Editing portlet details
You can view and edit the details of any portlet that is listed in the Portlets list.
To view and edit portlet properties:
The changes that you make are saved and take effect immediately. However, sometimes a workspace must be refreshed for the change to visible in the application.
Using context variables in portlet URLs
Context variables can be added to portlet URLs.
You may want the web address of a portlet to contain context information that is passed to the workspace when it opens. Using context variables in URLs can automate and streamline tasks. For example, if a portlet displays a map from an external website, you can include a contact's address as part of the URL query. This allows the map to immediately focus on the contact's location without manual entry. Context variables can be included in URLs using context parameters.
Use the following syntax to place context variables in URLs: ${ContextVar}
The following is an example of a portlet URL with context parameters:
- TEXT
<://example.portlet.com/portletname.html>?<PortletVar1>=${<ContextVar1>}&<PortletVar2>=${<ContextVar2>}&<PortletVar3>=${<ContextVar3>}
where:
<https://example.portlet.com/portletname.html>
is the full URL to the portlet. This is the same URL that is entered in the Enterprise Component Registry.<PortletVar1>
,<PortletVar2>
, and<PortletVar3>
are the variables that the portlet requires values for.<ContextVar1>
,<ContextVar2>
, and<ContextVar3>
are the context variables whose values you want to include in the portlet URL.
Info
Context variables in a portlet URL must be defined in the portlet's context attribute using NexJ Studio or the NexJ Admin Console to function properly.
You can use as many context variables as you want. You can use multiple context variables to create longer values. For example:
- https://example.portlet.com/portletname.html?PortletVar1=${<ContextVar1>}+${<ContextVar2>}
When the URL is resolved, the ${<ContextVar>} strings are replaced with the value of the context variable. For example, if you have a workspace definition that includes a portlet with the following URL attribute:
/TestPlaceHolder.html?ContactId=${EntityId}
If the EntityId context variable has been set to 1234, when the workspace loads the portlet will resolve the parameter within the query string resulting in the following URL being accessed:
/TestPlaceHolder.html?ContactId=1234
The URL is recalculated every time the workspace loads the portlet.
If none of the context variables used in the URL are listed in the portlet's context attribute, the system will automatically append the context variables and query parameters to the portlet URL on initial load. Otherwise, only the context variables listed in the portlet's context attribute will be present; including variables in the URL that are not subscribed to will result in an error.
Context values passed this way are intended only for use during the initial loading of a portlet. If a portlet should listen to the context bus for changes in variables, you should design it to make use of the portal APIs.
Configuring context variables in portlet URLs
Insert context variables in a portlet URL using portal administration tools.
Info
Only users with administrative privileges can access the Portal Tools menu.
To modify a portlet URL:
Your changes to the portlet URL have been saved.