com.plumtree.portalpages.browsing.portletpreview
Class PreviewPortletModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.activityspace.AClearModel
      extended by com.plumtree.portalpages.browsing.portletpreview.PreviewPortletModel
All Implemented Interfaces:
IPreviewPortletModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IRepostModel

public class PreviewPortletModel
extends AClearModel
implements IRepostModel, IModel, IPreviewPortletModelRO

File: PreviewPortletModel.java ----------------------------- Model for entire preview/invitation (and invitation join) functionality.

Author:
NaveenP/DustinA

Field Summary
static int INVITEHEADER
          Constant: Invite Header Bar
 AActivitySpace m_asOwner
          Activity Space
 boolean m_bAlwaysCommunity
          Whether to always use community preview mode
 boolean m_bErrorPage
          Is it an Error Page
 boolean m_bPortletChecked
          Portlet Checked on selection page (for checkbox)
 boolean m_bPortletEnabled
          Is Portlet Enabled
 int m_nPageID
          Page ID
 int m_nPortletAlignment
          Portlet Alignment
 int m_nPortletID
          Portlet ID
 int m_nPortletIndex
          Portlet Index on selection page (for checkbox)
 int m_nPreviewStatus
          Preview Status
 IPTSession m_ptSession
          Session
 java.lang.String m_strDisabledMessage
          Disabled Message
 java.lang.String m_strHostPageURI
          Host Page URI
 java.lang.String m_strJavascriptOverride
          Add Portlet Javascript override
 java.lang.String m_strPortletDesc
          Localized Portlet Description
 java.lang.String m_strPortletName
          Localized Portlet Name
 java.lang.String m_strRawHeaders
           
static int PREVIEWHEADER
          Constant: Preview Header Bar for preview only (as in Portlet Editor)
static int SEARCHHEADER
          Constant: Invite Header Bar
static int SELECTIONPREVIEWHEADER
          Constant: Preview Header Bar for Selection Page
static java.lang.String STR_MVC_CLASS_NAME
           
 
Constructor Summary
PreviewPortletModel()
           
 
Method Summary
 void AddPortletInPage()
          Add Portlet In Page - adds gadget to the specified user's page
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 void Finish()
          Implement some code to execute when the user clicks on "Finish".
 java.lang.String GetAddPortletJavaScriptOverride()
          Get Add Portlet Javascript override.
 XPArrayList GetAllCommunitiesUsingPortlet()
          Method GetAllCommunitiesUsingPortlet.
 boolean GetAlwaysUseCommunityPreview()
          Returns true if the community preview mode should be used even if the portlet is not community-only
 java.lang.String GetDefaultMyPageURL()
          Get Default MyPage URL
 IASQueryResult GetMyPages()
          Get My Pages
 java.lang.String GetMyPageURL()
          Get MyPage URL
 java.lang.String GetName()
          Get Object Name
 java.lang.Object GetNewTempData()
          This method returns a new temporary data object.
 int GetPageID()
          Get the page id
 java.lang.String GetPageName()
          Get the page name
 AActivitySpace GetParent()
          Get AS Parent
 int GetPortletAlignment()
          Get Portlet Alignment
 java.lang.String GetPortletDescription()
          Get Portlet Description
 java.lang.String GetPortletDisabledMessage()
          Get Disabled Message if portlet is disabled
 java.lang.Object[][] GetPortletHTMLText()
          Get Portlet HTML Text
 int GetPortletID()
          Get the gadget id
 int GetPortletIndex()
          Get the gadget index for selection page
 java.lang.String GetPortletName()
          Get Portlet Name
 java.lang.String GetPortletPreviewURL()
          Get Preview Portlet URL
 int GetPortletType()
          Returns the gadget type
 Redirect GetRedirectAfterFinish()
          Returns the Redirect object (this is were we need to go at the end of the Editor).
 IPTSession GetSession()
          Returns the user session
 int GetUserID()
          Returns the user ID
 void Init(AActivitySpace parent)
          This method initializes the model.
 boolean IsErrorPage()
          IsErrorPage
 boolean IsFooter()
          Is Portlet Footer
 boolean IsFreeForm()
          Is Portlet FreeForm
 boolean IsHeader()
          Is Portlet Header
 boolean IsNarrow()
          Is Portlet Narrow
 boolean IsNone()
          Is Portlet None
 boolean IsPortletChecked()
          Check if Portlet is already selected
 boolean IsPortletEnabled()
          Is Portlet Enabled
 boolean IsPortletInPage()
          Is Portlet In Page - checks to if the gadget is already in the user's page that's specified
 boolean IsPortletInvitePage()
          Is Portlet Invite Page
 boolean IsPortletSearchPreviewPage()
          Is Portlet Search Preview Page
 boolean IsPortletSelectionPreviewPage()
          Is Portlet Selection Preview Page
 boolean IsWide()
          Is Portlet Wide
 int SavePage(java.lang.String _sPageName, XPHashtable _htFormData)
          Calls the right save function according to the page name passed in argument.
 void SetAddPortletJavaScriptOverride(java.lang.String _strOverride)
          Set the Add Portlet Javascript override.
 void SetAlwaysUseCommunityPreview(boolean b)
          Tells the model that community preview mode should always be used, even if the portlet is not community-only
 void SetErrorPage(boolean bSetErrorPage)
          SetErrorPage
 void SetHostPageURI(java.lang.String strHostPageURI)
          Sets the host page URI that is later used to initialize the AppDataObject
 void SetPageID(int nPageID)
          Set The Page ID
 void SetPortletChecked(boolean bPortletChecked)
           
 void SetPortletID(int nPortletID)
          Set Portlet ID
 void SetPortletIndex(int nPortletIndex)
           
 void SetPortletToInvitePage()
          Set to use Invite Header
 void SetPortletToPreviewPage()
          Set to use Preview Header
 void SetPortletToSearchPreviewPage()
          Set to use Search Preview Header
 void SetPortletToSelectionPreviewPage()
          Set to use Selection Preview Header
 void SetRawHeaders(java.lang.String strRawHeaders)
           
 void SetupIntrinsicPortlet(java.lang.String _strPortletClass, java.lang.String _strStorageName)
          Register model, view, and control for intrinsic portlet.
 boolean UserHasMyPageAccess()
          User Has My Page Access
 boolean UserHasReadAccess()
          User Has Read Access
 boolean UserHasSelectAccess()
          User Has Select Access
 
