Skip to Content
Author's profile photo Former Member

Customizing Portal Log off confirmation box

Unlike the log off URL we don’t have any UME parameter for customizing log off confirmation box.(Fig 1)

image

This blog explains to maintain a custom UME parameter in order to handle the log off confirmation box.

Step 1 :

Download the com.sap.portal.navigation.masthead.par.bak file from

image

!https://weblogs.sdn.sap.com/weblogs/images/51753/Reminder2.gif|height=285|alt=image|width=346|src=https://weblogs.sdn.sap.com/weblogs/images/51753/Reminder2.gif|border=0!

Step 4 : Modify the HeaderiView.jsp

I have created a new method getLogoffConfirmationBox() just below getExternalLogOfUrl() method

!https://weblogs.sdn.sap.com/weblogs/images/51753/method.gif|height=199|alt=image|width=600|src=https://weblogs.sdn.sap.com/weblogs/images/51753/method.gif|border=0!

Now call the getLogoffConfirmationBox() method in the script(as shown below) and code the condition
If ‘True’ the confirmation box will be shown else the logoff() function is directly called.

!https://weblogs.sdn.sap.com/weblogs/images/51753/condition1.gif|height=258|alt=image|width=508|src=https://weblogs.sdn.sap.com/weblogs/images/51753/condition1.gif|border=0!

!https://weblogs.sdn.sap.com/weblogs/images/51753/condition2.gif|height=171|alt=image|width=342|src=https://weblogs.sdn.sap.com/weblogs/images/51753/condition2.gif|border=0!

Step 5 :

Export the par file and deploy in portal.

Step 6 :

Go to User Management Configuration -> Direct Editing and add the line as in Fig 1.

Step 7 :

Restart portal

+
Advantages : +

1) Now the Logoff confirmation box is part of the Portal Administration than development.
one time upload the par file and switch on/off the confirmation box.

2) This is just a hint of using the UME properties. we can use this for our custom JSP pages also.

For those who use external log off link (SSO accross applications). They might want to change the log out(confirmation) text.

!https://weblogs.sdn.sap.com/weblogs/images/51753/logoff_text.gif|height=308|alt=image|width=292|src=https://weblogs.sdn.sap.com/weblogs/images/51753/logoff_text.gif|border=0!

!https://weblogs.sdn.sap.com/weblogs/images/51753/logoff_text1.gif|height=81|alt=image|width=516|src=https://weblogs.sdn.sap.com/weblogs/images/51753/logoff_text1.gif|border=0!

