Over the last few days I found too many post in the forum related to changing the masthead portal Desktop, themes, hiding the iview name .Before we go for customizing any component inside the Portal it is necessary to understand in/out functionalities which it achieves.Before I put down it’s essential for us to comprehend the structure of the portal screen and going forward, to understand the best possible approach to change the look and feel. “Where, what and how “are the aspects which I am going to address in this blog.+I don’t want to add any redundancy to the SDN +.Refer to these links to discern exactly how the entire portal screen, displayed contents and layout combines to form Portal Desktop.
Now we can effortlessly say that the Portal desktop can be broadly divided into smaller components as
<li>Portal Desktop & Framework</b>
Figure3 : Add Framework To Portal Desktop.
- Modifying Masthead and Deploying with a different Name
- Copy the file com.sap.portal.navigation.masthead.par.bak and rename it to .Par
- Import the Par file in the NWDS.
- Unzip the com.sap.portal.navigation.masthead.par file using zip and copy the
com.sap.portal.navigation.masthead_core.jar from \PORTAL-INF\private\lib.
- Paste the jar file in the Lib folder inside the NWDS and remove the unnecessary jars if any.
The Structure in NWDS should be like This
- open HeaderiView.jsp
- Do whatever changes you have do, but keep in mind don’t play much with the code.
The beauty of masthead provided by SAP is that you have all the links appearing on the Right hand side based on the user selection(Personalize,help).If the user is anonymous the masthead shows Log In instead of Log off. A lot can be said about how it functions but I am going to leave this option for you all to explore.
Save the file and deploy the par from the NWDS provide a new name say my.sdn.masthead .(Right Click and Import, make sure that you have defined the necessary setting in the NWDS Windows
- Once the file is being deployed,open Portalapp.xml(or the deployment Descriptor)& run Default Configuration.
- Check if all the changes done by you are reflected or not.
Sample Code for this type of Masthead(TD are same as of the original file i have just removed the image which comes in between).
<textarea rows=”5″ cols=”100″>
<TD class=”prtlHeaderNotch” id=”header_notch” nowrap>!!/../common/1×1.gif” class=”prtlHeaderNotchImgWidth”></TD>
<TD nowrap ti=”0″ tabIndex=”0″ class=”prtlHdrWelcome” id=”welcome_message”><%=StringUtils.escapeToHTML(GetWelcomeMsg(componentRequest, welcomeClauseStr))%></TD>
<TD nowrap ti=”1″ tabIndex=”1″ class=”prtlHdrWelcome” id=”welcome_message”>
var months=new Array(13);
var time=new Date();
var lmonth=months[time.getMonth() + 1];
if ((navigator.appName == “Microsoft Internet Explorer”) && (year < 2000))
year=”19″ + year;
if (navigator.appName == “Netscape”)
year=1900 + year;
document.write(“<center>” + lmonth + ” “);
document.write(date + “, ” + year + “</center>”);
// End –>
<b>Create Iview From Par.</b><br>
<li>Right click on the folder SDN_Masthead and create an iview from the deployed par.(In content Admin)<br>
<li>Open the framework and rename it.(Customized Framework)<br>
<li>Assign the iview which we have created to the Framework.
- Remove the com.sap.portal.masthead iview (SAP Provided ) and add the one which we have created.
- Navigate to Page Layout and Bring the masthead on the top
- Save and Exit.
( If any point of time you don’t want any iview to appear on the screen , just uncheck its visibility)
Changing the Master Rule.
Navigate to System Administration – Portal Display — Desktops & Display Rules —Portal Content — Portal Administrator — Super Administrator.
- Open the Master Rule Collection.
- Add an IF expression .
- You can assign the If statement to a Group, User ,Role etc.
- In then statement assign the Portal Desktop which we have created .Save and close.
Log off and Log in to check the changes.( Log in with the user id to whom the rule has been assigned to ).
Rendering of JSP
An important concept which each new beginner should understand .It’s a wrong practice to copy a bak file, unzip it, Make changes to it .Create par using WinZip and then paste directly in the pcd folder. In this case you have to restart the server also .No matter when we restart the server that par file will become bak.
One things should be analyzed here is when we deploy a par file from the NWDS to the portal these JSP are rendered and a work folder is created which has the class files related to it .( the same applies to Logon par ).It’s always advisable to make use of NWDS.