com.jalios.jcms.widget
Class WidgetUtil

java.lang.Object
  extended by com.jalios.jcms.widget.WidgetUtil
All Implemented Interfaces:
JcmsConstants, JaliosConstants

public class WidgetUtil
extends Object
implements JcmsConstants

Version:
$Revision: 22476 $
Author:
Jean-Philippe Encausse

Nested Class Summary
static class WidgetUtil.TinyMceSpellChecker
          RPC Class used by TinyMCE spellchecker
 
Field Summary
static String CSS_BUTTON
           
static String CSS_CHECKBOX
           
static String CSS_CHOOSERFIELD
           
static String CSS_CHOOSERLABELFIELD
           
static String CSS_COMBOBOX
           
static String CSS_DESCRIPTION
           
static String CSS_INFO
           
static String CSS_LABEL
           
static String CSS_LABELBOX
           
static String CSS_LISTBOX
           
static String CSS_MAIN_BUTTON
           
static String CSS_MANDATORY
           
static String CSS_RADIOBOX
           
static String CSS_RICHTEXT
           
static String CSS_RICHTEXT_POPUP
           
static String CSS_TEXTAREA
           
static String CSS_TEXTFIELD
           
static String CSS_UNITS
           
static String HAS_RICHTEXT
          Name of the Boolean attribute added to the request when the current request contains one or more Rich Text editor.
static String ICON_ARROW_DOWN
           
static String ICON_ARROW_LEFT
           
static String ICON_ARROW_RIGHT
           
static String ICON_ARROW_UP
           
static String ICON_CATEGORY_CHOOSER
           
static String ICON_CLEAR
           
static String ICON_COLOR_CHOOSER
           
static String ICON_DATE
           
static String ICON_DBRECORD_CHOOSER
           
static String ICON_DOC_CHOOSER
           
static String ICON_FOLDER
           
static String ICON_GROUP_CHOOSER
           
static String ICON_IMAGE_CHOOSER
           
static String ICON_MEDIA_CHOOSER
           
static String ICON_MEMBER_CHOOSER
           
static String ICON_PLUS
           
static String ICON_PUB_CHOOSER
           
static String ICON_QUERY_CHOOSER
           
static String ICON_TRASH
           
static String ICON_WORKSPACE_CHOOSER
           
static String REVISION
           
 
Fields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CRYPT_MD5, CRYPT_UNDEFINED, CRYPT_UNIX, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DAILY_MAIL_ALERT, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, MONTHLY_MAIL_ALERT, NO_MAIL_ALERT, OP_CREATE, OP_DEEP_COPY, OP_DEEP_DELETE, OP_DELETE, OP_MERGE, OP_UPDATE, PDATE_SEARCH, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WEEKLY_MAIL_ALERT, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
 
Fields inherited from interface com.jalios.util.JaliosConstants
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
 
Constructor Summary
WidgetUtil()
           
 
Method Summary
static void addWysiwygJavaScripts(JcmsJspContext jcmsContext)
          Add the required JavaScript files to the current context
static String getDateChooserJSlang(String userLang)
          Return the language that can be used for the javascript file to be included for the date chooser.
static String getHtmlHidden(String widgetName, String value)
          Convenient method that build an input hidden field calling printHiddenField
static String getHtmlIcon(String src, String title)
          Build an icon
static String getHtmlIcon(String src, String title, String alt)
          Build an icon
static String getHtmlIcon(String src, String title, String id, String style, String onclick)
          Build an icon
static String getHtmlIcon(String src, String title, String alt, String id, String style, String onclick)
          Build an icon
static String getLangTab(String widget, String lang)
          Return ONE Lang Tab for a given lang with a given widget has content.
static String getPropertyEditor(String name)
          Returns the editor associated to the given default Property.
static String getShortProperty(String key)
          Return the value of the property without the editor value
static String getShortProperty(String key, String editor)
          Return the value of the property without the editor value
static void print2ClearIconField(StringBuffer sb, String formField, String formName, String def, String userLang, int pos)
          Print Red Cross to clear a 2 Field in a Form
static void print2InputField(StringBuffer sb, String fieldId, String fieldName, String fieldLabel, String fieldValue, int cols, int tabindex, boolean disabled, String lang, boolean showIDField)
          Print 2 Input Fields for chooser
static void printAddCountIcon(StringBuffer sb, String formField, String formFieldGroup, String formName, String userLang, int addCount, int langCount, String widgetId)
          Print the plus icon to add more fields to a field list
static void printCategoryChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos, String chooserQS)
          Print a Category Chooser
static void printClearIconField(StringBuffer sb, String formField, String formName, String def, String userLang, int pos)
          Print Red Cross to clear a Field in a Form
static void printClearIconField(StringBuffer sb, String formField, String formName, String def, String userLang, int pos, String func)
          Print Red Cross to clear a Field in a Form
static void printColorChooser(StringBuffer sb, String ctxPath, String formField, String formName, String userLang, int pos)
          Print ColorChooser icon
static String printConfirmSubmitFormButton(String label, String action, String formName, String msg, String userLang)
          Display a Button that will ask to confirm the action
static String printConfirmSubmitFormButton(String label, String action, String formName, String msg, String userLang, int tabindex)
           
protected static void printDataChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos, String jsp, String chooserQS, int width, int height, String icon)
           
static void printDataSourceSelect(StringBuffer sb, String widgetName, String dataSource, String userLang)
          This method write to the buffer a select box of sql datasource.
static void printDateChooser(StringBuffer sb, boolean inPopup, String ctxPath, String formField, String formName, String alt, int pos, boolean showTime, boolean showWeekNumbers)
          Print the Date Chooser Icon
