planetj.html
Class HTMLExtractor

java.lang.Object
  extended byplanetj.html.HTMLExtractor

public class HTMLExtractor
extends java.lang.Object

This class is used for extracting HTML data into Rows. It may also be used for retrieving selected Rows out of the HttpSession in the HttpServletRequest.

Author:
PlanetJ Corporation

Field Summary
static byte ARRAY_LIST
           
static java.lang.String EXTRACTABLE_AUTO_ALL
           
static java.lang.String EXTRACTABLE_AUTO_CHOOSE
           
static java.lang.String EXTRACTABLE_AUTO_NEXT
           
static java.lang.String EXTRACTABLE_AUTO_PREVIOUS
           
static java.lang.String EXTRACTABLE_FIELD
           
static java.lang.String EXTRACTABLE_RC_FIELD
           
static java.lang.String EXTRACTABLE_RC_PREFIX
           
static java.lang.String EXTRACTABLE_ROW_FIELD
           
static java.lang.String EXTRACTABLE_ROW_PREFIX
           
static byte ROW_COLLECTION
           
static java.lang.String TRANSIENT
           
static java.util.List VALUES_TO_IGNORE
           
 
Constructor Summary
HTMLExtractor()
           
 
Method Summary
static boolean extractAndValidateTableData(RowCollection rc, HttpServletRequest request)
          Extracts information off the HttpServletRequest out of a table and puts it in the given RowCollection's Rows.
static void extractData(INavigationObject object, HttpServletRequest req)
          Extracts data from the HttpServletRequest and puts it into the object
static Row extractDataIntoRow(Row row, HttpServletRequest request)
          Extracts information off the HttpServletRequest and puts its in the given Row.
static Row extractDataIntoRow(java.lang.String rowNavKey, Row row, HttpServletRequest request)
          Extracts information off the HttpServletRequest and puts it in the given Row.
static void extractTableData(RowCollection rc, HttpServletRequest request)
          Extracts information off the HttpServletRequest out of a table and puts it in the given RowCollection's Rows.
static void extractTableData(java.lang.String rcKey, RowCollection rc, HttpServletRequest request)
          Extracts information off the HttpServletRequest out of a table and puts it in the given RowCollection's Rows.
static Row extractTableDataIntoRow(java.lang.String rcNavKey, java.lang.String rowNavKey, Row row, HttpServletRequest request)
          Extracts information off the HttpServletRequest out of a table and puts it in the given Row.
static Row getSelectedRow(java.lang.String rcSessionId, HttpServletRequest request)
          Retrieves the selected Row from the HttpServletRequest.
static java.util.List getSelectedRows(RowCollection rc, byte returnType, HttpServletRequest request)
          Retrieves the selected Rows from the HttpServletRequest.
static java.util.List getSelectedRows(RowCollection rc, HttpServletRequest req)
          Get the selected Rows from the request.
static java.util.List getSelectedRows(java.lang.String rcSessionId, byte returnType, HttpServletRequest request)
          Retrieves the selected Rows from the HttpServletRequest.
static java.util.List getSelectedRows(java.lang.String rcSessionId, HttpServletRequest req)
          Retrieves the selected Rows from the HttpServletRequest.
static void loadGlobalAttributeValues(IContext context, HttpServletRequest request)
          Gets the values of all attributes out of the session and puts them in the context.
static void loadParameterValues(IContext context, HttpServletRequest request)
          Gets the values of all parameters out of the request and puts them in the context.
static void loadRequestAttributeValues(IContext context, HttpServletRequest request)
          Gets the values of all attributes out of the request and puts them in the context.
static void loadSessionAttributeValues(IContext context, HttpServletRequest request)
          Gets the values of all attributes out of the session and puts them in the context.
static void loadSQLTextReplacementValues(IContext context, HttpServletRequest request)
          Gets the values of all attributes out of the session and puts them in the context.
static void maintainSelection(RowCollection rc, HttpServletRequest req)
          Ensures the rows selections the user made will be maintained on the RC when it is rendered again on the next screen.