Methods inherited from class com.plumtree.uiinfrastructure.activityspace.AClearModel
CleanupAllData, CleanupTempData, GetTempData
 
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, CleanupTempData
 

Field Detail

STR_MVC_CLASS_NAME

public static final java.lang.String STR_MVC_CLASS_NAME
See Also:
Constant Field Values

SELECTIONPREVIEWHEADER

public static final int SELECTIONPREVIEWHEADER
Constant: Preview Header Bar for Selection Page

See Also:
Constant Field Values

INVITEHEADER

public static final int INVITEHEADER
Constant: Invite Header Bar

See Also:
Constant Field Values

PREVIEWHEADER

public static final int PREVIEWHEADER
Constant: Preview Header Bar for preview only (as in Portlet Editor)

See Also:
Constant Field Values

SEARCHHEADER

public static final int SEARCHHEADER
Constant: Invite Header Bar

See Also:
Constant Field Values

m_bAlwaysCommunity

public boolean m_bAlwaysCommunity
Whether to always use community preview mode


m_nPortletID

public int m_nPortletID
Portlet ID


m_nPreviewStatus

public int m_nPreviewStatus
Preview Status


m_bErrorPage

public boolean m_bErrorPage
Is it an Error Page


m_bPortletChecked

public boolean m_bPortletChecked
Portlet Checked on selection page (for checkbox)


m_nPortletIndex

public int m_nPortletIndex
Portlet Index on selection page (for checkbox)


m_strHostPageURI

public java.lang.String m_strHostPageURI
Host Page URI


m_strRawHeaders

public java.lang.String m_strRawHeaders

m_nPageID

public int m_nPageID
Page ID


m_asOwner

public AActivitySpace m_asOwner
Activity Space


m_ptSession

public IPTSession m_ptSession
Session


m_strPortletName

public java.lang.String m_strPortletName
Localized Portlet Name


m_strPortletDesc

public java.lang.String m_strPortletDesc
Localized Portlet Description


m_nPortletAlignment

public int m_nPortletAlignment
Portlet Alignment


m_bPortletEnabled

public boolean m_bPortletEnabled
Is Portlet Enabled


m_strDisabledMessage

public java.lang.String m_strDisabledMessage
Disabled Message


m_strJavascriptOverride

public java.lang.String m_strJavascriptOverride
Add Portlet Javascript override

