Login | Register
My pages Projects Community openCollabNet
CyberWebForm 2.0

cyber.web.form
Class FormUtil

java.lang.Object
  |
  +--cyber.web.form.FormUtil

public class FormUtil
extends Object

This class is used internally throughout the entire architecture. The main purpose is to generate HTML code. If there is possibility of porting to other browser, one will want to modify code in here.

Author:
cy.ing

Inner Class Summary
static class FormUtil.ActionDefRec
           
static class FormUtil.CtrlViewIdRec
          CtrlViewId is an identifier for a control in an HTML form that uniquely identifies 1. the form the control belongs 2. the attribute (CompositeControl) the control associates 3. the control (representation) type
 
Field Summary
static String FA_ACTION_DEFINITION_PREFIX
           
static String FA_FWSCRIPT
           
static String FA_SCROLL_LEFT
           
static String FA_SCROLL_TOP
           
static String FA_SELECTED_ACTION
           
static String FA_SELECTED_FORM_GUID
           
static String FA_SELECTED_FORM_MANAGER_STR
           
static String FA_SELECTED_LINK
           
static String FA_SERVLET_PATH
           
static String FA_SOURCE_PAGE
           
static String FORM_NAME
           
static String OBJECT_MODEL_INSTANCE_NAME
           
 
Constructor Summary
FormUtil(WebFormTransaction tr)
           
 
Method Summary
static String addPathElement(String path, String name)
           
 void attachFormManager(FormModelManager manager1)
          Called by external party to link with FormModelManager
 void attachPageContext(PageContext pageContext1)
          Called by FormTag to attach the page context.
 void attachRequestResponse(HttpServletRequest request1, HttpServletResponse response1)
          Called by WebFormLogicServlet to attach the request and response object.
 void attachToTransaction(WebFormTransaction tr)
           
static boolean doBasicValidation(String elementName, XFormEvent evt)
           
static void doForward(FormModelManager manager1, HttpServletRequest req, HttpServletResponse res)
           
static String generateCtrlViewId(CompositeControl ctrl, String ctrlType, String extraInfo)
          Generates a CtrlViewId For more information about the characteristic of such identifier, see CtrlViewIdRec inner class.
 void generateFormName()
          Called by the outermost FormTag to generate the HTML form name.
static void generateFormTemplate(FormDef fdef, PrintWriter pw, WebFormTransaction tr)
           
static String generateXformViewId(XForm xfm, String extraInfo)
           
 String getFormName()
           
 JspWriter getOut()
           
static FormUtil getTransactionInstance(WebFormTransaction tr)
           
static boolean isParameterOfWebformControl(String name)
           
static String makePath(String base, String file)
           
static FormUtil.CtrlViewIdRec parseCtrlViewId(String id)
          Parse the CtrlViewId.
static cyber.web.form.FormUtil.XformIdRec parseXformViewId(String id)
           
 void printActionDefinition(FormUtil.ActionDefRec adrec)
          Called by ForwardSetTag to print action definition (3 hidden input fields)
 void printForm()
          Called by the outermost FormTag to print the initial form.
 void printFormClosed()
          Called by the outermost FormTag to print the form close tag.
 void printForwardLinkAnchor(FormUtil.ActionDefRec adrec)
          Called by ForwardSetTag to print anchor foward tag
static void printRuntimeError(PageContext pageContext, Throwable err, String location)
           
 void printXForm()
          Called by the outermost FormTag to print the initial form.
 void processForwardLogic()
          Called by WebFormLogicServlet to process the web form forward logic.
 void removeFromTransaction(WebFormTransaction tr)
           
static String removeLastPathElement(String path)
           
 void setFormName(String name)
           
 void XattachFormManager(XFormManager xmanager1)
           
static void XdoForward(XFormManager manager1, HttpServletRequest req, HttpServletResponse res)
           
static boolean XisParameterOfWebformControl(String name)
           
 void XprocessForwardLogic()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_MODEL_INSTANCE_NAME

public static String OBJECT_MODEL_INSTANCE_NAME

FORM_NAME

public static final String FORM_NAME

FA_SOURCE_PAGE

public static final String FA_SOURCE_PAGE

FA_SERVLET_PATH

public static final String FA_SERVLET_PATH

FA_SELECTED_LINK

public static final String FA_SELECTED_LINK

FA_SELECTED_ACTION

public static final String FA_SELECTED_ACTION

FA_SELECTED_FORM_GUID

public static final String FA_SELECTED_FORM_GUID

FA_SELECTED_FORM_MANAGER_STR

public static final String FA_SELECTED_FORM_MANAGER_STR

