org.apache.jetspeed.om.profile
Class BasePSMLDocument

java.lang.Object
  extended byorg.apache.jetspeed.om.profile.BasePSMLDocument
All Implemented Interfaces:
java.lang.Cloneable, PSMLDocument, java.io.Serializable

public class BasePSMLDocument
extends java.lang.Object
implements PSMLDocument

This class represents a loaded PSML document in memory, providing all facilities for finding and updating specific parts of the document.

Version:
$Id: BasePSMLDocument.java,v 1.10 2005/03/21 18:21:36 sgala Exp $
Author:
Raphaël Luta
See Also:
Serialized Form

Constructor Summary
BasePSMLDocument()
          Construct a new empty PSMLDocument
BasePSMLDocument(java.lang.String name, Portlets portlets)
          Construct a new named PSMLDocument associated with the specified PSML portlet set description
 
Method Summary
 java.lang.Object clone()
          Create a clone of this object
static Entry getEntry(Portlets portlets, java.lang.String name)
          Returns the first entry in the specified PSML resource corresponding to the given portlet name
 Entry getEntry(java.lang.String name)
          Returns the first entry in the current PSML resource corresponding to the given portlet name
static Entry getEntryById(Portlets portlets, java.lang.String entryId)
          Returns the first entry in the specified PSML resource corresponding to the given portlet Id
 Entry getEntryById(java.lang.String entryId)
          Returns the first entry in the current PSML resource corresponding to the given entry id
 java.lang.String getName()
          Return the name of this document
 Portlets getPortlets()
          Return ths portlet set PSML description of this document
 Portlets getPortlets(int position)
          Returns the first portlets element in the current PSML resource found at the specified position.
static Portlets getPortlets(Portlets portlets, int position, int count)
          Returns the first portlets element in the specified PSML resource in the given position
static Portlets getPortlets(Portlets portlets, java.lang.String name)
          Returns the first portlets element in the specified PSML resource corresponding to the given name
 Portlets getPortlets(java.lang.String name)
          Returns the first portlets element in the current PSML resource corresponding to the given name
static Portlets getPortletsById(Portlets portlets, java.lang.String portletId)
          Returns the first portlets element in the specified PSML resource corresponding to the given Id
 Portlets getPortletsById(java.lang.String portletId)
          Returns the first portlets element in the current PSML resource corresponding to the given id
static boolean removeEntryById(Portlets portlets, java.lang.String entryId)
          Remove the Entry in the specified PSML resource corresponding to the given portlet Id
 boolean removeEntryById(java.lang.String entryId)
          Remove the Entry in the specified PSML resource corresponding to the given portlet Id
 void setName(java.lang.String name)
          Sets a new name for this document
 void setPortlets(Portlets portlets)
          Sets a new PSML object model for this document
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePSMLDocument

public BasePSMLDocument()
Construct a new empty PSMLDocument


BasePSMLDocument

public BasePSMLDocument(java.lang.String name,
                        Portlets portlets)
Construct a new named PSMLDocument associated with the specified PSML portlet set description

Parameters:
name - the name of this document
portlets - the PSML memory structure
Method Detail

getName

public final java.lang.String getName()
Return the name of this document

Specified by:
getName in interface PSMLDocument

setName

public final void setName(java.lang.String name)
Sets a new name for this document

Specified by:
setName in interface PSMLDocument
Parameters:
name - the new document name

getPortlets

public final Portlets getPortlets()
Return ths portlet set PSML description of this document

Specified by:
getPortlets in interface PSMLDocument
Returns:
a PSML object model hierarchy, or null if none is defined for this document

setPortlets

public final void setPortlets(Portlets portlets)
Sets a new PSML object model for this document

Specified by:
setPortlets in interface PSMLDocument
Parameters:
portlets - the PSML object model

getEntry

public Entry getEntry(java.lang.String name)
Returns the first entry in the current PSML resource corresponding to the given portlet name

Specified by:
getEntry in interface PSMLDocument
Parameters:
name - the portlet name to seek
Returns:
the found entry description or null

getEntryById

public Entry getEntryById(java.lang.String entryId)
Returns the first entry in the current PSML resource corresponding to the given entry id

Specified by:
getEntryById in interface PSMLDocument
Parameters:
entryId - the portlet's entry id to seek
Returns:
the found entry description or null

getPortlets

public Portlets getPortlets(java.lang.String name)
Returns the first portlets element in the current PSML resource corresponding to the given name

Specified by:
getPortlets in interface PSMLDocument
Parameters:
name - the portlets name to seek
Returns:
the found portlets description or null

getPortletsById

public Portlets getPortletsById(java.lang.String portletId)
Returns the first portlets element in the current PSML resource corresponding to the given id

Specified by:
getPortletsById in interface PSMLDocument
Parameters:
portletId - the portlet's entry id to seek
Returns:
the found portlets description or null

getPortlets

public Portlets getPortlets(int position)
Returns the first portlets element in the current PSML resource found at the specified position. The position is computed using a left-most tree traversal algorithm of the existing portlets (thus not counting other entry objects)

Specified by:
getPortlets in interface PSMLDocument
Parameters:
position - the sought position
Returns:
the found portlets object or null if we did not find such an object

getEntry

public static Entry getEntry(Portlets portlets,
                             java.lang.String name)
Returns the first entry in the specified PSML resource corresponding to the given portlet name

Parameters:
portlets - the PSML description to look into
name - the portlet name to seek
Returns:
the found entry description or null

getEntryById

public static Entry getEntryById(Portlets portlets,
                                 java.lang.String entryId)
Returns the first entry in the specified PSML resource corresponding to the given portlet Id

Parameters:
portlets - the PSML description to look into
entryId - the portlet's entry id to seek
Returns:
the found entry description or null

getPortletsById

public static Portlets getPortletsById(Portlets portlets,
                                       java.lang.String portletId)
Returns the first portlets element in the specified PSML resource corresponding to the given Id

Parameters:
portlets - the PSML description to look into
portletId - the portlet's id to seek
Returns:
the found portlets description or null

getPortlets

public static Portlets getPortlets(Portlets portlets,
                                   java.lang.String name)
Returns the first portlets element in the specified PSML resource corresponding to the given name

Parameters:
portlets - the PSML description to look into
name - the portlets name to seek
Returns:
the found portlets description or null

getPortlets

public static Portlets getPortlets(Portlets portlets,
                                   int position,
                                   int count)
Returns the first portlets element in the specified PSML resource in the given position

Parameters:
portlets - the PSML description to look into
position - the position to look for
count - the numbering for the portlets passed as parameter
Returns:
the found portlets description or null

removeEntryById

public boolean removeEntryById(java.lang.String entryId)
Remove the Entry in the specified PSML resource corresponding to the given portlet Id

Specified by:
removeEntryById in interface PSMLDocument
Parameters:
entryId - the portlet's entry id to seek
Returns:
true if the entry was removed

removeEntryById

public static boolean removeEntryById(Portlets portlets,
                                      java.lang.String entryId)
Remove the Entry in the specified PSML resource corresponding to the given portlet Id

Parameters:
portlets - the PSML description to look into
entryId - the portlet's entry id to seek

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Create a clone of this object

Specified by:
clone in interface PSMLDocument
Throws:
java.lang.CloneNotSupportedException


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.