Show TOC

Procedure documentationSetting the Default Layout for a Page Locate this document in the navigation 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.

    Syntax Syntax

    1. 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);
      
    End of the code.
  2. Perform a lookup of the page for which you want to set the default layout.

    Syntax Syntax

    1. InitialContext iCtx = null;
      try
      {
          iCtx = new InitialContext(env);
          IPage myPage =(IPage)iCtx.lookup(
              "pcd:portal_content/Desktop/finance");
      
      ...
      
    End of the code.
  3. Set the default layout by specifying the layout's atomic name.

    Syntax Syntax

    1. myPage.setActiveLayout("narrowWideNarrow");
    End of the code.
  4. Save the changes.

    Syntax Syntax

    1. ...
      
          myPage.save();
      
      }       
      catch(NamingException e)
      {
      }
      
    End of the code.