com.sap.portal.pcm.page
Interface IPage

All Superinterfaces:
com.sap.portal.pcm.admin.IAttributeSet, 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

Fields inherited from interface com.sap.portal.pcm.admin.IAttributeSet
ADMINISTRATION, ATTRIBUTE_NOT_FOUND, DIALOG, DIALOG_READ_ONLY, NONDIALOG, NONE, PERSONALIZATION, STRING_ATTRIBUTE, TEXT_ATTRIBUTE
 
Method Summary
 void addiView(com.sap.portal.pcm.INewObjectDescriptor descriptor, java.lang.String atomicName)
          Add an iView/page object to the page.
 void addiView(com.sap.portal.pcm.INewObjectDescriptor descriptor, java.lang.String atomicName, java.lang.String layoutContainer)
          Add a new iView / page object to the page, into a specific layout-container.
 void addLayout(com.sap.portal.pcm.INewObjectDescriptor descriptor, java.lang.String atomicName)
          Add a layout to the page.
 ILayout getActiveLayoutObject()
          Get the active layout of the page
 javax.naming.NamingEnumeration getiViews()
          Get all iView / page objects under the page.
 javax.naming.NamingEnumeration getLayouts()
          Get all layout objects under the page.
 java.lang.String getValidChildName(java.lang.String atomicName)
          Check if an offered name does not exist under the page.
 void removeiView(java.lang.String atomicName)
          Remove an iView / page object from the page.
 void removeLayout(java.lang.String layoutAtomicName)
          Remove layout from the page.
 void setActiveLayout(java.lang.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
 
Methods inherited from interface com.sap.portal.pcm.admin.IAttributeSet
deleteAttribute, deleteMetaAttribute, getAttribute, getAttribute, getAttributeIds, getAttributeType, getAvailableAttributeLocales, getAvailableMetaAttributeLocales, getMetaAttribute, getMetaAttribute, getMetaAttributeIds, getMetaAttributeType, putAttribute, putAttribute, putMetaAttribute, putMetaAttribute, save, validate
 

Method Detail

setActiveLayout

public void setActiveLayout(java.lang.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
Parameters:
name - the layout atomic name (relative to the page)
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 javax.naming.NamingEnumeration getLayouts()
                                          throws javax.naming.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:
javax.naming.NamingException - if a JNDI naming exception is encountered

addLayout

public void addLayout(com.sap.portal.pcm.INewObjectDescriptor descriptor,
                      java.lang.String atomicName)
               throws com.sap.portal.pcm.OperationFailedException
Add a layout to the page. Changes will be persisted immediately.
Parameters:
descriptor - describes how to create the new object
name - the layout new name (relative to the page)
Throws:
com.sap.portal.pcm.OperationFailedException - if the addition failed.

removeLayout

public void removeLayout(java.lang.String layoutAtomicName)
                  throws com.sap.portal.pcm.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:
com.sap.portal.pcm.OperationFailedException - if the removal failed.

getiViews

public javax.naming.NamingEnumeration getiViews()
                                         throws javax.naming.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:
javax.naming.NamingException - if a JNDI naming exception is encountered

addiView

public void addiView(com.sap.portal.pcm.INewObjectDescriptor descriptor,
                     java.lang.String atomicName,
                     java.lang.String layoutContainer)
              throws com.sap.portal.pcm.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:
com.sap.portal.pcm.OperationFailedException - if the addition failed.

addiView

public void addiView(com.sap.portal.pcm.INewObjectDescriptor descriptor,
                     java.lang.String atomicName)
              throws com.sap.portal.pcm.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:
com.sap.portal.pcm.OperationFailedException - if the addition failed.

removeiView

public void removeiView(java.lang.String atomicName)
                 throws com.sap.portal.pcm.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:
com.sap.portal.pcm.OperationFailedException - if the removal failed.

getValidChildName

public java.lang.String getValidChildName(java.lang.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