Package org.javlo.component.form
Class GenericForm
- java.lang.Object
-
- org.javlo.component.core.AbstractVisualComponent
-
- org.javlo.component.form.GenericForm
-
- All Implemented Interfaces:
Comparable<IContentVisualComponent>
,IAction
,IContentVisualComponent
,IRestItem
- Direct Known Subclasses:
GenericFormForRegistering
public class GenericForm extends AbstractVisualComponent implements IAction
store html form in csv file and send email with parameters. For use this component you need to create a renderer with a html form. this form need at least two field :<input type="hidden" name="webaction" value="gform-registering.submit" />
. You can define required field with uppercase letter : "Firstname" > requierd, "firstname" > not requiered. for use captacha you need to tag :
<input type="hidden" name="comp_id" value="${comp.id}" /><img src="${info.captchaURL}" alt="captcha" /></label>
<input type="text" id="captcha" name="captcha" value="" />JSTL variable :
- inherited from
AbstractVisualComponent
String
msg : message to display.Map
errorFields: field with error.String
valid: contains true if form is valid.
Local JSTL
- ci18n : local i18n map.
keys for message and config can be use in content
- captcha : true for use captacha
- error.required : error message if requiered field is'nt filled.
- error.captcha : message if catacha value is'nt correct.
- message.thanks : confirmation message.
- field.fake : name of fake field.
- Author:
- Patrick Vandermaesen
-
-
Field Summary
Fields Modifier and Type Field Description static String
DYNAMIC_FORM_RESULT_FOLDER
protected static Object
LOCK
-
Fields inherited from class org.javlo.component.core.AbstractVisualComponent
CACHE_KEY_SUFFIX_PARAM_NAME, COMPONENT_KEY, config, EDIT_CLASS, FLUID_COL_SIZE, FORCE_COMPONENT_ID, HIDDEN, I18N_FILE, MAX_COL_VALUE, MOBILE_TYPE, NOT_EDIT_PREVIEW_PARAM_NAME, SCROLL_TO_COMP_ID_ATTRIBUTE_NAME, TIME_CACHE_NAME, VALUE_SEPARATOR
-
Fields inherited from interface org.javlo.component.core.IContentVisualComponent
COLORED_WRAPPER_CLASS, COMP_ID_REQUEST_PARAM, COMPLEXITY_ADMIN, COMPLEXITY_EASY, COMPLEXITY_STANDARD, CONTAINER_COLOR, DEFAULT_COLOR, DYN_COMP_COLOR, ECOM_COLOR, EDIT_ACTION_CSS_CLASS, GRAPHIC_COLOR, HIGH_LABEL_LEVEL, ID_SEPARATOR, LINK_COLOR, LOW_LABEL_LEVEL, META_COLOR, MIDDLE_LABEL_LEVEL, SEARCH_LEVEL_HIGH, SEARCH_LEVEL_LOW, SEARCH_LEVEL_MIDDLE, SEARCH_LEVEL_NONE, TEXT_COLOR, VIEW_DEFINITION_REQUEST_ID, WEB2_COLOR
-
-
Constructor Summary
Constructors Constructor Description GenericForm()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getActionGroupName()
the group name of the actionprotected File
getAttachFolder(ContentContext ctx)
int
getComplexityLevel(ContentContext ctx)
return the complexity level of the component.ComponentConfig
getConfig(ContentContext ctx)
get the configuration of the component. from project or from template.protected String
getConfig(ContentContext ctx, String field, String condition)
protected String
getConfigMessage(ContentContext ctx, String field, String condition)
protected File
getFile(ContentContext ctx)
String
getFontAwesome()
String
getHexColor()
get the exadecimal color for representation of the component.Properties
getLocalConfig(boolean reload)
protected String
getMailFooter(ContentContext ctx)
protected String
getMailHeader(ContentContext ctx)
protected Integer
getMaxSize(ContentContext ctx, String field)
String
getRecaptchaKey()
String
getRecaptchaSecretKey()
Map<String,String>
getRenderes(ContentContext ctx)
String
getType()
return the type of the element.protected void
init(ComponentBean bean, ContentContext ctx)
boolean
isCaptcha()
protected boolean
isCaptcha(ContentContext ctx)
protected boolean
isHTMLMail()
boolean
isRealContent(ContentContext ctx)
return true if component is considered as realContent and the page that contain the component is also considered as real content.protected boolean
isSendEmail()
protected boolean
isStorage()
String
performEdit(ContentContext ctx)
action call when update the content page.static String
performSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
void
prepareView(ContentContext ctx)
prepare the rendering of a component. default attributes put in request : style, value, type, compidprotected void
sendConfirmationEmail(ContentContext ctx, GenericForm comp, Map<String,Object> params, javax.mail.internet.InternetAddress to)
protected void
storeResult(ContentContext ctx, Map<String,String> data)
-
Methods inherited from class org.javlo.component.core.AbstractVisualComponent
applyReplacement, cleanResources, cleanValue, clearReplacement, clone, compareTo, contructViewStyle, countLine, delete, deleteMySelf, drawColumn, equals, equals, executeCurrentRenderer, executeJSP, executeRenderer, executeRenderer, extractFieldsFromRenderer, forceInit, getAjaxId, getArea, getAuthors, getBackgroundColor, getBaseHelpURL, getClassName, getColomnablePrefix, getColomnableSuffix, getColumn, getColumnableDefaultValue, getColumnMaxSize, getColumnSize, getColumnSizes, getColumnStyle, getComponentBean, getComponentCSS, getComponentCssClass, getComponentId, getComponentLabel, getComponentPath, getConfigInValue, getConfigMessage, getContainerPage, getContentAsMap, getContentAsText, getContentCache, getContentMessage, getContentName, getContentTimeCache, getCookiesDisplayStatus, getCreationDate, getCSSStyle, getCurrentPage, getCurrentRenderer, getDataAttributes, getDebugHeader, getDefaultHelpURI, getDefaultRenderer, getDeleteDate, getDescription, getDisplayAsInputName, getDisplayMessage, getEditorComplexity, getEditRenderer, getEditText, getEditXHTMLCode, getEmptyCode, getEmptyXHTMLCode, getErrorMessage, getErrorMessage, getExternalModules, getExternalResources, getFileDirectory, getFirstPrefix, getForcedId, getForcedPrefixViewXHTMLCode, getForcedRenderer, getForcedSuffixViewXHTMLCode, getFormName, getGroup, getHeaderContent, getHelpText, getHelpType, getHelpURI, getHelpURL, getI18nEditableKeys, getIcon, getId, getImportFolderPath, getImportFolderPath, getInlineStyle, getInputName, getInputNameColomn, getInputNameColomnStyle, getInputNameRenderer, getInputNameRendererTitle, getItalicAndStrongLanguageMarkerList, getJSOnSubmit, getKey, getLabelLevel, getLastSufix, getLayout, getListClass, getListGroup, getListItemTag, getListTag, getLocalMessage, getLock, getManualCssClass, getMarkerList, getMessage, getMirrorWrapper, getModificationDate, getNextComponent, getPage, getPageDescription, getPrefixCssClass, getPrefixViewXHTMLCode, getPreviewAttributes, getPreviewCssClass, getPreviewCssId, getPreviousComponent, getQuotationLanguageMarkerList, getReferenceComponent, getRemplacement, getRenderer, getRendererTitle, getRequestComponent, getSearchLevel, getSelectRendererXHTML, getSpecialInputTag, getSpecialPreviewCssId, getSpecialTagTitle, getSpecialTagXHTML, getSpecificClass, getSpecificCssClass, getStyle, getStyleLabel, getStyleLabelList, getStyleList, getStyleTitle, getSuffixViewXHTMLCode, getTag, getTextColor, getTextForSearch, getTextLabel, getTextMessage, getTextPosition, getTextTitle, getTitleLevel, getTypeInputName, getValue, getValue, getVersion, getViewData, getViewDataFile, getViewID, getViewText, getViewXHTMLCode, getWidth, getWordCount, getXHTMLCode, getXHTMLConfig, haveRight, includeComponentJSP, includePage, init, initContent, insert, isAjaxWrapper, isAskWidth, isAutoDeletable, isAutoRenderer, isBackgroundColored, isCanAddClass, isCloseRow, isColored, isColumnable, isConfig, isContentCachable, isContentCachableByQuery, isContentTimeCachable, isDefaultValue, isDispayEmptyXHTMLCode, isDisplayable, isDisplayHidden, isEditOnCreate, isFirstElementOfRepeatSequence, isFirstRepeated, isFreeInputLayout, isHelpURL, isHiddable, isHidden, isHiddenInMode, isHiddenInModeValue, isInline, isInsertable, isList, isListable, isMetaTitle, isMirroredByDefault, isMirrorWrapped, isModify, isNeedDelete, isNeedRefresh, isNeedRenderer, isNew, isNextSame, isNextSame, isNolink, isNoLinkable, isOpenRow, isPreviousSame, isPreviousSame, isRepeat, isRepeatable, isRestMatch, isReversedLink, isStyleHidden, isUnique, isValueProperties, isValueTranslatable, isViewDataFile, isVisible, isVisible, isVisibleFromCookies, isWrapped, isXML, loadViewData, markAsNew, newInstance, next, onStyleChange, performColumnable, performConfig, performUpdate, prepareEdit, previous, processView, renderOtherComponent, renderViewXHTMLCode, replaceAllInContent, replaceInContent, resetContentCache, resetViewData, setBackgroundColor, setColumnSize, setColumnStyle, setComponentBean, setContainerPage, setContentCache, setContentTimeCache, setDisplayHidden, setForcedId, setForcedRenderer, setGroup, setHidden, setHiddenInMode, setList, setLocalMessage, setMessage, setMirrorWrapped, setModify, setNeedRefresh, setNextComponent, setNolink, setPage, setPreviousComponent, setRenderer, setRepeat, setStyle, setTextColor, setTextPosition, setValid, setValue, setWidth, stored, storeViewData, stringToReader, stringToReader, stringToStream, textToXHTML, toString, transflateFrom, updateCache
-
-
-
-
Field Detail
-
DYNAMIC_FORM_RESULT_FOLDER
public static final String DYNAMIC_FORM_RESULT_FOLDER
- See Also:
- Constant Field Values
-
LOCK
protected static final Object LOCK
-
-
Method Detail
-
init
protected void init(ComponentBean bean, ContentContext ctx) throws Exception
- Overrides:
init
in classAbstractVisualComponent
- Throws:
Exception
-
getRenderes
public Map<String,String> getRenderes(ContentContext ctx)
- Overrides:
getRenderes
in classAbstractVisualComponent
-
getConfig
public ComponentConfig getConfig(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get the configuration of the component. from project or from template.- Specified by:
getConfig
in interfaceIContentVisualComponent
- Overrides:
getConfig
in classAbstractVisualComponent
- Returns:
-
getType
public String getType()
Description copied from interface:IContentVisualComponent
return the type of the element.- Specified by:
getType
in interfaceIContentVisualComponent
- Returns:
- the type of the element.
-
isCaptcha
protected boolean isCaptcha(ContentContext ctx)
-
prepareView
public void prepareView(ContentContext ctx) throws Exception
Description copied from class:AbstractVisualComponent
prepare the rendering of a component. default attributes put in request : style, value, type, compid- Specified by:
prepareView
in interfaceIContentVisualComponent
- Overrides:
prepareView
in classAbstractVisualComponent
- Throws:
Exception
-
getActionGroupName
public String getActionGroupName()
Description copied from interface:IAction
the group name of the action- Specified by:
getActionGroupName
in interfaceIAction
- Returns:
- a group name.
-
getHexColor
public String getHexColor()
Description copied from interface:IContentVisualComponent
get the exadecimal color for representation of the component.- Specified by:
getHexColor
in interfaceIContentVisualComponent
- Overrides:
getHexColor
in classAbstractVisualComponent
- Returns:
- a exadecimal color (sample : a5b499)
-
isRealContent
public boolean isRealContent(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return true if component is considered as realContent and the page that contain the component is also considered as real content.- Specified by:
isRealContent
in interfaceIContentVisualComponent
- Overrides:
isRealContent
in classAbstractVisualComponent
- Parameters:
ctx
- current context- Returns:
-
getLocalConfig
public Properties getLocalConfig(boolean reload)
-
getFile
protected File getFile(ContentContext ctx) throws IOException
- Throws:
IOException
-
getAttachFolder
protected File getAttachFolder(ContentContext ctx) throws IOException
- Throws:
IOException
-
storeResult
protected void storeResult(ContentContext ctx, Map<String,String> data) throws IOException
- Throws:
IOException
-
performEdit
public String performEdit(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponent
action call when update the content page.- Specified by:
performEdit
in interfaceIContentVisualComponent
- Overrides:
performEdit
in classAbstractVisualComponent
- Returns:
- the error message, null if no error
- Throws:
Exception
-
isCaptcha
public boolean isCaptcha()
-
isSendEmail
protected boolean isSendEmail()
-
isStorage
protected boolean isStorage()
-
getMailHeader
protected String getMailHeader(ContentContext ctx)
-
getMailFooter
protected String getMailFooter(ContentContext ctx)
-
isHTMLMail
protected boolean isHTMLMail()
-
getConfig
protected String getConfig(ContentContext ctx, String field, String condition)
-
getConfigMessage
protected String getConfigMessage(ContentContext ctx, String field, String condition)
-
getMaxSize
protected Integer getMaxSize(ContentContext ctx, String field)
-
getRecaptchaKey
public String getRecaptchaKey()
-
getRecaptchaSecretKey
public String getRecaptchaSecretKey()
-
performSubmit
public static String performSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
- Throws:
Exception
-
sendConfirmationEmail
protected void sendConfirmationEmail(ContentContext ctx, GenericForm comp, Map<String,Object> params, javax.mail.internet.InternetAddress to) throws Exception
- Throws:
Exception
-
getComplexityLevel
public int getComplexityLevel(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return the complexity level of the component.- Specified by:
getComplexityLevel
in interfaceIContentVisualComponent
- Overrides:
getComplexityLevel
in classAbstractVisualComponent
- Parameters:
ctx
- TODO- Returns:
- see contant
-
getFontAwesome
public String getFontAwesome()
- Specified by:
getFontAwesome
in interfaceIContentVisualComponent
- Overrides:
getFontAwesome
in classAbstractVisualComponent
-
-