lunes, 31 de julio de 2017

WCP 12c: Using WCCDOC Task Flow as Document Preview

One of the biggest changes of Oracle WebCenter Portal 12c has been its integration with Oracle WebCenter Content.

All the legacy ADF Bounded Task Flows such as Document Explorer, Document Viewer etc... has been deprecated and replaced with the same component as used by WCC ADF UI.

Oracle WebCenter Portal 12c uses a wrapper to WCC ADF UI called Content Manager Task Flow (which internally calls to wccdoc, wccmain and other internal Task Flows used by Oracle WebCenter Content).


One of the missing functionalities is how can we preview a Document in WCP 12c as Document Viewer does not exists anymore.

In OTN WCP Forum I was asked how to achieve this. It can be achieved with the wccdoc Task Flow (https://community.oracle.com/thread/4061288)

There are two choices for accessing a detail of a specific content / document in WCP 12c:
  • Offer a link by using /wccdoc Servlet which will open a Oracle WebCenter Portal page with Content Manager Task Flow pre-loading the specific content / document specified in the dDocName parameter. (E.g.: /wccdoc/d?dDocName=[YourdDocName])

    Use the following snippet of code for generating links to Detail / Download a specific document in WCP:
    public static String getApplicationURL() {
     HttpServletRequest request = (HttpServletRequest)ADFContext.getCurrent().getEnvironment().getRequest();
     StringBuilder urlBuilder = new StringBuilder(request.getScheme()).append("://").append(request.getServerName()).append(':').append(request.getServerPort()).append(request.getContextPath());
     return urlBuilder.toString();
    }
    
    public static String generateDownloadDocumentLink(String dDocName) {
     StringBuilder docURL = new StringBuilder(DocUtil.getApplicationURL());
     docURL.append("/wccproxy/d?dDocName=");
     docURL.append(dDocName);
     return docURL.toString();
    }
    
    public static String generateDetailDocumentLink(String dDocName) {
     StringBuilder docURL = new StringBuilder(DocUtil.getApplicationURL());
     docURL.append("/portal/wccdoc?dDocName=");
     docURL.append(dDocName);
     return docURL.toString();
    }

  • By adding the wccdoc Task Flow to the Resource Catalog and configuring its Input Parameters.
    wccdoc Task Flow in the Resource Catalog

    WCCDOC Task Flow Input Parameters (Compact Mode overrided)
Take care when configuring the WCCDOC Task Flow as it will throw a  ClassCastException ( javax.servlet.ServletException: /wcc/docInfoTabs.jsff @23,67 test="#{wccDocInfoBean.summaryTabDisplayed}": java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean) If you try to use the checkbox of the Compact Mode Input Parameter. The secret is to setup manually to a boolean EL Expression!!.

Use #{wccRuiConfiguration} in the Wcc Rui Configuration Input Parameter. It is a Managed Bean pre-calculated by Oracle WebCenter Portal with the connection settings.

Now you can configure a WebCenter Portal Page to display specific document / content.
Map the dID and (or) dDocName to a URL parameter or Page Attribute to make it dynamic!.

Note: The usage of WCCDOC Task Flow is not supported by Oracle.

jueves, 6 de abril de 2017

WCP-BPM12c: Process Workspace

In case of you are planning to integrate the BPM Process Workspace in WebCenter Portal in 12c version then read the following :).

First of all you need to follow the steps mentioned in the official documentation (Note that now this information is in the BPM 12c documentation and not in WCP 12c documentation):

BPM 12c - Integrating with Oracle WebCenter Portal

Basically you need to:
  1. Register a BPEL connection within WebCenter Portal.
  2. Restart Portal (then it will use this BPEL connection to create a Worklist Connection as well). You can check all of this connections by using WebCenter Portal WLST Scripts.
  3. Add the BPM Resource Catalog as in the Shared Assets of WebCenter Portal

Surprisingly the Resource Catalog only offers the Task List and Available Processes Task Flows. I am wondering what happened with Cases and other stuff you can access in the BPM Workspace :/. In 11g version we had the Portal Templates and a complete setup of BPM Task Flows. All of them has been deprecated (as I saw when decompiled the BPM-WCP Task Flows library)

BPM Resource Catalog (BPM Task Flows)
When you add any of these Task Flows into a WebCenter Portal Page you will face an amazing and sexy error in your SOA server logs.

java.lang.NullPointerException
at oracle.bpm.workspace.adf.wcp.WebCenterTaskFlowPageListener.beforePhase(WebCenterTaskFlowPageListener.java:67)
at oracle.adfinternal.controller.lifecycle.LifecycleImpl.internalDispatchBeforeEvent(LifecycleImpl.java:97)
at oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:195)
at oracle.adfinternal.controller.faces.lifecycle.


This is due to a BUG that has been solve in previous releases. But, unfortunately were not included in 12c version. I have already raised this bug and you can find the patch here:

Patch: 25064586: 12.2.1.2.0 Blank worklist portlet in webcenter portal to bpm integration

Now... We can add the Task List and Available Processes Task Flow to our pages :).

BPM Task List in WebCenter Portal
If you still face a blank screen and the following stack trace appears in soa_server1.out

