Package org.javlo.component.form
Class SmartGenericForm
- java.lang.Object
-
- org.javlo.component.core.AbstractVisualComponent
-
- org.javlo.component.form.SmartGenericForm
-
- All Implemented Interfaces:
Comparable<IContentVisualComponent>
,IAction
,IEventRegistration
,IContentVisualComponent
,IDataContainer
,IRestItem
- Direct Known Subclasses:
GenericQuiz
,SurveyGenericForm
public class SmartGenericForm extends AbstractVisualComponent implements IAction, IEventRegistration, IDataContainer
-
-
Field Summary
Fields Modifier and Type Field Description static String
FOLDER
protected static Object
LOCK_ACCESS_FILE
static String
RECAPTCHAKEY
static String
RECAPTCHASECRETKEY
static String
TYPE
-
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 SmartGenericForm()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
acceptLinks(ContentContext ctx)
protected int
decodeEditNumber(ContentContext ctx, String number)
protected int
decodeUserEditNumber(ContentContext ctx, String number)
protected void
delField(String name)
protected String
encodeEditNumber(ContentContext ctx, int number)
String
getActionGroupName()
the group name of the actionprotected File
getAttachFolder(ContentContext ctx)
protected boolean
getColumnableDefaultValue()
int
getComplexityLevel(ContentContext ctx)
return the complexity level of the component.protected javax.mail.internet.InternetAddress
getConfirmToEmail(ContentContext ctx)
int
getCountSubscription(ContentContext ctx)
List<Map<String,String>>
getData(ContentContext ctx)
List<Map<String,String>>
getData(ContentContext ctx, String login)
get information about a specific user, if exist.protected String
getDataKey()
protected String
getEditXHTMLCode(ContentContext ctx)
protected Field
getField(ContentContext ctx, String fieldName)
List<Field>
getFields()
Deprecated.List<Field>
getFields(ContentContext ctx)
protected File
getFile(ContentContext ctx)
String
getFontAwesome()
protected String
getInputEditLineName(ContentContext ctx)
protected String
getInputValidLineName(ContentContext ctx)
Properties
getLocalConfig(boolean reload)
protected String
getMailFooter(ContentContext ctx)
protected String
getMailHeader(ContentContext ctx)
protected long
getMaxFileSize()
protected String
getNewFieldKey()
protected MenuElement
getNextPage(ContentContext ctx)
List<IUserInfo>
getParticipants(ContentContext ctx)
String
getRecaptchaKey()
String
getRecaptchaSecretKey()
String
getRenderer(ContentContext ctx)
get current renderer file.String
getTableSqlName()
String
getTableSqlNameReference()
String
getTitle()
String
getType()
return the type of the element.String
getUserLink(ContentContext ctx)
protected boolean
importFieldAsExcel(ContentContext ctx)
boolean
initContent(ContentContext ctx)
init the content with a default value. sample : "lorem ipsum" for text component.boolean
isCaptcha()
protected boolean
isCaptcha(ContentContext ctx)
boolean
isClose(ContentContext ctx)
protected boolean
isClosedEventSite(ContentContext ctx)
boolean
isContentCachable(ContentContext ctx)
return the part of header needed for this componentboolean
isContentCachableByQuery(ContentContext ctx)
boolean
isDocument()
boolean
isEvent()
boolean
isFile()
protected boolean
isFilledFromCookies()
protected boolean
isFormExpire()
check if form is expired (too much time for submit)protected boolean
isFullEventSite(ContentContext ctx)
protected boolean
isHTMLMail()
boolean
isList()
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()
protected boolean
isUpdate(ContentContext ctx)
protected boolean
isWarningEventSite(ContentContext ctx)
static String
performDownloadForm(ContentContext ctx, RequestService rs)
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, compidvoid
setValue(String inContent)
set the content without renderingprotected void
store(Field field)
void
store(ContentContext ctx)
protected int
storeResult(ContentContext ctx, Map<String,String> data, boolean sort)
-
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, getColumnMaxSize, getColumnSize, getColumnSizes, getColumnStyle, getComponentBean, getComponentCSS, getComponentCssClass, getComponentId, getComponentLabel, getComponentPath, getConfig, 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, getEmptyCode, getEmptyXHTMLCode, getErrorMessage, getErrorMessage, getExternalModules, getExternalResources, getFileDirectory, getFirstPrefix, getForcedId, getForcedPrefixViewXHTMLCode, getForcedRenderer, getForcedSuffixViewXHTMLCode, getFormName, getGroup, getHeaderContent, getHelpText, getHelpType, getHelpURI, getHelpURL, getHexColor, 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, getRendererTitle, getRenderes, 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, init, insert, isAjaxWrapper, isAskWidth, isAutoDeletable, isAutoRenderer, isBackgroundColored, isCanAddClass, isCloseRow, isColored, isColumnable, isConfig, 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, setWidth, stored, storeViewData, stringToReader, stringToReader, stringToStream, textToXHTML, toString, transflateFrom, updateCache
-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.javlo.actions.IEventRegistration
getId
-
-
-
-
Field Detail
-
RECAPTCHASECRETKEY
public static final String RECAPTCHASECRETKEY
- See Also:
- Constant Field Values
-
RECAPTCHAKEY
public static final String RECAPTCHAKEY
- See Also:
- Constant Field Values
-
FOLDER
public static final String FOLDER
- See Also:
- Constant Field Values
-
LOCK_ACCESS_FILE
protected static final Object LOCK_ACCESS_FILE
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLocalConfig
public Properties getLocalConfig(boolean reload)
-
getAttachFolder
protected File getAttachFolder(ContentContext ctx) throws Exception
- Throws:
Exception
-
acceptLinks
protected boolean acceptLinks(ContentContext ctx)
-
getInputEditLineName
protected String getInputEditLineName(ContentContext ctx) throws Exception
- Throws:
Exception
-
getInputValidLineName
protected String getInputValidLineName(ContentContext ctx) throws Exception
- Throws:
Exception
-
encodeEditNumber
protected String encodeEditNumber(ContentContext ctx, int number) throws Exception
- Throws:
Exception
-
decodeEditNumber
protected int decodeEditNumber(ContentContext ctx, String number) throws NumberFormatException, Exception
- Throws:
NumberFormatException
Exception
-
decodeUserEditNumber
protected int decodeUserEditNumber(ContentContext ctx, String number) throws Exception
- Throws:
Exception
-
isCaptcha
protected boolean isCaptcha(ContentContext ctx)
-
isCaptcha
public boolean isCaptcha()
-
getRecaptchaKey
public String getRecaptchaKey()
-
getRecaptchaSecretKey
public String getRecaptchaSecretKey()
-
getCountSubscription
public int getCountSubscription(ContentContext ctx) throws Exception
- Throws:
Exception
-
getData
public List<Map<String,String>> getData(ContentContext ctx) throws Exception
- Specified by:
getData
in interfaceIDataContainer
- Throws:
Exception
-
setValue
public void setValue(String inContent)
Description copied from interface:IContentVisualComponent
set the content without rendering- Specified by:
setValue
in interfaceIContentVisualComponent
- Overrides:
setValue
in classAbstractVisualComponent
-
isEvent
public boolean isEvent()
-
isDocument
public boolean isDocument()
-
getEditXHTMLCode
protected String getEditXHTMLCode(ContentContext ctx) throws Exception
- Overrides:
getEditXHTMLCode
in classAbstractVisualComponent
- Throws:
Exception
-
getField
protected Field getField(ContentContext ctx, String fieldName)
-
getFields
@Deprecated public List<Field> getFields()
Deprecated.
-
getFields
public List<Field> getFields(ContentContext ctx)
-
isFile
public boolean isFile()
-
isList
public boolean isList()
-
getRenderer
public String getRenderer(ContentContext ctx)
Description copied from class:AbstractVisualComponent
get current renderer file.- Specified by:
getRenderer
in interfaceIContentVisualComponent
- Overrides:
getRenderer
in classAbstractVisualComponent
-
getTitle
public String getTitle()
-
store
protected void store(Field field)
-
delField
protected void delField(String name)
-
store
public void store(ContentContext ctx) throws IOException
- Throws:
IOException
-
isClose
public boolean isClose(ContentContext ctx) throws Exception
- Throws:
Exception
-
isFilledFromCookies
protected boolean isFilledFromCookies()
-
getDataKey
protected String getDataKey()
-
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
-
isUpdate
protected boolean isUpdate(ContentContext ctx) throws Exception
- Throws:
Exception
-
getMaxFileSize
protected long getMaxFileSize()
-
getNewFieldKey
protected String getNewFieldKey()
-
isWarningEventSite
protected boolean isWarningEventSite(ContentContext ctx) throws Exception
- Throws:
Exception
-
isClosedEventSite
protected boolean isClosedEventSite(ContentContext ctx) throws Exception
- Throws:
Exception
-
isFullEventSite
protected boolean isFullEventSite(ContentContext ctx) throws Exception
- Throws:
Exception
-
importFieldAsExcel
protected boolean importFieldAsExcel(ContentContext ctx) throws Exception
- Throws:
Exception
-
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
-
getMailHeader
protected String getMailHeader(ContentContext ctx)
-
getMailFooter
protected String getMailFooter(ContentContext ctx)
-
isHTMLMail
protected boolean isHTMLMail()
-
isStorage
protected boolean isStorage()
-
getTableSqlName
public String getTableSqlName()
-
getTableSqlNameReference
public String getTableSqlNameReference()
-
getFile
protected File getFile(ContentContext ctx) throws Exception
- Throws:
Exception
-
storeResult
protected int storeResult(ContentContext ctx, Map<String,String> data, boolean sort) throws Exception
- Throws:
Exception
-
isSendEmail
protected boolean isSendEmail()
-
getConfirmToEmail
protected javax.mail.internet.InternetAddress getConfirmToEmail(ContentContext ctx)
-
isFormExpire
protected boolean isFormExpire()
check if form is expired (too much time for submit)- Returns:
-
performSubmit
public static String performSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
- Throws:
Exception
-
getNextPage
protected MenuElement getNextPage(ContentContext ctx)
-
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.
-
getActionGroupName
public String getActionGroupName()
Description copied from interface:IAction
the group name of the action- Specified by:
getActionGroupName
in interfaceIAction
- Returns:
- a group name.
-
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:
-
isContentCachable
public boolean isContentCachable(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return the part of header needed for this component- Specified by:
isContentCachable
in interfaceIContentVisualComponent
- Overrides:
isContentCachable
in classAbstractVisualComponent
- Returns:
-
isContentCachableByQuery
public boolean isContentCachableByQuery(ContentContext ctx)
- Overrides:
isContentCachableByQuery
in classAbstractVisualComponent
-
initContent
public boolean initContent(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponent
init the content with a default value. sample : "lorem ipsum" for text component.- Specified by:
initContent
in interfaceIContentVisualComponent
- Overrides:
initContent
in classAbstractVisualComponent
- Returns:
- true if content is create.
- 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
-
getParticipants
public List<IUserInfo> getParticipants(ContentContext ctx) throws Exception
- Specified by:
getParticipants
in interfaceIEventRegistration
- Throws:
Exception
-
getUserLink
public String getUserLink(ContentContext ctx) throws Exception
- Specified by:
getUserLink
in interfaceIEventRegistration
- Throws:
Exception
-
getFontAwesome
public String getFontAwesome()
- Specified by:
getFontAwesome
in interfaceIContentVisualComponent
- Overrides:
getFontAwesome
in classAbstractVisualComponent
-
getData
public List<Map<String,String>> getData(ContentContext ctx, String login) throws Exception
Description copied from interface:IEventRegistration
get information about a specific user, if exist.- Specified by:
getData
in interfaceIDataContainer
- Specified by:
getData
in interfaceIEventRegistration
- Throws:
Exception
-
performDownloadForm
public static String performDownloadForm(ContentContext ctx, RequestService rs) throws Exception
- Throws:
Exception
-
getColumnableDefaultValue
protected boolean getColumnableDefaultValue()
- Overrides:
getColumnableDefaultValue
in classAbstractVisualComponent
-
-