com.plumtree.uiinfrastructure.form
Class AFormDP

java.lang.Object
  extended by com.plumtree.uiinfrastructure.form.AFormDP
All Implemented Interfaces:
IDisplayPage, IMVCObject
Direct Known Subclasses:
ABOPopupSelectDP, AssociatedObjectsPopupDP, AuthSourceReenableUsersConfirmPopupDP, AuthSourceReenableUsersPopupDP, AYSPopupBodyFrameDP, AYSPopupBottomFrameDP, AYSPopupTopFrameDP, CodePopUpDP, CommunityInvitationDP_D, CreateFolderDP, CreateInvCodeDP, DefaultPageNamePopUpDP, DirCardPropertiesDP, DirCardSubmitDependenciesDP, DirCardSubmitSimpleDP, DirDeleteWarningsDP, DisplayInPortletDP, EditDefaultProfileTopDP, EditorDP, EditWebLinkDP, GroupDynamicMembersPreviewPopupDP, InheritTemplateDP, InvitePortletJSDP, JobLogDisplayDP, LocNamesPopUpDP, MigrationResultPopupDP, MigrationStatusPopupDP, MyPortalPartialPortletsDP, NewLinkPopUpDP, ObjDependenciesDP, ObjPropBrowseDP, PlumtreeDP, PortletInvitationJoinDP, PreviewCommPortletListDP, PreviewCommunityBarDP, PreviewPortletDP, RelatedResourcesMorePopupDP, RulesDebugMSGDP, SaveObjectBottomFrameDP, SaveObjectCantChangeFolderDP, SaveObjectRecentFoldersDP, SaveObjectTopFrameDP, SaveSearch508DP, SaveSearchPopupDP, SendDocPopUpDP, SendInvitationDP, SiteMapCreateWebLinkDP, TreeDP, TreeHeaderDP, TreeWithSearchDP, VarPackContentDP

public abstract class AFormDP
extends java.lang.Object
implements IDisplayPage

All AActivitySpaces that contain IDisplayPages that extend AFormDP must also implement IRepostAS. The exception to this rule is that PlumtreeDP extends AFormDP, but by default does not include the form code. Therefore, when you are using PlumtreeDP, you only need to implement IRepostAS if you have called SetAddMainForm(true);

Author:
Don Hayler

Field Summary
static java.lang.String GET
           
static java.lang.String HTMLFORM_NAME
          The name of the main form (for use in Javascript, etc...)
static java.lang.String JAVASCRIPT_SETUP_FOR_SUBMIT_TO_CONTROL
          Name of helper javascript function to set up for postToPassthru function
static java.lang.String JAVASCRIPT_SUBMIT_FORM
          The name of the main form javascript submission function
static java.lang.String JAVASCRIPT_SUBMIT_TO_CONTROL
          Name of helper javascript function to post the form, then pass through to another control
protected  AActivitySpace m_asOwner
          The parent activity space.
static java.lang.String MULTIPART_ENCODING
          multi-part form data encoding constant
static java.lang.String POST
          Form submission types
 
Constructor Summary
AFormDP()
           
 
Method Summary
 void AddToValidationFunction(java.lang.String functionName)
          This is a helper method that adds a function to the client side page validation.
 void Display(IWebData pageData)
          Construct the HTMLPage for Display.
 HTMLForm DisplayForm()
          This is a helper method that adds the main form to the page.
 HTMLElementCollection DisplayHTMLAfterForm()
          This is a method that classes extending this one can over write.
 HTMLElementCollection DisplayHTMLBeforeForm()
          This is a method that classes extending this one can over write.
 HTMLElementCollection DisplayHTMLinHEAD()
          This is a method that classes extending this one can over write.
 HTMLScriptCollection DisplayJavascript()
          This is a helper method that displays the javascript in the page.
