com.plumtree.portaluiinfrastructure.editor
Class ObjEditorModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorModel
      extended by com.plumtree.portaluiinfrastructure.editor.ObjEditorModel
All Implemented Interfaces:
IDescriptionModelRO, IMigrationModelRO, IObjEditorModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IEditorModelRO, IRepostModel
Direct Known Subclasses:
AdminFolderModel, AuthSourceModel, CardEditorModel, CommunityEditorModel, CommunityTemplateModel, CrawlerModel, DocTypeModel, DSModel, ExternalOperationEditorModel, FilterModel, FolderEditorModel, GroupModel, InvitationModel, JobModel, LockboxEditorModel, MultipleCardLinkSettingsModel, NetSearchModel, NetSearchModel, ObjPropEditorModel, OutgoingNSModel, PageEditorModel, PageTemplateModel, PlumtreeAuthSourceEditorModel, PortletBundleModel, PortletModel, ProfileSourceModel, PropModel, RemoteServerModel, RuleEditorModel, SavedSearchModel, SiteMapFolderModel, SmartSortEditorModel, SOAPCardSubmitAdvancedModel, SubPortalModel, UserModel, UsrProfMgrModel, WebServiceModel, WWWCardSubmitAdvancedModel

public abstract class ObjEditorModel
extends EditorModel
implements IObjEditorModelRO, IMigrationModelRO, IDescriptionModelRO

This is the Model class for the Editor Framework. This class assumes the framework is based on an IPTObject. Editors based on other Objects like for example Global Objects need to extend EditorModel directly. This class contains the IPTObject as a member variable. It initializes IPTObject when the editor starts and stores it in the DB when the user is done. Model classes should extend this class.

Author:
Julie Fournier

Field Summary
static int EDITOR_CLASSID_UNKNOWN
          Query String param default value: unknown class ID
static int EDITOR_FOLDERID_UNKNOWN
          Query String param default value: unknown folder ID
static int EDITOR_OBJECTID_UNKNOWN
          Query String param default value: unknown object ID
static java.lang.String EDITOR_QS_BOL_QS_FORCESAVEINFOLDER
          Query String param name: Create In Parent ID
static java.lang.String EDITOR_QS_INT_CLASS_ID
          Query String param name: Class ID
static java.lang.String EDITOR_QS_INT_QS_FOLDER_ID
          Query String param name: Folder ID
static java.lang.String EDITOR_QS_INT_QS_OBJECT_ID
          Query String param name: Object ID
protected  boolean m_bDisableDescription
          For some objects, you can't set/change the description from the Editor.
protected  boolean m_bDisableSecurity
          Some Objects don't support ACLs.
protected  boolean m_bForceSavedInSuppliedFolder
          This var is set if this editor is opened by a parent editor (although not being a sub editor), and the requires the edited object to be stored in a certain folder.
protected  boolean m_bIsSysAdmin
          Flag to know if the current user has system administration activity rights.
protected  int m_nClassID
          Object being created or edited class ID
protected  int m_nFolderID
          Folder ID where this object should be saved (has value only in create mode)
protected  int m_nFolderType
          Folder type.
protected  int m_nObjectID
          Object being created or edited ID (has value only in edit mode)
protected  IPTObject m_ptObject
          Server object: Object being created or edited
protected  IPTSession m_Session
          Server object: Plumtree Session for the current user
protected  java.lang.String m_sFolderName
          Folder Name.
static int OBJECT_NAME_TRUNCATE
          Truncate object name after this number of chars.
 
Fields inherited from class com.plumtree.uiinfrastructure.editor.EditorModel
isReadAccessAvailable, m_asOwner, m_bCloseOnDone, m_bDeleteOnCancel, m_bEnableApplyButton, m_bEnableCancelButton, m_bHideLeftNav, m_bIsEditorReadOnly, m_bUserHasAccessToEditor, m_nEditorType
 
Constructor Summary
ObjEditorModel()
           
 
Method Summary
protected  boolean CheckEditorAccess(XPHashtable _htFormData)
          Helper method to check the current user rights to this Object Editor.
 boolean CheckEditorAccessAndStart(XPHashtable _htFormData)
          That method is called by the EditorStartControl.
