|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.wf.html.HTMLUtils
public class HTMLUtils
Some utility methods for building HTML GUIs
| Nested Class Summary | |
|---|---|
static class |
HTMLUtils.TooManyResultsException
Exception is thrown in case the total count of entries exceeds the configured maximum. |
| Field Summary | |
|---|---|
static int |
COMP_MODE
|
static int |
SAFE_MODE
|
static String |
SELECTLIST_LIST
|
static String |
SELECTLIST_TABLE
|
| Constructor Summary | |
|---|---|
HTMLUtils()
|
|
| Method Summary | ||
|---|---|---|
protected static String |
addPattern(String searchString)
adds % to the searchstring, based on the selectlist.search property (either infix, or prefix search) |
|
Page |
agentSelectList(HttpServletRequest req)
Deprecated. use selectUserOrRole(HttpServletRequest) |
|
static void |
editConditionParams(Map<String,String> params)
|
|
static String |
getDisplayValue(DMSForm form,
String field)
returns the given field's display value this can be: for dates: can be either a CalUtil.showDate(Object) or the CalUtil.showDateTime(Object) representation of the value
for selectlist-values: the localized display-value of the selectlist-option
for decimal fields: the formatted value using Settings.getDecimalFormatter() with the max. fraction and integer digits set as defined for the field
|
|
static Link |
getDocumentsLink(ActivityInstance si)
|
|
static Link |
getDocumentsLink(ActivityInstance si,
String comingFrom)
|
|
static List |
getFormLinkList(ActivityInstance ai,
int mode,
String comingFrom,
String target,
boolean buttonsInToolbar,
boolean withToolbar)
|
|
static String |
getFormLinks(ActivityInstance ai,
int mode,
String comingFrom,
String target)
|
|
static Link |
getNotesLink(ActivityInstance ai)
|
|
static
|
getObject(HttpServletRequest req)
This method returns a persistent object when the request contains a parameter "object" with a value in the form <classname>:<oid>. |
|
static
|
getObject(HttpServletRequest req,
String key)
|
|
static Persistent |
getObject(JSONObject obj)
|
|
static Persistent |
getObject(String obj)
Deprecated. since 8.0; use StoreUtil.getObject(Object) instead |
|
static
|
getObjectList(HttpServletRequest req,
String key)
Get list of objects (from multiple selection list) stored in request under key |
|
static List<Pair<String,String>> |
getObjectListForComponent(List<Persistent> l)
|
|
static List<Persistent> |
getObjects(Class c,
Map<String,String> params,
boolean isTable)
|
|
static Map<String,String> |
getParameters(HttpServletRequest req,
boolean avoidSqlInjection)
|
|
static Pair<String,List<Object>> |
getSearchCondition(Persistent o,
String searchAttrs,
String searchString)
builds a condition for querying the given Persistent uses the global setting for smartSearch |
|
static Pair<String,List<Object>> |
getSearchCondition(Persistent o,
String searchAttrs,
String searchString,
boolean smartSearch)
builds a condition querying the given Persistent
if smartSearch is true, the given searchString will be splitted, and searched in each searchAttr on it's own |
|
static Collection<Pair> |
getSelectList2(HttpServletRequest req)
|
|
static Collection<Pair> |
getSelectList2(Map<String,String> params)
|
|
static Pair |
getSelectListObject(Map<String,String> params)
Used for object selection UI control to retrieve the initial display value for the selected list item. |
|
static Pair |
getSelectObjectById(long oid,
Map<String,String> params)
|
|
static String |
getStandardSearchIdOfClass(Class<?> c)
|
|
static Page |
refreshWorklist(HttpServletRequest req,
Application appl)
Returns a page that redirects to the current worklist of this application |
|
Page |
roleList(HttpServletRequest request)
|
|
Page |
selectDocTemplates(HttpServletRequest req)
|
|
static Page |
selectList(HttpServletRequest req)
Shows a list of objects for selection in form of a selectlist |
|
static Page |
selectList(Map<String,String> params,
HttpServletRequest req)
|
|
static Page |
selectList2(HttpServletRequest req)
Shows a list of objects for selection in form of a selectlist |
|
static Page |
selectTable(HttpServletRequest req)
|
|
static Page |
selectUserOrRole(HttpServletRequest req)
|
|
static Page |
showEmptyForm(DMSForm f,
String buttons,
HttpServletRequest req)
Deprecated. |
|
static Page |
showForm(DMSForm form,
List<Component> buttons,
String action,
FormContext ctx)
Show a form. |
|
static Page |
showForm(HttpServletRequest req)
|
|
static Page |
showForm(HttpServletRequest r,
ActivityInstance ai,
String formid,
int mode)
Show a process form. |
|
static Page |
showForm(HttpServletRequest r,
ActivityInstance ai,
String formid,
int mode,
String buttons)
Deprecated. |
|
Page |
showPrintForm(HttpServletRequest req)
This method returns a page containing a print version of a form. |
|
static Page |
showProcessDetail(HttpServletRequest req)
|
|
static Link |
showSubformLink(HttpServletRequest req,
String title,
String subformid,
int width,
int height,
String tablehandler)
|
|
static Link |
showSubformLink(HttpServletRequest req,
String title,
String subformid,
int width,
int height,
String tablehandler,
String actions)
|
|
static Link |
showSubformLink(HttpServletRequest req,
String title,
String subformid,
int width,
int height,
String tablehandler,
String actions,
String defaultAction)
|
|
static Link |
showSubformLink(HttpServletRequest req,
String title,
String subformid,
int width,
int height,
String tablehandler,
String actions,
String defaultAction,
String page)
|
|
static Link |
showSubformLink(Persistent obj,
String title,
String subformid,
int width,
int height,
String tablehandler,
String actions,
String defaultAction,
String page)
|
|
static void |
showWorklist(HttpServletRequest r,
HttpServletResponse res,
com.dec.avw.core.Application appl,
int type,
String worklist,
String functions)
sends the worklist to the browser. |
|
static JSONObject |
toJSON(Persistent obj)
|
|
Page |
userList(HttpServletRequest r)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SELECTLIST_TABLE
public static final String SELECTLIST_LIST
public static final int SAFE_MODE
public static final int COMP_MODE
| Constructor Detail |
|---|
public HTMLUtils()
| Method Detail |
|---|
public static Page refreshWorklist(HttpServletRequest req,
Application appl)
req - the HTTP requestappl - the application
public static void showWorklist(HttpServletRequest r,
HttpServletResponse res,
com.dec.avw.core.Application appl,
int type,
String worklist,
String functions)
throws Exception
r - the HTTP requestres - the HTTP responseappl - the applicationtype - the type: 0..user, 1..role, 2..suspension listworklist - a worklist implementation (implements com.groiss.wf.html.Worklist)functions - a space-separated list of function ids
Exception
public static Page showForm(HttpServletRequest req)
throws Exception
Exception
public static Page showForm(HttpServletRequest r,
ActivityInstance ai,
String formid,
int mode)
throws Exception
r - the requestai - the current activityformid - the id of the form in the process definitionmode - the mode
HTMLUtils.TooManyResultsException
Exception
public static Page showForm(DMSForm form,
List<Component> buttons,
String action,
FormContext ctx)
throws Exception
form - the form objectbuttons - a list of components, buttons are shown on the bottom of the form, hidden fields are included in the form.action - the submit action (Hint: If a XForm is used, the submit action must be defined at the Submit button!)ctx - the form context
Exception
public Page showPrintForm(HttpServletRequest req)
throws Exception
Exception
public static Page showProcessDetail(HttpServletRequest req)
throws Exception
Exception
public static Page selectList(HttpServletRequest req)
throws Exception
Exception
public static Page selectList(Map<String,String> params,
HttpServletRequest req)
throws Exception
Exception
public static Page selectTable(HttpServletRequest req)
throws Exception
Exception
public static Page selectList2(HttpServletRequest req)
throws Exception
Exception
public static Pair getSelectListObject(Map<String,String> params)
throws Exception
params - the map of parameters
Pair object with the key and display value for
the selected object
HTMLUtils.TooManyResultsException - in case of an error
Exception
public static Map<String,String> getParameters(HttpServletRequest req,
boolean avoidSqlInjection)
public static Collection<Pair> getSelectList2(HttpServletRequest req)
throws HTMLUtils.TooManyResultsException,
Exception
HTMLUtils.TooManyResultsException
Exception
public static Pair getSelectObjectById(long oid,
Map<String,String> params)
throws Exception
Exceptionpublic static void editConditionParams(Map<String,String> params)
public static List<Persistent> getObjects(Class c,
Map<String,String> params,
boolean isTable)
throws Exception
Exception
public static Collection<Pair> getSelectList2(Map<String,String> params)
throws Exception
Exception
@Deprecated
public Page agentSelectList(HttpServletRequest req)
throws Exception
selectUserOrRole(HttpServletRequest)
Exception
public Page roleList(HttpServletRequest request)
throws Exception
Exception
public Page userList(HttpServletRequest r)
throws Exception
Exception
public static Persistent getObject(JSONObject obj)
throws JSONException
JSONException
public static JSONObject toJSON(Persistent obj)
throws JSONException
JSONException
public static Page selectUserOrRole(HttpServletRequest req)
throws Exception
Exceptionpublic static <T extends Persistent> T getObject(HttpServletRequest req)
req -
HTMLUtils.TooManyResultsException
public static <T extends Persistent> T getObject(HttpServletRequest req,
String key)
@Deprecated public static Persistent getObject(String obj)
StoreUtil.getObject(Object) instead
public static Link getDocumentsLink(ActivityInstance si)
throws Exception
Exception
public static Link getDocumentsLink(ActivityInstance si,
String comingFrom)
comingFrom - the url for the back button in the document table
public static Link getNotesLink(ActivityInstance ai)
throws Exception
Exception
public static String getFormLinks(ActivityInstance ai,
int mode,
String comingFrom,
String target)
public static List getFormLinkList(ActivityInstance ai,
int mode,
String comingFrom,
String target,
boolean buttonsInToolbar,
boolean withToolbar)
public static Link showSubformLink(HttpServletRequest req,
String title,
String subformid,
int width,
int height,
String tablehandler)
throws Exception
Exception
public static Link showSubformLink(HttpServletRequest req,
String title,
String subformid,
int width,
int height,
String tablehandler,
String actions)
throws Exception
Exception
public static Link showSubformLink(HttpServletRequest req,
String title,
String subformid,
int width,
int height,
String tablehandler,
String actions,
String defaultAction)
throws Exception
Exception
public static Link showSubformLink(HttpServletRequest req,
String title,
String subformid,
int width,
int height,
String tablehandler,
String actions,
String defaultAction,
String page)
throws Exception
Exception
public static Link showSubformLink(Persistent obj,
String title,
String subformid,
int width,
int height,
String tablehandler,
String actions,
String defaultAction,
String page)
throws Exception
Exception
public static <T extends Persistent> List<T> getObjectList(HttpServletRequest req,
String key)
throws Exception
req - key -
Exceptionpublic static List<Pair<String,String>> getObjectListForComponent(List<Persistent> l)
public static String getDisplayValue(DMSForm form,
String field)
CalUtil.showDate(Object) or the CalUtil.showDateTime(Object) representation of the valueSettings.getDecimalFormatter() with the max. fraction and integer digits set as defined for the field
form - the formfield - the field, the text will be returned
null if no text was found
@Deprecated
public static Page showEmptyForm(DMSForm f,
String buttons,
HttpServletRequest req)
throws Exception
ExceptionshowForm(DMSForm, List, String, FormContext)
@Deprecated
public static Page showForm(HttpServletRequest r,
ActivityInstance ai,
String formid,
int mode,
String buttons)
throws Exception
Exceptionor,
showForm(HttpServletRequest, ActivityInstance, String, int)public static String getStandardSearchIdOfClass(Class<?> c)
public static Pair<String,List<Object>> getSearchCondition(Persistent o,
String searchAttrs,
String searchString)
Persistent uses the global setting for smartSearch
o - searchAttrs - the attrs, comma separatedsearchString - the search-string
public static Pair<String,List<Object>> getSearchCondition(Persistent o,
String searchAttrs,
String searchString,
boolean smartSearch)
Persistent
if smartSearch is true, the given searchString will be splitted, and searched in each searchAttr on it's own
o - searchAttrs - searchString - smartSearch - use smartSearch?
protected static String addPattern(String searchString)
searchString -
public Page selectDocTemplates(HttpServletRequest req)
throws Exception
Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||