El expression null check




















If the EL syntax is invalid, an error appears and the value is neither applied nor saved. 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 asset-related ELs to form a single query that returns a particular portal template. It retrieves the template storesMasterTemplate from the parent portal stores :. The following table lists EL expressions relevant to WebCenter Portal information and describes the type of functionality they provide. An oracle. WCApplicationContext object that provides an access point in the current web request for all WebCenter Portal-related information.

Returns a URL representing the current web request with bookmarkable WebCenter Portal URL parameters of the request appended to the end parameters are not necessarily in a fixed order.

If an application logo was uploaded through WebCenter Portal Administration settings, this expression returns the URL to the application logo image. If a copyright message was configured through WebCenter Portal Administration settings, this expression returns the application copyright message. Returns the URL to the document that contains the application's privacy policy as configured through WebCenter Portal Administration settings. Returns the name of the default ADF Faces skin family to use for rendering pages in the application as configured through WebCenter Portal 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. 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. Table A-2 lists EL expressions relevant to portal pages and describes the types of functionality they provide.

Returns the file directory path to the page relative to the application root directory, for example:. A string of 60 or so characters that uniquely identifies the current page to the security system, for example:.

Returns true if current page is in Oracle Composer mode. Returns false if current page is not in Oracle Composer mode. Table A-3 lists EL expressions relevant to portals and describes the types of functionality each provides. The portal internal name is the name specified for Portal URL on the Overview page of a portal's administration settings.

The portal display name is the name specified for Name. Many of the EL expressions in Table A-3 call for the portal internal name. SpacesContext object that provides an access point in the current web request for all portal-related information. Space object that represents the portal associated with the current web request.

If the current web request is in the Home portal context, it returns a value of null. The name of the portal associated with the current web request. Space object that represents the portal that is named spaceName or the current portal currentSpace. The value of this expression is whatever is returned in Java on invoking. The MDS path of the portal metadata document for the portal with specified name portalName or the current portal currentSpace. The value of this expression is whatever is returned in java on invoking.

SpaceType bean that carries metadata about the portal that is named portalName or the current portal currentSpace. The display name of the portal that is named portalName or the current portal currentSpace.

For example, if a portal called Web20Portal has the display name web 2. A URL to the icon associated with the portal that is named portalName or the current portal currentSpace. The description of the portal that is named portalName or the current portal currentSpace.

A java. Calendar object representing the date-time on which the portal with specified name portalName or the current portal currentSpace was created. The user-name of the person who created the portal that is named portalName or the current portal currentSpace. A comma-delimited list of searchable keywords associated with the portal with the name portalName or the current portal currentSpace.

Boolean value that indicates whether the portal that is named portalName or the current portal currentSpace is offline. Boolean value that indicates whether the portal that is named portalName or the current portal currentSpace is closed. Boolean value that indicates whether users are allowed to register themselves with the portal that is named portalName or the current portal currentSpace.

Boolean value that indicates whether users can discover the existence of the portal that is named portalName or the current portal currentSpace by searching for it or seeing it listed on the My portals page. Boolean value indicating whether the portal that is named portalName or the current portal currentSpace publishes RSS feeds. The email address of the mailing list associated with the portal that is named portalName or the current portal currentSpace.

The value of a specific custom attribute of the name attributeName for the portal that is named portalName or the current portal currentSpace. For example, if the FinanceProject portal has a custom attribute called stockPrice with a value of However, the value will resolve correctly in the running portal.

A means of querying a portal using a query parameter in the form of property [' value '] , where property means the name of the property, for example, unionOf , shape , and so on; and value means the criteria to use in fetching the list of all portals, discoverable portals, and so on.

If listSpaces is appended to the expression, the query returns the list of portals of type GSMetadata. This object type must be evaluated using SpacesManager. For example, the following EL expression returns an instance of type SpacesQueryParameters with all the query conditions populated. This EL also returns all the subportals under each of the parent portals to which the current user has access. For example, the following query returns a list of portals to which the user has access sorted by discoverable and lastUpdateDate fields.

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 portals to which a user has access and returns the third page of the result set:. Allows specifying the number of results to be included in each page when breaking down the result portal into pages. For example, the following expression returns a list of all portals to which a user has access, listing 10 records per page. Returns a list of all portals a user has access which are created by a specified user, and on which self subscription is enabled.

