Thursday 29 January 2015

ADF panelTabbed persistence issue with WebCenter Portal

Issue

 

Recently an issue was found working with ADF tabs. A panelTabbed component was added to a page with 'n' tabs, each of them had its own showDetailItem. The way this ADF component works is explained in this link; roughly speaking, there is a disclosed attribute in every tab where developer specifies when its content will be displayed. For instance:

       <af:panelTabbed childCreation="lazyUncached" id="pt2">
              <af:showDetailItem text="Tab1"
                                           id="sdi2"
                                           disclosureListener="#{pageFlowScope.utilBean.navigateToNode}"
                                           disclosed="#{navigationContext.currentNavigationModel.currentSelection.attributes['Target'] eq 'tab1' or param.p eq 'tab1'}"
                                           immediate="true">

                        <!--Task flow that will be displayed in that tab-->
                        <af:region value="#{bindings.taskflowTab1.regionModel}"
                             id="r3"/>

                        <!-- Navigation path to the tab, as it is defined in default-navigation-model.xml file-->
                        <f:attribute name="destination"
                                        value="app1/myTabPage/tab1"/>

               </af:showDetailItem> 
              <!--Other tabs here-->
         </af:panelTabbed>




Tabs are accessed via:
  •  URL: Introducing an URL specifying the tab parameter, i.e. http://localhost:7101app1/faces/oracle/webcenter/portalapp/pages/myTabPage.jspx?p=tab1
  • Click: Just clicking on the tab.
After deploying application to Development environment, the following issue was reported:


If a tab is clicked, then URL links to other tabs stop working properly. For instance, if tab number 4 is clicked, then URL links to tabs after number 4 stop working.

A Service Request was registered in Oracle Support and a tes case was provided. Pascal B., an experienced WebCenter Portal engineer, was able to reproduce the issue and found the cause:

It is an issue related to persistence storage. When a tab is clicked, the persistence for the selected tab is not set and the issue appears.


Solution

 

A workaround was provided which successfully solved the problem. By overriding the default ComposerChangeManager class to avoid persistence problems. Steps:

1. Create a java class to overwrite the default ComposerChangeManage: PortalComposerChangeManager.java

2. Set this custom ComposerChangeManager as default composer manager in the web.xml file:
Comment out the following
<!--
<context-param>
<param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
<param-value>oracle.adf.view.page.editor.change.ComposerChangeManager</param-value>
</context-param>
-->

Add the following:
<context-param>
<param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
<param-value>oracle.webcenter.portalapp.override.PortalComposerChangeManager</param-value>
</context-param>


3. Save all, deploy and test the application.

NOTE: As requested, here you may download a Tabs Sample Application where this issue is reproduced, and the same application where the issue is solved using the workaround.

References

 

PortalComposerChangeManager.java

ShowDetailItem Documentation

Oracle Service Request: SR 3-9372590301: ADF panelTabbed Navigation issue with WebCenter Portal

Bug 19265590 : ADF PANELTABBED NAVIGATION ISSUE WITH WEBCENTER PORTAL

Thursday 22 January 2015

Rendering ADF based on the device type

According to some statistics, nowadays more than half of internet usage occurs on mobile platforms. So it is time to ask yourself if your Portal is working properly in tablets and phones.

Latest WebCenter Portal release (11.1.1.8) includes some useful features that control how the pages are displayed in different devices. Also, if you are interested in modifying some Portal behavior in your code, deviceManagement EL expressions are available.

The following piece of code will return the device type accessing Portal:

<af:outputText value="#{DeviceAgent.currentScopeDeviceGroup.name}" id="a1"/>

This group of expressions has several applications, for instance conditional rendering:

                    <af:commandLink rendered="#{DeviceAgent.currentScopeDeviceGroup.name eq 'desktopBrowsers' or DeviceAgent.currentScopeDeviceGroup.name eq 'iOSTablets'}"
                                    text="Register"
                                    id="gl1" styleClass="linkBlue">
                      <af:clientListener method="open" type="click"/>
                    </af:commandLink>


That piece of code will show a Registration link only if the user is accessing Portal via desktop computer or iPads.

Possible values: desktopBrowsers, iOSTablets, iOSPhones, androidTablets, ...

References

 

Tablet Growth: Usage Statistics and Expectations

 

Tuesday 13 January 2015

WebCenter Managed Servers taking too long to start up

Issue 

 

In an Oracle WebCenter Portal installation, the process of starting a managed server took around 40 minutes. Checking the start logs, there was a long time between the login and the following line.

 [EL Info]: 2013-11-06 19:35:25.773--ServerSession(645650875)--file:/SOFT/software/middleware/product/11.1.1/oracle_common/modules/oracle.jps_11.1.1/jps-internal.jar_JpsDBDataManagerV2_nonJtaDataSource=594822561 login successful
<Nov 6, 2013 7:58:58 PM CET> <Warning> <J2EE> <BEA-160140> <Unresolved optional package references (in META-INF/MANIFEST.MF): [Extension-Name:
oracle.apps.common.resource

 Also, in the managed server log, it was registered a big delay in database connections:

The thread is waiting for data from DataBase (as the admin as managed server show the same thread)
[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'" id=23 idx=0x60 tid=24740 prio=5 alive, in native, daemon

 In order to find out the source of this problem, an AWR (Automatic Workload Repository) was requested to DBA. The report showed there was a single query that was taking 400 seconds to execute during server startup:

SELECT LOGID, DN, ACTION, APPLICATIONDN, ATTRNAME, CREATEDATE, ATTRVALUE, VERSION FROM JPS_CHANGELOG WHERE DN LIKE :1 ESCAPE :2 ORDER BY LOGID DESC

That query is against the JPS_CHANGELOG table in the OPSS (Oracle Platform Security Services) schema, where WebCenter security is located. It is a log where all the updates in WebCenter permissions are registered. The size of the table was checked, getting a result of 600.000 rows. Therefore, it needed to be purged.

Solution

 

Oracle explained how to maintain that table here. Basically, the following query should be executed in the OPSS schema:

SQL>delete from jps_changelog where createdate < (select(max(createdate) - 1) from jps_changelog);
SQL>Commit;

It is also recommended to execute the DMS_STATS package to gather database storage statistics.

After that purge:
  1. Start of the servers, including AdminServer, only took 4 minutes.
  2. JPS_CHANGELOG table size was 2.000 rows.
  3. AWR report showed that the query was taking only 40 seconds.
In case you are not sure if WebLogic security is maintained in databse, perform the following steps:
  1. Login to Enterprise Manager as administrator.
  2. Select WebLogic domain.
  3. Navigate to Security -> Security Provider Configuration.
  4. In the screen the database storage would appear.


Conclusion 

 

If WebCenter Portal has security delegated in an OPSS schema, it is important to program a periodic purge of the JPS_CHANGELOG table. Otherwise, platform performance would decrease progressively, showing an increase in the startup time of the servers.

References


Oracle® Fusion Middleware Application Security Guide 11g Release 1 (11.1.1):

Oracle Support Service Request:
SR 3-8069279071 : My custom portal node spends more 25 min to startup