static void selectRow(Row row, RowCollection rc, HttpServletRequest req)
          Sets the row as a currently selected row.
static void selectRows(java.util.List rows, RowCollection rc, HttpServletRequest req)
          Adds the rows to the currently selected rows.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROW_COLLECTION

public static final byte ROW_COLLECTION
See Also:
Constant Field Values

ARRAY_LIST

public static final byte ARRAY_LIST
See Also:
Constant Field Values

TRANSIENT

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

EXTRACTABLE_FIELD

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

EXTRACTABLE_RC_FIELD

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

EXTRACTABLE_ROW_FIELD

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

EXTRACTABLE_ROW_PREFIX

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

EXTRACTABLE_RC_PREFIX

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

EXTRACTABLE_AUTO_CHOOSE

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

EXTRACTABLE_AUTO_ALL

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

EXTRACTABLE_AUTO_NEXT

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

EXTRACTABLE_AUTO_PREVIOUS

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

VALUES_TO_IGNORE

public static final java.util.List VALUES_TO_IGNORE
Constructor Detail

HTMLExtractor

public HTMLExtractor()
Method Detail

extractAndValidateTableData

public static boolean extractAndValidateTableData(RowCollection rc,
                                                  HttpServletRequest request)
                                           throws CMException
Extracts information off the HttpServletRequest out of a table and puts it in the given RowCollection's Rows. This method requires the RowCollection is already in navigation. (e.g. it already has a navigation key)

Parameters:
rc - RowCollection to extract data into
request - request from client.
Throws:
CMException

extractData

public static void extractData(INavigationObject object,
                               HttpServletRequest req)
                        throws CMException
Extracts data from the HttpServletRequest and puts it into the object

Throws:
CMException

extractDataIntoRow

public static Row extractDataIntoRow(java.lang.String rowNavKey,
                                     Row row,
                                     HttpServletRequest request)
                              throws CMException
Extracts information off the HttpServletRequest and puts it in the given Row.

Parameters:
row - Row to extract values into
request - HttpServletRequest containing values to extract
Returns:
Row
Throws:
CMException

extractDataIntoRow

public static Row extractDataIntoRow(Row row,
                                     HttpServletRequest request)
                              throws CMException
Extracts information off the HttpServletRequest and puts its in the given Row. This method requires the Row to already be in navigation. (e.g. it already has a navigation key)

Parameters:
row - Row to extract data into
request - request from the client
Throws:
CMException

extractTableData

public static void extractTableData(java.lang.String rcKey,
                                    RowCollection rc,
                                    HttpServletRequest request)
                             throws CMException
Extracts information off the HttpServletRequest out of a table and puts it in the given RowCollection's Rows. This method requires the RowCollection is already in navigation. (e.g. it already has a navigation key)

Parameters:
rcKey - Navigation key for the given RowCollection
rc - RowCollection to extract data into
request - request from client
Throws:
CMException

extractTableData

public static void extractTableData(RowCollection rc,
                                    HttpServletRequest request)
                             throws CMException
Extracts information off the HttpServletRequest out of a table and puts it in the given RowCollection's Rows. This method requires the RowCollection is already in navigation. (e.g. it already has a navigation key)

Parameters:
rc - RowCollection to extract data into
request - request from client.
Throws:
CMException

extractTableDataIntoRow

public static Row extractTableDataIntoRow(java.lang.String rcNavKey,
                                          java.lang.String rowNavKey,
                                          Row row,
                                          HttpServletRequest request)
                                   throws CMException
Extracts information off the HttpServletRequest out of a table and puts it in the given Row. A RowCollections index in the Session can be retrieved by asking the SessionManager what its index is.

Parameters:
row - Row to extract values into
request - HttpServletRequest containing values to extract.
Returns:
Row
Throws:
CMException

getSelectedRow

public static Row getSelectedRow(java.lang.String rcSessionId,
                                 HttpServletRequest request)
                          throws DataEngineException
Retrieves the selected Row from the HttpServletRequest. If more than one Row is selected in the RowCollection, then the first selected Row is returned.