Assigned Tags

      8 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      I liked it!
      Author's profile photo Former Member
      Former Member
      Hi Dhruv,

      Are these special jar files? If yes, where can I find them?

      I am on EP 6.0 SP12 and I could only find the com.sap.portal.navigation.masthead_core.jar in the J2EE engine. The API jar is missing. Am I looking in the wrong place? Greatly appreciate any help.

      Thanks.

      Author's profile photo Former Member
      Former Member
      Shiva,
      The supporting jars will be part of com.sap.portal.navigation.masthead.par.bak. but when you explode in NWDS it might not join in the lib folders. so you might want to manually add those files.

      -D

      Author's profile photo Former Member
      Former Member
      Hi... I'm trying to modifiy masthead iView.

      I'm not getting the com.sap.portal.navigation.mastheadapi.jar file.

      So when is execute the par file, am getting "Portal Runtime Error".

      Where to get this api.jar file.? I download the com.sap.portal.navigation.masthead.par.bak file from the server. But it contains only com.sap.portal.navigation.masthead_core.jar file and not the com.sap.portal.navigation.mastheadapi.jar file

      Author's profile photo Former Member
      Former Member
      Hi Siva,
      download the com.sap.portal.navigation.masthead.par.bak file from your server and explode it , you can find the API jar file inside PORTAL-INF/lib/.

      -D

      Author's profile photo Former Member
      Former Member
      I tried to implement this solution just like you said in EP 6.0 SP2. I'm getting the following error:
      Error in executing a process for compilation, D:/usr/sap/EPDA/j2ee/j2ee_00/cluster/server/services/servlet_jsp/work/jspTemp/irj/root/WEB-INF/portal/portalapps/com.sap.portal.navigation.masthead/work/jsp/_sapportalsjsp_HeaderiView.java:1537: 'catch' without 'try' } catch (ThreadDeath tde) { throw tde; ^

      D:/usr/sap/EPDA/j2ee/j2ee_00/cluster/server/services/servlet_jsp/work/jspTemp/irj/root/WEB-INF/portal/portalapps/com.sap.portal.navigation.masthead/work/jsp/_sapportalsjsp_HeaderiView.java:219: 'try' without 'catch' or 'finally' try { ^

      D:/usr/sap/EPDA/j2ee/j2ee_00/cluster/server/services/servlet_jsp/work/jspTemp/irj/root/WEB-INF/portal/portalapps/com.sap.portal.navigation.masthead/work/jsp/_sapportalsjsp_HeaderiView.java:1549: '}' expected }

      ^ 3 errors .
      Exception id: 01:56_30/08/06_0008
      See the details for the exception ID in the log file

      Any ideas???

      Author's profile photo Former Member
      Former Member

      Hi Jose,<br/>This looks like a syntax error. kindly check the code.<br/>function openLogoffMsg()<br/>{<br/><%if (!isPreview){%><br/><br/>    if (EPCM.getUAType() == EPCM.MSIE)<br/>    {<br/>    var confirmationBox = '<%=getLogoffConfirmationBox()%>';<br/>    <br/>    if(confirmationBox == 'true'){<br/><br/>        var val = window.showModalDialog('<%=GetLogoffConfirmMsgURL(componentRequest)%>', '', '<%=LOGOFF_CONFIRM_MSG_ARGS_IE%>');<br/>        if (val == 'logoff')<br/>        logoff(); <br/>        }else{logoff()};<br/>        <br/>      <br/>    }<br/>    else<br/>    {<br/>    if(confirmationBox == 'true'){<br/>       window.open('<%=GetLogoffConfirmMsgURL(componentRequest)%>', '<%=LOGOFF_CONFIRM_WINDOW_NAME%>', '<%=LOGOFF_CONFIRM_MSG_ARGS_NS%>');<br/>       logoff();<br/>       }else {logoff()};<br/>    }<br/>      <br/><%}%><br/>}

      Author's profile photo Former Member
      Former Member

      Here is the code based on NW7. I didn't want to change the original code structure... So anyone that wants to simplify the code is welcome to post it.<br/><br/>function openLogoffMsg()<br/>{<br/><%if (!isPreview){%><br/>    if (EPCM.getUAType() == EPCM.MSIE)<br/>    {<br/>         var confirmationBox = '<%=getLogoffConfirmationBox()%>';<br/>         <br/>         if(EPCM.getGlobalDirty())<br/>         {<br/>              if (confirmationBox == 'true'){<br/>                    // unsaved data on the page, display modified dialog<br/>                  var val = window.showModalDialog('<%=GetLogoffConfirmUnsavedMsgURL(componentRequest)%>', '', '<%=LOGOFF_CONFIRM_MSG_ARGS_IE%>');<br/>                  if (val == 'logoff')<br/>                  {<br/>                       disableWorkProtectCheck = true;<br/>                       logoff();<br/>                  }<br/>                  }else{<br/>                       disableWorkProtectCheck = true;<br/>                       logoff();<br/>                  }<br/>          }<br/>          else //no unsaved data<br/>          {<br/>               if (confirmationBox == 'true'){<br/>                    // data saved, nothing get lost on the page, display normal dialog<br/>                var val = window.showModalDialog('<%=GetLogoffConfirmMsgURL(componentRequest)%>', '', '<%=LOGOFF_CONFIRM_MSG_ARGS_IE%>');<br/>                if (val == 'logoff')<br/>                   logoff();<br/>             }else{<br/>                  logoff();<br/>             }<br/>        }          <br/>    }<br/>    else<br/>    {<br/>         if (confirmationBox == 'true'){<br/>              if(EPCM.getGlobalDirty())<br/>              {<br/>                window.open('<%=GetLogoffConfirmUnsavedMsgURL(componentRequest)%>', '<%=LOGOFF_CONFIRM_WINDOW_NAME%>', '<%=LOGOFF_CONFIRM_MSG_ARGS_NS%>');<br/>             }<br/>             else<br/>             {<br/>                window.open('<%=GetLogoffConfirmMsgURL(componentRequest)%>', '<%=LOGOFF_CONFIRM_WINDOW_NAME%>', '<%=LOGOFF_CONFIRM_MSG_ARGS_NS%>');<br/>             }<br/>        }else{<br/>             logoff();<br/>        }<br/>    }<br/><%}%><br/>}