public class FormUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FORMDATA_CONTAINER |
static String |
DEFAULT_FORMDATA_TYPE |
static String |
DEFAULT_STORED_FORMS_LOCATION |
static String |
DEFAULT_UUID_NAME |
static String |
HST_CREATIONTIME |
static String |
HST_FORM_DATA_NODE |
static String |
HST_FORM_FIELD_DATA |
static String |
HST_FORM_FIELD_MESSAGES |
static String |
HST_FORM_FIELD_NAME |
static String |
HST_PREDECESSOR |
static String |
HST_SEALED |
Constructor and Description |
---|
FormUtils() |
Modifier and Type | Method and Description |
---|---|
static FormMap |
getFormMap(javax.servlet.http.HttpServletRequest request)
Returns a populated FormaMap for some form data node if that node can be found with the u_u_i_d parameter
on the
request . |
static javax.jcr.Session |
getWritableSession() |
static void |
persistFormMap(HstRequest request,
HstResponse response,
FormMap formMap,
StoreFormResult storeFormResult)
Facility to temporarily store submitted form data which needs to be accessed in the rendering phase again.
|
static void |
populate(HstRequest request,
FormMap formMap)
This method tries to repopulate an earlier posted form that was stored in the repository.
|
static void |
populate(javax.servlet.http.HttpServletRequest request,
FormMap formMap)
This method tries to repopulate an earlier posted form that was stored in the repository.
|
static void |
validateId(String uuid)
Validates an uuid.
|
public static final String DEFAULT_UUID_NAME
public static final String DEFAULT_STORED_FORMS_LOCATION
public static final String DEFAULT_FORMDATA_CONTAINER
public static final String DEFAULT_FORMDATA_TYPE
public static final String HST_CREATIONTIME
public static final String HST_PREDECESSOR
public static final String HST_FORM_DATA_NODE
public static final String HST_FORM_FIELD_DATA
public static final String HST_FORM_FIELD_MESSAGES
public static final String HST_FORM_FIELD_NAME
public static final String HST_SEALED
public static FormMap getFormMap(javax.servlet.http.HttpServletRequest request)
request
. If no such form data node can be found, an empty FormMap
will be returnedrequest
- the HttpServletRequest
FormMap
for the formdata node belonging to the UUID from request parameter u_u_i_d
If there is no formdata for the UUID or no u_u_i_d parameter, just an empty FormMap
object will be returned#populate(javax.servlet.http.HttpServletRequest, FormMap)}
public static void populate(javax.servlet.http.HttpServletRequest request, FormMap formMap)
request
- the HttpServletRequest
formMap
- a not yet populated FormMap object (just new FormMap())public static void populate(HstRequest request, FormMap formMap)
request
- the current hstRequestformMap
- the formMap that will be populatedrather use {@link #populate(javax.servlet.http.HttpServletRequest, FormMap)} instead
of this method
public static void persistFormMap(HstRequest request, HstResponse response, FormMap formMap, StoreFormResult storeFormResult) throws HstComponentException
request
- the requestresponse
- the responseformMap
- the form names + values to temporarily storestoreFormResult
- an object to store some result of the data persisting, for example the uuid of the created nodeHstComponentException
- when the storing of the formdata failspublic static void validateId(String uuid) throws IllegalArgumentException
uuid
- uuid to validateIllegalArgumentException
- thrown on invalid uuidpublic static javax.jcr.Session getWritableSession() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
Copyright © 2008-2013 Hippo B.V. (http://www.onehippo.com). All Rights Reserved.