com.plumtree.uiinfrastructure.approval
Class AApprovalModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorModel
      extended by com.plumtree.uiinfrastructure.approval.AApprovalModel
All Implemented Interfaces:
IManagedObject, IModel, IModelRO, IMVCObject, IApprovalModelRO, IEditorModelRO, IRepostModel
Direct Known Subclasses:
DocumentApprovalModel, ObjectApprovalModel

public abstract class AApprovalModel
extends EditorModel
implements IModel, IApprovalModelRO

Author:
Beng This abstract model for the approval framework provides much functionality for the ui.

Concrete models for specific implementations of approval should extend this abstract model.

Currently there are two known concrete subclasses of this class: DocumentApprovalModel and ObjectApprovalModel.

This class implements general functionality common to approval display pages. Specifically, page management and caching.

Field Summary
 
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
AApprovalModel()
           
 
Method Summary
abstract  boolean AddColumnsHeaderForEachItem()
           
 void CleanupTempData()
          This method is called at the end of every HTTP request by the Interpreter.
 void ClearCache()
           
 void ClearCache(ApprovalItemType type)
           
abstract  boolean DisplayDescriptionImmediatelyUnderTitle()
           
 boolean DisplayItemComment()
           
abstract  boolean DisplayItemTypeHeaderAboveActionbar()
           
 boolean DisplayViewItems()
           
 boolean DoSortDate()
           
 boolean DoSortName()
           
 boolean DoSortSubmittedBy()
           
 boolean GetAddComment()
           
 IXPEnumerator GetAllCachedItems()
           
abstract  boolean GetAllowClearingOfApprovalRequests()
           
abstract  boolean GetAllowClearingOfItem(AItemDescriptor item)
           
 int GetCurrentPageIndex(ApprovalItemType type)
          Call this method to obtain the index of the page being viewed for the given ApprovalItemType

 ApprovalItemType GetCurrentType()
          Call this method to obtain the ApprovalItemType currently being viewed.
abstract  ApprovalItemType GetDefaultItemType()
          Call this method to determine the default ApprovalItemType displayed by the view.
abstract  boolean GetDisableRadioSelection()
           
abstract  boolean GetDisplayHeadersForItemTypesWithNoItems()
           
abstract  boolean GetDisplayInstances(ApprovalItemType type)
          Concrete subclasses must implement this method to return a boolean value indicating whether instance information is displayed for the specified type.
abstract  boolean GetDisplaySelectAllButton()
           
abstract  boolean GetDisplayStatusColumn()
           
abstract  boolean GetDisplayTypeHeader(ApprovalItemType type)
          Concrete subclasses must implement this method to return a boolean indicating whether or not a header banner should be displayed for the specified type.
abstract  java.lang.String GetEmptyTypeSectionSubTitle(ApprovalItemType type)
          Concrete subclasses must implement this method to return a string that is displayed in sections containg no items awaiting approval.
 int GetHighItemIndexForCurrentPage(ApprovalItemType type)
          Call this method to obtain the index of the last item on the current page for a specific ApprovalItemType.
 int GetHighItemIndexForGivenPage(int iPageIndex, ApprovalItemType type)
           
 AItemDescriptor GetItemDescriptor(java.lang.String sID)
          Call this method to obtain a specific AItemDescriptor object.
 IXPEnumerator GetItemDescriptors(ApprovalItemType type)
          Call this method to obtain an enumeration of AItemDescriptor objects.
 java.lang.String GetItemID()
           
 int GetLowItemIndexForCurrentPage(ApprovalItemType type)
          Call this method to obtain the index of the first item on the current page for a specific ApprovalItemType.
 int GetLowItemIndexForGivenPage(int iPageIndex, ApprovalItemType type)
           
abstract  java.lang.String GetName()
          Concrete subclasses must implement this method to return the name of the model.
 java.lang.String GetNoItemsDescription()
           
 int GetNumPagesAvailable(ApprovalItemType type)
           
 int GetPageSize()
          Get the size of a page.
abstract  java.lang.String GetSubTitle()
          Concrete subclasses must implement this method to return the subtitle.
