Display Custom Message on Post Portal Login
Display Custom Message on Post Portal Login
The purpose of this article is to show the step-by-step procedure for Displaying Custom Message to the Users who successfully login to SAP NetWeaver Portal.
Applies to: SAP NetWeaver Portal 700 SP22
Authors: Naga Devisetty
Created On: 01 SEP 2012
Basic knowledge of HTML coading
NWDS installed and little exposure on developing PAR applications
Super Administrator role and knowledge of Portal Desktops and Master Rule Collection
There are different approaches on the ‘requirement of displaying a customized messages’ on various scenarios to users who are successfully authenticated into Portal. General approaches like:
ii) displaying pop-up windows using WDJ and PAR application sitting as a saperate elements in the default framework page
But few customers are looking for a scenario as ‘the solution that should fit in between the login page & welcome page’, so there is a requirement for an additional layer between these TWO UI stages. The current article describes to fulfill the middle layer for displaying the Customized Messages post to Portal Logon which could typically Terms & Conditions of Usage, Usage Agreements, Disclaimers & General Information etc,.
1. Create a custom PAR application with required JSP page
Purpose: We need to create a custom PAR application for the custom message to be displayed after the portal logon.
Open the NWDS > goto EP perspective > create a new Project
Select an application of type PAR, click on Next
Give relevant Project Name, click on Finish
Out requirement is to create the web-content primarily with text, so select New in the project to create JSP file
Select Simple > Select File > click on Next
Give relevant name for the JSP file, customMessage.jsp and click on Finish
Open the customMessage.jsp file and embed the code given below as shown in the screenshot
Note: The html form action target URL path is
<form name=“groovyform” action=“/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fevery_user!2fgeneral!2fframeworkpage?sap-config-mode=true”>
Now deploy or explort the generated PAR file into your Portal server and Run it.
Below is the OUTPUT of the PAR applications deployed into the server.
2. Create a custom Portal Desktop
2.1 Create a PAR iView on the custom PAR application in Content Administrator
Create a PAR iView ‘PLMH (Portal Logon Message Header)’ of PortalLogonMessage application in Content Administrator.
2.2 Create a custom Portal Framework Page, add the PAR iView
Now create a new portal framework page ‘PLMHFP (Portal Logon Message Header Framework Page)’ and assign the PLMH iView to this framework page as delta-link in Content Administrator.
2.3 Create a custom Portal Desktop with a framework page & default theme
Goto System Admin > Portal Display > Desktops & Display Rules > create a new portal desktop ‘PLMHD (Portal Logon Message Header Desktop)’ and assign the newly created framework page and the default theme as shown in the below screenshot:
2.4 Create a new Display Rule in Master Rule Collection
Goto System Admin > Portal Display > Desktops & Display Rules > Portal Administrator > Super Administrators > open Master Rule Collection and make the below assignments as shown in the screenshot:
RED Circle: We need to ensure that ALL logging users/group are assigned to a defaultDesktop or projectSpecificDesktop, reason being… this is the desktop that has all the framework elements.
BLACK Circle: After the users login to portal their are first redirect to this PLMHD desktop, which was created in step-2.3
3. Login & Test Navigation
Lets test the execution part of this article by login using the user-id specified in the display rule collections. You will login with the regular ‘/irj/portal’ url,
On the event of successfull login, the portal framework checks for the Desktop to be loaded as per the order specified in the rules-collections.
And as specified in step-2.4 the login user has the PLMHD desktop tobe loaded first by default, and below is the screenshot of the results.
Note: Developers can implement their own logic for Agree & DisAgree action events in the JSP page, while on Agree to take them to Portal and on DisAgree call the Logout from the portal.
Now on click of Continue, you would be taken to the defaultDesktop or projectDesktop loaded as displayed in the screenshot and also the outcome of this exercise.
Users of portal are now allowed to navigate to all Roles and content of it as usaul as before!
Note: Notice the change in the URL of the Portal, this has been redirected to the desktop needed!
Also view the screencasting of the complete exercise!
1. SCN THRED:
The main prupose of writing this article!
This article talks about another nice approach, except that you would need to login to portal using application URL or implement an extention to this application by redirecting the lenghty URL using a web-dispatcher or an IIS server.