com.jalios.jcms.handler
Class JcmsFormHandler

java.lang.Object
  extended by com.jalios.jcms.context.JcmsContext
      extended by com.jalios.jcms.context.JcmsJspContext
          extended by com.jalios.jcms.handler.JcmsFormHandler
All Implemented Interfaces:
JcmsConstants, JaliosConstants
Direct Known Subclasses:
AbstractCaddyManagerHandler, AbstractQueryHandler, AdminSearchEnginesHandler, AuthKeyGeneratorHandler, CacheManagerHandler, CheckRightsHandler, DeployManagerDownloadHandler, DeployManagerUpgradeHandler, DeployManagerUpgradeUploadHandler, DisplayPluginHandler, EditDataHandler, EditDataIdHandler, EditImageHandler, EditPluginHandler, ExportRawStatDataHandler, FileProcessorAdminHandler, FriendlyURLsHandler, ImportCatListHandler, ImportConflictHandler, ImportManagerHandler, JSyncManagerHandler, LegacyWitnessFileImportHandler, LoadJcms5DataHandler, MailEditHandler, MailPasswordHandler, MemberListHandler, MergeCategoryHandler, PortletWorkflowHandler, ProfilerHandler, PropertiesHandler, PubBrowserHandler, ResetPasswordHandler, StoreCleanerHandler, SwitchAccessibilityContextHandler, SyncLdapHandler, TypeEditorHandler, TypeListEditorHandler, UpgradeManagerHandler, WFEditorHandler, WorkReportHandler, WorkspaceWizardHandler, ZipFilesHandler

public abstract class JcmsFormHandler
extends JcmsJspContext
implements JcmsConstants

This abstract class is the super class of all the Form Handler classes (i.e. JavaBean classes used in JSP pages for processing form).

To implement a custom form handler :

The following example demonstrate uses of a form handler to receive a firstname as an input and when validated display a Hello World message to the user

Java file com.example.jcmsplugin.hello.HelloWorldHandler.java:
 package com.example.jcmsplugin.hello;
 
 import java.io.IOException;
 
 import com.jalios.jcms.HttpUtil;
 import com.jalios.jcms.context.JcmsMessage;
 import com.jalios.jcms.context.JcmsMessage.Level;
 import com.jalios.jcms.handler.JcmsFormHandler;
 import com.jalios.util.Util;
 
 public class HelloWorldHandler extends JcmsFormHandler {
 
   // Possible operations
   private boolean opSayHello = false;
   private boolean opCancel = false;
 
   // Member variables
   private String firstname = null; 
 
   @Override
   public boolean processAction() throws IOException {
     
     if (validateSayHello()) {
       return performSayHello();
     }
 
     if (validateCancel()) {
       return performCancel();
     }
 
     return false;
   }
 
   // ---------------------------------------------------------------
   // Say Hello
   // ---------------------------------------------------------------
 
   public boolean validateSayHello() {
     if (!opSayHello) {
       return false;
     }
     if (Util.isEmpty(this.firstname)) {
       addMsg(new JcmsMessage(Level.WARN, glp("jcmsplugin.myplugin.myhandler.missing-firsname")));
       return false;
     }
     return true;
   }
 
   public boolean performSayHello() throws IOException {
     // In I18N properties : 
     //   jcmsplugin.myplugin.myhandler.say-hello: Hello {0} !
     //
     addMsgSession(request, new JcmsMessage(Level.INFO,  glp("jcmsplugin.myplugin.myhandler.say-hello", HttpUtil.encodeForHTML(firstname))));
     return false;
   }
 
   // ---------------------------------------------------------------
   // Cancel
   // ---------------------------------------------------------------
 
   public boolean validateCancel() {
     return opCancel;
   }
 
   public boolean performCancel() throws IOException {
     sendRedirect(Util.notEmpty(redirect) ? redirect : "index.jsp");
     return true;
   }
 
   // ---------------------------------------------------------------
   // Setters
   // ---------------------------------------------------------------
 
   public void setOpSayHello(String opSayHello) {
     this.opSayHello = true;
   }
 
   public void setOpCancel(String opCancel) {
     this.opCancel = true;
   }
 
 
   public String getFirstname() {
     return this.firstname;
   }
   public void setFirstname(String firstname) {
     this.firstname = firstname;
   }
 }
 