abstract  XPArrayList GetSupportedItemTypes()
          Concrete subclasses must implement this method to return an XPArrayList of those ItemTypes that are supporeted by the model.
abstract  java.lang.String GetTitle()
          Concrete subclasses must implement this method to return the title.
 int GetTypeCount(ApprovalItemType type)
          Call this method to obtain the count of items awaiting approval of the specified type.
 void GotoPage(ApprovalItemType type, int iPageNumber)
           
abstract  XPArrayList InternalGetItemDescriptors(ApprovalItemType type, int iLow, int iHigh)
          Concrete subclasses must implement this method to return an XPArrayList of AItemDescriptor objects.
abstract  int InternalGetTypeCount(ApprovalItemType type)
          Concrete subclasses must implement this method to return the count of specified ApprovalItemType.
abstract  boolean IsDateSortable()
           
abstract  boolean IsDescriptionEditable()
           
abstract  boolean IsNameSortable()
           
 boolean IsNextPageAvailable(ApprovalItemType type)
          Call this method to determine if there is another page of items of a given type.
 boolean IsPageAvailable(ApprovalItemType type, int iPageNumber)
           
 boolean IsPreviousPageAvailable(ApprovalItemType type)
          Call this method to determine if there is a previous page of items of a given type.
abstract  boolean IsSubmittedBySortable()
           
abstract  boolean IsTitleEditable()
           
 void NextPage(ApprovalItemType type)
          Call this method to move the view to the next page of items of the specified type.
 void PreviousPage(ApprovalItemType type)
          Call this method to move the view to the previous page of items of the specified type.
 void SetAddComment(boolean b)
           
 void SetCurrentPageIndex(ApprovalItemType type, int i)
          Call this method to set the index of the page being viewed of the given ApprovalItemType.
 void SetCurrentType(ApprovalItemType type)
          Call this method to set the type currently being viewed.
 void SetDoSortDate(boolean b)
           
 void SetDoSortName(boolean b)
           
 void SetDoSortSubmittedBy(boolean b)
           
 void SetItemID(java.lang.String s)
           
 void SetNoItemsDescription(java.lang.String s)
           
 void SetPageHighIndex(int _index)
          set the size of a page.
 void SetPageLowIndex(int _index)
          set the low item index of a page.
 
Methods inherited from class com.plumtree.uiinfrastructure.editor.EditorModel
Cancel, CheckEditorAccessAndStart, CleanupAllData, Create, DoTaskAfterStore, DoTaskBeforeStore, DoTaskOnChangePage, DoTaskOnComeBackFromSubEditor, DoTaskOnStartEditor, Finish, GetAccessToEditorPriviledges, GetCloseOnDone, GetCurrentRepostAction, GetDeleteOnCancel, GetEditorType, GetEnableApplyButton, GetEnableCancelButton, GetHideLeftNav, GetIsEditorReadOnly, GetRedirectAfterFinish, GetUserHasAccessToEditor, Init, SavePage, 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.activityspace.IModel
CleanupAllData, Init
 
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IManagedObject
Create
 
Methods inherited from interface com.plumtree.uiinfrastructure.editor.IEditorModelRO
GetEditorType, GetEnableApplyButton, GetEnableCancelButton, GetHideLeftNav, GetIsEditorReadOnly
 

Constructor Detail

AApprovalModel

public AApprovalModel()
Method Detail

SetNoItemsDescription

public void SetNoItemsDescription(java.lang.String s)

GetNoItemsDescription

public java.lang.String GetNoItemsDescription()
Specified by:
GetNoItemsDescription in interface IApprovalModelRO

AddColumnsHeaderForEachItem

public abstract boolean AddColumnsHeaderForEachItem()
Specified by:
AddColumnsHeaderForEachItem in interface IApprovalModelRO
Returns:

CleanupTempData

public void CleanupTempData()
Description copied from interface: IModel
This method is called at the end of every HTTP request by the Interpreter. The Interpreter calls AActivitySpace.CleanupTempData(), which calls this method on all IModels registered using AActivitySpace.RegisterModel(). This method is intended for cleaning up temporary data that is only used for the lifetime of a single request, like DB query results.

Specified by:
CleanupTempData in interface IModel
Overrides:
CleanupTempData in class EditorModel
See Also:
IModel.CleanupTempData()

