Scheme API reference for NexJ CRM portal containers
The following Scheme APIs are available for use in NexJ CRM portal containers.
They are only accessible to developers building portlets in NexJ Studio
add-to-batch-requests
Adds a node to a list of ActiveNodes to query within one request.
add-to-batch-requests parameters
Parameter | Value | Description |
---|---|---|
controller | any | The controller which contains the node. |
node | any | The ActiveNode to query. |
event | string | The name of the event. Valid names are restricted to query or refresh. |
Syntax
(add-to-batch-requests controller node event)
Example
(add-to-batch-requests this (@ view activeNode) "refresh")
(add-to-batch-requests this (@ view activeNode) "query")
context-form-source
Sets up a form to set the context to the OID of the current active instance whenever it changes.
context-form-source parameters
Parameter | Value | Description |
---|---|---|
view | view | The view. |
var | string | The context variable name. |
form | string | The form name. |
Syntax
(context-form-source view var form)
Example
(context-form-source (this'view) "EntityId" "EntityList")
context-form-target
Sets up a form to listen to changes of a specific context variable.
context-form-target parameters
Parameter | Value | Description |
---|---|---|
view | view | The view. |
var | string | The context variable name. |
form | string | The form name. |
association | string | The association between the context variable and the form or a WHERE clause, in the following format (: association <value> ) or (: whereFunc <value> ). |
Syntax
(context-form-target view var form association)
Example
(context-form-target (this'view) "EntityId" "EntityList" '(@@ Entity entityParticipations act))
context-get
Gets the current value of a given context variable. The signature must not change as the framework invokes the function.
context-get parameters
Parameter | Value | Description |
---|---|---|
view | view | The view. |
var | string | The context variable name. |
Returns
The context variable value.
Syntax
(context-get view var)
Example
(context-get (this'view) "Contact")
context-set
Sets context variable value. The signature must not change as the framework invokes the function.
Parameter | Value | Description |
---|---|---|
view | view | The view. |
newValues | list | The list of pairs containing <variable, value> for each context variable to be set. |
Syntax
(context-set view . newValues)
Example
(context-set (this'view) (cons "Contact" (inst'contactId)) (cons
"Account" (inst'accountId)))
event-broadcast
Broadcasts an event so that sibling portlets and other portal container display groups are also notified of the event. The portlets will only receive the event if they are subscribed to an event with the same name.
event-broadcast parameters
Parameter | Value | Description |
---|---|---|
name | string | The name of the event. |
parameter | any | The parameter of the event. |
view | view | The source view of the event. |
Syntax
(event-broadcast name parameter view)
Example
(event-broadcast "notifyAll" (message (:state "ready)) (this'view))
event-fire
Fires an event to the application broker portlet and the portal container.
event-fire parameters
Parameter | Value | Description |
---|---|---|
name | string | The name of the event. |
parameter | any | The parameter of the event. |
view | view | The source view of the event. |
Syntax
(event-fire name parameter view)
Example
(event-fire "notifyAll" (message (:state "ready)) (this'view))
get-global-property
Gets the current value of a global property in the application.
get-global-property parameters
Parameter | Value | Description |
---|---|---|
controller | controller | The current controller for the screen or form. |
propName | string | The name of the property. |
Returns
The global property value.
Syntax
(get-global-property controller propName)
Example
(get-global-property this "CurrentContact")
navigate
Navigate to an existing workspace that contains the portlet specified by the view path with the option to pass context and event information.
navigate parameters
Parameter | Value | Description |
---|---|---|
controller | controller | The controller for the portlet view. |
viewPath | list | The view path to the target view as a list. The head of the view path is the name of the workspace. The tail of the view path is the name of the portlet reference. For example, (workspace1 portlet1) or (Person refEntityDetailPortlet). |
context | list | List of context value pairs to set in the target workspace. |
event | UIEvent | A UIEvent instance to fire on the target view. |
fallbackViewPaths | list | A list of view paths to try in the order they are specified if the target view cannot be found. |
Syntax
(navigate controller viewPath context event . fallbackViewPaths)
Example
(navigate this '(DockedEntity) (list (cons "EntityId" entityId)) () '(Person EntityNavigatorPortlet))
(navigate this '(Schedule TaskPortlet) () (UIEvent'new "sysRefresh" () (this'view))
portal-beacon-set-caption
Sets the displayed caption of a notification beacon, which appears on the portal container toolbar.
portal-beacon-set-caption parameters
Parameter | Value | Description |
---|---|---|
controller | controller | The current controller. |
sId | string | The ID of the beacon. |
caption | string | The new caption to set. |
Syntax
(portal-beacon-set-caption controller sId sCaption)
Example
(portal-beacon-set-caption this "inbox" (number->string count))
portal-beacon-set-icon
Sets the displayed icon of a notification beacon, which appears on the portal container toolbar.
portal-beacon-set-icon parameters
Parameter | Value | Description |
---|---|---|
portletView | view | The current portlet view. |
id | string | The ID of the beacon. |
icon | string | The URL of the icon to display. If prependBaseURL is false, then the URL must be absolute. |
prependBaseURL | boolean | Indicates whether to prepend the icon URL with the calling portlet's group base URL. Values are #t and #f . If this parameter is not set to #t , the icon URL is expected to be an absolute URL. |
Syntax
(portal-beacon-set-icon portletView id icon prependBaseURL)
Example
(portal-beacon-set-icon (this'view) "inbox" "/icons/16/note.png" #t)
portal-beacon-set-remote-method
Sets the SOA method to invoke when the specified notification beacon should update its value.
portal-beacon-set-remote-method parameters
Parameter | Value | Description |
---|---|---|
controller | controller | The current controller. |
sid | string | The ID of the beacon. |
sRemoteMethod | string | The name of the SOA method. |
Syntax
(portal-beacon-set-remote-method controller sId sRemoteMethod)
Example
(portal-beacon-set-remote-method this "inbox" "getInboxCount")
portal-beacon-set-visibility
Sets the visibility of a beacon.
portal-beacon-set-visibility parameters
Parameter | Value | Description |
---|---|---|
controller | controller | The current controller. |
sid | string | The ID of the beacon. |
bVisible | boolean | The new state of visibility for the beacon. |
Syntax
(portal-beacon-set-visibility controller sId bVisible)
Example
(portal-beacon-set-visibility this "inbox" #t)
portal-toast-add-messages
Adds toast messages to the notification queue. Each message will be displayed sequentially.
portal-toast-add-messages parameters
Parameter | Value | Description |
---|---|---|
portletView | view | The current portlet view. |
prependBaseURL | boolean | Indicates whether to prepend each message icon URL with the calling portlet's group base URL. Values are #t and #f. If the value is #f, the message icon URL is expected to be an absolute URL. |
messageList | list | A list of toast messages. Each item is a message with the following parameters: |
<msg>'icon | string | The icon URL. (Optional) |
<msg>'text | string | The HTML markup to display in the toast message. |
<msg>'event | string | The name of the event to fire when the user clicks on toast message. (Optional) |
<msg>'params | any | The parameters associated with the event when the user clicks on toast message. (Optional) |
Syntax
(portal-toast-add-messages portletView prependBaseURL . messageList)
Example
(portal-toast-add-messages (this'view) #f msg)
portal-toast-set-enabled
Enables or disables the toast control.
portal-toast-set-enabled parameters
Parameter | Value | Description |
---|---|---|
controller | controller | The current controller. |
enabled | boolean | Indicates whether to enable the toast control. Values are #t and #f . |
Syntax
(portal-toast-set-enabled controller enabled)
Example
(portal-toast-set-enabled this #t)
portal-set-sidebar-visibility
Sets sidebar visibility.
portal-set-sidebar-visibility parameters
Parameter | Value | Description |
---|---|---|
controller | ScriptedController | The current controller. |
sSide | string | The position of the sidebar. Options are: LEFT or RIGHT. |
bVisible | boolean | Indicates whether this sidebar should be visible. Values are #t and #f. |
sPortletRefName | string | The name of the portlet reference. The portlet must also be referenced in the sidebar that belongs to this side of the screen. Optional if only only one portlet is defined for that screen side. |
Syntax
(portal-set-sidebar-visibility controller sSide bvisible sPortletRefName)
Example
(portal-set-sidebar-visibility this "RIGHT" #t "conversationUserInboxPortlet")
set-global-property
Sets a global property in the application.
set-global-property parameters
Parameter | Value | Description |
---|---|---|
controller | controller | The current controller for the screen or form. |
propName | string | The name of the property. |
value | any | The value to be set. The value should be something that can be serialized. |
Syntax
(set-global-property controller propName value)
Example
(set-global-property this "CurrentContact"
(unless (null? contact)
(message (: :oid (contact':oid)) (: :class (contact':class)))
)
)
workspace-close
Closes the workspace in which the portlet resides.
workspace-close parameters
Parameter | Value | Description |
---|---|---|
portletView | view | The view of the portlet. |
Syntax
(workspace-close portletView)
Example
(workspace-close (this'view))
workspace-get-portlet-alias
Obtains a unique identifier for the calling portlet. The portlet alias can be used to differentiate instances of the same portlet within a workspace.
workspace-get-portlet-alias parameters
Parameter | Value | Description |
---|---|---|
portletView | view | The view of the portlet. |
Returns
The portlet alias string. Null if the portletView is invalid.
Syntax
(workspace-get-portlet-alias portletView)
Example
(workspace-get-portlet-alias portletView)
workspace-is-docked
Determines if the workspace in which the portlet resides is a docked workspace.
workspace-is-docked parameters
Parameter | Value | Description |
---|---|---|
portletView | view | The portlet view corresponding to the portlet for which to check. |
Returns
#t
if portlet is currently in a docked workspace; #f
otherwise.
Syntax
(workspace-is-docked portletView)
Example
(workspace-is-docked (this'view))
workspace-open
Opens a workspace or switches to a workspace if one matching the parameters is already open.
Opening a workspace has different behavior depending on which parameters are set. In all cases when searching for an opened workspace that matches the given parameters, if multiple workspaces matches the specified conditions, the workspace with the lowest ordinal number will open. Similarly, when opening a new workspace, the workspace template with the lowest ordinal that matches the specified conditions is used.
- workspaceTemplate, var, context
If all of these values are provided, then the current set of open workspaces is searched for an exact match of the three parameters. If a match is found, then it becomes the active workspace. If no match is found, then the portal framework will look for a workspace template configured with a workspace template name, context variable and open that workspace using the specified context value. - var, context
If these two values are provided, then the current set of open workspaces is searched for any dynamic workspace that matches the context variable and value. If a match is found, then it becomes the active workspace. If no match is found, then the portal framework will look for a workspace template configured with a matching context variable and open that workspace using the specified context value. - workspaceTemplate
If only the template name is provided, then the current set of open workspaces is searched for a workspace based on the specified template. If a match is found, then it becomes the active workspace. If no match is found, the system opens a new workspace making use of the template.
workspace-open parameters
Parameter | Value | Description |
---|---|---|
controller | controller | The current controller for the workspace. |
workspaceTemplate | string | The name of the workspace template to locate. |
caption | string | The caption of the workspace layout. |
icon | string | The URL of the workspace icon. |
var | string | The context variable name. |
context | string | The context variable value. |
wkspContext | list | A context map for initializing the workspace. |
args | list | A list of additional argument pairs. To open a specific workspace, you can specify its OID, in the following format: To persist client state for the docked workspace upon closing the workspace, specify |
Syntax
(workspace-open controller workspaceTemplate caption icon var context wkspContext . args)
Example
(workspace-open this (model'name) () (model'icon) '() '() '() (: workspace (model':oid)))
workspace-open-app-perspective
Opens an application perspective.
workspace-open-app-perspective parameters
Parameter | Value | Description |
---|---|---|
screenView | view | The current portlet view, or workspace view. |
portletLayoutRefName | string | The name of the portlet layout reference which will hold the application perspective layout. |
workspaceTemplate | string | The name of the workspace template to locate, to provide the layout definition. |
caption | string | The caption of application perspective layout. |
icon | string | The URL of the application perspective icon. |
configs | list | Transfer objects representing application configuration data (application configuration ID, caption, and icon) (Optional) |
Syntax
(workspace-open-app-perspective screenView portletLayoutRefName
workspaceTemplate caption icon . configs)
Example
(workspace-open-app-perspective(this'view) "appHolder" "ScheduleApplication" "AppHolder Caption" "./icons/16/appHolderIcon.png" ())
workspace-set-caption
Sets the caption of the workspace that the specified portlet view resides in.
workspace-set-caption parameters
Parameter | Value | Description |
---|---|---|
portletView | view | The view of the portlet. |
caption | string | The caption string to set. |
Syntax
(workspace-set-caption portletView caption)
Example
(workspace-set-caption (this'view) "Accounts")