protected  void CheckFolderType()
          Helper method to check retrieve the folder type.
 boolean DisableSecurity()
          Returns true if the current Object doesn't support ACLs.
 void DoTaskOnComeBackFromSubEditor()
          This method will be called when you come back to the main Editor from a sub Editor.
 void Finish()
          That method is called by the EditorFinishControl.
 boolean ForceSaveInFolder()
          Returns the Folder ID in which the Object will be saved.
 int GetClassID()
          Returns the Class ID corresponding to the object being created or edited.
 int GetFolderID()
          Returns the Folder ID in which the Object will be saved.
 java.lang.String GetFolderName()
          Returns the folder name.
 boolean GetIsSysAdmin()
          Returns the value of the m_bIsSysAdmin member variable.
 int GetMigrationStatus()
          Returns the current Object's migration status.
 IPTObject GetObject()
          Returns the the IPTObject being created or edited.
 java.lang.String GetObjectDescription()
          Returns the description of the IPTObject being created or edited.
 int GetObjectID()
          Returns the ID of the IPTObject being created or edited.
 java.lang.String GetObjectName()
          Returns the name of the IPTObject being created or edited.
 java.lang.String GetParentFolderPath()
          Returns the path to the folder where the object has been saved.
 IPTSession GetPTSession()
          Returns the IPTSession for the current user.
 void Init(AActivitySpace parent)
          Inits the Model with the IPTSession.
protected  void InitIsSysAdminFlag()
          Helper method to init the isSysAdmin flag.
protected  void InitPTObject(XPHashtable _htFormData)
          Helper method to initialize the PTObject being created or edited.
 boolean IsDescriptionDisabled()
          Returns true if the object description cannot be set/changed from the Editor.
 boolean IsMigrationApproved()
          Returns true if the migration has already been approved for the current object.
protected  void SaveMigrationStatus()
          Helper method to Save the migration status on the object.
 int SavePage(java.lang.String _sPageName, XPHashtable _htFormData)
          Calls the right save function according to the page name passed in argument.
 void SetDisableDescription(boolean _bDisableDescription)
          Sets the value of the m_bDisableDescription member variable.
 void SetEditorToReadOnly()
          Helper method to set the read-only flag to true and display a warning on every page to remind the user his changes will not be saved.
 void SetMemberVariablesFromQS(XPHashtable _htFormData)
          Helper method for the StartEditor method.
 void SetMigrationStatus(int _nMigrationStatus)
          Sets the current Object's migration status.
 void StartKeywords()
          Helper method to start the keywords section.
 void StartLocNamesList()
          Helper method to start the localized names and description list.
 void StartMigrationHistory()
          Helper method to start the migration history page.
 void StartObjectProp()
          Helper method to start the object property page.
 void StartSecurityList()
          Helper method to start the security page.
protected  void StoreObject()
          Helper method to Store the Object.
 
Methods inherited from class com.plumtree.uiinfrastructure.editor.EditorModel
Cancel, CleanupAllData, CleanupTempData, Create, DoTaskAfterStore, DoTaskBeforeStore, DoTaskOnChangePage, DoTaskOnStartEditor, GetAccessToEditorPriviledges, GetCloseOnDone, GetCurrentRepostAction, GetDeleteOnCancel, GetEditorType, GetEnableApplyButton, GetEnableCancelButton, GetHideLeftNav, GetIsEditorReadOnly, GetName, GetRedirectAfterFinish, GetUserHasAccessToEditor, SetCloseOnDone, SetDeleteOnCancel, SetEditorType, SetEnableApplyButton, SetHideLeftNav, SetPageStatus, SetUserHasAccessToEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.plumtree.uiinfrastructure.editor.IEditorModelRO
GetEditorType, GetEnableApplyButton, GetEnableCancelButton, GetHideLeftNav, GetIsEditorReadOnly
 
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IMVCObject
GetName
 

Field Detail

EDITOR_QS_INT_CLASS_ID

public static final java.lang.String EDITOR_QS_INT_CLASS_ID
Query String param name: Class ID

See Also:
Constant Field Values

EDITOR_QS_INT_QS_OBJECT_ID

public static final java.lang.String EDITOR_QS_INT_QS_OBJECT_ID
Query String param name: Object ID

See Also:
Constant Field Values

EDITOR_QS_INT_QS_FOLDER_ID

public static final java.lang.String EDITOR_QS_INT_QS_FOLDER_ID
Query String param name: Folder ID