static void printDBRecordChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos, String chooserQS)
          Print a DBRecord Chooser
static void printDescription(StringBuffer sb, String formDescription)
          Print the field Description
static void printDocChooser(StringBuffer sb, String ctxPath, String formField, String formName, String msgLang, int pos, int nbElt, FileDocument doc)
          Print the Doc Chooser icon
static void printDown2IconField(StringBuffer sb, String formField, String formName, String userLang, int pos, int relFirst, String widgetId)
           
static void printDown3IconField(StringBuffer sb, String formField, String formName, String userLang, int pos, int relFirst, String widgetId)
           
static void printDownIconField(StringBuffer sb, String formField, String formName, String userLang, int pos, String widgetId)
          Print Arrow Down Icon to move fields
static void printFileChooser(StringBuffer sb, String ctxPath, String path, String formField, String formName, String userLang, int pos)
          Print Folder icon linked to old filechooser
static void printGroupChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos, String chooserQS)
          Print a Group Chooser
static void printHelpIconField(StringBuffer sb, String alt)
          Print Help Icon to display help about the field
static void printHiddenField(StringBuffer sb, String widgetName, String value)
          Print Hidden Input
static void printHiddenField(StringBuffer sb, String widgetName, String value, String style, String id)
          Print Hidden Input
static String printHtmlButton(String widgetName, String value, boolean submit, String onClick, boolean isMainAction)
          Print an HTML Button
static String printHtmlButton(String widgetName, String value, boolean submit, String onClick, boolean isMainAction, int tabindex)
           
static void printImageChooser(StringBuffer sb, String ctxPath, String formField, String formName, String userLang, int pos, boolean pub)
          Print the folder icon linked to the image chooser.
static String printImageChooser(String ctxPath, String formField, String formName, String alt, int pos, boolean pub)
          Print Folder icon linked to image chooser
static String printImageMapToolbar(String formName, String widgetName, int widgetPos, JcmsContext ctx)
           
static void printInfo(StringBuffer sb, String formInfo)
          Print the field Info
static void printInputBox(StringBuffer sb, String inputId, String fieldName, String fieldValue, String fieldLabel, boolean check, boolean selected, boolean disabled, int tabindex, String lang)
          Print an input Checkbox or Radio button
static String printInputBox(String fieldId, String fieldName, String fieldValue, String fieldLabel, boolean check, boolean selected, boolean disabled, int tabindex, String lang)
           
static void printInputBoxList(StringBuffer sb, Collection<?> fieldIds, String fieldName, Collection<?> fieldValue, Collection<?> fieldLabel, boolean check, Collection<?> selected, boolean br, boolean disabled, int tabindex, String lang)
          Print an html list of check/radio box
static void printInputComboBox(StringBuffer sb, String fieldId, String fieldName, Collection<?> fieldValue, Collection<?> fieldLabel, String selected, boolean blank, int tabindex, boolean disabled, String custom, String lang)
          Print a ComboBox
static void printInputField(StringBuffer sb, String fieldId, String fieldName, String fieldValue, int cols, boolean disabled, String lang)
          A Convenient method to print a TextField
static void printInputField(StringBuffer sb, String fieldId, String fieldName, String fieldValue, int cols, int colsMax, int tabindex, boolean disabled, String custom, String lang)
          A Convenient method to print a TextField
protected static void printInputField(StringBuffer sb, String fieldType, String fieldId, String fieldName, String fieldValue, int cols, int colsMax, int tabindex, boolean disabled, String css, String customs, String lang)
          Print a Text Input
static void printInputListBox(StringBuffer sb, String fieldId, String fieldName, int size, Collection<?> fieldValue, Collection<?> fieldLabel, Collection<?> selected, boolean disabled, int tabindex, String customs, String lang)
          Print a ListBox
static void printLabel(StringBuffer sb, String formLabel, String inputId)
          Print the field Label
static void printLabel(StringBuffer sb, String formLabel, String[] inputId)
          Print the field label.
static void printLangAttributes(StringBuffer sb, String lang)
          Appends the html language attributes to use for the given language.
static void printLeft2IconField(StringBuffer sb, String formField, String formName, String userLang, int pos, int relFirst, String widgetId)
           
static void printLeft3IconField(StringBuffer sb, String formField, String formName, String userLang, int pos, int relFirst, String widgetId)
           
static void printLeftIconField(StringBuffer sb, String formField, String formName, String userLang, int pos, String widgetId)
          Print Arrow Left Icon to move fields
static void printMandatory(StringBuffer sb)
          Print the Mandatory for a given field
static void printMediaChooser(StringBuffer sb, String ctxPath, String formField, String formName, String userLang, int pos, boolean pub)
          Print the icon linked to the media chooser.
static String printMediaChooser(String ctxPath, String formField, String formName, String alt, int pos, boolean pub)
          Print icon linked to old media chooser
static void printMemberChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos, String chooserQS)
          Print a Member Chooser
protected static void printMoveFormElement(StringBuffer sb, String jsfunc, String formField, String formName, String action, String icon, String alt, int pos, int relFirst, String formFieldId)
           
static void printPasswordField(StringBuffer sb, String fieldId, String fieldName, String fieldValue, int cols, int colsMax, int tabindex, boolean disabled, String customs, String lang)
          A Convenient method to print a PasswordField
static String printPopupButton(String label, String url)
           
static void printPubChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos, String chooserQS)
          Print a Pub Chooser
static void printPubsChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos, String chooserQS)
          Print a Pubs Chooser
static void printQueryChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos)
          Print Query icon linked to querychooser