Constructor Detail

PreviewPortletModel

public PreviewPortletModel()
Method Detail

GetNewTempData

public java.lang.Object GetNewTempData()
Description copied from class: AClearModel
This method returns a new temporary data object. It is called at the beginning of a new HTTP Request. This method can perform initialization on the data object if necessary.

Specified by:
GetNewTempData in class AClearModel
Returns:
Object the new temporary data object
See Also:
com.plumtree.uiinfrastructure.activityspace.AClearModel#GetNewm_TempData()

AddPortletInPage

public void AddPortletInPage()
Add Portlet In Page - adds gadget to the specified user's page

Specified by:
AddPortletInPage in interface IPreviewPortletModelRO
Parameters:
int - nPageID

Create

public java.lang.Object Create()
Description copied from class: AClearModel
This method is used by the ASManager to return new instances of managed objects.

Specified by:
Create in interface IManagedObject
Specified by:
Create in class AClearModel
Returns:
A new instance of the managed class (i.e. return new Foo();)
See Also:
IManagedObject.Create()

Finish

public void Finish()
Description copied from interface: IRepostModel
Implement some code to execute when the user clicks on "Finish".

Specified by:
Finish in interface IRepostModel
See Also:
IRepostModel.Finish()

GetAddPortletJavaScriptOverride

public java.lang.String GetAddPortletJavaScriptOverride()
Description copied from interface: IPreviewPortletModelRO
Get Add Portlet Javascript override. This javascript should be the name of the javascript function to be used in the onclick attribute of the add button. The function should take 2 arguments: the portlet ID, and a reference to the popup window. (i.e. If the name is "addPortlet", then the function will look like this: "addPortlet(portletID, self)"). This function name can also include an optional window reference (i.e. "opener.addPortlet").

Specified by:
GetAddPortletJavaScriptOverride in interface IPreviewPortletModelRO
Returns:
String the name of the javascript function to use when adding the portlet. This string will be null if there is no override.
See Also:
IPreviewPortletModelRO.GetAddPortletJavaScriptOverride()

GetDefaultMyPageURL

public java.lang.String GetDefaultMyPageURL()
Get Default MyPage URL

Specified by:
GetDefaultMyPageURL in interface IPreviewPortletModelRO
Returns:
String

GetPortletAlignment

public int GetPortletAlignment()
Get Portlet Alignment

Specified by:
GetPortletAlignment in interface IPreviewPortletModelRO
Returns:
int

GetPortletHTMLText

public java.lang.Object[][] GetPortletHTMLText()
Get Portlet HTML Text

Specified by:
GetPortletHTMLText in interface IPreviewPortletModelRO
Returns:
String

GetPortletID

public int GetPortletID()
Description copied from interface: IPreviewPortletModelRO
Get the gadget id

Specified by:
GetPortletID in interface IPreviewPortletModelRO
Returns:
int
See Also:
IPreviewPortletModelRO.GetPortletID()

GetPortletIndex

public int GetPortletIndex()
Description copied from interface: IPreviewPortletModelRO
Get the gadget index for selection page

Specified by:
GetPortletIndex in interface IPreviewPortletModelRO
Returns:
int
See Also:
IPreviewPortletModelRO.GetPortletIndex()

GetPortletName

public java.lang.String GetPortletName()
Get Portlet Name

Specified by:
GetPortletName in interface IPreviewPortletModelRO
Returns:
String

GetPortletDescription

public java.lang.String GetPortletDescription()
Get Portlet Description

Specified by:
GetPortletDescription in interface IPreviewPortletModelRO
Returns:
String

IsPortletEnabled

public boolean IsPortletEnabled()
Is Portlet Enabled

Specified by:
IsPortletEnabled in interface IPreviewPortletModelRO
Returns:
boolean

GetPortletDisabledMessage

public java.lang.String GetPortletDisabledMessage()
Get Disabled Message if portlet is disabled

Specified by:
GetPortletDisabledMessage in interface IPreviewPortletModelRO
Returns:
boolean

GetPortletPreviewURL

public java.lang.String GetPortletPreviewURL()
Get Preview Portlet URL

Specified by:
GetPortletPreviewURL in interface IPreviewPortletModelRO
Returns:
String

GetAlwaysUseCommunityPreview

public boolean GetAlwaysUseCommunityPreview()
Returns true if the community preview mode should be used even if the portlet is not community-only

