Package org.javlo.component.dynamic
Class DynamicComponent
- java.lang.Object
-
- org.javlo.component.core.AbstractVisualComponent
-
- org.javlo.component.dynamic.DynamicComponent
-
- All Implemented Interfaces:
Serializable
,Comparable<IContentVisualComponent>
,IContentVisualComponent
,IDate
,ILink
,ISubTitle
,IImageTitle
,ITimeRange
,IRestItem
,IFieldContainer
,IStaticContainer
- Direct Known Subclasses:
ReactionComponent
,StaticMapComponent
public class DynamicComponent extends AbstractVisualComponent implements IStaticContainer, IFieldContainer, IDate, ILink, IImageTitle, ISubTitle, ITimeRange
- Author:
- pvandermaesen
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DynamicComponent.FieldOrderComparator
-
Field Summary
Fields Modifier and Type Field Description static String
HIDDEN
static String
JSP_HEADER
protected static Logger
logger
create a static logger.protected StructuredProperties
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, 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
-
Fields inherited from interface org.javlo.component.image.IImageTitle
NO_LINK
-
-
Constructor Summary
Constructors Constructor Description DynamicComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(ContentContext ctx, String uri)
check if the class contains the static resources define by a URIint
contentHashCode()
protected String
contructViewStyle(ContentContext ctx)
Collection<Resource>
getAllResources(ContentContext ctx)
return all resources found in the component.Collection<Link>
getAllResourcesLinks(ContentContext ctx)
create link to resources.protected boolean
getColumnableDefaultValue()
int
getComplexityLevel(ContentContext ctx)
return the complexity level of the component.String
getComponentLabel(ContentContext ctx, String lg)
return the label of the element.Properties
getConfigProperties()
String
getContainerType(ContentContext ctx)
Map<String,Object>
getContentAsMap(ContentContext ctx)
String
getCSSClass()
String
getDataPath()
Date
getDate(ContentContext ctx)
String
getDirSelected(ContentContext ctx)
get folder with ressourcesString
getDynamicId()
protected String
getEditXHTMLCode(ContentContext ctx)
Collection<String>
getExternalResources(ContentContext ctx)
return the external resources needed from component as css, javascript...Field
getField(ContentContext ctx, String name)
List<Field>
getFields(ContentContext ctx)
List<String>
getFieldsNames(ContentContext ctx)
String
getFieldValue(ContentContext ctx, String name)
List<File>
getFiles(ContentContext ctx)
String
getHexColor()
get the exadecimal color for representation of the component.String
getIcon()
String
getImageDescription(ContentContext ctx)
protected FieldImage
getImageField(ContentContext ctx)
String
getImageLinkURL(ContentContext ctx)
protected String
getInputName(String field)
String
getKey()
get a unic key of the component.String
getLabel(ContentContext ctx)
int
getLabelLevel(ContentContext ctx)
define the level of label.Date
getLatestValidDate()
Map<String,String>
getList(ContentContext ctx, String listName)
Map<String,String>
getList(ContentContext ctx, String listName, Locale locale)
String
getNotififyPageName(ContentContext ctx)
String
getPageDescription(ContentContext ctx)
return the description of the page if this component is or contains description.int
getPopularity(ContentContext ctx)
return indice of popularityString
getPrefix()
String
getPrefixViewXHTMLCode(ContentContext ctx)
code for prefix the view XHTML code.int
getPriority(ContentContext ctx)
return the priority of the picture inside the page (9=max)StructuredProperties
getProperties()
String
getResourceURL(ContentContext ctx)
String
getSpecificClass(ContentContext ctx)
override this method for add specific class to prefix.String[]
getStyleLabelList(ContentContext ctx)
return a list of label define the style.String[]
getStyleList(ContentContext ctx)
get the list of style possible for this component.String
getSubTitle(ContentContext ctx)
int
getSubTitleLevel(ContentContext ctx)
String
getSuffix()
String
getSuffixViewXHTMLCode(ContentContext ctx)
code for sufix the view XHTML code.String
getTextForSearch(ContentContext ctx)
return a text represent the content of the component. sample all the content :-)String
getTextLabel(ContentContext ctx)
return a string representation of the componentString
getTextTitle(ContentContext ctx)
return a string representation of the component with complete titleLocalDateTime
getTimeRangeEnd(ContentContext ctx)
LocalDateTime
getTimeRangeStart(ContentContext ctx)
String
getType()
return the type of the element.protected String
getType(String field)
String
getURL(ContentContext ctx)
generate a URL or URI link with all elements to click on.String
getViewListXHTMLCode(ContentContext ctx)
String
getViewXHTMLCode(ContentContext ctx)
String
getViewXHTMLCode(ContentContext ctx, boolean asList)
String
getXHTMLId(ContentContext ctx)
void
init(ComponentBean bean, ContentContext newContext)
boolean
initContent(ContentContext ctx)
init the content with a default value. sample : "lorem ipsum" for text component.protected boolean
isAutoDeletable()
boolean
isContentCachable(ContentContext ctx)
return the part of header needed for this componentboolean
isContentTimeCachable(ContentContext ctx)
boolean
isFieldContainer(ContentContext ctx)
boolean
isImageValid(ContentContext ctx)
boolean
isLinkValid(ContentContext ctx)
return true if the link on the component is enabledboolean
isMobileOnly(ContentContext ctx)
boolean
isNotififyCreation(ContentContext ctx)
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.boolean
isRestMatch(ContentContext ctx, Map<String,String> params)
boolean
isValidDate(ContentContext ctx)
protected boolean
isValueTranslatable()
boolean
isWrapped()
IContentVisualComponent
newInstance(ComponentBean bean, ContentContext newCtx, MenuElement page)
init the component, do that before all using.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, compidvoid
reload(ContentContext ctx)
void
reloadProperties()
boolean
renameResource(ContentContext ctx, File oldName, File newName)
rename a resourcevoid
setConfigProperties(Properties properties)
void
setDirSelected(String dir)
set folder with resourcesvoid
setDynamicId(String id)
void
setLatestValidDate(Date date)
void
setProperties(StructuredProperties properties)
void
setValue(String inContent)
set the content without renderingvoid
storeProperties()
boolean
transflateFrom(ContentContext ctx, ITranslator translator, String lang)
translate the content of the component to the current language-
Methods inherited from class org.javlo.component.core.AbstractVisualComponent
applyReplacement, cleanResources, cleanValue, clearReplacement, clone, compareTo, 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, getComponentPath, getConfig, getConfigInValue, getConfigMessage, getContainerPage, 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, getFileDirectory, getFirstPrefix, getFontAwesome, getForcedId, getForcedPrefixViewXHTMLCode, getForcedRenderer, getForcedSuffixViewXHTMLCode, getFormName, getGroup, getHeaderContent, getHelpText, getHelpType, getHelpURI, getHelpURL, getI18nEditableKeys, getId, getImportFolderPath, getImportFolderPath, getInlineStyle, getInputNameColomn, getInputNameColomnStyle, getInputNameRenderer, getInputNameRendererTitle, getItalicAndStrongLanguageMarkerList, getJSOnSubmit, getLastSufix, getLayout, getListClass, getListGroup, getListItemTag, getListTag, getLocalMessage, getLock, getManualCssClass, getMarkerList, getMessage, getMirrorWrapper, getModificationDate, getNextComponent, getPage, getPrefixCssClass, getPreviewAttributes, getPreviewCssClass, getPreviewCssId, getPreviousComponent, getQuotationLanguageMarkerList, getReferenceComponent, getRemplacement, getRenderer, getRendererTitle, getRenderes, getRequestComponent, getSearchLevel, getSelectRendererXHTML, getSpecialInputTag, getSpecialPreviewCssId, getSpecialTagTitle, getSpecialTagXHTML, getSpecificCssClass, getStyle, getStyleLabel, getStyleTitle, getTag, getTextColor, getTextMessage, getTextPosition, getTitleLevel, getTypeInputName, getValue, getValue, getVersion, getViewData, getViewDataFile, getViewID, getViewText, getWidth, getWordCount, getXHTMLCode, getXHTMLConfig, haveRight, includeComponentJSP, includePage, init, insert, isAjaxWrapper, isAskWidth, isAutoRenderer, isBackgroundColored, isCanAddClass, isCloseRow, isColored, isColumnable, isConfig, isContentCachableByQuery, 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, isReversedLink, isStyleHidden, isUnique, isValueProperties, isViewDataFile, isVisible, isVisible, isVisibleFromCookies, isWrapped, isXML, loadViewData, markAsNew, 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, updateCache
-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.javlo.component.core.IContentVisualComponent
cleanResources, clearReplacement, delete, equals, extractFieldsFromRenderer, forceInit, getArea, getAuthors, getClassName, getColumnSize, getColumnStyle, getComponentBean, getComponentCssClass, getConfig, getConfigInValue, getConfigMessage, getContentAsText, getContentMessage, getContentName, getCreationDate, getCurrentRenderer, getDescription, getEditText, getEmptyXHTMLCode, getErrorMessage, getErrorMessage, getExternalModules, getFirstPrefix, getFontAwesome, getGroup, getHeaderContent, getHelpText, getHelpURL, getI18nEditableKeys, getId, getInputNameRenderer, getJSOnSubmit, getLastSufix, getLayout, getListGroup, getMarkerList, getMessage, getModificationDate, getNextComponent, getPreviousComponent, getReferenceComponent, getRenderer, getSearchLevel, getSpecialTagTitle, getSpecialTagXHTML, getStyle, getStyleLabel, getStyleTitle, getTextMessage, getTitleLevel, getValue, getVersion, getViewText, getWordCount, getXHTMLCode, getXHTMLConfig, insert, isColumnable, isConfig, isDefaultValue, isDispayEmptyXHTMLCode, isDisplayable, isDisplayHidden, isEditOnCreate, isFirstRepeated, isHelpURL, isHidden, isHiddenInMode, isInline, isInsertable, isList, isListable, isMetaTitle, isMirroredByDefault, isModify, isNeedRefresh, isNew, isNolink, isRepeat, isRepeatable, isUnique, isVisible, isVisible, isVisibleFromCookies, loadViewData, markAsNew, next, performConfig, previous, replaceAllInContent, replaceInContent, resetViewData, setColumnSize, setContainerPage, setDisplayHidden, setGroup, setList, setNeedRefresh, setNextComponent, setPage, setPreviousComponent, setRenderer, setRepeat, setStyle, setValid, stored
-
Methods inherited from interface org.javlo.fields.IFieldContainer
getPage
-
Methods inherited from interface org.javlo.component.meta.ITimeRange
isTimeRangeValid
-
-
-
-
Field Detail
-
JSP_HEADER
public static final String JSP_HEADER
- See Also:
- Constant Field Values
-
HIDDEN
public static final String HIDDEN
- See Also:
- Constant Field Values
-
logger
protected static Logger logger
create a static logger.
-
properties
protected StructuredProperties properties
-
-
Method Detail
-
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
-
getStyleList
public String[] getStyleList(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get the list of style possible for this component.- Specified by:
getStyleList
in interfaceIContentVisualComponent
- Overrides:
getStyleList
in classAbstractVisualComponent
- Returns:
- a list of string represent a style.
-
getStyleLabelList
public String[] getStyleLabelList(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return a list of label define the style.- Specified by:
getStyleLabelList
in interfaceIContentVisualComponent
- Overrides:
getStyleLabelList
in classAbstractVisualComponent
- Returns:
- a list of label.
-
init
public void init(ComponentBean bean, ContentContext newContext) throws Exception
- Overrides:
init
in classAbstractVisualComponent
- Throws:
Exception
-
reloadProperties
public void reloadProperties()
-
contructViewStyle
protected String contructViewStyle(ContentContext ctx)
- Overrides:
contructViewStyle
in classAbstractVisualComponent
-
getPrefixViewXHTMLCode
public String getPrefixViewXHTMLCode(ContentContext ctx)
Description copied from interface:IContentVisualComponent
code for prefix the view XHTML code.- Specified by:
getPrefixViewXHTMLCode
in interfaceIContentVisualComponent
- Overrides:
getPrefixViewXHTMLCode
in classAbstractVisualComponent
- Returns:
- XHTML code.
-
getSuffixViewXHTMLCode
public String getSuffixViewXHTMLCode(ContentContext ctx)
Description copied from interface:IContentVisualComponent
code for sufix the view XHTML code.- Specified by:
getSuffixViewXHTMLCode
in interfaceIContentVisualComponent
- Overrides:
getSuffixViewXHTMLCode
in classAbstractVisualComponent
- Returns:
- XHTML code.
-
getViewListXHTMLCode
public String getViewListXHTMLCode(ContentContext ctx) throws Exception
- Specified by:
getViewListXHTMLCode
in interfaceIFieldContainer
- Throws:
Exception
-
getViewXHTMLCode
public String getViewXHTMLCode(ContentContext ctx) throws Exception
- Specified by:
getViewXHTMLCode
in interfaceIFieldContainer
- Overrides:
getViewXHTMLCode
in classAbstractVisualComponent
- Throws:
Exception
- See Also:
org.javlo.itf.IContentVisualComponent#getXHTMLCode()
-
getViewXHTMLCode
public String getViewXHTMLCode(ContentContext ctx, boolean asList) throws Exception
- Throws:
Exception
-
getFieldsNames
public List<String> getFieldsNames(ContentContext ctx)
- Specified by:
getFieldsNames
in interfaceIFieldContainer
-
getFields
public List<Field> getFields(ContentContext ctx) throws Exception
- Specified by:
getFields
in interfaceIFieldContainer
- Throws:
Exception
-
getField
public Field getField(ContentContext ctx, String name) throws Exception
- Specified by:
getField
in interfaceIFieldContainer
- Throws:
Exception
-
getFieldValue
public String getFieldValue(ContentContext ctx, String name) throws Exception
- Specified by:
getFieldValue
in interfaceIFieldContainer
- Throws:
Exception
-
getCSSClass
public String getCSSClass()
-
getPrefix
public String getPrefix()
-
getSuffix
public String getSuffix()
-
isWrapped
public boolean isWrapped()
-
getColumnableDefaultValue
protected boolean getColumnableDefaultValue()
- Overrides:
getColumnableDefaultValue
in classAbstractVisualComponent
-
getDataPath
public String getDataPath()
-
getList
public Map<String,String> getList(ContentContext ctx, String listName, Locale locale)
- Specified by:
getList
in interfaceIFieldContainer
-
getList
public Map<String,String> getList(ContentContext ctx, String listName)
- Specified by:
getList
in interfaceIFieldContainer
-
getInputName
protected String getInputName(String field)
- Overrides:
getInputName
in classAbstractVisualComponent
-
isNotififyCreation
public boolean isNotififyCreation(ContentContext ctx) throws ServiceException
- Throws:
ServiceException
-
getNotififyPageName
public String getNotififyPageName(ContentContext ctx) throws ServiceException
- Throws:
ServiceException
-
getEditXHTMLCode
protected String getEditXHTMLCode(ContentContext ctx) throws Exception
- Overrides:
getEditXHTMLCode
in classAbstractVisualComponent
- Throws:
Exception
-
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.
-
storeProperties
public void storeProperties()
-
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
-
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
-
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)
-
getProperties
public StructuredProperties getProperties()
-
setProperties
public void setProperties(StructuredProperties properties)
-
setConfigProperties
public void setConfigProperties(Properties properties)
-
getConfigProperties
public Properties getConfigProperties()
-
newInstance
public IContentVisualComponent newInstance(ComponentBean bean, ContentContext newCtx, MenuElement page) throws Exception
Description copied from interface:IContentVisualComponent
init the component, do that before all using.- Specified by:
newInstance
in interfaceIContentVisualComponent
- Overrides:
newInstance
in classAbstractVisualComponent
newCtx
- the context of the content manager.- Throws:
Exception
-
getComponentLabel
public String getComponentLabel(ContentContext ctx, String lg)
Description copied from interface:IContentVisualComponent
return the label of the element.- Specified by:
getComponentLabel
in interfaceIContentVisualComponent
- Overrides:
getComponentLabel
in classAbstractVisualComponent
lg
- language of the label- Returns:
- the label of the element.
-
getKey
public String getKey()
Description copied from interface:IContentVisualComponent
get a unic key of the component. User special for DynamicComponent.- Specified by:
getKey
in interfaceIContentVisualComponent
- Overrides:
getKey
in classAbstractVisualComponent
-
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
- Specified by:
isRealContent
in interfaceIFieldContainer
- 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:
-
contains
public boolean contains(ContentContext ctx, String uri)
Description copied from interface:IStaticContainer
check if the class contains the static resources define by a URI- Specified by:
contains
in interfaceIStaticContainer
uri
- a uri to a static resources- Returns:
- true if the class conatins this static resources.
-
getAllResources
public Collection<Resource> getAllResources(ContentContext ctx)
Description copied from interface:IStaticContainer
return all resources found in the component.- Specified by:
getAllResources
in interfaceIStaticContainer
- Returns:
-
renameResource
public boolean renameResource(ContentContext ctx, File oldName, File newName)
Description copied from interface:IStaticContainer
rename a resource- Specified by:
renameResource
in interfaceIStaticContainer
- Returns:
- true if rename, false else
-
getLabel
public String getLabel(ContentContext ctx)
- Specified by:
getLabel
in interfaceIFieldContainer
-
isContentTimeCachable
public boolean isContentTimeCachable(ContentContext ctx)
- Overrides:
isContentTimeCachable
in classAbstractVisualComponent
-
getAllResourcesLinks
public Collection<Link> getAllResourcesLinks(ContentContext ctx)
Description copied from interface:IStaticContainer
create link to resources.- Specified by:
getAllResourcesLinks
in interfaceIStaticContainer
- Returns:
-
getDate
public Date getDate(ContentContext ctx)
-
isValidDate
public boolean isValidDate(ContentContext ctx)
- Specified by:
isValidDate
in interfaceIDate
-
getPopularity
public int getPopularity(ContentContext ctx)
Description copied from interface:IStaticContainer
return indice of popularity- Specified by:
getPopularity
in interfaceIStaticContainer
- Returns:
-
contentHashCode
public int contentHashCode()
-
getTextForSearch
public String getTextForSearch(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return a text represent the content of the component. sample all the content :-)- Specified by:
getTextForSearch
in interfaceIContentVisualComponent
- Overrides:
getTextForSearch
in classAbstractVisualComponent
- Returns:
- a text represent the content of the component for the search module
-
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
-
reload
public void reload(ContentContext ctx) throws Exception
- Throws:
Exception
-
getURL
public String getURL(ContentContext ctx) throws Exception
Description copied from interface:ILink
generate a URL or URI link with all elements to click on.
-
isLinkValid
public boolean isLinkValid(ContentContext ctx) throws Exception
Description copied from interface:ILink
return true if the link on the component is enabled- Specified by:
isLinkValid
in interfaceILink
- Returns:
- Throws:
Exception
-
getImageField
protected FieldImage getImageField(ContentContext ctx)
-
getImageDescription
public String getImageDescription(ContentContext ctx)
- Specified by:
getImageDescription
in interfaceIImageTitle
-
getResourceURL
public String getResourceURL(ContentContext ctx)
- Specified by:
getResourceURL
in interfaceIImageTitle
-
getImageLinkURL
public String getImageLinkURL(ContentContext ctx)
- Specified by:
getImageLinkURL
in interfaceIImageTitle
-
isImageValid
public boolean isImageValid(ContentContext ctx)
- Specified by:
isImageValid
in interfaceIImageTitle
-
getLabelLevel
public int getLabelLevel(ContentContext ctx)
Description copied from interface:IContentVisualComponent
define the level of label. If there area most than 1 level on page, the label of the page is the bigger level.- Specified by:
getLabelLevel
in interfaceIContentVisualComponent
- Overrides:
getLabelLevel
in classAbstractVisualComponent
- Returns:
- 0=default, no the components is'nt label.
-
getTextTitle
public String getTextTitle(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return a string representation of the component with complete title- Specified by:
getTextTitle
in interfaceIContentVisualComponent
- Overrides:
getTextTitle
in classAbstractVisualComponent
- Returns:
-
getTextLabel
public String getTextLabel(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return a string representation of the component- Specified by:
getTextLabel
in interfaceIContentVisualComponent
- Overrides:
getTextLabel
in classAbstractVisualComponent
-
getSpecificClass
public String getSpecificClass(ContentContext ctx)
Description copied from class:AbstractVisualComponent
override this method for add specific class to prefix.- Overrides:
getSpecificClass
in classAbstractVisualComponent
- Returns:
-
getPageDescription
public String getPageDescription(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return the description of the page if this component is or contains description.- Specified by:
getPageDescription
in interfaceIContentVisualComponent
- Overrides:
getPageDescription
in classAbstractVisualComponent
- Returns:
-
getSubTitle
public String getSubTitle(ContentContext ctx)
- Specified by:
getSubTitle
in interfaceISubTitle
-
getSubTitleLevel
public int getSubTitleLevel(ContentContext ctx)
- Specified by:
getSubTitleLevel
in interfaceISubTitle
-
getPriority
public int getPriority(ContentContext ctx)
Description copied from interface:IImageTitle
return the priority of the picture inside the page (9=max)- Specified by:
getPriority
in interfaceIImageTitle
- Returns:
-
isFieldContainer
public boolean isFieldContainer(ContentContext ctx)
- Specified by:
isFieldContainer
in interfaceIFieldContainer
-
getContainerType
public String getContainerType(ContentContext ctx)
- Specified by:
getContainerType
in interfaceIFieldContainer
-
getXHTMLId
public String getXHTMLId(ContentContext ctx)
- Specified by:
getXHTMLId
in interfaceISubTitle
-
getDynamicId
public String getDynamicId()
-
setDynamicId
public void setDynamicId(String id)
-
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
-
getContentAsMap
public Map<String,Object> getContentAsMap(ContentContext ctx) throws Exception
- Specified by:
getContentAsMap
in interfaceIRestItem
- Overrides:
getContentAsMap
in classAbstractVisualComponent
- Throws:
Exception
-
getFiles
public List<File> getFiles(ContentContext ctx)
- Specified by:
getFiles
in interfaceIStaticContainer
-
getDirSelected
public String getDirSelected(ContentContext ctx)
Description copied from interface:IStaticContainer
get folder with ressources- Specified by:
getDirSelected
in interfaceIStaticContainer
- Returns:
-
setDirSelected
public void setDirSelected(String dir)
Description copied from interface:IStaticContainer
set folder with resources- Specified by:
setDirSelected
in interfaceIStaticContainer
-
setLatestValidDate
public void setLatestValidDate(Date date)
- Specified by:
setLatestValidDate
in interfaceILink
-
getLatestValidDate
public Date getLatestValidDate()
- Specified by:
getLatestValidDate
in interfaceILink
-
getExternalResources
public Collection<String> getExternalResources(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return the external resources needed from component as css, javascript...- Specified by:
getExternalResources
in interfaceIContentVisualComponent
- Overrides:
getExternalResources
in classAbstractVisualComponent
- Returns:
- a list of URI to external resources
-
isRestMatch
public boolean isRestMatch(ContentContext ctx, Map<String,String> params)
- Specified by:
isRestMatch
in interfaceIContentVisualComponent
- Overrides:
isRestMatch
in classAbstractVisualComponent
-
getIcon
public String getIcon()
- Specified by:
getIcon
in interfaceIContentVisualComponent
- Overrides:
getIcon
in classAbstractVisualComponent
-
isAutoDeletable
protected boolean isAutoDeletable()
- Overrides:
isAutoDeletable
in classAbstractVisualComponent
-
isValueTranslatable
protected boolean isValueTranslatable()
- Overrides:
isValueTranslatable
in classAbstractVisualComponent
-
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:
-
isMobileOnly
public boolean isMobileOnly(ContentContext ctx)
- Specified by:
isMobileOnly
in interfaceIImageTitle
-
getTimeRangeStart
public LocalDateTime getTimeRangeStart(ContentContext ctx)
- Specified by:
getTimeRangeStart
in interfaceITimeRange
-
getTimeRangeEnd
public LocalDateTime getTimeRangeEnd(ContentContext ctx)
- Specified by:
getTimeRangeEnd
in interfaceITimeRange
-
-