Wednesday, January 6, 2010

Writing links to Web Content Management Content

Links to content items can be written as URLs.

The following examples show how to write links to Web Content Management Content that are to be used with the rendering portlet.

Note: Non-ascii characters

Non-ascii characters can not be used in the query string section of URLs. For this reason, it is best not to name IBM® Lotus Web Content Management items using non-ascii characters if you plan to use URLs to call Web Content Management items.

To create a link from a piece of Web Content Management content to another piece of Web Content Management content, use the following URL format:

/[LIBRARY]/[SITE]/[SITE_AREA_PATH]/[CONTENT]

[LIBRARY] = the name of the Web content library.

[SITE] = the name of the site where the content resides.

[SITE_AREA_PATH] = the path to the site area where the content resides.

[CONTENT] = the name of the content item.

Linking to Web Content Management content from an external portlet or Web site
To create a link from an external portlet or Web site that displays Web Content Management content, use the following URL format:

http://[HOST]/wps/wcm/connect/[LIBRARY]/[SITE]/[SITE_AREA_PATH]/[CONTENT]

[HOST] = the name of the Web Content Management host.

wps/wcm = the Web Content Management context root.

[LIBRARY] = the name of the Web content library.

[SITE] = the name of the site where the content resides.

[SITE_AREA_PATH] = the path to the site area where the content resides.

[CONTENT] = the Name of the content item.

Linking to content displayed in a JSR 286 Web content viewer from an external portlet or Web site

To create a link from an external portlet or Web site to content displayed in a JSR 286 Web content viewer, use the following URL format:

http://[PORTAL_HOST]/wps/mypoc[/vp_mapping]?urile=wcm%3Apath%3A[LIBRARY]/[SITE]/[SITE_AREA_PATH]/[CONTENT][&page=unique_name | object_id | &mapping=mapping | ¤t=true]

[PORTAL_HOST] = the name of the Web Content Management host.

wps/mypoc = the Web Content Management context root, specifying the piece of content lookup service.

For protected access, use wps/mypoc.

For unprotected access, use wps/poc.

vp_mapping = the virtual portal mapping, if appropriate. For example, wps/mypoc/myvp or wps/poc/myvp.

[LIBRARY] = the name of the Web content library.

[SITE] = the name of the site where the content resides.

[SITE_AREA_PATH] = the path to the site area where the content resides.

[CONTENT] = the name of the content item.

To address a specific portal page, use one of the following parameters. The parameters cannot be combined.

page: Specify the unique name or the object ID of the page.

mapping: Specify the URL mapping for the page.

current: Indicates that the current page should be used.

Dynamic page lookup: The page parameter is optional. You can use the link broadcasting feature of the JSR 286 Web content viewer to dynamically look up pages by simply omitting the page parameter. For example, if you have a content item called News1, stored in the library Web Content under the site My Site and the site area News, you can create a link to that content item with the following URL:
http://host_name/wps/mypoc?urile=wcm%3Apath%3A/Web+Content/My+Site/News/News1

Alternatively you can also add a specific portal page using a URL mapping by using the following format:

http://[PORTAL_HOST]/[PORTAL_CONTEXT_ROOT]
/[PORTAL_PAGE_URL_MAPPING]/?current=true&urile=wcm%3Apath%3A[LIBRARY]/[SITE]/[SITE_AREA_PATH]/[CONTENT]


[PORTAL_HOST] = the name of the portal host

[PORTAL_CONTEXT_ROOT] = the portal context root. For anonymous sites use /wps/portal, otherwise use /wps/myportal

[PORTAL_PAGE_URL_MAPPING] = the compound name of the portal URL mapping to the portal page that contains the Web Content Management portlet (URL mappings can be set up using the portal administration portlets).

[LIBRARY] = the name of the Web content library.

[SITE] = the name of the site where the content resides.

[SITE_AREA_PATH] = the path to the site area where the content resides.

[CONTENT] = the name of the content item.

Note: The JSR 286 Web content viewer on the target page must be configured to receive links from Other portlets and this portlet.
Changing Web Content Management content via a Rendering Portlet from an external portlet or Web site
To create a link that causes an existing Rendering Portlet to display different Web Content Management Content, use the following URL format:

http://[PORTAL_HOST]/[PORTAL_CONTEXT_ROOT]
/[PORTAL_PAGE_URL_MAPPING]/?WCM_GLOBAL_CONTEXT=[ILWWCM_PAGE_URL]

[PORTAL_HOST] = the name of the portal host

[PORTAL_CONTEXT_ROOT] = the portal context root. For anonymous sites use /wps/portal, otherwise use /wps/myportal

[PORTAL_PAGE_URL_MAPPING] = the portal URL mapping to the portal page that contains the Web Content Management Portlet (URL Mapping's can be setup via the Portal Server Administration).

[ILWWCM_PAGE_URL] = the full URL to the Web Content Management Content.
Changing Web Content Management content via a Rendering Portlet from Web Content Management content

To create a link in Web Content Management Content that causes an existing Rendering Portlet to display different Web Content Management Content, use the following URL format:

http://[PORTAL_HOST]/[PORTAL_CONTEXT_ROOT]/[PORTAL_PAGE_URL_MAPPING]
/?WCM_GLOBAL_CONTEXT=/[LIBRARY]/[SITE]/[SITE_AREA_PATH]/[CONTENT]


[PORTAL_HOST] = the name of the portal host

[PORTAL_CONTEXT_ROOT] = the portal context root. For anonymous sites use /wps/portal, otherwise use /wps/myportal

[PORTAL_PAGE_URL_MAPPING] = the portal URL mapping to the portal page that contains the Web Content Management Portlet (URL Mapping's can be setup via the Portal Server Administration).

[LIBRARY] = the name of the Web content library.

[SITE] = the name of the site where the content resides.

[SITE_AREA_PATH] = the path to the site area where the content resides.

[CONTENT] = the name of the content item.

Adding cache paramters to a URL
You can add Web content Cache parameters and Cache expire parameters to a URL to custom caching strategies to individual items. For example:

http://[HOST]/wps/wcm/connect/[LIBRARY]/[SITE]/[SITE_AREA_PATH]/[CONTENT]>?cache=site&contentcache=session

Adding a last modified parameter to a URL
You can add the last modified date of the current content item to the header of the rendered page. For example:

http://[HOST]/wps/wcm/connect/[LIBRARY]/[SITE_AREA_PATH]/[CONTENT]>?returnLastModified=true

5 comments:

  1. Hi Jerome have you ever had a problem in which anonymous users get authenticated urls generated (i.e. myconnect)?

    ReplyDelete
  2. how do you create a link to a file uploaded into the content item using the file upload component in the authoring template?

    ReplyDelete
  3. Hi Juan

    Are these still existing problems for you?You can add me to your Gtalk - I am jerome.slinger@gmail.com and I will gladly help you resolve them.

    Yours in WebSphere
    Jerome

    ReplyDelete
  4. Hi Jerome, Im having that problem, All my URLs in my search result pages are generated for authenticated users.

    can you help me?

    ReplyDelete
  5. Hi Overon, do you still have this problem?

    ReplyDelete