Custom session timeout popup message in ADF/ Webcenter portal

Hi All,

In ADF and webcenter applications sometimes we have a requirement to show custom session time-out message.I have tried A team article approach as mentioned but this is not working for me in webcenter 11.1.1.8 not even in portal framework or run time portal. So I have tried something to handle this. In ADF application normally we have a popup before session time out and one after the session is expired.

So I need to disable standard warning message for expiry. I did that like below.

To disable to warning for session time out –

Add these entries in web.xml as

<context-param>
  <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
  <param-value>client</param-value>
</context-param>

<context-param>
  <param-name>
     oracle.adf.view.rich.sessionHandling.WARNING_BEFORE_TIMEOUT
  </param-name>
    <param-value>0</param-value>
</context-param>

Fair enough. Now you will not see any ootb warning before session time out.But I need a customized session time out popup.Following is the solution for that.
Add this code in the your page template for ADF and webcenter application.

 <af:resource type="javascript">
     var timeoutID;
    resetTimeout();
    function resetTimeout(){
        if( timeoutID ) clearTimeout( timeoutID );
        timeoutID = setTimeout( ShowTimeoutWarning, 1500000 ); // this is popup will come if user is idle for 25 minutes(25*6000)
    }
    function ShowTimeoutWarning() {
       var popup = AdfPage.PAGE.findComponentByAbsoluteId('pt_p1');
       popup.show();
    }

    document.onkeyup   = resetTimeout;
    document.onkeydown = resetTimeout;
    document.onclick   = resetTimeout;

    </af:resource>

and in the page template add a popup.You can also skin your popup as you like through normal skinning.

 <af:popup id="pt_p1" animate="default">
           <af:dialog id="tod" title="Warning" closeIconVisible="false" type="ok">
              <af:outputText value="You session will expire in next 5 Minute." id="pt_ot1"/>
           </af:dialog>
         </af:popup>

Thats it. You can try this in ADF , webcenter portal framework and or runtime portal too.

Happy learning with Vinay in techartifact.

Building ADF Taskflow for reuse

Hi All,

If you making taskflow for reuse either as jar or in portal and so on.Always make sure one property that Library Internal
This property makes an entry in task-flow-registry.xml and enable/disable taskflow to reuse.

Library Internal: This property controls the visibility of a task flow when packaged in an ADF library.
This helps developers to expose only those task flows that are indented for reuse.

taskflowProperties

if you check this property you will have task-flow-registry.xml as below

<?xml version = '1.0' encoding = 'UTF-8'?>
<task-flow-registry xmlns="http://xmlns.oracle.com/adf/controller/rc">
 <task-flow-descriptor path="../../main/public_html/WEB-INF/testTaskFlow.xml" id="" type="" uses-page-fragments="false" library-internal="true" remote-invocable="false" train="false"/>
</task-flow-registry>

 

So always make sure you never check this property if you want to reuse.Or if you have parent taskflow and 5 sub taskflow which is called by parent taskflow then you can have 5 sub taskflow as
internal library but parent should be as internal library false.

Happy reusing with Vinay in techartifact

Deploy ADF application as shared library in weblogic

Shared library – WebLogic Shared Library is an Enterprise Application Archive, a stand-alone EJB, a Web Application module, or a JAR file that is registered with Oracle WebLogic Server as a shared library. The library resources can be shared between multiple applications, alleviating the need to have duplicate copies of the resources in each application. For an example, we can all dependency as shared libraries in weblogic.

Normally in bigger application, best practice is to use common features application or dependency as shared library in weblogic. For example, taking an webcenter portal application
we are making custom taskflow and using it in webcenter portal application. We can deploy these adf taskflow as shared libraries and can reference in weblogic.xml for Portal application.

We have two option.
– Deploy adf app as jar and then deploy as shared library or wrap jar into war profile and deploy as shared library.
– We can directly deploy adf application as war shared lib in Weblogic.

Following is the process for ADF/ Webcenter Application in jdeveloper

1) Create deployment profile as war file.
2) Create an MANIFEST.MF file as META-INF/MANIFEST.MF

Manifest-Version: 1.0
Implementation-Title: ADF_Shared_Lib
Implementation-Version: 1.0
Specification-Title: ADF_Shared_Lib
Specification-Version: 1.0
Extension-Name: ADF_Shared_Lib

3) Edit war deployment profile and add MANIFEST.MF in war options.

555

4) Deploy ADF taskflow to weblogic(assuming you have made connection with weblogic in jdeveloper) to specific managed server or admin server.
5) mark option as deploy as shared library instead of application.

11

222

444

6) In master (Portal) application enter reference of your shared library as follows

ADF_Shared_Lib 1.0
1.0
true

This way you can directly deploy from the jdeveloper. Other options is to deploy as war file and find war file from specified location and go to weblogic admin console
and install as shared library

11111

Note: If you deploying shared library again, make sure, you increase implementation version every time to specify version no.

Video –

Troubleshoot :

IOException: ‘Invalid header field; with manifest
Solution – Make sure name is name is correct. There is proper spacing after colon in manifest file content.

Unresolved WebApp library references defined in weblogic.xml
Solution- Make sure you have same implementation version and specification version of shared library, If there is mismatch you will get this error.

Till then happy deployment in Weblogic with Vinay…..