Specified by:
GetAlwaysUseCommunityPreview in interface IPreviewPortletModelRO
Returns:
True if the community preview mode should be used even if the portlet is not community-only

SetAlwaysUseCommunityPreview

public void SetAlwaysUseCommunityPreview(boolean b)
Tells the model that community preview mode should always be used, even if the portlet is not community-only


GetPortletType

public int GetPortletType()
Returns the gadget type

Specified by:
GetPortletType in interface IPreviewPortletModelRO
Returns:
Portlet type

GetMyPageURL

public java.lang.String GetMyPageURL()
Get MyPage URL

Specified by:
GetMyPageURL in interface IPreviewPortletModelRO
Returns:
String

GetMyPages

public IASQueryResult GetMyPages()
Get My Pages

Specified by:
GetMyPages in interface IPreviewPortletModelRO
Returns:
boolean

GetName

public java.lang.String GetName()
Get Object Name

Specified by:
GetName in interface IMVCObject
Specified by:
GetName in class AClearModel
Returns:
String
See Also:
IMVCObject.GetName()

GetPageID

public int GetPageID()
Description copied from interface: IPreviewPortletModelRO
Get the page id

Specified by:
GetPageID in interface IPreviewPortletModelRO
Returns:
int
See Also:
com.plumtree.portalpages.browsing.portletpreview.IPreviewPortletModel#GetPageID()

GetPageName

public java.lang.String GetPageName()
Description copied from interface: IPreviewPortletModelRO
Get the page name

Specified by:
GetPageName in interface IPreviewPortletModelRO
Returns:
String
See Also:
com.plumtree.portalpages.browsing.portletpreview.IPreviewPortletModel#GetPageID()

GetParent

public AActivitySpace GetParent()
Get AS Parent

Returns:
AActivitySpace

GetRedirectAfterFinish

public Redirect GetRedirectAfterFinish()
Description copied from interface: IRepostModel
Returns the Redirect object (this is were we need to go at the end of the Editor).

Specified by:
GetRedirectAfterFinish in interface IRepostModel
Returns:
Redirect
See Also:
IRepostModel.GetRedirectAfterFinish()

GetSession

public IPTSession GetSession()
Description copied from interface: IPreviewPortletModelRO
Returns the user session

Specified by:
GetSession in interface IPreviewPortletModelRO
Returns:
IPTSession
See Also:
IPreviewPortletModelRO.GetSession()

GetUserID

public int GetUserID()
Description copied from interface: IPreviewPortletModelRO
Returns the user ID

Specified by:
GetUserID in interface IPreviewPortletModelRO
Returns:
User ID
See Also:
IPreviewPortletModelRO.GetUserID()

Init

public void Init(AActivitySpace parent)
Description copied from interface: IModel
This method initializes the model. This is called automatically when AActivitySpace.RegisterModel() is called.

Specified by:
Init in interface IModel
Overrides:
Init in class AClearModel
Parameters:
parent - the parent Activity Space
See Also:
com.plumtree.xpshared.activityspace.IModel#Init()

IsErrorPage

public boolean IsErrorPage()
IsErrorPage

Specified by:
IsErrorPage in interface IPreviewPortletModelRO
Parameters:
boolean -

IsFooter

public boolean IsFooter()
Is Portlet Footer

Returns:
boolean

IsFreeForm

public boolean IsFreeForm()
Is Portlet FreeForm

Returns:
boolean

IsPortletChecked

public boolean IsPortletChecked()
Check if Portlet is already selected

Specified by:
IsPortletChecked in interface IPreviewPortletModelRO
Returns:
boolean

IsPortletInPage

public boolean IsPortletInPage()
Is Portlet In Page - checks to if the gadget is already in the user's page that's specified

Specified by:
IsPortletInPage in interface IPreviewPortletModelRO
Parameters:
int - nPageID

IsPortletInvitePage

public boolean IsPortletInvitePage()
Is Portlet Invite Page

Specified by:
IsPortletInvitePage in interface IPreviewPortletModelRO
Returns:
boolean

IsPortletSearchPreviewPage

public boolean IsPortletSearchPreviewPage()
Is Portlet Search Preview Page

Specified by:
IsPortletSearchPreviewPage in interface IPreviewPortletModelRO
Returns:
boolean

IsPortletSelectionPreviewPage

public boolean IsPortletSelectionPreviewPage()
Is Portlet Selection Preview Page

