Package org.javlo.component.properties
Class AbstractPropertiesComponent
- java.lang.Object
-
- org.javlo.component.core.AbstractVisualComponent
-
- org.javlo.component.properties.AbstractPropertiesComponent
-
- All Implemented Interfaces:
Comparable<IContentVisualComponent>
,IContentVisualComponent
,IRestItem
- Direct Known Subclasses:
AbstractSurvey
,CalendarComponent
,ChatComponent
,ChooseBaseContext
,ComponentList
,ContactInformation
,CountTool
,DebugNote
,DefinitionComponent
,DynamicComponentFilter
,DynamicComponentList
,EditBasketComponent
,EventRegistration
,ExtendedWidget
,FileFinder
,FormInputComponent
,Heading
,LanguageCopy
,LottieAnimationComponent
,Menu
,Multimedia
,MyEvents
,ProductComponent
,RSSRegistration
,SecureText
,TableComponent
,TaxonomySessionComponent
,UserLogin
,Wall
public abstract class AbstractPropertiesComponent extends AbstractVisualComponent
-
-
Field Summary
Fields Modifier and Type Field Description protected Properties
properties
-
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, logger, 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 AbstractPropertiesComponent()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
createKeyWithField(String inField)
protected boolean
getColumnableDefaultValue()
Map<String,Object>
getContentAsMap(ContentContext ctx)
String
getContentAsText(ContentContext ctx)
get the text of the componentprotected String
getEditXHTMLCode(ContentContext ctx)
Collection<Map.Entry<String,String>>
getFieldChoice(ContentContext ctx, String fieldName)
protected double
getFieldDoubleValue(String inField)
protected long
getFieldLongValue(String inField)
protected static String
getFieldName(String field)
abstract List<String>
getFields(ContentContext ctx)
protected static String
getFieldType(String field)
protected String
getFieldValue(String inField)
work only if all fields is translatedprotected String
getFieldValue(String inField, String defaultValue)
protected String
getFieldValue(ContentContext ctx, String inField)
String
getHeader()
protected String
getLabel(I18nAccess i18nAccess, String fieldName)
protected String
getListSeparator()
protected int
getMdSize()
int
getRowSize(String field)
String
getViewXHTMLCode(ContentContext ctx)
int
getWordCount(ContentContext ctx)
count the word in the content.protected int
getXsSize()
void
init(ComponentBean bean, ContentContext newContext)
protected boolean
isAllTranslated()
all field value is different on any language, if false, only field end with .i18n is different.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.static void
main(String[] args)
String
performEdit(ContentContext ctx)
action call when update the content page.void
prepareView(ContentContext ctx)
prepare the rendering of a component. default attributes put in request : style, value, type, compidprotected void
renderField(PrintWriter out, ContentContext ctx, String field)
protected void
setFieldValue(String inField, String value)
void
storeProperties()
boolean
transflateFrom(ContentContext ctx, ITranslator translator, String lang)
translate the content of the component to the current languageString
validateField(ContentContext ctx, String fieldName, String fieldValue)
-
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, getComplexityLevel, getComponentBean, getComponentCSS, getComponentCssClass, getComponentId, getComponentLabel, getComponentPath, getConfig, getConfigInValue, getConfigMessage, getContainerPage, 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, getFontAwesome, 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, getRenderer, 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, getWidth, 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, updateCache
-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.javlo.component.core.IContentVisualComponent
getType
-
-
-
-
Field Detail
-
properties
protected Properties properties
-
-
Method Detail
-
isAllTranslated
protected boolean isAllTranslated()
all field value is different on any language, if false, only field end with .i18n is different.- Returns:
-
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
-
getFieldChoice
public Collection<Map.Entry<String,String>> getFieldChoice(ContentContext ctx, String fieldName)
-
getMdSize
protected int getMdSize()
-
getXsSize
protected int getXsSize()
-
getLabel
protected String getLabel(I18nAccess i18nAccess, String fieldName)
-
renderField
protected void renderField(PrintWriter out, ContentContext ctx, String field) throws ServiceException, Exception
- Throws:
ServiceException
Exception
-
getEditXHTMLCode
protected String getEditXHTMLCode(ContentContext ctx) throws Exception
- Overrides:
getEditXHTMLCode
in classAbstractVisualComponent
- Throws:
Exception
-
getFieldDoubleValue
protected double getFieldDoubleValue(String inField)
-
getFieldLongValue
protected long getFieldLongValue(String inField)
-
getFields
public abstract List<String> getFields(ContentContext ctx) throws Exception
- Throws:
Exception
-
getFieldValue
protected String getFieldValue(String inField)
work only if all fields is translated- Parameters:
inField
-- Returns:
-
getFieldValue
protected String getFieldValue(ContentContext ctx, String inField)
-
getHeader
public String getHeader()
-
getRowSize
public int getRowSize(String field)
-
getViewXHTMLCode
public String getViewXHTMLCode(ContentContext ctx) throws Exception
- Overrides:
getViewXHTMLCode
in classAbstractVisualComponent
- Throws:
Exception
-
getWordCount
public int getWordCount(ContentContext ctx)
Description copied from interface:IContentVisualComponent
count the word in the content.- Specified by:
getWordCount
in interfaceIContentVisualComponent
- Overrides:
getWordCount
in classAbstractVisualComponent
- Returns:
-
init
public void init(ComponentBean bean, ContentContext newContext) throws Exception
- Overrides:
init
in classAbstractVisualComponent
- Throws:
Exception
-
getListSeparator
protected String getListSeparator()
-
validateField
public String validateField(ContentContext ctx, String fieldName, String fieldValue) throws Exception
- Throws:
Exception
-
getColumnableDefaultValue
protected boolean getColumnableDefaultValue()
- Overrides:
getColumnableDefaultValue
in classAbstractVisualComponent
-
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
-
storeProperties
public void storeProperties()
-
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:
-
getContentAsMap
public Map<String,Object> getContentAsMap(ContentContext ctx) throws Exception
- Specified by:
getContentAsMap
in interfaceIRestItem
- Overrides:
getContentAsMap
in classAbstractVisualComponent
- Throws:
Exception
-
getContentAsText
public String getContentAsText(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get the text of the component- Specified by:
getContentAsText
in interfaceIContentVisualComponent
- Overrides:
getContentAsText
in classAbstractVisualComponent
- Returns:
-
main
public static void main(String[] args)
-
transflateFrom
public boolean transflateFrom(ContentContext ctx, ITranslator translator, String lang)
Description copied from interface:IContentVisualComponent
translate the content of the component to the current language- Specified by:
transflateFrom
in interfaceIContentVisualComponent
- Overrides:
transflateFrom
in classAbstractVisualComponent
- Parameters:
ctx
- contextContext of the current renderingtranslator
- class to translatelang
- the language of the current content (source language)- Returns:
-
-