See Also:
Constant Field Values

EDITOR_QS_BOL_QS_FORCESAVEINFOLDER

public static final java.lang.String EDITOR_QS_BOL_QS_FORCESAVEINFOLDER
Query String param name: Create In Parent ID

See Also:
Constant Field Values

EDITOR_CLASSID_UNKNOWN

public static final int EDITOR_CLASSID_UNKNOWN
Query String param default value: unknown class ID

See Also:
Constant Field Values

EDITOR_OBJECTID_UNKNOWN

public static final int EDITOR_OBJECTID_UNKNOWN
Query String param default value: unknown object ID

See Also:
Constant Field Values

EDITOR_FOLDERID_UNKNOWN

public static final int EDITOR_FOLDERID_UNKNOWN
Query String param default value: unknown folder ID

See Also:
Constant Field Values

m_ptObject

protected IPTObject m_ptObject
Server object: Object being created or edited


m_Session

protected IPTSession m_Session
Server object: Plumtree Session for the current user


OBJECT_NAME_TRUNCATE

public static final int OBJECT_NAME_TRUNCATE
Truncate object name after this number of chars.

See Also:
Constant Field Values

m_sFolderName

protected java.lang.String m_sFolderName
Folder Name.


m_bDisableSecurity

protected boolean m_bDisableSecurity
Some Objects don't support ACLs. We don't display the Security page for those Objects.


m_bForceSavedInSuppliedFolder

protected boolean m_bForceSavedInSuppliedFolder
This var is set if this editor is opened by a parent editor (although not being a sub editor), and the requires the edited object to be stored in a certain folder. E.g is when creating a subcommunity within a community, always want the subcommonity to be created in the parent community's folder. The parent editor passes in the ForceSaveIn parameter to set this.


m_bIsSysAdmin

protected boolean m_bIsSysAdmin
Flag to know if the current user has system administration activity rights. We need it to know when to display the migration checkbox.


m_nClassID

protected int m_nClassID
Object being created or edited class ID


m_nFolderID

protected int m_nFolderID
Folder ID where this object should be saved (has value only in create mode)


m_nFolderType

protected int m_nFolderType
Folder type.


m_bDisableDescription

protected boolean m_bDisableDescription
For some objects, you can't set/change the description from the Editor.


m_nObjectID

protected int m_nObjectID
Object being created or edited ID (has value only in edit mode)

Constructor Detail

ObjEditorModel

public ObjEditorModel()
Method Detail

CheckEditorAccessAndStart

public boolean CheckEditorAccessAndStart(XPHashtable _htFormData)
That method is called by the EditorStartControl. It creates a new IPTObject in create mode and retrieves the existing IPTObject in edit mode.

Specified by:
CheckEditorAccessAndStart in class EditorModel
Parameters:
_htFormData -
Returns:
boolean Is true if the current user has the rights to access this Editor.
Throws:
XPException

DisableSecurity

public boolean DisableSecurity()
Returns true if the current Object doesn't support ACLs.

Returns:
boolean

Finish

public void Finish()
That method is called by the EditorFinishControl. It takes care of storing the IPTObject in the DB when the user finishes the Editor.

Specified by:
Finish in interface IRepostModel
Specified by:
Finish in class EditorModel
Throws:
XPException

ForceSaveInFolder

public boolean ForceSaveInFolder()
Returns the Folder ID in which the Object will be saved.

Returns:
boolean

GetClassID

public int GetClassID()
Returns the Class ID corresponding to the object being created or edited.

Specified by:
GetClassID in interface IObjEditorModelRO
Returns:
int
See Also:
GetClassID()

GetFolderID

public int GetFolderID()
Returns the Folder ID in which the Object will be saved.

Returns:
int

IsDescriptionDisabled

public boolean IsDescriptionDisabled()
Returns true if the object description cannot be set/changed from the Editor.

Specified by:
IsDescriptionDisabled in interface IDescriptionModelRO
Returns:
boolean
See Also:
IsDescriptionDisabled()

SetDisableDescription

public void SetDisableDescription(boolean _bDisableDescription)
Sets the value of the m_bDisableDescription member variable.


GetFolderName

public java.lang.String GetFolderName()
Returns the folder name.

Returns:
String

GetIsSysAdmin

public boolean GetIsSysAdmin()
Returns the value of the m_bIsSysAdmin member variable.