Parameters:
request - HttpServletRequest to get selected Row
Returns:
Row
Throws:
DataEngineException

getSelectedRows

public static java.util.List getSelectedRows(java.lang.String rcSessionId,
                                             byte returnType,
                                             HttpServletRequest request)
                                      throws DataEngineException
Retrieves the selected Rows from the HttpServletRequest.

Parameters:
rcSessionId - The ID of the existing table in the session
returnType - Indicates whether the rows should be returned in an ArrayList or RowCollection. These options are defined as constants in the class.
Returns:
A newly created List of the specified type, containing only the rows in the original RowCollection which were selected
Throws:
DataEngineException

getSelectedRows

public static java.util.List getSelectedRows(RowCollection rc,
                                             byte returnType,
                                             HttpServletRequest request)
                                      throws DataEngineException
Retrieves the selected Rows from the HttpServletRequest.

Parameters:
returnType - Indicates whether the rows should be returned in an ArrayList or RowCollection. These options are defined as constants in the class.
Returns:
A newly created List of the specified type, containing only the rows in the original RowCollection which were selected
Throws:
DataEngineException

getSelectedRows

public static java.util.List getSelectedRows(java.lang.String rcSessionId,
                                             HttpServletRequest req)
                                      throws DataEngineException
Retrieves the selected Rows from the HttpServletRequest. The rows are returned in a brand new RowCollection.

Parameters:
req - The HttpServletRequest
Returns:
A newly created RowCollection containing only the rows in the original RowCollection which were selected
Throws:
DataEngineException

getSelectedRows

public static java.util.List getSelectedRows(RowCollection rc,
                                             HttpServletRequest req)
                                      throws DataEngineException
Get the selected Rows from the request.

Throws:
DataEngineException

loadParameterValues

public static void loadParameterValues(IContext context,
                                       HttpServletRequest request)
                                throws CMException
Gets the values of all parameters out of the request and puts them in the context.

Throws:
CMException

loadRequestAttributeValues

public static void loadRequestAttributeValues(IContext context,
                                              HttpServletRequest request)
                                       throws CMException
Gets the values of all attributes out of the request and puts them in the context.

Throws:
CMException

loadSessionAttributeValues

public static void loadSessionAttributeValues(IContext context,
                                              HttpServletRequest request)
                                       throws CMException
Gets the values of all attributes out of the session and puts them in the context.

Throws:
CMException

maintainSelection

public static void maintainSelection(RowCollection rc,
                                     HttpServletRequest req)
                              throws CMException
Ensures the rows selections the user made will be maintained on the RC when it is rendered again on the next screen.

Throws:
CMException

selectRow

public static void selectRow(Row row,
                             RowCollection rc,
                             HttpServletRequest req)
                      throws CMException
Sets the row as a currently selected row. This will only take effect as the RowCollection is rendered - it will not effect invocations of getSelectedRow() until the next request/repsonse cycle. This method will have no effect if the RowCollection is not rendered during this request/response cycle. Depending on the display properties a RowCollections may be rendered in a format which support multiple, single, or no selected rows.

Throws:
CMException

selectRows

public static void selectRows(java.util.List rows,
                              RowCollection rc,
                              HttpServletRequest req)
                       throws CMException
Adds the rows to the currently selected rows. This will only take effect as the RowCollection is rendered - it will not effect invocations of getSelectedRow() until the next request/repsonse cycle. This method will have no effect if the RowCollection is not rendered during this request/response cycle. Depending on the display properties a RowCollections may be rendered in a format which support multiple, single, or no selected rows.

Throws:
CMException

loadGlobalAttributeValues

public static void loadGlobalAttributeValues(IContext context,
                                             HttpServletRequest request)
                                      throws CMException
Gets the values of all attributes out of the session and puts them in the context.

Throws:
CMException

loadSQLTextReplacementValues

public static void loadSQLTextReplacementValues(IContext context,
                                                HttpServletRequest request)
                                         throws CMException
Gets the values of all attributes out of the session and puts them in the context.

Throws:
CMException