DisplayDescriptionImmediatelyUnderTitle

public abstract boolean DisplayDescriptionImmediatelyUnderTitle()
Specified by:
DisplayDescriptionImmediatelyUnderTitle in interface IApprovalModelRO
Returns:

DoSortDate

public boolean DoSortDate()
Returns:

DoSortName

public boolean DoSortName()
Returns:

DoSortSubmittedBy

public boolean DoSortSubmittedBy()
Specified by:
DoSortSubmittedBy in interface IApprovalModelRO
Returns:

GetAddComment

public boolean GetAddComment()
Specified by:
GetAddComment in interface IApprovalModelRO
Returns:

DisplayItemComment

public boolean DisplayItemComment()
Specified by:
DisplayItemComment in interface IApprovalModelRO
Returns:

DisplayViewItems

public boolean DisplayViewItems()
Specified by:
DisplayViewItems in interface IApprovalModelRO
Returns:

GetAllowClearingOfApprovalRequests

public abstract boolean GetAllowClearingOfApprovalRequests()
Specified by:
GetAllowClearingOfApprovalRequests in interface IApprovalModelRO
Returns:

GetAllowClearingOfItem

public abstract boolean GetAllowClearingOfItem(AItemDescriptor item)
Specified by:
GetAllowClearingOfItem in interface IApprovalModelRO
Parameters:
item -
Returns:

GetCurrentPageIndex

public int GetCurrentPageIndex(ApprovalItemType type)
Call this method to obtain the index of the page being viewed for the given ApprovalItemType

Specified by:
GetCurrentPageIndex in interface IApprovalModelRO
Parameters:
type - ApprovalItemType
Returns:
int

GetCurrentType

public ApprovalItemType GetCurrentType()
Call this method to obtain the ApprovalItemType currently being viewed.

Returns:
ApprovalItemType

GetDefaultItemType

public abstract ApprovalItemType GetDefaultItemType()
Call this method to determine the default ApprovalItemType displayed by the view.

Specified by:
GetDefaultItemType in interface IApprovalModelRO
Returns:
ApprovalItemType

GetDisableRadioSelection

public abstract boolean GetDisableRadioSelection()
Specified by:
GetDisableRadioSelection in interface IApprovalModelRO
Returns:

DisplayItemTypeHeaderAboveActionbar

public abstract boolean DisplayItemTypeHeaderAboveActionbar()
Specified by:
DisplayItemTypeHeaderAboveActionbar in interface IApprovalModelRO

GetDisplayHeadersForItemTypesWithNoItems

public abstract boolean GetDisplayHeadersForItemTypesWithNoItems()
Specified by:
GetDisplayHeadersForItemTypesWithNoItems in interface IApprovalModelRO
Returns:

GetDisplayInstances

public abstract boolean GetDisplayInstances(ApprovalItemType type)
Concrete subclasses must implement this method to return a boolean value indicating whether instance information is displayed for the specified type.

The DocumentApprovalModel class for example, returns true. This is because each document, being an item, consists of one or more copies existing in various portal folders, or INSTANCES. The ObjectApprovalModel, however, return false for this method.

Specified by:
GetDisplayInstances in interface IApprovalModelRO
Parameters:
type - ApprovalItemType
Returns:
boolean value

GetDisplayTypeHeader

public abstract boolean GetDisplayTypeHeader(ApprovalItemType type)
Concrete subclasses must implement this method to return a boolean indicating whether or not a header banner should be displayed for the specified type.

Specified by:
GetDisplayTypeHeader in interface IApprovalModelRO
Parameters:
type - ApprovalItemType
Returns:
boolean value

GetEmptyTypeSectionSubTitle

public abstract java.lang.String GetEmptyTypeSectionSubTitle(ApprovalItemType type)
Concrete subclasses must implement this method to return a string that is displayed in sections containg no items awaiting approval.

Specified by:
GetEmptyTypeSectionSubTitle in interface IApprovalModelRO
Parameters:
type - ApprovalItemType
Returns:
String

GetHighItemIndexForCurrentPage