In this example, you will use the following EL to display a list of all portals of which you are a member:. You will also use the following methods to display the logo, name, description, and number of members of a portal.

Edit the source code of the task flow. On the Assets tab, select the task flow. From the Actions menu, select Edit Source. In the Edit Source dialog, on the Fragment tab, replace the existing code with the following code:. Add the task flow to a page. Table A-4 lists EL expressions relevant to the types of portal events that can trigger the passing of payloads rather than events relevant to the events feature. You can access all or part of the event payloads provided in Table A-4 once they have been raised.

To dereference a map entry, use the standard EL for Maps:. 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. 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. Use the expressions in this section to query for assets.

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 so on, 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:. When no matching asset is found, null is returned. When no matching assets are found, an empty list is returned.

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 page template asset found with a display name that contains myPage :. The following example returns a list of page template assets residing in the directory resourceDir , with a description that contains sampleDesc :.

A property of this class includes any attribute of this class. 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:. You can use any property of this class in an EL-based query in the format property [' value '] and in any order. Table A-5 lists EL expressions relevant to assets and describes the types of functionality each provides.

To get multiple results, use resultList in lieu of singleResult. The description key is the key in the xsrt file for the asset description. List of possible category names includes: siteTemplate , pageStyle , dataPresenter , contentPresenter , resourceCatalog , taskFlow , dataControl , taskFlowStyle , and skin.

In a larger expression, returns all specified resources except those available in the excluded scopes. For example:. In a larger expression, returns any asset that is or is not seeded, depending on the provided value.

For example, the following expression returns assets that are visible, that is, assets that are set to Show :. In a larger expression, returns one or multiple assets available in the application of the specified version. For example, the following expression searches for assets in the scope in this instance, the portal MyPortal :.

To search in the default scope, that is, the application scope, use defaultScope. In a larger expression, returns one or multiple assets that contain or equal the values set by other included expressions.

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 portal managers so that only they can access the features or links available in that page template. Reduces the list down to one depending on whether the current user is a portal manager. If the user is a portal manager, the Fusion Side Navigation page template is applied. For all other user roles, the portal is rendered using the WebCenter Portal Top Navigation page template.

ELs Related to Security lists EL expressions relevant to application security and describes the types of functionality they provide. Returns true when the current user is authenticated in the context in which the EL is being invoked, otherwise false. Returns the user name of the currently logged in user. If the current user is not logged in, this expression returns no value. Returns the value true if the current user is the specified user, otherwise false.

Returns the value true if the current user is assigned the specified group, for example:. Returns the value true if the current user is the Portal Manager of the current portal. Returns the value true if the current user is assigned the specified role in the current scope.

Role can be Moderator or Portal Manager, which is the display name , or a custom role defined in that scope. The scope is implicitly resolved to be the current scope. If you use this EL in a portal scope, it resolves to roles defined for the portal. ELs Related to General Settings lists EL expressions relevant to general application settings and describes the types of functionality they provide.

Returns the current user's preferred date format pattern if it has been set, else, returns null. Returns the current user's preferred time format pattern if it has been set, else, returns null. Returns the current user's preferred date and time format pattern if it has been set, else, returns null. Returns the current user's preferred accessibility mode either default , inaccessible , or screenReader.

Use the expressions in this section to query for portal resources. Querying for a portal 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. When no matching resource is found, null is returned. When no matching portal resources are found, an empty list is returned.

The following example returns the first page template portal resource found with a display name that contains myPage :. The following example returns a list of page template portal resources residing in the directory resourceDir , with a description that contains sampleDesc :. Table A-8 lists EL expressions relevant to portal resources and describes the types of functionality each provides. Many of the expressions in Table A-8 are building blocks for narrowing down the portal resource or resources you want returned.

For example, the following expression uses three portal resource-related ELs to form a single query that returns a particular portal template. The description key is the key in the xsrt file for the portal resource description. In a larger expression, returns all specified portal resources except those available in the excluded scopes. In a larger expression, returns any portal resource that either does or does not use custom security.