protected  HTMLScriptCollection DisplayJavaScriptFromChild()
          This is a helper method that all classes that inherit from AFormDP can override if they like.
 ASURL Get508RepostURL(int nRepostAction)
          Method Get508RepostURL.
 boolean GetCloseOnCancel()
          This is a helper method that determines whether or not cancels should close the window immediately.
 FormPageTypes GetFormPageType()
          This method returns the current page type.
abstract  java.lang.String GetFormTitle()
          This is a helper method that all classes that inherit from AFormDP need to implement.
abstract  java.lang.String GetName()
          Return the name of the MVC object.
 java.lang.String GetOnLoad()
          This is a method that classes extending this one can overwrite to set an onload handler for the page.
 AActivitySpace GetOwner()
          Return the owning Activity Space.
protected  java.lang.String GetRepostControlName()
          This method is provided so that the repost control name can be overridden on a per DP basis.
protected  boolean GetRepostTypeIsPost()
          Override this method to set the form submission type.
 boolean GetStatusViewEnabled()
          This method returns whether the status view is enabled.
 int[] GetStatusViewRepostValues()
          This method returns the repost values that we will turn the status view on for.
 boolean GetUseJavascript()
           
 boolean GetWindowFocusEnabled()
           
 void Init(AActivitySpace parent)
          Initialize the Display Page.
 void InsertJavascriptBeforeFormSubmit(XPStringBuilder sb)
          Helper method to insert custom javascript in the form submit method right before the form is submitted.
abstract  HTMLElement PageDisplay()
          This is a helper method that all classes that inherit from AFormDP need to implement.
 HTMLElement PartialContentDisplay()
          This is a helper method that all classes that inherit from AFormDP can override.
 void RemoveFromValidationFunction(java.lang.String functionName)
          This is a helper method that removes a function from the client side page validation.
 void SetMultiPartEncoding(boolean bMultiPart)
          This method sets whether or not the form should use multipart encoding.
 void SetShow508FormFooter(boolean bShow508Footer)
          This method sets whether or not the form should display the done and cancel buttons at the bottom of the page in 508 mode.
 void SetStatusViewEnabled(boolean bEnabled)
          This method sets whether the status view is enabled.
 void SetStatusViewRepostValues(int[] aRepostValues)
          This method sets the repost values that we will turn the status view on for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTMLFORM_NAME

public static final java.lang.String HTMLFORM_NAME
The name of the main form (for use in Javascript, etc...)

See Also:
Constant Field Values

JAVASCRIPT_SUBMIT_FORM

public static final java.lang.String JAVASCRIPT_SUBMIT_FORM
The name of the main form javascript submission function

See Also:
Constant Field Values

JAVASCRIPT_SETUP_FOR_SUBMIT_TO_CONTROL

public static final java.lang.String JAVASCRIPT_SETUP_FOR_SUBMIT_TO_CONTROL
Name of helper javascript function to set up for postToPassthru function

See Also:
Constant Field Values

JAVASCRIPT_SUBMIT_TO_CONTROL

public static final java.lang.String JAVASCRIPT_SUBMIT_TO_CONTROL
Name of helper javascript function to post the form, then pass through to another control

See Also:
Constant Field Values

MULTIPART_ENCODING

public static final java.lang.String MULTIPART_ENCODING
multi-part form data encoding constant

See Also:
Constant Field Values

POST

public static final java.lang.String POST
Form submission types

See Also:
Constant Field Values

GET

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

m_asOwner

protected AActivitySpace m_asOwner
The parent activity space. Warning: EditorDP overrides this to provide an editor specific version, so GetOwner() must be used in this class file.

Constructor Detail

AFormDP

public AFormDP()
Method Detail

AddToValidationFunction

public final void AddToValidationFunction(java.lang.String functionName)
This is a helper method that adds a function to the client side page validation. If this is not called, then a blank default validation function will be used. AddValidationFunction() should be called when the DisplayPage is first being constructed in the Activity Space. It should not be called each time the page is being displayed. The function name should be just the name of the function without parentheses or semicolons. I.E. myValidateFunction, which will be called by AFormDP as myValidateFunction(). These functions should return true if the page is valid, or display an error message and return false if the page is invalid.

