com.sap.portal.pcm.page

Interface IPage

All Superinterfaces:
IiView

public interface IPage
extends IiView

The semantic aspect of a page object. Defines the page object specific functionality.

Can be retreived by JNDI lookup:

Hashtable env = new Hashtable();
env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
env.put(Context.SECURITY_PRINCIPAL, user);
try
{
  com.sapportals.portal.prt.jndisupport.InitialContext iCtx = new InitialContext(env);
  IPage page = (IPage)iCtx.lookup(name);
}
catch (NamingException e)
{
  // ...
}

See Also:
ILayout, IPages, IAttrPage

Method Summary
 void addiView(INewObjectDescriptor descriptor, String atomicName)
          Add an iView/page object to the page.
 void addiView(INewObjectDescriptor descriptor, String atomicName, String layoutContainer)
          Add a new iView / page object to the page, into a specific layout-container.
 void addLayout(INewObjectDescriptor descriptor, String atomicName)
          Add a layout to the page.
 ILayout getActiveLayoutObject()
          Get the active layout of the page
 NamingEnumeration getiViews()
          Get all iView / page objects under the page.
 NamingEnumeration getLayouts()
          Get all layout objects under the page.
 String getValidChildName(String atomicName)
          Check if an offered name does not exist under the page.
 void removeiView(String atomicName)
          Remove an iView / page object from the page.
 void removeLayout(String layoutAtomicName)
          Remove layout from the page.
 void setActiveLayout(String atomicName)
          Defines which of the available layouts is the active layout upon runtime.
 
Methods inherited from interface com.sap.portal.pcm.iview.IiView
addRelatedItem, getRelatedItems, removeRelatedItem, setRelatedItemActive
 

Method Detail

setActiveLayout

public void setActiveLayout(String atomicName)
Defines which of the available layouts is the active layout upon runtime.
A layout with the same name has to exist under the page.
Changes will only be persisted after IAttributeSet#save

See Also:
getActiveLayoutObject()

getActiveLayoutObject

public ILayout getActiveLayoutObject()
Get the active layout of the page

Returns:
ILayout- the layout object
See Also:
setActiveLayout(String atomicName)

getLayouts

public NamingEnumeration getLayouts()
                             throws NamingException
Get all layout objects under the page.

Returns:
NamingEnumeration- enumeration of layout objects.
Each element of the enumeration is of type Binding.
For example:
Enumeration en = page.getLayouts();
while (en.hasMoreElements())
{
  Binding bind = (Binding)en.nextElement();
  Object obj = bind.getObject();
  if (obj instanceof ILayout)
  {
    // a layout child
  }
}
Throws:
NamingException - if a JNDI naming exception is encountered

addLayout

public void addLayout(INewObjectDescriptor descriptor,
                      String atomicName)
               throws OperationFailedException
Add a layout to the page. Changes will be persisted immediately.

Parameters:
descriptor - describes how to create the new object
Throws:
OperationFailedException - if the addition failed.

removeLayout

public void removeLayout(String layoutAtomicName)
                  throws OperationFailedException
Remove layout from the page. Changes will be persisted immediately.

Parameters:
layoutAtomicName - the name of the object to remove, relative to the page.
Throws:
OperationFailedException - if the removal failed.

getiViews

public NamingEnumeration getiViews()
                            throws NamingException
Get all iView / page objects under the page.

Returns:
NamingEnumeration- an enumeration of iView / page objects.
Each element of the enumeration is of type Binding.
For example:
Enumeration en = page.getiViews();
while (en.hasMoreElements())
{
  Binding bind = (Binding)en.nextElement();
  Object obj = bind.getObject();
  if (obj instanceof IPage)
  {
    // a page child
  }
  if (obj instanceof IiView)
  {
    // an iView child
  }
}
Throws:
NamingException - if a JNDI naming exception is encountered

addiView

public void addiView(INewObjectDescriptor descriptor,
                     String atomicName,
                     String layoutContainer)
              throws OperationFailedException
Add a new iView / page object to the page, into a specific layout-container. Changes will be persisted immediately.

Parameters:
descriptor - describes how to create the new object
atomicName - the new object name (relative to the page)
layoutContainer - the layout-container to put the object in. null for default container
Throws:
OperationFailedException - if the addition failed.

addiView

public void addiView(INewObjectDescriptor descriptor,
                     String atomicName)
              throws OperationFailedException
Add an iView/page object to the page. Changes will be persisted immediately.

Parameters:
descriptor - describes how to create the new object
atomicName - the new name (relative to the page)
Throws:
OperationFailedException - if the addition failed.

removeiView

public void removeiView(String atomicName)
                 throws OperationFailedException
Remove an iView / page object from the page. Changes will be persisted immediately.

Parameters:
atomicName - the name of the object to remove (relative to the page).
Throws:
OperationFailedException - if the removal failed.

getValidChildName

public String getValidChildName(String atomicName)
Check if an offered name does not exist under the page. If it exists, normalize the name to a valid name. A name is normalized using the format: newName = originalName + "_" + idNumber.

Parameters:
atomicName - the offered name
Returns:
String- the normalized name if found any. null if not


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.