static void printRichTextZone(StringBuffer sb, String fieldName, String fieldValue, int cols, int rows, int tabindex, int count, boolean inline, String wysiwygParams, String lang)
          Print a Rich Text Area
static void printRight2IconField(StringBuffer sb, String formField, String formName, String userLang, int pos, int relFirst, String widgetId)
           
static void printRight3IconField(StringBuffer sb, String formField, String formName, String userLang, int pos, int relFirst, String widgetId)
           
static void printRightIconField(StringBuffer sb, String formField, String formName, String userLang, int pos, String widgetId)
          Print Arrow Right Icon to move fields
static void printSeparator(StringBuffer sb, String formField)
          Print a HR separator and an Anchor for the field
static String printSubmitButton(String label, String action)
          Return a Submit HTML Button with a given label/action
static String printSubmitButton(String label, String action, int tabindex)
           
static String printSubmitFormButton(String label, String action, String formName, String userLang)
          Display a Button that will submit form for a given action
static String printSubmitFormButton(String label, String action, String formName, String userLang, int tabindex)
           
static void printTextArea(StringBuffer sb, String fieldId, String fieldName, String fieldValue, int cols, int rows, int tabindex, boolean escapeEntities, boolean disabled, String customs, String lang)
          Print a Text Area
static void printTrash2IconField(StringBuffer sb, String formField, String formName, String userLang, int pos, int relFirst, String widgetId)
           
static void printTrash3IconField(StringBuffer sb, String formField, String formName, String userLang, int pos, int relFirst, String widgetId)
           
static void printTrashIconField(StringBuffer sb, String formField, String formName, String userLang, int pos, String widgetId)
          Print Trash Icon to move fields
static void printUnits(StringBuffer sb, String formUnit)
          Print the units for field
static void printUp2IconField(StringBuffer sb, String formField, String formName, String userLang, int pos, int relFirst, String widgetId)
           
static void printUp3IconField(StringBuffer sb, String formField, String formName, String userLang, int pos, int relFirst, String widgetId)
           
static void printUpIconField(StringBuffer sb, String formField, String formName, String userLang, int pos, String widgetId)
          Print Arrow Up Icon to move fields
static String printWikiToolbar(String formName, int widgetPos, JcmsContext ctx, String flag)
           
static void printWorkspaceChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos, String chooserQS)
          Print a Workspace Chooser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

CSS_BUTTON

public static final String CSS_BUTTON
See Also:
Constant Field Values

CSS_MAIN_BUTTON

public static final String CSS_MAIN_BUTTON
See Also:
Constant Field Values

CSS_TEXTAREA

public static final String CSS_TEXTAREA
See Also:
Constant Field Values

CSS_RICHTEXT

public static final String CSS_RICHTEXT
See Also:
Constant Field Values

CSS_RICHTEXT_POPUP

public static final String CSS_RICHTEXT_POPUP
See Also:
Constant Field Values

CSS_CHECKBOX

public static final String CSS_CHECKBOX
See Also:
Constant Field Values

CSS_RADIOBOX

public static final String CSS_RADIOBOX
See Also:
Constant Field Values

CSS_LABELBOX

public static final String CSS_LABELBOX
See Also:
Constant Field Values

CSS_COMBOBOX

public static final String CSS_COMBOBOX
See Also:
Constant Field Values

CSS_LISTBOX

public static final String CSS_LISTBOX
See Also:
Constant Field Values

CSS_TEXTFIELD

public static final String CSS_TEXTFIELD
See Also:
Constant Field Values

CSS_CHOOSERFIELD

public static final String CSS_CHOOSERFIELD
See Also:
Constant Field Values

CSS_CHOOSERLABELFIELD

public static final String CSS_CHOOSERLABELFIELD
See Also:
Constant Field Values

CSS_UNITS

public static final String CSS_UNITS
See Also:
Constant Field Values

CSS_MANDATORY

public static final String CSS_MANDATORY
See Also:
Constant Field Values

CSS_LABEL

public static final String CSS_LABEL
See Also:
Constant Field Values

CSS_DESCRIPTION

public static final String CSS_DESCRIPTION
See Also:
Constant Field Values

CSS_INFO

public static final String CSS_INFO
See Also:
Constant Field Values

ICON_CLEAR

public static final String ICON_CLEAR
See Also:
Constant Field Values

ICON_PLUS

public static final String ICON_PLUS
See Also:
Constant Field Values

ICON_ARROW_UP

public static final String ICON_ARROW_UP
See Also:
Constant Field Values

ICON_ARROW_DOWN

public static final String ICON_ARROW_DOWN
See Also:
Constant Field Values

ICON_ARROW_LEFT

public static final String ICON_ARROW_LEFT
See Also:
Constant Field Values

ICON_ARROW_RIGHT

public static final String ICON_ARROW_RIGHT
See Also:
Constant Field Values

ICON_TRASH

public static final String ICON_TRASH
See Also:
Constant Field Values

ICON_DATE

public static final String ICON_DATE
See Also:
Constant Field Values

ICON_FOLDER

public static final String ICON_FOLDER
See Also:
Constant Field Values

ICON_IMAGE_CHOOSER

public static final String ICON_IMAGE_CHOOSER
See Also:
Constant Field Values

ICON_MEDIA_CHOOSER

public static final String ICON_MEDIA_CHOOSER
See Also:
Constant Field Values

ICON_COLOR_CHOOSER

public static final String ICON_COLOR_CHOOSER
See Also:
Constant Field Values

ICON_QUERY_CHOOSER

public static final String ICON_QUERY_CHOOSER
See Also:
Constant Field Values

ICON_MEMBER_CHOOSER

public static final String ICON_MEMBER_CHOOSER
See Also:
Constant Field Values

