Showing posts with label wcm. Show all posts
Showing posts with label wcm. Show all posts

Monday, June 8, 2009

Retrieving the rendering context within a WCM .jsp component



Question
How do you retrieve the rendering context within a Lotus Web Content Management (WCM) .jsp component?

Answer
Sample .jsp:
1. For the preview to work, place the code in the following directory:
\ibm\WebSphere1\profiles\wp_profile\installedApps\\wcm.ear\ilwwcm.war\jsp\html>

2. Access via a .jsp component configured with the following path: /jsp/html/render.jsp.
    Note that this .jsp will not work if accessed directly using a URL in a browser such as xxxx/wps/wcm/jsp/html/render.jsp. The .jsp must be accessed via Preview or a rendering portlet.

    If you are accessing the content via the Web Content Viewer local rendering portlet, you must also place the .jsp in the war/jsp/html directory for the local rendering portlet. Here is a sample location:

    \websphere\PortalServer\installedApps\WCM_Local_ng_Portlet_zkj5916.ear\zkj5916.war\jsp\html\
    If you use the Remote Rendering Portlet, you must place it there as well.
    <%@ taglib uri="/WEB-INF/tld/wcm.tld" prefix="wcm" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" %>
    <%@ page import="com.ibm.workplace.wcm.api.*" %>
    ">Cannot get Workspace

    <%

    RenderingContext currentRenderingContext = (RenderingContext) pageContext.getRequest().getAttribute(Workspace.WCM_RENDERINGCONTEXT_KEY);


    out.println("APP PATH: " +currentRenderingContext.getWcmWebAppPath() + "
    ");

    out.println("Servlet PATH: " +currentRenderingContext.getWcmServletPath() + "
    ");

    out.println("Rendering Context " +currentRenderingContext.getPath());

    %>

    <%--
    Note: if the rendering context is returning %2F instead of "/", you may want to use the string replaceAll method to modify. For example:

    String myContext = currentRenderingContext.getPath();
    String myModifiedContext = myContext.replaceAll("%2F", "/");
    --%>

Thursday, June 4, 2009

How to tell that search indexing has completed in IBM Web Content Management (WCM)



Question
As the system administrator of an IBM® Web Content Management (WCM), you are interested in learning if the product's search index can completed being processed. How does one verify that the search indexing has completed?

Answer
The WCM system's SystemOut.log and trace.log files can be used to indicate the status of the search index's state of completion.



Search stringMeaning
IndexMaintainer.processPendingUpdates. ProcessedThis entry in the WCM SystemOut.log indicates that the index maintainer task is completed.
Example:
[12/4/07 19:45:58:734 IST] 0000013e JCRCFLLoggerI I com.ibm.icm.ts.tss.JCRCFLLoggerImpl com.ibm.icm.ts.tss.app.IndexMaintainer.processPendingUpdates [java.lang.ThreadGroup[name=icmciWorkManager: icmjcrear,maxpri=10]] com.ibm.icm.ts.tss.app.IndexMaintainer.processPendingUpdates [java.lang.ThreadGroup[name=icmciWorkManager: icmjcrear,maxpri=10]]: - IndexMaintainer.processPendingUpdates. Processed 149 events for index: 1




Search stringMeaning
IndexMaintainer.runIndexMaintenance() (*** no pending updates***)This entry in the WCM trace.log indicates that there are no events needing to be processed.
**Note:**
This output written to the trace.log requires that the following configuration be enabled:
com.ibm.icm.ts.*=finest

Friday, May 1, 2009

How to get user ID of logged-in user from LDAP

How do you retrieve the user ID of a logged-in user from the LDAP instead of the user name which may not be unique?

There are two ways to achieve this :
1. Setting the "api.use.dn" parameter in WCMConfigService.properties to True gives you the distinguished name (DN) of the user instead of the display name when calling the getUserName() method.

2. You can dynamically set this by calling

"workspace.useDistinguishedNames(true)" before calling "workspace.getUserProfile()".
Essentially this would be similar to the following:

Workspace workspace = p_contextProcessorParams.getWorkspace();
workspace.useDistinguishedNames(true);
String currentCust = CustContextProcessorUtils.getCustomer(workspace.getUserProfile().getUsername());

Saturday, April 25, 2009

Configuration Web Content Management for accomodating multiple LDAP sources

Problem
Each time syndication takes place between your IBM® Web Content Management (WCM) authoring and rendering nodes--each configured to access a different LDAP source--you have the run the MemberFixer tool to remove extraneous references and avoid "member not found" exceptions.

Symptom
The WCM users who author content are present in the internal user LDAP source. When syndication propagates content from the authoring to the rendering server, which is coupled to a different LDAP source, all the references to internal LDAP entries results in "member not found" exceptions.

The only known solution to remove those unnecessary references to is utilize the MemberFixer utility each time syndication runs.

Environment
Your IBM Web Content Management environment includes and authoring WCM server connected to one LDAP source and one or more WCM rendering services configured to perform user look-ups on a different LDAP source.

Resolving the problem
Running the MemberFixer after every syndication is not how the product is designed to function, nor is it a recommended solution.
Web Content Management integrates within environments possessing more than one LDAP environment so long as both the DN and WMM External ID for each member (internal as well as external) resolves to the correct entity in each of the various LDAP sources.


There are two options:

1. Establish LDAP sources in which the DNs are consistent across the multiple environments

NOTE:
If the DNs are not the same across LDAP environments--that is to say that the LDAP sources contain different users and groups--then a common set of groups must be included in each LDAP. Each of these newly-created common groups must be given the DN and WMM External ID. Next, configure your WCM security utilizing these common groups. Each common group, however, may contain different members, depending on the particular LDAP directory.

2. Modify the WMM configuration to pull the WMM External ID from an accessible LDAP attribute.

NOTE: This step assumes that LDAP data is configured to replicate between each environment.



Once either option 1 or option 2 is configured, the MemberFixer will need to be run ONCE to update the data on the authoring server. Once complete, the Member Fixer tool not need to be re-run again.


WebSphere Portal Information Center topic: Mapping external IDs (extId) in Member Manager

Web Content Management search seed list to a readable format?

Question
A wcmsearchseed list page is used by the WebSphere Portal search engine to crawl a Web Content Management (WCM) searchable site. However, the wcmsearchseed list page is not human readable.

Cause
By default, the wcmsearchseed list page is base64 encoded.

Answer
If you are interested is seeing the wcmsearchseed list page in a format that you can read for debug purposes, then copy the Managed Web Content site content source URL, open a new Web browser, and access the copied URL with the following appended URL parameters:

&userid=&password=
&debug=1


The number of items per page in the wcmsearchseed list is configured by /wcm/shared/app/config/wcmservices/SearchService.properties SearchService.DefaultSeedPageSize. The default is 200. To see more than the first page, append the following URL parameter also:

&pageNum=


The first page is &pageNum=0.

An example of the viewable default wcmsearchseed list URL is as follows:

http://www.ibm.com:10038/wps/wcmsearchseed/searchseed?
siteid=98eae7804755055eb71db746880f549b&userid=wpsadmin& password=wpsadmin_password


An example of the URL for the viewable wcmsearchseed list that you can read is:

http://www.ibm.com:10038/wps/wcmsearchseed/searchseed?
siteid=98eae7804755055eb71db746880f549b&userid=wpsadmin& password=wpsadmin_password&debug=1


An example of the URL for the viewable wcmsearchseed list (second page) that you can read is:

http://www.ibm.com:10038/wps/wcmsearchseed/searchseed?
siteid=98eae7804755055eb71db746880f549b&userid=wpsadmin& password=wpsadmin_password&debug=1&pageNum=1

JCR Troubleshooting topic: locks and deadlocks

Problem
How does one perform troubleshooting in IBM® Web Content Management regarding locking issues with JCR?


Resolving the problem
Locks

What is the best way to approach locks (AccessDenied, object has violated one or more lock constraints)?


There are two primary types of locks leveraged by the repository--external and internal. External locks are defined by the JCR specification and allow users to place locks on items to prohibit certain actions from other users. WCM supports only a "write" lock on a per-node basis within the product's implementation which means that user with the proper permission (PAC Action EDIT (EDITOR role)) can "lock" a node within the system. This "external" lock prohibits any other user from being able to persist changes to that node. In particular to be able to call save on that node alone. Interestingly enough it doesn't prohibit another user from indirectly modifying the node by operating on its parent (ie: another user could still delete the locked node by deleting its parent node).

Internal locks are known as "consistency" locks. These locks are used by the internal implementation to attempt to prohibit situations where merge conflicts or consistency conflicts could be encountered. For instance, if one creates a "dynamic workspace" from a stable workspace and then adds a node to a node that exists in the stable workspace, the system MUST place an "internal" lock on the node in the stable workspace to prohibit any other user from deleting it. If another user deleted the node, then the merge of the dynamic workspace would later fail. The consistency locks prevent situations like this from occurring.

In an effort to allow applications to know when such locks may prohibit actions, all internal locks are EXPOSED as "external" locks on nodes owned by the workspace itself. This allows applications to investigate locks and to take correct actions when "internal" locks exist.

When faced with an operation that is being reported as causing an AccessDeniedException (object has violated one or more lock constraints) this indicates that there are one or more locks that exist that prohibit this user from executing the operation just requested. Again, please note this isn't a bug it is the repository's way of alerting an application that they are prohibited from the operation at this moment due to a lock constraint. To help identify what the source of the constraint is, the following steps should again be utilized:

1. Identify the WCM class that is making the request that is failing and enable FINEST trace point for it.
2. Enable com.ibm.icm.*=finest trace point
3. Recreate and capture the traces. Look for the entry into the WCM class. From that point, look for the AccessDeniedException. From that exception walk upward on the thread id until you find a trace point for com.ibm.icm.jcr.NodeImpl save. This will output any locks that prohibited the save from completing. With this knowledge you can engage IBM Support. Please note within the output for the Lock object, the owner of the lock will be shown. If the lock is an "internal" lock the owner will be shown in some form as "Workspace XXXXX". This is how you can identify if an internal lock is prohibiting the operation vs and external lock owned by another true user of the system.


In addition, you can use selectableDisplayLocks.jsp to display all locks on a given node (and its children). Contact IBM Support for a copy of this jsp.


The following common exceptions are related to JCR Access and Locking exceptions:
User Name contains a comma (javax.jcr.LoginException)

Example: javax.jcr.LoginException: Login failed for UserId: cn=Smith, John, cn=users,dc=ibm,dc=com. Retrieved authenticated subject with unmatching UserId: CN=Smith\, John,CN=Users,dc=ibm,dc=com

The user name cannot contain a comma. If so, its name cannot be correctly processed by JCR internals.

AccessDeniedException

When the user sees an AccessDeniedException from WCM, it can mean one of the following possibilities:

The logged in user does not have available Portal Access Control for this object

This is a valid exception if the user does not have the correct access rights for the requested action. The administrator must grant the necessary rights through Portal for that object and action.

The JCR node is locked by another workspace

Example:
NodeImpl 3 com.ibm.icm.jcr.NodeImpl save(false, false) Found lock on path: /contentRoot/icm:libraries[8]/Content/epfsite/welcome owned by: Workspace 7c2ba800465031b597d5f719fed3c258
SystemErr R com.ibm.icm.jcr.access.AccessDeniedException: The requested operation violates one or more lock constraints.: [ErrorCode:7591]

This is the common occurrence if the node is being held by another draft. In this case, you must first delete the node and its draft workspace before proceeding.

Older version of Portal have seen problems after a failed library delete where drafts are still left in the library. If this is the case, contact IBM Support to review the issue and provide the cleanup tools as needed. It is recommended to make a full database backup before using any tools which directly modify the database.

The JCR node is locked by another user

This is the common occurrence where another user is working on the same node, and is considered to be normal behavior. The best course of action for this failure is to log in as the other user and unlock the node.

If that user has been removed, IBM Support has the tools to remove the locks for that user. Contact IBM Support to review the issue and provide the needed tools if indicated. It is recommended to make a full database backup before directly modifying the database.

Delete all JCR locks for a node.

WARNING: Incorrectly updating the database tables can lead to database inconsistencies and deadlocks. You should not remove all of the locks for a node unless you are in the process of deleting that node, and have exhausted all other possibilities.

To delete all of the JCR locks for a node, you need to know the UUID for that node. IBM Support has a utility to internally remove the locks for that node. Contact IBM Support to review the issue and provide the required utility if indicated. It is recommended to make a full database backup before using any tools which directly modify the database.



Tracing all SQL statements (including host variables)

Enabling the pls.debug.trackStatementCursorLeakage setting in icm.properties, combined with JCR trace (com.ibm.icm.*=all), will trace all of the SQL from JCR, combined with the host variables. Note that this setting will significantly slow down performance, so you you should reset pls.debug.trackStatementCursorLeakage to false after collecting the necessary trace data.

To enable this value, do the following:

1. Stop Portal Server
2. Edit /jcr/lib/com/ibm/icm/icm.properties, and set the following property:
pls.debug.trackStatementCursorLeakage=+
3. Set trace to com.ibm.icm.*=all and restart Portal

Deadlocks
Derby (Portal 6.1)
SQL Exception: A lock could not be obtained within the time requested

Check the derby.log file to verify that the customer is running at at least build 639536 of Derby 10.1.3.2.

DB2
Database hang during Portal upgrade

We have seen a problem where the customer will see a database hang while upgrading Portal version, for example upgrading to 6.0.1.4. This issue can occur when the database user does not have DBADM authority. Note that it is not enough to only grant SYSADM authority to the user, but the user must have explicit DBADM authority.

How to combine the results of queries based on two criteria in the Web Content Management local rendering portlet

Problem
When using an IBM® Web Content Management (WCM) local rendering portlet, how can one utilize the combined query results based on two criteria?

**Note:** This information is not included in the WebSphere Portal information center topic: Defining menu element formatting options.

Cause
A menu element displays metadata and content from content items that match the search criteria of the menu element. The search criteria of a menu element can include matching site areas, authoring templates, categories and keywords.

The information center topic Defining menu element formatting options does not include any reference for a more complex scenario whereby you could combine the results of a query based on two criteria to include the results of both queries -- a menu component that retrieves content based on a query that considers both a site area or a category.

Example: Menus that display "ALL the contents for a specific site area and an item that is in another site area and has been tagged with a specific category" by combining the search parameters "Site area X" and a "category Y".

Resolving the problem

1. Create two menus: one for each specific query.

2. Wrap both menus using an HTML component.


This combination should resolve the issue while providing optimal application performance.

How to reposition drafts using the Web Content Management v6.1 API

Problem
Unlike Web Content Management version 5.1, in version 6.1, the API method getAllChildren does not return drafts in-line. Instead drafts are returned after the order list of published and expired items, limiting the users' ability to view the position changes made to draft items and to view the overall position of the elements within a site area.

Symptom
The getAllChildren method does not return drafts in order.

Cause
Drafts are not included in the main hierarchy for version 6.x.

Resolving the problem
Drafts can be repositioned using the method moveSiteFrameworkDocument.


The getAllChildren method will not return the draft item in order, however once the item is published, the order will be as specified/set by the moveSiteFrameworkDocument method.

Drafts are not included in the main hierarchy for version 6.x. Although the drafts can be repositioned with moveSiteFrameworkDocument, the results returned by getAllChildren(int) will not correctly order draft items. Draft items are always returned after the other items.

Workaround :
You may create a workflow to make the item published with restricted access to sort out this issue

Using WCM API in EJB

When accessing the WCM API through the use of an EJB, the transaction type of the EJB should be set to Bean managed, and not Container managed
Technote (FAQ)


Cause
When accessing the WCM API through the use of an EJB, if the transaction type of the EJB is set to Container Managed, the API does not work as expected and will throw following exceptions in logs.

ContentServic E Error while calling a function updateItems of PLS data manager.: Error while calling
a function updateItems of PLS data manager.
javax.jcr.StaleValueException: Error while calling a function updateItems of PLS data manager.: Error while calling a function updateItems of PLS data manager...

Answer
Set the transaction type of the EJB to Bean managed, and not Container managed, while accessing the WCM API through the use of EJB

Customizing error pages in Web Content Management

Problem
When using IBM Web Content Management (WCM), there is no way to change the error pages if 404 errors are returned. For example, when using servlet rendering to render a website, if you try to request a URL that doesn't exist, you are presented with a 404 error.
Is it possible to display a customer page with this error?

Resolving the problem
You can bypass Portal's default behavior by implementing a solution using servlet filters to return custom error pages.
One example of how to implement this solution is covered in detail on the Portal Family Wiki as Custom Error Pages.

Specify a destination library when using Remote Actions URL extension

Question
When constructing a "Remote Action" URL, is there a way to specify a destination library?

Answer
A remote action is triggered using the query string parameter ?wcmAuthoringAction=action, where action is one of the following:


new
This is used to open new item form. You must also specify a "type" parameter.


For example:

* ?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM_Content


Now if you want to create a new content and also want to specify a destination library, then you must use &library=libraryName.

How to use WCM Memberfixer to replace a non-existent user or group with an existing user or group

Question
You need to have a batch tool to reassign Web Content Management item-level security settings.

For example: Your LDAP groups were consolidated, which merges multiple groups into a single group. Your Web Content Management (WCM) items are assigned group access, but you need to update thousands of WCM content items, sites, and so on, to accommondate the group changes.

Is there a way to reassign the user or group references assigned to the WCM items to match the user or group reorganization?

Answer
You can use the Memberfixer utility to make these changes. A fix was included in Web Content Management 6.0.1.1 and later that allows you to edit the WCMConfigService.properties file with mappings to your existing DNs.

The member fixer module's "alt_dn" mode now checks for mapped alternate DNs in the WCMConfigServices.properties file before using the configured values in the wpconfig.properties file.

Perform the following steps to map user and group DNs in the WCMConfigServices.properties file before running the member fixer module:

1. Map the user and group DN syntax changes in the
PortalServer\wcm\shared\app\config\wcmservices\WCMConfigServices.properties file like so:

EXISTING_DN_KEY=NEW_DN_SYNTAX

where:

o EXISTING_DN_KEY is the key constructed from the existing DN by replacing all equal sign characters "=" and spaces " " with underscores "_"

o NEW_DN_SYNTAX is the replacement DN syntax.


For example, if you have a user branch with the following DN syntax:

cn=Jane Smith,ou=Portal Users,o=IBM


You construct the EXISTING_DN_KEY by replacing all "=" and " " with "_" in the DN. So in this example the EXISTING_DN_KEY will be:

cn_Jane_Smith,ou_Portal_Users,o_IBM


If you are changing the syntax of this branch to:

cn=Jane Jones,ou=Portal,o=IBM


The NEW_DN_SYNTAX will be the new DN as is.

This gives you the following mapping entry in your WCMConfigServices.properties file like so:

cn_Jane_Smith,ou_Portal_Users,o_IBM=cn=Jane Jones,ou=Portal,o=IBM


You can of course have mapping entries for multiple users that need to explicitly mapped to a new DN

cn_Jane_Smith,ou_Portal_Users,o_IBM=cn=Jane Jones,ou=Portal,o=IBM
cn_Mary_Jane,ou_WCM_Users,o_IBM=cn=Mary Smith,ou=WCM,o=IBM


2. You could then run the member fixer as normal using the alt_dn option:

http://[HOST]:[PORT]/wps/wcm/connect?MOD=MemberFixer&library=[LIBRARY_NAME]&alt_dn=UPDATE&fix=true


Note: For this procedure to work, the LDAP entry for cn=Jane Smith,ou=Portal Users,o=IBM does not exist. This user only exists as seen on the WCM content. If the user actually existed in the LDAP, the Memberfixer would not have been triggered to detect there was any issue.

Important Note: Always backup your system (WCM/Portal Server and WCM/Portal Databases) before running the Memberfixer in fix mode. The Memberfixer when run in a fix mode will update your WCM data; you should have a database backup as a best practice for a backup/recovery plan.

Thursday, April 16, 2009

URL encoding spaces in WCM_GLOBAL_CONTEXT with %20 will fail.

Problem
The IBM Web Content Management (WCM) local rendering portlet will always render the default content configured to it .However. if you want to overwrite a WCM local rendering portlet with new content, place the following string at the end of the link to the page:

?WCM_GLOBAL_CONTEXT=/wps/wcm/myconnect/library/site/sitename/content


If the WCM library, site, site area, or content contains spaces in the name , using "%20" as URL encoding for spaces fails to render the specified content in WCM_GLOBAL_CONTEXT and therefore, the local rendering portlet will render the default content.

Example:
The library name is "Intranet library". Encoding this library name is "Intranet%20library". WCM_GLOBAL_CONTEXT is used with the following URL encoding:

?WCM_GLOBAL_CONTEXT=/wps/wcm/myconnect/Intranet%20library/site/sitename/new_content

Clicking the link with "WCM_GLOBAL_CONTEXT" added will cause the local rendering portlet to render only the default content. It will fail to render new_content from "Intranet library".

Exceptions in the systemOut.log would be:
com.aptrix.pluto.renderer.BadPathInfoException: IWKPL1453X: Exception occured while processing request: /Intranet%20library/site/sitearea/new_content/

at

com.aptrix.pluto.renderer.RenderContext.generateContext(RenderContext.java:488)

at com.aptrix.pluto.renderer.RenderContext.(RenderContext.java:294)
at

com.ibm.workplace.wcm.api.WCM_RenderingContext.createRenderContext(WCM_RenderingContext.java:866)

at

com.ibm.workplace.wcm.api.WCM_RenderingContext.getRenderContext(WCM_RenderingContext.java:395)

at

com.ibm.workplace.wcm.api.WCM_RenderingContext.getContent(WCM_RenderingContext.java:988)
...

Symptom
In the above example, "Intranet%20library" will be encoded again to "Intranet%2520library", where "%25" is the encoded value for "%". This means that "%25" will lead to the new encoded string, "Intranet%2520library".


Since there is no library named "Intranet%20library" (the decoded value of "Intranet%2520GSC"), it will fail.

Resolving the problem
Use the plus sign ("+") instead of "%20".
For example, use following URL encoding in WCM_GLOBAL_CONTEXT:

?WCM_GLOBAL_CONTEXT=/wps/wcm/myconnect/Intranet+library/site/sitename/new_content

This will overwrite the default content of the local rendering portlet with new_content from Intranet library.

Specify a destination library when using Remote Actions URL extension

Question
When constructing a "Remote Action" URL, is there a way to specify a destination library?

Answer
A remote action is triggered using the query string parameter ?wcmAuthoringAction=action, where action is one of the following:


new
This is used to open new item form. You must also specify a "type" parameter.


For example:

* ?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM_Content


Now if you want to create a new content and also want to specify a destination library, then you must use &library=libraryName.

Implementing a custom logout link when using WCM servlet rendering

Question
How do you implement a custom logout link when using Lotus Web Content Management (WCM) servlet rendering?

Answer
To implement a custom logout link in WCM servlet rendering, copy the WebSphere Portal logout link.
If there is a requirement to display a special page after logout, use the property redirect.logout.url in the ConfigService.properties file located at \PortalServer\config and set it to point to the custom logout page.

unable to select the Web 2.0 theme for use with a local rendering portlet.

Problem(Abstract)
You are unable to select the Web 2.0 theme for use with a local rendering portlet.

Cause
By default, the local rendering portlet is on the Web 2.0 theme's portlet blacklist because of a known issue where the browser applet used to edit content with Rich Text fields does not load correctly in Internet Explorer when using authoring tool components.

If this is not a valid use case in your environment, then you can choose to remove the portlet from the blacklist at your own discretion. It is recommended that you test the local rendering portlet in the Web 2.0 theme before putting it into production.

Resolving the problem
To use the Web 2.0 theme with a local rendering portlet, you need to remove the local rendering portlet from the blacklist by either removing or commenting out the following line from the portlet blacklist, or by setting the value to "false":


"wcm.contentviewer.1001":false


The blacklist is stored in a JavaScript file in the Web 2.0 theme: /js/portletsForServerSideOnly.js .

Any cached copies of the JavaScript file will need to be cleared from browser and proxy caches before the change will take effect in a client browser.

Friday, April 10, 2009

How to force the WCM rendering portlet to show the default content


Question
The Workplace Web Content Management™ (WCM) rendering portlets have default content that they are configured to show. When a user clicks a link that updates the portlet to display updated content, if the user clicks away from the portlet and clicks back, the updated content still displays.

Cause
There is no actual problem with this scenario. This is the expected behavior of the portlet, because it is designed to maintain its state even when navigating away from the Portal page.

Answer
One way to force the Web content viewer portlet to display the default content is to override the link to the Portal page that contains the portlet. To update a WCM portlet with new content, place the following string at the end of the link to the page:

For Web Content Management version 6 and above:


?WCM_GLOBAL_CONTEXT=/wps/wcm/myconnect/library/site/sitename/content


For earlier versions of Web Content Management:


?WCM_GLOBAL_CONTEXT=/wps/wcm/myconnect/site/sitename/content


It can be simple to do this override when writing links within WCM to this content, but how do you force it in the WebSphere Portal navigation? For example, you have a page in WebSphere Portal named "Home." You want the WCM content displayed within to always be the default when the user clicks on the Home page tab.

One solution is to customize the WebSphere® Portal theme, and override the functionality that is providing the links. In the Default.jsp in the IBM sample theme, there is a file named topNav.jsp that generates these links. Once you know the name of the page, and the default WCM content that you want to be displayed, you can override the links to always force the default content.

In the IBM provided file, this change would be from this code:








  • To the following code:



  • <%
    String myString = wpsNavNode.getContentNode().getTitle(request.getLocale());
    if(!myString.equalsIgnoreCase("CKTestSearch")) {
    %>

    <%} else { %>

    <%}%>





  • In this example, the WebSphere Portal page was named "CKTestSearch", and WebSphere Portal is version 6.


    Additionally, if the default content in the portlet is going to be changing, in order to not have to constantly update the navigation jsp the portlet can be forced to always display the default content for the portlet. To accomplish this, in the above sample, leave the WCM_GLOBAL_CONTEXT= blank.

    So, instead of
    ?WCM_GLOBAL_CONTEXT=/wps/wcm/myconnect/Library/Site/SiteArea/ContentName
    Use
    ?WCM_GLOBAL_CONTEXT=

    That way, when nothing is passed to the portlet, it will default to the default content for the portlet.

    How to reset Page Navigation Component to render the contents from first page in local rendering portlet

    How to reset Page Navigation Component to render the contents from first page in local rendering portlet



    Cause
    Since using the same paging component across multiple navigator or menu components , the paging component itself is not being updated, the paging component will maintain its state until it gets specifically told to update by a URL request.

    While clicking on a paging link, it will have information in the URL about which page to display. With this information in the URL, the paging component can update to display the next page, previous page, etc
    Now , if a specific request to the page comes in, and the URL does not have any paging parameter information, the page element will not be changed.

    This is not a problem if the paging elements are not being shared, because each paging component when it is first rendered will start at page one, and then hold the page information in the session.

    So in this case, while clicking on a link to a piece of content, and the portlet is updated, since the links are clicking does not have any paging information, the paging component will not be updated, and will always renders the contents from last selected page.

    Answer
    In order to reset the page navigation component and force page navigation component to render from first page , the parameter WCM_Page.ResetAll=TRUE can be appended as querystring while generating links into page navigator component design.

    For example
    &WCM_Page.ResetAll=TRUE" >

    This parameter will reset the page navigation component and it always start rendering from first page.

    Moving From IBM Workplace Web Content Management API V.5.x To V6.0

    Table of Contents
    Moving From IBM Workplace Web Content Management API V.5.x To V6.0 1
    Introduction 1
    What's New In The API 2
    Direct and Linked Content 3
    Libraries 3
    Moving and Copying Items 4
    Retrieving a Repository Object Via Portal Services 4
    Component Types 5
    Limitations 5
    Deprecated Methods 6
    Example 6
    Summary Comparison of the WCM API v5.x and 6.0 Interfaces 6
    A Detailed Look At Key Individual Interfaces 9
    Taxonomies 9
    Categories 10
    Site 11
    SiteArea 13
    Content 15
    ContentComponents 17
    LibraryFile, LibraryImage, LibraryHTML 19


    Introduction
    The IBM Workplace Web Content Management (WCM) Java API allows a programmer to access Web Content Management functionality in order to create custom portlets, servlets and other applications such as bulk resource import and importing of content from third-party web content management systems.. The API provides access to important items during the content creation and rendering process. Specifically the API provides interfaces for WCM items such as workspace, content, sites, site areas, taxonomies, categories, workflows and library components.
    Since the WCM API is not new there are a number of good resources available. For example:
    • The API Java doc was_profile_root\AppServer\profiles\wp_profile\installedApps\nodename\wcm.ear\ilwwcm.war\webinterface\
    • A section in the redbook for WCM 5.x: http://www.redbooks.ibm.com/redbooks/SG246792/wwhelp/wwhimpl/js/html/wwhelp.htm
    • A developerworks article for WCM 2.0
    http://www-128.ibm.com/developerworks/lotus/library/lwwcm-api/
    • The Portal 6.0 InfoCenter

    This article describes the differences between version 5.x and version 6.0 of the APIs, and therefore assumes the reader is familiar with the v5.x API. In that light, this document adds to the information in the above resources:
    • explaining new functionality available via the 6.0 version of the API as well as any limitations of the API.
    • outlining the new interfaces and methods
    • identifying deprecated methods and what to use in place of them .
    • providing tables that summarize the comparison of the two API interfaces and methods
    • providing updated code examples

    What's New In The API

    There are a number of new interfaces and methods in the v6.0 API. These include support for:
    • Libraries
    • Additional Library Component Types:
    • Date
    • DocumentManager
    • Link
    • Numeric
    • StyleSheet
    • UserSelection
    • Additional ContentComponent Types:
    • Date
    • DocumentManager
    • Link
    • Numeric
    • OptionSelection
    • UserSelection
    • Direct and Linked Content in a SiteFrameworkContainer
    • Getting a Repository object via Portal Services
    • Additional capabilities for items: such as locking, moving, copying and create/add/remove content components.
    • References

    The InfoCenter has background information on most of the above topics such as libraries and the different component types. The InfoCenter combined with the Javadoc makes some topics straightforward. There are however some points that we raise or expand on in this article.

    Best Practice Even though the WCM API is powerful and can be used to build custom rendering portlets, that may not be the best approach for a given project. The OOB functionality of WCM and Rendering Portlets can save a lot of time and be more performant. Each project should consider their unique needs. Similarly, categorization and Personalization rules should be used to personalize a site rather than using the WCM API.

    Note Only the WCM public APIs are supported.
    Direct and Linked Content

    Because of a different underlying storage mechanism being used by WCM (the Java Content Repository often referred to as the JCR), there were some changes in the API regarding the handling child items. In addition, the current Javadoc version requires some clarification to lessen confusion.

    For explanation purposes let's look at SiteAreas. Content is now either directly contained within a SiteArea (think containment) or is linked in. So instead of just two methods for retrieving children (SiteFrameworkContainer.getChildren which gets the immediate children and SiteFrameworkContainer.getAllChildren which gets all descendants), there are now two additional ones (SiteFrameworkContainer.getDirectChildren and SiteFrameworkContainer.getAllDirectChildren). When you see the word 'direct', that implies that ContentLinks will not be returned. Alternatively, if you want just the linked content you would use SiteArea.getLinkedChildren.

    There are other manifestations of this change in the API. For example, SiteArea.hasDirectContent to check whether the SiteArea has a direct child of the specified item. Similarly, there is also SiteArea.hasLinkedContent.

    To create new content you would use Workspace.createContent(templateId, siteAreaId,sibling, position), or to link in content- Workspace.CreateContentLink. Workspace.delete would be called for deleting content. The DocumentId that is passed in to delete will determine what happens- for example, if the DocumentId is returned from a SiteArea that links that content, the link is removed on the call to delete.

    Another item to note about the creation of content with the deprecated methods is that you could create content (with workspace.create()), save it, and then later attach it to a site area (with siteArea.addContent). This behavior is maintained in 6.0 by saving content items that do not have parents into the root folder, and then the user can explicitly associate them with a site area by moving them out of the root folder into the site hierarchy (the move methods are discussed below). It is preferable now however to create a content item in a location that already exists since it will simplify the work done in the background and perform better.

    Libraries
    The introduction of libraries brings WCM in line with the IBM Content Model partitioning concepts. Libraries are used to partition the content repository. This can be leveraged in several ways:
    • Roles can be defined that users and groups may have when working with different item types in libraries. This allows sharing or restricting access to content at the library level.
    • Syndication is performed at the library level rather that at the repository level. This allows libraries to be syndicated at different frequencies.
    • Libraries are essential for cleanly partitioned virtual portals. For example virtual portals can contain different authoring portlets pointing to shared and non-shared libraries.

    The WCM API has a number of methods to work with libraries. For example, use the Workspace.setCurrentDocumentLibrary method to make API calls library specific. If not specified, the default library identified in the WCMConfigService.properties file is used (This file is in portal_server_root/wcm/shared/app/config/wcmservices. The property is connect.connector.contentmodelconnector.defaultlibrary=DM). TBD verify property
    The are other methods available to get the current document library, get the document libraries available for a user of a workspace, copy and move items to another library, and to determine the containing library for a document:
    • Workspace.getCurrentDocumentLibrary
    • Workspace.getDocumentLibraries
    • Workspace.getDocumentLibrary
    • Workspace.copyToLibrary
    • Workspace.moveToLibrary
    • Document.getOwnerLibrary
    Moving and Copying Items


    There are three methods that have been introduced in 6.0 related to moving items:
    • Workplace.MoveSiteFrameworkDocument
    • Workplace.moveCategory, and
    • Workspace.moveToLibrary
    Workspace.moveSiteFrameworkDocument can be used for SiteArea, Content or ContentLinks, and can be used to move these items to another library as well. Workspace.moveCategory can also be used within or between libraries. Workspace.moveToLibrary can be used to move root items.
    Similarly Workspace.copyCategory and Workspace.copySiteFrameworkDocument are used to copy items within and between libraries and Workspace.copyToLibrary can be used for root items.
    TBD Verify info about moveToLibrary and copyToLibyrary.
    Retrieving a Repository Object Via Portal Services
    As introduced in v5.x, Repository and Workspace objects can be created in the following manner:
    Repository repository = WCM_API.getRepository();
    Workspace workspace = repository.getWorkspace("wpsadmin", "wpsadmin pw");
    In v6.0, the WCMApiService also enables a user to access the WCM API through Portal services. The service must be configured in "\shared\app\config\services.properties" as such:
    com.ibm.workplace.wcm.api.WCMApiService = com.ibm.workplace.wcm.api.WCMApiServiceImpl

    The following code example demonstrates how to use this:

    com.ibm.wps.services.Service service =
    com.ibm.wps.services.ServiceManager.getService(WCMApiService.class);
    WCMApiServiceImpl wcmService = (WCMApiServiceImpl) service;
    com.ibm.workplace.wcm.api.Repository rep = wcmService.getRepository();

    TBD verify the above.

    Best Practice The workspace object instance for each user in the session should be cached for performance reasons since creating a workspace for a user can be a time consuming operation.


    Component Types
    There are a number of new Library and Content component types in the API. These interfaces are straightforward to use with the Javadoc and InfoCenter on hand.

    • Additional Library Component Types:
    • Date
    • DocumentManager
    • Link
    • Numeric
    • StyleSheet
    • UserSelection
    • Additional ContentComponent Types:
    • Date
    • DocumentManager
    • Link
    • Numeric
    • OptionSelection (related to single/multiple select, min/max choices, enumerators, radio buttones, drop down, check boxes...)
    • UserSelection

    Best Practice ContentComponentContainer.getComponentByReference should be called instead of ContentComponentContainer.getComponent when the component is not going to be edited. This improves performance when the component will be read only.

    Best Practice PDM can be an effective way to store documents. Syndication needs must be considered however.
    Limitations

    The v6.0 API has added a lot of functionality as can be seen in the tables in the following sections. There are still some limitations however. Specifically, the current version of the IBM Workplace Web Content Management API does not allow read and write access to all items of the Web content management system. Some functionality is excluded to avoid potential damage to the data integrity or to avoid exposing functionality which can be changed significantly in future releases of the product.
    You cannot create, update, or delete workflows, workflow stages, workflow actions, taxonomies, categories, syndicators, subscribers, presentation templates and authoring templates.

    In general, reviewing the tables in the following sections will quickly show the reader what functionality is missing for specific WCM objects.
    Deprecated Methods

    There are a number of deprecated methods in v6.0. These mainly involve the following areas:
    • Creating, adding and removing content from a SiteArea
    • Working with Live Access Members
    • Adding and removing SiteAreas

    Adding and removing content was described above in a previous section. Calls to 'Live' access methods have the same effect as the 'Read' access method calls, so any 'live' access related methods are now deprecated. Other deprecated methods and their alternatives are straightforward and are identified in the tables in the following sections.

    Example

    The DeveloperWorks article “Introducing the Lotus Workplace Web Content Management API” (http://www-128.ibm.com/developerworks/lotus/library/lwwcm-api/), introduces a sample WCM API application. This sample application requires a couple of changes if the deprecated methods are to be avoided. In the CreateContentText.java file the createContent() method would require changes highlighted like this:

    public void runPost(HttpServletRequest request, HttpServletResponse response){
    Workspace workspace = config.getWorkspace();
    output = new StringBuffer();
    String publishingTemplateId = request.getParameter("publishingtemplateid");
    String siteAreaId = request.getParameter("siteareaid");
    String contentTitle = request.getParameter("contenttitle");
    String contentDescription = request.getParameter("contentdescription");
    String body = request.getParameter("body");
    Content content;
    SiteArea siteArea;
    DocumentIdIterator siteAreaChildren;
    HTMLComponent bodyComponent;
    int index = 0;
    try {
    //Replace the use of the deprecated createContent and addContent methods:
    //content = workspace.createContent(workspace.createDocumentId(publishingTemplateId));
    //siteArea = (SiteArea) workspace.getById(workspace.createDocumentId(siteAreaId));
    //siteArea.addContent(content.getId());

    // with this:
    siteArea = (SiteArea) workspace.getById(workspace.createDocumentId(siteAreaId));
    content =
    workspace.createContent(workspace.createDocumentId
    (publishingTemplateId), siteArea.getId(), null, ChildPosition.END);

    siteAreaChildren = siteArea.getChildren();
    ...

    Summary Comparison of the WCM API v5.x and 6.0 Interfaces

    Table 1 below shows a summary comparison of the WCM API interfaces between version 5.x and 6.0.Each row lists one of the main interfaces. Interfaces that have changed are explained in more detail in subsequent tables.

    Color Key:
    Unchanged interface
    New interface
    Interface that has changed or inherits from a changed interface
    Version 5.x Public API Version 6.0 Public API Comments




    AuthoringTemplate AuthoringTemplate Unchanged
    Category Category Unchanged, although some changes in inherited interfaces

    ChildPosition new
    Content Content

    ContentComponent ContentComponent Unchanged. There are new components however
    ContentComponentContainer ContentComponentContainer


    ContetLink new

    DateComponent new
    Document Document

    DocumentId DocumentId


    DocumentLibrary new

    DocumentManagerComponent new
    DocumentType DocumentType Unchanged
    DocumentTypes DocumentTypes

    Editable Editable

    EditableLibraryComponent EditableLibraryComponent

    EmbeddedImageMap EmbeddedImageMap Unchanged
    FileComponent FileComponent Unchanged
    HTMLComponent HTMLComponent Unchanged
    ImageComponent ImageComponent Unchanged
    LibraryComponent LibraryComponent Unchanged. There are new library components however

    LibraryDateComponent new

    LibraryDocumentManagerComponent new
    LibraryFileComponent LibraryFileComponent Unchanged, although some changes in inherited interfaces
    LibraryHTMLComponent LibraryHTMLComponent Unchanged, although some changes in inherited interfaces
    LibraryImageComponent LibraryImageComponent Unchanged, although some changes in inherited interfaces

    LibraryLinkComponent new

    LibraryNumericComponent new

    LibraryStyleSheetComponent new

    LibraryUserSelectionComponent new

    LinkComponent new

    NumericComponent new

    OptionSelectionComponent new
    PresentationTemplate PresentationTemplate Unchanged

    Reference new
    ReferenceComponent ReferenceComponent Unchanged
    RenderingContext RenderingContext Unchanged
    Repository Repository Unchanged
    RichTextComponent RichTextComponent Unchanged
    Site Site Unchanged, although some changes in inherited interfaces
    SiteArea SiteArea

    SiteFrameworkContainer SiteFrameworkContainer

    Taxonomy Taxonomy Unchanged
    TextComponent TextComponent Unchanged
    UserProfile UserProfile Unchanged

    UserSelectionComponent new

    WCMApiService new

    WCMApiServiceImpl new

    WCMServiceHome new
    Workflow Workflow Unchanged
    WorkflowStage WorkflowStage Unchanged
    Workspace Workspace

    WCM_API


    Table 1 Summary Comparison of the WCM API v5.x and 6.0 Interfaces

    A Detailed Look At Key Individual Interfaces

    The following sections provide tables that show what methods are needed to carry out specific functionality for each of the key WCM objects. The tables also show the differences between specificV5 and V6 interfaces as well as alternatives for deprecated methods. The WCM objects discussed include:
    • Taxonomies
    • Categories
    • Content
    • ContentComponents
    • Sites
    • SiteAreas
    • LibraryFileComponents, LibraryHTMLComponents, LibraryImageComponents


    Taxonomies

    The following table lists each major Taxonomy function and what interface and method is required to carry out that functionality for both the V5 and V6 APIs.

    Taxonomy Functions V5 Public API V6 Public API

    Create New Taxonomy N/A N/A
    Update Existng Taxonomy N/A N/A
    Remove Existing Taxonomy N/A N/A

    Get ID Document.getId() Same as V5
    Get Name Document.getName() Same as V5
    Get Title N/A Document.getTitle()
    Get Description Document.getDescription() Same as V5
    Get Authors Document.getAuthors() Same as V5
    Get Owners Document.getOwners() Same as V5
    Get Modified Date N/A Document.getModifiedDate
    Get Owner Library N/A Document.getOwnerLibrary
    Get Live Accesss Members Document.getLiveAccessMembers Same as V5 - Deprecated
    Get Read Access Members Document.getReadAccessMembers Same as V5
    Get Edit Access Members Document.getEditAccessMembers Same as V5
    Get Delete Access Members Document.getDeleteAccessMembers Same as V5

    Set Name N/A N/A
    Set Title N/A N/A
    Set Description N/A N/A
    Add Authors N/A N/A
    Remove Authors N/A N/A
    Add Owners N/A N/A
    Remove Owners N/A N/A
    Add Live Access Members N/A N/A
    Add Read Access Members N/A N/A
    Add Edit Access Members N/A N/A
    Add Delete Access Members N/A N/A
    Remove Live Access Members N/A N/A
    Remove Read Access Members N/A N/A
    Remove Edit Access Members N/A N/A
    Remove Delete Access Members N/A N/A

    Get Immediate Children Taxonomy.getChildren() Same as V5
    Get All Children Taxonomy.getAllChildren() Same as V5
    Add Child Category N/A N/A
    Remove Child Category N/A N/A


    Categories

    The following table lists each major Category function and what interface and method is required to carry out that functionality for both the V5 and V6 APIs.

    Category Functions V5 Public API V6 Public API

    Create New Category N/A N/A
    Update Existing Category N/A N/A
    Remove Existing Category N/A N/A
    Copy Category N/A Workspace.copyCategory
    Move Category N/A Workspace.moveCategory

    Get ID Document.getId() Same as V5
    Get Name Document.getName() Same as V5
    Get Title N/A Document.getTitle()
    Get Description Document.getDescription() Same as V5
    Get Authors Document.getAuthors() Same as V5
    Get Owners Document.getOwners() Same as V5
    Get Modified Date N/A Document.getModifiedDate()
    Get Owner Library N/A Document.getOwnerLibrary()
    Get Live Accesss Members Document.getLiveAccessMembers() Same as V5 - Deprecated
    Get Read Access Members Document.getReadAccessMembers() Same as V5
    Get Edit Access Members Document.getEditAccessMembers() Same as V5
    Get Delete Access Members Document.getDeleteAccessMembers() Same as V5
    Set Name N/A N/A
    Set Title N/A N/A
    Set Description N/A N/A
    Add Authors N/A N/A
    Remove Authors N/A N/A
    Add Owners N/A N/A
    Remove Owners N/A N/A
    Add Live Access Members N/A N/A
    Add Read Access Members N/A N/A
    Add Edit Access Members N/A N/A
    Add Delete Access Members N/A N/A
    Remove Live Access Members N/A N/A
    Remove Read Access Members N/A N/A
    Remove Edit Access Members N/A N/A
    Remove Delete Access Members N/A N/A

    Get Immediate Children Category.getChildren() Same as V5
    Get All Children Category.getAllChildren() Same as V5
    Get Parent Category.getParent() Same as V5
    Add Child Category N/A N/A
    Remove Child Category N/A N/A

    Site

    The following table lists each major Site function and what interface and method is required to carry out that functionality for both the V5 and V6 APIs.



    Site Functions V5 Public API V6 Public API

    Methods from Workspace Interface
    Create New Site Workspace.createSite() Same as V5
    Update Existing Site Workspace.save() Same as V5
    Remove Existing Site Workspace.delete() Same as V5

    Methods from Document Interface
    Get ID Document.getId() Same as V5
    Get Name Document.getName() Same as V5
    Get Title N/A Document.getTitle()
    Get Description Document.getDescription() Same as V5
    Get Authors Document.getAuthors() Same as V5
    Get Owners Document.getOwners() Same as V5
    Get Modified Date N/A Document.getModifiedDate()
    Get Owner Library N/A Document.getOwnerLibrary()
    Get Live Accesss Members Document.getLiveAccessMembers() Same as V5 - Deprecated
    Get Read Access Members Document.getReadAccessMembers() Same as V5
    Get Edit Access Members Document.getEditAccessMembers() Same as V5
    Get Delete Access Members Document.getDeleteAccessMembers() Same as V5

    Methods from Editable Interface
    Set Name Editable.setName() Same as V5
    Set Title N/A Editable.setTitle()
    Set Description Editable.setDescription() Same as V5
    Add Authors Editable.addAuthors() Same as V5
    Remove Authors Editable.removeAuthors() Same as V5
    Add Owners Editable.addOwners() Same as V5
    Remove Owners Editable.removeOwners() Same as V5
    Add Live Access Members Editable.addLiveAccessMembers() Same as V5 - Deprecated
    Add Read Access Members Editable.addReadAccessMembers() Same as V5
    Add Edit Access Members Editable.addEditAccessMembers() Same as V5
    Add Delete Access Members Editable.addDeleteAccessMembers() Same as V5
    Remove Live Access Members Editable.removeLiveAccessMembers() Same as V5 - Deprecated
    Remove Read Access Members Editable.removeReadAccessMembers() Same as V5
    Remove Edit Access Members Editable.removeEditAccessMembers() Same as V5
    Remove Delete Access Members Editable.removeDeleteAccessMembers() Same as V5
    Is Changed? Editable.isChanged Same as V5

    Methods from ContentComponent Interface
    Get Component ContentComponentContainer.getComponent
    ContentComponentContainer.getComponentByReference Same as V5
    Get All Components ContentComponentContainer.componentIterator Same as V5
    Get All Component Names N/A ContentComponentContainer.getComponentNames
    Check Has Component ContentComponentContainer.hasComponent() Same as V5
    Set Component Value ContentComponentContainer.setComponent() Same as V5
    Create New Component N/A ContentComponentContainer.createComponent
    Add New Component N/A ContentComponentContainer.addComponent
    Remove Component N/A ContentComponentContainer.removeComponent

    Methods from SiteFrameworkContainer
    Get Immediate Children SiteFrameworkContainer.getChildren() SiteFrameworkContainer.getDirectChildren
    SiteFrameworkContainer.getChildren
    Get All Children SiteFrameworkContainer.getAllChildren() SiteFrameworkContainer.getAllDirectChildren
    SiteFrameworkContainer.getAllChildren
    Add Child Site Area SiteFrameworkContainer.addSiteArea() Same as V5 - Deprecated - use Workspace.createSiteArea
    Has Child Site Area SiteFrameworkContainer.hasSiteArea() Same as V5
    Insert Child Site Area SiteFrameworkContainer.insertSiteArea() Same as V5 - Deprecated - use Workspace.createSiteArea
    Check Has Child Site Area SiteFrameworkContainer.hasSiteArea() Same as V5
    Remove Child Site Area SiteFrameworkContainer.removeSiteArea() Same as V5 - Deprecated - use Workspace.delete
    Get Default Content SiteFramworkContainer.getDefaultContent Same as V5
    Set Default Content SiteFrameworkContainer.setDefaultContent Same as V5
    Get Template Mapping SiteFrameworkContainer.getTemplateMapping Same as V5
    Add Template Mapping SiteFrameworkContainer.addTemplateMapping Same as V5
    Check Has Template Mapping SiteFrameworkContainer.hasTemplateMapping Same as V5
    Remove Template Mapping SiteFrameworkContainer.removeTemplateMapping Same as V5
    Get Associated Auth Tmplts N/A SiteFrameworkContainer.getAuthoringTemplateIds



    SiteArea

    The following table lists each major SiteArea function and what interface and method is required to carry out that functionality for both the V5 and V6 APIs.


    SiteArea Functions V5 Public API V6 Public API

    Methods from Workspace Interface
    Create New SiteArea Workspace.createSiteArea() Same as V5
    Update Existing SiteArea Workspace.save() Same as V5
    Remove Existing SiteArea Workspace.delete() Same as V5
    Copy SiteArea N/A Workspace.copySiteFrameworkDocument

    Methods from Document Interface
    Get ID Document.getId() Same as V5
    Get Name Document.getName() Same as V5
    Get Title N/A Document.getTitle()
    Get Description Document.getDescription() Same as V5
    Get Authors Document.getAuthors() Same as V5
    Get Owners Document.getOwners() Same as V5
    Get Modified Date N/A Document.getModifiedDate()
    Get Owner Library N/A Document.getOwnerLibrary()
    Get Live Accesss Members Document.getLiveAccessMembers() Same as V5 - Deprecated
    Get Read Access Members Document.getReadAccessMembers() Same as V5
    Get Edit Access Members Document.getEditAccessMembers() Same as V5
    Get Delete Access Members Document.getDeleteAccessMembers() Same as V5

    Methods from Editable Interface
    Set Name Editable.setName() Same as V5
    Set Title N/A Editable.setTitle()
    Set Description Editable.setDescription() Same as V5
    Add Authors Editable.addAuthors() Same as V5
    Remove Authors Editable.removeAuthors() Same as V5
    Add Owners Editable.addOwners() Same as V5
    Remove Owners Editable.removeOwners() Same as V5
    Add Live Access Members Editable.addLiveAccessMembers() Same as V5 - Deprecated
    Add Read Access Members Editable.addReadAccessMembers() Same as V5
    Add Edit Access Members Editable.addEditAccessMembers() Same as V5
    Add Delete Access Members Editable.addDeleteAccessMembers() Same as V5
    Remove Live Access Members Editable.removeLiveAccessMembers() Same as V5 - Deprecated
    Remove Read Access Members Editable.removeReadAccessMembers() Same as V5
    Remove Edit Access Members Editable.removeEditAccessMembers() Same as V5
    Remove Delete Access Members Editable.removeDeleteAccessMembers() Same as V5
    Is Changed? Editable.isChanged() Same as V5

    Methods from ContentComponentContainer
    Get Component ContentComponentContainer.getComponent()
    ContentComponentContainer.getComponentByReference() Same as V5
    Get All Components ContentComponentContainer.componentIterator() Same as V5
    Get All Component Names N/A ContentComponentContainer.getComponentNames()
    Check Has Component ContentComponentContainer.hasComponent() Same as V5
    Set Component Value ContentComponentContainer.setComponent() Same as V5
    Create New Component N/A ContentComponentContainer.createComponent()
    Add New Component N/A ContentComponentContainer.addComponent()
    Remove Component N/A ContentComponentContainer.removeComponent()

    Methods from SiteFrameworkContainer
    Get Immediate Children SiteFrameworkContainer.getChildren() SiteFrameworkContainer.getDirectChildren()
    SiteFrameworkContainer.getChildren()
    Get All Children SiteFrameworkContainer.getAllChildren() SiteFrameworkContainer.getAllChildren() SiteFrameworkContainer.getAllDirectChildren()
    Add Child Site Area SiteFrameworkContainer.addSiteArea() Same as V5 - Deprecated - use Workspace.createSiteArea()
    Insert Child Site Area SiteFrameworkContainer.insertSiteArea() Same as V5 - Deprecated - use Workspace.createSiteArea()
    Check Has Child Site Area SiteFrameworkContainer.hasSiteArea() Same as V5
    Remove Child Site Area SiteFrameworkContainer.removeSiteArea() Same as V5 - Deprecated - use Workspace.delete()
    Get Default Content SiteFramworkContainer.getDefaultContent() Same as V5
    Set Default Content SiteFrameworkContainer.setDefaultContent() Same as V5
    Get Template Mapping SiteFrameworkContainer.getTemplateMapping() Same as V5
    Add Template Mapping SiteFrameworkContainer.addTemplateMapping() Same as V5
    Check Has Template Mapping SiteFrameworkContainer.hasTemplateMapping() Same as V5
    Remove Template Mapping SiteFrameworkContainer.removeTemplateMapping Same as V5
    Get Associated Auth Tmplts N/A SiteFrameworkContainer.getAuthoringTemplateIds()

    Methods from SiteArea Interface
    Get Parent SiteArea.getParent() Same as V5
    Add Child Content SiteArea.addContent() Same as V5 - Deprecated - use Workspace.createContent()
    Insert Child Content SiteArea.insertContent() Same as V5 - Deprecated - use Workspace.createContent()
    Check Has Child Content SiteArea.hasContent() SiteArea.hasContent()
    SiteArea.hasDirectContent()
    SiteArea.hasLinkedContent()
    Remove Child Content SiteArea.removeContent() Same as V5 - Deprecated - use Workspace.delete()
    Has Direct Content N/A SiteArea.hasDirectConten()
    Has Linked Content N/A SiteArea.hasLinkedContent()
    Has Content SiteArea.hasContent() Same as V5
    Get Linked Children N/A SiteArea.getLinkedChildren()

    Content

    The following table lists each major Content function and what interface and method is required to carry out that functionality for both the V5 and V6 APIs.


    Content Functions V5 Public API V6 Public API

    Methods from Workspace Interface
    Create New Content Workspace.createContent() Same as V5
    Update Existing Content Workspace.save() Same as V5
    Remove Existing Content Workspace.delete() Same as V5
    Copy Content N/A Workspace.copySiteFrameworkDocument()
    Lock/Unlock/IsLocked N/A Workspace.lock() Workspace.unlock() Workspace.isLocked()
    Move Content N/A Workspace.MoveSiteFrameworkDocument()

    Methods from Document Interface
    Get ID Document.getId() Same as V5
    Get Name Document.getName() Same as V5
    Get Title N/A Document.getTitle()
    Get Description Document.getDescription() Same as V5
    Get Authors Document.getAuthors() Same as V5
    Get Owners Document.getOwners() Same as V5
    Get Modified Date N/A Document.getModifiedDate()
    Get Owner Library N/A Document.getOwnerLibrary()
    Get Live Accesss Members Document.getLiveAccessMembers() Same as V5 - Deprecated
    Get Read Access Members Document.getReadAccessMembers() Same as V5
    Get Edit Access Members Document.getEditAccessMembers() Same as V5
    Get Delete Access Members Document.getDeleteAccessMembers() Same as V5

    Methods from Editable Interface
    Set Name Editable.setName() Same as V5
    Set Description Editable.setDescription() Same as V5
    Set Title N/A Document.setTitle()
    Add Authors Editable.addAuthors() Same as V5
    Remove Authors Editable.removeAuthors() Same as V5
    Add Owners Editable.addOwners() Same as V5
    Remove Owners Editable.removeOwners() Same as V5
    Add Live Access Members Editable.addLiveAccessMembers() Same as V5 - Deprecated
    Add Read Access Members Editable.addReadAccessMembers() Same as V5
    Add Edit Access Members Editable.addEditAccessMembers() Same as V5
    Add Delete Access Members Editable.addDeleteAccessMembers() Same as V5
    Remove Live Access Members Editable.removeLiveAccessMembers() Same as V5 - Deprecated
    Remove Read Access Members Editable.removeReadAccessMembers() Same as V5
    Remove Edit Access Members Editable.removeEditAccessMembers() Same as V5
    Remove Delete Access Members Editable.removeDeleteAccessMembers() Same as V5
    Is Changed? Editable.isChanged() Same as V5

    Methods from ContentComponentContainer
    Get Component ContentComponentContainer.getComponent()
    ContentComponentContainer.getComponentByReference() Same as V5
    Get All Components ContentComponentContainer.componentIterator() Same as V5
    Get All Component Names N/A ContentComponentContainer.getComponentNames()
    Check Has Component ContentComponentContainer.hasComponent() Same as V5
    Set Component Value ContentComponentContainer.setComponent() Same as V5
    Create New Component N/A ContentComponentContainer.createComponent()
    Add New Component N/A ContentComponentContainer.addComponent()
    Remove Component N/A ContentComponentContainer.removeComponent()

    Methods from Content Interface
    Get Authoring Template Content.getAuthoringTemplateID() Same as V5
    Change Authoring Template N/A N/A
    Get Parents Content.getParents() Content.getParents()
    Content.getDirectParent()
    Content.getLinkedParents()
    Get Categories Content.getCategoryIds() Same as V5
    Add Categories Content.addCategoryIds() Same as V5
    Remove Categories Content.removeCategoryIds() Same as V5
    Get Keywords Content.getKeywords() Same as V5
    Add Keywords Content.setKeywords() Same as V5
    Remove Keywords Content.setKeywords() Same as V5
    Get Current Workflow Content.getWorkflowId() Same as V5
    Set Workflow Content.setWorkflowId() Same as V5
    Restart Workflow Content.restartWorkflow() Same as V5
    Get Current Workflow Stage Content.getWorkflowStageId() Same as V5
    Set Workflow Stage Content.nextWorkflowStage() Same as V5
    Get Approvers Content.getCurrentApprovers() Same as V5
    Approve Content Content.nextWorkflowStage() Same as V5
    Reject Content Content.decline() Same as V5
    Check Status is Draft Content.isDraft() Same as V5
    Check Status is Published Content.isPublished() Same as V5
    Check Status is Expired Content.isExpired() Same as V5
    Create New Draft Content.createDraft() Same as V5
    Check Has Draft Content.hasDraft() Same as V5
    Get Publish Date Content.getEffectiveDate() Same as V5
    Set Publish Date Content.setEffectiveDate() Same as V5
    Get Expiration Date Content.getExpiryDate() Same as V5
    Set Expiration Date Content.setExpiryDate() Same as V5
    Get General Date One Content.getGeneralDateOne() Same as V5
    Set General Date One Content.setGeneralDateOne() Same as V5
    Get General Date Two Content.getGeneralDateTwo() Same as V5
    Set General Date Two Content.setGeneralDateTwo() Same as V5
    Get Additional Viewers Content.getAddlViewers() Same as V5
    Add Additional Viewers Content.addAddlViewers() Same as V5
    Remove Additional Viewers Content.removeAddlViewers() Same as V5

    ContentComponents

    The following table lists each major ContentComponent function and what interface and method is required to carry out that functionality for both the V5 and V6 APIs. It also shows the specialized ContentComponent objects and their methods.


    Content Component Functions V5 Public API V6 Public API

    Methods from ContentComponent
    Get Container ContentComponent.getContainer() Same as V5
    Get Name ContentComponent.getName() Same as V5

    TextComponent Methods
    Get Text TextComponent.getText() Same as V5
    Set Text TextComponent.setText() Same as V5

    HTMLComponent Methods
    Get HTML HTMLComponent.getHTML() Same as V5
    Set HTML HTMLComponent.setHTML() Same as V5

    RichTextComponent
    Get Rich Text RichTextComponent.getRichText() Same as V5
    Set Rich Text RichTextComponent.setRichText() Same as V5

    FileComponent Methods
    Get File Name FileComponent.getFileName() Same as V5
    Set File contained in component FileComponent.setFile() Same as V5
    Get File Contents FileComponent.getFile() Same as V5

    ImageComponent Methods
    Get Image File Name ImageComponent.getImageFileName() Same as V5
    Set Image File Name ImageComponent.setImage() Same as V5
    Get Image File Contents ImageComponent.getImage() Same as V5
    Set Image File Contents ImageComponent.setImage() Same as V5
    Get Alt Text ImageComponent.getAltText() Same as V5
    Set Alt Text ImageComponent.setAltText() Same as V5
    Get Border ImageComponent.getBorder() Same as V5
    Set Border ImageComponent.setBorder() Same as V5
    Get Height ImageComponent.getHeight() Same as V5
    Set Height ImageComponent.setHeight() Same as V5
    Get Width ImageComponent.getWidth() Same as V5
    Set Width ImageComponent.setWidth() Same as V5
    Get HTML Name ImageComponent.getNameTag() Same as V5
    Set HTML Name ImageComponent.setNameTag() Same as V5

    ReferenceComponent Methods
    Get Component Reference ReferenceComponent.getComponentRef() Same as V5
    Set Component Reference ReferenceComponent.setComponentRef() Same as V5

    DocumentManagerComponent Methods
    Get PDM Document Library N/A DocumentManagerComponent.getDocumentLibrary()
    Set PDM Document Library N/A DocumentManagerComponent.setDocumentInformation()
    Get PDM Document Path N/A DocumentManagerComponent.getDocumentPath()
    Set PDM Document Path N/A DocumentManagerComponent.setDocumentInformation()
    Get PDM Document Version Name N/A DocumentManagerComponent.getVersionName()
    Check If Locked To Version N/A DocumentManagerComponent.isLockedToVersion()
    Lock To Version N/A DocumentManagerComponent.setLockToVersion()
    Refresh PDM Document Info N/A DocumentManagerComponent.refreshDocument()

    DateComponent Methods
    Get Date N/A DateComponent.getDate()
    Set Date N/A DateComponent.setDate()
    Get Date Format N/A DateComponent.getDateType()
    Set Date Format N/A DateComponent.setDateType()

    NumericComponent Methods
    Get Number N/A NumericComponent.getNumber()
    Set Number N/A NumericComponent.setNumber()
    Get Number Type N/A NumericComponent.getNumberType()
    Set Number Type N/A NumericComponent.setNumberType()

    OptionSelectionComponent Methods
    Get Option Selections -array of strings N/A OptionSelectionComponent.getSelections()
    Set Option Selections- array of strings N/A OptionSelectionComponent.setSelections()

    UserSelectionComponent Methods
    Get User Selections- principals N/A UserSelectionComponent.getSelections()
    Set User Selections- principals N/A UserSelectionComponent.setSelections

    LinkComponent Methods
    Get/Set Additional Attribute N/A LinkComponent.get/setAdditionalAttribute()
    Get/Set Document Reference N/A LinkComponent.get/setDocumentReference()
    Get/Set Link Description N/A LinkComponent.get/setLinkDescription()
    Get/Set Link Image N/A LinkComponent.get/setLinkImage()
    Get/Set Link Target N/A LinkComponent.get/setLinkTarget()
    Get/Set Link Text N/A LinkComponent.get/setLinkText()
    Get Link Text Type N/A LinkComponent.getLinkTextType()
    Get Link Type N/A LinkComponent.getLinkType()
    Get/Set Query String N/A LinkComponent.get/setQueryString()
    Get Reference Display Name N/A LinkComponent.getReferenceDisplayName()
    Set/Get Is Clearable N/A LinkComponent.set/IsClearable()
    Get/Set s Use Reference Description N/A LinkComponent.get/IsUseReferenceDescription()
    Get/Set Is Use Reference Link Text Enabled N/A LinkComponent.get/IsUseReferenceLinkTextEnabled()
    Set External Reference N/A LinkComponent.setExterntalReference()

    LibraryFile, LibraryImage, LibraryHTML

    The following table lists each major LibraryFile, LibraryImage and LibraryHTML function and what interface and method is required to carry out that functionality for both the V5 and V6 APIs.


    LibraryFile LibraryImage LibraryHTML Functions V5 Public API V6 Public API

    Methods from Workspace Interface
    Create New Library File Cmpnt Workspace.createFileComponent() Same as V5
    Update Existing Library File Cmpnt Workspace.save() Same as V5
    Remove Existing Library File Cmpnt Workspace.delete() Same as V5

    Methods from Document Interface
    Get ID Document.getId() Same as V5
    Get Name Document.getName() Same as V5
    Get Description Document.getDescription() Same as V5
    Get Title N/A Document.getTitle()
    Get Authors Document.getAuthors() Same as V5
    Get Owners Document.getOwners() Same as V5
    Get Modified Date N/A Document.getModifiedDate()
    Get Owner Library N/A Document.getOwnerLibrary()
    Get Live Accesss Members Document.getLiveAccessMembers() Same as V5
    Get Read Access Members Document.getReadAccessMembers() Same as V5
    Get Edit Access Members Document.getEditAccessMembers() Same as V5
    Get Delete Access Members Document.getDeleteAccessMembers() Same as V5

    Methods from EditableLibraryComponent Interface
    Set Name EditableLibraryComponent.setName() Same as V5
    Set Description EditableLibraryComponent.setDescription() Same as V5
    Set Title N/A Document.setTitle()
    Add Authors EditableLibraryComponent.addAuthors() Same as V5
    Remove Authors EditableLibraryComponent.removeAuthors() Same as V5
    Add Owners EditableLibraryComponent.addOwners() Same as V5
    Remove Owners EditableLibraryComponent.removeOwners() Same as V5
    Add Live Access Members EditableLibraryComponent.addLiveAccessMembers() Same as V5
    Add Read Access Members EditableLibraryComponent.addReadAccessMembers() Same as V5
    Add Edit Access Members EditableLibraryComponent.addEditAccessMembers() Same as V5
    Add Delete Access Members EditableLibraryComponent.addDeleteAccessMembers() Same as V5
    Remove Live Access Members EditableLibraryComponent.removeLiveAccessMembers() Same as V5
    Remove Read Access Members EditableLibraryComponent.removeReadAccessMembers() Same as V5
    Remove Edit Access Members EditableLibraryComponent.removeEditAccessMembers() Same as V5
    Remove Delete Access Members EditableLibraryComponent.removeDeleteAccessMembers() Same as V5
    Is Changed EditableLibraryComponent.isChanged()

    Methods from LibraryFileComponent Interface
    Get File Name LibraryFileComponent.getFileName() Same as V5
    Get File Contents LibraryFileComponent.getFile() Same as V5
    Set File LibraryFileComponent.setFile() Same as V5

    Methods from LibraryImageComponent Interface
    Get Image File Name LibraryImageComponent.getImageFileName() Same as V5
    Set Image File Name LibraryImageComponent.setImage() Same as V5
    Get Image File Contents LibraryImageComponent.getImage() Same as V5
    Set Image File Contents LibraryImageComponent.setImage() Same as V5
    Get Alt Text LibraryImageComponent.getAltText() Same as V5
    Set Alt Text LibraryImageComponent.setAltText() Same as V5
    Get Border LibraryImageComponent.getBorder() Same as V5
    Set Border LibraryImageComponent.setBorder() Same as V5
    Get Height LibraryImageComponent.getHeight() Same as V5
    Set Height LibraryImageComponent.setHeight() Same as V5
    Get Width LibraryImageComponent.getWidth() Same as V5
    Set Width LibraryImageComponent.setWidth() Same as V5
    Get HTML Name LibraryImageComponent.getHTMLNameTag() Same as V5
    Set HTML Name LibraryImageComponent.setHTMLNameTag() Same as V5

    Methods from LibraryHTMLComponent Interface
    Get HTML LibraryHTMLComponent.getHTML() Same as V5
    Set HTML LibraryHTMLComponent.setHTML() Same as V5

    Sunday, March 29, 2009

    ClearHistory with WCM 6.1

    If you are using 6.1x a new module was delivered in Cummulative fix 6.

    "Creation of a module that will allow for the deletion of history log entries."
    To enable the library delete module:

    1. Add the following lines to the WCMConfigService.properties file located in the portal_server_root/wcm/shared/app/config/wcmservices directory:

    connect.businesslogic.module.historycropper.class=com.aptrix.history.HistoryCropperModule
    connect.businesslogic.module.historycropper.remoteaccess=true
    connect.businesslogic.module.historycropper.autoload=false

    2. add ",historycropper" (without quotes) at the end of the "connect.businesslogic.module=" property in the same file.
    3. Restart the server for the configuation changes to take effect.

    To view a report, use the following URL:
    http://HOST:PORT/wps/wcm/myconnect?MOD=HistoryCropper&day=DATE&month=MONTH&year=YEAR&keep=LOG_ENTRIES_TO_KEEP&restrictOn=CONTROLLABLE_TYPES&library=LIBRARY

    The day, month, year and keep parameters must all be numbers.

    The day, month and year parameters combine to make up a date object which is used to determine whether a certain history log entry is removed from a Web Content Management item. Any history log entries that occurred before the specified date will be deleted. If no date is specified, then the date will default to one year before the current date.

    The keep parameter specifies the minimum number of history log entries to keep on Web Content Management items. If a number is not specified, then the minimum number of history control entries to keep will default to 10.

    The library parameter tells which library to process. If this attribute is not specified, then all libraries will be processed.

    The restricOn parameter tells the module to process only controllable of the specified types. If this attribute is not specified, then all controllables types will be processed.