JSP sayHello.jsp:
 <%@ include file='/jcore/doInitPage.jsp' %><%
 %><jsp:useBean id="formHandler" scope="page" class="com.example.jcmsplugin.hello.HelloWorldHandler"><%
  %><jsp:setProperty name="formHandler" property="request" value="<%= request %>" /><%
  %><jsp:setProperty name="formHandler" property="response" value="<%= response %>" /><%
  %><jsp:setProperty name="formHandler" property="*" /><%
 %></jsp:useBean><%
 
   if (formHandler.validate()) {
     return;
   }
 
 
 %><%@ include file='/jcore/doEmptyHeader.jsp' %><%
 %><%@ include file='/jcore/doMessageBox.jsp' %>
 
 <div id='hello'>
  <form action="sayHello.jsp" name="sayHelloForm" method="post">
   <%-- Inputs --%>
   <jalios:widget  editor          ='<%= AbstractWidget.UI_EDITOR_TEXTFIELD %>'
                   widgetName      ='<%= "firstname" %>'
                   formName        ='<%= "sayHelloForm" %>'
                   value           ='<%= formHandler.getFirstname() %>'
                   label           ='<%= glp("ui.adm.mbr-edit.lbl.f-name") %>'
                   printLabel      ='<%= true %>'
   />
   <%-- Hidden Inputs --%>
   <% if (Util.notEmpty(formHandler.getRedirect())) { %>
   <input type="hidden" name="redirect" value="<%= encodeForHTMLAttribute(formHandler.getRedirect()) %>" />
   <% } %>
   <%-- Buttons --%>
   <%= WidgetUtil.printHtmlButton("opSayHello", glp("jcmsplugin.btn.sayhello"), true, null, true) %>
   <%= WidgetUtil.printHtmlButton("opCancel", glp("ui.com.btn.cancel"), true, null, false) %>
  </form>
 </div>
 
Data Handlers (handlers inheriting from EditDataHandler) must perform additionnal operation, see corresponding JavaDoc.

Version:
$Revision: 39432 $

Field Summary
protected  HashMap<String,Object> contextMap
           
protected  HashSet editFieldSet
           
protected  boolean noRedirect
           
protected  boolean noSendRedirect
           
protected  boolean popupEdition
           
protected  String redirect
           
protected  boolean redirectOnClosePopup
           
static String REVISION
           
protected  boolean workspaceForced
           
 
Fields inherited from class com.jalios.jcms.context.JcmsJspContext
AJAX_REQUEST_ATTRIBUTES, BODY_HEADER, CSS_HEADER, cssboMap, cssfoMap, CUSTOM_HEADER, editIcon, HTTPEQUIV_HEADER, httpequivMap, HTTPNAME_HEADER, httpnameMap, initEditIcon, JAVASCRIPT_CODE_SET_ATTRIBUTE, JAVASCRIPT_SET_ATTRIBUTE, jsboSet, jsfoSet, out, pageContext, SHOW_EDIT_ICON, STYLE_HEADER
 
Fields inherited from class com.jalios.jcms.context.JcmsContext
browser, caddy, channel, inFO, initDone, initWorkspace, isAdmin, isAjaxRequest, isDBMember, isDebug, isLogged, loggedMember, request, response, userCountry, userLang, userLocale, workspace
 
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
JcmsFormHandler()
           
 
Method Summary
protected  boolean afterValidation(boolean result)
           
protected  boolean checkMissingField(Object obj, String prop)
           