In a larger expression, returns any portal resource that is or is not seeded, depending on the provided value. For example, the following expression returns portal resources that are visible, that is, portal resources that are set to Show :. In a larger expression, returns one or multiple portal resources available in the application of the specified version. In a larger expression, returns one or multiple portal resources available in the specified scope.

For example, the following expression searches for portal resources in the scope in this instance, the portal MyPortal :. In a larger expression, returns one or multiple portal resources that contain or equal the values set by other included expressions.

Table A-9 lists EL expressions relevant to application navigation and describes the types of functionality they provide. Returns default navigation model. It gets the value from the preference bean.

The preference bean gets the value based on the preference setting in adf-config. You can also use defaultMenuModel and defaultListModel see next listing. The current navigation model is set only when the processAction is called.

You can also use defaultMenuModel and defaultListModel. This EL has been deprecated. Returns the default navigation method for binding to UI component's actionListener attribute. This assumes that the target resource to navigate to is passed in through the action UI component's node or path attribute. The node attribute is typically used for the iterative case; while the path attribute is typically used to create a static link. If both are specified, the node attribute is used.

Note that when using the path attribute, you must also specify the model attribute to pass in the navigation model object. If the model attribute is not specified, the current navigation model is used. The default values for the settings are specified in the next row.

For example, the default value for depth is 0. For defaultSiteMap , it returns the XML for the site map of the navigation based on the default settings.

Available parameters with default values as examples are:. In which case, use "1" to fetch on demand when users click the Expand icon. Use false if you want only the initial sets of nodes. In which case, it does not return deeper nodes later on when requested, even when there are deeper nodes. For siteMap , the available parameters are startNode and includeStartNode. Returns a root node of type NavigationResource of the navigation model.

If successful, returns the newly selected node of type NavigationResource. 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. Returns the value of the specified property of the navigation model, where propertyName is either rootNode or currentSelection.

Returns the raw value of the specified parameter of the navigation portal resource before it is evaluated. Returns a collection of identifying paths by depth to enable its use as a starting path to drive another navigation view.

Returns the identifying path for this navigation portal resource suitable for goLink destination. Returns whether the portal resource is the currently selected portal 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.

Returns the parent node of type NavigationResource of this node. For the root node, null is returned. Returns the hierarchy list of ancestors of this node of type NavigationResource starting with the root node. Returns the list of siblings of type NavigationResource of this node inclusive. Returns the next sibling in the list of type NavigationResource of this node.

Returns the previous sibling in the list of type NavigationResource of this node. Returns the child node of type NavigationResource specified by the zero-relative index. Returns the child node of type NavigationResource specified by the path relative to this node.

If not found, this returns null. Returns the value of the specified property of the navigation portal resource, where propertyName is one of the following: separator , title , prettyUrl , prettyUrlPath , depth , leaf , childCount , navigable , selected , or currentlySelected.

ELs Related to Tools and Services lists EL expressions relevant to tools and services and describes the types of functionality they provide. Returns an implementation of oracle.

In the example, object of class oracle. DoclibService is returned:. For service IDs, see Table A Returns a Boolean value that indicates whether the WebCenter Portal tool or service represented by the service ID serviceId is configured for use in the current WebCenter Portal instance. The following table lists EL expressions relevant to Composer.

The childCreation attribute determines whether the children of popup dialogs can be viewed in Composer. By default, this attribute is set to deferred and users are unable to see the children of popup dialogs.

Setting the value to immediate allows users to view the children of popup dialogs. There is a performance impact by setting the childrenCreation attribute to immediate. If you do not need to use the popup on the page, using the default setting of deferred will avoid the penalty of CPU and memory usage when it is not needed. Note that the popup will be shown non-modally, thus, the application must be able to handle that fact without error. 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. You can use the EL of the following format:. This EL displays the specified website when your page is in Edit mode, and shows Page2 when in View mode. In the Component Properties dialog, on the Display Options tab, in the Source field, enter the value as per the following format:.

