Package org.javlo.component.core
Interface IContentVisualComponent
-
- All Superinterfaces:
Comparable<IContentVisualComponent>
,IRestItem
- All Known Subinterfaces:
IContainer
,IFieldContainer
,IVideo
- All Known Implementing Classes:
AbstractFileComponent
,AbstractOrderComponent
,AbstractPropertiesComponent
,AbstractRowComponent
,AbstractSurvey
,AbstractVisualComponent
,AddressFormRegisterComponent
,AgendaImport
,AllImagesGallery
,AnchorComponent
,AnchorLink
,ArrayDisplayComponent
,ArrayFileComponent
,AutoNumberComponent
,BeanEditionComponent
,Box
,Breadcrumb
,CalendarComponent
,Category
,ChangeLanguageLink
,ChangeLanguageMenu
,ChatComponent
,ChildrenLink
,ChooseBaseContext
,CloseCol
,CloudTag
,Code
,ColorComponent
,ComplexEventDefinitionComponent
,ComplexPropertiesLink
,ComponentList
,Contact
,ContactInformation
,ContactText
,ContentSeparation
,CountAccess
,CountTool
,CreateContext
,CSVArrayComponent
,DataList
,DateComponent
,DebugNote
,DefaultTableBreak
,DefinitionComponent
,Description
,DisplayComponent
,DisplayResult
,DisplayUserInfo
,DynamicComponent
,DynamicComponentBasket
,DynamicComponentCreator
,DynamicComponentFactory
,DynamicComponentFilter
,DynamicComponentList
,DynamicParagraph
,EditBasketComponent
,EmbedVideo
,EpubConverterComponent
,EventDefinitionComponent
,EventRegistration
,ExtendedWidget
,ExternalLink
,FacebookChooseFriend
,FAQComponent
,FileFinder
,FolderedMultimedia
,FollowComponent
,Font
,ForceRealContent
,FormComponent
,FormInputComponent
,FormMailingComponent
,Forward
,FreeImage
,FreeImageWithVisibleLabel
,FreeTextList
,FullWysiwygParagraph
,Gallery
,GenericFile
,GenericFileList
,GenericForm
,GenericFormForRegistering
,GenericQuiz
,GlobalImage
,GlobalImageSession
,GraphicCharter
,GroupTitle
,Heading
,HeadMeta
,I18nComponent
,Image
,ImageBackground
,ImageTitle
,IMComponent
,InternalLink
,InvisibleImage
,IubendaRemoteImport
,Keywords
,LanguageCopy
,LanguageMirrorComponent
,LaunchMacro
,Layouts
,LinkLabel
,List
,ListSurvey
,LocationComponent
,LoginLogoutLink
,LottieAnimationComponent
,Map
,MapComponent
,Menu
,MenuTitle
,MessageContainer
,MetaDescription
,MetaTitle
,MirrorComponent
,MirrorLinkImportation
,MoneybookersPayement
,MonthChildrenLink
,Multimedia
,MultimediaFilter
,MultimediaGallery
,MyEvents
,NextPage
,NotSearchPage
,OnlineVideo
,OpenCell
,OpenCol
,OpenRow
,PageBreak
,PageCss
,PageMirrorComponent
,PageRank
,PageReferenceComponent
,PageTitle
,PageURL
,PageWeight
,Paragraph
,PaypalOrderComponent
,PDFLayoutComponent
,PDFLink
,PDFMultimedia
,PreviousPage
,ProductComponent
,QuizzParty
,ReactionComponent
,RendererReferenceComponent
,RepeatContainer
,ResultSurvey
,Row
,RowColumn
,RSSLink
,RSSReader
,RSSRegistration
,SearchResultComponent
,Section
,SectionLinks
,SecureText
,SelectSurvey
,ShowTemplateComponent
,SimpleInternalLink
,SimplePoll
,SimpleVideo
,SiteMap
,Slogan
,SmartExternalLink
,SmartExternalLinkImportation
,SmartGenericForm
,SmartHTMLPageImportation
,SmartLink
,SortSurvey
,Sound
,Space
,StaticMapComponent
,StripeOrderComponent
,SubTitle
,SubtitleLink
,Survey
,SurveyGenericForm
,TableBreak
,TableComponent
,Tags
,TaxonomyDisplayComponent
,TaxonomySessionComponent
,TestComponent
,Text
,TextDirection
,TimeRangeComponent
,Title
,ToTheTopComponent
,TransferOrderComponent
,TwitterReader
,Unknown
,UnsubsribeLink
,UploadFileComponent
,UserInfoLink
,UserLogin
,UserRegistration
,UserSearch
,VFSFile
,Video
,VideoContentMultimedia
,Wall
,WebSiteTitle
,WeekChildrenLink
,WysiwygParagraph
,XHTML
public interface IContentVisualComponent extends Comparable<IContentVisualComponent>, IRestItem
- Author:
- pvandermaesen
-
-
Field Summary
Fields Modifier and Type Field Description static String
COLORED_WRAPPER_CLASS
static String
COMP_ID_REQUEST_PARAM
static int
COMPLEXITY_ADMIN
static int
COMPLEXITY_EASY
static int
COMPLEXITY_STANDARD
static String
CONTAINER_COLOR
static String
DEFAULT_COLOR
static String
DYN_COMP_COLOR
static String
ECOM_COLOR
static String
EDIT_ACTION_CSS_CLASS
static String
GRAPHIC_COLOR
static int
HIGH_LABEL_LEVEL
static String
ID_SEPARATOR
static String
LINK_COLOR
static int
LOW_LABEL_LEVEL
static String
META_COLOR
static int
MIDDLE_LABEL_LEVEL
static int
SEARCH_LEVEL_HIGH
static int
SEARCH_LEVEL_LOW
static int
SEARCH_LEVEL_MIDDLE
static int
SEARCH_LEVEL_NONE
static String
TEXT_COLOR
static String
VIEW_DEFINITION_REQUEST_ID
static String
WEB2_COLOR
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
cleanResources(ContentContext ctx)
clean resources.void
clearReplacement()
clear remplacement valuesvoid
delete(ContentContext ctx)
this method is called when component is deleted.boolean
equals(ContentContext ctx, IContentVisualComponent comp)
check of component is considered as the same than an other.List<String>
extractFieldsFromRenderer(ContentContext ctx)
extract field define in the current renderervoid
forceInit(ComponentBean bean, ContentContext ctx)
force a init.String
getArea()
get the area where the component must be renderedString
getAuthors()
authors of the componentString
getClassName()
return the name of the class (use for JSTL)int
getColumnSize(ContentContext ctx)
get the size of the column, the column contains the componentString
getColumnStyle(ContentContext ctx)
int
getComplexityLevel(ContentContext ctx)
return the complexity level of the component.ComponentBean
getComponentBean()
get the internal dataString
getComponentCssClass(ContentContext ctx)
get the current style of the component.String
getComponentLabel(ContentContext ctx, String lg)
return the label of the element.ComponentConfig
getConfig(ContentContext ctx)
get the configuration of the component. from project or from template.String
getConfigInValue(String key, String defaultValue)
transform the value of the component in a config properties file.GenericMessage
getConfigMessage(ContentContext ctx)
warning message on config tabString
getContentAsText(ContentContext ctx)
get the text of the componentGenericMessage
getContentMessage(ContentContext ctx)
warning message on content tabString
getContentName()
return the name if the content field (textarea...)Date
getCreationDate()
String
getCurrentRenderer(ContentContext ctx)
return the name of the renderer.String
getDescription(Locale local)
a description of the component;String
getEditText(ContentContext ctx, String key)
get a internationalized text, in the languague of the edition.String
getEmptyXHTMLCode(ContentContext ctx)
return the code if component contain's no data.String
getErrorMessage(String fieldName)
return a error message in current view languageString
getErrorMessage(ContentContext ctx)
return error message on structure of the component.Collection<String>
getExternalModules(ContentContext ctx)
Collection<String>
getExternalResources(ContentContext ctx)
return the external resources needed from component as css, javascript...String
getFirstPrefix(ContentContext ctx)
get the prefix must be insered before a list of the current component (warning: one element is a list) #return XHTML code of prefixString
getFontAwesome()
Deprecated.String
getGroup()
get the group of the component (meta, text, links, media,...)String
getHeaderContent(ContentContext ctx)
return the part of header needed for this componentString
getHelpText(ContentContext ctx)
String
getHelpURL(ContentContext ctx)
a url to descripe the usage of the componentString
getHexColor()
get the exadecimal color for representation of the component.List<String>
getI18nEditableKeys(ContentContext ctx)
get i18n keys for editionString
getIcon()
String
getId()
return a unique id for the coponentString
getInputNameRenderer()
get the input name of the renderer.String
getJSOnSubmit()
return the java script code called when global form is submited.String
getKey()
get a unic key of the component.int
getLabelLevel(ContentContext ctx)
define the level of label.String
getLastSufix(ContentContext ctx)
get the sufix before must be insered after a list of the current component.ComponentLayout
getLayout()
get a simple layout for the component.String
getListGroup()
return the name of group component.List<SuffixPrefix>
getMarkerList(ContentContext ctx)
return the title of the style choice.GenericMessage
getMessage()
get a message for the component.Date
getModificationDate()
IContentVisualComponent
getNextComponent()
return the next component in the page sequence.MenuElement
getPage()
get the page contains the componentString
getPageDescription(ContentContext ctx)
return the description of the page if this component is or contains description.String
getPrefixViewXHTMLCode(ContentContext ctx)
code for prefix the view XHTML code.IContentVisualComponent
getPreviousComponent()
return the previous component in the page sequence.IContentVisualComponent
getReferenceComponent(ContentContext ctx)
reference to the same component in default languageString
getRenderer(ContentContext ctx)
get the current renderer for the component view.int
getSearchLevel()
return the level of the component is a search.String
getSpecialTagTitle(ContentContext ctx)
String
getSpecialTagXHTML(ContentContext ctx)
String
getStyle()
get the style of the display (sp. image-left, image-right)String
getStyleLabel(ContentContext ctx)
get the label of the current styleString[]
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
getStyleTitle(ContentContext ctx)
return the title of the style choice.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 componentGenericMessage
getTextMessage(ContentContext ctx)
warning message on text tabString
getTextTitle(ContentContext ctx)
return a string representation of the component with complete titleint
getTitleLevel(ContentContext ctx)
get the level of the title (1,2,3...). return 0 if the component is not a titleString
getType()
return the type of the element.String
getValue(ContentContext ctx)
get the value of the content without any rendering.String
getVersion()
return the version of the component : A.B.C A : major version, no compatibility with the older data B : new function but compatibilty with older data C : bug correctionString
getViewText(ContentContext ctx, String key)
get a internationalized text, in the languague of the view.int
getWordCount(ContentContext ctx)
count the word in the content.String
getXHTMLCode(ContentContext ctx)
the code for view the element in XHTML environment.String
getXHTMLConfig(ContentContext ctx)
xhtml code for config the componentboolean
initContent(ContentContext ctx)
init the content with a default value. sample : "lorem ipsum" for text component.void
insert(String text)
insert a text in the componentboolean
isColumnable(ContentContext ctx)
contributor can select size of column to wrap componentboolean
isConfig(ContentContext ctx)
return true if there the component is configurable.boolean
isContentCachable(ContentContext ctx)
return the part of header needed for this componentboolean
isDefaultValue(ContentContext ctx)
return true if value is never modified.boolean
isDispayEmptyXHTMLCode(ContentContext ctx)
display empty xhtml code if emptyboolean
isDisplayable(ContentContext ctx)
true if the component can be displayed in preview modeboolean
isDisplayHidden()
is component displayed for visitorboolean
isEditOnCreate(ContentContext ctx)
return true if the component is directly edited when it is insered.boolean
isFirstRepeated()
return true if component is in the first repeat sequence of the page.boolean
isHelpURL(ContentContext ctx)
boolean
isHidden(ContentContext ctx)
true if component marked as hidden (in components.txt the class name start with '.')boolean
isHiddenInMode(ContentContext ctx, int mode, Boolean mobile)
component can be hidded in some mode, like view or preview.boolean
isInline()
check if the component can be inserd inline.boolean
isInsertable()
you can insert a text in this componentboolean
isList(ContentContext ctx)
true if the component is in a listboolean
isListable()
you display the composant as a list (if you want)boolean
isMetaTitle()
return true is this component is a title of a group of component.boolean
isMirroredByDefault(ContentContext ctx)
if this component is duplicated, by default it is mirrored.boolean
isModify()
boolean
isNeedRefresh()
return true if the modifition of the component need a refresh of the edit page (ajax).boolean
isNew(ContentContext ctx)
check if this component has maked has new in the current requestboolean
isNolink()
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
isRepeat()
boolean
isRepeatable()
boolean
isRestMatch(ContentContext ctx, Map<String,String> params)
boolean
isUnique()
return true if the component must be unique on a pageboolean
isVisible()
boolean
isVisible(ContentContext ctx)
check if this element is visible in the format.boolean
isVisibleFromCookies(ContentContext ctx)
visible or no, depend of the choice of visitor with cookiesvoid
loadViewData(ContentContext ctx)
load special data file.void
markAsNew(ContentContext ctx)
mark component as new in the current requestIContentVisualComponent
newInstance(ComponentBean bean, ContentContext newCtx, MenuElement page)
init the component, do that before all using.IContentVisualComponent
next()
get the next component on the page. if null this is the last component.String
performConfig(ContentContext ctx)
action to manage the config, call when global content form is saved.String
performEdit(ContentContext ctx)
action call when update the content page.void
prepareView(ContentContext ctx)
this method is called before rendering the component.IContentVisualComponent
previous()
get the next component on the page. if null this is the last component.void
replaceAllInContent(Map<String,String> replacement)
add a list of remplacement key, valuevoid
replaceInContent(String source, String target)
replace a content in visual elementvoid
resetViewData(ContentContext ctx)
reset the view data.void
setColumnSize(int size)
set the size of the column, the column contains the componentvoid
setContainerPage(ContentContext ctx, MenuElement page)
set the page of a container (page mirror, component mirror).void
setDisplayHidden(boolean hidden)
hide component in display modevoid
setGroup(String grp)
void
setList(boolean inList)
put the component is a listvoid
setNeedRefresh(boolean needRefresh)
if you set true the page is refresh after updatevoid
setNextComponent(IContentVisualComponent nextComponent)
change the previous componentvoid
setPage(MenuElement inPage)
void
setPreviousComponent(IContentVisualComponent nextComponent)
change the previous componentvoid
setRenderer(ContentContext ctx, String renderer)
set the current renderer for the component view.void
setRepeat(boolean newRepeat)
void
setStyle(ContentContext ctx, String inStyle)
set the current style of the component.void
setValid(boolean inVisible)
void
setValue(String inContent)
set the content without renderingvoid
stored()
call this method when the component is stored.boolean
transflateFrom(ContentContext ctx, ITranslator translator, String lang)
translate the content of the component to the current language-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.javlo.data.rest.IRestItem
getContentAsMap
-
-
-
-
Field Detail
-
ID_SEPARATOR
static final String ID_SEPARATOR
- See Also:
- Constant Field Values
-
VIEW_DEFINITION_REQUEST_ID
static final String VIEW_DEFINITION_REQUEST_ID
- See Also:
- Constant Field Values
-
COMP_ID_REQUEST_PARAM
static final String COMP_ID_REQUEST_PARAM
- See Also:
- Constant Field Values
-
EDIT_ACTION_CSS_CLASS
static final String EDIT_ACTION_CSS_CLASS
- See Also:
- Constant Field Values
-
SEARCH_LEVEL_NONE
static final int SEARCH_LEVEL_NONE
- See Also:
- Constant Field Values
-
SEARCH_LEVEL_LOW
static final int SEARCH_LEVEL_LOW
- See Also:
- Constant Field Values
-
SEARCH_LEVEL_MIDDLE
static final int SEARCH_LEVEL_MIDDLE
- See Also:
- Constant Field Values
-
SEARCH_LEVEL_HIGH
static final int SEARCH_LEVEL_HIGH
- See Also:
- Constant Field Values
-
COMPLEXITY_EASY
static final int COMPLEXITY_EASY
- See Also:
- Constant Field Values
-
COMPLEXITY_STANDARD
static final int COMPLEXITY_STANDARD
- See Also:
- Constant Field Values
-
COMPLEXITY_ADMIN
static final int COMPLEXITY_ADMIN
- See Also:
- Constant Field Values
-
DEFAULT_COLOR
static final String DEFAULT_COLOR
- See Also:
- Constant Field Values
-
TEXT_COLOR
static final String TEXT_COLOR
- See Also:
- Constant Field Values
-
LINK_COLOR
static final String LINK_COLOR
- See Also:
- Constant Field Values
-
META_COLOR
static final String META_COLOR
- See Also:
- Constant Field Values
-
GRAPHIC_COLOR
static final String GRAPHIC_COLOR
- See Also:
- Constant Field Values
-
ECOM_COLOR
static final String ECOM_COLOR
- See Also:
- Constant Field Values
-
DYN_COMP_COLOR
static final String DYN_COMP_COLOR
- See Also:
- Constant Field Values
-
WEB2_COLOR
static final String WEB2_COLOR
- See Also:
- Constant Field Values
-
CONTAINER_COLOR
static final String CONTAINER_COLOR
- See Also:
- Constant Field Values
-
COLORED_WRAPPER_CLASS
static final String COLORED_WRAPPER_CLASS
- See Also:
- Constant Field Values
-
HIGH_LABEL_LEVEL
static final int HIGH_LABEL_LEVEL
- See Also:
- Constant Field Values
-
MIDDLE_LABEL_LEVEL
static final int MIDDLE_LABEL_LEVEL
- See Also:
- Constant Field Values
-
LOW_LABEL_LEVEL
static final int LOW_LABEL_LEVEL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getConfig
ComponentConfig getConfig(ContentContext ctx)
get the configuration of the component. from project or from template.- Parameters:
ctx
-- Returns:
-
performEdit
String performEdit(ContentContext ctx) throws Exception
action call when update the content page.- Returns:
- the error message, null if no error
- Throws:
Exception
-
getStyle
String getStyle()
get the style of the display (sp. image-left, image-right)- Returns:
-
prepareView
void prepareView(ContentContext ctx) throws Exception
this method is called before rendering the component.- Parameters:
ctx
-- Throws:
Exception
-
getXHTMLCode
String getXHTMLCode(ContentContext ctx) throws Exception
the code for view the element in XHTML environment.- Returns:
- Throws:
Exception
-
isDisplayable
boolean isDisplayable(ContentContext ctx) throws Exception
true if the component can be displayed in preview mode- Parameters:
ctx
-- Returns:
- Throws:
Exception
-
isDispayEmptyXHTMLCode
boolean isDispayEmptyXHTMLCode(ContentContext ctx) throws Exception
display empty xhtml code if empty- Parameters:
ctx
-- Returns:
- Throws:
Exception
-
getEmptyXHTMLCode
String getEmptyXHTMLCode(ContentContext ctx) throws Exception
return the code if component contain's no data.- Throws:
Exception
-
getXHTMLConfig
String getXHTMLConfig(ContentContext ctx) throws Exception
xhtml code for config the component- Returns:
- Throws:
Exception
-
isConfig
boolean isConfig(ContentContext ctx)
return true if there the component is configurable.- Parameters:
ctx
-- Returns:
-
performConfig
String performConfig(ContentContext ctx) throws Exception
action to manage the config, call when global content form is saved.- Parameters:
ctx
-- Returns:
- Throws:
Exception
-
getValue
String getValue(ContentContext ctx)
get the value of the content without any rendering.- Returns:
- content in a text format.
-
setValue
void setValue(String inContent)
set the content without rendering- Parameters:
inContent
-
-
getType
String getType()
return the type of the element.- Returns:
- the type of the element.
-
getComponentLabel
String getComponentLabel(ContentContext ctx, String lg)
return the label of the element.- Parameters:
lg
- language of the label- Returns:
- the label of the element.
-
getTitleLevel
int getTitleLevel(ContentContext ctx)
get the level of the title (1,2,3...). return 0 if the component is not a title- Returns:
- the level of the title, 0 if the component is not a title.
-
isVisible
boolean isVisible(ContentContext ctx)
check if this element is visible in the format.- Returns:
- true if elment visible, false else
-
isVisibleFromCookies
boolean isVisibleFromCookies(ContentContext ctx)
visible or no, depend of the choice of visitor with cookies- Parameters:
ctx
-- Returns:
-
getId
String getId()
return a unique id for the coponent
-
newInstance
IContentVisualComponent newInstance(ComponentBean bean, ContentContext newCtx, MenuElement page) throws Exception
init the component, do that before all using.- Parameters:
newContent
- the content of the componentnewId
- the id of the componentnewCtx
- the context of the content manager.- Throws:
Exception
-
isModify
boolean isModify()
- Returns:
- true if the composant was modified.
-
isUnique
boolean isUnique()
return true if the component must be unique on a page- Returns:
-
isRealContent
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.- Parameters:
ctx
- current context- Returns:
-
isDefaultValue
boolean isDefaultValue(ContentContext ctx)
return true if value is never modified.- Returns:
- true if value contain default value.
-
stored
void stored()
call this method when the component is stored.
-
getViewText
String getViewText(ContentContext ctx, String key) throws ResourceNotFoundException
get a internationalized text, in the languague of the view.- Parameters:
key
- the key of the text- Returns:
- the text in the current language
- Throws:
ResourceNotFoundException
-
getEditText
String getEditText(ContentContext ctx, String key)
get a internationalized text, in the languague of the edition.- Parameters:
key
- the key of the text- Returns:
- the text in the current language
-
getErrorMessage
String getErrorMessage(String fieldName) throws ResourceNotFoundException
return a error message in current view language- Parameters:
key
- the of the error message- Returns:
- a error message in current view language
- Throws:
ResourceNotFoundException
-
getComponentBean
ComponentBean getComponentBean()
get the internal data- Returns:
-
getTextLabel
String getTextLabel(ContentContext ctx)
return a string representation of the component
-
getTextTitle
String getTextTitle(ContentContext ctx)
return a string representation of the component with complete title- Returns:
-
isRepeat
boolean isRepeat()
-
setRepeat
void setRepeat(boolean newRepeat)
-
getLabelLevel
int getLabelLevel(ContentContext ctx)
define the level of label. If there area most than 1 level on page, the label of the page is the bigger level.- Parameters:
ctx
-- Returns:
- 0=default, no the components is'nt label.
-
getJSOnSubmit
String getJSOnSubmit()
return the java script code called when global form is submited.- Returns:
- java script code.
-
extractFieldsFromRenderer
List<String> extractFieldsFromRenderer(ContentContext ctx) throws IOException
extract field define in the current renderer- Parameters:
ctx
-- Returns:
- a list of fields name, null if no renderer found
- Throws:
IOException
-
getTextForSearch
String getTextForSearch(ContentContext ctx)
return a text represent the content of the component. sample all the content :-)- Returns:
- a text represent the content of the component for the search module
-
getSearchLevel
int getSearchLevel()
return the level of the component is a search.- Returns:
- 1-LOW 2-MIDDLE 3-HIGH
-
getStyleTitle
String getStyleTitle(ContentContext ctx)
return the title of the style choice.
-
getStyleList
String[] getStyleList(ContentContext ctx)
get the list of style possible for this component.- Returns:
- a list of string represent a style.
-
getStyleLabelList
String[] getStyleLabelList(ContentContext ctx)
return a list of label define the style.- Returns:
- a list of label.
-
getMarkerList
List<SuffixPrefix> getMarkerList(ContentContext ctx)
return the title of the style choice.
-
getComponentCssClass
String getComponentCssClass(ContentContext ctx)
get the current style of the component.- Returns:
- the current style.
-
getStyleLabel
String getStyleLabel(ContentContext ctx)
get the label of the current style- Parameters:
ctx
-- Returns:
-
setStyle
void setStyle(ContentContext ctx, String inStyle)
set the current style of the component.- Parameters:
inStyle
- new style
-
setRenderer
void setRenderer(ContentContext ctx, String renderer)
set the current renderer for the component view.- Parameters:
a
- key to a renderer (defined in config file of the component)
-
getRenderer
String getRenderer(ContentContext ctx)
get the current renderer for the component view.- Parameters:
a
- key to a renderer (defined in config file of the component)
-
getCurrentRenderer
String getCurrentRenderer(ContentContext ctx)
return the name of the renderer.- Parameters:
ctx
-- Returns:
-
getPrefixViewXHTMLCode
String getPrefixViewXHTMLCode(ContentContext ctx)
code for prefix the view XHTML code.- Returns:
- XHTML code.
-
getInputNameRenderer
String getInputNameRenderer()
get the input name of the renderer.- Returns:
-
getSuffixViewXHTMLCode
String getSuffixViewXHTMLCode(ContentContext ctx)
code for sufix the view XHTML code.- Returns:
- XHTML code.
-
getContentName
String getContentName()
return the name if the content field (textarea...)- Returns:
-
isInline
boolean isInline()
check if the component can be inserd inline.- Returns:
- true if component is a inline component. (text, link, image)...
-
next
IContentVisualComponent next()
get the next component on the page. if null this is the last component.- Returns:
- a component.
-
previous
IContentVisualComponent previous()
get the next component on the page. if null this is the last component.- Returns:
- a component.
-
setNextComponent
void setNextComponent(IContentVisualComponent nextComponent)
change the previous component- Parameters:
nextComponent
-
-
setPreviousComponent
void setPreviousComponent(IContentVisualComponent nextComponent)
change the previous component- Parameters:
nextComponent
-
-
getFirstPrefix
String getFirstPrefix(ContentContext ctx)
get the prefix must be insered before a list of the current component (warning: one element is a list) #return XHTML code of prefix
-
getLastSufix
String getLastSufix(ContentContext ctx)
get the sufix before must be insered after a list of the current component.- Returns:
- XHTML code of sufix.
-
getHexColor
String getHexColor()
get the exadecimal color for representation of the component.- Returns:
- a exadecimal color (sample : a5b499)
-
getMessage
GenericMessage getMessage()
get a message for the component.- Returns:
- a generic message (error, info, warning, help), null if no message.
-
isInsertable
boolean isInsertable()
you can insert a text in this component- Returns:
- true if a text is insertable
-
isListable
boolean isListable()
you display the composant as a list (if you want)- Returns:
- true if a text is listable
-
insert
void insert(String text)
insert a text in the component- Parameters:
text
- the text to be insered
-
isList
boolean isList(ContentContext ctx)
true if the component is in a list- Returns:
- true if component is in a list
-
setList
void setList(boolean inList)
put the component is a list- Parameters:
inList
- true for put in a list, false for remove from a list
-
isNeedRefresh
boolean isNeedRefresh()
return true if the modifition of the component need a refresh of the edit page (ajax).
-
isVisible
boolean isVisible()
-
isRepeatable
boolean isRepeatable()
-
setValid
void setValid(boolean inVisible)
-
getArea
String getArea()
get the area where the component must be rendered- Returns:
- a area name
-
getHelpURL
String getHelpURL(ContentContext ctx)
a url to descripe the usage of the component- Parameters:
lang
- the langage of the edit interface- Returns:
- url to a help page or null if no help page defined
-
getHelpText
String getHelpText(ContentContext ctx) throws IOException
- Throws:
IOException
-
isHelpURL
boolean isHelpURL(ContentContext ctx)
-
setNeedRefresh
void setNeedRefresh(boolean needRefresh)
if you set true the page is refresh after update- Parameters:
needRefresh
-
-
resetViewData
void resetViewData(ContentContext ctx) throws IOException
reset the view data.- Throws:
IOException
-
replaceInContent
void replaceInContent(String source, String target)
replace a content in visual element- Parameters:
source
- the source element (sample. : test)target
- the target element (sample. : -- test --)
-
replaceAllInContent
void replaceAllInContent(Map<String,String> replacement)
add a list of remplacement key, value- Parameters:
replacement
-
-
clearReplacement
void clearReplacement()
clear remplacement values
-
getComplexityLevel
int getComplexityLevel(ContentContext ctx)
return the complexity level of the component.- Parameters:
ctx
- TODO- Returns:
- see contant
-
isHidden
boolean isHidden(ContentContext ctx)
true if component marked as hidden (in components.txt the class name start with '.')- Returns:
-
getPage
MenuElement getPage()
get the page contains the component- Returns:
- a page of the navigation
-
delete
void delete(ContentContext ctx)
this method is called when component is deleted.
-
getNextComponent
IContentVisualComponent getNextComponent()
return the next component in the page sequence.- Returns:
-
getPreviousComponent
IContentVisualComponent getPreviousComponent()
return the previous component in the page sequence.- Returns:
-
isFirstRepeated
boolean isFirstRepeated()
return true if component is in the first repeat sequence of the page.- Returns:
-
getExternalResources
Collection<String> getExternalResources(ContentContext ctx)
return the external resources needed from component as css, javascript...- Returns:
- a list of URI to external resources
-
getHeaderContent
String getHeaderContent(ContentContext ctx)
return the part of header needed for this component- Returns:
-
isContentCachable
boolean isContentCachable(ContentContext ctx)
return the part of header needed for this component- Returns:
-
loadViewData
void loadViewData(ContentContext ctx) throws IOException
load special data file.- Parameters:
ctx
-- Throws:
IOException
-
getI18nEditableKeys
List<String> getI18nEditableKeys(ContentContext ctx)
get i18n keys for edition- Parameters:
ctx
-- Returns:
- a list of i18n keys.
-
getKey
String getKey()
get a unic key of the component. User special for DynamicComponent.
-
getWordCount
int getWordCount(ContentContext ctx)
count the word in the content.- Returns:
-
isMetaTitle
boolean isMetaTitle()
return true is this component is a title of a group of component.- Returns:
-
getClassName
String getClassName()
return the name of the class (use for JSTL)- Returns:
-
getVersion
String getVersion()
return the version of the component : A.B.C A : major version, no compatibility with the older data B : new function but compatibilty with older data C : bug correction- Returns:
- ? if version undefined.
-
getAuthors
String getAuthors()
authors of the component- Returns:
-
initContent
boolean initContent(ContentContext ctx) throws Exception
init the content with a default value. sample : "lorem ipsum" for text component.- Parameters:
ctx
-- Returns:
- true if content is create.
- Throws:
Exception
-
getCreationDate
Date getCreationDate()
-
getModificationDate
Date getModificationDate()
-
setPage
void setPage(MenuElement inPage)
-
getSpecialTagTitle
String getSpecialTagTitle(ContentContext ctx) throws Exception
- Throws:
Exception
-
getSpecialTagXHTML
String getSpecialTagXHTML(ContentContext ctx) throws Exception
- Throws:
Exception
-
getLayout
ComponentLayout getLayout()
get a simple layout for the component.- Returns:
-
equals
boolean equals(ContentContext ctx, IContentVisualComponent comp)
check of component is considered as the same than an other.- Parameters:
ctx
-comp
-- Returns:
-
getPageDescription
String getPageDescription(ContentContext ctx)
return the description of the page if this component is or contains description.- Returns:
-
getListGroup
String getListGroup()
return the name of group component.- Returns:
-
getContentMessage
GenericMessage getContentMessage(ContentContext ctx)
warning message on content tab- Parameters:
ctx
-- Returns:
-
getTextMessage
GenericMessage getTextMessage(ContentContext ctx)
warning message on text tab- Parameters:
ctx
-- Returns:
-
getConfigMessage
GenericMessage getConfigMessage(ContentContext ctx)
warning message on config tab- Parameters:
ctx
-- Returns:
-
markAsNew
void markAsNew(ContentContext ctx)
mark component as new in the current request- Parameters:
ctx
-
-
isNew
boolean isNew(ContentContext ctx)
check if this component has maked has new in the current request- Parameters:
ctx
-- Returns:
-
isEditOnCreate
boolean isEditOnCreate(ContentContext ctx)
return true if the component is directly edited when it is insered.- Parameters:
ctx
-- Returns:
-
isNolink
boolean isNolink()
-
isMirroredByDefault
boolean isMirroredByDefault(ContentContext ctx)
if this component is duplicated, by default it is mirrored.- Returns:
-
setContainerPage
void setContainerPage(ContentContext ctx, MenuElement page)
set the page of a container (page mirror, component mirror).- Parameters:
ctx
-page
-
-
getContentAsText
String getContentAsText(ContentContext ctx)
get the text of the component- Returns:
-
isHiddenInMode
boolean isHiddenInMode(ContentContext ctx, int mode, Boolean mobile)
component can be hidded in some mode, like view or preview.- Parameters:
mode
- current mode (view, preview, edit...)mobile
- render in mobil mode- Returns:
-
setDisplayHidden
void setDisplayHidden(boolean hidden)
hide component in display mode- Parameters:
hidden
-
-
isDisplayHidden
boolean isDisplayHidden()
is component displayed for visitor- Returns:
-
getErrorMessage
String getErrorMessage(ContentContext ctx)
return error message on structure of the component.- Returns:
- null if no errors found
-
isRestMatch
boolean isRestMatch(ContentContext ctx, Map<String,String> params)
-
getFontAwesome
@Deprecated String getFontAwesome()
Deprecated.
-
getIcon
String getIcon()
-
transflateFrom
boolean transflateFrom(ContentContext ctx, ITranslator translator, String lang)
translate the content of the component to the current language- Parameters:
ctx
- contextContext of the current renderingtranslator
- class to translatelang
- the language of the current content (source language)- Returns:
-
isColumnable
boolean isColumnable(ContentContext ctx)
contributor can select size of column to wrap component- Parameters:
ctx
-- Returns:
- 0:auto -1:undefined
-
getColumnSize
int getColumnSize(ContentContext ctx)
get the size of the column, the column contains the component- Returns:
-
setColumnSize
void setColumnSize(int size)
set the size of the column, the column contains the component
-
getGroup
String getGroup()
get the group of the component (meta, text, links, media,...)- Returns:
-
setGroup
void setGroup(String grp)
-
getConfigInValue
String getConfigInValue(String key, String defaultValue)
transform the value of the component in a config properties file. If key not found a entry is created in the content.- Parameters:
key
- the key of the config fielddefaultValue
- the default value of the config field, this value is inserd in the config data if key not found.- Returns:
- the value of the config field, defaultValue if key not found.
-
forceInit
void forceInit(ComponentBean bean, ContentContext ctx) throws Exception
force a init.- Parameters:
bean
-ctx
-- Throws:
Exception
-
getReferenceComponent
IContentVisualComponent getReferenceComponent(ContentContext ctx) throws Exception
reference to the same component in default language- Throws:
Exception
-
getColumnStyle
String getColumnStyle(ContentContext ctx)
-
cleanResources
boolean cleanResources(ContentContext ctx)
clean resources. By default remove import folder- Returns:
-
getExternalModules
Collection<String> getExternalModules(ContentContext ctx)
-
-