com.plumtree.uiinfrastructure.form
Class RepostControl

java.lang.Object
  extended by com.plumtree.uiinfrastructure.form.RepostControl
All Implemented Interfaces:
IControl, IManagedObject, IMVCObject
Direct Known Subclasses:
AddPortletControl, AdminSearchRepostControl, AdvancedSearchRepostControl, DirRepostControl, DisplayInPortletControl, EditDefaultProfileRepostControl, EditMyPagePortletLayoutRepostControl_D, EditorRepostControl, HTTPMemoryDebugRepostControl, IntrinsicPortletsRepostControl, JobLogRepostControl, ObjMgrRepostControl, PreviewPortletControl, SaveObjectRepostControl, SendInvitationRepostControl, SetSiteMapControl, SiteMapRepostControl, TreeRepostControl

public class RepostControl
extends java.lang.Object
implements IControl

This class is used along with IRepostModel and IRepostAS to partially implement the logic of the repost action. Those two classes are used by the Editor Framework to help implementing the repost mechanism on any Editor page. They can also be used by any other Activity Space. To do so here is what you need to do: - Extend this class in your activity space and add any repost action (e.g.: com.plumtree.portalpagessample.editor.template1.PropRepostControl). - Your model must implement IRepostModel. - Your AS must implement IRepostAS. - In your view, you can implement any repost action using the postToSelf JavaScript method. - If you extend PlumtreeDP and call SetAddMainForm(true) in the init method of your DP, the form and the JS postToSelf will be printed out automatically.

Author:
Julie Fournier

Field Summary
static java.lang.String HTMLINPUT_PASSTHRU_ARGS
          HTML Element: Pass thru arguments
static java.lang.String HTMLINPUT_PASSTHRU_CONTROL
          The pass thru inputs need to be manually added in 508 mode if they are needed.
static java.lang.String HTMLINPUT_POSTTOSELF
          Form element names
static java.lang.String HTMLSUBMIT_508_POSTTOSELF
          HTML Element: 508 submit button
protected  AActivitySpace m_asOwner
          JF- Associated Activity Space.
protected  boolean m_bInitialized
          has Init() been called properly?
protected  XPHashtable m_htFormData
          Variables for the lifetime of the execute().
protected  IRepostModel m_model
          JF- Associated Model
protected  int m_nAction
          JF- Value of the repost action
protected  int m_nPageStatus
          JF- Server side validation.
protected  Redirect m_rRedirect
          JF- Redirect object.
static int PAGE_STATUS_INVALID
          JF- Page status: Invalid
static int PAGE_STATUS_VALID
          JF- Page status: Valid
static int POSTTOSELF_ACTION_APPLY_CHANGES
          JF- Repost Action: Apply changes
static int POSTTOSELF_ACTION_CANCEL
          JF- Repost Action: Cancel
static int POSTTOSELF_ACTION_FINISH
          JF- Repost Action: Finish
static int POSTTOSELF_ACTION_GOTOPAGE
          JF- Repost Action: Change page
static int POSTTOSELF_ACTION_IN_PLACE_REFRESH
          RW- Repost Action: In place refresh
static int POSTTOSELF_ACTION_PASSTHRU
          JF- Repost Action: Pass thru
static int POSTTOSELF_ACTION_SIMPLEREPOST
          JF- Repost Action: Simple repost
static int POSTTOSELF_ACTION_UNDEFINED
          JF- Repost Action: Undefined
static java.lang.String STR_MVC_CLASS_NAME
          Object Name for AS
 
Constructor Summary
RepostControl()
           
 
Method Summary
 Redirect CheckActionSecurityAndExecute(XPHashtable arguments)
          This code is called by the AS Servlet each time there is a repost.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 java.lang.String GetName()
          Return the class name.
 int GetPageStatus()
          Returns the current page status.
 int GetRepostAction()
          Returns the current value of the repost action.
 void Init(IModel model, AActivitySpace space)
          Inits the class with the associated model and activity space.
protected  void PerformAction(int _nAction)
          Given the repost action mode, calls the associated method in the model.
protected  void PerformPassthruAction()
          Sets the Pass thru arguments from the pass thru control into m_htFormData.
protected  void SaveCurrentPage()
          Get the current page name and call the save method on the model.
 void SetPageStatus(int _nPageStatus)
          Sets a new page status.
protected  void SetRedirect(Redirect _rRedirect)
          Sets the redirect member variable.
protected  void SetRepostAction()
          Get the repost action mode from the form data hashtable and set it in the member variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STR_MVC_CLASS_NAME

public static final java.lang.String STR_MVC_CLASS_NAME
Object Name for AS

See Also:
Constant Field Values

HTMLINPUT_POSTTOSELF

public static final java.lang.String HTMLINPUT_POSTTOSELF
Form element names

See Also:
Constant Field Values

HTMLSUBMIT_508_POSTTOSELF

public static final java.lang.String HTMLSUBMIT_508_POSTTOSELF
HTML Element: 508 submit button

See Also:
Constant Field Values

HTMLINPUT_PASSTHRU_CONTROL

