Monday, April 27, 2009

How to set the default authenticated or unauthenticated page.

Question
How can you change the page that displays by default for authenticated and/or unauthenticated users to IBM WebSphere Portal?

Answer

WebSphere Portal serves the page with the lowest ordinal number under a given context for which the user (authenticated or unauthenticated) has access. Therefore, you can control which page is served by changing order and access control through the Manage Pages portlet.

Consider the following example:

For the base Portal, by default, the content root is "wps/portal" for unauthenticated users and "wps/myportal" for authenticated users. When an unauthenticated user accesses
http:/ /portalserver.com/wps/portal, the Login page displays by default. When the user logs in, he/she is redirected to http:/ /portalserver.com/wps/myportal and sees the Home page by default.

To change the page the unauthenticated user sees when accessing "/wps/portal/", in the Manage Pages portlet, click Content Root. If you check the page permissions (key icon), notice that Anonymous Portal User is a member of the User role for the Login page. Select another page such as NewPage and click the up arrow until the page is listed above Login (this lowers NewPage's ordinal number so that it precedes Login in the list). Then add Anonymous Portal User to the User role for NewPage. The unauthenticated user now will see NewPage when he accesses "/wps/portal/".

To change the page the authenticated user sees when accessing "/wps/myportal/", in the Manage Pages portlet, click Content Root. Select another page such as NewPage2 and click the up arrow until the page is listed above Home. Assign access rights to NewPage2 appropriately (generally, ensure All Authenticated Portal Users is in the Privileged User role). The authenticated user now sees NewPage2 when he/she accesses "/wps/myportal/".

The Manage Pages portlet's list of pages under the Content Root would look as follows:



If you export a release with XMLAccess, you can see how the ordinal numbers relate:



...



...


NewPage2


...




...



...

What does "Configuring JCR collation support" mean?

Problem
What does the term, "Configuring JCR collation support", mean as mentioned during the setup of DB2 for Lotus Web Content Management (WCM)?

Resolving the problem
In IBM WebSphere Portal, you can use (store or retrieve) contents using Unicode or a locale-specific character set. If you are storing the content using Unicode, collation has minimum importance. Unicode is generic so each character is a predefined size that is the same across characters. If you are storing content using a locale-specific character set, collation becomes a priority.
If you use a filter on the content, the database must use the same character set as that used to encode the content. For example, if you have a column that stores names using a Chinese character set, the comparison will not be the same as if ASCII characters were used. Each character in the Chinese set has a predefined index associated with it so the database must follow these indexes when sorting the names in the result.

This is why you must configure your database and enable collation up front so that in response to your query, the database can pick up the desired character set and use it when ordering the data.

Portal Upgrades: Best Practices

Question
IBM® WebSphere® Portal upgrades can be a very combersome undertaking. This document is meant to provide a basic set of what to do and what not to do when performing Portal upgrades.

Failure to observe these points, particularly in the 'What NOT to do' section can result in an unusable system and often results in complete reinstalls.

Answer
What to do:

* Ensure you have a working backup of your environment. This includes a full file structure backup AND a full database backup. Having only one or the other is no better than having no backup at all. Portal upgrades cannot be uninstalled if they fail.

Customers using DB2 on z/OS: When taking the database backup starting 6.0.1.4 and higher fix packs it is sufficient to only take a backup of the data but not the DB2 catalog as separate SQL files are provided to revert changes applied to the database schema during fixpack installation.
* Ensure file permissions are set correctly for UNIX environments. If you are using a non-root user, ensure that the user owns the AppServer directory, the PortalServer directory and the profile directory. Ensure that the non-root user has full access to the /tmp directory.
* If the upgrade fails, fix the problem with the upgrade and finish it before attempting anything else with the system (unless you decide to restore a backup).
* Ensure you have followed all of the 'Before You Begin' steps from the upgrade instructions.



What NOT to do:

* If upgrading a clustered environment, upgrade the primary node first. DO NOT upgrade a secondary first.
* If upgrading a clustered environment, DO NOT upgrade cluster nodes simultaneously.
* If an upgrade fails, DO NOT attempt to apply a different fixpack on top of a fixpack failure. This is the most common action that results in a complete reinstall.
* Do NOT upgrade a node that is federated but not clustered. Create a cluster first, even if it is just one node.
* If an upgrade fails, DO NOT attempt to further configure the Portal server (reconfigure secuirty, transfer the database, etc) until you have resolved the upgrade failure.
* When restoring a backup, DO NOT simply overwrite the existing WebSphere directory with a backed up one. You run the risk of corrupting the environment since overwriting the directory might not remove new files that had been laid down by the failed upgrade.

Saturday, April 25, 2009

Versioning "by-type" is default, but can be overridden

Abstract
The entry "versioningStrategy.Default" may be added (optional) to the WCMConfigService.properties file used in IBM® Web Content Management to override the "by-type' versioning.


Content
The following example shows an example implementation:
# enable version control for the following types.
# options are always | never
versioningStrategy.Default = always
versioningStrategy.AuthoringTemplate = always
versioningStrategy.Component = always
versioningStrategy.Content = always
versioningStrategy.PresentationTemplate = always
versioningStrategy.Site = always
versioningStrategy.Taxonomy = always
versioningStrategy.Workflow = always

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

JCR troubleshooting topic: troubleshooting common exceptions

Problem
You need to troubleshoot JCR (Java Content Repository) error codes that appear in the logs of your IBM Web Content Management (WCM) system.

Cause
JCR exceptions in logs

Resolving the problem
PathNotFound Exception and ItemNotFound exceptions

Within a workspace, each node is identified by its path and its uuid. In order to retrieve a node you must specify either its path or its uuid. The retrieval methods within the repository throw the exceptions "PathNotFoundException" and "ItemNotFoundException" to indicate that the node or property that you attempted to retrieve (either by path or uuid) does not exist in the current workspace. This exception is the repository's method of telling the WCM application that is does not have the item being requested.

NOTE: From the perspective of the API, both a node and a property possess a "path" which can be requested. Both Node and Property are sub-interfaces of the common parent interface Item, and hence the "ItemNotFoundException" notification.




javax.jcr.nodetype.NoSuchNodeTypeException

Example: javax.jcr.nodetype.NoSuchNodeTypeException: Node Type clb:clbLibrary not found
This problem indicates that the application is expecting a JCR Node Type which has not been defined.

Two scenarios are known to lead to this problem.

1. The node types have not been defined during the Portal upgrade. This is the most common scenario, and occurs when either Portal update has failed, or was never correctly invoked. To resolve this problem, we need to find out what happened during Portal update, and why the node types were not created correctly at this time.
2. The application is looking for a Quickr Node Type on 6.0.1.1. Since Quickr Node Types are not guaranteed to be installed on a base WebSphere Portal installation, this error calls for an update for the application. In this customer-reported case, the issue was found with PZN and the issue is resolved with PK51123.




Error deleting a library: SQL0101N

The SQL0101N error indicates that the SQL is too large or complex. One needs to ensure that the database statistics are current, especially if running DB2. Depending on the nature of your environment's data set, specific database tuning may be required to resolve this error. In the case of using DB2, the presence of the large number of versions is creating a SQL statement that exceeds the settings for DB2 cache size.

DB2:

* Increase the DB2 parameter: pckcachesz. This parameter is allocated out of the database shared memory, and is used for caching of sections for static and dynamic SQL and XQuery statements on a database. Try using 16382 for value.
NOTE: The database manager must be restarted for these updates to take effect.
* Verify the new value is set before retrying. If it fails again, then double the value specified in the previous step.
NOTE: the value can be reduced once the library is removed.




java.lang.OutOfMemoryError

For complete details about OutOfMemoryError during export, read JCR Troubleshooting topic: Export and Import, technote 1322146.

JCR Troubleshooting topics: Export and Import
There are often cases where the OutOfMemoryError is caused by the application processing too much data when using a StrongWorkspaceState. You can recognize this situation when you see the StrongWorkspaceState holding a lot of memory when you analyze the heap dumps. The StrongWorkspaceState is an internal cache of all JCR nodes referenced in the current workspace, and the OutOfMemoryError here indicates that more nodes are referenced than the current memory can handle.

The application needs to change to do one of the following:

1. Reduce the number of nodes processed per workspace
2. Manually clear the workspace state at an interval that can be handled by the system's memory
3. Use Weak workspace state



Applying PK70951 will not resolve the problem alone, but it will help identify what part of the application that is improperly using the StrongWorkspaceState.

After applying PK70951:

1. Enable trace to com.ibm.icm.jcr.StrongWorkspaceState=all, and
2. Recreate the failure.


After the next OutOfMemoryError, the trace will contain debug stack traces which can be used by IBM Support to identify the failure. Otherwise, this error needs more diagnostic information to determine the cause, including Java core output and the heap dump of the failure.





StaleValueException

The StaleValueException is a normal exception by JCR and does not indicate a JCR failure. JCR throws StaleValueException when the current node being saved is different from the latest version of that node in the database.


There is a known issue with JCR nodes which have been created or updated within the first hour after the time switch to Daylight Savings Time (DST). The cause of this problem is that Java compensates for DST differently than the database. During this hour of overlap, Java advances internal timestamps one hour ahead. The database does not advance the timestamp during this time period, so the result is an inconsistency between timestamps from Java and database timestamps. The end result is that the user encounters a StaleValueException every time they try to update nodes from this hour of overlap.
IBM support has a utility to fixup the invalid nodes during this hour of overlap. Contact IBM Support to review the issue and provide the utility if indicated.





javax.jcr.query.InvalidQueryException

Example:
javax.jcr.query.InvalidQueryException: Query exception is thrown for query statement: /contentRoot/element(*,icm:documentLibrary)/Taxonomies/mig/My Taxonomy/My Organization/North Carolina: QRY0552E: Syntax of query string is incorrect. Parsing error at position 71. Detail: Error: could not match input.



The application needs to correctly encode the query before sending it to JCR.




javax.jcr.PathNotFoundException

This message is not necessarily an error. It indicates that the caller is looking for a JCR object that does not exist. You need to look up the call stack to the calling application to determine where to debug further.





javax.jcr.ItemExistsException

This message is not necessarily an error. javax.jcr.ItemExistsException indicates that the caller is trying to save a JCR object that already exists. The object may already exist by either the same path or the same UUID.
We have also seen ItemExistsException occur during import. For more information, read JCR Troubleshooting topic: Export and Import, technote 1322146.





Data field is too long

Example: javax.jcr.nodetype.ConstraintViolationException: The value for the string property ibmcontentwcm:writeAccess on node /contentRoot/icm:libraries[5]\/Workflow/Stages/test/ibmcontentwcm:effective exceeds its max length.


The maximum length is 252 while the value is of length 263
This message indicates that the application is sending a data property value which is greater than its definition size. This is most commonly seen when migrating WCM data from 5.1 to V6. If this problem is occurring during WCM migration, this error indicates that a 5.1 property needs to be shortened in order to fit into the V6 size restrictions.

If this problem is not occurring during WCM migration, implement application debugging to proceed further.




SQLSTATE=54001 - The statement is too long or too complex.

This error can occur if you have not regularly executed database statistics. Ensure that the database statistics are current.


For more information, read the IBM WebSphere Portal Information Center topic: Database performance.


If using DB2 as the database:

1. Increase the values of the DB2 statement heap (stmtheap), the application heap (applheapsz) and the cache size (pckcachesz).
2. Restart the database manager for these updates to take effect.


NOTE: If this failure occurs during a one-time operation such as library delete, you can reduce these values after delete has completed.


java.io.IOException: Bad file number

Example:
java.io.IOException: Bad file number
at java.io.FileInputStream.available(Native Method)


This exception is reported because the data stream being stored inside JCR is invalid.




getMimeTypeId errors

Example: java.lang.NullPointerException at com.ibm.icm.ci.data.impl.dautils.PCreateNodeImpl.getMimeTypeId()


This error is encountered when the MimeType extensions had been manually edited. Make sure that WCMConfigServices.properties has the correct extension mappings.





Problems in LibraryDeleteModule

Older versions of LibraryDeleteModule would cause database exceptions when deleting drafts (internal locks). This has been resolved by PK64844. Ensure that your system has the latest version of the LibraryDeleteModule.




DB2 zOS
Fail to create database


The prefix must be unique enough to contain only the databases used for the content repository. Use a prefix that provides unique database name conventions, such as DPTJCRXXX, or something similar.


jcr.ZosDbPrefix=





Oracle
Error with ordered results


There is a known defect with ordering on Oracle 9.2.0.6. The result is that an ordered list from JCR may not be returned in the correct order. IBM recommends upgrading to Oracle 10.0.2.3 or higher to resolve this problem. For more information, read "Menu ordering is broken in Web Content Management (WCM) due to bug in Oracle" technote 1266428.


Sort issues may also indicate a query problem. To troubleshoot SQL queries:

1. Collect the database response
2. Look to the output from the repository class that identifies the SQL statement that will be issued against the database.
3. Once this SQL statement is identified, manually execute the query against the database to see if the results are ordered correctly and as expected. If the results do not appear in the expected order, open a support ticket with the database vendor support team.

Portal 6.0
DB2 engine SQL error, SQLCODE = -104, SQLSTATE = 42601, error tokens = ,1;+ - AS


There is a problem on a German locale where the comma character is allowed as a period. Ensure that you have the latest JCR cumulative fix to resolve the problem.

JCR Troubleshooting topic: query performance and XPath

Problem
As system administrator of you IBM Web Content Management system, you need to analyze the JCR (Java Content Repository) query performance.

Resolving the problem
The following steps show how to search through a JCR trace for data showing the query performance. Note that this assumes a trace of the query using com.ibm.icm.*=all

The following lines in the trace will show the XPath query being sent to JCR, the generated SQL being sent to the database, and the performance for each:

1. The entry to JCR query:
Search string: QueryImpl execute includeLocks
Example:
[8/8/08 4:51:28:490 GMT] 0000006c QueryImpl 2 com.ibm.icm.jcr.query.QueryImpl execute includeLocks=false includeReferences=false includePaths=false statement=//element(*, icm:documentLibrary)[@jcr:uuid = '5375be0046c9f315bf53bf996f9fe841']//(element(*, ibmcontentwcm:webContent) | element(*, ibmcontentwcm:draftSummary))[@ibmcontentwcm:workflowStage = '3d115a0046c9fef2bf88bf996f9fe841' and (not(@ibmcontentwcm:isPrototype) or @ibmcontentwcm:isPrototype = fn:false()) and (@ibmcontentwcm:classification = 'Content' or @ibmcontentwcm:draftClassification = 'Content')] propertiesToRetrieve=null 2. The SQL sent to the database:
Search string: Generated SQL with param markers
[8/8/08 4:51:28:740 GMT] 0000006c ResultSetProc 3 Generated SQL with param markers included:
WITH NONLEAFS AS (SELECT Links_18.SIID , Links_18.SVID , Links_19.TIID , Links_19.TVID , Links_19.TIX , Links_19.TCTID ,

<200 more lines....>

NodesTab_17.IID)
3. The actual query:
Search string: executeQuery
[8/8/08 4:51:28:744 GMT] 0000006c PPreparedStat 3 com.ibm.icm.da.portable.common.sql.PPreparedStatement executeQuery() ==> [...] 4. The return from the query:
Search string: openQueryCursor
[8/8/08 4:51:43:472 GMT] 0000006c Query 2 com.ibm.icm.da.portable.query.Query openQueryCursor() Note: The difference between the executeQuery() and the openQueryCursor() is the time spent by the database server executing the SQL (about 15 seconds here). 5. The result size of the query:
Search string: query result size
[8/8/08 4:51:43:785 GMT] 0000006c QueryResultIt 2 com.ibm.icm.jcr.query.QueryResultIteratorImpl QueryResultIteratorImpl query result size=34 6. The total query execute time:
Search string: total query execute time
[8/8/08 4:51:43:785 GMT] 0000006c QueryImpl 2 com.ibm.icm.jcr.query.QueryImpl execute total query execute time=15294

Xpath query issues.

the JCR spec declares that nodes within the repository must be retrievable by way of a query language. The query language supported by our repository implementation is XPath. Technically, a subset of the full XPath specification is supported by the repository for retrieving nodes from the repository. To use this function, an application will construct a "query" object and execute that "query" against the repository returning an "iterator" of results. The results are the nodes that met the XPath query criteria.

The execution of an XPath query against the repository includes two primary steps: validation and execution. The validation step ensures that the XPath query string specified by the application is of a syntactically valid form and can be processed by the repository. If the XPath query is of an invalid form, then the query will throw an InvalidQueryException which indicates to the application that the XPath was not syntactically valid. If the XPath is syntactically valid, then the query is accepted and processed by the repository and a "result set" is returned.

In order to debug any issues with XPath queries that are valid but not returning results as expected there are the following steps:

1. Recreate the failing query with both the application trace (e.g. WCM trace) and JCR trace (com.ibm.icm.*=finest). The application trace will identify the XPath query being issued, as well as the context of that query. The JCR trace will identify the generated SQL that has been generated from the XPath.
2. Once you have gathered the traces, obtain the entry and exit points from the query, as well as the generated SQL.


See also the appropriate MustGather documents at the bottom of the technote for help collecting the JCR trace output.

--------------------------------

JCR MustGather documentation for collecting JCR trace output:

Version 6.0.x: http://www-01.ibm.com/support/docview.wss?uid=swg21303048

Version 6.1.x: http://www-01.ibm.com/support/docview.wss?uid=swg21316273

JCR troubleshooting topic: search index

Problem
As the system administrator of an implementation of IBM Web Content Management, you must troubleshoot the Java Content Repository (JCR) search index component.

Cause
Search not working properly

Resolving the problem


Rebuild Search Index

Title: How to rebuild the WebSphere Portal Document Manager search index
Doc #: 1296931
URL: http://www.ibm.com/support/docview.wss?rs=899&uid=swg21296931

NOTE: The SystemOut.log displays the following lines when rebuilding the search index:

* Start: START rebuilding juru index:
* End: DONE rebuilding juru index:


Stellent Conversion Errors

There is a database fix for Stellent Conversion Errors with htmlElement.elementData. contact IBM Support for more information

If you encounter other Stellant Conversion Errors while rebuilding the search index, contact IBM Support to involve the ODC/DCS team to help resolve the issues with running the conversion.

ParentIDNotFoundException

Example: com.ibm.icm.ts.path.ParentIDNotFoundException: Original parent not found for id: 120337072591476.

This error can occur if search indexing attempts to index an item which has been deleted. This is normal processing, and is not an error. The failed event is logged in the ICMJCRSTERRORS table.

Note that PK56104 will remove a lot of these messages. The former APAR, PK56033, has been replaced by PK56104.

After PK56104 has been applied, if search indexing encounters a deleted item, it will process that item only once and log the exception. The next time it will not attempt to process the deleted item again.

NOTE: PK56104 has been part of the JCR Cumulative fix since PK60132 (JCR Cumulative Fix #3).

This exception can cause the ICMJCRSTERRORS to grow very large. It is safe to remove the contents of this table after the JCR Cumulative Fix has been applied. Contact IBM Support to review the issue and provide the required SQL if indicated. It is recommended to make a full database backup before directly modifying the database.

Exception during Search


Previous Exceptions

If there is an exception starting a WebSphere service, this may lead to search problems later on. These are the exceptions that have been seen so far:

* java.lang.IllegalStateException: I18N0012I: The Internationalization service is not started on WebSphere_Portal


Duplicate exceptions during search

Example: COM.ibm.db2.jdbc.DB2Exception: SQL0601N The name of the object to be created is identical to the existing name "JCR.TSSTBL_2" of type "TABLE".

You should clean up the temporary search tables to resolve this error. To clean up the temporary search tables, contact IBM Support to review the issue and provide the required SQL if indicated. It is recommended to make a full database backup before directly modifying the database.

unique constraint violated

Example: java.sql.BatchUpdateException: ORA-00001: unique constraint (WCMICMADMIN.SYS_C0036649) violated
This error has been fixed in 6.0.1.1, but can occur if the search index has not been rebuilt since upgrading to 6.0.1.1.
Solution: Rebuild the search index.

Temp search tables

PK58346 is now available for 6.0.1.1 and later, which will greatly reduce the use use temporary search tables.
Note: PK58346 is part of the JCR Cumulative Fix since PK60132 (JCR Cumulative Fix #3).

To clean up the temporary search tables, contact IBM Support to review the issue and provide the required SQL if indicated. It is recommended to make a full database backup before directly modifying the database.


Incorrect Results from Search


Search index failures


If the search is not yielding correct results, make sure that the search index was created with no errors.

You can verify if a single document was reindexed successfully by the following steps:
1. Change the index maintenance interval to 2 minutes
2. Enable JCR trace at com.ibm.icm.*=finest
3. Edit the document
4. Allow 2 minutes (the index maintenance interval) for the document to be reindexed
Trace search results


Collect the following information:

* Search criteria
* Portal page from where search was invoked
* Any other search options (if advanced search)
* The user's locale
* Expected results
* Actual results
* JCR trace of the failure: com.ibm.icm.*=finest
(For instructions, read the MustGather documentation at the end of this technote)


Trace information:
1. Look for the entry to JCR query:
This will show the actual query that is being executed (including the text search):
Search string: QueryImpl execute includeLocks

Example:
[3/16/08 7:28:05:161 PDT] 0000009c QueryImpl 2 com.ibm.icm.jcr.query.QueryImpl execute includeLocks=false includeReferences=false includePaths=true statement=//element(, icm:documentLibrary)[@jcr:uuid = 'e8b5dc8046f1eb03a15db108d7e720a9']//(element(, ibmcontentwcm:authoringTemplate)|element(, ibmcontentwcm:webCategory))[@ibmcontentwcm:workflowStatus and @icm:authors = 'cn=userid,o=all users'][text-contains(.,'board')] order by text-score(.,'board*') descending propertiesToRetrieve=null


2. Look for the entry to text search (Juru):
This will show what is being sent to text search, and if any truncation has occurred:
Search string: executing search:

Example:
[3/16/08 7:28:05:416 PDT] 000000b6 JCRCFLLoggerI 3 com.ibm.icm.ts.tss.JCRCFLLoggerImpl com.ibm.icm.ts.tss.JuruIndexImpl.result [java.lang.ThreadGroup[name=icmciWorkManager: icmjcrear,maxpri=10]] com.ibm.icm.ts.tss.JuruIndexImpl.result [java.lang.ThreadGroup[name=icmciWorkManager: icmjcrear,maxpri=10]]: executing search: 'board*' with language: en wildcard expansion size: 20

Wildcard term expansion truncated for search: 'board*


3. Look for exit from text search:
This will identify how many results were found from text search (Juru).
Search string: num results:
Example:

[3/16/08 7:28:05:416 PDT] 000000b6 JCRCFLLoggerI 3 com.ibm.icm.ts.tss.JCRCFLLoggerImpl com.ibm.icm.ts.tss.JuruIndexImpl.result [java.lang.ThreadGroup[name=icmciWorkManager: icmjcrear,maxpri=10]] com.ibm.icm.ts.tss.JuruIndexImpl.result [java.lang.ThreadGroup[name=icmciWorkManager: icmjcrear,maxpri=10]]: num results: 4


4. Look for exit from query:
This will identify how many of the search results are returned after JCR has performed a query based on the results from text search.
Search string: query result size

Example:
[3/16/08 7:28:16:216 PDT] 0000009c QueryResultIt 2 com.ibm.icm.jcr.query.QueryResultIteratorImpl QueryResultIteratorImpl query result size=0

If the number of results returned from Juru is different than what is expected, then we must pursue the incorrect search with Juru.

If the number of results returned from Juru is what is expected, then we must pursue the incorrect search with IBM JCR Support, to find out if/where JCR has changed the result list.

If trace indicates "expansion truncated" as above, it indicates that Juru search is working as designed, but the search terms yield more results than are allowed, and so they are truncated by Juru. Note that you can increase the number of search terms with the jcr.textsearch.wildcardTermExpansionSize property in icm.properties. However, note that a larger wildcard expansion size will impact search performance.

Number of search results returned

At present, JCR cannot retrieve more than 100 results from a Juru search. Note that this number may be further reduced by JCR based on either access control, or additional query criteria. The best way to identify if the incorrect number of search results is being limited by the maximum number of results returned from Juru is to look at the search trace (see above). If the number of results returned from Juru is 100, it is very likely that the current search exceeds this maximum of 100.

Miscellaneous topics on search
Search performance issue in 6.0.1.3

We have encountered a performance issue with search on 6.0.1.3 and JCR Cumulative Fix #3. This problem causes the search performance to degrade with a large number of search results. This problem has been fixed with PK64038.

Search Across Locales

Nodes which are indexed in one language are not guaranteed to be searchable from another language. For example, a Turkish language node "fulya" is not searchable from English. This is working as designed.

To verify the search index language, compare the language from the search trace with the workspace language in icm.properties: jcr.workspace.defaultLanguage

Reorganize search index

If a lot of PDM or WCM content has been removed but the search index continues to grow, you may need to perform the administrator function to reorganize the search index. This capability is provided with PK61534. See the readme for PK61534 for instructions.

Reference information

Web Content Management Authoring Inline Advanced Search known limitations:
http://www-1.ibm.com/support/docview.wss?rs=688&uid=swg21259650

Known limitations and issues for Juru search utilized by WCM Authoring UI search:
http://www-1.ibm.com/support/docview.wss?rs=1041&uid=swg21259649

Web Content Management advanced authoring search does not return new or changed content:
http://www-1.ibm.com/support/docview.wss?rs=688&uid=swg21259884

--------------------------------

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

How to disable workflow actions in IBM Web Content Management (WCM)

Problem
As the system administrator of your IBM Web Content Management system, you need to disable the workflow actions in your system.

Resolving the problem
Use a text editor to modify the system's [WPS_ROOT]\wcm\shared\app\config\wcmservices\WCMConfigService.properties file.

1. Add a property named "disableWorkflowAction".

2. Use a comma to separate the workflow action name that you want to disable, for example,
disableWorkflowAction=ScheduledMoveAction1,ScheduledMoveAction2

NOTE: the name is case-sensitive.



To disable all workflow actions on the server, " * " can be used in the disableWorkflowAction property.


The following disables all workflow actions on the server:

disableWorkflowAction=*


The generic use of this property is for machine working as a subscriber. This property is added to
disable all the actions on the subscriber. If you use it on the syndicator machine, then it will disable all the actions.

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

DraftDetectionModule utility allows bulk removal of drafts

Question
How do you use the DraftDetectionModule utility to perform the bulk removal of drafts in IBM Web Content Management (WCM)?

Answer
A new DraftDetectionModule with an optional Remove mode (Remove=True) was developed to automate bulk removal of drafts. In WCM 6.1.0.1, this function was added in PK74353 (included in CF6)
The module must first be configured in the WCM configuration file before it can be used. This is similar to the MemberFixer/LibraryDelete module. To configure the DraftDetectionModule, perform the following steps:

1. Edit the \wcm\shared\app\config\wcmservices\WCMConfigService.properties file.

2. Add the following three lines underneath the "connect.businesslogic.module" property:

-- conect.businesslogic.module.draftdetection.class=com.aptrix.pluto.workflow.DraftDetectionModule
-- connect.businesslogic.module.draftdetection.remoteaccess=true
-- connect.businesslogic.module.draftdetection.autoload=false


3. Add "draftdetection" to the end of the "connect.businesslogic.module" property as follows:

connect.businesslogic.module=,draftdetection

4. Restart the server.

To run the new module in report mode, place the following URL in the browser:

http://[HOST]:[PORT]/wps/wcm/connect/?MOD=draftdetection&library=[LIBRARY]

To run the new module in remove mode, place the following URL in the browser:

http://[HOST]:[PORT]/wps/wcm/connect/?MOD=draftdetection&library=[LIBRARY]&remove=true


NOTE: This utility can also be used with 6.1.0.1 with CF3 and onwards.

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.

Enabling Workflow to existing WCM items

Problem
After enabling Workflow to different WCM item types, the Administrator realized that the Workflow had been assigned only to items created after the change. The Workflow was not added to any of the items that existed prior to enabling Workflow.

Resolving the problem
First, if you haven’t done it already, you need to enable the Workflow to your items.

The WCMConfigService.properties file can be edited to enable workflows for different items.


1. Edit the file /wcm/shared/app/config/wcmservices/WCMConfigService.properties

2. Add com.aptrix.pluto.workflow.WorkflowControl to any of the control.itemtype settings. For example:

# control properties
control.Style=com.aptrix.pluto.workflow.WorkflowControl
control.Template=com.aptrix.pluto.workflow.WorkflowControl
control.Site=com.aptrix.pluto.workflow.WorkflowControl
control.SiteArea=com.aptrix.pluto.workflow.WorkflowControl
control.Cmpnt=com.aptrix.pluto.workflow.WorkflowControl


3. Save and close it

4. Restart WS Portal

At this point, you will be able to select Workflows to new items only.

Run the URL below in order to enable the Workflow to all existing items:

http://[HOST]:[PORT]/wps/wcm/connect?MOD=WorkflowEnablement&workflow=workflowName&library=libraryName&fix=true

Where, workflowName should be replaced by your Workflow name and libraryName must be replaced by your WCM library name.

You must always specify a workflow name in the URL. Any existing items will have this workflow applied to them. You cannot specify different workflows for different items. If you have further workflows to apply to items, you will need to add them manually.

If you want to restrict the workflow enablement to a specific item type, use the &restrictOn= option:

- Content - &restrictOn=Content
- Presentation templates - &restrictOn=Style
- Authoring templates - &restrictOn=Template
- Taxonomy - &restrictOn=Taxonomy
- Category - &restrictOn=Category
- Site - &restrictOn=Site
- Site area - &restrictOn=SiteArea
- Workflow - &restrictOn=Workflow
- Workflow stage - &restrictOn=WorkflowStage
- Workflow action - &restrictOn=WorkflowAction
- Library components - &restrictOn=Cmpnt


Multiple item types can be selected as follows:

&restrictOn=Content,Style,Cmpnt

Example: Enable Workflow to all existing Site and Site Area items:

http://[HOST]:[PORT]/wps/wcm/connect?MOD=WorkflowEnablement&workflow=workflowname&library=libraryName&fix=true&restrictOn=Site,SiteArea

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.

Fetch all PDM libraries from the context root using Content APIs

Problem
You are unable to fetch all libraries from context root using Content API as follows:


ContentRoot conroot=contentService.getContentRoot(loginContext);
List lis= conroot.getLibraries();

System.out.println("count::::"+lis.size());
Iterator itr=lis.iterator();


Cause
The call to ContentService.getContentRoot(loginContext).getLibraries() to create the List of libraries returns a zero (0), because it returns a datagraph that only includes the node requested and its attributes.

Resolving the problem
To get the libraries list, use the information from that node and do a getChildren, for example:

public DataContainer getChildrenByID(LoginContext loginContext,
java.lang.String id,
Service.PaginationParams paginationParams,
commonj.sdo.Type[] filter,
Service.Order order,
int options)
throws AccessDeniedException,
ItemNotFoundException,
LoginException,
ServiceException

This method returns a list of children that can be filtered, paginated and ordered. The list is always guaranteed to be a flat list since depth is not an option and the object represented by the path will not be returned.

Some information on this Content API has been removed in version 6.1 (pdm library and its usage of cmapi). Lotus Quickr and the supported REST APIs are the preferred content solution going forward.

Friday, April 17, 2009

Using the Web Application Integrator for IBM WebSphere Portal

Overview

Web Application Integrator for IBM WebSphere Portal is a solution which allows external web applications to be integrated with WebShpere Portal. It allows Portal customers to further leverage their investment in Portal by using it to access to web applications, like Quickr
Why is WebAppIntegrator solution unique?

Typically, when an external web application like Lotus Quickr is integrated with Portal, two approaches are considered: either write a set of portlets that expose the web app's UI/functionality or use Portal's web clipper portlet (an iFrame based portlet). WebAppIntegrator offers a third approach. It is particularly attractive because:

1. No portlet development is required to implement this integration since it does not use portlets at runtime. Portal administrators, in concert with the internal web application owner, can do this integration.
2. It does not use an iFrame. Consequently, the viewing area of the web application is not constrained in any way (i.e. no iFrame scroll bars). Also, all JavaScript and links within the integrated web app continue to function as expected.
3. Integration is achieved in three simple steps.
How does WebAppIntegrator integration work?

WebAppIntegrator integration is achieved by "injecting" Portal navigation markup into Lotus Quickr at render time. The solution implementation leverages the existing Portal URL page feature and makes use of a new Portal entry point - WebAppIntegrator theme template - which returns JavaScript that generates Portal page navigation markup (e.g. page tabs, launch menu and bread crumbs). This markup can be "injected" into Quickr by adding exactly one HTML

You should see that the event and window objects are accessible to both the old 'wrapped' and new onload functions.

One last alternative... Working with WebSphere Portal 6.0 and IBM's JSF-based Ajax framework, I found that the javascript called by the page's onload event handler (via the addBehaviour() method, or hx:behaviour tag) is actually a property of another object that seems to expect values from within this object as parameters. This makes it next to impossible to automatically deduce the correct parameters to pass in from the wrapper function. In cases like this, there's another very simple workaround that is suitable for many occasions - the old setTimeOut function:

var t=setTimeout(newOnloadFunction, 100);

This above will call your function 100ms after this script is executed. Remember that this could be a bit unreliable. Putting a line like the above in your page starts the clock from the point the browser renders that part of the page. On a page that takes a long time to render, this could mean that your script fires before body.onload. There's a chance that DOM elements your script references (for example using getElementById()) may not yet be present on the page in such a scenario. For best results, put this as close to the bottom of your page as you can, and increase the time value as much as you can (although this can look glitchy if your onload event makes visual changes to the page). Also make sure you handle scenarios where the script fails to find DOM objects, perhaps by setting a new timer to go off in another 100ms time.

Making the Search Center Box (embedded in the theme) available to anonymous users

Problem
Anonymous users cannot view the Search center box embedded in the theme. How can you make this search box available to them?

Solution
To enable this functionality, use these steps:

1. Log in to the portal using an administrative ID.

2. Go to Administration > Portlet Management > Portlets and add anonymous user role to Search Center portlet

3. Go to Administration > Manage Pages and add anonymous user role to the Search center page.

Note: This change does not automatically make all search scopes viewable to anonymous users, To make the scopes viewable by anonymous user, you must make it "Visible to Anonymous user" through the Manage search portlet.

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.

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.

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

portlet statistics about the number of users online wps 5.1

Just to follow up the earliar post for wps 6 and here it is to implement for 5.1.

Next on this series for 6.1.

portlet statistics about the number of users online

Problem: jsp is HttpSessionListener interface implementation, portlet in how is this not possible or that there are other interface?
My wps is 5.1, tested landing users can record, code as follows

private static int activeSessions = 0;

/** / **
* @see javax.servlet.http.HttpSessionListener#sessionCreated(javax.servlet.http.HttpSessionEvent)

* /
public void sessionCreated(HttpSessionEvent se) {
activeSessions++;
saveOnlineNum();
} )

/** / **
* @see javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent)

* /
public void sessionDestroyed(HttpSessionEvent se) {
if(activeSessions > 0)
activeSessions--;
} )

/** Online access to the current number of
* @ Return the current line number
*/ * /
public static int getActiveSessions() {

return activeSessions;
} )

Can not record if anonymous, prompt: NO PORTLET SESSION YET.
Do not know how this custom? Give a prompt, thank you

Answer:

In fact, implementation of this feature is not particularly difficult, it is important that you must know the work of the whole mechanism of the container Portal. Because of the length of questions, I will not elaborate too much here at Portal container is how the job.

Online for your statistics on the number of questions, you can understand that: the entire Portal page is being assembled and rendering, that is the root Portal page where it is. Portal page exist in the root of the Portal Server directory installedApps application wps EAR, if you have custom themes and skins on the know.

Well, about the number of online statistics, statistics on the number that must be at the EAR in the wps to worry too much about the application and follow-up.
web.xml such as in the configuration file, add the following filter and listener


ClickStreamFilter
ClickStreamFilter


com.ibm.portal.user.utils.CustomClickStreamFilter





ClickStreamFilter
/*



...... ......
...... ......



com.ibm.portal.user.utils.CustomClickStreamListener


Now you use this to display stat in whatever way you want.

User driven personalized skin in wps 6

We know now just to support the administrator Portal6 unified skin, not users own personalized skin. The following is a simple implementation of the process of personalized skin.

At $ portalPath / themes / html / Hebmc path has the following documents under the

1, since the definition of three sets of subject css: styles_default.css default version of the style; styles_big.css Style Deluxe Edition; styles_thin.css style version of Jane

2, modify the application of Default.jsp information session. Reference category are as follows:

<%@ page import="javax.servlet.http.HttpServletRequest"%>
<%@ page import="javax.servlet.http.HttpServletResponse"%>
<%@ page import="javax.servlet.http.HttpSession"%>
<%@ page import="com.ibm.wps.puma.User"%>
<%@ page import="com.ibm.portal.um.PumaLocator"%>

3, access to user information in session.

<%
HttpSession session = request.getSession();
String styleId = "01";
if (session.getAttribute("com.ibm.wps.util.session_user") != null) {
User user = (User) session.getAttribute("com.ibm.wps.util.session_user");
if(user==null){
…… }else{ ...

} ) %>

Through access to user information, access the settings on the skin field information.

4, personalized skin based on field information to determine the path stylesName.


href='' rel = "styleSheet" type = "text / css" />

5, the user successfully topic. Note: Topics for the course of this write-off required in order to have the effect of re-landing.

Working with navigation model spi

Get the Current Selected Page
public static ObjectID getCurrentPage(PortletRequest request,
PortletResponse response) throws StateException, NamingException, IOException {
ObjectID oId = null;
try {
NavigationSelectionModelProvider provider = getNavigationSelectionModelProvider();

NavigationSelectionModel model = provider.getNavigationSelectionModel(request, response);
NavigationNode node = (NavigationNode)model.getSelectedNode();
oId node.getObjectID();
} catch (ModelException e) {
System.err.println("The current page could not be located = " + e);
}

return oId;
}

protected static NavigationSelectionModelProvider getNavigationSelectionModelProvider() {
NavigationSelectionModelProvider provider = null;
try {
if(navSelHome == null) {
Context ctx = new InitialContext();
navSelHome = (PortletServiceHome)ctx.lookup("portletservice/com.ibm.portal.portlet.service.model.NavigationSelectionModelProvider");
}
provider =(NavigationSelectionModelProvider) navSelHome.getPortletService(NavigationSelectionModelProvider.class);
} catch (Exception e) {
System.err.println("There was an error getting the navigation selection model provider = " + e);
}

return provider;
}


Create a Navigation Change URL
public static String generateUrl(
String pageName,
String portletName,
HashMap params,
boolean saveState,
PortletRequest request,
PortletResponse response)
throws StateException, NamingException, IOException {

final PortletStateManager mgr = getPortletStateManager(request, response);

// Get the URL factory
URLFactory urlFactory = mgr.getURLFactory();
String finalUrl = "";

try {
final EngineURL url ;

if(saveState) {
url = urlFactory.newURL(Constants.SMART_COPY);
} else {
url = urlFactory.newURL(Constants.EMPTY_COPY);
}
// Set the page this URL should point to
final com.ibm.portal.state.accessors.selection.SelectionAccessorFactory selectionFactory = (com.ibm.portal.state.accessors.selection.SelectionAccessorFactory) mgr.getAccessorFactory(com.ibm.portal.state.accessors.selection.SelectionAccessorFactory.class);
// Request the selection controller to set the page; pass in the state associated with the created URL
final SelectionAccessorController selectionCtrl = selectionFactory.getSelectionAccessorController(url.getState());
// Set the page; you need the unique name (String) or the ObjectID of that page
selectionCtrl.setSelection(pageName);
// Dispose the accessor (avoids memory leak)
selectionCtrl.dispose();
if(portletName != null) {
// Set portlet render parameters
final PortletAccessorFactory portletAccessorFactory = (PortletAccessorFactory) mgr.getAccessorFactory(PortletAccessorFactory.class);
// Get the portlet controller to set render parameters; pass in the state associated with rge created URL
final PortletAccessorController portletCtrl = portletAccessorFactory.getPortletAccessorController(portletName, url.getState());
// Set the render parameter
if(params != null) {
portletCtrl.getParameters().putAll(params);
}
// Dispose the accessor (avoids memory leak)
portletCtrl.dispose();
}
finalUrl = url.writeDispose(new StringWriter()).toString();
} finally {
urlFactory.dispose();
}
return finalUrl;
}