com.sap.portal.pcm.page

Interface IPage

All Superinterfaces:
IAttributes, IAttributeSet, IiView, IMutableAttributes
All Known Subinterfaces:
IApplicationPage

public interface IPage
extends IiView

The interface that represents the semantic aspect of a page object. IPage contains methods for manipulating a page object and its attributes.
An IPage object can be retrieved by JNDI lookup, as follows:


                String name = "pcd:portal_content/myFolder/stocks";

                Hashtable env = new Hashtable();
                env.put(Context.INITIAL_CONTEXT_FACTORY,
                   IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
                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

Field Summary
 
Fields inherited from interface com.sap.portal.pcm.IAttributes
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, String atomicName)
          Adds a new iView/page object to the page.
 void addiView(com.sap.portal.pcm.INewObjectDescriptor descriptor, String atomicName, String layoutContainer)
          Adds a new iView/page object to the page and places it in the specified layout container.
 void addiView(com.sap.portal.pcm.INewObjectDescriptor descriptor, String atomicName, String layoutContainer, int position)
          Adds a new iView/page object to the page and places it at a specified position in the specified layout container.
 void addLayout(com.sap.portal.pcm.INewObjectDescriptor descriptor, String atomicName)
          Adds a layout to the page.
 ILayout getActiveLayoutObject()
          Gets the active layout of the page.
 IApplicationPage getApplicationPage()
          Returns an IApplicationPage in case isApplicationPage() returns true, null otherwise.
 NamingEnumeration getiViews()
          Gets all iView/page objects on the page.
 NamingEnumeration getLayouts()
           
 String getValidChildName(String atomicName)
          Checks if an iView/page object with the specified name exists on the page.
 boolean isApplicationPage()
          Indicates whether this page is an application page
 boolean isLockedPage()
          Indicates whether this page is locked
 void removeiView(String atomicName)
          Removes an iView/page object from the page.
 void removeLayout(String layoutAtomicName)
          Removes a layout from the page.
 void setActiveLayout(String atomicName)
          Sets the active layout for the page.
 
Methods inherited from interface com.sap.portal.pcm.iview.IiView
addRelatedItem, getApplicationContextURL, getModifications, getRelatedItems, removeRelatedItem, setRelatedItemActive
 
Methods inherited from interface com.sap.portal.pcm.admin.IAttributeSet
save, validate
 
Methods inherited from interface com.sap.portal.pcm.IMutableAttributes
deleteAttribute, deleteMetaAttribute, putAttribute, putAttribute, putMetaAttribute, putMetaAttribute
 
Methods inherited from interface com.sap.portal.pcm.IAttributes
getAttribute, getAttribute, getAttributeIds, getAttributeType, getAvailableAttributeLocales, getAvailableMetaAttributeLocales, getMetaAttribute, getMetaAttribute, getMetaAttributeIds, getMetaAttributeType
 

Method Detail

setActiveLayout

void setActiveLayout(String atomicName)
Sets the active layout for the page. The specified layout must exist on the page.
Changes are persisted only after calling IAttributeSet#save.

Parameters:
atomicName - the atomic name of the layout

getActiveLayoutObject

ILayout getActiveLayoutObject()
Gets the active layout of the page.

Returns:
the layout object

getLayouts

NamingEnumeration getLayouts()
                             throws NamingException
Throws:
NamingException

addLayout

void addLayout(com.sap.portal.pcm.INewObjectDescriptor descriptor,
               String atomicName)
               throws com.sap.portal.pcm.OperationFailedException
Adds a layout to the page.
Changes are persisted immediately. No save is required.

Parameters:
descriptor - describes how to create the new layout object
atomicName - the atomic name for the new layout
Throws:
com.sap.portal.pcm.OperationFailedException - if the operation fails

removeLayout

void removeLayout(String layoutAtomicName)
                  throws com.sap.portal.pcm.OperationFailedException
Removes a layout from the page.
Changes are persisted immediately. No save is required.

Parameters:
layoutAtomicName - the atomic name of the layout to remove
Throws:
com.sap.portal.pcm.OperationFailedException - if the operation fails

getiViews

NamingEnumeration getiViews()
                            throws NamingException
Gets all iView/page objects on the page. Each element of the returned enumeration is of type javax.naming.Binding.
For example:
          Enumeration en = page.getiViews();
          while (en.hasMoreElements())
          {
             Binding bind = (Binding)en.nextElement();
             Object obj = bind.getObject();
             if (obj instanceof IPage)
             {
                // ...
             }
             if (obj instanceof IiView)
             {
                // ...
             }
          }
          

Returns:
an enumeration of iView/page objects
Throws:
NamingException - if a JNDI naming exception is encountered

addiView

void addiView(com.sap.portal.pcm.INewObjectDescriptor descriptor,
              String atomicName,
              String layoutContainer)
              throws com.sap.portal.pcm.OperationFailedException
Adds a new iView/page object to the page and places it in the specified layout container.
Changes are persisted immediately. No save is required.

Parameters:
descriptor - describes how to create the new object
atomicName - the atomic name of the new object
layoutContainer - the container ID in which to place the object (null for the default container)
Throws:
com.sap.portal.pcm.OperationFailedException - if an iView with the same atomic name exists on the page

addiView

void addiView(com.sap.portal.pcm.INewObjectDescriptor descriptor,
              String atomicName,
              String layoutContainer,
              int position)
              throws com.sap.portal.pcm.OperationFailedException
Adds a new iView/page object to the page and places it at a specified position in the specified layout container.
Changes are persisted immediately. No save is required.

Parameters:
descriptor - describes how to create the new object
atomicName - the atomic name of the new object
layoutContainer - the container ID in which to place the object (null for the default container)
position - the position in the container
Throws:
com.sap.portal.pcm.OperationFailedException - if an iView with the same atomic name exists on the page

addiView

void addiView(com.sap.portal.pcm.INewObjectDescriptor descriptor,
              String atomicName)
              throws com.sap.portal.pcm.OperationFailedException
Adds a new iView/page object to the page. The iView is automatically placed at the bottom of the left-most column of the page's active layout.
Changes are persisted immediately. No save is required.

Parameters:
descriptor - describes how to create the new object
atomicName - the atomic name of the new object
Throws:
com.sap.portal.pcm.OperationFailedException - if an iView with the same atomic name exists in the page

removeiView

void removeiView(String atomicName)
                 throws com.sap.portal.pcm.OperationFailedException
Removes an iView/page object from the page.
Changes are persisted immediately. No save is required.

Parameters:
atomicName - the atomic name of the object to remove
Throws:
com.sap.portal.pcm.OperationFailedException - if the operation fails.

getValidChildName

String getValidChildName(String atomicName)
Checks if an iView/page object with the specified name exists on the page. If such an object exists, returns a normalized name to a valid name.
A name is normalized using the format:
newName = originalName + "_" + idNumber.

Parameters:
atomicName - the name to check
Returns:
the normalized name if one was found (null if no iView/page with the specified name was found on the page)

isApplicationPage

boolean isApplicationPage()
Indicates whether this page is an application page

Returns:
true if it is an application page. false otherwise

getApplicationPage

IApplicationPage getApplicationPage()
Returns an IApplicationPage in case isApplicationPage() returns true, null otherwise.


isLockedPage

boolean isLockedPage()
Indicates whether this page is locked

Returns:
true if it is locked. false otherwise
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-RUNTIME [sap.com] tc/ep/semantics/api api EP-PIN
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2011 SAP AG Complete Copyright Notice