public class HTMLUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HTMLUtils.TooManyResultsException
Exception is thrown in case the total count of entries exceeds the
configured maximum.
|
Modifier and Type | Field and Description |
---|---|
static int |
COMP_MODE |
static String |
FORMAT_FIELDS_AS_COMPONENT |
static int |
SAFE_MODE |
static Pattern |
SEARCH_TERM_SPLIT_PATTERN |
static String |
SELECTLIST_LIST
Deprecated.
|
static String |
SELECTLIST_TABLE
Deprecated.
|
Constructor and Description |
---|
HTMLUtils() |
Modifier and Type | Method and Description |
---|---|
Page |
agentSelectList(HttpServletRequest req)
Deprecated.
|
static void |
convertToPDF(XHTMLPage p,
OutputStream os,
String addr,
Locale l)
Create a pdf out of the form.
|
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<Link> |
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 <T extends Persistent> |
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 <T extends Persistent> |
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 <T extends Persistent> |
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<? extends Persistent> l) |
static List<Persistent> |
getObjects(Class<Persistent> c,
Map<String,String> params,
boolean isTable) |
static Map<String,String> |
getParameters(HttpServletRequest req)
read the parameters from node and from request
|
static String |
getPreparedStatementCondition(String cond,
List<Object> values,
String param,
String types) |
static String |
getRunningSteps(ProcessInstance pi,
String delim,
boolean includeLongRunning)
Returns a string containing the active step of the given process with agents and step-name
|
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<String,String>> |
getSelectList2(HttpServletRequest req) |
static Collection<Pair<String,String>> |
getSelectList2(Map<String,String> params) |
static Pair<String,String> |
getSelectListObject(Map<String,String> params)
Used for object selection UI control to retrieve the initial display
value for the selected list item.
|
static Pair<String,String> |
getSelectObjectById(long oid,
Map<String,String> params) |
static String |
getSortAttrForSQL(String orderAttr) |
static String |
getStandardSearchIdOfClass(Class<?> c) |
static TableModel |
getWorklist(HttpServletRequest req,
String id)
Return a worklist as table model.
|
static void |
insertSubTable(Element el,
DMSForm mainform,
short mode)
Insert a subform table in an XHTMLPage.
|
static void |
insertSubTable(Element el,
DMSForm mainform,
short mode,
ActivityInstance ai)
Insert a subform table in an XHTMLPage.
|
void |
pdf(HttpServletRequest req,
HttpServletResponse res) |
static Page |
refreshForm(HttpServletRequest req) |
static Page |
refreshWorklist(HttpServletRequest req,
Application appl)
Deprecated.
|
Page |
roleList(HttpServletRequest request) |
Page |
selectDocTemplates(HttpServletRequest req) |
static Page |
selectList(HttpServletRequest req) |
static Page |
selectList2(HttpServletRequest req)
Deprecated.
|
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 |
showFormTable(HttpServletRequest req)
Show a Form table in its own window or iframe.
|
static void |
showPdfForm(DMSForm form,
FormContext ctx,
OutputStream os,
String addr,
Locale l)
Create a pdf out of the form.
|
void |
showPdfForm(HttpServletRequest req,
HttpServletResponse res)
This methods creates a pdf from a form.
|
Page |
showPrintForm(HttpServletRequest req)
This method returns a page containing a print version of a form.
|
static Page |
showProcessDetail(HttpServletRequest req)
Deprecated.
|
static Page |
showProcessDetails(HttpServletRequest req)
Show the process details, designed for opened in a popup window.
|
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,
Application appl,
int type,
String worklist,
String functions)
Deprecated.
|
static JSONObject |
toJSON(Persistent obj)
Deprecated.
|
Page |
userList(HttpServletRequest r) |
public static final Pattern SEARCH_TERM_SPLIT_PATTERN
public static final String FORMAT_FIELDS_AS_COMPONENT
@Deprecated public static final String SELECTLIST_TABLE
@Deprecated public static final String SELECTLIST_LIST
public static final int SAFE_MODE
public static final int COMP_MODE
@Deprecated public static Page refreshWorklist(HttpServletRequest req, Application appl)
req
- the HTTP requestappl
- the application@Deprecated public static void showWorklist(HttpServletRequest r, HttpServletResponse res, 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 idsException
public static TableModel getWorklist(HttpServletRequest req, String id)
req
- the HTTP requestid
- the id of the worklist, for example standard.wlpublic static String getRunningSteps(ProcessInstance pi, String delim, boolean includeLongRunning)
pi
- a process instancedelim
- a delimiter, for example ", "includeLongRunning
- if true, not only interactive steps are shown but also batch steps, webservice calls, etc.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 modeException
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 contextException
public static Page refreshForm(HttpServletRequest req) throws Exception
Exception
public Page showPrintForm(HttpServletRequest req) throws Exception
Exception
public void showPdfForm(HttpServletRequest req, HttpServletResponse res) throws Exception
req
- parameter object references the formres
- receives the pdfException
public static void showPdfForm(DMSForm form, FormContext ctx, OutputStream os, String addr, Locale l) throws Exception
form
- a form objectctx
- the form context (may define visibilities)os
- on this stream the pdf is writtenaddr
- base address if the html contains links to external resources, for example imagesl
- the locale used for internationalizationException
public static void convertToPDF(XHTMLPage p, OutputStream os, String addr, Locale l) throws Exception
p
- an XHTML Pageos
- on this stream the pdf is writtenaddr
- base address if the html contains links to external resources, for example imagesl
- the locale used for internationalizationException
public void pdf(HttpServletRequest req, HttpServletResponse res) throws Exception
Exception
@Deprecated public static Page showProcessDetail(HttpServletRequest req) throws Exception
showProcessDetails(HttpServletRequest)
Exception
public static Page showProcessDetails(HttpServletRequest req) throws Exception
req
- the request must contain a parameter "pi" of form classname:oid referencing a process instance object.
Optional request parameter "selectedTab" of form "xmlid.nodeid" (e.g. admin.documents) determines the selected tab.Exception
public static Page selectList(HttpServletRequest req) throws Exception
Exception
public static Page selectTable(HttpServletRequest req) throws Exception
Exception
@Deprecated public static Page selectList2(HttpServletRequest req) throws Exception
req
- Exception
public static Pair<String,String> getSelectListObject(Map<String,String> params) throws Exception
params
- the map of parametersPair
object with the key and display value for
the selected objectException
- in case of an errorpublic static Map<String,String> getParameters(HttpServletRequest req)
public static Collection<Pair<String,String>> getSelectList2(HttpServletRequest req) throws Exception
Exception
public static Pair<String,String> getSelectObjectById(long oid, Map<String,String> params) throws Exception
Exception
public static List<Persistent> getObjects(Class<Persistent> c, Map<String,String> params, boolean isTable) throws Exception
Exception
public static String getPreparedStatementCondition(String cond, List<Object> values, String param, String types)
public static Collection<Pair<String,String>> 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)
@Deprecated public static JSONObject toJSON(Persistent obj)
StoreUtil.toJsonAsReference(Persistent)
or StoreUtil.toJson(Persistent)
insteadobj
- StoreUtil.toJsonAsReference(Persistent)
public static Page selectUserOrRole(HttpServletRequest req) throws Exception
Exception
public static <T extends Persistent> T getObject(HttpServletRequest req)
req
- public static <T extends Persistent> T getObject(HttpServletRequest req, String key)
@Deprecated public static Persistent getObject(String obj)
StoreUtil.getObject(Object)
insteadpublic static Link getDocumentsLink(ActivityInstance si)
public static Link getDocumentsLink(ActivityInstance si, String comingFrom)
comingFrom
- the url for the back button in the document tablepublic static Link getNotesLink(ActivityInstance ai)
public static String getFormLinks(ActivityInstance ai, int mode, String comingFrom, String target)
public static List<Link> 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)
public static Link showSubformLink(HttpServletRequest req, String title, String subformid, int width, int height, String tablehandler, String actions)
public static Link showSubformLink(HttpServletRequest req, String title, String subformid, int width, int height, String tablehandler, String actions, String defaultAction)
public static Link showSubformLink(HttpServletRequest req, String title, String subformid, int width, int height, String tablehandler, String actions, String defaultAction, String page)
public static Link showSubformLink(Persistent obj, String title, String subformid, int width, int height, String tablehandler, String actions, String defaultAction, String page)
public static void insertSubTable(Element el, DMSForm mainform, short mode) throws Exception
el
- an jdom-element in a XHMTL page. The element will be modified and the table is added as sub-element.mainform
- the main formmode
- the mode for showing the table, RemoteWfEngine.INVISIBLE, READ_ONLY, READ_WRITE, NO_ADDDELException
public static void insertSubTable(Element el, DMSForm mainform, short mode, ActivityInstance ai) throws Exception
el
- an jdom-element in a XHMTL page. The element will be modified and the table is added as sub-element.mainform
- the main formmode
- the mode for showing the table, RemoteWfEngine.INVISIBLE, READ_ONLY, READ_WRITE, NO_ADDDELai
- context activity instance, may be used in subtables table event handlerException
public static <T extends Persistent> List<T> getObjectList(HttpServletRequest req, String key)
req
- key
- public static List<Pair<String,String>> getObjectListForComponent(List<? extends 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 fieldform
- the formfield
- the field, the text will be returnednull
if no text was found@Deprecated public static Page showEmptyForm(DMSForm f, String buttons, HttpServletRequest req) throws Exception
Exception
showForm(DMSForm, List, String, FormContext)
@Deprecated public static Page showForm(HttpServletRequest r, ActivityInstance ai, String formid, int mode, String buttons) throws Exception
Exception
or
,
showForm(HttpServletRequest, ActivityInstance, String, int)
public static Pair<String,List<Object>> getSearchCondition(Persistent o, String searchAttrs, String searchString)
Persistent
uses the global setting for smartSearcho
- searchAttrs
- the attrs, comma separatedsearchString
- the search-stringpublic 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 owno
- searchAttrs
- searchString
- smartSearch
- use smartSearch?public Page selectDocTemplates(HttpServletRequest req) throws Exception
Exception
public Page showFormTable(HttpServletRequest req)
req
- parameters: showToolbar: true | false, hideCloseButton: true | false,
nodeid: define the node by specifying the id@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.