public static final java.lang.String HTMLINPUT_PASSTHRU_CONTROL
The pass thru inputs need to be manually added in 508 mode if they are needed.

See Also:
Constant Field Values

HTMLINPUT_PASSTHRU_ARGS

public static final java.lang.String HTMLINPUT_PASSTHRU_ARGS
HTML Element: Pass thru arguments

See Also:
Constant Field Values

POSTTOSELF_ACTION_UNDEFINED

public static final int POSTTOSELF_ACTION_UNDEFINED
JF- Repost Action: Undefined

See Also:
Constant Field Values

POSTTOSELF_ACTION_IN_PLACE_REFRESH

public static final int POSTTOSELF_ACTION_IN_PLACE_REFRESH
RW- Repost Action: In place refresh

See Also:
Constant Field Values

POSTTOSELF_ACTION_SIMPLEREPOST

public static final int POSTTOSELF_ACTION_SIMPLEREPOST
JF- Repost Action: Simple repost

See Also:
Constant Field Values

POSTTOSELF_ACTION_FINISH

public static final int POSTTOSELF_ACTION_FINISH
JF- Repost Action: Finish

See Also:
Constant Field Values

POSTTOSELF_ACTION_CANCEL

public static final int POSTTOSELF_ACTION_CANCEL
JF- Repost Action: Cancel

See Also:
Constant Field Values

POSTTOSELF_ACTION_GOTOPAGE

public static final int POSTTOSELF_ACTION_GOTOPAGE
JF- Repost Action: Change page

See Also:
Constant Field Values

POSTTOSELF_ACTION_APPLY_CHANGES

public static final int POSTTOSELF_ACTION_APPLY_CHANGES
JF- Repost Action: Apply changes

See Also:
Constant Field Values

POSTTOSELF_ACTION_PASSTHRU

public static final int POSTTOSELF_ACTION_PASSTHRU
JF- Repost Action: Pass thru

See Also:
Constant Field Values

PAGE_STATUS_VALID

public static final int PAGE_STATUS_VALID
JF- Page status: Valid

See Also:
Constant Field Values

PAGE_STATUS_INVALID

public static final int PAGE_STATUS_INVALID
JF- Page status: Invalid

See Also:
Constant Field Values

m_asOwner

protected AActivitySpace m_asOwner
JF- Associated Activity Space.


m_model

protected IRepostModel m_model
JF- Associated Model


m_rRedirect

protected Redirect m_rRedirect
JF- Redirect object. Used to redirect at the end of the Form.


m_htFormData

protected XPHashtable m_htFormData
Variables for the lifetime of the execute(). Just for convenience. (Contains all the form params from the request.)


m_bInitialized

protected boolean m_bInitialized
has Init() been called properly?


m_nAction

protected int m_nAction
JF- Value of the repost action


m_nPageStatus

protected int m_nPageStatus
JF- Server side validation. Current state. ***Note that if the state is set to invalid, all it does is it will not perform the changePage and finish actions. ***Also note that this framework does not provide any way to set the error/status message to display to the end user. Another framework is responsible for it. ***Finaly note that multiple save methods might return invalid on the same DP but we don't want to keep an array of status returned, we just need to know if invalid was returned at least once.

Constructor Detail

RepostControl

public RepostControl()
Method Detail

CheckActionSecurityAndExecute

public Redirect CheckActionSecurityAndExecute(XPHashtable arguments)
This code is called by the AS Servlet each time there is a repost. First it saves the page and then performs any repost action. If the Redirect object returned is not null, the Servlet will go to the page specified by the Redirect. If the Redirect is null, the Servlet will get the current page from the AS and display it.

Specified by:
CheckActionSecurityAndExecute in interface IControl
Returns:
Redirect

Create

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

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

GetName

public java.lang.String GetName()
Return the class name.

Specified by:
GetName in interface IMVCObject
Returns:
String

GetPageStatus

public int GetPageStatus()
Returns the current page status.

Returns:
int

GetRepostAction

public int GetRepostAction()
Returns the current value of the repost action.

Returns:
int

Init

public void Init(IModel model,
                 AActivitySpace space)
Inits the class with the associated model and activity space. If this method is overridden in a sub-class, this version of Init must be called as super.Init();

Specified by:
Init in interface IControl
Parameters:
model -
space -

SetPageStatus

public void SetPageStatus(int _nPageStatus)
Sets a new page status.

Parameters:
_nPageStatus -

PerformAction

protected void PerformAction(int _nAction)
Given the repost action mode, calls the associated method in the model.

Parameters:
_nAction -

PerformPassthruAction

protected void PerformPassthruAction()
Sets the Pass thru arguments from the pass thru control into m_htFormData. And executes the Pass thru control.


SaveCurrentPage

protected void SaveCurrentPage()
Get the current page name and call the save method on the model.


SetRedirect

protected void SetRedirect(Redirect _rRedirect)
Sets the redirect member variable. (Used to redirect at the end of the Editor.)

Parameters:
_rRedirect -

SetRepostAction

protected void SetRepostAction()
Get the repost action mode from the form data hashtable and set it in the member variable.




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