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 StringCOLORED_WRAPPER_CLASSstatic StringCOMP_ID_REQUEST_PARAMstatic intCOMPLEXITY_ADMINstatic intCOMPLEXITY_EASYstatic intCOMPLEXITY_STANDARDstatic StringCONTAINER_COLORstatic StringDEFAULT_COLORstatic StringDYN_COMP_COLORstatic StringECOM_COLORstatic StringEDIT_ACTION_CSS_CLASSstatic StringGRAPHIC_COLORstatic intHIGH_LABEL_LEVELstatic StringID_SEPARATORstatic StringLINK_COLORstatic intLOW_LABEL_LEVELstatic StringMETA_COLORstatic intMIDDLE_LABEL_LEVELstatic intSEARCH_LEVEL_HIGHstatic intSEARCH_LEVEL_LOWstatic intSEARCH_LEVEL_MIDDLEstatic intSEARCH_LEVEL_NONEstatic StringTEXT_COLORstatic StringVIEW_DEFINITION_REQUEST_IDstatic StringWEB2_COLOR
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleancleanResources(ContentContext ctx)clean resources.voidclearReplacement()clear remplacement valuesvoiddelete(ContentContext ctx)this method is called when component is deleted.booleanequals(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 renderervoidforceInit(ComponentBean bean, ContentContext ctx)force a init.StringgetArea()get the area where the component must be renderedStringgetAuthors()authors of the componentStringgetClassName()return the name of the class (use for JSTL)intgetColumnSize(ContentContext ctx)get the size of the column, the column contains the componentStringgetColumnStyle(ContentContext ctx)intgetComplexityLevel(ContentContext ctx)return the complexity level of the component.ComponentBeangetComponentBean()get the internal dataStringgetComponentCssClass(ContentContext ctx)get the current style of the component.StringgetComponentLabel(ContentContext ctx, String lg)return the label of the element.ComponentConfiggetConfig(ContentContext ctx)get the configuration of the component. from project or from template.StringgetConfigInValue(String key, String defaultValue)transform the value of the component in a config properties file.GenericMessagegetConfigMessage(ContentContext ctx)warning message on config tabStringgetContentAsText(ContentContext ctx)get the text of the componentGenericMessagegetContentMessage(ContentContext ctx)warning message on content tabStringgetContentName()return the name if the content field (textarea...)DategetCreationDate()StringgetCurrentRenderer(ContentContext ctx)return the name of the renderer.StringgetDescription(Locale local)a description of the component;StringgetEditText(ContentContext ctx, String key)get a internationalized text, in the languague of the edition.StringgetEmptyXHTMLCode(ContentContext ctx)return the code if component contain's no data.StringgetErrorMessage(String fieldName)return a error message in current view languageStringgetErrorMessage(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...StringgetFirstPrefix(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 prefixStringgetFontAwesome()Deprecated.StringgetGroup()get the group of the component (meta, text, links, media,...)StringgetHeaderContent(ContentContext ctx)return the part of header needed for this componentStringgetHelpText(ContentContext ctx)StringgetHelpURL(ContentContext ctx)a url to descripe the usage of the componentStringgetHexColor()get the exadecimal color for representation of the component.List<String>getI18nEditableKeys(ContentContext ctx)get i18n keys for editionStringgetIcon()StringgetId()return a unique id for the coponentStringgetInputNameRenderer()get the input name of the renderer.StringgetJSOnSubmit()return the java script code called when global form is submited.StringgetKey()get a unic key of the component.intgetLabelLevel(ContentContext ctx)define the level of label.StringgetLastSufix(ContentContext ctx)get the sufix before must be insered after a list of the current component.ComponentLayoutgetLayout()get a simple layout for the component.StringgetListGroup()return the name of group component.List<SuffixPrefix>getMarkerList(ContentContext ctx)return the title of the style choice.GenericMessagegetMessage()get a message for the component.DategetModificationDate()IContentVisualComponentgetNextComponent()return the next component in the page sequence.MenuElementgetPage()get the page contains the componentStringgetPageDescription(ContentContext ctx)return the description of the page if this component is or contains description.StringgetPrefixViewXHTMLCode(ContentContext ctx)code for prefix the view XHTML code.IContentVisualComponentgetPreviousComponent()return the previous component in the page sequence.IContentVisualComponentgetReferenceComponent(ContentContext ctx)reference to the same component in default languageStringgetRenderer(ContentContext ctx)get the current renderer for the component view.intgetSearchLevel()return the level of the component is a search.StringgetSpecialTagTitle(ContentContext ctx)StringgetSpecialTagXHTML(ContentContext ctx)StringgetStyle()get the style of the display (sp. image-left, image-right)StringgetStyleLabel(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.StringgetStyleTitle(ContentContext ctx)return the title of the style choice.StringgetSuffixViewXHTMLCode(ContentContext ctx)code for sufix the view XHTML code.StringgetTextForSearch(ContentContext ctx)return a text represent the content of the component. sample all the content :-)StringgetTextLabel(ContentContext ctx)return a string representation of the componentGenericMessagegetTextMessage(ContentContext ctx)warning message on text tabStringgetTextTitle(ContentContext ctx)return a string representation of the component with complete titleintgetTitleLevel(ContentContext ctx)get the level of the title (1,2,3...). return 0 if the component is not a titleStringgetType()return the type of the element.StringgetValue(ContentContext ctx)get the value of the content without any rendering.StringgetVersion()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 correctionStringgetViewText(ContentContext ctx, String key)get a internationalized text, in the languague of the view.intgetWordCount(ContentContext ctx)count the word in the content.StringgetXHTMLCode(ContentContext ctx)the code for view the element in XHTML environment.StringgetXHTMLConfig(ContentContext ctx)xhtml code for config the componentbooleaninitContent(ContentContext ctx)init the content with a default value. sample : "lorem ipsum" for text component.voidinsert(String text)insert a text in the componentbooleanisColumnable(ContentContext ctx)contributor can select size of column to wrap componentbooleanisConfig(ContentContext ctx)return true if there the component is configurable.booleanisContentCachable(ContentContext ctx)return the part of header needed for this componentbooleanisDefaultValue(ContentContext ctx)return true if value is never modified.booleanisDispayEmptyXHTMLCode(ContentContext ctx)display empty xhtml code if emptybooleanisDisplayable(ContentContext ctx)true if the component can be displayed in preview modebooleanisDisplayHidden()is component displayed for visitorbooleanisEditOnCreate(ContentContext ctx)return true if the component is directly edited when it is insered.booleanisFirstRepeated()return true if component is in the first repeat sequence of the page.booleanisHelpURL(ContentContext ctx)booleanisHidden(ContentContext ctx)true if component marked as hidden (in components.txt the class name start with '.')booleanisHiddenInMode(ContentContext ctx, int mode, Boolean mobile)component can be hidded in some mode, like view or preview.booleanisInline()check if the component can be inserd inline.booleanisInsertable()you can insert a text in this componentbooleanisList(ContentContext ctx)true if the component is in a listbooleanisListable()you display the composant as a list (if you want)booleanisMetaTitle()return true is this component is a title of a group of component.booleanisMirroredByDefault(ContentContext ctx)if this component is duplicated, by default it is mirrored.booleanisModify()booleanisNeedRefresh()return true if the modifition of the component need a refresh of the edit page (ajax).booleanisNew(ContentContext ctx)check if this component has maked has new in the current requestbooleanisNolink()booleanisRealContent(ContentContext ctx)return true if component is considered as realContent and the page that contain the component is also considered as real content.booleanisRepeat()booleanisRepeatable()booleanisRestMatch(ContentContext ctx, Map<String,String> params)booleanisUnique()return true if the component must be unique on a pagebooleanisVisible()booleanisVisible(ContentContext ctx)check if this element is visible in the format.booleanisVisibleFromCookies(ContentContext ctx)visible or no, depend of the choice of visitor with cookiesvoidloadViewData(ContentContext ctx)load special data file.voidmarkAsNew(ContentContext ctx)mark component as new in the current requestIContentVisualComponentnewInstance(ComponentBean bean, ContentContext newCtx, MenuElement page)init the component, do that before all using.IContentVisualComponentnext()get the next component on the page. if null this is the last component.StringperformConfig(ContentContext ctx)action to manage the config, call when global content form is saved.StringperformEdit(ContentContext ctx)action call when update the content page.voidprepareView(ContentContext ctx)this method is called before rendering the component.IContentVisualComponentprevious()get the next component on the page. if null this is the last component.voidreplaceAllInContent(Map<String,String> replacement)add a list of remplacement key, valuevoidreplaceInContent(String source, String target)replace a content in visual elementvoidresetViewData(ContentContext ctx)reset the view data.voidsetColumnSize(int size)set the size of the column, the column contains the componentvoidsetContainerPage(ContentContext ctx, MenuElement page)set the page of a container (page mirror, component mirror).voidsetDisplayHidden(boolean hidden)hide component in display modevoidsetGroup(String grp)voidsetList(boolean inList)put the component is a listvoidsetNeedRefresh(boolean needRefresh)if you set true the page is refresh after updatevoidsetNextComponent(IContentVisualComponent nextComponent)change the previous componentvoidsetPage(MenuElement inPage)voidsetPreviousComponent(IContentVisualComponent nextComponent)change the previous componentvoidsetRenderer(ContentContext ctx, String renderer)set the current renderer for the component view.voidsetRepeat(boolean newRepeat)voidsetStyle(ContentContext ctx, String inStyle)set the current style of the component.voidsetValid(boolean inVisible)voidsetValue(String inContent)set the content without renderingvoidstored()call this method when the component is stored.booleantransflateFrom(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)
-
-