Parameters:
String - the name of the Javascript function to call for validation

RemoveFromValidationFunction

public final void RemoveFromValidationFunction(java.lang.String functionName)
This is a helper method that removes a function from the client side page validation. The function name should be just the name of the function without parentheses or semicolons. I.E. myValidateFunction, which will be called by AFormDP as myValidateFunction().

Parameters:
String - the name of the Javascript function to remove from the list of functions to call for validation

SetMultiPartEncoding

public final void SetMultiPartEncoding(boolean bMultiPart)
This method sets whether or not the form should use multipart encoding.

Parameters:
boolean - true implies multipart encoding in the form.

SetShow508FormFooter

public final void SetShow508FormFooter(boolean bShow508Footer)
This method sets whether or not the form should display the done and cancel buttons at the bottom of the page in 508 mode. This variable is ignored in normal mode. It is only valid in 508 and low bandwidth modes. This is for developers who provide their own buttons in standard mode, but want to use the AFormDP buttons in 508 mode (such as the editor).

Parameters:
boolean - true implies buttons in footer, no header is displayed (in 508 mode).

GetFormPageType

public FormPageTypes GetFormPageType()
This method returns the current page type. Override this method to display a different page type (small pop-up, etc...) This gets called at Init() time. Default has no buttons on the form.

Returns:
FormPageTypes the type of the page to display

DisplayHTMLBeforeForm

public HTMLElementCollection DisplayHTMLBeforeForm()
This is a method that classes extending this one can over write. The HTML returned by that method will get printed out before the FORM tag and AFTER the BODY tag. E.g.: DIV tags should go in that method. Override this method to display HTML after the body and before the form.

Returns:
HTMLElement

DisplayHTMLAfterForm

public HTMLElementCollection DisplayHTMLAfterForm()
This is a method that classes extending this one can over write. The HTML returned by that method will get printed out after the FORM tag E. g.: If you have other forms, like with portlets. Override this method to display HTML after the form.

Returns:
HTMLElement

GetStatusViewRepostValues

public int[] GetStatusViewRepostValues()
This method returns the repost values that we will turn the status view on for. The status view replaces the body of the existing view. Be default, AFormDP is initialized to show the status view only after a FINISH repost.

Returns:
Repost values for which you want the status view on.

SetStatusViewRepostValues

public void SetStatusViewRepostValues(int[] aRepostValues)
This method sets the repost values that we will turn the status view on for. The status view replaces the body of the existing view. Be default, AFormDP is initialized to show the status view only after a FINISH repost. Set this to NULL to allow all values to display the view.

Parameters:
aRepostValues - Values for which you want the status view on.

GetStatusViewEnabled

public boolean GetStatusViewEnabled()
This method returns whether the status view is enabled.

Returns:
True if the status view is enabled, false otherwise.

SetStatusViewEnabled

public void SetStatusViewEnabled(boolean bEnabled)
This method sets whether the status view is enabled.

Parameters:
bEnabled - True to enable the status view, false otherwise.

DisplayHTMLinHEAD

public HTMLElementCollection DisplayHTMLinHEAD()
This is a method that classes extending this one can over write. The HTML returned by that method will get printed out in the head. Warning: Only TITLE LINK and META can be added to the head with that method (use DisplayJavaScriptFromChild for SCRIPT) Override this method to display HTML in the head.

Returns:
HTMLElement

GetOnLoad

public java.lang.String GetOnLoad()
This is a method that classes extending this one can overwrite to set an onload handler for the page.


GetCloseOnCancel

public boolean GetCloseOnCancel()
This is a helper method that determines whether or not cancels should close the window immediately. This is useful in the case of pop up windows, where you don't need to know anything unless the user presses finish. In this case, cancel should just call window.close(); Override this method to immediately close the pop ups.

Returns:
boolean true implies close the window immediately on cancel

