com.plumtree.server
Interface IPTServerContext

All Superinterfaces:
IPTStorable
All Known Subinterfaces:
IPTAdminFolder, IPTAuthSource, IPTCard, IPTCommunity, IPTCommunityTemplate, IPTCrawler, IPTDataSource, IPTDocumentType, IPTExpression, IPTExternalOperation, IPTFederatedPortal, IPTFilter, IPTFolder, IPTGadget, IPTGadgetBundle, IPTGadgetContentServer, IPTGadgetTemplate, IPTGuestLogin, IPTInvitation, IPTJob, IPTMyPages, IPTObject, IPTPage, IPTPageContainer, IPTPageTemplate, IPTPreferencesContext, IPTProfilePage, IPTProfileSection, IPTProfileSource, IPTProperty, IPTSavedSearch, IPTSiteMapFolder, IPTSubPortal, IPTTaxonomist, IPTUser, IPTUserGroup, IPTUserInterface, IPTWebService

public interface IPTServerContext
extends IPTStorable

The IPTServerContext interface is used to set and retrieve object metadata that is common to Plumtree objects.

The following metadata can be set/retrieved via the IPTServerContext interface: - The object's ID - The object's owner - The ACL of the object - The user that last modified the object - The lock state of the object

In addition, the Session used to instantiate the object can be retrieved, as well as that Session's access level to the underlying object.

Finally, the SetServerContextSettings() and GetServerContextSettings() methods set and retrieve flags that control the behavior of the Store() method of the IPTStorable interface, which IPTServerContext extends. These flags are specified in the PT_SERVERCONTEXT_SETTINGS enumeration.

Version:
2.0
Author:
Arvind Seshan
See Also:
PT_SERVERCONTEXT_SETTINGS

Method Summary
 int GetAccessLevel()
          Retrieves the access level of the Session used to instantiate this object.
 IPTAccessList GetACL()
          Retrieves the ACL of this object.
 int GetLastModifiedBy()
          Retrieves the user id of the user that last modified this object.
 int GetLockState()
          Returns the current lock state of the object.
 int GetObjectID()
          Returns the object ID of this object, which is unique for each object of a particular class (unique by class ID).
 int GetOwnerID()
          Retrieves owner of this object, which is generally the user that created it.
 int GetServerContextSettings(int iSetting)
          Retrieves the value associated with a setting for this object
 IPTSession GetSession()
          Returns the IPTSession that was used to instantiate the underlying object.
 int GetSettings(int iSetting)
          Deprecated. Use GetServerContextSettings(int)
 boolean LockObject()
          Locks the object.
 void SetLastModifiedBy(int iUser)
          Sets the user that last modified the object to be the passed-in user id.
 void SetObjectID(int iObjectID)
          Sets this object's ID.
 void SetOwnerID(int iOwnerID)
          Sets a user as the owner of this object.
 void SetServerContextSettings(int iSetting, int iValue)
          Associates a value with the passed-in setting id.
 void SetSettings(int iSetting, int iValue)
          Deprecated. Use SetServerContextSettings(int)
 void UnlockObject()
          Unlocks the object.
 
Methods inherited from interface com.plumtree.server.IPTStorable
Store
 

Method Detail

GetSession

IPTSession GetSession()
Returns the IPTSession that was used to instantiate the underlying object.

Returns:
The IPTSession used to instantiate this object.

GetObjectID

int GetObjectID()
Returns the object ID of this object, which is unique for each object of a particular class (unique by class ID).

Returns:
The object ID of this object.

SetObjectID

void SetObjectID(int iObjectID)
Sets this object's ID.

Parameters:
iObjectID - - The new ID of the object. Most implementations will throw an exception since object ID gets set when the object is created and cannot be subsequently modified.
Throws:
PTException - - PT_RESULTCODES.PT_E_ACCESSDENIED indicates that the implementation does not support modifying the object ID.

GetOwnerID

int GetOwnerID()
Retrieves owner of this object, which is generally the user that created it.

Returns:
The user ID of this object's current owner.

SetOwnerID

void SetOwnerID(int iOwnerID)
Sets a user as the owner of this object.

