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: 59848 $
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_SELECTBOX
           
static String CSS_TEXTAREA
           
static String CSS_TEXTFIELD
           
static String CSS_UNITS
           
static String CSS_UPLOADFIELD
           
static String CSS_WIKIWYG
           
static String CSS_WIKIWYG_POPUP
           
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_ACL_CHOOSER
           
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_DOC_RECHOOSER
           
static String ICON_EDIT
           
static String ICON_FIELD_DOWN
           
static String ICON_FIELD_UP
           
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_MULTILANG
           
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
           
static String SPRITE_ACL_CHOOSER
           
static String SPRITE_ADD
           
static String SPRITE_CAT_CHOOSER
           
static String SPRITE_CATEGORY_CHOOSER
           
static String SPRITE_CLEAR
           
static String SPRITE_COLOR_CHOOSER
           
static String SPRITE_DATE
           
static String SPRITE_DOC_CHOOSER
           
static String SPRITE_DOC_EYE
           
static String SPRITE_EYE
           
static String SPRITE_GROUP_CHOOSER
           
static String SPRITE_IMAGE_CHOOSER
           
static String SPRITE_MEDIA_CHOOSER
           
static String SPRITE_MEMBER_CHOOSER
           
static String SPRITE_PUB_CHOOSER
           
static String SPRITE_QUERY_CHOOSER
           
static String SPRITE_REMOVE
           
static String SPRITE_WORKSPACE_CHOOSER
           
 
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, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, 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, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_DEEP_COPY, OP_DEEP_DELETE, OP_DELETE, OP_MERGE, OP_UPDATE, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, 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, 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 addWikiwygJavaScripts(JcmsJspContext jcmsContext)
          Add the required JavaScript files to the current context
static void addWysiwygJavaScripts(JcmsJspContext jcmsContext)
          Add the required JavaScript files to the current context
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 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 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 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 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 customAttributes, 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 String printInputBox(String fieldId, String fieldName, String fieldValue, String fieldLabel, boolean check, boolean selected, boolean disabled, int tabindex, String customAttributes, 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 customAttributes, 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 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 printMandatory(StringBuffer sb)
          Print the Mandatory for a given field
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 String printPopupButton(String label, String url)
           
static void printRichTextZone(StringBuffer sb, String fieldName, String fieldValue, int cols, int rows, int tabindex, int count, boolean inline, String wysiwygParams, String wysiwygCss, String lang)
          Print a Rich Text Area
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 printUnits(StringBuffer sb, String formUnit)
          Print the units for field
static void printWikiwyg(StringBuffer sb, String fieldName, String fieldValue, int cols, int rows, int tabindex, int count, boolean inline, String wysiwygParams, String lang)
          Print a Wysiwyg Wiki Text Area
 
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_WIKIWYG

public static final String CSS_WIKIWYG
See Also:
Constant Field Values

CSS_WIKIWYG_POPUP

public static final String CSS_WIKIWYG_POPUP
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_SELECTBOX

public static final String CSS_SELECTBOX
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_UPLOADFIELD

public static final String CSS_UPLOADFIELD
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_EDIT

public static final String ICON_EDIT
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_FIELD_UP

public static final String ICON_FIELD_UP
See Also:
Constant Field Values

ICON_FIELD_DOWN

public static final String ICON_FIELD_DOWN
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

ICON_DOC_RECHOOSER

public static final String ICON_DOC_RECHOOSER
See Also:
Constant Field Values

ICON_ACL_CHOOSER

public static final String ICON_ACL_CHOOSER
See Also:
Constant Field Values

ICON_MULTILANG

public static final String ICON_MULTILANG
See Also:
Constant Field Values

SPRITE_CLEAR

public static final String SPRITE_CLEAR
See Also:
Constant Field Values

SPRITE_REMOVE

public static final String SPRITE_REMOVE
See Also:
Constant Field Values

SPRITE_ADD

public static final String SPRITE_ADD
See Also:
Constant Field Values

SPRITE_COLOR_CHOOSER

public static final String SPRITE_COLOR_CHOOSER
See Also:
Constant Field Values

SPRITE_IMAGE_CHOOSER

public static final String SPRITE_IMAGE_CHOOSER
See Also:
Constant Field Values

SPRITE_MEDIA_CHOOSER

public static final String SPRITE_MEDIA_CHOOSER
See Also:
Constant Field Values

SPRITE_DOC_CHOOSER

public static final String SPRITE_DOC_CHOOSER
See Also:
Constant Field Values

SPRITE_PUB_CHOOSER

public static final String SPRITE_PUB_CHOOSER
See Also:
Constant Field Values

SPRITE_CAT_CHOOSER

public static final String SPRITE_CAT_CHOOSER
See Also:
Constant Field Values

SPRITE_EYE

public static final String SPRITE_EYE
See Also:
Constant Field Values

SPRITE_DOC_EYE

public static final String SPRITE_DOC_EYE
See Also:
Constant Field Values

SPRITE_DATE

public static final String SPRITE_DATE
See Also:
Constant Field Values

SPRITE_QUERY_CHOOSER

public static final String SPRITE_QUERY_CHOOSER
See Also:
Constant Field Values

SPRITE_MEMBER_CHOOSER

public static final String SPRITE_MEMBER_CHOOSER
See Also:
Constant Field Values

SPRITE_GROUP_CHOOSER

public static final String SPRITE_GROUP_CHOOSER
See Also:
Constant Field Values

SPRITE_WORKSPACE_CHOOSER

public static final String SPRITE_WORKSPACE_CHOOSER
See Also:
Constant Field Values

SPRITE_CATEGORY_CHOOSER

public static final String SPRITE_CATEGORY_CHOOSER
See Also:
Constant Field Values

SPRITE_ACL_CHOOSER

public static final String SPRITE_ACL_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

printRichTextZone

public static void printRichTextZone(StringBuffer sb,
                                     String fieldName,
                                     String fieldValue,
                                     int cols,
                                     int rows,
                                     int tabindex,
                                     int count,
                                     boolean inline,
                                     String wysiwygParams,
                                     String wysiwygCss,
                                     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
wysiwygCss - WYSIWYG css to use instead of the expected "formRichText" or "formRichTextPopup". Used to trigger a custom configuration of TinyMCE editor
lang - the language (ISO-639) of this rich text zone or null for default site language.

printWikiwyg

public static void printWikiwyg(StringBuffer sb,
                                String fieldName,
                                String fieldValue,
                                int cols,
                                int rows,
                                int tabindex,
                                int count,
                                boolean inline,
                                String wysiwygParams,
                                String lang)
Print a Wysiwyg Wiki 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.

addWikiwygJavaScripts

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

Parameters:
jcmsContext -

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 customAttributes,
                                 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 -
customAttributes - the custom attributes to add to each input
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)

printInputBox

public static String printInputBox(String fieldId,
                                   String fieldName,
                                   String fieldValue,
                                   String fieldLabel,
                                   boolean check,
                                   boolean selected,
                                   boolean disabled,
                                   int tabindex,
                                   String customAttributes,
                                   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 customAttributes,
                                     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 -
customAttributes - the custom attributes to add to each input
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

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

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-2010 Jalios SA. All Rights Reserved.