Specified by:
IsPortletSelectionPreviewPage in interface IPreviewPortletModelRO
Returns:
boolean

IsHeader

public boolean IsHeader()
Is Portlet Header

Returns:
boolean

IsNarrow

public boolean IsNarrow()
Is Portlet Narrow

Specified by:
IsNarrow in interface IPreviewPortletModelRO
Returns:
boolean

IsNone

public boolean IsNone()
Is Portlet None

Returns:
boolean

IsWide

public boolean IsWide()
Is Portlet Wide

Returns:
boolean

SavePage

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

Specified by:
SavePage in interface IRepostModel
Returns:
int Page status for server side validation
See Also:
IRepostModel.SavePage(String, XPHashtable)

SetAddPortletJavaScriptOverride

public void SetAddPortletJavaScriptOverride(java.lang.String _strOverride)
Set the Add Portlet Javascript override. This javascript should be the name of the javascript function to be used in the onclick attribute of the add button. The function should take 2 arguments: the portlet ID, and a reference to the popup window. (i.e. If the name is "addPortlet", then the function will look like this: "addPortlet(portletID, self)"). This function name can also include an optional window reference (i.e. "opener.addPortlet"). Null means to use the default javascript.


SetErrorPage

public void SetErrorPage(boolean bSetErrorPage)
SetErrorPage

Parameters:
boolean -

SetPortletChecked

public void SetPortletChecked(boolean bPortletChecked)
Parameters:
sPortletChecked -

SetPortletID

public void SetPortletID(int nPortletID)
Set Portlet ID

Parameters:
int - nPortletID

SetPortletIndex

public void SetPortletIndex(int nPortletIndex)
Parameters:
nPortletIndex -

SetPortletToInvitePage

public void SetPortletToInvitePage()
Set to use Invite Header


SetPortletToPreviewPage

public void SetPortletToPreviewPage()
Set to use Preview Header


SetPortletToSearchPreviewPage

public void SetPortletToSearchPreviewPage()
Set to use Search Preview Header


SetPortletToSelectionPreviewPage

public void SetPortletToSelectionPreviewPage()
Set to use Selection Preview Header


SetHostPageURI

public void SetHostPageURI(java.lang.String strHostPageURI)
Sets the host page URI that is later used to initialize the AppDataObject

Parameters:
strHostPageURI - strHostPageURI

SetPageID

public void SetPageID(int nPageID)
Set The Page ID

Parameters:
int -

SetRawHeaders

public void SetRawHeaders(java.lang.String strRawHeaders)
Parameters:
strRawHeaders -

SetupIntrinsicPortlet

public void SetupIntrinsicPortlet(java.lang.String _strPortletClass,
                                  java.lang.String _strStorageName)
Register model, view, and control for intrinsic portlet. Initialize portlet with the portletID, the IPTMyPortal object, and the AppDataState object.

Parameters:
_strPortletClass - Class identifier for portlet
_strStorageName - Storage name for portlet
Throws:
XPException - Exception thrown if model, view, or control is not registered successfully.

UserHasReadAccess

public boolean UserHasReadAccess()
Description copied from interface: IPreviewPortletModelRO
User Has Read Access

Specified by:
UserHasReadAccess in interface IPreviewPortletModelRO
Returns:
boolean
See Also:
com.plumtree.portalpages.browsing.portletpreview.IPreviewPortletModel#UserHasReadAccess()

UserHasSelectAccess

public boolean UserHasSelectAccess()
Description copied from interface: IPreviewPortletModelRO
User Has Select Access

Specified by:
UserHasSelectAccess in interface IPreviewPortletModelRO
Returns:
boolean
See Also:
com.plumtree.portalpages.browsing.portletpreview.IPreviewPortletModel#UserHasSelectAccess()

UserHasMyPageAccess

public boolean UserHasMyPageAccess()
Description copied from interface: IPreviewPortletModelRO
User Has My Page Access

Specified by:
UserHasMyPageAccess in interface IPreviewPortletModelRO
Returns:
boolean
See Also:
IPreviewPortletModelRO.UserHasMyPageAccess()

GetAllCommunitiesUsingPortlet

public XPArrayList GetAllCommunitiesUsingPortlet()
Method GetAllCommunitiesUsingPortlet. Gets a compound list suitable for URL constrcution for communities preview links.

Specified by:
GetAllCommunitiesUsingPortlet in interface IPreviewPortletModelRO
Returns:
ASCompoundList



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