public class HTMLUtils
extends java.lang.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 int |
SAFE_MODE |
static java.lang.String |
SELECTLIST_LIST |
static java.lang.String |
SELECTLIST_TABLE |
Constructor and Description |
---|
HTMLUtils() |
Modifier and Type | Method and Description |
---|---|
Page |
agentSelectList(javax.servlet.http.HttpServletRequest req)
Deprecated.
|
static void |
convertToPDF(XHTMLPage p,
java.io.OutputStream os,
java.lang.String addr,
java.util.Locale l)
Create a pdf out of the form.
|
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. fraction and integer digits set as defined for the field
|
static Link |
getDocumentsLink(ActivityInstance si) |
static Link |
getDocumentsLink(ActivityInstance si,
java.lang.String comingFrom) |
static java.util.List<Link> |
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 <T extends Persistent> |
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 <T extends Persistent> |
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 <T extends Persistent> |
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<? extends Persistent> l) |
static java.util.List<Persistent> |
getObjects(java.lang.Class<Persistent> 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)
read the parameters from node and from request
|
static java.lang.String |
getPreparedStatementCondition(java.lang.String cond,
java.util.List<java.lang.Object> values,
java.lang.String param,
java.lang.String types) |
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<java.lang.String,java.lang.String>> |
getSelectList2(javax.servlet.http.HttpServletRequest req) |
static java.util.Collection<Pair<java.lang.String,java.lang.String>> |
getSelectList2(java.util.Map<java.lang.String,java.lang.String> params) |
static Pair<java.lang.String,java.lang.String> |
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<java.lang.String,java.lang.String> |
getSelectObjectById(long oid,
java.util.Map<java.lang.String,java.lang.String> params) |
static java.lang.String |
getStandardSearchIdOfClass(java.lang.Class<?> c) |
void |
pdf(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res) |
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 |
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.
|
static void |
showPdfForm(DMSForm form,
FormContext ctx,
java.io.OutputStream os,
java.lang.String addr,
java.util.Locale l)
Create a pdf out of the form.
|
void |
showPdfForm(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
This methods creates a pdf from a form.
|
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) |
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
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 idsjava.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 modejava.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 contextjava.lang.Exception
public Page showPrintForm(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
public void showPdfForm(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.lang.Exception
req
- parameter object references the formres
- receives the pdfjava.lang.Exception
public static void showPdfForm(DMSForm form, FormContext ctx, java.io.OutputStream os, java.lang.String addr, java.util.Locale l) throws java.lang.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 internationalizationjava.lang.Exception
public static void convertToPDF(XHTMLPage p, java.io.OutputStream os, java.lang.String addr, java.util.Locale l) throws java.lang.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 internationalizationjava.lang.Exception
public void pdf(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) 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 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<java.lang.String,java.lang.String> getSelectListObject(java.util.Map<java.lang.String,java.lang.String> params) throws java.lang.Exception
params
- the map of parametersPair
object with the key and display value for
the selected objectjava.lang.Exception
- in case of an errorpublic static java.util.Map<java.lang.String,java.lang.String> getParameters(javax.servlet.http.HttpServletRequest req)
public static java.util.Collection<Pair<java.lang.String,java.lang.String>> getSelectList2(javax.servlet.http.HttpServletRequest req) throws HTMLUtils.TooManyResultsException, java.lang.Exception
HTMLUtils.TooManyResultsException
java.lang.Exception
public static Pair<java.lang.String,java.lang.String> getSelectObjectById(long oid, java.util.Map<java.lang.String,java.lang.String> params) throws java.lang.Exception
java.lang.Exception
public static java.util.List<Persistent> getObjects(java.lang.Class<Persistent> c, java.util.Map<java.lang.String,java.lang.String> params, boolean isTable) throws java.lang.Exception
java.lang.Exception
public static java.lang.String getPreparedStatementCondition(java.lang.String cond, java.util.List<java.lang.Object> values, java.lang.String param, java.lang.String types)
public static java.util.Collection<Pair<java.lang.String,java.lang.String>> 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
- java.lang.Exception
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)
insteadpublic 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 tablepublic 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<Link> 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<? extends 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 fieldform
- the formfield
- the field, the text will be returnednull
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 smartSearcho
- searchAttrs
- the attrs, comma separatedsearchString
- the search-stringpublic 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 owno
- searchAttrs
- searchString
- smartSearch
- use smartSearch?public Page selectDocTemplates(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
java.lang.Exception
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.