Parameters:
iOwnerID - - The user ID of this object's new owner.

GetACL

IPTAccessList GetACL()
Retrieves the ACL of this object.

Returns:
IPTAccessList that is the access control list for this object.

GetAccessLevel

int GetAccessLevel()
Retrieves the access level of the Session used to instantiate this object.

Returns:
The current access level, from the PT_ACCESSLEVELS enumeration.

UnlockObject

void UnlockObject()
Unlocks the object. Typically the sequence of actions will be to call IPTServerContext.LockObject(), perform some updates to the object, call IPTServerContext.Store(), and then call this method to unlock.

Throws:
PTException - - PT_RESULTCODES.PT_E_ACCESSDENIED indicates the calling user does not have sufficient access to perform this operation.
PTException - - PT_RESULTCODES.PT_E_OBJECTNOTLOCKED indicates either that object is not in the PT_LOCKSTATES.PT_LOCKED state. Generally this means that either the object was newly created, or LockObject() was not called prior to calling this method.

LockObject

boolean LockObject()
Locks the object. Typically the sequence of actions will be to call this method, perform some updates to the object, call IPTServerContext.Store(), and finally call IPTServerContext.UnlockObject() to unlock.

Returns:
true if the object was successfully locked, false if it has been already locked by another user.
Throws:
PTException - - PT_RESULTCODES.PT_E_ACCESSDENIED indicates the calling user does not have sufficient access to perform this operation, or that the object has not yet been stored (e.g. its lock state is PT_LOCKSTATES.PT_NEWLYCREATED).
PTException - - PT_RESULTCODES.PT_E_OBJECTLOCKED indicates the calling user already has a lock on this object.

GetLockState

int GetLockState()
Returns the current lock state of the object.

Returns:
The lock state of the object, which will be a value from the PT_LOCKSTATES enumeration.

GetSettings

int GetSettings(int iSetting)
Deprecated. Use GetServerContextSettings(int)

Retrieves the value associated with a setting for this object.

Parameters:
iSetting - - The id of the setting to retrieve. Valid values are from the PT_SERVERCONTEXT_SETTINGS enumeration.
Returns:
The value associated with the passed-in setting id.

GetServerContextSettings

int GetServerContextSettings(int iSetting)
Retrieves the value associated with a setting for this object

Parameters:
iSetting - - The id of the setting to retrieve. Valid values are from the PT_SERVERCONTEXT_SETTINGS enumeration: PT_SERVERCONTEXT_SETTINGS.PT_SERVERCONTEXT_AUTOUNIQUENAMING PT_SERVERCONTEXT_SETTINGS.PT_SERVERCONTEXT_DIRTYACL
Returns:
The value associated with the passed-in setting id.

SetSettings

void SetSettings(int iSetting,
                 int iValue)
Deprecated. Use SetServerContextSettings(int)

Associates a value with the passed-in setting id.

Parameters:
iSetting - - The setting id of the setting to set. Valid values are from the PT_SERVERCONTEXT_SETTINGS enumeration.
iValue - - The value to associate with the passed-in setting id.

SetServerContextSettings

void SetServerContextSettings(int iSetting,
                              int iValue)
Associates a value with the passed-in setting id.

Parameters:
iSetting - - The setting id of the setting to set. Valid values are from the PT_SERVERCONTEXT_SETTINGS enumeration: PT_SERVERCONTEXT_SETTINGS.PT_SERVERCONTEXT_AUTOUNIQUENAMING PT_SERVERCONTEXT_SETTINGS.PT_SERVERCONTEXT_DIRTYACL
iValue - The value to associated with the passed-in setting id.

GetLastModifiedBy

int GetLastModifiedBy()
Retrieves the user id of the user that last modified this object.

Returns:
The user id of the user that last modified this object.

SetLastModifiedBy

void SetLastModifiedBy(int iUser)
Sets the user that last modified the object to be the passed-in user id.

Parameters:
iUser - - The userid of the user that will be returned by subsequent calls to IPTServerContext.GetLastModifiedBy().


Copyright 2008 Plumtree Software Inc. All Rights Reserved.