protected  HashMap<String,Object> getControllerContext()
          Build a controller context.
 HashSet getEditFieldSet()
           
 String getHiddenField(String name, boolean value)
           
 String getHiddenField(String name, boolean[] array)
           
 String getHiddenField(String name, Data value)
           
 String getHiddenField(String name, Data[] datas)
           
 String getHiddenField(String name, Date value)
           
 String getHiddenField(String name, Date[] array)
           
 String getHiddenField(String name, double value)
           
 String getHiddenField(String name, double[] array)
           
 String getHiddenField(String name, int value)
           
 String getHiddenField(String name, int[] array)
           
 String getHiddenField(String name, long value)
           
 String getHiddenField(String name, long[] array)
           
 String getHiddenField(String name, String value)
           
 String getHiddenField(String name, String[] array)
           
 String getHiddenFieldML(String name, HashMap<String,String> map)
           
protected  String getMainLangValue(String[] array, boolean trim, boolean escape)
          Returns the first value (i.e.
protected  String[] getMainLangValueArray(String[] array, boolean trim, boolean escape)
          Returns the first values (i.e.
protected  HashMap<String,String> getMLMap(String[] array, boolean trim, boolean escape)
          Returns the ML map (i.e.
protected  HashMap<String,String[]> getMLMapArray(String[] array, boolean trim, boolean escape)
          Returns the ML map (i.e.
 String getRedirect()
          Get the value of redirect.
 boolean getRedirectOnClosePopup()
          Return the value indicating whether the redirect value should be applied to the opener when closing the popup edition.
 Workspace getWorkspace()
          Retrieve the current Workspace variable for this context either from request if inFO or from session if in back office.
protected  void init()
          Method to implement if you need to initialize your handler from parameter received, prior to all security validation.
 boolean isFieldEdition(String field)
           
protected  boolean isFieldMissing(String field)
          Check if the given parameter is present in the query parameters
 boolean isPartialFieldEdition()
          Returns true if this is a partial field edition (i.e.
 boolean isPopupEdition()
           
 boolean isWorkspaceForced()
           
 boolean processAction()
          Method to be implemented to check/validate action to be performed and process them.
protected  boolean processStatus(ControllerStatus status)
          Process the ControllerStatus: do nothing if OK, or send on forbidden, or put a warning message in the request.
 void sendRedirect(String url)
          Redirect current request to given URL.
Overrides JcmsContext.sendRedirect(String) to use behavior provided by sendRedirect(String, boolean).
 void sendRedirect(String url, boolean checkRedirect)
          Set the redirect in the response.
 void setEditField(String[] v)
           
 void setNoRedirect(boolean noRedirect)
          Set the value of noRedirect.
 void setNoSendRedirect(boolean noSendRedirect)
          Set the value of noSendRedirect.
 void setPopupEdition(boolean v)
          Set where this form handler is being invoked in a popup.
 void setRedirect(String url)
          Set the value of redirect.
 void setRedirectOnClosePopup(boolean redirectOnClosePopup)
          Set whether the redirect value should be applied to the opener when closing the popup edition.
The value set by this method will be used only when using popup edition (setPopupEdition(boolean)).
 void setWorkspace(Workspace wspc)
           
 void setWs(String v)
           
protected  String updateUploadedField(String fieldName, String value, boolean isFileDocument, boolean override)
          Perform upload then, return value of the real File realtive path.
protected  void updateUploadedFields(String fieldName, String[] values, boolean isFileDocument, boolean override)
          Perform upload then, replace all values with value MultipartRequest.MULTIPART_UPLOAD with the real File realtive path.
 boolean validate()
          Method invoked by JSP to validate all conditions (authorization, parameters, ...), and eventualy trigger the action that was requested to the handler.
 
Methods inherited from class com.jalios.jcms.context.JcmsJspContext
addBodyAttributes, addCSSHeader, addCSSHeader, addCSSHeader, addCSSHeader, addCustomHeader, addHttpEquivHeader, addHttpNameHeader, addJavaScript, addJavaScript, addJavaScript, addJavaScriptCode, addStyleHeader, addStyleHeader, checkAccess, checkAccess, checkCSRF, debugDisplayContext, disablePacker, forceEditIcon, forceUpdate, getAjaxRequestAttribute, getAjaxRequestId, getAllHeadersDiffMap, getAllHeadersMap, getBackOfficeCSSHeader, getBackOfficeJavaScriptSet, getBodyAttributes, getContentForm, getCSSHeaders, getCtxCategories, getCurrentCategory, getCustomHeaders, getDocType, getFinalCSSMap, getFinalJavaScriptSet, getFormElementCount, getFrontOfficeCSSHeader, getFrontOfficeJavaScriptSet, getHttpEquivHeaders, getHttpNameHeaders, getJavaScriptCodeSet, getJavaScriptSet, getJSONBridge, getPackVersion, getPageContext, getPageTitle, getPageZone, getPortal, getPortalCategory, getPortlet, getPublication, getStyleHeaders, getTemplateUsage, internalSetupEmptyHeader, isEditIcon, isEditIcon, isPrintView, registerDisplayContext, removeAjaxRequestAttribute, setAjaxRequestAttribute, setAjaxRequestId, setAllHeadersDiffMap, setDocType, setEditIcon, setFormElementCount, setPageContext, setPageTitle, setPageZone, setShowEditIcon, setTemplateUsage, showEditIcon, showEditIcon, workaroundBrowserBaseHrefBug
 
Methods inherited from class com.jalios.jcms.context.JcmsContext
addCookie, addMsg, addMsg, addMsgSession, addMsgSession, applySelector, forceWorkspaceUpdate, getBaseUrl, getBrowser, getCaddy, getContextPath, getErrorMsg, getErrorMsgList, getErrorMsgSession, getErrorMsgSessionList, getInfoMsg, getInfoMsgList, getInfoMsgSession, getInfoMsgSessionList, getLoggedMember, getMsgList, getMsgSessionList, getRequest, getResponse, getSession, getUploadedFile, getUploadedFileList, getUrlWithCommonUpdatedParams, getUserCountry, getUserLang, getUserLocale, getWarningMsg, getWarningMsgList, getWarningMsgSession, getWarningMsgSessionList, glp, isAdmin, isAjaxRequest, isDBMember, isDebug, isInFrontOffice, isLogged, isWebdavAccess, removeMessage, removeMessage, retrieveUploadedFile, select, sendForbidden, sendForbidden, sendRedirect, sendRedirect, sendRedirect, setErrorMsg, setErrorMsg, setErrorMsgSession, setErrorMsgSession, setInfoMsg, setInfoMsg, setInfoMsgSession, setInfoMsgSession, setLoggedMember, setRequest, setResponse, setWarningMsg, setWarningMsg, setWarningMsgSession, setWarningMsgSession, validateRegexp, validateSchedule
 
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

redirect

protected String redirect

noRedirect

protected boolean noRedirect

noSendRedirect

protected boolean noSendRedirect

redirectOnClosePopup

protected boolean redirectOnClosePopup

workspaceForced

protected boolean workspaceForced

popupEdition

protected boolean popupEdition

editFieldSet

protected HashSet editFieldSet

contextMap

protected HashMap<String,Object> contextMap
Constructor Detail

JcmsFormHandler

public JcmsFormHandler()
Method Detail

init

protected void init()
Method to implement if you need to initialize your handler from parameter received, prior to all security validation.

You must absolutely not perform any action which modify data or site configuration.

Therefore it is strongly recommend NOT TO implement this method, or use very wisely.


validate

public boolean validate()
                 throws IOException
Method invoked by JSP to validate all conditions (authorization, parameters, ...), and eventualy trigger the action that was requested to the handler.

You MUST not override this method to validate and perform your action, instead implement processAction() if you need to provide custom actions.

As of current implementation, this method is NOT final to ensure backward compatibility with older handler which may have had a validate() method. But it WILL end as a final method.

Returns:
true if a redirect was done, false otherwise
Throws:
IOException - if error occured during validate
Since:
jcms-7.1 in JcmsFormHandler (was in EditDataHandler),

afterValidation

protected boolean afterValidation(boolean result)
                           throws IOException
Throws:
IOException

processAction

public boolean processAction()
                      throws IOException
Method to be implemented to check/validate action to be performed and process them.

Default implementation is to return false. No need to call super method.

This method may NOT be invoked at all if security validation are not met.
You must ensure your handler and JSP can work properly without any code invoked in this method.

Returns:
false if no redirection is needed, true otherwise
Throws:
IOException

getWorkspace

public Workspace getWorkspace()
Description copied from class: JcmsContext
Retrieve the current Workspace variable for this context either from request if inFO or from session if in back office. Fast: this method is cached using initDone (it is recomputed only on forceUpdate() or setRequest()).

Overrides:
getWorkspace in class JcmsContext
Returns:
the workspace (the one set by doInitPage.jsp)

isWorkspaceForced

public boolean isWorkspaceForced()

setWorkspace

public void setWorkspace(Workspace wspc)

setWs

public void setWs(String v)

sendRedirect

public void sendRedirect(String url,
                         boolean checkRedirect)
                  throws IOException
Set the redirect in the response. If noRedirect has been set, this method set no redirection. If noSendRedirect has been set, put the request attribute "redirect" but do not call response.sendRedirect(). This may be useful when redirecting from a dynamically included JSP in the front-office (some AppServer throw an exception when setting/getting request attribute once the redirect has been put.)

Parameters:
url - the url to redirect to.
checkRedirect - if true and if redirect attribute has been set, redirect on this url
Throws:
IOException
Since:
jcms-4.0

sendRedirect

public void sendRedirect(String url)
                  throws IOException
Redirect current request to given URL.
Overrides JcmsContext.sendRedirect(String) to use behavior provided by sendRedirect(String, boolean).

Overrides:
sendRedirect in class JcmsContext
Parameters:
url - the url to redirect to.
Throws:
IOException - if an error occured while writing in response headers
Since:
jcms-4.0
See Also:
JcmsContext.sendRedirect(String, HttpServletRequest, HttpServletResponse)

getRedirect

public String getRedirect()
Get the value of redirect.

Returns:
Value of redirect.

setRedirect

public void setRedirect(String url)
Set the value of redirect.

Parameters:
url - Value to assign to redirect.

setNoRedirect

public void setNoRedirect(boolean noRedirect)
Set the value of noRedirect.

Parameters:
noRedirect - Value to assign to noRedirect.
Since:
jcms-4.0

setNoSendRedirect

public void setNoSendRedirect(boolean noSendRedirect)
Set the value of noSendRedirect.

Parameters:
noSendRedirect - Value to assign to noSendRedirect.
Since:
jcms-4.0

setRedirectOnClosePopup

public final void setRedirectOnClosePopup(boolean redirectOnClosePopup)
Set whether the redirect value should be applied to the opener when closing the popup edition.
The value set by this method will be used only when using popup edition (setPopupEdition(boolean)).

Parameters:
redirectOnClosePopup - if true, the redirect value (setRedirect(String)) will be provided to closePopup.jsp to redirect the opener. if false, the popup will simply be closed and the opener refreshed.
Since:
jcms-5.7

getRedirectOnClosePopup

public final boolean getRedirectOnClosePopup()
Return the value indicating whether the redirect value should be applied to the opener when closing the popup edition.

Returns:
true, when redirect value (setRedirect(String)) will be provided to closePopup.jsp to redirect the opener. false, if the popup will simply be closed and the opener refreshed.
Since:
jcms-5.7

processStatus

protected boolean processStatus(ControllerStatus status)
                         throws IOException
Process the ControllerStatus: do nothing if OK, or send on forbidden, or put a warning message in the request.

Parameters:
status - the ControllerStatus to be processed
Throws:
IOException
Since:
jcms-5.0.0

getControllerContext

protected HashMap<String,Object> getControllerContext()
Build a controller context. I.E. add request, response and loggedMember.

Returns:
the HashMap which contains the context
Since:
jcms-5.0.0

isFieldMissing

protected boolean isFieldMissing(String field)
Check if the given parameter is present in the query parameters

Parameters:
field - the field to be checked
Returns:
true if this field is present in the query parameters
Since:
jcms-5.0.0

setPopupEdition

public void setPopupEdition(boolean v)
Set where this form handler is being invoked in a popup.

Parameters:
v - true if handler is invoked in popup, false otherwise
Since:
jcms-5.0.0

isPopupEdition

public boolean isPopupEdition()
Returns:
true if this form handler is invoked through a popup
Since:
jcms-5.0.0

setEditField

public void setEditField(String[] v)
Parameters:
v - a set of field names to edite
Since:
jcms-5.0.0

getEditFieldSet

public HashSet getEditFieldSet()
Returns:
a set of field names being edited
Since:
jcms-5.0.0

isFieldEdition

public boolean isFieldEdition(String field)
Parameters:
field -
Returns:
true if this handler is invoked to edit only some fields of the data
Since:
jcms-5.0.0
See Also:
getEditFieldSet()

isPartialFieldEdition

public boolean isPartialFieldEdition()
Returns true if this is a partial field edition (i.e. front edition)

Returns:
true if this is a partial field edition.
Since:
jcms-5.5.0

updateUploadedField

protected String updateUploadedField(String fieldName,
                                     String value,
                                     boolean isFileDocument,
                                     boolean override)
Perform upload then, return value of the real File realtive path. if value is equal to MultipartRequest.MULTIPART_UPLOAD

Parameters:
fieldName - the field name
value - the field fake value
Since:
jcms-5.7.0

updateUploadedFields

protected void updateUploadedFields(String fieldName,
                                    String[] values,
                                    boolean isFileDocument,
                                    boolean override)
Perform upload then, replace all values with value MultipartRequest.MULTIPART_UPLOAD with the real File realtive path.

Parameters:
fieldName - the field name
values - the field fake values
Since:
jcms-5.7.0

getMainLangValue

protected String getMainLangValue(String[] array,
                                  boolean trim,
                                  boolean escape)
Returns the first value (i.e. the main language value) from the given array (monovalued ML fields).

Parameters:
array - the array
trim - if true trim the value
escape - if true escape the value
Returns:
the first value from the array.
Since:
jcms-6.0.0

getMLMap

protected HashMap<String,String> getMLMap(String[] array,
                                          boolean trim,
                                          boolean escape)
Returns the ML map (i.e. the additionnal languages) filled with the values contained in the given array (monovalued ML fields).

Parameters:
array - the array
trim - if true trim the values
escape - if true escape the values
Returns:
the ML map filled with the values contained in the given array.
Since:
jcms-6.0.0

getMainLangValueArray

protected String[] getMainLangValueArray(String[] array,
                                         boolean trim,
                                         boolean escape)
Returns the first values (i.e. the main language value) from the given array (multivalued ML fields).

Parameters:
array - the array
trim - if true trim the values
escape - if true escape the values
Returns:
the first values from the array (i.e. the main language value) from the given array.
Since:
jcms-6.0.0

getMLMapArray

protected HashMap<String,String[]> getMLMapArray(String[] array,
                                                 boolean trim,
                                                 boolean escape)
Returns the ML map (i.e. the additionnal languages) filled with the values contained in the given array (multivalued ML fields).

Parameters:
array - the array
trim - if true trim the values
escape - if true escape the values
Returns:
the ML map filled with the values contained in the given array.
Since:
jcms-6.0.0

getHiddenField

public String getHiddenField(String name,
                             String value)

getHiddenFieldML

public String getHiddenFieldML(String name,
                               HashMap<String,String> map)

getHiddenField

public String getHiddenField(String name,
                             Data value)

getHiddenField

public String getHiddenField(String name,
                             boolean value)

getHiddenField

public String getHiddenField(String name,
                             int value)

getHiddenField

public String getHiddenField(String name,
                             double value)

getHiddenField

public String getHiddenField(String name,
                             long value)

getHiddenField

public String getHiddenField(String name,
                             Date value)

getHiddenField

public String getHiddenField(String name,
                             Data[] datas)

getHiddenField

public String getHiddenField(String name,
                             boolean[] array)

getHiddenField

public String getHiddenField(String name,
                             int[] array)

getHiddenField

public String getHiddenField(String name,
                             long[] array)

getHiddenField

public String getHiddenField(String name,
                             double[] array)

getHiddenField

public String getHiddenField(String name,
                             String[] array)

getHiddenField

public String getHiddenField(String name,
                             Date[] array)

checkMissingField

protected boolean checkMissingField(Object obj,
                                    String prop)


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