Show TOC Start of Content Area

Procedure documentation Setting the Default Layout for a Page  Locate the document in its SAP Library structure

This section describes how to set a page’s default layout. A page’s default layout is the layout used for rendering if the page’s layout has not been personalized.

Procedure

...

       1.      Set the parameters for the JNDI lookup.

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,
    IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);

env.put(Context.SECURITY_PRINCIPAL, request.getUser());

env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);

       2.      Perform a lookup of the page for which you want to set the default layout.

InitialContext iCtx = null;

try

{

    iCtx = new InitialContext(env);

    IPage myPage =(IPage)iCtx.lookup(
       
"pcd:portal_content/Desktop/finance");

 

...

       3.      Set the default layout by specifying the layout’s atomic name.

    myPage.setActiveLayout("narrowWideNarrow");

       4.      Save the changes.

...

 

    myPage.save();

 

}      

catch(NamingException e)

{

}

 

End of Content Area