Sample Layout
The following is a sample JSP page and portalapp.xml file for a PAR file that defines a custom layout.
The layout includes one container whose iViews are displayed with a custom tray. The tray shows the title of the iView at the top, and then a link to either hide or display the contents.
A set of links is displayed just below the title for invoking standard tray functions. Each button is only displayed if the administrator has set the link to be displayed in the iView’s properties. The iView’s content is displayed just below.
<%@ taglib uri="prt:taglib:com.sap.portal.reserved.layout.TagLibHtmlb" prefix="hbj" %>
<%@ taglib uri="prt:taglib:com.sap.portal.reserved.layout.TagLibLayout" prefix="lyt" %>
<lyt:template>
<hbj:content id="myContext" >
<hbj:page title="Portal Page">
<lyt:containerWithTrayDesign id="the_container_id">
<TABLE border=1 cellspacing=10 cellpadding=10 style='WIDTH=100%;font-size:8.5pt;font-family:Tahoma;border-collapse:collapse;border:none;'>
<TR>
<TD>
<b><lyt:IViewTitle/></b> |
<lyt:IViewToggleOpen>>>></lyt:IViewToggleOpen>
<lyt:IViewToggleClose><<<</lyt:IViewToggleClose>
<BR><BR>
<lyt:IfIViewExpandAvailable>
<lyt:IViewExpand><lyt:IviewExpandTitle/>
</lyt:IViewExpand>
|
</lyt:IfIViewExpandAvailable>
<lyt:IfIViewRefreshAvailable>
<lyt:IViewRefresh><lyt:IViewRefreshTitle/>
</lyt:IViewRefresh>
|
</lyt:IfIViewRefreshAvailable>
<lyt:IfIViewAboutAvailable>
<lyt:IViewAbout><lyt:IViewAboutTitle/>
</lyt:IViewAbout>
|
</lyt:IfIViewAboutAvailable>
<lyt:IfIViewHelpAvailable>
<lyt:IViewHelp><lyt:IViewHelpTitle/>
</lyt:IViewHelp>
|
</lyt:IfIViewHelpAvailable>
<lyt:IfIViewRemoveAvailable>
<lyt:IViewRemove><lyt:IViewRemoveTitle/>
</lyt:IViewRemove>
|
</lyt:IfIViewRemoveAvailable>
<lyt:IfIViewPersonalizeAvailable>
<lyt:IViewPersonalize><lyt:IViewPersonalizeTitle/>
</lyt:IViewPersonalize>
</lyt:IfIViewPersonalizeAvailable>
<br>
<lyt:IViewContent/>
</TD>
</TR>
</TABLE>
</lyt:containerWithTrayDesign>
</hbj:page>
</hbj:content>
</lyt:template>
The text in bold is customizable. You can also add references to other portal services, if necessary.
The value for the property called com.sap.portal.reserved.layout.Cont1 is the same as the value for the id attribute for the container or containerWithTrayDesign tag for that column in the JSP page.
<application>
<application-config>
<property name="SharingReference" value="com.sap.portal.htmlb,
com.sap.portal.pagebuilder"/>
</application-config>
<components>
<component name="myFullWidthLayout">
<component-config>
<property name="ClassName"
value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName"
value="pagebuilder_nls"/>
</component-config>
<component-profile>
<property
name="ComponentType"
value="com.sapportals.portal.layout" />
<property name="com.sap.portal.pcm.Title"
value="My 1 Column Layout (Full
Width)"/>
<property name="com.sap.portal.pcm.Description"
value="Layout displaying one
full-width column"/>
<property
name="com.sap.portal.reserved.layout.TagLibLayout"
value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TagLibHtmlb"
value="/SERVICE/com.sap.portal.htmlb/taglib/htmlb.tld "/>
<property
name="com.sap.portal.reserved.layout.TemplateFile"
value="myFullWidth.jsp"/>
<property name="com.sap.portal.reserved.layout.Cont1"
value="the_container_id">
<property name="title" value="my container"/>
<property name="orientation" value="vertical"/>
</property>
</component-profile>
</component>
</components>
<services/>
</application>
The HTMLB sharing reference is only needed if you use the default iView tray or you add HTMLB code to the JSP page.