Specified by:
GetIsSysAdmin in interface IMigrationModelRO
Returns:
boolean
See Also:
GetIsSysAdmin()

GetMigrationStatus

public int GetMigrationStatus()
Returns the current Object's migration status.

Returns:
int

GetObject

public IPTObject GetObject()
Returns the the IPTObject being created or edited.

Specified by:
GetObject in interface IObjEditorModelRO
Returns:
IPTObject
See Also:
GetObject()

GetObjectDescription

public java.lang.String GetObjectDescription()
Returns the description of the IPTObject being created or edited.

Specified by:
GetObjectDescription in interface IObjEditorModelRO
Returns:
String
See Also:
GetObjectDescription()

GetObjectID

public int GetObjectID()
Returns the ID of the IPTObject being created or edited.

Specified by:
GetObjectID in interface IObjEditorModelRO
Returns:
int
See Also:
GetObjectID()

GetObjectName

public java.lang.String GetObjectName()
Returns the name of the IPTObject being created or edited.

Specified by:
GetObjectName in interface IObjEditorModelRO
Returns:
String
See Also:
GetObjectName()

GetPTSession

public IPTSession GetPTSession()
Returns the IPTSession for the current user.

Specified by:
GetPTSession in interface IObjEditorModelRO
Returns:
IPTSession
See Also:
GetPTSession()

GetParentFolderPath

public java.lang.String GetParentFolderPath()
Returns the path to the folder where the object has been saved.

Specified by:
GetParentFolderPath in interface IObjEditorModelRO
Returns:
String
See Also:
GetParentFolderPath()

Init

public void Init(AActivitySpace parent)
Inits the Model with the IPTSession.

Specified by:
Init in interface IModel
Overrides:
Init in class EditorModel
Parameters:
parent -

IsMigrationApproved

public boolean IsMigrationApproved()
Returns true if the migration has already been approved for the current object.

Specified by:
IsMigrationApproved in interface IMigrationModelRO
Returns:
boolean
See Also:
IsMigrationApproved()

SavePage

public int SavePage(java.lang.String _sPageName,
                    XPHashtable _htFormData)
Calls the right save function according to the page name passed in argument.

Specified by:
SavePage in interface IRepostModel
Specified by:
SavePage in class EditorModel
Parameters:
_sPageName -
_htFormData -
Returns:
int Page status for server side validation

SetMemberVariablesFromQS

public void SetMemberVariablesFromQS(XPHashtable _htFormData)
Helper method for the StartEditor method. Fill out the member variables with data from QS.

Parameters:
_htFormData -

SetMigrationStatus

public void SetMigrationStatus(int _nMigrationStatus)
Sets the current Object's migration status.

Parameters:
_nMigrationStatus -

StartLocNamesList

public void StartLocNamesList()
Helper method to start the localized names and description list.


StartMigrationHistory

public void StartMigrationHistory()
Helper method to start the migration history page.


StartObjectProp

public void StartObjectProp()
Helper method to start the object property page.


StartKeywords

public void StartKeywords()
Helper method to start the keywords section.


StartSecurityList

public void StartSecurityList()
Helper method to start the security page.


CheckEditorAccess

protected boolean CheckEditorAccess(XPHashtable _htFormData)
Helper method to check the current user rights to this Object Editor.

Parameters:
_htFormData - Form data
Returns:
boolean

CheckFolderType

protected void CheckFolderType()
Helper method to check retrieve the folder type.


InitIsSysAdminFlag

protected void InitIsSysAdminFlag()
Helper method to init the isSysAdmin flag.


InitPTObject

protected void InitPTObject(XPHashtable _htFormData)
Helper method to initialize the PTObject being created or edited.

Parameters:
_htFormData -

SaveMigrationStatus

protected void SaveMigrationStatus()
Helper method to Save the migration status on the object.


StoreObject

protected void StoreObject()
Helper method to Store the Object.

Throws:
XPException

SetEditorToReadOnly

public void SetEditorToReadOnly()
Helper method to set the read-only flag to true and display a warning on every page to remind the user his changes will not be saved.


DoTaskOnComeBackFromSubEditor

public void DoTaskOnComeBackFromSubEditor()
This method will be called when you come back to the main Editor from a sub Editor.

Overrides:
DoTaskOnComeBackFromSubEditor in class EditorModel



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.