Friday, September 16, 2011

Integrating UCM Wiki Content Presenter into WebCenter 11g PS3/PS4

WebCenter 11g PS3/PS4 is able to store and retrieve Wiki content directly to and from Oracle UCM Content Server. Thats really good improvement comparing with early WebCenter releases, because there is no need to run separate server just to maintain static Wiki content. However, there are few tips and tricks to know, when integrating and making it work together with WebCenter Portal Framework application. This post will explain how to publish static Wiki content inside WebCenter Portal Framework application with the help of WebCenter Content Presenter ADF Task Flow.

Sample application defines connection to UCM server, you should change these details according to your infrastructure:


Download sample application for this post - EnterprisePortalApp_v8.zip.

Menu is implemented using WebCenter Portal Framework menu model. Wiki content will be retrieved and displayed in the menu using Content Query - Static Content:


In WebCenter PS3/PS4, we can construct menu from list of documents dynamically, based on UCM query. Content Query retrieves Wiki documents of type text/html, by specified Tag - populated list will be converted into menu automatically (make sure Insert Folder Contents option is set):


You may wonder, what is this Tag, which we are using to construct menu list. Tag is defined directly inside UCM, for example if we have documents stored in UCM:


Each of the documents/folders can be assigned with specific Tag, we can use this tag from WebCenter menu model Content Query:


Here is example of menu list populated from Content Query, Wiki document is loaded based on menu selection. All such menu links, generated based on Content Query, are rendering Wiki content directly inside Content Presenter:


We can edit Wiki document, because content is loaded inside Content Presenter automatically. Let's specify a link to another Wiki document available in UCM:


Wiki document is updated inside Content Presenter, using Rich Text editor:


Let's see what will happen, when we click on newly added link to another Wiki document:


When link to another Wiki document is clicked, WebCenter is loading Document Viewer task flow and opens referenced Wiki document:


Its not what we want, there is no need to open Document Viewer, we want to open Wiki document as static HTML page. Even more, when Document Viewer is opened from Wiki link, it destroys WebCenter menu model - portal application becomes broken (even Logout doesn't work):


But don't worry ! There is option to force Wiki links to behave as simple links and load static content - 31.3.5 Displaying Wiki Page Links Within Content Presenter. We need to update adf-config.xml file with Wiki resource handler:


Let's try to click on Wiki link again:


It works now ! Referenced Wiki document was loaded, even menu selection was updated automatically - thats what we need:


11 comments:

  1. Hi Andrejus,
    One of our requirements is to show news dynamically.

    That is, a user creates a news and tags it in UCM. After that, the news must be automatically displayed in different sections of the portal without having to create new pages or menu items (based on the tag value).

    Do you think this option could be done through this approach? Do you have some previous experience?

    Thanks in advance!!

    ReplyDelete
  2. Yes, you need to use Content Presenter and define CMIS Content Query based on Tag value in WHERE clause. It will retrieve new documents automatically for you.

    Andrejus

    ReplyDelete
  3. Thanks Andrejus!

    I have two more questions :D

    1) Could be possible to define the where clause at run time?

    2) We have already done a taskflow which shows the news lists, and we are trying to simulate url friendly functionaly, for example:
    - Our domain is www.company.com
    - We have a news section www.company.com/news where its avaiblable the news lists
    - We need to access to a specific content through its url, for instance: www.company.com/news/title-of-the-news. Until now it doesn´t have a specific page because it must be showed dinamycally.

    Through this approach I think we could implement a hidden menu which will provide this functionality. Is that right? Do you have some better recommendation? Could you suggest us some brilliant idea?

    Thanks again!

    ReplyDelete
  4. Answers:

    1) No, Content Query doesn't support Bind Variables - WHERE clause can be only static. Means you need to have several queries prepared in advance, based on Tag names

    2) You may use ExternalId attribute functionality from WebCenter Menu model

    You can contact me offline on email, we can discuss prototype ideas - this sounds interesting.

    Regards,
    Andrejus

    ReplyDelete
  5. Finally due to the timing of the project we decided to implement an alternative solution though initially involve further development.

    Anyway, thank you very much for your help, GREAT BLOG!

    ReplyDelete
  6. Its interesting about alternative solution, what you decided to implement ? Can you share in few words?

    Thanks,
    Andrejus

    ReplyDelete
  7. In case it helps to someone else (perhaps it is not the best option): we have developed a filter to translate between friendly url and internal pages.

    For example: www.company.com/news/title internally is redirected to www.company.com/news/search.jspx?id=title

    It´s a basic solution but it works.
    Regards!

    ReplyDelete
  8. It is possible to supply the entire CMIS query string as a ${EL} rather than using bind variables. In my case I had a managed bean create the CMIS query from the values of a number of Pop lists (defining the required Metadata) then the getter simply returned the entire thing into the Content presenter parameter. Worked a treat!

    ReplyDelete
  9. It is actually possible to supply the entire CMIS qry string via EL rather than use it as bind variables in the CMIS Query (the later being restricted by when the string is actually parsed in the life cycle)

    Instead, generate the entire string in the getter of a bean and reference this in the Qry Parameter. Make sure to use immediate eval EL.

    In my case of a custom Portal App I was able to dynamically generate the CMIS from a series of selected meta-data and generate the CMIS injected into the Content presenter. Worked like a charm.

    ReplyDelete
  10. Only keep in mind, entire CMIS query can be visible on for the Web client - because its set through parameter. Not sure if you want to expose it.

    Andrejus

    ReplyDelete