public int GetHighItemIndexForCurrentPage(ApprovalItemType type)
Call this method to obtain the index of the last item on the current page for a specific ApprovalItemType.

Specified by:
GetHighItemIndexForCurrentPage in interface IApprovalModelRO
Parameters:
type - ApprovalItemType
Returns:
int value

GetHighItemIndexForGivenPage

public int GetHighItemIndexForGivenPage(int iPageIndex,
                                        ApprovalItemType type)
Specified by:
GetHighItemIndexForGivenPage in interface IApprovalModelRO
Parameters:
iPageIndex -
type -
Returns:

GetItemID

public java.lang.String GetItemID()
Specified by:
GetItemID in interface IApprovalModelRO
Returns:

GetLowItemIndexForCurrentPage

public int GetLowItemIndexForCurrentPage(ApprovalItemType type)
Call this method to obtain the index of the first item on the current page for a specific ApprovalItemType.

Specified by:
GetLowItemIndexForCurrentPage in interface IApprovalModelRO
Parameters:
type - ApprovalItemType
Returns:
int value

GetLowItemIndexForGivenPage

public int GetLowItemIndexForGivenPage(int iPageIndex,
                                       ApprovalItemType type)
Specified by:
GetLowItemIndexForGivenPage in interface IApprovalModelRO
Parameters:
iPageIndex -
type -
Returns:

GetName

public abstract java.lang.String GetName()
Concrete subclasses must implement this method to return the name of the model.

Specified by:
GetName in interface IMVCObject
Specified by:
GetName in class EditorModel
Returns:
String

GetNumPagesAvailable

public int GetNumPagesAvailable(ApprovalItemType type)
Specified by:
GetNumPagesAvailable in interface IApprovalModelRO
Parameters:
type -
Returns:

GetPageSize

public int GetPageSize()
Get the size of a page. This is the maximum number of items awaiting approval displayed.

Returns:
int

SetPageHighIndex

public void SetPageHighIndex(int _index)
set the size of a page. This is the maximum number of items awaiting approval displayed.


SetPageLowIndex

public void SetPageLowIndex(int _index)
set the low item index of a page. This is the index of the first item to be displayed on a page.


GetSubTitle

public abstract java.lang.String GetSubTitle()
Concrete subclasses must implement this method to return the subtitle. This string is displayed in a banner at the top of the view.

Specified by:
GetSubTitle in interface IApprovalModelRO
Returns:
String

GetSupportedItemTypes

public abstract XPArrayList GetSupportedItemTypes()
Concrete subclasses must implement this method to return an XPArrayList of those ItemTypes that are supporeted by the model.

Specified by:
GetSupportedItemTypes in interface IApprovalModelRO
Returns:
XPArrayList of AItemDescriptors

GetTitle

public abstract java.lang.String GetTitle()
Concrete subclasses must implement this method to return the title. This string is displayed in a banner at the top of the view.

Specified by:
GetTitle in interface IApprovalModelRO
Returns:
String

GotoPage

public void GotoPage(ApprovalItemType type,
                     int iPageNumber)
Parameters:
type -
iPageNumber -

InternalGetItemDescriptors

public abstract XPArrayList InternalGetItemDescriptors(ApprovalItemType type,
                                                       int iLow,
                                                       int iHigh)
Concrete subclasses must implement this method to return an XPArrayList of AItemDescriptor objects.

Parameters:
type - ApprovalItemType
Returns:
XPArrayList of AItemDescriptor objects.

InternalGetTypeCount

public abstract int InternalGetTypeCount(ApprovalItemType type)
Concrete subclasses must implement this method to return the count of specified ApprovalItemType. This is the total number of object of the specified type, visible to the current user, awaiting approval.

Parameters:
type - ApprovalItemType
Returns:
int

IsDateSortable

public abstract boolean IsDateSortable()
Specified by:
IsDateSortable in interface IApprovalModelRO
Returns:

IsDescriptionEditable

public abstract boolean IsDescriptionEditable()
Specified by:
IsDescriptionEditable in interface IApprovalModelRO
Returns:

IsNameSortable

public abstract boolean IsNameSortable()
Specified by:
IsNameSortable in interface IApprovalModelRO
Returns:

IsNextPageAvailable