Broken pipe[[
java.io.IOException: Broken pipe
    at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
    at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
 
It means that you are accessing to your WCP using the OHS port or LB Port and you have made the configurtion of your BPEL connection by using the SOA Server Managed Server Port. Please, make sure you followed properly the steps mentioned in the documentation about configuring OHS :).

I hope this guideline helped you!.

My next step is ask Oracle why they have deprecated the Other Task Flows as I have the feeling that all BPM functionality is not now exposed :(.

WCP 12c: Automatic switch of the Skin when a Template is selected

Do you like when an Out of the Box Page Template is selected then a Skin is selected automatically?.

You can do it with to your custom Page Template / Skins as well.

Basically you need to add a property to your Page Template called preferredSkin. Go to the Edit Properties of your Page Template and add the preferredSkin (skin-family name).

preferredSkin Property for auto-skin selection


Now when you select the Page Template then the Skin will be automatically selected as well.
This will help your Portal Administrators to do not have headaches looking for the Skin that is more suitable for your Page Template.

martes, 21 de febrero de 2017

WebCenter Portal 12.2.x.x: Performance Bug in VCR services

During my last project of Oracle WebCenter Portal 12c we have found a performance degradation when using Content Presenter.

As you know, Content Presenter calls the following services which are coming from PortalVCRHelper component:
  • VCR_GET_CONTENT_TYPES: Returns the list of Content Types which are Profiles and Region Definitions defined in WebCenter Content.
  • VCR_GET_CONTENT_TYPE: Returns specific information of the Content Type.
  • VCR_GET_DOCUMENT_BY_NAME: Returns the information of a DOC_INFO + the Content of the Data File (XML content).
On Oracle WebCenter Content 12cR2, Imaging has been embedded into the Content Server as two components:
  • Imaging: Bringing Imaging capabilities to the new Content Manager Task Flow (which is the WCC ADF UI embedded in WebCenter Portal).
  • IpmRepository: The old capabilities of using Imaging as a repository.
Imaging executes some filters in Oracle WebCenter Content which degrades the performance of the VCR calls when the number of Profiles is big enough. This component cannot be disabled as is mandatory for Content Manager Task Flow.

For example, if you have 40 Profiles and 8 Region Definitions the times can be like the following ones:
  • VCR_GET_CONTENT_TYPES around 12-16 seconds to execute
  • VCR_GET_DOCUMENT_BY_NAME: around 2-4 seconds each one
In case of having in the Home Page of your Portal 12 Data Files it is translated to: 16 + 12*4 = 64 seconds to load the Home Page!!.

This bug has been solved after working hard with Oracle Support and exists already a patch :).

Patch 25528107: Slow performance from VCR_GET_CONTENT_TYPES when IPM components are enabled

It will reduce the latency of calling VCR services. However, never forget to Configure Coherence cache as suggested by the A-Team for reduce the VCR calls as much as possible :).

http://www.ateam-oracle.com/optimizing-content-cache-performance-in-webcenter-portal/

lunes, 20 de febrero de 2017

Speaker at OGh Tech Experience 2017!

Dear friends / fans and lovers of Oracle WebCenter 12c! I will be in the OGh Tech Experience 2017 for speaking about "Performance in Oracle WebCenter 12c" for sharing tricks, tips and experiences I had on WebCenter 12c!

Stay tuned!!!!

https://www.ogh.nl/

lunes, 16 de enero de 2017

WCP 12.2.x.x: BUG Customizing the Welcome / Login Page

Hello everyone and welcome to 2017!.

We comeback again to the Blog and not sharing a BUG I have raised to Oracle.

The bugs can be tracked as following:

Bug 22748849 : System page customization for Welcome Page not working
Bug 22921957: - UNCAUGHT SECURITYERROR: FAILED TO EXECUTE 'REPLACESTATE' ON 'HISTORY' ON PAGELOA

Summary of the Bug:

"If you customise the Login Page then a JavaScript error will happen in the ADF JS boot.js. This error will block you to try to login again after a first fail attempt which is quite annoying.
In addition, restoring the Welcome Page to the default one will not fix the issue".

ADF JS Error
Basically, the steps to reproduce it are the following:

1. Go to http://wcp.vm.oracle.com/webcenter/system/welcome.jsp
2. Enter wrong password and then sign in
3. It will redirect to http://wcp.vm.oracle.com/webcenter/system/login.jsp?login_fail=true
4. Try now to re-enter the password and I am logged in.
5. Go to Administration->System Pages and Customize Webcenter Portal Welcome Page
6. The page being edited is http://wcp.vm.oracle.com/webcenter/portal/oracle/webcenter/page/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/businessRolePages/Landing.jspx
7. For example, change the color for User Name and Password.
8. Save and Close
9. Logout and Remove the cookie from browser history.
10. Go to http://wcp.vm.oracle.com/webcenter/system/welcome.jsp - You can see the color is changed
11. In addition, you can also see the boot-ASPEN-6282.js:244 Uncaught DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL message in the Console
Uncaught DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL 'http://wcp.vm.or/oracle/webcenter/page/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/businessRolePages/Landing.jspx' cannot be created in a document with origin 'http://wcp.vm.oracle.com' and URL 'http://wcp.vm.oracle.com/webcenter/system/welcome.jsp'.

12. Enter the wrong password and You will not be redirected to http://wcp.vm.oracle.com/webcenter/system/login.jsp?login_fail=true


Update: Oracle has released the patch for ADF Framework for fixing this issue :).
 

Patch 22921957: UNCAUGHT SECURITYERROR: FAILED TO EXECUTE 'REPLACESTATE' ON 'HISTORY' ON PAGELOA