FA_ACTION_DEFINITION_PREFIX

public static final String FA_ACTION_DEFINITION_PREFIX

FA_FWSCRIPT

public static final String FA_FWSCRIPT

FA_SCROLL_LEFT

public static final String FA_SCROLL_LEFT

FA_SCROLL_TOP

public static final String FA_SCROLL_TOP
Constructor Detail

FormUtil

public FormUtil(WebFormTransaction tr)
Method Detail

printActionDefinition

public void printActionDefinition(FormUtil.ActionDefRec adrec)
                           throws IOException
Called by ForwardSetTag to print action definition (3 hidden input fields)
Parameters:
action -  
link -  
formGuid -  
Throws:
IOException -  

printForwardLinkAnchor

public void printForwardLinkAnchor(FormUtil.ActionDefRec adrec)
                            throws IOException
Called by ForwardSetTag to print anchor foward tag
Parameters:
action -  
link -  
formGuid -  
Throws:
IOException -  

attachPageContext

public void attachPageContext(PageContext pageContext1)
Called by FormTag to attach the page context.
Parameters:
pageContext1 -  

generateFormName

public void generateFormName()
Called by the outermost FormTag to generate the HTML form name. The generation is based on random number in order to avoid conflict in the same page.

setFormName

public void setFormName(String name)

getFormName

public String getFormName()

printForm

public void printForm()
               throws IOException
Called by the outermost FormTag to print the initial form.
Throws:
IOException -  

printXForm

public void printXForm()
                throws IOException
Called by the outermost FormTag to print the initial form.
Throws:
IOException -  

printFormClosed

public void printFormClosed()
                     throws IOException
Called by the outermost FormTag to print the form close tag.
Throws:
IOException -  

attachFormManager

public void attachFormManager(FormModelManager manager1)
Called by external party to link with FormModelManager

XattachFormManager

public void XattachFormManager(XFormManager xmanager1)

attachRequestResponse

public void attachRequestResponse(HttpServletRequest request1,
                                  HttpServletResponse response1)
Called by WebFormLogicServlet to attach the request and response object.
Parameters:
request1 -  

processForwardLogic

public void processForwardLogic()
                         throws IOException
Called by WebFormLogicServlet to process the web form forward logic.

XprocessForwardLogic

public void XprocessForwardLogic()
                          throws IOException

doForward

public static void doForward(FormModelManager manager1,
                             HttpServletRequest req,
                             HttpServletResponse res)
                      throws IOException

XdoForward

public static void XdoForward(XFormManager manager1,
                              HttpServletRequest req,
                              HttpServletResponse res)
                       throws IOException

isParameterOfWebformControl

public static boolean isParameterOfWebformControl(String name)

XisParameterOfWebformControl

public static boolean XisParameterOfWebformControl(String name)

parseCtrlViewId

public static FormUtil.CtrlViewIdRec parseCtrlViewId(String id)
Parse the CtrlViewId. For more information about the characteristic of such identifier, see CtrlViewIdRec inner class.
Parameters:
id -  
Returns:
 
See Also:
FormUtil.CtrlViewIdRec

generateCtrlViewId

public static String generateCtrlViewId(CompositeControl ctrl,
                                        String ctrlType,
                                        String extraInfo)
Generates a CtrlViewId For more information about the characteristic of such identifier, see CtrlViewIdRec inner class.
Parameters:
ctrl -  
ctrlType -  
Returns:
 
See Also:
FormUtil.CtrlViewIdRec

generateXformViewId

public static String generateXformViewId(XForm xfm,
                                         String extraInfo)

parseXformViewId

public static cyber.web.form.FormUtil.XformIdRec parseXformViewId(String id)

printRuntimeError

public static void printRuntimeError(PageContext pageContext,
                                     Throwable err,
                                     String location)
Parameters:
pageContext -  
err -  

addPathElement

public static String addPathElement(String path,
                                    String name)

removeLastPathElement

public static String removeLastPathElement(String path)

generateFormTemplate

public static void generateFormTemplate(FormDef fdef,
                                        PrintWriter pw,
                                        WebFormTransaction tr)

doBasicValidation

public static boolean doBasicValidation(String elementName,
                                        XFormEvent evt)

getOut

public JspWriter getOut()
Returns:
 

makePath

public static String makePath(String base,
                              String file)

attachToTransaction

public void attachToTransaction(WebFormTransaction tr)

removeFromTransaction

public void removeFromTransaction(WebFormTransaction tr)

getTransactionInstance

public static FormUtil getTransactionInstance(WebFormTransaction tr)

CyberWebForm 2.0

Copyright 2000-2002 Apache Software Foundation.