When configuring page components, you can express values as variables that take advantage of the current application context by grabbing information that happens to be true at the moment. For example, you can use variables to obtain the name of the current user, the user's assigned role, the state of the current page, and the like.
Such flexibility is made possible through the Expression Builder, a simple Expression Language (EL) editor that you can use to build EL expressions.
This appendix provides information about the Expression Builder and useful EL expressions. It includes the following subsections:
See Also:
For additional information about EL APIs, see Oracle Fusion Middleware Java API Reference for Oracle WebCenter.
All properties on the Parameters and Display Options tabs provide an Expression Builder icon that opens a simple Expression Language (EL) editor, called the Expression Builder. Use the Expression Builder when you want to formulate a dynamic computation for an otherwise unknown property value, for example, to specify the current user, the current page mode, and the like.
Click the Expression Builder icon next to a property to open the editor. (Figure B-1).
Figure B-1 Expression Builder Icon Next to a Parameter Value Field and the Resulting Editor
See Also:
For information about accessing component properties, see Section 18.6, "Modifying Page Components."
The Expression Builder is particularly useful when you want a value that is retrievable but otherwise unknown, for example, when you want a value to be the name of the current user or the current application skin.
The Expression Builder provides two options for entering expressions:
Choose a value, for selecting a seeded EL expression
Type a value or expression, for entering an expression manually
The options under Choose a value are categorized according to the type of information an expression returns. Select a category from the first menu, and then select the type of value you want returned from the second menu (Figure B-2).
Figure B-2 Options Under Choose a value in the Expression Builder
See Also:
For information about seeded EL expressions, see Section B.4.1, "Seeded Expressions in the Expression Builder."
The option Type a value or expression is followed by a text box, which you can use to manually enter the expression you intend (Figure B-3).
Figure B-3 Text Box Under Type a value or expression in the Expression Builder
Many expressions in the tables in this appendix are building blocks for narrowing down the object or objects you want returned. That is, they are not necessarily meant to be used by themselves, but rather in an assembly of ELs to form the desired query.
For example, the following expression uses three resource-related ELs to form a single query that returns a particular space template. It retrieves the template storesMasterTemplate
from the parent space stores
:
#{srmContext.resourceScope['stores'].resourceType['siteTemplate'].displayName['storesMasterTemplate'].singleResult}
In the Expression Builder, select predefined values, under Choose a value, or enter a value or an Expression Language expression, under Type a value or expression.
Use the following formats to enter values:
a literal number: #{123}
a literal string: #{'string'}
a literal Boolean: #{true}
a Java Bean called to return a value: #{generalSettings.preferredTimeStyle}
The editor provides a Test button for validating your EL entry. The Test button is available for expressions entered in the text box under Type a value or expression.
Validation checks the EL syntax and evaluates the expression. Because expression values vary according to the context in which they are executed, the resulting value that appears in the editor may differ from the value returned during actual use.
Note, however, that only EL is validated when you click Test; other types of values are not validated.
Test results are shown in a popup (Figure B-4).
Note:
Wherever you enter EL on the generic Display Options tab in the Component Properties dialog, the entry is automatically validated. If the EL syntax is invalid, an error appears and the value is neither applied nor saved. Generic Display Options are those cataloged in Table 18-1.
EL validation is not performed on non-generic display options.
This section provides an example of using EL expressions to display something based on a user's role, permissions, and the like.
In this example, we will use Expression Language to reveal or hide an item in the navigation model based on the user's role. Because there is Expression Language for almost every piece of metadata maintained by Spaces, using ELs to personalize the user's experience is an extremely powerful tool.
You can use the following EL to determine a user's role:
#{WCSecurityContext.userInScopedRole['Role 1'] or WCSecurityContext.userInScopedRole['Role 2']}
This EL compares the current user's credentials (in this case, the role), against what is specified in the EL. If the result is true
, that is, if the user is assigned one of the specified roles then the navigation item is visible to the user. If the result is false
, the navigation item is hidden from the user.
The roles referred to in the EL can be a system role, such as Administrator
, Moderator
, Participant
, or a custom role.
Notice that this EL joins two conditions with the use of an OR
clause; that is, the user must have either Role 1 OR Role 2 to be able to see the navigational item.
These steps demonstrate how to add a navigational item (a page query for another space) that is visible only to user assigned the role Moderator
.
Note:
This exercise assumes you have applied a custom navigation model to your space. You cannot edit a seeded navigation model.
To personalize navigation:
Go to space Settings, and access the Navigations panel under Resources.
You can use the following URL to navigate to the Resources subpage, from there, click Navigations:
http://host:port/webcenter/spaces/spaceName/admin/resources
Select the navigation model that the space is using.
Tip:
To find out which navigation model the current space is using, go to the General subpage under space Settings, and look for the value in the Navigation field.
From the Edit menu, select Edit.
In the Edit - navigation model dialog, expand the Add menu, and select Pages Query.
Bring the Target tab forward:
In the Name field, enter a name for your query, for example, moderatorQuery
.
Next to Find Page in, select Space, and ensure that the current space name appears in the field.
Click the icon to the right of the Visible check box, and select Expression Builder.
Select Choose a value, and then select Space Info from the first dropdown and CurrentSpace Role - Moderator from the second.
The expression #{WCSecurityContext.userInScopedRole['Moderator']}
appears in the text field.
Tip:
If you are working with a custom role, select CurrentSpace Role - Custom. In the text area, highlight CustomRole
, then type in the name of your custom role.
Click OK until you return to the Resources tab.
To test this, add a member to the space, and assign this user any role other than Moderator
. Log off and log back in as that user. You should not see the Pages Query navigational item.
If you have introduced an EL expression for querying spaces based on a JPQL WHERE
clause, you should know that the freeform JPQL WHERE
clause is desupported. Instead, use a structured WHERE
clause. Freeform SORT
clauses are also desupported. Instead, specify sort criteria on a space query in a structured way.
For example, imagine that you have used the following syntax to form a WHERE
clause on a space query:
#{spaceContext.spacesQuery.unionOf['ALL_QUERIABLE'].whereClause['sp.keywords like \'forquery%\' and not (sp.discoverable is null or sp.discoverable = \'N\')'].listSpaces}
Going forward, you must use the following syntax to form a WHERE
clause:
#{spaceContext.spacesQuery.unionOf['ALL_QUERIABLE'].where[wCond['sp.keywords']['like']['forquery']['and'][wCond['sp.discoverable'] ['is']['null']['or'][wCond['sp.discoverable']['=']['N']]['not']]].listSpaces}
Where:
wCond
is an atomic condition that can be expressed as wCond[
p
][
op
][
v
]
.
Where:
p
is a space attribute (a field in WcSpaceHeader
, see the following bullet list).
op
is one among a restricted set of JPQL comparison operators ('=
', 'like
', '!=
', '<
', '>
', '<=
', '>=
', 'is
').
v
is a string whose interpretation depends on the operator op
.
If the operator is is
, v
can be the string 'null'
or 'not null'
, and the condition is understood as the attribute being checked for null or not null respectively in JPQL. If the operator is anything else, v
is interpreted as a literal, and the condition is understood to be the attribute being compared with the literal value.
You can use any field defined in WcSpaceHeader
in the WHERE
clause, including:
closed
createDate
createdBy
description
discoverable
displayName
keywords
icon
logo
lastUpdateDate
selfSubEnabled
rssEnabled
spaceGuid
spaceId
spaceOffline
spacePublic
spacesType
spacesUser
updatedBy
version
parentGuid
securityParentGuid
ancestorPath
seeded
groupSpaceMemCount
sp
represents the JPA entity for a space, WcSpaceHeader
.
For example, you can use the following condition to create a filter for all spaces created by users having user names starting with monty
on which self subscription is enabled:
sp.createdBy like 'monty%' and not (sp.selfSubEnabled is null or sp.selfSubEnabled = 'N')
and
, or
, not
(along with wCond
) are types of conditions.
Where:
and
represents a conjunction of two conditions. You can express a conjunction condition as cond1
['and'][
cond2
]
where cond1
and cond2
are the expressions for the two conditions being conjoined.
or
represents a disjunction condition. You can express a disjunction condition as cond1
['or'][
cond2
]
where cond1
and cond2
are the expressions for the two conditions being disjoined.
not
represents a negation condition. You can express a negation condition as cond
['not']
where cond
is the expression for the condition being conjoined.
For example, the following EL returns a list of all spaces (to which the current user has access) that are created by users having names starting with monty
and on which self subscription is enabled:
#{spaceContext.spacesQuery.unionOf.ALL_QUERIABLE.where[wCond['sp.createdBy'] ['like']['monty%'] ['and'] [wCond['sp.selfSubEnabled']['is']['null'] ['or'] [wCond['sp.selfSubEnabled']['=']['N']] ['not'] ] ].listSpaces}
Now imagine that you have used the following syntax to specify SORT
criteria on a space query:
#{spaceContext.spacesQuery.unionOf['ALL_QUERIABLE'].sortCriteria ['sp.discoverabledesc, sp.keywords'].listSpaces}
Going forward, you must use the following syntax to specify SORT
criteria on a space query:
#{spaceContext.spacesQuery.unionOf['ALL_QUERIABLE'].sort['sp.discoverable'] ['desc'].sort['sp.keywords']['asc'].listSpaces}
Where:
sp
represents the JPA entity for a space, WcSpaceHeader
(see previous bullet list for fields defined in WcSpaceHeader
).
desc
and asc
define sort order, descending and ascending, respectively.
For example, the following query returns a list of spaces to which the user has access and sorts the result set on the fields discoverable
and lastUpdateDate
.
#{spaceContext.spacesQuery.unionOf['ALL_QUERIABLE'].sort['sp.discoverable'] ['asc'].sort['sp.lastUpdateDate']['desc'].listSpaces}
Oracle strongly recommends that you convert all existing freeform JPQL WHERE
and SORT
clauses to the new syntax.
If for any reason you must retain the existing syntax, your Spaces administrator must explicitly enable support for freeform JPQL in the webcenter-config.xml.xml
file by setting the following global flag:
oracle.webcenter.spaces.query.DIRECT_JPQL_CLAUSE_SUPPORTED
Note:
The webcenter-config.xml.xml
file is the customization document for webcenter-config.xml
.
Set this flag to true
for continued support of legacy freeform WHERE
and SORT
clauses. When this option is set to true
, Spaces log files will contain warnings.
To set this flag in webcenter-config.xml.xml
:
Export the latest webcenter-config.xml.xml
from MDS.
For example:
exportMetadata(application='webcenter', server='WC_Spaces', toLocation='/tmp/mydata',docs='/oracle/webcenter/webcenterapp/metadata/mdssys/cust/site/webcenter/webcenter-config.xml.xml')
Open the file in a text editor and modify settings, as required.
For example:
<mds:insert parent="webcenter(xmlns(webcenter=http:// xmlns.oracle.com/webcenter/webcenterapp))/webcenter:custom-attributes" position="last"> <attribute name= "oracle.webcenter.spaces.query.DIRECT_JPQL_CLAUSE_SUPPORTED" xmlns="http://xmlns.oracle.com/webcenter/webcenterapp"> <description/> <type>java.lang.String</type> <value>true</value> <visible/> </attribute> </mds:insert>
Save and close webcenter-config.xml.xml
.
Import the updated webcenter-config.xml.xml
file to Spaces.
For example:
importMetadata(application='webcenter', server='WC_Spaces', fromLocation='/tmp/mydata', docs='/oracle/webcenter/webcenterapp/metadata/mdssys/cust/site/webcenter/webcenter-config.xml.xml')
This section provides a series of tables that list and describe useful EL expressions. Tables are grouped according to the context in which the expressions they contain apply.
This section includes the following subsections:
Section B.4.1, "Seeded Expressions in the Expression Builder"
Section B.4.2, "EL Expressions Relevant to the Spaces Application"
Section B.4.3, "EL Expressions Relevant to Application Security"
Section B.4.4, "EL Expressions Relevant to Application Navigation"
Section B.4.11, "EL Expressions Relevant to the Personalization Conductor"
Section B.4.12, "EL Expressions Relevant to the Documents Service"
Section B.4.13, "EL Expressions Relevant to the People Connections Service"
Section B.4.14, "EL Expressions Relevant to User Preferences"
In the Expression Builder editor, when you select the option Choose a value you can populate the text box in the dialog with a seeded EL expression. First, select an expression category, and then select the type of information you want the expression to return. Your selection's associated EL appears in the text box at the bottom of the dialog (Figure B-5).
Figure B-5 Options Under Choose a value in the Expression Builder
This section is broken into subsections for each category. Each subsection lists and describes the ELs associated with that category.
This section includes the following subsections:
Application Info seeded EL expressions return values related to the Spaces application. For example, the expression #{WCAppContext.application.applicationConfig.title}
, returns the application title that is specified on the Configuration page in the Spaces Administration pages.
See Also:
For additional EL expressions related to the application, see Section B.4.2, "EL Expressions Relevant to the Spaces Application."
Table B-1 lists the seeded EL expressions available under the category Application Info and provides an example of the types of values each returns.
Table B-1 Seeded EL Expressions Under Application Info
Option | Expression | Example of Returned Value |
---|---|---|
Current Scope |
|
|
Current Page Template Scope |
|
|
Previously Set Page Template |
|
|
Application |
|
|
Application URL |
|
|
Current WebCenter Portal URL |
|
|
Application Config |
|
|
Application Config Title |
|
|
Application Config Logo |
|
|
Application Config HelpPage |
|
|
Application Config CopyrightMessage CustomValue |
|
|
Application Config Privacy Policy URL |
|
|
Application Config Skin |
|
|
For example, consider that you want a link to appear in all pages of a space that lets you copy and share the current page's URL. You can add an HTML Markup item to a page template, and add the EL that returns page URL.
These steps demonstrate how to use ELs to retrieve page URLs:
Open a custom page template in Edit mode.
Click Add Content.
In Resource Catalog, click Web Development.
Click Add next to HTML Markup, then click Close.
Click the Edit icon for the newly added HTML Markup.
In the Component Properties dialog, on the Display Options tab, in the Value field, enter the following EL:
<a href="javascript:{ var returnvalue = prompt( '#{pageDocBean.title} URL','#{WCAppContext.applicationURL}/faces#{WCAppContext.currentWebCenterURI}'); }">Share Link</a>
Click OK.
Apply the page template to your space.
Page Info seeded EL expressions return values related to Spaces pages. For example, the expression #{pageDocBean.createdBy}
, returns the user name of the person who created the current page.
Table B-2 lists the seeded EL expressions available under the category Page Info and provides an example of the types of values each returns.
Table B-2 Seeded EL Expressions Under Page Info
Option | Expression | Example of Returned Value |
---|---|---|
Title |
|
|
Created By |
|
j.doe |
Create Date String |
|
|
Last Updated By |
|
|
Last Update Date String |
|
|
Page Path |
|
|
Name |
|
|
UI CSS Style |
|
|
UI Scheme BG Image |
|
|
UI Scheme BG Color String |
|
null |
Page Permission |
|
|
Page Security Target |
|
|
Page Parameter seeded EL expressions return values related to Spaces page parameters. The editor lists all parameters that are defined for the current page. If no parameters are defined, the Page Parameter category is not available.
For example, the seeded page style Three Column provides five seeded page parameters (see Table B-3). The width
parameters describe the percentage of total width allotted to each column. The show
parameters specify whether a page header and footer are rendered. Of the seeded page styles, Blank, Home Page, Left Narrow, and Right Narrow all provide the same seeded page parameters (see Table B-3). Additionally, any page may have its own custom page parameters.
Whether seeded or custom, available page parameters are exposed in the Expression Builder editor under the Page Parameter category.
See Also:
For more information about creating and using page parameters, see Section 22.3, "Wiring Components and Page Parameters."
Table B-3 lists the EL expressions available under the Page Parameter category for pages based on the styles Three Column, Blank, Home Page, Left Narrow, and Right Narrow. It provides an example of the types of values each returns.
Resource Info seeded EL expressions return values related to Spaces resources, such as templates, styles, Resource Catalogs, and the like. For example, the expression #{srmContext.id['
ResourceID
'].singleResult}
, returns the resource with the specified GUID.
See Also:
For additional resource-related EL expressions, see Section B.4.5, "EL Expressions Relevant to Resources."
Table B-4 lists the seeded EL expressions available under the category Resource Info and provides an example of the types of values each returns.
Table B-4 Seeded EL Expressions Under Resource Info
Option | Expression | Example of Returned Value |
---|---|---|
|
|
|
Display Name |
|
See Resource ID for an example of a returned value. |
Description |
|
See Resource ID for an example of a returned value. |
Creation Date |
|
See Resource ID for an example of a returned value. |
Modified By |
|
See Resource ID for an example of a returned value. |
Modified Date |
|
See Resource ID for an example of a returned value. |
Resource Scope |
|
See Resource ID for an example of a returned value. |
Space Info seeded EL expressions return values related to spaces (other than the Home space). For example, the expression #{spaceContext.space['
spaceName
'].children}
, returns a list of the subspaces under the named parent space.
See Also:
For additional space-related EL expressions, see Section B.4.6, "EL Expressions Relevant to Specific Spaces."
Table B-5 lists the seeded EL expressions available under the category Space Info and provides an example of the types of values each returns.
Note:
Use the EL expressions listed in Table B-5 only in the context of spaces other than the Home space.
Table B-5 Seeded EL Expressions Under Space Info
Option | Expression | Example of Returned Value |
---|---|---|
NamedSpace |
|
|
CurrentSpace |
|
|
CurrentSpace Name |
|
|
NamedSpace Metadata Path |
|
|
CurrentSpace Metadata Path |
|
|
NamedSpace Metadata |
|
|
CurrentSpace Metadata |
|
|
NamedSpace Metadata DisplayName |
|
|
CurrentSpace Metadata DisplayName |
|
|
NamedSpace Metadata Icon |
|
|
CurrentSpace Metadata Icon |
|
|
NamedSpace Metadata Description |
|
|
CurrentSpace Metadata Description |
|
|
NamedSpace Metadata CreationDate |
|
|
CurrentSpace Metadata CreationDate |
#{spaceContext.currentSpace.metadata.creationDate} |
|
NamedSpace Metadata CreatedBy |
|
|
NamedSpace Metadata Keywords |
|
|
CurrentSpace Metadata Keywords |
|
|
NamedSpace Metadata Offline |
|
|
CurrentSpace Metadata Offline |
|
|
NamedSpace Metadata Closed |
|
|
CurrentSpace Metadata Closed |
|
|
NamedSpace Metadata SelfRegistration |
|
|
CurrentSpace Metadata SelfRegistration |
|
|
NamedSpace Metadata Discoverable |
|
|
CurrentSpace Metadata Discoverable |
|
|
NamedSpace Metadata PublishRSS |
|
|
CurrentSpace Metadata PublishRSS |
|
|
NamedSpace Distribution List |
|
|
CurrentSpace Distribution List |
|
|
NamedSpace Metadata CustomAttributes |
|
Returns the value provided for the named custom attribute |
CurrentSpace Metadata CustomAttributes |
|
Returns the value provided for the named custom attribute |
CurrentSpace Metadata Logo |
|
|
CurrentSpace Role - Moderator |
|
|
CurrentSpace Role - Participant |
|
|
CurrentSpace Role - Viewer |
|
|
CurrentSpace Role - Custom |
|
|
NamedSpace Children |
|
Note: The braces ([]) denote a set. |
CurrentSpace Children |
|
Note: The braces ([]) denote a set. |
NamedSpace Parent |
|
|
CurrentSpace Parent |
|
|
NamedSpace Security Parent |
|
|
CurrentSpace Security Parent |
|
|
All visible root level spaces |
|
|
All children and descendent spaces for specified Parent Space GUID |
|
|
Immediate Sub Spaces for specified Parent Space name |
|
|
List of Spaces matching given Space Names |
|
|
List of Spaces matching given Space GUID |
|
|
List of Spaces sorted based on criteria |
|
|
List of Spaces based on search pattern |
|
|
List of Spaces with limited page size |
|
|
List of Spaces matching the where clause |
|
|
Rather than EL expressions, the selections under Space Page Info are directory paths to different application pages. Use them, for example, to provide navigation information to a specified page.
Table B-6 lists the seeded directory paths available under the category Space Page Info and provides an example of the types of values each returns. The number of values in the dropdown list depends on the template used and the pages created by users.
Table B-6 Seeded Paths Under Space Page Info
Option | Path | Destination |
---|---|---|
COIHome.jspx |
|
Path to the Home page of the current space |
GroupSpaceDocLibMainView.jspx |
|
Path to the Documents page in the current space |
ForumMainView.jspx |
|
Path to Discussions page in the current space |
AnnouncementsMainView.jspx |
|
Path to Announcements page in current space |
EventsMainView.jspx |
|
Path to Events page in current space |
ListsMainView.jspx |
|
Path to Lists page in current space |
GroupSpaceActivityMainView.jspx |
|
Path to Activity Stream page in current space |
System seeded EL expressions return values related to system settings, such as the user name of the current user or the current user's specified locale. For example, the expression #{securityContext.userName}
, returns the name of the currently logged in user. For example, if user j.doe is viewing a page where this expression is used, the returned value in j.doe's view is j.doe
. If user j.smith is looking at the same page, the value returned in j.smith's view is j.smith
.
See Also:
For additional utilitarian EL expressions, see Section B.4.15, "Utilitarian EL Expressions."
Table B-7 lists the seeded EL expressions available under the category System and provides an example of the types of values each returns.
Table B-7 Seeded EL Expressions Under System
Option | Expression | Example of Returned Value |
---|---|---|
User |
|
The current user's user name |
Locale |
|
The current user's specified locale This may be taken from application or space-level settings or user Preferences, whichever is taking precedence. For example: en_US |
User Info seeded EL expressions return values related to a given user's Profile. For example, the expression #{webCenterProfile[securityContext.userName].description}
, returns the content of the About Me attribute of the current user's Profile.
See Also:
For additional user-related expressions, see Section B.4.13, "EL Expressions Relevant to the People Connections Service."
Table B-8 lists the seeded EL expressions available under the category User Info and provides an example of the types of values each returns.
Table B-8 Seeded EL Expressions Under User Info
Option | Expression | Example of Returned Value |
---|---|---|
About Me |
|
Returns the content of the About Me attribute of the current user's Profile |
Username |
|
The user name specified in the current user's Profile Compare this with the current user's display name. |
First Name |
|
The current user's first name |
Middle Name |
|
The current user's middle name |
Last Name |
|
The current user's last name |
Initials used |
|
The current user's initials |
Display Name |
|
The current user's display name Compare this with the current user's user name. |
|
|
The current user's business email address |
Department |
|
The current user's department |
Job Title/Designation |
|
The current user's job title or designation |
Manager |
|
The current user's manager's display name |
Time zone |
|
The time zone associated with the current user |
Employee type |
|
The current user's employee type |
Employee Number |
|
The current user's employee number |
Preferred Language Code |
|
The current user's preferred language |
Organization |
|
The company organization to which the current user belongs |
Organizational Unit |
|
The unit of the company organization to which the current user belongs |
Expertise |
|
The current user's expertise, for example, |
Business Fax |
|
The current user's business fax number |
Business Mobile Number |
|
The current user's business mobile or cell phone number |
Business Phone |
|
The current user's business phone number |
Business Pager Number |
|
The current user's business pager number |
Business Street |
|
The street address of the current user's business office |
Business City |
|
The city where the current user's business office is located |
Business State |
|
The state where the current user's business office is located |
Business PO Box |
|
The current user's business Post Office Box number |
Business Postal Code |
|
The postal or ZIP code of the current user's business office |
Business Country |
|
The country where the current user's business office is located |
Home Address |
|
The current user's home address |
Home phone |
|
The current user's home phone number |
Date of Birth |
|
The current user's date of birth |
Maiden Name |
|
The current user's maiden name |
Date of hire |
|
The date the current user was hired by the company |
Name Suffix |
|
Titles or credentials appended to the current user's name, for example, |
Wireless Account Number |
|
The account number for the current user's wireless internet account |
WebCenter Events seeded EL expressions return values related to document-related events, such as the name of the selected document, the document's creator, the date the document was last modified, and so on. For example, the expression #{wcEventContext.events.WebCenterResourceSelected.name}
, returns the name of the currently selected document.
Table B-9 lists the seeded EL expressions available under the category WebCenter Events and provides an example of the types of values each returns.
Table B-9 Seeded EL Expressions Under WebCenter Events
Option | Expression | Example of Returned Value |
---|---|---|
Selected User Name |
|
The user name of the currently selected user |
Selected Document Name |
|
The name of the currently selected document |
Selected Document Creator |
|
The name of the user who created the currently selected document |
Selected Document Last Modified By |
|
The date the selected document was last modified |
Table B-10 lists EL expressions relevant to the Spaces application information and describes the types of functionality it provides. The Context column indicates whether the expression can be used in Spaces context (WCS) or in both Spaces and Framework applications built with Oracle JDeveloper (Both).
Table B-10 EL Expressions Relevant to Spaces Application
Expression | Function | Context |
---|---|---|
|
An oracle.webcenter.webcenterapp.context.WCApplicationContext object that provides an access point in the current web request for all Oracle WebCenter Portal application-related information. |
WCS |
|
Returns a URL representing the current web request with bookmarkable Spaces URL parameters of the request appended to the end (parameters are not necessarily in a fixed order). Example: http://www.example.com/webcenter/faces/oracle/webcenter/page/scopedMD/someguid/SomePage.jspx?wc.contextURL=/spaces/somename&wc.pageScope=1234 |
WCS |
|
An oracle.webcenter.webcenterapp.beans.WebCenterType bean with a payload of metadata from the current Spaces application. |
WCS |
|
Returns the display name of the current Spaces application (as configured through Spaces Administration settings). Out of the box, this returns WebCenter Portal. |
WCS |
|
If an application logo was uploaded through Spaces Administration settings, this expression returns the URL to the application logo image. Out of the box, this returns null. |
WCS |
|
Returns the URL to the Help application used for the current Spaces application (as configured through Spaces Administration settings). Out of the box, this returns /webcenterhelp/spaces. |
WCS |
|
If a copyright message was configured through Spaces Administration settings, this expression returns the application copyright message. Out of the box, this returns null. |
WCS |
|
Returns the URL to the document that contains the application's privacy policy (as configured through Spaces Administration settings). Out of the box, this returns http://www.oracle.com/html/privacy.html |
WCS |
|
Returns the name of the default ADF Faces skin family to use for rendering pages in the application (as configured through Spaces Administration settings). This expression represents only the application-level setting that may not necessarily be used in all web requests. For example, you cannot use it successfully if a user has chosen to override the skin through application Preferences (for more information, see Chapter 38, "Setting Your Personal Preferences"). |
WCS |
|
Returns the name of the ADF Faces skin family being used for the current web request, depending on factors such as what has been configured at the application level, the current user's preference setting, and so on. Returns the same value as |
Both |
Table B-11 lists EL expressions relevant to application security and describes the types of functionality it provides. The Context column indicates whether the expression can be used in the Spaces context (WCS) or in both the Spaces application and Framework applications built with Oracle JDeveloper (Both).
See Also:
For example implementations of expressions related to component-level security, see Section 26.2, "Setting Access on a Page Component."
Table B-11 EL Expressions Relevant to Security
Expression | Function | Context |
---|---|---|
|
Returns |
Both |
|
Returns the user name of the currently logged in user. If the current user is not logged in, this expression returns no value. |
Both |
|
Returns the value true if the current user is a moderator of the current space. |
WCS |
|
Returns the value true if the current user is assigned the specified role in the current scope. Role can be The scope is implicitly resolved to be the current scope. If you use this EL in the Home space, it resolves to Home space GUID and roles defined at the application level. If you use this EL in a space scope, it resolves to roles defined for the space. |
WCS |
|
Returns the value true if the current user is assigned the specified group, for example, |
Both |
|
Returns the value true if the current user is the specified user. |
Both |
This section provides an example of using EL expressions to display something based on a user's role. In the example, you will create a page style and edit its source code to add an EL expression that allow only users granted the AdvancedEdit
role to be able to access Source view of Composer in Home space.
To restrict access to Composer's Source view in Home space:
Log on to Spaces with administrative privileges, and navigate to the Security tab in Spaces Administration.
Create a new role called AdvancedEdit
, and assign it to the user, weblogic
. (For information, see Section 24.2, "Managing Application Roles and Permissions.")
The user weblogic
will now have two roles: Administrator
and AdvancedEdit
.
Create a new page style, say Blank Page (For information, see Section 15.2, "Creating a Custom Page Style.")
To grant access to Composer's Source view only to the users with the AdvancedEdit
role, edit the source code of the page style and add the following attribute to the <pe: pageCustomizable>
tag (Figure B-6):
toolbarLayout="message stretch statusindicator newline #{WCSecurityContext.userInScopedRole['AdvancedEdit'] ? 'menu' : ''} addonpanels stretch help button"
For information about editing the source code, see Section 11.3.2, "Editing the Source Code of a Resource."
Figure B-6 Editing Source Code of a Page Style
Log in as a user other than weblogic
, and in Home space create a page using the Blank Page page style. When you open the page in Composer, the page appears in Design view, and no View menu is available because the user is not granted the AdvancedEdit
role.
Applying this technique to all page styles available to users in Home space completely controls access to Source view. You can follow the same technique for various spaces.
Table B-12 lists EL expressions relevant to Spaces navigation and describes the types of functionality it provides. All navigation ELs can be used in both the Spaces application and Framework applications built with Oracle JDeveloper.
Table B-12 EL Expressions Relevant to Navigation
Expression | Function |
---|---|
Navigation Context Expressions |
|
|
Returns default navigation model. It gets the value from the preference bean. The preference bean gets the value based on the preference setting in The following example returns the specified default tree model: #{navigationContext.defaultNavigationModel.defaultTreeModel} You can also use |
|
Returns the navigation model used to navigate to the current view (that is, the current page) There may be a number of navigation models on the page. Only the one used to navigate to the page is the current navigation model. The current navigation model is set only when the The following example returns the default tree model for the current navigation model: #{navigationContext.currentNavigationModel.defaultTreeModel} You can also use See Also: |
|
Returns the navigation model specified by path. Example: #{navigationContext.navigationModel['/oracle/webcenter/portalapp/navigations/default-navigation-model']} User can simply enter the path in the square bracket without having to remember the parameter name. For backward compatibility, comma-separated parameters are also supported. Available parameters (with examples) are:
Note: #{navigationContext.navigationModel['modelScope=/oracle/webcenter/portalapp/navigations,modelId=default-navigation-model']} |
Returns the default navigation method for binding to UI component's The Example using the
<af:forEach var="node" varStatus="vs"
items="#{navigationContext.defaultNavigationModel.rootNode.children}">
<af:subform id="pt_sfm1">
<af:commandLink id="pt_cl1"
text="#{node.title}"
inlineStyle="font-size:small;color:White;"
actionListener="#{navigationContext.processAction}"
action="pprnav">
<f:attribute name="node" value="#{node}"/>
<af:showPopupBehavior popupId="menuPopup"
align="afterStart"
triggerType="mouseOver"/>
</af:commandLink>
Example using the <af:commandLink id="pt_cl1" text="Prescriptions" inlineStyle="font-size:small; color:White;" actionListener="#{navigationContext.processAction}" action="pprnav"> <f:attribute name="path" value="/prescriptions"/> <f:attribute name="model" value="#{navigationContext.defaultNavigationModel}"/> </af:commandLink> |
|
Navigation Model Expressions |
|
|
Returns a tree/menu/list model based on the default settings The default values for the settings are specified in the next row. For example, the default value for For This expression returns a model of type:
|
|
Returns tree/menu/list model based on the specified comma-separated parameters. Available parameters (with default values as examples) are:
For Example: #{navigationContext.defaultNavigationModel.treeModel['startNode=home,includeStartNode=false,depth=2']} |
|
Returns a root node (of type Example: <af:commandLink id="pt_cl1" text="Prescriptions" inlineStyle="font-size:small; color:White;" actionListener="#{navigationContext.processAction}" action="pprnav"> <f:attribute name="node" value="#{navigationContext. defaultNavigationModel. rootNode.children[2]"/> </af:commandLink> |
|
Returns a node (of type Example: #{navigationContext.defaultNavigationModel.node['home/page1']} |
|
Returns currently selected navigation resource. |
|
Sets the current selection to a node specified by the given path (you do not need "/" prefix unless you are requesting the root node, for example, The user must have the ability to explicitly set the current selection without having to actually navigate to a node. This can be used where the user enters a page directly, and no selection is set. It provides a mechanism for the user to control what is the default when there is no current selection. Example: <c:set value="${navigationContext.defaultNavigationModel.newCurrentSelection['home/page1']}" var="currSel" scope="session"/> <c:if test="${currSel!=null}"> <af:forEach items="#{currSel.children}" var="cnode" varStatus="cnodestatus"> ...</c:if> |
|
Returns the value of the specified attribute of the navigation model. |
Navigation Resource Expressions |
|
|
Returns the value of the specified attribute of the navigation resource. |
|
Returns the value of the specified parameter of the navigation resource. |
|
Returns the raw value of the specified parameter of the navigation resource (before it is evaluated). |
|
Returns the title of the navigation resource. |
|
Returns the path to the navigation resource. |
|
Returns the URL for the navigation resource of type |
|
Returns the identifying path for this navigation resource. |
|
Returns a collection of identifying paths by depth to enable its use as a starting path to drive another navigation view. For example, assuming the
#{node.prettyUrlPath[3]}
|
|
Returns the identifying path for this navigation resource suitable for <af:goLink id="pt_gl2" text="#{node.title}" destination="#{node.goLinkPrettyUrl}" targetFrame="#{node.attributes['Target']}" inlineStyle="font-size:small;#{node.selected ? 'font-weight:bold;' : ''}"/> Any link to a page within Spaces also needs certain context parameters, but |
|
Returns whether this resource is a separator item. |
|
Returns whether it is possible to navigate to this resource. |
|
Returns whether this resource is currently selected. |
|
Returns whether the resource is the currently selected resource and the model is the currently selected model. |
|
Returns whether this node lies on the selected path. This is useful for highlighting the selected tab, for example. For example, assuming the currently selected node is <c:set value="${navigationContext.defaultNavigationModel.node['home']}" var="home" scope="session"/> <af:commandImageLink id="cil1" icon="#{(home.onSelectedPath) ? '/images/caremark/nav/HomeSelected.png' : '/images/caremark/nav/HomeIcon.png'}" actionListener="#{navigationContext.processAction}" action="pprnav"> <f:attribute name="node" value="#{home}"/></af:commandImageLink> |
|
Returns whether this resource is a leaf node. |
|
Returns the parent node (of type |
|
Returns the hierarchy list of ancestors of this node (of type NavigationResource) starting with the root node. For example, assuming the current node is
|
|
Returns the depth of this node from the root node. Root node has a depth of zero. |
|
Returns the list of siblings (of type |
|
Returns the next sibling in the list (of type NavigationResource) of this node. For example, the following code ensures that you do not output two separators in a row: <c:if test="${(node.separator) && (!node.nextSibling.separator}"> <af:separator id="s166"/> </c:if> |
|
Returns the previous sibling in the list (of type |
|
Returns the zero-relative index of this node relative to its siblings. |
|
Returns a collection of child resources. |
|
Returns the number of children of this node. |
|
Returns the child node (of type If not found, this returns |
|
Returns the child node (of type The path can be deeper than one level and does not need the |
This section provides an example of using a navigation model to monitor activities of two subspaces from a shared page in the parent space. In this example, you use a page containing the Activity Stream task flow. The content of the task flow is determined by a parameter passed to the page. The navigation model includes two links that link to the page. The first link passes subspace1
as the parameter so that the Activity Stream task flow shows activities of subspace1
. The second link passes subspace2
as the parameter. So, the content of the page is different depending on which link you click in the navigation.
To build a navigation model that uses ELs to monitor subspace activity from a parent space:
Create a space, and two subspaces. While creating subspaces, note down the internal name used (for example, subspace1
and subspace2
).
In your space, create a page called Subspace Activity
, and add the Activity Stream task flow to the page. For information about adding a task flow, see Section 18.5, "Adding a Component to a Page."
Create a page parameter, say subspaceName
, for the newly created page. For information, see Section 22.3.1, "Creating Page Parameters."
Use the following EL as the value of the parameter:
#{empty navigationContext.currentNavigationModel.currentSelection.parameters.subspaceName ? 'subspace1' : navigationContext.currentNavigationModel.currentSelection.parameters.subspaceName}
Where, 'subspace1
' is the value to be used for the page parameter if none is passed to it from the navigation.
Edit the settings of the Activity Stream task flow. In the Component Properties dialog, on the Parameters tab, for the Spaces parameter, open the Expression Builder, and for Page Parameter, select subspaceName.
On the Display Options tab, for the Text field, specify a value that shows the name of the subspace whose activity is shown. For example, use the following EL:
#{bindings.subspaceName} Activity
Build a navigation that passes the space to show your page:
Create a navigation based on Spaces Default Navigation Model.
Edit the navigation by adding a Link navigation item.
On the Target tab, in the Name field, specify the name of the Link item as Sub Space 1
.
In the Path field, select the Subspace Activity
page.
On the Parameters tab, for the subspaceName
field, specify the internal name of the first subspace, subspace1
.
Copy the newly created link, and edit it to make a link for the second subspace, subspace2
.
While editing, on the Target tab you only need to change the Name of the link. On the Parameters tab, you only need to change the value of the subspaceName parameter to subspace2
(the internal name of the second subspace).
Make sure the newly created navigation is set as the current navigation for your space.
You now have two links that take you to the shared Subspace Activity
page, passing different values for the space depending on the link you click.
Use the expressions in this section to query for resources. Querying for a resource through an EL expression is similar to querying for it through an API call. That is, you must set query parameters in the format ['property']['like']['value']
, where property
is the name of the property, for example, id
, resourceScope
, and the like, and value
is the search value for the attribute.
A query can result in single or multiple results. The query designer must decide what is wanted. The query designer determines whether to return one or multiple results by encountering one of the following values in the expression:
singleResult
—Returns a single resource. When no matching resource is found, null is returned.
resultList
—Returns a list of resources. When no matching resources are found, an empty list is returned.
Note:
Occurrences of singleResult
or resultList
in the expression are used internally as the query end point, and, after this, the query is executed immediately. Anything set after the end point can result in unexpected behavior.
The following example returns the first template resource found with a display name that contains myPage
:
#{srmContext[wCond['resourceType']['like']['siteTemplate']]['and'][wCond['displayName']['like']['myPage']].singleResult}
The following example returns a list of template resources residing in the directory resourceDir
, with a description that contains sampleDesc
:
#{srmContext[wCond['resourceType']['like']['siteTemplate']]['and'][wCond['description']['like']['sampleDesc']]['and'][wCond['contentDirectory']['like']['resourceDir'].resultList}
A property of this class includes any attribute of this class. Example properties include: Id
, DisplayName
, iconURI
, contentDirectory
, and the like.
The property value can be an explicit value or an EL expression that returns that type of value. For example, the following two queries return the same result:
#{srmContext[wCond['id']['like']['resourceId']].singleResult} #{srmContext[wCond['id']['like']['spacesContext.currentSpace.uiMetadata.siteTemplateId']].singleResult}
You can use any property of this class in an EL-based query in the format property
['
value
']
and in any order. For example, the following two queries return the same result:
#{srmContext[wCond['resourceScope']['like']['scopeName']]['and'][wCond['id]['like']['resourceId']].singleResult} #{srmContext[wCond['id']['like']['resourceId']]['and'][wCond['resourceScope']['like']['scopeName']].singleResult}
Table B-13 lists EL expressions relevant to resources and describes the types of functionality each provides. You can use all resource EL expressions in both the Spaces application and Framework applications built with Oracle JDeveloper.
Table B-13 ELs Relevant to Resources
EL | Function |
---|---|
|
Returns the resource with the specified ID |
|
Returns any resources with the specified display name |
|
Returns any resources with the specified display name key |
|
Returns one result of a resource that contains the specified value in its description To get multiple results, use |
|
Returns one result of a resource with the specified description key The description key is the key in the To get multiple results, use |
|
Returns any resource with the specified creation date |
|
Returns any resource that was last modified by the user with the specified user name |
|
Returns any resource that was last modified by the specified date |
|
Returns any resource that falls within the specified scope |
|
Returns any resource that falls within the specified category For example: #{srmContext[wCond['category']['like']['siteTemplates']]} |
|
Returns any resource that is stored within the specified directory |
|
Returns resource metadata from the specified metadata file For example, the following expression returns resource metadata from the following file #{srmContext[wCond['metadataFile']['like']['/home/metadat/data.xml']]} |
|
Returns any For example, the following expression returns the #{srmContext[wCond['jspx']['like']['/home/web/page.jspx']]} |
|
Returns any |
|
Returns the icon at the specified icon URI |
|
In a larger expression, returns all specified resources except those available in the excluded scopes |
|
In a larger expression, returns any resource the either does or does not use custom security Set #{srmContext[wCond['usesCustomSecurity']['like']['TRUE']]} |
|
In a larger expression, returns any resource that is or is not seeded, depending on the provided value Set #{srmContext[wCond['seeded']['like']['TRUE']]} |
|
In a larger expression, returns any resource that is of the specified type of visibility Set #{srmContext[wCond['visibleType']['like']['TRUE']]} |
|
In a larger expression, returns one or multiple resources with visibility set to either |
|
In a larger expression, returns any resource created by the specified user |
|
In a larger expression, returns one or multiple resources of the specified type For example, the following expression searches for a resource of the type #{srmContext[wCond['resourceType']['like']['SITE_TEMPLATE']]} Note that all resource types are listed in Oracle Fusion Middleware Java API Reference for Oracle WebCenter, in the |
|
In a larger expression, returns one or multiple resources available in the application of the specified version |
|
In a larger expression, returns one or multiple resources available in the specified scope For example, the following expression searches for resources in the scope (in this instance, the space) #{srmContext[wCond['resourceScope']['like']['MySpace']]} To search in the default scope, that is, the application scope, use |
|
In a larger expression, returns one or multiple resources that contain or equal the values set by other included expressions Set |
This section provides an example of using an EL expression to display a page template based on a user's role.
In this example, you will use an EL expression to enable a specific page template to be displayed for moderators so that only they can access the features or links available in that page template.
To display a page template based on a user role:
Go to the desired space.
Go to Manage > General Settings.
In the Display Setting section, for Page Template click the Expression Builder icon, and click Expression Builder.
In the Type a value or expression, enter the following expression:
#{srmContext[wCond['resourceType']['like']['siteTemplate']][wCond['displayName']['like'][WCSecurityContext.userInScopedRole['Moderator'] ? 'Fusion Side Navigation' : 'WebCenter Spaces Top Navigation']].singleResult.id}
Where:
srmContext[wCond['resourceType']['like']['siteTemplate']]
Gets a list of all page templates in the scope
[wCond['displayName']['like'][WCSecurityContext.userInScopedRole['Moderator'] ? 'Fusion Side Navigation' : 'WebCenter Spaces Top Navigation']]
Reduces the list down to one depending on whether the current user is a moderator. If the user is a moderator, the Fusion Side Navigation page template is applied. For all other user roles, the space is rendered using the WebCenter Spaces Top Navigation page template.
singleResult.id
Returns the GUID of the required entry.
Click OK.
Table B-14 lists EL expressions relevant to spaces and describes the types of functionality each provides. All of the listed ELs are for use in Spaces.
Note:
The space internal name is the name specified by the Space URL on the General page of a space's administration settings. The space display name is specified by Display Name. Many of the EL expressions in Table B-14 call for the space internal name.
Table B-14 EL Expressions Relevant to Specific Spaces
Expression | Function |
---|---|
|
An The value of this expression is whatever is returned on invoking the java API: |
|
An The value of this expression is whatever is returned on invoking the Java API: |
|
The name of the space associated with the current web request. If the current web request is in a Home space context, it returns a value of The value of this expression is whatever is returned on invoking the java API: |
|
An The value of this expression is whatever is returned in Java on invoking |
|
The MDS path of the space metadata document for the space with specified name The value of this expression is whatever is returned in java on invoking |
|
An The value of this expression is whatever is returned in java on invoking |
|
The display name of the space that is named |
|
The URL of the space that is named |
|
A URL to the icon associated with the space that is named |
|
The description of the space that is named |
|
A java.util.Calendar object representing the date-time on which the space with specified name |
|
The user-name of the person who created the space that is named |
|
A comma-delimited list of searchable keywords associated with the space with the name |
|
Boolean value that indicates whether the space that is named |
|
Boolean value that indicates whether the space that is named |
|
Boolean value that indicates whether users are allowed to register themselves with the space that is named |
|
Boolean value that indicates whether users can discover the existence of the space that is named |
|
Boolean value indicating whether the space that is named |
|
The email address of the mailing list associated with the space that is named |
|
The value of a specific custom attribute of the name |
|
Returns the logo URL for the space named |
|
A means of querying a space using a query parameter in the form of If For example, the following EL expression returns a list of all discoverable spaces. #{spaceContext.spacesQuery.unionOf['DISCOVERABLE'].listSpaces} If For example, the following EL expression returns an instance of type #{spaceContext.spacesQuery.unionOf['DISCOVERABLE']} |
|
Returns a list of all top-level spaces of which the current user is a member This EL returns only those spaces that do not have a parent, that is, it does not return subspaces. |
|
Returns a list of all spaces of which the current user is a member This EL also returns all the subspaces under each of the parent spaces to which the current user has access. To see an example, refer to Section B.4.6.1, "Example: Using EL Expressions for Various Spaces". |
|
Returns spaces sorted into the order specified by the sort criteria For example, the following query returns a list of spaces to which the user has access sorted by Note that in the following example, the idenitifier #{spaceContext.spacesQuery.unionOf['ALL_QUERIABLE'].sort['sp.discoverable']['asc']['sp.lastUpdateDate']['desc'].listSpaces} |
|
Allows specifying the page number (0-based) to select from the results matching the query criteria For example, the following expression returns a list of all spaces to which a user has access and returns the third page of the result set: #{spaceContext.spacesQuery.unionOf['ALL_QUERIABLE'].pageNumber[2].listSpaces]} |
|
Allows specifying the number of results to be included in each page when breaking down the result space into pages For example, the following expression returns a list of all spaces to which a user has access, listing 10 records per page. #{spaceContext.spacesQuery.unionOf['ALL_QUERIABLE'].pageNumber[10].listSpaces]} |
#{spaceContext.spacesQuery.unionOf.ALL_QUERIABLE.where[wCond['sp.createdBy']['like']['monty%'] ['and'] [wCond['sp.selfSubEnabled']['is']['null'] ['or'] [wCond['sp.selfSubEnabled']['=']['N']] ['not'] ] ].listSpaces} |
Returns a list of all spaces a user has access which are created by a specified user, and on which self subscription is enabled. (For more information, see |
This section provides an example of using EL expressions to query various spaces.
In this example, you will use the following EL to display a list of all spaces of which you are a member:
"#{spaceContext.spacesQuery.unionOf['USER_JOINED'].shape['RECURSIVE_FLATTENED'].listSpaces}"
You will also use the following methods to display the logo, name, description, and number of members of a space.
iconURI
- to display the space logo
displayName
- to display the space name
description
- to display the space description
memberCount
- to display the number of space members
To query a space:
Create a new task flow, and mark it as available for use, as described in Section 29.3.1, "Creating a Task Flow."
Edit the source code of the task flow. On the Resources tab, select the task flow. From the Edit menu, select Edit Source.
In the Edit Source dialog, on the Fragment tab, replace the existing code with the following code:
<?xml version='1.0' encoding='UTF-8'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:pe="http://xmlns.oracle.com/adf/pageeditor" xmlns:cust="http://xmlns.oracle.com/adf/faces/customizable" xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions"> <af:panelGroupLayout id="pgl1"> <cust:panelCustomizable id="pc1"> <table border="0" width="100%"> <af:iterator id="it1" var="row" value="#{spaceContext.spacesQuery.unionOf['USER_JOINED'].shape['RECURSIVE_FLATTENED'].listSpaces}"> <c:set var="iconURI" value="#{fn:split(row.iconURI,'}')[1]}"/> <c:set var="displayName" value="#{row.displayName}"/> <c:set var="description" value="#{row.description}"/> <c:set var="numMembers" value="#{row.memberCount}"/> <tr class="PortletText1"> <td width="16px" rowspan="3" valign="top"> <af:image id="img1" source="/webcenter-spaces-resources/oracle/webcenter/siteresources/scopedMD/shared#{iconURI}/ICON16"/> </td> <td> <af:outputText id="otCol1" value="#{displayName}" inlineStyle="color:#333333; font-size:12px; font-weight:bold;"/> </td> </tr> <tr> <td> <af:outputText id="otCol3" value="#{description}" inlineStyle="color:#666666; font-size:12px;"/> </td> </tr> <tr> <td> <af:outputText id="otCol4" value="members (#{numMembers}) -" inlineStyle="color:#666666; font-size:10px;"/> <af:spacer id="spacer1" width="5px"/> <af:goLink id="gl1" destination="/spaces/#{row.name}" targetFrame="_blank" text="view"/> </td> </tr> </af:iterator> </table> </cust:panelCustomizable> </af:panelGroupLayout> </jsp:root>
Add the task flow to a page. In the Resource Catalog, the custom task flow is available under Mash-Ups > Task Flows.
The page should now show a list of all the spaces of which you are is a member (Figure B-1).
Table B-15 lists EL expressions relevant to application pages and describes the types of functionality it provides.
Table B-15 EL Expressions Relevant to Application Pages
Expression | Function |
---|---|
|
Returns the page display name, for example: FinanceProject |
|
Returns the user name of the person who created the page, for example: monty |
|
Returns the date and time the page was created, for example: 2008-11-19T10:18:36 |
|
Returns the user name of the person who last updated the page, for example: monty |
|
Returns the date and time the page was last updated, for example: 2008-11-19T10:18:36 |
|
Returns the file directory path to the page relative to the application root directory, for example: /oracle/webcenter/page/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/user/Umonty/Page4.jspx |
|
Returns the file name of the page, for example: Page4.jspx |
|
Returns the name of the style scheme used on the page, for example: WCSchemeEggShell |
|
Returns the directory path and file name of the page scheme background image. |
|
Returns the hexadecimal value of the page scheme background color, for example: #ffa500 |
|
Returns the permission the current user has on the page, for example: oracle.webcenter.page.model.security.CustomPagePermission |
|
A string of 60 or so characters that uniquely identifies the current page to the security system, for example: oracle_webcenter_page_scopedMD_s8bba98ff_4cbb_40b8_beee_296c916a23ed_user_Umonty_Page4PageDef |
Table B-16 lists EL expressions relevant to Composer. The Context column indicates that the expression can be used both in the Spaces application and Framework applications built with Oracle JDeveloper.
Table B-16 EL Expressions Relevant to Composer
Expression | Function | Context |
---|---|---|
#{composerContext.inEditMode} |
Determines whether the current page is in View mode or Edit mode, for example: <af:outputText id="ot1" value="#{composerContext.inEditMode ne true ? 'View mode' : 'Edit mode'} /> This example shows an ADF Faces |
Both |
This section provides an example of using an EL expression to display different pages in View mode and Edit mode. Consider that you want one of your pages, Page1
, to display another page, Page2
, in View mode. However, while editing Page1
, instead of Page2
, you want to display a website, www.example.com
. You can use the EL of the following format:
#{ composerContext.inEditMode ? 'http://www.example.com' : 'url_of_Page2' }
This EL displays the specified website when your page is in Edit mode, and shows Page2
when in View mode.
The following steps demonstrate how to display different pages depending on the page mode.
Open a page named Page1
in Edit mode.
Click Add Content.
In Resource Catalog, click Web Development.
Click Add next to Web Page, then click Close.
Click the Edit icon for the newly added Web Page.
In the Component Properties dialog, on the Display Options tab, in the Source field, enter the value as per the following format:
#{ composerContext.inEditMode ? 'website_url' : 'url_of_Page2' }
Click OK.
In Edit mode, Page1
should now display the website you specified. Save and close the page. Page1
should now show Page2
.
Table B-17 lists EL expressions relevant to the types of events that can trigger the passing of payloads (rather than events relevant to the Events service).
You can access all or part of the event payloads provided in Table B-17 once they have been raised.
For example, for the whole payload, use the following EL:
#{wcEventContext.events.<eventName>}
For example:
#{wcEventContext.events.WebCenterUserSelected}
All of the payloads for the ELs in Table B-17 are Maps. To dereference a map entry, use the standard EL for Maps:
#{wcEventContext.events.WebCenterUserSelected.UserName}
See Also:
For more information about event wiring, see Chapter 22, "Wiring Pages, Task Flows, Portlets, and UI Components."
Table B-17 EL Expressions Relevant to Event Contexts
Expression | Function |
---|---|
Event Context #{wcEventContext.events.WebCenterResourceSelected} Document Name #{wcEventContext.events.WebCenterResourceSelected.name} Document Creator #{wcEventContext.events.WebCenterResourceSelected.createdBy} Document Last Modified By #{wcEventContext.events.WebCenterResourceSelected.lastModifiedBy} |
Use in context wiring between producer and consumer task flows. Returns a map that relates some piece of metadata from the producer to some piece of metadata from the consumer, for example, from a document creator to the creator's Profile. Producer task flows include:
Consumer task flows include:
|
Event Context #{wcEventContext.events.WebCenterUserSelected} User Name #{wcEventContext.events.WebCenterUserSelected.userName} User GUID #{wcEventContext.events.WebCenterUserSelected.userGUID} space Name #{wcEventContext.events.WebCenterUserSelected.spaceName} space GUID #{wcEventContext.events.WebCenterUserSelected.spaceGUID} |
Use in context wiring between producer and consumer task flows. Returns a map that relates some piece of metadata from the producer to some piece of metadata from the consumer, for example, from a user to the user's connections. Producer task flows include:
Consumer task flows include:
|
Event Context #{wcEventContext.events.WebCenterConnectionSelected} Profile User Name #{wcEventContext.events.WebCenterConnectionSelected.profileUserName} Profile User GUID #{wcEventContext.events.WebCenterConnectionSelected.profileUserGUID} Connected User Name #{wcEventContext.events.WebCenterConnectionSelected.userName} Connected User GUID #{wcEventContext.events.WebCenterConnectionSelected.userGUID} |
-- |
|
Returns the name of the selected space |
|
Returns the GUID of the selected space |
Table B-18 lists EL expressions relevant to services and describes the types of functionality it provides. All listed ELs can be used in both Spaces and WebCenter Portal: Framework.
Table B-18 EL Expressions Relevant to Services
Expression | Function |
---|---|
|
An #{webcenterService['oracle.webcenter.doclib']} For service IDs, see Table B-19. |
|
Returns a Boolean value that indicates whether the WebCenter Portal service with the service ID
For service IDs, see Table B-19. |
|
Returns the forum ID of the specified space discussion forum. Enter the space name in lieu of |
|
Returns the category ID of the specified space discussion forums. Enter the space name in lieu of |
Table B-19 lists service IDs associated with services at runtime.
Service | ID |
---|---|
Announcements |
oracle.webcenter.collab.announcement |
Discussions |
oracle.webcenter.collab.forum |
Documents and Wikis |
oracle.webcenter.doclib |
Events |
oracle.webcenter.collab.calendar.community |
Space Management |
oracle.webcenter.community |
Instant Messaging and Presence (IMP) |
oracle.webcenter.collab.rtc |
Links |
oracle.webcenter.relationship |
Lists |
oracle.webcenter.list |
|
oracle.webcenter.collab.mail |
Notes |
oracle.webcenter.note |
Notifications |
oracle.webcenter.notification |
Page |
oracle.webcenter.page |
People Connections: Activity Stream |
oracle.webcenter.activitystreaming |
People Connections: Connections |
oracle.webcenter.peopleconnections.connections |
People Connections: Feedback |
oracle.webcenter.peopleconnections.kudos |
People Connections: Message Board |
oracle.webcenter.peopleconnections.wall |
People Connections: Profile |
oracle.webcenter.peopleconnections.profile |
Polls |
oracle.webcenter.collab.survey |
Recent Activities |
oracle.webcenter.recentactivity |
Activity Graph |
oracle.webcenter.activitygraph |
RSS |
oracle.webcenter.rss |
Search |
oracle.webcenter.search |
Tags |
oracle.webcenter.tagging |
Blogs |
oracle.webcenter.blog |
Worklist |
oracle.webcenter.worklist |
Table B-20 lists EL expressions relevant to the Personalization Conductor and describes the types of functionality it provides. All listed ELs can be used in both the Spaces application and Framework applications built with Oracle JDeveloper.
Table B-20 EL Expressions Relevant to the Personalization Conductor
Expression | Function |
---|---|
|
Clears the state of the context object in which it is invoked. Other examples: #{p13nContext.conductor['ConductorConnection'].reset} #{p13nContext.conductor['ConductorConnection'].namespaces['MyNamespace'].reset} #{p13nContext.properties['PropertiesConnection'].namespaces['MyNamespace'].setDefinitions['MyPropertySetDefinition'].set['MyPropertySet'].reset} |
|
Updates the property set with new values if bound to a form. The |
|
Retrieves the results of the context object. In the case of In the case of Other examples: #{p13nContext.conductor['ConductorConnection'].namespaces['MyNamespace'].scenario['MyScenario'].results} #{p13nContext.conductor['ConductorConnection'].namespaces['MyNamespace'].scenario['MyScenario'].withInput['input1=val1;input2=value2;input3=value3'].results} |
|
Executes a scenario by name. |
|
Executes a scenario by name with input parameters. Input parameters must be in the following format: <paramOne>=<valueOne>;<paramTwo>=<valueTwo>;<paramThree>=<valueThree> Where each parameter name and value is separated by semicolon. The |
|
Determines if an error has occurred in the current context object. The Other examples: #{p13nContext.properties['PropertiesConnection'].namespaces['MyNamespace'].setDefinitions['MyPropertySetDefinition'].set['MyPropertySet'].isError} |
|
Returns the error message if an error has occurred in the current context object. The errorMessage method applies only to Other examples: #{p13nContext.properties['PropertiesConnection'].namespaces['MyNamespace'].setDefinitions['MyPropertySetDefinition'].set['MyPropertySet'].errorMessage} |
Table B-21 lists EL expressions relevant to the Documents service and describes the types of functionality it provides. The Context column indicates whether the expression can be used in the Spaces context (WCS) or in both the Spaces application and Framework applications built with Oracle JDeveloper (Both).
Table B-21 EL Expressions Relevant to the Documents Service
Expression | Function | Context |
---|---|---|
|
Provides information on the space's documents. Returns a bean that provides access to documents-related information for the space. |
WCS |
|
Provides information about the current user's documents. |
WCS |
|
Gets the default content repository connection name. Returns |
Both |
|
Provides a way to look up a given space's documents information by the space's GUID. Returns a bean that provides documents-related information for the space. |
WCS |
|
Provides a way to look up a given space's documents information by the space's name. Returns a bean that provides access to documents-related information for the space. Enter the space internal name. The space internal name is the name specified by the space URL on the General page of a space's administration settings. The space display name is specified by Display Name, and is the name that appears in the banner at the top of a space. Many of the EL expressions in Table B-14 call for the space internal name. |
WCS |
|
Provides a way to look up user documents information by user name. Returns a bean that provides access to documents-related information for the user. |
WCS |
|
Checks whether the Documents service is configured. Returns |
Both |
Table B-22 lists EL expressions relevant to the Profile feature of the People Connections service and describes the types of functionality it provides. All listed ELs can be used in both the Spaces application and Framework applications built with Oracle JDeveloper.
Note:
The entry securityContext.userName
, included in every Profile expression, returns the name of the current user. Note also that information is returned only if it is present in the user's profile. If the information is not included in the profile, a null value is returned.
Table B-22 EL Expressions Relevant to the People Connections Service (Profile)
Expression | Function |
---|---|
|
The display name of the specified user's manager if the current user is allowed to know it. |
|
The specified user's employee number if the current user is allowed to know it. |
|
The post office box number associated with the specified user if the current user is allowed to know it. |
|
The time zone in which the specified user's home office is located if the current user is allowed to know it. |
|
A description of the specified user (from Profile "About Me") if the current user is allowed to know it. |
|
The department to which the specified user belongs if the current user is allowed to know it. |
|
The specified user's business pager number if the current user is allowed to know it. |
|
The city in which the specified user is located if the current user is allowed to know it. |
|
The specified user's surname or last name before marriage if the current user is allowed to know it. |
|
The specified user's business fax number if the current user is allowed to know it. |
|
The specified user's date of hire if the current user is allowed to know it. |
|
Additional information appended to the user's name, such as |
|
The specified user's middle name if the current user is allowed to know it. |
|
The specified user's home phone number if the current user is allowed to know it. |
|
The specified user's employee type classification, for example, |
|
The specified user's surname or last name if the current user is allowed to know it. |
|
The specified user's birthday if the current user is allowed to know it. |
|
The state in which the specified user's home office is located if the current user is allowed to know it. |
|
The specified user's home street address if the current user is allowed to know it. |
|
The street on which the specified user's home office is located if the current user is allowed to know it. |
|
The specified user's postal or ZIP code if the current user is allowed to know it. |
|
The specified user's initials if the current user is allowed to know it. |
|
The specified user's first name if the current user is allowed to know it. |
|
The organizational unit to which the specified user belongs, for example, |
|
The specified user's wireless account number if the current user is allowed to know it. |
|
The specified user's business telephone number if the current user is allowed to know it. |
|
The country in to which the specified user is assigned if the current user is allowed to know it. |
|
The specified user's preferred language if the current user is allowed to know it. |
|
The specified user's display name if the current user is allowed to know it. |
|
The specified user's actual name if the current user is allowed to know it. |
|
The specified user's job title if the current user is allowed to know it. |
|
The specified user's business email address if the current user is allowed to know it. |
|
The organization to which the specified user belongs, for example, |
|
The specified user's cell or mobile phone number if the current user is allowed to know it. |
|
The specified user's business expertise if the current user is allowed to know it. |
Table B-23 lists EL expressions relevant to user preferences and describes the types of functionality they provide. All listed ELs can be used in both the Spaces application and Framework applications built with Oracle JDeveloper.
Table B-23 EL Expressions Relevant to User Preferences
Expression | Function |
---|---|
|
Returns the time zone the current user has selected in application Preferences. For more information, see Section 38.3, "Setting Date and Time Preferences." |
|
Returns the date format the current user has selected in application Preferences. For more information, see Section 38.3, "Setting Date and Time Preferences." |
|
Returns the current user's preferred date format pattern if it has been set, else, returns Note that date + pattern is applicable only to Framework applications, where they take precedence over date + style if they are set. |
|
Returns the time format the current user has selected in application Preferences. For more information, see Section 38.3, "Setting Date and Time Preferences." |
|
Returns the current user's preferred time format pattern if it has been set, else, returns |
|
Returns the current user's preferred date and time format pattern if it has been set, else, returns |
|
Returns the current user's preferred accessibility mode (either |
|
The current user's preferred skin name if one is specified, otherwise the default value. |
|
Returns the current date in the current user's selected locale. |
|
Returns the current time in the current user's selected locale. |
|
Returns the current date and time in the current user's selected locale. |
|
Returns the name of the ADF Faces skin family being used for the current web request, depending on factors such as what has been configured at the application level, the current user's preference setting, and so on. |
This section provides an example of using EL expressions to personalize a page through user preferences. Consider that you want to display the current date and time in one of your pages. You can use the following EL:
#{generalSettings.formattedCurrentDateTime}
This EL uses the current user's locale to displays the current date and time.
The following steps demonstrate how to display current date and time in a page:
Open the required page in Edit mode.
Click Add Content.
In Resource Catalog, click Web Development.
Click Add next to HTML Markup, then click Close.
Click the Edit icon for the newly added HTML Markup.
In the Component Properties dialog, on the Display Options tab, in the Value field, enter the following EL:
#{generalSettings.formattedCurrentDateTime}
Click OK.
Your page should now display the current date and time.
Table B-24 lists utilitarian EL expressions and describes the types of functionality it provides.
Table B-24 Utilitarian EL Expressions
Expression | Function |
---|---|
|
Returns the current date in the format specified in the current user's preferences. |
|
Returns a truncation of the string specified as |
|
Both of these expressions return the request locale (that is, the browser locale setting). |
|
Returns true if current application page is in Composer mode. Returns false if current application page is not in Composer mode |
|
Returns the current application skin family. Returns the same value as |