In today's blog post I will cover some Web Content Manager Questions and Answers.
How to pass in the current project into an AJAX component call for previewing a project?
It is a common pattern to load menu's or other WCM components directly via AJAX to display some data. In case of a project based preview in an authoring scenario though the hard coded URL to the component is missing the project the author selected and so changes to items loaded by the component will be missing. The URL for a component with a project has the projectid parameter appended - e.g. it could be:
No out of the box plugin allows to generate the projectid parameter for a component so I implemented a rendering plugin one can reference within WCM to get the projectID - the parameter could then be attached to a static URL for a component or multiple components. The war file can be downloaded here including the source: Download.
Is it possible to use syndication between servers that are in different time zones?
Syndication is fairly sensitive to time differences between the syndicator and subscriber. It operates across time zones though so will be able to handle servers in different time zones as long as the time is synchronized (e.g. 9 am EST, 6 am PST).
What is the best way to have syndication triggered only on demand?
One option is to disable the syndicator or subscriber or both and turn them on when needed.
The other option is to leverage manual syndication. A challenge with manual syndication is that when the subscriber is restarted it can lead to syndication still happening. With the setting connect.moduleconfig.syndication.update.subscribers.on.start=false in WCM WCMConfigService this can be avoided.
How to clean the cache on secondary nodes in a cluster if the library was deleted and re-syndicated?
If the subscriber is a cluster of more than one JVM and in a scenario where a library is deleted on the subscriber and then re-syndicated from the syndicator an issue can arise where on secondary nodes cached content is being served. To solve the issue for this case stop the JVM, clean the JCR file cache in the directory <wp_profile>\PortalServer\jcr\binaryValues\cache\PortalContent\1 (in case of issues in virtual Portals delete the other folders in the directory PortalContent). After restarting the problem should be solved.
How to deal with the use case of multiple sorting patterns for a list of items served by a Menu?
Possible solutions are:
2. Implement more than one Menu with different sorting patterns and call them on demand. This can work well in case a very limited amount of sorting options exists and a larger amount of data exists.
3. Leverage the QueryService API on the server and sort based on an input parameter. Be careful with large result sets to avoid performance issues.