WebSphere Portal, Express Beta Version 6.1
Operating systems: i5/OS, Linux,Windows


 

<portal-logic/> tags

The <portal-logic/> tags are used to provide tags for conditional logic.

<portal-logic:find>

Used to access the portal-wide find URL that is specified in Portal Settings. The tag is conditional. If no URL is set, the body of the tag is not evaluated. A scripting variable called <% wpsPortalFindURL %> is available inside the body of the tag for accessing the URL. This tag can be used in both theme and skin JSPs.

<portal-logic:if attribute="value">

Through the attributes of this tag, several conditions can be checked. If the condition is true, the content of the tag's body is written to the page. Otherwise the content is skipped. More than one condition can be evaluated. For example, the user must be logged in and the Home screen must be active for the content of the following tag to be rendered:Note: All earlier attributes that started with "not" have been deprecated. Use the <portal-logic:unless/> tag instead of these attributes.
    <portal-logic:if loggedIn="yes" screen="Home">

       <!--  content area -->

    </portal-logic:if>
    

Attributes of the <portal-logic:if/> tag

<portal-logic:pageMetaData/>

Used to access meta data of the currently rendered page. The tag has two attributes:

varname

This attribute is mandatory and specifies the name of the variable that exposes the meta data inside the body of the tag. The variable provides an object that implements com.ibm.portal.MetaData.

type

This attribute is optional. Allowed values are direct and aggregated. The value aggregated is the default. If the type attribute is set to direct, only the meta data specifically set for the page are exposed, otherwise the meta data of the page as provided by the content meta data model are used.
The Content meta data model is described in more detail in the Model SPI overview topic. The following example outputs a table with all names and values of the aggregated meta data of the current page.
<portal-logic:pageMetaData varname="pageMetaData">
  <table>
    <tr><th>Name</th><th>Value</th></tr>
    <c:forEach var="metaItem" items="${pageMetaData}">
      <tr><td>${metaItem.key}</td><td>${metaItem.value}</td></tr>
    </c:forEach>
  </table>
</portal-logic:pageMetaData>

<portal-logic:unless>

This tag operates in contrast to the <portal-logic:if> tag. Through the attributes of this tag, several conditions can be checked. If the condition is true, the content of the tag is not written to the page. Otherwise, the content is written. More than one condition can be evaluated. The following attributes can be evaluated. For more information, see the corresponding description for each attribute under the <portal-logic:if> tag.

<portal-logic:urlFind>

Generates a URL pointing to a file. The resource is searched under different paths depending on the markup and locale supported by the client and the specified attributes of the tag. Attributes

The first place where the resource is found is used to construct the URL. The search order used is:

  1. root path
  2. markup name
  3. path
  4. markup version
  5. locale in diminishing sequence
  6. file name

See the Aggregation topic for more information about how the portal server locates resources. The allowRelativeURL attribute indicates whether a fully-qualified or relative URL is generated.

<portal-logic:urlFindInSkin file="file_name" id="identifier">

Similar to <portal-logic:urlFind>, this tag generates a URL pointing to a file in the WebSphere Application Server directory.

The skin is taken from the user's or system's settings. The file attribute is required.

When id is specified, the tag initializes a scripting variable with the value normally written out and nothing is written to the output stream. The value of the id attribute is the name of the scripting variable.

Attribute:

forceAbsolute = "true|false"

This attribute is optional. It specifies whether the URL that is generated by this tag is to be absolute or not. If you set this attribute to true, absolute URLs are enforced; in this case other settings that affect the generation of URLs might be overridden.

<portal-logic:urlFindInTheme file="file_name" id="identifier">

Similar to <portal-logic:urlFind>, this tag generates a URL pointing to a file in the WebSphere Application Server directory.

The theme is taken from the user's or system settings. The file attribute is required.

When id is specified, the tag initializes a scripting variable with the value normally written out and nothing is written to the output stream. The value of the id attribute is the name of the scripting variable.

Attribute:

forceAbsolute = "true|false"

This attribute is optional. It specifies whether the URL that is generated by this tag is to be absolute or not. If you set this attribute to true, absolute URLs are enforced; in this case other settings that affect the generation of URLs might be overridden.
Parent topic: Tags used by the portal JSPs
Library | Support | Terms of use |