public boolean IsNextPageAvailable(ApprovalItemType type)
Call this method to determine if there is another page of items of a given type.

Specified by:
IsNextPageAvailable in interface IApprovalModelRO
Parameters:
type - Pass the ApprovalItemType
Returns:
boolean value

IsPageAvailable

public boolean IsPageAvailable(ApprovalItemType type,
                               int iPageNumber)
Parameters:
type -
iPageNumber -
Returns:

IsPreviousPageAvailable

public boolean IsPreviousPageAvailable(ApprovalItemType type)
Call this method to determine if there is a previous page of items of a given type.

Specified by:
IsPreviousPageAvailable in interface IApprovalModelRO
Parameters:
type - Pass the ApprovalItemType
Returns:
boolean value

IsSubmittedBySortable

public abstract boolean IsSubmittedBySortable()
Specified by:
IsSubmittedBySortable in interface IApprovalModelRO
Returns:

IsTitleEditable

public abstract boolean IsTitleEditable()
Specified by:
IsTitleEditable in interface IApprovalModelRO
Returns:

ClearCache

public void ClearCache()

ClearCache

public void ClearCache(ApprovalItemType type)
Parameters:
type -

GetAllCachedItems

public IXPEnumerator GetAllCachedItems()
Returns:

GetDisplayStatusColumn

public abstract boolean GetDisplayStatusColumn()
Specified by:
GetDisplayStatusColumn in interface IApprovalModelRO
Returns:

GetDisplaySelectAllButton

public abstract boolean GetDisplaySelectAllButton()
Specified by:
GetDisplaySelectAllButton in interface IApprovalModelRO
Returns:

GetItemDescriptor

public AItemDescriptor GetItemDescriptor(java.lang.String sID)
Call this method to obtain a specific AItemDescriptor object.

If this ItemDescriptor is not in the internal cache, the server will not be contacted.

Parameters:
type - ApprovalItemType
sID - String id of the specific AItemDescriptor wanted.
Returns:
AItemDescriptor

GetItemDescriptors

public IXPEnumerator GetItemDescriptors(ApprovalItemType type)
Call this method to obtain an enumeration of AItemDescriptor objects.

Included AItemDescriptor objects will be those object existing on the currently viewed page of item descriptors.

Specified by:
GetItemDescriptors in interface IApprovalModelRO
Parameters:
type - ApprovalItemType
Returns:
IXPEnumerator of AItemDescriptor objects

GetTypeCount

public int GetTypeCount(ApprovalItemType type)
Call this method to obtain the count of items awaiting approval of the specified type.

Specified by:
GetTypeCount in interface IApprovalModelRO
Parameters:
type - ApprovalItemType
Returns:
int

NextPage

public void NextPage(ApprovalItemType type)
Call this method to move the view to the next page of items of the specified type. If there is no next page available, calling this method will do nothing.

Parameters:
type - ApprovalItemType

PreviousPage

public void PreviousPage(ApprovalItemType type)
Call this method to move the view to the previous page of items of the specified type. If there is no previous page available, calling this method will do nothing.

Parameters:
type - ApprovalItemType

SetAddComment

public void SetAddComment(boolean b)
Parameters:
b -

SetCurrentType

public void SetCurrentType(ApprovalItemType type)
Call this method to set the type currently being viewed. Only one type of item may be viewed at a given time. This is intended to reduce stress on the portal server.

Parameters:
type - ApprovalItemType

SetDoSortDate

public void SetDoSortDate(boolean b)
Parameters:
b -

SetDoSortName

public void SetDoSortName(boolean b)
Parameters:
b -

SetDoSortSubmittedBy

public void SetDoSortSubmittedBy(boolean b)
Parameters:
b -

SetItemID

public void SetItemID(java.lang.String s)
Parameters:
s -

SetCurrentPageIndex

public void SetCurrentPageIndex(ApprovalItemType type,
                                int i)
Call this method to set the index of the page being viewed of the given ApprovalItemType.

If the index passed is not within the valid range, then GetLowItemIndexForCurrentPage() and GetHighItemIndexForCurrentPage() will return correct values for either the first or last valid page.

Parameters:
type - ApprovalItemType
i - int



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