GetFormTitle

public abstract java.lang.String GetFormTitle()
This is a helper method that all classes that inherit from AFormDP need to implement. The method should return the title that should be displayed in the window TITLE element as well as on the form header bar, if displayed. The String returned by this method needs to already be HTML Encoded for safe display.

Returns:
String the HTML Encoded title for the form header

GetName

public abstract java.lang.String GetName()
Description copied from interface: IMVCObject
Return the name of the MVC object.

Specified by:
GetName in interface IMVCObject
Returns:
the name of the object.
See Also:
IMVCObject.GetName()

PageDisplay

public abstract HTMLElement PageDisplay()
This is a helper method that all classes that inherit from AFormDP need to implement. The method should add whatever HTML the child class wants to display to the body argument. The parent class will then add that HTML to the HTMLPage after filling in the banner and navigation.

Returns:
HTMLElement the HTML to put inside the form

Display

public void Display(IWebData pageData)
Description copied from interface: IDisplayPage
Construct the HTMLPage for Display.

Specified by:
Display in interface IDisplayPage
See Also:
Warning: PlumtreeDP overrides this, so if you change things here, you probably need to change it there as well.

DisplayJavascript

public final HTMLScriptCollection DisplayJavascript()
This is a helper method that displays the javascript in the page. SetValidationFunction() and AddJavascript() should be called before this method.

Returns:
HTMLScriptCollection the Javascript for this DisplayPage (child javascript excluded)

GetWindowFocusEnabled

public boolean GetWindowFocusEnabled()
Returns:
if true, DisplayJavascript will inject a window.focus into the AFormDP javascript

InsertJavascriptBeforeFormSubmit

public void InsertJavascriptBeforeFormSubmit(XPStringBuilder sb)
Helper method to insert custom javascript in the form submit method right before the form is submitted. javascript should have 4 spaces indenting each line to make it line up with the code it is being inserted into.

Parameters:
sb - StringBuilder to add your custom javascript to.

DisplayForm

public HTMLForm DisplayForm()
This is a helper method that adds the main form to the page. It also calls PageDisplay, so AddForm and PageDisplay should not be used in the same page.

Returns:
HTMLForm the HTML for the main form

Get508RepostURL

public ASURL Get508RepostURL(int nRepostAction)
Method Get508RepostURL.

Parameters:
nRepostAction -
Returns:
ASURL

GetOwner

public AActivitySpace GetOwner()
Description copied from interface: IDisplayPage
Return the owning Activity Space.

Specified by:
GetOwner in interface IDisplayPage
See Also:
IDisplayPage.GetOwner()

Init

public void Init(AActivitySpace parent)
Description copied from interface: IDisplayPage
Initialize the Display Page.

Specified by:
Init in interface IDisplayPage
See Also:
IDisplayPage.Init(AActivitySpace)

DisplayJavaScriptFromChild

protected HTMLScriptCollection DisplayJavaScriptFromChild()
This is a helper method that all classes that inherit from AFormDP can override if they like. The method provides a hook into the head so that DP's can add javascript. Simply override and return and HTMLScript. Also, it is best to return the results of the DisplayJavaScript functions from the appropriate views. Override this method to Display javascript from child IViews

Returns:
HTMLScriptCollection the Javascript from the Child IViews

GetRepostControlName

protected java.lang.String GetRepostControlName()
This method is provided so that the repost control name can be overridden on a per DP basis.

Returns:
String the name of the repost control to use

GetRepostTypeIsPost

protected boolean GetRepostTypeIsPost()
Override this method to set the form submission type.

Returns:
boolean true implies POST, false implies GET

GetUseJavascript

public boolean GetUseJavascript()

PartialContentDisplay

public HTMLElement PartialContentDisplay()
This is a helper method that all classes that inherit from AFormDP can override. When displaying in place refresh content, this method is called instead of PageDisplay. In place refresh can be enabled via setting a flag in the activity space.

Returns:
String Partial page content to be displayed.



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