In Composer, Page1 should now display the website you specified. Save and close the page. Page1 should now show Page2. Table A lists EL expressions relevant to documents and describes the types of functionality they provide.

Gets the default content repository connection name. Returns null if no connection name is defined. Checks whether the documents feature is configured. Returns true if the documents feature is configured, otherwise false. Table A lists EL expressions relevant to the people connections Profile feature and describes the types of functionality they provide. The entry securityContext. 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. Information is also returned only if the current user is allowed to see it. Additional information appended to the user's name, such as Esq. In this case, this expression acts as an rvalue expression.

During a postback request, this expression can be used to set the value of the name property with user input. In this case, the expression acts as an lvalue expression. Both rvalue and lvalue expressions can refer to the following objects and their properties or attributes:.

To refer to these objects, you write an expression using a variable that is the name of the object. The following expression references a backing bean a JavaBeans component called customer :. The web container evaluates the variable that appears in an expression by looking up its value according to the behavior of PageContext. If customer is not found, a null value is returned. You can use a custom EL resolver to alter the way variables are resolved. To reference an enum constant with an expression, use a String literal.

For example, consider this Enum class:. To refer to the Suit constant Suit. Depending on the context, the String literal is converted to the enum constant automatically.

For example, in the following expression in which mySuit is an instance of Suit , "hearts" is first converted to Suit. To refer to properties of a bean or an enum instance, items of a collection, or attributes of an implicit object, you use the. The part inside the brackets is a String literal that is the name of the property to reference.

You can use double or single quotes for the String literal. You can also combine the [] and. Properties of an enum constant can also be referenced in this way. However, as with JavaBeans component properties, the properties of an Enum class must follow JavaBeans component conventions.

This means that a property must at least have an accessor method called get Property , where Property is the name of the property that can be referenced by an expression. For example, consider an Enum class that encapsulates the names of the planets of our galaxy and includes a method to get the mass of a planet. You can use the following expression to reference the method getMass of the Enum class Planet :. If you are accessing an item in an array or list, you must use either a literal value that can be converted to int or the [] notation with an int and without quotes.

The following examples could resolve to the same item in a list or array, assuming that socks can be converted to int :.

In contrast, an item in a Map can be accessed using a string literal key; no coercion is required:. An rvalue expression also refers directly to values that are not objects, such as the result of arithmetic operations and literal values, as shown by these examples:.

You can also write expressions that perform operations on an enum constant. For example, consider the following Enum class:. After declaring an enum constant called mySuit , you can write the following expression to test whether mySuit is spade :.

When it resolves this expression, the EL resolving mechanism will invoke the valueOf method of the Enum class with the Suit class and the spade type, as shown here:. The value of an expression in static text is computed and inserted into the current output. Here is an example of an expression embedded in static text:. If the static text appears in a tag body, note that an expression will not be evaluated if the body is declared to be tagdependent. A tag attribute value using either an rvalue or lvalue expression can be set in the following ways:.

These kinds of expression, called composite expressions , are evaluated from left to right. Each expression embedded in the composite expression is converted to a String and then concatenated with any intervening text.

This expression is called a literal expression. Literal value expressions have special syntax rules. See Literal Expressions for more information. When a tag attribute has an enum type, the expression that the attribute uses must be a literal expression.

For example, the tag attribute can use the expression "hearts" to mean Suit. The literal is converted to Suit , and the attribute gets the value Suit. All expressions used to set attribute values are evaluated in the context of an expected type. If the result of the expression evaluation does not match the expected type exactly, a type conversion will be performed.

See Section 1. Another feature of the EL is its support of deferred method expressions. A method expression is used to invoke an arbitrary public method of a bean, which can return a result. In JavaServer Faces technology, a component tag represents a component on a page. The component tag uses method expressions to invoke methods that perform some processing for the component.

These methods are necessary for handling events that the components generate and for validating component data, as shown in this example:. Property attributeParameter, attributeName , Expression. Where comparison select user Any clues?? Thanks for your time. Anil Jain. Bulk Delete. Bulk Update. Bulk Merge. Accepted Answer Thanks for your reply.



0コメント

  • 1000 / 1000