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

Wednesday, October 16, 2013

Customizing UI elements of the Authoring Template


Wow, its quite useful feature!!!. Now we have a ability to change the UI of the authoring field using custom JSP.


Benefits:-

1. Change the UI look and feel as per customer input
2. Restriction on the input value
3. Opportunity to write business logic on fly


Steps to do:-

1. Edit authoring template
2. Go to Default Content Properties
3. Click on "page icon"(properties) next to the field for which you need to customize the UI
4. Give the JSP path in the Custom JSP field. For ex: "/jsp/html/customUIField.jsp"
5. Place the custom jsp at "/wcm/wp_profile/installedApps/node/PA_WCM_Authoring_UI.ear/ilwwcm-authoring.war/jsp/html"

Ref: http://publib.boulder.ibm.com/infocenter/wpdoc/v6r0/index.jsp?topic=/com.ibm.wp.zos.doc/wcm/wcm_dev_custom_jsp.html

Saturday, October 12, 2013

workspace.getById() throws AuthorisationException

Recently came across a requirement to migrate JSP component scripts from 6.1 to 8. In the process of migration found that workspace.getById() WCM API call is not functioning. 

Looking at the logs one could see following kind of error

com.aptrix.pluto.security.AuthorisationException: IWKPY1015X: 
Unauthorised access by {{employeenumber=11111111,ou=people,ou=b2e,ou=ebusiness, 8ef21840-54a0-102c-96c8-950414f94614, fi, Type: User}, 4, {false, {userAccess={}}, {editorAccess={}}, {managerAccess={}}, [all_auth_portal_users%all_auth_portal_users_group_id, anonymous_user%anonymous_user_id, all_users%all_users_group_id


The surprising thing is this happens in-spite of giving "Anonymous user access" 
When looked at the details found following 

In Websphere Portal 8, WCM API calls from custom JSPs by default relies on "Contributor" access to the target content. 

If one wants to override this rule could place following call just before the getById() call.

workspace.useUserAccess(true)


Ref: https://www-304.ibm.com/support/docview.wss?uid=swg21399507


Monday, April 15, 2013

Anonymous Search Collection for custom Search Portlet



Introduction

The objective of the task is to create a Portal Search collection, which
could index contents inside specific site area of the WCM. As the client
has specific UI needs, Instead of out of box Search Portlet, the developer
is expected to access the Search services from the custom portal. All
contents thus searched from the custom Portlet should be searchable in
anonymous mode.


Steps to Create Collection


· Go to Administration > Manage Search >Search Collections > Default
Search Collection
· Click "New Collection"



· Click "ok"


Steps to Create Index


· Click "NCCollection"
· Click "New Content Source"
· Under "Content Source type" select "WCM site"
· Under "General Parameters"
o Content Source Name : DataIndex
o Collect documents linked from this URL :
http://hostname:10039/wps/seedlist/myserver?SeedlistId=NC_Contents/Data&Source=com.ibm.workplace.wcm.plugins.seedlist.retriever.WCMRetrieverFactory&Action=GetDocuments
o Stop fetching a document after (sec): 1800

· Under "Schedulers"
o From: Today's Date
o At: Current time
o Update every: 1 days
o Click Create
· Under "Security"
o User Name: wpsadmin
o Password: wpsadmin
o Host Name: hostname
o Click Create

· Click "Save"
· Click Play icon


· After some time click "Refresh" to see no of Documents indexed





Giving Anonymous Access to the Collection Resources



· Go to Administration > Access > Resource Permissions > PSE Sources
· Click on "Assign Access"





· Click on "Edit Role" against User



· Click Add
· Select "Anonymous Portal User"
· Click "ok"


Accessing the Collection Service using contenthandler servlet

It is possible to launch the search over the index thus created using
contenthandler servlet. Following is the example url which caries a query
text as "keyword".

http://hostname:10039/wps/contenthandler/searchfeed/search?queryLang=en&locale=en&resultLang=en&query=keyword&start=0&results=10&index=Default
+Search
+Service%3A%3AC%3A%5CIBM%5CWebSphere%5Cwp_profile%5CPortalServer%5Ccollections%5CDataIndex

For linux/unix based portal environments, the url would be of bellow format

http://hostname:10039/wps/contenthandler/searchfeed/search?queryLang=en&locale=en&resultLang=en&query=keyword&start=0&results=10&index=Default
+Search
+Service%3A%3A%2Fopt%2FIBM%2FWebSphere%2Fwp_profile%2FPortalServer%2Fcollections%2FDataIndex

The above URL could be launched from the custom Portlet and the response
would be in the form of ATOM feed. The developer could parse the ATOM Feed
and build the custom Portlet as per the UI needs given by customer.

Thursday, March 14, 2013

Piece of Content Servlet for URI resolution


From Wps 6.0.1 onwards we have URI resolution service that helps to construct preview url of the web content in a most efficient manner.

Assume that you have content in WCM in the following hierarchy.

Testlibrary
|-----Site1
            |---Sitearea1
                        |-----content1

To preview the content we could use following url



In the above /poc or /mpoc is mapped to a servlet which is part of latest URI resolution service.

Now goto the page where you added the JSR286 Web content Viewer Portlet. The beauty of this servlet is it makes use of “web content mappings” defined under the portal page properties “Advanced Options”>”Edit Web content Mappings”

Add “Sitearea1” in to the list. This will inform POC servlet that all contents under the “Sitearea1” will use this page as the target for rendering the Web contents.

Monday, March 4, 2013

Steps to export and import WCM libraries


Export:


  1. Log in to the WAS Integration Solution Console using Administrator id.
  2. Go to Resources>Resource Environment>Resource Environment Providers
  3. Select WCM WCMConfigService > Custom Properties
  4. Update/Create the property "export.libraryname". Set the value as string containing library names separated by semi colon.Example: export.libraryname=library_1;library_2;library_3
  5. Go to directory /IBM/Websphere/wp_profile/ConfigEngine
  6. Enter command ./ConfigEngine.sh export-wcm-data -DWasPassword=password -DPortalAdminPwd=password -Dexport.directory=/home/user/exportdir -Dexport.singledirectory=true
Transfer the file
  1. Compress the above directory using the zip command: zip -r exportdir.zip /exportdir 
  2. Transfer the zip file to the target server
  3. Unzip it in some folder say /home/user/importdir
Import
  1. Ensure target server does not have same libraries created in it. If present kindly delete
  2. Go to /IBM/Websphere/wp_profile/ConfigEngine
  3. Enter command ./ConfigEngine.sh import-wcm-data -DWasPassword=password -DPortalAdminPwd=password -Dimport.directory=/home/user/importdir

This is suitable for Initial setup of Environment where we need to transfer bulky contents. For further updates kindly use Syndication.

Tuesday, February 26, 2013

Configuring Advanced Search in Out of Box authoring portlet of WCM 8




1.        Open  Integration solutions console (having url like https://yourhost:port/ibm/console/logon.jsp)  and login as administrator

2.   Click Resources > Resource Environment > Resource Environment Providers.

3.   Click WCM WCMConfigService > Custom properties 

4.   Search for following entries.
  •  wcm.authoringui.advancedsearch.searchonselection
  • wcm.authoringui.simplesearch.addstar
  • wcm.authoringui.advancedsearch.addstar
If these are not available please create new by clicking on "New"

Now your portal is activated for using "Advanced search feature in OOB WCM authoring portlet"



 



Friday, February 1, 2013

WCM Library Syndication in WPS8

1. Launch the Portal administration of the Subscriber server (Receiver)

2. Creation of Credential Vault Slot: In WPS8, syndication mechanism
requires "Shared Credential slot", so start to create the one by
clicking Administration > Access > Credential Vault

3. Click "Add a Vault Slot" and enter the details


4. Note the check box against "Vault slot is shared". Finally Click "ok"

5. Configuring Subscriber: Now Click on Administration > Portal Content
> Subscribers

6. Click "Subscribe Now"

7. Enter the Syndicator url. Ex: http://sourcehost:port/wps/wcm

8. Enter syndicator name SYNDSOURCE

9. Enter subscriber name SUBDEST

10. Choose the credential vault slot created above

11. Click Next

12. Select the libraries you want to syndicate; select the scope

13. Click Finish

14. To begin syndication, click "Update Subscriber"

Tuesday, September 18, 2012

WCM: Scheduled Move Action for Publish is irrelevent at the entry stage of Published workflow stage

Recently I came across a problem with regard to having "Schedule move action on Publish date". The scenario is this. For a Workflow Stage: Published, if "scheduled move action on publish date" is added in entry stage, we observed the content never stays in PUBLISHED status and moves to EXPIRED status.The reason for the behavior is explain in this article.

What is Scheduled move action?

This is the workflow action which pushes the content to next workflow stage upon satisfying some condition. This some condition is on the date field we select while creating the schedule move action. It could be on Live date(Publish date), Expiry date, General date or Selected date.

In our case we opted on Live date(Publish date) and created a workflow action called "To publish". This workflow action has been added in the entry action list for Workflow Stage "PublishedStage".

Now lets observe what happens in the content creation scenario alone. When content is created by default it pics the publish date as "current date". The moment content is created, published date will have value in past for sure. So "To publish" is going to be valid action for sure in this case. It is going to triggered whenever content enters "PublishedStage" Workflow stage. So after content leaves "DraftStage" and enters "PublishedStage", "To publish" is also triggered. The "To publish" going to just trigger "Next Stage" action, so naturally content has to land in "Expired" Stage.

Hope the explanation is logical. Through this exercise I learned precise behavior of "Scheduled Move action" and "Default publish date assignment in content creation process".

Now this pushes me to analyze why WPS is designed to populate "Current date" in the "Publish date" field by default in the content creation process?

Tuesday, April 12, 2011

Rich Text Editor in IBM v6.1

Business Need

In the todays world it is most common that CxO of a company would like to intract with public and employees over blogs, wikis... So it is imperative that that Content management system should have a most elegent content contribution interface with all the features of normal document autoring and aswell trouble free.

I took 3 tools for my analysis, they are

1. Ephox EditLive
2. TineyMce
3. CKEditor

Ephox EditLive

Pros:
# Most powerfull Rich Text Editor in the market with all essential features
# Good Support as it is licenced
# Good Code organization and easy to develop custom feature

Cons:
# Applet based so requires right version of JRE with all the clients
# Linking external CSS file for the style definition in portal context is tricky and required static definition at the configuration XML.

TineyMce

Pros:
# Rich in Features
# Javascript based and hence no dependecy with client side plugin
# Good architecture

Cons:
# Support is not good
# Custom development requires deep expertise
# Integration is not easy

CKEditor
Pros:
# Javascript based and hence no dependecy with client side plugin
# Easy to do Custom development
# Easy to Integrate

Cons:
# Poor Documentation and support
# Results in some allignment problem if the custom development involves custome tags.

If the organization objective is to find a tool for requires almost all employes of the organization to author a content, It is necessary to avoid dependency with client side plugins. In such case RTE based on the normal Javascript is better option. So essentially we are narrowed down to TineyMCE and CKEditor. Given this choise CKEditor look favourable in terms of cost to production with most decent features in place. If the content autoring requires support of custom tags, TineyMCe would be the better solution among all. On the otherway If number of contributor is less , Editlive is perfect option as the posibility to end with plugin problem is limited.

Ideal solution:

Inorder to better utilize the power of Editlive and to get the rouboustness of TinyMCE it is beter to make TinyMCE as a fallback for the Editlive. Fortunately Ephox is working on this fallback scenario and there is more challenge for them to meet the markup compatibility between two RTEs.

Inline Editing in WPS 6.1

Recently I was analysing the oppurtunity to utilize IBM Inline Edit mechanism given in Websphere Portal.

For example while implementing a Inline edit for List structure, we look for following features.

1.Create new content
2.Edit current content
3.Publish(Approve) content
4.Expire content
5.Delete content
6.Disable Authoring Components in Production

For any project above five operations are very basic functional needs. When started analysing we were so disapointed with the features provided by IBM.

Create Content & Approve Action

I have included the Authoring Tools component for Create content in the header of ther Menu component. This would result in rendering of button to create content. Rendering in proper we have a button in the list. On click of button well it took us to form based on the underlying authoring templeate. So far the behaviour is normal. After we will the form with values, we have been given the option to Save. Here is the problem, Upon the click of Save button the content is saved as Draft content. As we know menu component can only search published content, the the content just saved is not falling under the current search result and hence it does not appear in the rendering side. As there is no chance to render the draft content, we have no way to see Approve(Publish) button.

Workarround:

Bypass Draft. We must publish the content as soon as content is authored by clicking “Save and Approve”. (Not a better choise because all contents forced to go live)

Edit Content & Expire Content

Ok. It satisfies the core need of editing the current content.

There is no option in Authoring Tools component to render the expire button. Other way they can give it as part of Edit form. But even in edit form it fails to give option “Move to Next Workflow”.

Workarround:

For Next workflow: We have to move away from IBM inline edit and forced us to use Our own Custom implementation based on WCM API.

Delete Content

Perfectly OK. Good luck to IBM(So far we have not found issues)

Limitation to Disable Authoring Components in Production Site

Currently there is no parameter(configuration) available to stop rendering the Authoring links in production. Becaue of this Create, Edit, Delete buttons are rendered. This I feel is not a good practice

Workarround:

The quick and dirty option is to clear the reference to Authoring Tools from Menu component. Offcoure in this case we need to maintain different MenuComponent design for Authoring environment and Production environment. (We have be coutious if syndinacion is enabled, if enabled the only option is to lock the Menucomponent in Producion, so that syndication will not override locked contents). Alternatevely we can clear Authoring template and lock it.

Let’s hope future versions of WPS addresses these basic requirement.