Web Content Management JSP tags
Use IBM Lotus Web Content Management JSP tags with the Web Content Management API to pull Web Content Management content and components into external JSP applications.
A JSP referenced within a JSP component must not include a reference, directly or indirectly, to the same JSP component.
This includes references within Web Content Management tags or the API.
If it does, a loop is created and your server will crash.
To use the Web Content Management JSP tags, the following directive must be provided in the JSP:
<%@ taglib uri="/WEB-INF/tld/wcm.tld" prefix="wcm" %>Storing JSP Files
JSP files can be located:
- within the PROFILE_HOME/installedApps/node-name/wcm.ear/ilwwcm.war directory of your server.
The JSP page is also stored in the client war directory of the local rendering portlet or of the servlet or portlet that calls the JSP, if using the Web Content Management API.
For example, to render a JSP page on a local rendering portlet, you would also need to store a copy of the JSP file under PROFILE_HOME/installedApps/node-name/PA_WCMLocalRendering.ear/ilwwcm-localrende.war
- within any other Web application running on portal. When referencing JSP files in another Web application, use the following path: contextPath;jspPath
For example: /wps/customapplication;/jsp/editor.jsp
Writing JSP to be referenced within a JSP component
The setExplicitContext and setContext tags specified below are not required when displaying a JSP file via a JSP Component. They are only required when directly accessing a JSP file.
Reloading JSP files
JSP files referenced by Web Content Management are reloaded once every 10 seconds. If you update a JSP file, you may need to wait for it to be reloaded before your changes will be displayed.
InitWorkspace tag
This is used to set the initial workspace.
<wcm:initworkspace username=" " password=" " > [Error Message] </wcm:initworkspace>
Table 1. Parameters
Parameter Details username=" " The user name of a valid Web Content Management user. password=" " The password for the valid Web Content Management user.
Explicit context tag
This sets the path to your Web Content Management server.
This is not required in JSP that is displayed via a JSP component.
<wcm:setExplicitContext wcmWebAppPath=" " wcmServletPath=" " path=" " requestParameters" " prefix=" " > [Error Message] </wcm:setExplicitContext>
Table 2. Parameters
Parameter Details wcmWebAppPath=" " The URL up to the Web application. I.e. - up to and including the context path. For example, http://localhost:10040/wps/wcm
wcmServletPath=" " The servlet path to the Web Content Management servlet For example, /connect
path=" " The path to the content including the site and siteareas. For example, SiteA/Site Area A/ Site Area B/Content C
requestParameters=" " You specify java Map request parameters to set in the context. These parameters can be used by menu components that are rendered via the JSP that use a query string. prefix=" "
The wcmWebAppPath and wcmServletPath parameters are optional. However, if wcmWebAppPath is specified, wcmServletPath must also be specified.
Developers can add insert context tags at any place in the page and it will change the context for the rest of the page execution, but the tags cannot be nested.
Context retrieval tag
Sets context given the location of a path string. That is where to look for it and the name of the parameter it will be in. This is not required in JSP that is displayed via a JSP component.
<wcm:setContext location=" " wcmWebAppPath="" wcmServletPath="" param=" " > [Error Message] </wcm:setContext>
Table 3. Parameters
Parameter Details location=" " This sets the context of the location of a path string. Either:
- query
- request
- session
wcmWebAppPath=" " The URL up to the Web application. I.e. - up to and including the context path. For example, http://localhost:10040/wps/wcm
wcmServletPath=" " The servlet path to the Web Content Management servlet For example, /connect
param=" " This is the name of the parameter that the path string will be in.
The wcmWebAppPath and wcmServletPath parameters are optional. However, if wcmWebAppPath is specified, wcmServletPath must also be specified.
Developers can add insert context tags at any place in the page and it will change the context for the rest of the page execution, but the tags cannot be nested.
Rendering tags
There are two rendering tags. These are equivalent to element and component tags.
Rendering an element from the current site, site area, or content item.
<wcm:contentComponent type=" " key=" " > [Error Message] </wcm:contentComponent>
Table 4. Parameters
Parameter Details type=" " This determines where the element is being referenced from. Either "content", "sitearea" or "site". key=" " This is the name of this element being referenced.
Rendering a component from the Component Library
<wcm:libraryComponent name=" " library=" " > [Error Message] </wcm:libraryComponent >
Table 5. Parameters
Parameter Details name=" " This is the name of the component being referenced. library=" " This is the name of the library where the component is stored.
For example:
<wcm:libraryComponent name="SC Menu Events" library="Showcase" />You do not have access to this item. </wcm:libraryComponent >
Rendering Content based on the current context of a page
<wcm:content pageDesign=" " > [Error Message] </wcm:content >
Table 6. Parameters
Parameter Details pageDesign=" " This name of the Presentation Template used to determine context. Optional.
Error handling
The following tag can be added to error messages to enable error handling:
<%=error%>
Parent topic:
The IBM Lotus Web Content Management API