ICON_GROUP_CHOOSER

public static final String ICON_GROUP_CHOOSER
See Also:
Constant Field Values

ICON_WORKSPACE_CHOOSER

public static final String ICON_WORKSPACE_CHOOSER
See Also:
Constant Field Values

ICON_CATEGORY_CHOOSER

public static final String ICON_CATEGORY_CHOOSER
See Also:
Constant Field Values

ICON_PUB_CHOOSER

public static final String ICON_PUB_CHOOSER
See Also:
Constant Field Values

ICON_DBRECORD_CHOOSER

public static final String ICON_DBRECORD_CHOOSER
See Also:
Constant Field Values

ICON_DOC_CHOOSER

public static final String ICON_DOC_CHOOSER
See Also:
Constant Field Values

HAS_RICHTEXT

public static final String HAS_RICHTEXT
Name of the Boolean attribute added to the request when the current request contains one or more Rich Text editor.

Constructor Detail

WidgetUtil

public WidgetUtil()
Method Detail

getHtmlIcon

public static String getHtmlIcon(String src,
                                 String title)
Build an icon

Parameters:
src - the image source
title - the image title
Returns:
the image tag representation

getHtmlIcon

public static String getHtmlIcon(String src,
                                 String title,
                                 String alt)
Build an icon

Parameters:
src - the image source
title - the image title
alt - the image alt
Returns:
the image tag representation

getHtmlIcon

public static String getHtmlIcon(String src,
                                 String title,
                                 String id,
                                 String style,
                                 String onclick)
Build an icon

Parameters:
src - the image URL
title - the image title
id - the id
style - the style
onclick - the onclick value
Returns:
the image tag representation

getHtmlIcon

public static String getHtmlIcon(String src,
                                 String title,
                                 String alt,
                                 String id,
                                 String style,
                                 String onclick)
Build an icon

Parameters:
src - the image URL
title - the image title
alt - the image alt
id - the id
style - the style
onclick - the onclick value
Returns:
the image tag representation

getHtmlHidden

public static String getHtmlHidden(String widgetName,
                                   String value)
Convenient method that build an input hidden field calling printHiddenField

Parameters:
widgetName - the name of the hidden field
value - the value of the hidden field
Returns:
the hidden tag

getLangTab

public static String getLangTab(String widget,
                                String lang)
Return ONE Lang Tab for a given lang with a given widget has content.

Parameters:
widget - the widget to put
lang - the lang of the tab
Returns:
String for the given lang tab TODO: I18N Lang Alt

getPropertyEditor

public static String getPropertyEditor(String name)
Returns the editor associated to the given default Property.

Parameters:
name - the default property name
Returns:
String the default property editor

getShortProperty

public static String getShortProperty(String key)
Return the value of the property without the editor value

Parameters:
key - the full extra key
Returns:
String the short key

getShortProperty

public static String getShortProperty(String key,
                                      String editor)
Return the value of the property without the editor value

Parameters:
key - the full extra key
editor - the editor
Returns:
String the short key

printHtmlButton

public static String printHtmlButton(String widgetName,
                                     String value,
                                     boolean submit,
                                     String onClick,
                                     boolean isMainAction)
Print an HTML Button

Parameters:
widgetName - the name of the button
value - the value of the button
submit - is a submit button
onClick - is onClick action
isMainAction - if true use
Returns:
the String representation of the button

printHtmlButton

public static String printHtmlButton(String widgetName,
                                     String value,
                                     boolean submit,
                                     String onClick,
                                     boolean isMainAction,
                                     int tabindex)

printPopupButton

public static String printPopupButton(String label,
                                      String url)

printSubmitButton

public static String printSubmitButton(String label,
                                       String action)
Return a Submit HTML Button with a given label/action

Parameters:
label - the label of the button
action - the name of the action while submitting
Returns:
a String representation

printSubmitButton

public static String printSubmitButton(String label,
                                       String action,
                                       int tabindex)

printSubmitFormButton

public static String printSubmitFormButton(String label,
                                           String action,
                                           String formName,
                                           String userLang)
Display a Button that will submit form for a given action

Parameters:
label - the label of the button
action - the name of the action while submitting
formName - the name of the form
userLang - the current userLang
Returns:
the String representation of the button

printSubmitFormButton

public static String printSubmitFormButton(String label,
                                           String action,
                                           String formName,
                                           String userLang,
                                           int tabindex)

printConfirmSubmitFormButton

public static String printConfirmSubmitFormButton(String label,
                                                  String action,
                                                  String formName,
                                                  String msg,
                                                  String userLang)
Display a Button that will ask to confirm the action

Parameters:
label - the label of the button
action - the name of the action while submitting
formName - the name of the form
msg - an I18N confirm message
userLang - the current userLang
Returns:
the String representation of the button

printConfirmSubmitFormButton

public static String printConfirmSubmitFormButton(String label,
                                                  String action,
                                                  String formName,
                                                  String msg,
                                                  String userLang,
                                                  int tabindex)

printHiddenField

public static void printHiddenField(StringBuffer sb,
                                    String widgetName,
                                    String value,
                                    String style,
                                    String id)
Print Hidden Input

Parameters:
sb - the Buffer
widgetName - the widget name
value - the value
style -
id -

printHiddenField

public static void printHiddenField(StringBuffer sb,
                                    String widgetName,
                                    String value)
Print Hidden Input

Parameters:
sb - the Buffer
widgetName - the widget name
value - the value

printTextArea

public static void printTextArea(StringBuffer sb,
                                 String fieldId,
                                 String fieldName,
                                 String fieldValue,
                                 int cols,
                                 int rows,
                                 int tabindex,
                                 boolean escapeEntities,
                                 boolean disabled,
                                 String customs,
                                 String lang)
