|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 java.lang.String |
SELECTLIST_LIST
|
static java.lang.String |
SELECTLIST_TABLE
|
Constructor Summary | |
---|---|
HTMLUtils()
|
Method Summary | ||
---|---|---|
protected static java.lang.String |
addPattern(java.lang.String searchString)
adds % to the searchstring, based on the selectlist.search property (either infix, or prefix search) |
|
Page |
agentSelectList(javax.servlet.http.HttpServletRequest req)
Deprecated. use selectUserOrRole(HttpServletRequest) |
|
static void |
editConditionParams(java.util.Map<java.lang.String,java.lang.String> params)
|
|
static java.lang.String |
getDisplayValue(DMSForm form,
java.lang.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. |
|
static Link |
getDocumentsLink(ActivityInstance si)
|
|
static Link |
getDocumentsLink(ActivityInstance si,
java.lang.String comingFrom)
|
|
static java.util.List |
getFormLinkList(ActivityInstance ai,
int mode,
java.lang.String comingFrom,
java.lang.String target,
boolean buttonsInToolbar,
boolean withToolbar)
|
|
static java.lang.String |
getFormLinks(ActivityInstance ai,
int mode,
java.lang.String comingFrom,
java.lang.String target)
|
|
static Link |
getNotesLink(ActivityInstance ai)
|
|
static
|
getObject(javax.servlet.http.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(javax.servlet.http.HttpServletRequest req,
java.lang.String key)
|
|
static Persistent |
getObject(org.json.JSONObject obj)
|
|
static Persistent |
getObject(java.lang.String obj)
Deprecated. since 8.0; use StoreUtil.getObject(Object) instead |
|
static
|
getObjectList(javax.servlet.http.HttpServletRequest req,
java.lang.String key)
Get list of objects (from multiple selection list) stored in request under key |
|
static java.util.List<Pair<java.lang.String,java.lang.String>> |
getObjectListForComponent(java.util.List<Persistent> l)
|
|
static java.util.List<Persistent> |
getObjects(java.lang.Class c,
java.util.Map<java.lang.String,java.lang.String> params,
boolean isTable)
|
|
static java.util.Map<java.lang.String,java.lang.String> |
getParameters(javax.servlet.http.HttpServletRequest req,
boolean avoidSqlInjection)
|
|
static Pair<java.lang.String,java.util.List<java.lang.Object>> |
getSearchCondition(Persistent o,
java.lang.String searchAttrs,
java.lang.String searchString)
builds a condition for querying the given Persistent uses the global setting for smartSearch |
|
static Pair<java.lang.String,java.util.List<java.lang.Object>> |
getSearchCondition(Persistent o,
java.lang.String searchAttrs,
java.lang.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 java.util.Collection<Pair> |
getSelectList2(javax.servlet.http.HttpServletRequest req)
|
|
static java.util.Collection<Pair> |
getSelectList2(java.util.Map<java.lang.String,java.lang.String> params)
|
|
static Pair |
getSelectListObject(java.util.Map<java.lang.String,java.lang.String> params)
Used for object selection UI control to retrieve the initial display value for the selected list item. |
|
static Pair |
getSelectObjectById(long oid,
java.util.Map<java.lang.String,java.lang.String> params)
|
|
static java.lang.String |
getStandardSearchIdOfClass(java.lang.Class<?> c)
|
|
static Page |
refreshWorklist(javax.servlet.http.HttpServletRequest req,
Application appl)
Returns a page that redirects to the current worklist of this application |
|
Page |
roleList(javax.servlet.http.HttpServletRequest request)
|
|
Page |
selectDocTemplates(javax.servlet.http.HttpServletRequest req)
|
|
static Page |
selectList(javax.servlet.http.HttpServletRequest req)
Shows a list of objects for selection in form of a selectlist |
|
static Page |
selectList(java.util.Map<java.lang.String,java.lang.String> params,
javax.servlet.http.HttpServletRequest req)
|
|
static Page |
selectList2(javax.servlet.http.HttpServletRequest req)
Shows a list of objects for selection in form of a selectlist |
|
static Page |
selectTable(javax.servlet.http.HttpServletRequest req)
|
|
static Page |
selectUserOrRole(javax.servlet.http.HttpServletRequest req)
|
|
static Page |
showEmptyForm(DMSForm f,
java.lang.String buttons,
javax.servlet.http.HttpServletRequest req)
Deprecated. |
|
static Page |
showForm(DMSForm form,
java.util.List<Component> buttons,
java.lang.String action,
FormContext ctx)
Show a form. |
|
static Page |
showForm(javax.servlet.http.HttpServletRequest req)
|
|
static Page |
showForm(javax.servlet.http.HttpServletRequest r,
ActivityInstance ai,
java.lang.String formid,
int mode)
Show a process form. |
|
static Page |
showForm(javax.servlet.http.HttpServletRequest r,
ActivityInstance ai,
java.lang.String formid,
int mode,
java.lang.String buttons)
Deprecated. |
|
Page |
showPrintForm(javax.servlet.http.HttpServletRequest req)
This method returns a page containing a print version of a form. |
|
static Page |
showProcessDetail(javax.servlet.http.HttpServletRequest req)
|
|
static Link |
showSubformLink(javax.servlet.http.HttpServletRequest req,
java.lang.String title,
java.lang.String subformid,
int width,
int height,
java.lang.String tablehandler)
|
|
static Link |
showSubformLink(javax.servlet.http.HttpServletRequest req,
java.lang.String title,
java.lang.String subformid,
int width,
int height,
java.lang.String tablehandler,
java.lang.String actions)
|
|
static Link |
showSubformLink(javax.servlet.http.HttpServletRequest req,
java.lang.String title,
java.lang.String subformid,
int width,
int height,
java.lang.String tablehandler,
java.lang.String actions,
java.lang.String defaultAction)
|
|
static Link |
showSubformLink(javax.servlet.http.HttpServletRequest req,
java.lang.String title,
java.lang.String subformid,
int width,
int height,
java.lang.String tablehandler,
java.lang.String actions,
java.lang.String defaultAction,
java.lang.String page)
|
|
static Link |
showSubformLink(Persistent obj,
java.lang.String title,
java.lang.String subformid,
int width,
int height,
java.lang.String tablehandler,
java.lang.String actions,
java.lang.String defaultAction,
java.lang.String page)
|
|
static void |
showWorklist(javax.servlet.http.HttpServletRequest r,
javax.servlet.http.HttpServletResponse res,
com.dec.avw.core.Application appl,
int type,
java.lang.String worklist,
java.lang.String functions)
sends the worklist to the browser. |
|
static org.json.JSONObject |
toJSON(Persistent obj)
|
|
Page |
userList(javax.servlet.http.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 java.lang.String SELECTLIST_TABLE
public static final java.lang.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(javax.servlet.http.HttpServletRequest req, Application appl)
req
- the HTTP requestappl
- the applicationpublic static void showWorklist(javax.servlet.http.HttpServletRequest r, javax.servlet.http.HttpServletResponse res, com.dec.avw.core.Application appl, int type, java.lang.String worklist, java.lang.String functions) throws java.lang.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
java.lang.Exception
public static Page showForm(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
public static Page showForm(javax.servlet.http.HttpServletRequest r, ActivityInstance ai, java.lang.String formid, int mode) throws java.lang.Exception
r
- the requestai
- the current activityformid
- the id of the form in the process definitionmode
- the mode
HTMLUtils.TooManyResultsException
java.lang.Exception
public static Page showForm(DMSForm form, java.util.List<Component> buttons, java.lang.String action, FormContext ctx) throws java.lang.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
java.lang.Exception
public Page showPrintForm(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
public static Page showProcessDetail(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
public static Page selectList(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
public static Page selectList(java.util.Map<java.lang.String,java.lang.String> params, javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
public static Page selectTable(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
public static Page selectList2(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
public static Pair getSelectListObject(java.util.Map<java.lang.String,java.lang.String> params) throws java.lang.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
java.lang.Exception
public static java.util.Map<java.lang.String,java.lang.String> getParameters(javax.servlet.http.HttpServletRequest req, boolean avoidSqlInjection)
public static java.util.Collection<Pair> getSelectList2(javax.servlet.http.HttpServletRequest req) throws HTMLUtils.TooManyResultsException, java.lang.Exception
HTMLUtils.TooManyResultsException
java.lang.Exception
public static Pair getSelectObjectById(long oid, java.util.Map<java.lang.String,java.lang.String> params) throws java.lang.Exception
java.lang.Exception
public static void editConditionParams(java.util.Map<java.lang.String,java.lang.String> params)
public static java.util.List<Persistent> getObjects(java.lang.Class c, java.util.Map<java.lang.String,java.lang.String> params, boolean isTable) throws java.lang.Exception
java.lang.Exception
public static java.util.Collection<Pair> getSelectList2(java.util.Map<java.lang.String,java.lang.String> params) throws java.lang.Exception
java.lang.Exception
@Deprecated public Page agentSelectList(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
selectUserOrRole(HttpServletRequest)
java.lang.Exception
public Page roleList(javax.servlet.http.HttpServletRequest request) throws java.lang.Exception
java.lang.Exception
public Page userList(javax.servlet.http.HttpServletRequest r) throws java.lang.Exception
java.lang.Exception
public static Persistent getObject(org.json.JSONObject obj) throws org.json.JSONException
org.json.JSONException
public static org.json.JSONObject toJSON(Persistent obj) throws org.json.JSONException
org.json.JSONException
public static Page selectUserOrRole(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
public static <T extends Persistent> T getObject(javax.servlet.http.HttpServletRequest req)
req
-
HTMLUtils.TooManyResultsException
public static <T extends Persistent> T getObject(javax.servlet.http.HttpServletRequest req, java.lang.String key)
@Deprecated public static Persistent getObject(java.lang.String obj)
StoreUtil.getObject(Object)
instead
public static Link getDocumentsLink(ActivityInstance si) throws java.lang.Exception
java.lang.Exception
public static Link getDocumentsLink(ActivityInstance si, java.lang.String comingFrom)
comingFrom
- the url for the back button in the document table
public static Link getNotesLink(ActivityInstance ai) throws java.lang.Exception
java.lang.Exception
public static java.lang.String getFormLinks(ActivityInstance ai, int mode, java.lang.String comingFrom, java.lang.String target)
public static java.util.List getFormLinkList(ActivityInstance ai, int mode, java.lang.String comingFrom, java.lang.String target, boolean buttonsInToolbar, boolean withToolbar)
public static Link showSubformLink(javax.servlet.http.HttpServletRequest req, java.lang.String title, java.lang.String subformid, int width, int height, java.lang.String tablehandler) throws java.lang.Exception
java.lang.Exception
public static Link showSubformLink(javax.servlet.http.HttpServletRequest req, java.lang.String title, java.lang.String subformid, int width, int height, java.lang.String tablehandler, java.lang.String actions) throws java.lang.Exception
java.lang.Exception
public static Link showSubformLink(javax.servlet.http.HttpServletRequest req, java.lang.String title, java.lang.String subformid, int width, int height, java.lang.String tablehandler, java.lang.String actions, java.lang.String defaultAction) throws java.lang.Exception
java.lang.Exception
public static Link showSubformLink(javax.servlet.http.HttpServletRequest req, java.lang.String title, java.lang.String subformid, int width, int height, java.lang.String tablehandler, java.lang.String actions, java.lang.String defaultAction, java.lang.String page) throws java.lang.Exception
java.lang.Exception
public static Link showSubformLink(Persistent obj, java.lang.String title, java.lang.String subformid, int width, int height, java.lang.String tablehandler, java.lang.String actions, java.lang.String defaultAction, java.lang.String page) throws java.lang.Exception
java.lang.Exception
public static <T extends Persistent> java.util.List<T> getObjectList(javax.servlet.http.HttpServletRequest req, java.lang.String key) throws java.lang.Exception
req
- key
-
java.lang.Exception
public static java.util.List<Pair<java.lang.String,java.lang.String>> getObjectListForComponent(java.util.List<Persistent> l)
public static java.lang.String getDisplayValue(DMSForm form, java.lang.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, java.lang.String buttons, javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
showForm(DMSForm, List, String, FormContext)
@Deprecated public static Page showForm(javax.servlet.http.HttpServletRequest r, ActivityInstance ai, java.lang.String formid, int mode, java.lang.String buttons) throws java.lang.Exception
java.lang.Exception
or
,
showForm(HttpServletRequest, ActivityInstance, String, int)
public static java.lang.String getStandardSearchIdOfClass(java.lang.Class<?> c)
public static Pair<java.lang.String,java.util.List<java.lang.Object>> getSearchCondition(Persistent o, java.lang.String searchAttrs, java.lang.String searchString)
Persistent
uses the global setting for smartSearch
o
- searchAttrs
- the attrs, comma separatedsearchString
- the search-string
public static Pair<java.lang.String,java.util.List<java.lang.Object>> getSearchCondition(Persistent o, java.lang.String searchAttrs, java.lang.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 java.lang.String addPattern(java.lang.String searchString)
searchString
-
public Page selectDocTemplates(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |