Custom session timeout warning popup in Webcenter portal 11.1.1.8 using jquery

Hi All,

Requirement – To show customised session time out warning popup in webcenter portal builder.

Solution- Edit your template-

editpagetemplate

In the composer, open web development and add an html markup anywhere in the template.
Edit that markup and add below code as the value.

Below snippet uses normal javascript.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dialog Box Witout Close Button</title>


</head>
<body>
<div id="dialog"  title="Dialog Title"></div>
<script>
var resetTime_int;
function resetTimer(){
    if(resetTime_int) window.clearTimeout(resetTime_int)
    resetTime_int=window.setTimeout(function (){
    if(document.getElementById('dialog').innerHTML = 'You have ' + (timeoutCount * 3000)/1000 + 'seconds until timeout' ;)     
    location.reload()
    }, 1000*60*2)
}

resetTimer()
document.onmousemove=resetTimer
document.onkeyup=resetTimer
</script>
</body>
</html>

html

Following snippet with Jquery

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dialog Box Witout Close Button</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>

</head>
<body>
</head>
<body>
<div id="dialog" style="display:none;" title="Dialog Title"></div>
<script>
var lefttime=3;
var interval;
interval = setInterval('change()',60000);


function change()
{
   lefttime--;
   if(lefttime<=2) {
$( "#dialog" ).dialog( "open" );
return false;

}
}
$("#dialog").dialog({
autoOpen: false,
position: 'center' ,
title: 'session',
draggable: false,
width : 400,
height : 200,
resizable : true,
modal : true,
});

JS

With jquery you can make it more beautiful with these dialog options.

Thats it. You can change the time to show popup for idle user.

Happy learning with Vinay in techartifact

Spaces server could not start. Failed to load webapp /wcsdocs.

Hi,

If you have got this weird issue in starting webcenter server

Failed to initialize the application ‘webcenter [Version=11.1.1.4.0]’ due to error weblogic.application.ModuleException: Failed to load webapp: ‘/wcsdocs’.
weblogic.application.ModuleException: Failed to load webapp: ‘/wcsdocs’
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:395)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
… …

Caused By: weblogic.management.DeploymentException: Error: Unresolved Webapp Library references for “[email protected][app:webcenter module:/wcsdocs path:/wcsdocs spec-version:2.5 version:11.1.1.4.0]”, defined in weblogic.xml [Extension-Name: SomeLibraryName, exact-match: false]
at weblogic.servlet.internal.WebAppServletContext.processWebAppLibraries(WebAppServletContext.java:2750)
at weblogic.servlet.internal.WebAppServletContext.(WebAppServletContext.java:416)

Solution – You need to delete the reference of this library in weblogic.xml and delete this library.First you can check in
/archives/applications and see if there is reference in weblogic.xml .

You can find weblogic.xml using following command.

find / -iname weblogic.xml

If you cant find then check in
/user_projects/domains/DomainName/servers/WC_Spaces/tmp/_WL_user/webcenter_11.1.1.4.0/extend.spaces.webapp

Check weblogic.xml and delete the reference.

Thats it. Happy coding 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…..