Print a Text Area

Parameters:
sb - the Buffer
fieldId - the id of the field
fieldName - the name of the widget
fieldValue - the value of the widget
cols - the length of the field
rows - the height of the field
tabindex - the tab index
disabled - tell if the field must be disabled
escapeEntities - should entities be escaped
customs - custom attributes
lang - the language (ISO-639) of this text area or null for default site language.

printRichTextZone

public static void printRichTextZone(StringBuffer sb,
                                     String fieldName,
                                     String fieldValue,
                                     int cols,
                                     int rows,
                                     int tabindex,
                                     int count,
                                     boolean inline,
                                     String wysiwygParams,
                                     String lang)
Print a Rich Text Area

Parameters:
sb - the Buffer
fieldName - the name of the widget
fieldValue - the value of the widget
cols - the "TextArea" like cols
rows - the "TextArea" like rows
tabindex - the tab index
count - for multivalued fields, this is the index of the textarea
inline - set to false to use a popup edition (instead of the inline editor, a preview/source zone is displayed with a edit button which opens a popup)
wysiwygParams - the wysiwyg parameters
lang - the language (ISO-639) of this rich text zone or null for default site language.

addWysiwygJavaScripts

public static void addWysiwygJavaScripts(JcmsJspContext jcmsContext)
Add the required JavaScript files to the current context

Parameters:
jcmsContext -

printInputBox

public static void printInputBox(StringBuffer sb,
                                 String inputId,
                                 String fieldName,
                                 String fieldValue,
                                 String fieldLabel,
                                 boolean check,
                                 boolean selected,
                                 boolean disabled,
                                 int tabindex,
                                 String lang)
Print an input Checkbox or Radio button

Parameters:
sb - the buffer
inputId -
fieldName - the name of the widget
fieldValue - the value of the widget
fieldLabel - the label of the widget
check - checkbox or radio button ?
selected - selected or not ?
disabled - true to disabled the input box
tabindex -
lang - the language (ISO-639) of this text area or null for default site language.
Since:
6.0

printInputBox

public static String printInputBox(String fieldId,
                                   String fieldName,
                                   String fieldValue,
                                   String fieldLabel,
                                   boolean check,
                                   boolean selected,
                                   boolean disabled,
                                   int tabindex,
                                   String lang)

printInputBoxList

public static void printInputBoxList(StringBuffer sb,
                                     Collection<?> fieldIds,
                                     String fieldName,
                                     Collection<?> fieldValue,
                                     Collection<?> fieldLabel,
                                     boolean check,
                                     Collection<?> selected,
                                     boolean br,
                                     boolean disabled,
                                     int tabindex,
                                     String lang)
Print an html list of check/radio box

Parameters:
sb - the buffer
fieldIds - the DOM ids item : must be null or contains as many elements as fieldValue and fieldLabel
fieldName - the name of the widget
fieldValue - the values of the widget
fieldLabel - the labels of the widget
check - checkbox or radio button ?
selected - a Set of selected values
br - should append br
disabled - true to disabled the inputs
tabindex -
lang - the language (ISO-639) of this text area or null for default site language.
Since:
6.0

printInputComboBox

public static void printInputComboBox(StringBuffer sb,
                                      String fieldId,
                                      String fieldName,
                                      Collection<?> fieldValue,
                                      Collection<?> fieldLabel,
                                      String selected,
                                      boolean blank,
                                      int tabindex,
                                      boolean disabled,
                                      String custom,
                                      String lang)
Print a ComboBox

Parameters:
sb - the buffer
fieldId - the id of the field
fieldName - the name of the widget
fieldValue - the values of the widget
fieldLabel - the labels of the widget
selected - the selected String
blank -
disabled - true to disable the combo box
tabindex -
custom - custom html attribute to be added inside the select tag
lang - the language (ISO-639) of this text area or null for default site language.
Since:
jcms-6.0

printInputListBox

public static void printInputListBox(StringBuffer sb,
                                     String fieldId,
                                     String fieldName,
                                     int size,
                                     Collection<?> fieldValue,
                                     Collection<?> fieldLabel,
                                     Collection<?> selected,
                                     boolean disabled,
                                     int tabindex,
                                     String customs,
                                     String lang)
Print a ListBox

Parameters:
sb - the buffer
fieldId - the id of the field
fieldName - the name of the widget
size - size of the select
fieldValue - the values of the widget
fieldLabel - the labels of the widget
selected - the selected String
disabled - true to disabled the input listbox
tabindex -
customs - custom html attribute to be added inside the select tag
lang - the language (ISO-639) of this text area or null for default site language.
Since:
jcms-6.0

printInputField

protected static void printInputField(StringBuffer sb,
                                      String fieldType,
                                      String fieldId,
                                      String fieldName,
                                      String fieldValue,
                                      int cols,
                                      int colsMax,
                                      int tabindex,
                                      boolean disabled,
                                      String css,
                                      String customs,
                                      String lang)
Print a Text Input

Parameters:
sb - the Buffer
fieldType - the type of field
fieldId - the DOM id of the input
fieldName - the name of the widget
fieldValue - the value of the widget
cols - the length of the field
colsMax - the max chars in the field
tabindex - the tab index
css - the css style of the input
customs - some custom data to add at the end of the tag
lang - the language (ISO-639) of this text area or null for default site language.

printInputField

public static void printInputField(StringBuffer sb,
                                   String fieldId,
                                   String fieldName,
                                   String fieldValue,
                                   int cols,
                                   int colsMax,
                                   int tabindex,
                                   boolean disabled,
                                   String custom,
                                   String lang)
A Convenient method to print a TextField

Parameters:
sb - the Buffer
fieldId - the id of the field
fieldName - the name of the field
fieldValue - the value of te field
cols - the number of cols
colsMax - the max cols
tabindex - the tab index
disabled - true to disable the input
custom - some custom data to add at the end of the tag
lang - the language (ISO-639) of this text area or null for default site language.

printInputField

public static void printInputField(StringBuffer sb,
                                   String fieldId,
                                   String fieldName,
                                   String fieldValue,
                                   int cols,
                                   boolean disabled,
                                   String lang)
A Convenient method to print a TextField

Parameters:
sb - the Buffer
fieldId - the id of the field
fieldName - the name of the field
fieldValue - the value of te field
cols - the number of cols
disabled - true to disable the input
lang - the language (ISO-639) of this text area or null for default site language.

printPasswordField

public static void printPasswordField(StringBuffer sb,
                                      String fieldId,
                                      String fieldName,
                                      String fieldValue,
                                      int cols,
                                      int colsMax,
                                      int tabindex,
                                      boolean disabled,
                                      String customs,
                                      String lang)
A Convenient method to print a PasswordField

Parameters:
sb - the Buffer
fieldId - the id of the field
fieldName - the name of the field
fieldValue - the value of te field
cols - the number of cols
colsMax - the max cols
tabindex - the tab index
disabled -
customs - some custom data to add at the end of the tag
lang - the language (ISO-639) of this text area or null for default site language.

print2InputField

public static void print2InputField(StringBuffer sb,
                                    String fieldId,
                                    String fieldName,
                                    String fieldLabel,
                                    String fieldValue,
                                    int cols,
                                    int tabindex,
                                    boolean disabled,
                                    String lang,
                                    boolean showIDField)
Print 2 Input Fields for chooser

Parameters:
sb - the Buffer
fieldId - the id of the field
fieldName - the field name
fieldLabel - the field labels (disable)
fieldValue - the field values
cols -
tabindex - the tab index
disabled - true to disable the input
lang - the language (ISO-639) of this text area or null for default site language.
showIDField - whether to use a text input (true), or an hidden input (false) for the second field.

printClearIconField

public static void printClearIconField(StringBuffer sb,
                                       String formField,
                                       String formName,
                                       String def,
                                       String userLang,
                                       int pos)
Print Red Cross to clear a Field in a Form

Parameters:
sb - the Buffer
formField - the field name
formName - the icon title
def - the default clear value
userLang - the user language
pos - the relative widget position

printClearIconField

public static void printClearIconField(StringBuffer sb,
                                       String formField,
                                       String formName,
                                       String def,
                                       String userLang,
                                       int pos,
                                       String func)
Print Red Cross to clear a Field in a Form

Parameters:
sb - the Buffer
formField - the field name
formName - the icon title
def - the default clear value
userLang - the user language
pos - the relative widget position
func - the function to run after

print2ClearIconField

public static void print2ClearIconField(StringBuffer sb,
                                        String formField,
                                        String formName,
                                        String def,
                                        String userLang,
                                        int pos)
Print Red Cross to clear a 2 Field in a Form

Parameters:
sb - the Buffer
formField - the field name
formName - the icon title
def - the default clear value
userLang - the user language
pos - the relative widget position

printAddCountIcon

public static void printAddCountIcon(StringBuffer sb,
                                     String formField,
                                     String formFieldGroup,
                                     String formName,
                                     String userLang,
                                     int addCount,
                                     int langCount,
                                     String widgetId)
Print the plus icon to add more fields to a field list

Parameters:
sb - the buffer
formField - the field name
formFieldGroup - the field group
formName - the form Name
userLang - the user language
addCount - the number of fields to add
langCount - the number of lang count
widgetId - the widgetId id

printTrashIconField

public static void printTrashIconField(StringBuffer sb,
                                       String formField,
                                       String formName,
                                       String userLang,
                                       int pos,
                                       String widgetId)
Print Trash Icon to move fields

Parameters:
sb - the Buffer
formField - the field name
formName - the icon title
userLang - the user language
pos - the relative widget position
widgetId -

printTrash2IconField

public static void printTrash2IconField(StringBuffer sb,
                                        String formField,
                                        String formName,
                                        String userLang,
                                        int pos,
                                        int relFirst,
                                        String widgetId)

printTrash3IconField

public static void printTrash3IconField(StringBuffer sb,
                                        String formField,
                                        String formName,
                                        String userLang,
                                        int pos,
                                        int relFirst,
                                        String widgetId)

printUpIconField

public static void printUpIconField(StringBuffer sb,
                                    String formField,
                                    String formName,
                                    String userLang,
                                    int pos,
                                    String widgetId)
Print Arrow Up Icon to move fields

Parameters:
sb - the Buffer
formField - the field name
formName - the icon title
userLang - the user language
pos - the relative widget position
widgetId -

printUp2IconField

public static void printUp2IconField(StringBuffer sb,
                                     String formField,
                                     String formName,
                                     String userLang,
                                     int pos,
                                     int relFirst,
                                     String widgetId)

printUp3IconField

public static void printUp3IconField(StringBuffer sb,
                                     String formField,
                                     String formName,
                                     String userLang,
                                     int pos,
                                     int relFirst,
                                     String widgetId)

printDownIconField

public static void printDownIconField(StringBuffer sb,
                                      String formField,
                                      String formName,
                                      String userLang,
                                      int pos,
                                      String widgetId)
Print Arrow Down Icon to move fields

Parameters:
sb - the Buffer
formField - the field name
formName - the icon title
userLang - the user language
pos - the relative widget position
widgetId -

printDown2IconField

public static void printDown2IconField(StringBuffer sb,
                                       String formField,
                                       String formName,
                                       String userLang,
                                       int pos,
                                       int relFirst,
                                       String widgetId)

printDown3IconField

public static void printDown3IconField(StringBuffer sb,
                                       String formField,
                                       String formName,
                                       String userLang,
                                       int pos,
                                       int relFirst,
                                       String widgetId)

printLeftIconField

public static void printLeftIconField(StringBuffer sb,
                                      String formField,
                                      String formName,
                                      String userLang,
                                      int pos,
                                      String widgetId)
Print Arrow Left Icon to move fields

Parameters:
sb - the Buffer
formField - the field name
formName - the icon title
userLang - the user language
pos - the relative widget position
widgetId -

printLeft2IconField

public static void printLeft2IconField(StringBuffer sb,
                                       String formField,
                                       String formName,
                                       String userLang,
                                       int pos,
                                       int relFirst,
                                       String widgetId)

printLeft3IconField

public static void printLeft3IconField(StringBuffer sb,
                                       String formField,
                                       String formName,
                                       String userLang,
                                       int pos,
                                       int relFirst,
                                       String widgetId)

printRightIconField

public static void printRightIconField(StringBuffer sb,
                                       String formField,
                                       String formName,
                                       String userLang,
                                       int pos,
                                       String widgetId)
Print Arrow Right Icon to move fields

Parameters:
sb - the Buffer
formField - the field name
formName - the icon title
userLang - the user language
pos - the relative widget position
widgetId -

printRight2IconField

public static void printRight2IconField(StringBuffer sb,
                                        String formField,
                                        String formName,
                                        String userLang,
                                        int pos,
                                        int relFirst,
                                        String widgetId)

printRight3IconField

public static void printRight3IconField(StringBuffer sb,
                                        String formField,
                                        String formName,
                                        String userLang,
                                        int pos,
                                        int relFirst,
                                        String widgetId)

getDateChooserJSlang

public static String getDateChooserJSlang(String userLang)
Return the language that can be used for the javascript file to be included for the date chooser.

Parameters:
userLang - user lang
Returns:
a language

printDateChooser

public static void printDateChooser(StringBuffer sb,
                                    boolean inPopup,
                                    String ctxPath,
                                    String formField,
                                    String formName,
                                    String alt,
                                    int pos,
                                    boolean showTime,
                                    boolean showWeekNumbers)
Print the Date Chooser Icon

Parameters:
sb - the buffer
inPopup -
ctxPath - the context path
formField - the field name
formName - the form name
alt - the description
pos - the relative position
showTime - whether to show time or not in calendar
showWeekNumbers - whether to show time or not in calendar *Not Implemented yet* //FIXME

printFileChooser

public static void printFileChooser(StringBuffer sb,
                                    String ctxPath,
                                    String path,
                                    String formField,
                                    String formName,
                                    String userLang,
                                    int pos)
Print Folder icon linked to old filechooser

Parameters:
sb - the Buffer
ctxPath - the context path
path -
formField - the field name
formName - the icon title
userLang - the user language
pos - the relative widget position

printImageChooser

public static void printImageChooser(StringBuffer sb,
                                     String ctxPath,
                                     String formField,
                                     String formName,
                                     String userLang,
                                     int pos,
                                     boolean pub)
Print the folder icon linked to the image chooser.

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the icon title
userLang - the user language
pos - the relative widget position
pub -

printImageChooser

public static String printImageChooser(String ctxPath,
                                       String formField,
                                       String formName,
                                       String alt,
                                       int pos,
                                       boolean pub)
Print Folder icon linked to image chooser

Parameters:
ctxPath - the context path
formField - the field name
formName - the icon title
alt - the icon alt
pos - the relative widget position
pub -
Returns:
the String representation

printMediaChooser

public static void printMediaChooser(StringBuffer sb,
                                     String ctxPath,
                                     String formField,
                                     String formName,
                                     String userLang,
                                     int pos,
                                     boolean pub)
Print the icon linked to the media chooser.

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the icon title
userLang - the user language
pos - the relative widget position
pub -

printMediaChooser

public static String printMediaChooser(String ctxPath,
                                       String formField,
                                       String formName,
                                       String alt,
                                       int pos,
                                       boolean pub)
Print icon linked to old media chooser

Parameters:
ctxPath - the context path
formField - the field name
formName - the icon title
alt - the icon alt
pos - the relative widget position
pub -
Returns:
the String representation

printColorChooser

public static void printColorChooser(StringBuffer sb,
                                     String ctxPath,
                                     String formField,
                                     String formName,
                                     String userLang,
                                     int pos)
Print ColorChooser icon

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the icon title
userLang - the userLang
pos - the relative widget position

printQueryChooser

public static void printQueryChooser(StringBuffer sb,
                                     String ctxPath,
                                     String formField,
                                     String formName,
                                     String alt,
                                     int pos)
Print Query icon linked to querychooser

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the icon title
alt - the icon alt
pos - the relative widget position

printMemberChooser

public static void printMemberChooser(StringBuffer sb,
                                      String ctxPath,
                                      String formField,
                                      String formName,
                                      String alt,
                                      int pos,
                                      String chooserQS)
Print a Member Chooser

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the form name
alt - the icon alt
pos - the relative widget position
chooserQS - queryString for the chooser

printGroupChooser

public static void printGroupChooser(StringBuffer sb,
                                     String ctxPath,
                                     String formField,
                                     String formName,
                                     String alt,
                                     int pos,
                                     String chooserQS)
Print a Group Chooser

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the form name
alt - the icon alt
pos - the relative widget position
chooserQS - queryString for the chooser

printWorkspaceChooser

public static void printWorkspaceChooser(StringBuffer sb,
                                         String ctxPath,
                                         String formField,
                                         String formName,
                                         String alt,
                                         int pos,
                                         String chooserQS)
Print a Workspace Chooser

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the form name
alt - the icon alt
pos - the relative widget position
chooserQS - queryString for the chooser

printCategoryChooser

public static void printCategoryChooser(StringBuffer sb,
                                        String ctxPath,
                                        String formField,
                                        String formName,
                                        String alt,
                                        int pos,
                                        String chooserQS)
Print a Category Chooser

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the form name
alt - the icon alt
pos - the relative widget position
chooserQS - queryString for the chooser

printPubChooser

public static void printPubChooser(StringBuffer sb,
                                   String ctxPath,
                                   String formField,
                                   String formName,
                                   String alt,
                                   int pos,
                                   String chooserQS)
Print a Pub Chooser

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the form name
alt - the icon alt
pos - the relative widget position
chooserQS - queryString for the chooser

printPubsChooser

public static void printPubsChooser(StringBuffer sb,
                                    String ctxPath,
                                    String formField,
                                    String formName,
                                    String alt,
                                    int pos,
                                    String chooserQS)
Print a Pubs Chooser

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the form name
alt - the icon alt
pos - the relative widget position
chooserQS - queryString for the chooser

printDBRecordChooser

public static void printDBRecordChooser(StringBuffer sb,
                                        String ctxPath,
                                        String formField,
                                        String formName,
                                        String alt,
                                        int pos,
                                        String chooserQS)
Print a DBRecord Chooser

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the form name
alt - the icon alt
pos - the relative widget position
chooserQS - queryString for the chooser

printDataSourceSelect

public static void printDataSourceSelect(StringBuffer sb,
                                         String widgetName,
                                         String dataSource,
                                         String userLang)
This method write to the buffer a select box of sql datasource. With the correct selected datasource.

Parameters:
sb - the Buffer
widgetName - the widget name
dataSource - the selected datasource
userLang - the userlang
Since:
jcms-5.5.0

printDocChooser

public static void printDocChooser(StringBuffer sb,
                                   String ctxPath,
                                   String formField,
                                   String formName,
                                   String msgLang,
                                   int pos,
                                   int nbElt,
                                   FileDocument doc)
Print the Doc Chooser icon

Parameters:
sb - the Buffer
ctxPath - the context path
formField - the field name
formName - the form name
msgLang - the userLang
pos - the relative position
nbElt - the number of element to display
doc - the document

printHelpIconField

public static void printHelpIconField(StringBuffer sb,
                                      String alt)
Print Help Icon to display help about the field

Parameters:
sb - the Buffer
alt - the icon title

printWikiToolbar

public static String printWikiToolbar(String formName,
                                      int widgetPos,
                                      JcmsContext ctx,
                                      String flag)
Parameters:
formName - the form name
widgetPos - the formElementCount
ctx - the JcmsContext
flag -
Returns:
String the toolbar

printImageMapToolbar

public static String printImageMapToolbar(String formName,
                                          String widgetName,
                                          int widgetPos,
                                          JcmsContext ctx)
Parameters:
formName - the form name
widgetName - the widget name
widgetPos - the formElementCount
ctx - the JcmsContext
Returns:
String the toolbar

printLangAttributes

public static void printLangAttributes(StringBuffer sb,
                                       String lang)
Appends the html language attributes to use for the given language. For example "lang='fr' xml:lang='fr' dir='ltr' " (note the spaces and without the double quotes). Nothing is appended if advanced I18N is not enabled in JCMS.

Parameters:
sb - the StringBuffer in which to append the class name
lang - the language of the class to generated or null to use default jcms language
See Also:
Channel.isUsingAdvancedI18N()

printUnits

public static void printUnits(StringBuffer sb,
                              String formUnit)
Print the units for field

Parameters:
sb - the Buffer
formUnit -

printMandatory

public static void printMandatory(StringBuffer sb)
Print the Mandatory for a given field

Parameters:
sb - the Buffer

printLabel

public static void printLabel(StringBuffer sb,
                              String formLabel,
                              String inputId)
Print the field Label

Parameters:
sb - the Buffer
formLabel -
inputId - if not null, the given label is linked to the input with DOM id

printLabel

public static void printLabel(StringBuffer sb,
                              String formLabel,
                              String[] inputId)
Print the field label.

Parameters:
sb -
formLabel -
inputId - array of ids of the input. Used in a "for" attribute.

printDescription

public static void printDescription(StringBuffer sb,
                                    String formDescription)
Print the field Description

Parameters:
sb - the Buffer
formDescription -

printInfo

public static void printInfo(StringBuffer sb,
                             String formInfo)
Print the field Info

Parameters:
sb - the Buffer
formInfo -

printSeparator

public static void printSeparator(StringBuffer sb,
                                  String formField)
Print a HR separator and an Anchor for the field

Parameters:
sb - the Buffer
formField - name

printMoveFormElement

protected static void printMoveFormElement(StringBuffer sb,
                                           String jsfunc,
                                           String formField,
                                           String formName,
                                           String action,
                                           String icon,
                                           String alt,
                                           int pos,
                                           int relFirst,
                                           String formFieldId)

printDataChooser

protected static void printDataChooser(StringBuffer sb,
                                       String ctxPath,
                                       String formField,
                                       String formName,
                                       String alt,
                                       int pos,
                                       String jsp,
                                       String chooserQS,
                                       int width,
                                       int height,
                                       String icon)


Copyright © 2001-2007 Jalios SA. All Rights Reserved.