Package org.javlo.component.core
Class AbstractVisualComponent
- java.lang.Object
-
- org.javlo.component.core.AbstractVisualComponent
-
- All Implemented Interfaces:
Comparable<IContentVisualComponent>,IContentVisualComponent,IRestItem
- Direct Known Subclasses:
AbstractFileComponent,AbstractOrderComponent,AbstractPropertiesComponent,AbstractRowComponent,AgendaImport,AnchorComponent,ArrayDisplayComponent,AutoNumberComponent,BeanEditionComponent,Box,Breadcrumb,Category,ChangeLanguageMenu,ChildrenLink,CloseCol,CloudTag,Code,ColorComponent,ComplexPropertiesLink,Contact,ContactText,ContentSeparation,CountAccess,CreateContext,DataList,DateComponent,Description,DisplayComponent,DisplayUserInfo,DynamicComponent,DynamicComponentBasket,DynamicComponentCreator,DynamicComponentFactory,EpubConverterComponent,FacebookChooseFriend,FAQComponent,FollowComponent,Font,ForceRealContent,FormComponent,FormMailingComponent,Forward,FreeTextList,Gallery,GenericFileList,GenericForm,GraphicCharter,GroupTitle,HeadMeta,I18nComponent,IMComponent,IubendaRemoteImport,Keywords,LanguageMirrorComponent,LaunchMacro,Layouts,LinkLabel,List,LocationComponent,LoginLogoutLink,Map,MapComponent,MenuTitle,MessageContainer,MetaDescription,MetaTitle,MirrorComponent,MirrorLinkImportation,MoneybookersPayement,MonthChildrenLink,MultimediaFilter,NotSearchPage,OpenCol,PageBreak,PageCss,PageMirrorComponent,PageRank,PageTitle,PageURL,PageWeight,Paragraph,PDFLayoutComponent,PDFLink,QuizzParty,RendererReferenceComponent,RepeatContainer,SearchResultComponent,SectionLinks,ShowTemplateComponent,SimplePoll,SiteMap,Slogan,SmartExternalLinkImportation,SmartGenericForm,Space,SubTitle,SubtitleLink,Survey,TaxonomyDisplayComponent,TestComponent,Text,Title,ToTheTopComponent,TwitterReader,Unknown,UploadFileComponent,UserInfoLink,UserSearch,WebSiteTitle,WeekChildrenLink,WysiwygParagraph,XHTML
public abstract class AbstractVisualComponent extends Object implements IContentVisualComponent
This class is the first class for component.exposed variables :
Stringcompid : the id of the components. SeegetId()StringcompPage : a page bean of the page contain's the component.Stringvalue : the raw value of the component. SeegetValue()Stringtype : the component type. SeeIContentVisualComponent.getType()Stringlayout : the layout of the component is css (can be null).StringcomponentWidth : the width of component forced by contributor (if component manage it)Stringstyle : the style selected for the component. SeeStringpreviewAttributes : a string with attribute for preview edition (class and data attribute).getComponentCssClass(ContentContext)
- Author:
- Patrick Vandermaesen
-
-
Field Summary
Fields Modifier and Type Field Description static StringCACHE_KEY_SUFFIX_PARAM_NAMEstatic StringCOMPONENT_KEYprotected ComponentConfigconfigprotected static StringEDIT_CLASSstatic intFLUID_COL_SIZEstatic StringFORCE_COMPONENT_IDstatic StringHIDDENstatic StringI18N_FILEstatic Loggerloggerstatic intMAX_COL_VALUEstatic StringMOBILE_TYPEstatic StringNOT_EDIT_PREVIEW_PARAM_NAMEstatic StringSCROLL_TO_COMP_ID_ATTRIBUTE_NAMEstatic StringTIME_CACHE_NAMEprotected static StringVALUE_SEPARATOR-
Fields inherited from interface org.javlo.component.core.IContentVisualComponent
COLORED_WRAPPER_CLASS, COMP_ID_REQUEST_PARAM, COMPLEXITY_ADMIN, COMPLEXITY_EASY, COMPLEXITY_STANDARD, CONTAINER_COLOR, DEFAULT_COLOR, DYN_COMP_COLOR, ECOM_COLOR, EDIT_ACTION_CSS_CLASS, GRAPHIC_COLOR, HIGH_LABEL_LEVEL, ID_SEPARATOR, LINK_COLOR, LOW_LABEL_LEVEL, META_COLOR, MIDDLE_LABEL_LEVEL, SEARCH_LEVEL_HIGH, SEARCH_LEVEL_LOW, SEARCH_LEVEL_MIDDLE, SEARCH_LEVEL_NONE, TEXT_COLOR, VIEW_DEFINITION_REQUEST_ID, WEB2_COLOR
-
-
Constructor Summary
Constructors Constructor Description AbstractVisualComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected StringapplyReplacement(String content)booleancleanResources(ContentContext ctx)clean resources.protected StringcleanValue(ContentContext ctx, String value)voidclearReplacement()clear remplacement valuesprotected Objectclone()intcompareTo(IContentVisualComponent comp)protected StringcontructViewStyle(ContentContext ctx)protected intcountLine()voiddelete(ContentContext ctx)this method is called when component is deleted.protected voiddeleteMySelf(ContentContext ctx)protected StringdrawColumn(ContentContext ctx, int size)booleanequals(Object obj)booleanequals(ContentContext ctx, IContentVisualComponent comp)check of component is considered as the same than an other.protected StringexecuteCurrentRenderer(ContentContext ctx)protected StringexecuteJSP(ContentContext ctx, String jsp)protected StringexecuteRenderer(ContentContext ctx)protected StringexecuteRenderer(ContentContext ctx, String url, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)List<String>extractFieldsFromRenderer(ContentContext ctx)extract field define in the current renderervoidforceInit(ComponentBean bean, ContentContext ctx)force a init.StringgetAjaxId()StringgetArea()get the area where the component must be renderedStringgetAuthors()authors of the componentStringgetBackgroundColor()protected StringgetBaseHelpURL(ContentContext ctx)StringgetClassName()return the name of the class (use for JSTL)protected StringgetColomnablePrefix(ContentContext ctx)protected StringgetColomnableSuffix(ContentContext ctx)protected StringgetColumn(ContentContext ctx)protected booleangetColumnableDefaultValue()protected IntegergetColumnMaxSize(ContentContext ctx)intgetColumnSize(ContentContext ctx)get the size of the column, the column contains the componentprotected List<Integer>getColumnSizes(ContentContext ctx)StringgetColumnStyle(ContentContext ctx)intgetComplexityLevel(ContentContext ctx)return the complexity level of the component.ComponentBeangetComponentBean()get the internal dataprotected StringgetComponentCSS(javax.servlet.ServletContext application, String css)StringgetComponentCssClass(ContentContext ctx)get the current style of the component.static StringgetComponentId(javax.servlet.http.HttpServletRequest request)StringgetComponentLabel(ContentContext ctx, String lg)return the label of the element.protected StringgetComponentPath()the the localisation of the JSP files in the "component" directory in webapps. normaly this localisation is the name of the component direcoty in the src.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 tabMenuElementgetContainerPage(ContentContext ctx)get the page of the container if component is mirrored else get the page of the component.Map<String,Object>getContentAsMap(ContentContext ctx)StringgetContentAsText(ContentContext ctx)get the text of the componentStringgetContentCache(ContentContext ctx)GenericMessagegetContentMessage(ContentContext ctx)warning message on content tabStringgetContentName()get the XHTML input field name for the contentStringgetContentTimeCache(ContentContext ctx)intgetCookiesDisplayStatus()DategetCreationDate()protected StringgetCSSStyle(ContentContext ctx)MenuElementgetCurrentPage(ContentContext ctx, boolean componentPage)get the current pageStringgetCurrentRenderer(ContentContext ctx)get current renderer keyprotected StringgetDataAttributes(ContentContext ctx)StringgetDebugHeader(ContentContext ctx)protected StringgetDefaultHelpURI(ContentContext ctx)StringgetDefaultRenderer(ContentContext ctx)protected DategetDeleteDate(ContentContext ctx)StringgetDescription(Locale local)a description of the component;protected StringgetDisplayAsInputName()StringgetDisplayMessage()protected StringgetEditorComplexity(ContentContext ctx)return the wysiwyg editor complexityStringgetEditRenderer(ContentContext ctx)StringgetEditText(ContentContext ctx, String key)get a internationalized text, in the languague of the edition.protected StringgetEditXHTMLCode(ContentContext ctx)protected StringgetEmptyCode(ContentContext ctx)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...StringgetFileDirectory(ContentContext ctx)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()protected StringgetForcedId(ContentContext ctx)protected StringgetForcedPrefixViewXHTMLCode(ContentContext ctx)protected StringgetForcedRenderer(ContentContext ctx)protected StringgetForcedSuffixViewXHTMLCode(ContentContext ctx)StringgetFormName()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)protected StringgetHelpType()protected StringgetHelpURI(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 coponentStringgetImportFolderPath(ContentContext ctx)static StringgetImportFolderPath(ContentContext ctx, MenuElement page)protected StringgetInlineStyle(ContentContext ctx)protected StringgetInputName(String field)protected StringgetInputNameColomn()protected StringgetInputNameColomnStyle()StringgetInputNameRenderer()get the input name of the renderer.StringgetInputNameRendererTitle()List<SuffixPrefix>getItalicAndStrongLanguageMarkerList(ContentContext ctx)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.protected StringgetListClass(ContentContext ctx)StringgetListGroup()return the name of group component.protected StringgetListItemTag(ContentContext ctx)protected StringgetListTag(ContentContext ctx)GenericMessagegetLocalMessage()protected ObjectgetLock(ContentContext ctx)protected StringgetManualCssClass()List<SuffixPrefix>getMarkerList(ContentContext ctx)return the title of the style choice.GenericMessagegetMessage()get a message for the component.static MirrorComponentgetMirrorWrapper(ContentContext ctx, IContentVisualComponent comp)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.protected StringgetPrefixCssClass(ContentContext ctx, String currentClass)StringgetPrefixViewXHTMLCode(ContentContext ctx)code for prefix the view XHTML code.protected StringgetPreviewAttributes(ContentContext ctx)protected StringgetPreviewCssClass(ContentContext ctx, String currentClass)StringgetPreviewCssId(ContentContext ctx)IContentVisualComponentgetPreviousComponent()return the previous component in the page sequence.List<SuffixPrefix>getQuotationLanguageMarkerList(ContentContext ctx)IContentVisualComponentgetReferenceComponent(ContentContext ctx)search the equivalent component in the default language content.Map<String,String>getRemplacement()StringgetRenderer(ContentContext ctx)get current renderer file.protected StringgetRendererTitle()Map<String,String>getRenderes(ContentContext ctx)static IContentVisualComponentgetRequestComponent(javax.servlet.http.HttpServletRequest request)get a component in the request if there are.intgetSearchLevel()return the level of the component is a search.protected StringgetSelectRendererXHTML(ContentContext ctx, boolean justDisplay)protected StringgetSpecialInputTag()create technical input tag. sample : for know the type of component with only therequestStringgetSpecialPreviewCssId(ContentContext ctx)StringgetSpecialTagTitle(ContentContext ctx)StringgetSpecialTagXHTML(ContentContext ctx)StringgetSpecificClass(ContentContext ctx)override this method for add specific class to prefix.StringgetSpecificCssClass(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.protected StringgetTag(ContentContext ctx)StringgetTextColor()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 tabStringgetTextPosition()StringgetTextTitle(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 titleprotected StringgetTypeInputName()StringgetValue()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 correctionPropertiesgetViewData(ContentContext ctx)protected FilegetViewDataFile(ContentContext ctx)protected StringgetViewID(ContentContext ctx)StringgetViewText(ContentContext ctx, String key)get a internationalized text, in the languague of the view.StringgetViewXHTMLCode(ContentContext ctx)StringgetWidth()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 componentbooleanhaveRight(ContentContext ctx, String action)protected voidincludeComponentJSP(ContentContext ctx, String jsp)protected voidincludePage(ContentContext ctx, String jsp)protected voidinit()protected voidinit(ComponentBean bean, ContentContext ctx)booleaninitContent(ContentContext ctx)init the content with a default value. sample : "lorem ipsum" for text component.voidinsert(String text)insert a text in the componentbooleanisAjaxWrapper(ContentContext ctx)booleanisAskWidth(ContentContext ctx)protected booleanisAutoDeletable()protected booleanisAutoRenderer()return true if end user could not select the renderer.booleanisBackgroundColored()protected booleanisCanAddClass()protected booleanisCloseRow(ContentContext ctx)booleanisColored()booleanisColumnable(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 componentbooleanisContentCachableByQuery(ContentContext ctx)booleanisContentTimeCachable(ContentContext ctx)booleanisDefaultValue(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.protected booleanisFirstElementOfRepeatSequence(ContentContext ctx)booleanisFirstRepeated()return true if component is in the first repeat sequence of the page.protected booleanisFreeInputLayout()booleanisHelpURL(ContentContext ctx)protected booleanisHiddable()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.protected booleanisHiddenInModeValue(ContentContext ctx, int mode)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.static booleanisMirrorWrapped(ContentContext ctx, IContentVisualComponent comp)booleanisModify()protected booleanisNeedDelete(ContentContext ctx)booleanisNeedRefresh()return true if the modifition of the component need a refresh of the edit page (ajax).protected booleanisNeedRenderer()return true if this component need renderer from template.booleanisNew(ContentContext ctx)check if this component has maked has new in the current requestbooleanisNextSame()return true if the next component have the same type.booleanisNextSame(ContentContext ctx)booleanisNolink()booleanisNoLinkable()protected booleanisOpenRow(ContentContext ctx)booleanisPreviousSame()return true if the previous component have the same type.booleanisPreviousSame(ContentContext ctx)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)booleanisReversedLink(ContentContext ctx)protected booleanisStyleHidden(ContentContext ctx)booleanisUnique()return true if the component must be unique on a pagebooleanisValueProperties()if content of the component is a list of properties (key=value) this method must return true.protected booleanisValueTranslatable()protected booleanisViewDataFile(ContentContext ctx)booleanisVisible()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 cookiesprotected booleanisWrapped(ContentContext ctx)protected booleanisXML()voidloadViewData(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.protected voidonStyleChange(ContentContext ctx)protected voidperformColumnable(ContentContext ctx)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.voidperformUpdate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidprepareEdit(ContentContext ctx)voidprepareView(ContentContext ctx)prepare the rendering of a component. default attributes put in request : style, value, type, compidIContentVisualComponentprevious()get the next component on the page. if null this is the last component.protected StringprocessView(ContentContext ctx)prepare the rendering of the page.StringrenderOtherComponent(ContentContext ctx, IContentVisualComponent comp)protected StringrenderViewXHTMLCode(ContentContext ctx)voidreplaceAllInContent(Map<String,String> replacement)add a list of remplacement key, valuevoidreplaceInContent(String source, String target)replace a content in visual elementvoidresetContentCache(ContentContext ctx)voidresetViewData(ContentContext ctx)reset the view data.voidsetBackgroundColor(String bgcol)voidsetColumnSize(int size)set the size of the column, the column contains the componentvoidsetColumnStyle(String style)voidsetComponentBean(ComponentBean componentBean)voidsetContainerPage(ContentContext ctx, MenuElement page)set the page of a container (page mirror, component mirror).voidsetContentCache(ContentContext ctx, String contentCache)voidsetContentTimeCache(ContentContext ctx, String contentCache)voidsetDisplayHidden(boolean hidden)hide component in display modeprotected static voidsetForcedId(ContentContext ctx, String id)protected voidsetForcedRenderer(ContentContext ctx, String renderer)voidsetGroup(String group)voidsetHidden(boolean hidden)voidsetHiddenInMode(int mode, boolean hidden)voidsetList(boolean inList)put the component is a listvoidsetLocalMessage(GenericMessage localMessage)voidsetMessage(GenericMessage inMsg)static voidsetMirrorWrapped(ContentContext ctx, IContentVisualComponent comp, MirrorComponent mirror)voidsetModify()voidsetNeedRefresh(boolean needRefresh)if you set true the page is refresh after updatevoidsetNextComponent(IContentVisualComponent nextComponent)change the previous componentvoidsetNolink(boolean noLink)voidsetPage(MenuElement inPage)voidsetPreviousComponent(IContentVisualComponent previousComponent)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.voidsetTextColor(String textcol)voidsetTextPosition(String textPos)voidsetValid(boolean inVisible)voidsetValue(String inContent)set the content without renderingvoidsetWidth(String width)voidstored()call this method when the component is stored.voidstoreViewData(ContentContext ctx)ReaderstringToReader(String str)ReaderstringToReader(String str, String encoding)InputStreamstringToStream(String str)StringtextToXHTML(String text)Deprecated.use XHTMLHelper.textToXHTML(String text)StringtoString()booleantransflateFrom(ContentContext ctx, ITranslator translator, String lang)translate the content of the component to the current languageprotected voidupdateCache()-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.javlo.component.core.IContentVisualComponent
getType
-
-
-
-
Field Detail
-
SCROLL_TO_COMP_ID_ATTRIBUTE_NAME
public static final String SCROLL_TO_COMP_ID_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
NOT_EDIT_PREVIEW_PARAM_NAME
public static final String NOT_EDIT_PREVIEW_PARAM_NAME
- See Also:
- Constant Field Values
-
CACHE_KEY_SUFFIX_PARAM_NAME
public static final String CACHE_KEY_SUFFIX_PARAM_NAME
- See Also:
- Constant Field Values
-
EDIT_CLASS
protected static final String EDIT_CLASS
- See Also:
- Constant Field Values
-
logger
public static Logger logger
-
COMPONENT_KEY
public static final String COMPONENT_KEY
- See Also:
- Constant Field Values
-
I18N_FILE
public static final String I18N_FILE
- See Also:
- Constant Field Values
-
TIME_CACHE_NAME
public static final String TIME_CACHE_NAME
- See Also:
- Constant Field Values
-
VALUE_SEPARATOR
protected static final String VALUE_SEPARATOR
- See Also:
- Constant Field Values
-
HIDDEN
public static final String HIDDEN
- See Also:
- Constant Field Values
-
MOBILE_TYPE
public static final String MOBILE_TYPE
- See Also:
- Constant Field Values
-
MAX_COL_VALUE
public static final int MAX_COL_VALUE
- See Also:
- Constant Field Values
-
FLUID_COL_SIZE
public static final int FLUID_COL_SIZE
- See Also:
- Constant Field Values
-
FORCE_COMPONENT_ID
public static final String FORCE_COMPONENT_ID
- See Also:
- Constant Field Values
-
config
protected ComponentConfig config
-
-
Method Detail
-
getGroup
public String getGroup()
Description copied from interface:IContentVisualComponentget the group of the component (meta, text, links, media,...)- Specified by:
getGroupin interfaceIContentVisualComponent- Returns:
-
setGroup
public void setGroup(String group)
- Specified by:
setGroupin interfaceIContentVisualComponent
-
getComponentId
public static final String getComponentId(javax.servlet.http.HttpServletRequest request)
-
getRequestComponent
public static final IContentVisualComponent getRequestComponent(javax.servlet.http.HttpServletRequest request)
get a component in the request if there are.- Parameters:
request- the HTTP request- Returns:
- a IContentVisualComponent, null if there are no composant in the request
-
deleteMySelf
protected void deleteMySelf(ContentContext ctx) throws Exception
- Throws:
Exception
-
clearReplacement
public void clearReplacement()
Description copied from interface:IContentVisualComponentclear remplacement values- Specified by:
clearReplacementin interfaceIContentVisualComponent
-
clone
protected Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException- See Also:
Object.clone()
-
countLine
protected int countLine()
-
delete
public void delete(ContentContext ctx)
Description copied from interface:IContentVisualComponentthis method is called when component is deleted.- Specified by:
deletein interfaceIContentVisualComponent
-
getFileDirectory
public String getFileDirectory(ContentContext ctx)
-
cleanResources
public boolean cleanResources(ContentContext ctx)
Description copied from interface:IContentVisualComponentclean resources. By default remove import folder- Specified by:
cleanResourcesin interfaceIContentVisualComponent- Returns:
-
executeJSP
protected String executeJSP(ContentContext ctx, String jsp) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletExceptionIOException
-
executeRenderer
protected String executeRenderer(ContentContext ctx) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletExceptionIOException
-
getArea
public String getArea()
Description copied from interface:IContentVisualComponentget the area where the component must be rendered- Specified by:
getAreain interfaceIContentVisualComponent- Returns:
- a area name
-
getBaseHelpURL
protected String getBaseHelpURL(ContentContext ctx)
-
getReferenceComponent
public IContentVisualComponent getReferenceComponent(ContentContext ctx) throws Exception
search the equivalent component in the default language content.- Specified by:
getReferenceComponentin interfaceIContentVisualComponent- Throws:
Exception
-
isHelpURL
public boolean isHelpURL(ContentContext ctx)
- Specified by:
isHelpURLin interfaceIContentVisualComponent
-
getComplexityLevel
public int getComplexityLevel(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn the complexity level of the component.- Specified by:
getComplexityLevelin interfaceIContentVisualComponent- Parameters:
ctx- TODO- Returns:
- see contant
-
getComponentBean
public ComponentBean getComponentBean()
Description copied from interface:IContentVisualComponentget the internal data- Specified by:
getComponentBeanin interfaceIContentVisualComponent- Returns:
-
getComponentCSS
protected String getComponentCSS(javax.servlet.ServletContext application, String css) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletExceptionIOException
-
getComponentLabel
public String getComponentLabel(ContentContext ctx, String lg)
Description copied from interface:IContentVisualComponentreturn the label of the element.- Specified by:
getComponentLabelin interfaceIContentVisualComponentlg- language of the label- Returns:
- the label of the element.
-
getComponentPath
protected String getComponentPath()
the the localisation of the JSP files in the "component" directory in webapps. normaly this localisation is the name of the component direcoty in the src.- Returns:
- a part of a path
-
getConfig
public ComponentConfig getConfig(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the configuration of the component. from project or from template.- Specified by:
getConfigin interfaceIContentVisualComponent- Returns:
-
getContentTimeCache
public String getContentTimeCache(ContentContext ctx)
-
getContentName
public String getContentName()
get the XHTML input field name for the content- Specified by:
getContentNamein interfaceIContentVisualComponent- Returns:
- a XHTML input field name.
-
getContentCache
public String getContentCache(ContentContext ctx)
-
getCurrentPage
public MenuElement getCurrentPage(ContentContext ctx, boolean componentPage) throws Exception
get the current page- Parameters:
componentPage- if true return the page of the component, if false return the current page (in case of repeat component)- Returns:
- a page.
- Throws:
Exception
-
getForcedRenderer
protected String getForcedRenderer(ContentContext ctx)
-
setForcedRenderer
protected void setForcedRenderer(ContentContext ctx, String renderer)
-
getCurrentRenderer
public String getCurrentRenderer(ContentContext ctx)
get current renderer key- Specified by:
getCurrentRendererin interfaceIContentVisualComponent- Returns:
-
extractFieldsFromRenderer
public List<String> extractFieldsFromRenderer(ContentContext ctx) throws IOException
Description copied from interface:IContentVisualComponentextract field define in the current renderer- Specified by:
extractFieldsFromRendererin interfaceIContentVisualComponent- Returns:
- a list of fields name, null if no renderer found
- Throws:
IOException
-
getDebugHeader
public String getDebugHeader(ContentContext ctx)
-
getEditorComplexity
protected String getEditorComplexity(ContentContext ctx)
return the wysiwyg editor complexity- Returns:
- null if no wysywig editor
-
isColumnable
public final boolean isColumnable(ContentContext ctx)
Description copied from interface:IContentVisualComponentcontributor can select size of column to wrap component- Specified by:
isColumnablein interfaceIContentVisualComponent- Returns:
- 0:auto -1:undefined
-
getColumnableDefaultValue
protected boolean getColumnableDefaultValue()
-
getColumnSize
public int getColumnSize(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the size of the column, the column contains the component- Specified by:
getColumnSizein interfaceIContentVisualComponent- Returns:
-
getColumnStyle
public String getColumnStyle(ContentContext ctx)
- Specified by:
getColumnStylein interfaceIContentVisualComponent
-
setColumnSize
public void setColumnSize(int size)
Description copied from interface:IContentVisualComponentset the size of the column, the column contains the component- Specified by:
setColumnSizein interfaceIContentVisualComponent
-
setColumnStyle
public void setColumnStyle(String style)
-
getInputNameColomn
protected String getInputNameColomn()
-
getInputNameColomnStyle
protected String getInputNameColomnStyle()
-
drawColumn
protected String drawColumn(ContentContext ctx, int size)
-
getColumn
protected String getColumn(ContentContext ctx)
-
getColumnSizes
protected List<Integer> getColumnSizes(ContentContext ctx)
-
getColumnMaxSize
protected Integer getColumnMaxSize(ContentContext ctx)
-
getEditText
public String getEditText(ContentContext ctx, String key)
Description copied from interface:IContentVisualComponentget a internationalized text, in the languague of the edition.- Specified by:
getEditTextin interfaceIContentVisualComponentkey- the key of the text- Returns:
- the text in the current language
-
getEditRenderer
public String getEditRenderer(ContentContext ctx)
-
prepareEdit
public void prepareEdit(ContentContext ctx) throws Exception
- Throws:
Exception
-
getEditXHTMLCode
protected String getEditXHTMLCode(ContentContext ctx) throws Exception
- Throws:
Exception
-
isAskWidth
public boolean isAskWidth(ContentContext ctx)
-
getWidth
public String getWidth()
-
setWidth
public void setWidth(String width)
-
isFreeInputLayout
protected boolean isFreeInputLayout()
-
isAutoDeletable
protected boolean isAutoDeletable()
-
getXHTMLConfig
public String getXHTMLConfig(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponentxhtml code for config the component- Specified by:
getXHTMLConfigin interfaceIContentVisualComponent- Returns:
- Throws:
Exception
-
isHiddable
protected boolean isHiddable()
-
isConfig
public boolean isConfig(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn true if there the component is configurable.- Specified by:
isConfigin interfaceIContentVisualComponent- Returns:
-
performConfig
public String performConfig(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponentaction to manage the config, call when global content form is saved.- Specified by:
performConfigin interfaceIContentVisualComponent- Returns:
- Throws:
Exception
-
getEmptyCode
protected String getEmptyCode(ContentContext ctx) throws Exception
- Throws:
Exception
-
isDispayEmptyXHTMLCode
public boolean isDispayEmptyXHTMLCode(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponentdisplay empty xhtml code if empty- Specified by:
isDispayEmptyXHTMLCodein interfaceIContentVisualComponent- Returns:
- Throws:
Exception
-
getErrorMessage
public String getErrorMessage(String fieldName) throws ResourceNotFoundException
Description copied from interface:IContentVisualComponentreturn a error message in current view language- Specified by:
getErrorMessagein interfaceIContentVisualComponent- Returns:
- a error message in current view language
- Throws:
ResourceNotFoundException
-
getExternalResources
public Collection<String> getExternalResources(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn the external resources needed from component as css, javascript...- Specified by:
getExternalResourcesin interfaceIContentVisualComponent- Returns:
-
getExternalModules
public Collection<String> getExternalModules(ContentContext ctx)
- Specified by:
getExternalModulesin interfaceIContentVisualComponent
-
getFirstPrefix
public String getFirstPrefix(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the prefix must be insered before a list of the current component (warning: one element is a list) #return XHTML code of prefix- Specified by:
getFirstPrefixin interfaceIContentVisualComponent
-
getListClass
protected String getListClass(ContentContext ctx)
-
getListTag
protected String getListTag(ContentContext ctx)
-
getListItemTag
protected String getListItemTag(ContentContext ctx)
-
getFormName
public String getFormName()
-
getHeaderContent
public String getHeaderContent(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn the part of header needed for this component- Specified by:
getHeaderContentin interfaceIContentVisualComponent- Returns:
-
getHelpText
public String getHelpText(ContentContext ctx) throws IOException
- Specified by:
getHelpTextin interfaceIContentVisualComponent- Throws:
IOException
-
getHelpURL
public final String getHelpURL(ContentContext ctx)
Description copied from interface:IContentVisualComponenta url to descripe the usage of the component- Specified by:
getHelpURLin interfaceIContentVisualComponent- Returns:
- url to a help page or null if no help page defined
-
getHelpType
protected String getHelpType()
-
getDefaultHelpURI
protected String getDefaultHelpURI(ContentContext ctx)
-
getHelpURI
protected String getHelpURI(ContentContext ctx)
-
getHexColor
public String getHexColor()
Description copied from interface:IContentVisualComponentget the exadecimal color for representation of the component.- Specified by:
getHexColorin interfaceIContentVisualComponent- Returns:
- a exadecimal color (sample : a5b499)
-
getI18nEditableKeys
public List<String> getI18nEditableKeys(ContentContext ctx)
Description copied from interface:IContentVisualComponentget i18n keys for edition- Specified by:
getI18nEditableKeysin interfaceIContentVisualComponent- Returns:
- a list of i18n keys.
-
getId
public final String getId()
Description copied from interface:IContentVisualComponentreturn a unique id for the coponent- Specified by:
getIdin interfaceIContentVisualComponent- See Also:
org.javlo.itf.IContentVisualComponent#getContentLanguage()
-
getInputNameRenderer
public String getInputNameRenderer()
Description copied from interface:IContentVisualComponentget the input name of the renderer.- Specified by:
getInputNameRendererin interfaceIContentVisualComponent- Returns:
-
getInputNameRendererTitle
public String getInputNameRendererTitle()
-
getItalicAndStrongLanguageMarkerList
public List<SuffixPrefix> getItalicAndStrongLanguageMarkerList(ContentContext ctx)
-
getJSOnSubmit
public String getJSOnSubmit()
Description copied from interface:IContentVisualComponentreturn the java script code called when global form is submited.- Specified by:
getJSOnSubmitin interfaceIContentVisualComponent- Returns:
- java script code.
-
getKey
public String getKey()
Description copied from interface:IContentVisualComponentget a unic key of the component. User special for DynamicComponent.- Specified by:
getKeyin interfaceIContentVisualComponent
-
getLastSufix
public String getLastSufix(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the sufix before must be insered after a list of the current component.- Specified by:
getLastSufixin interfaceIContentVisualComponent- Returns:
- XHTML code of sufix.
-
getMarkerList
public List<SuffixPrefix> getMarkerList(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn the title of the style choice.- Specified by:
getMarkerListin interfaceIContentVisualComponent
-
getMessage
public GenericMessage getMessage()
Description copied from interface:IContentVisualComponentget a message for the component.- Specified by:
getMessagein interfaceIContentVisualComponent- Returns:
- a generic message (error, info, warning, help), null if no message.
-
getDisplayMessage
public String getDisplayMessage()
-
getNextComponent
public IContentVisualComponent getNextComponent()
Description copied from interface:IContentVisualComponentreturn the next component in the page sequence.- Specified by:
getNextComponentin interfaceIContentVisualComponent- Returns:
-
getPage
public MenuElement getPage()
Description copied from interface:IContentVisualComponentget the page contains the component- Specified by:
getPagein interfaceIContentVisualComponent- Returns:
- a page of the navigation
-
setContainerPage
public void setContainerPage(ContentContext ctx, MenuElement page)
Description copied from interface:IContentVisualComponentset the page of a container (page mirror, component mirror).- Specified by:
setContainerPagein interfaceIContentVisualComponent
-
getContainerPage
public MenuElement getContainerPage(ContentContext ctx)
get the page of the container if component is mirrored else get the page of the component.- Parameters:
ctx-- Returns:
-
getTag
protected String getTag(ContentContext ctx)
-
isWrapped
protected boolean isWrapped(ContentContext ctx)
-
isOpenRow
protected boolean isOpenRow(ContentContext ctx)
-
isCloseRow
protected boolean isCloseRow(ContentContext ctx)
-
getColomnablePrefix
protected String getColomnablePrefix(ContentContext ctx)
-
getColomnableSuffix
protected String getColomnableSuffix(ContentContext ctx)
-
getPrefixViewXHTMLCode
public String getPrefixViewXHTMLCode(ContentContext ctx)
Description copied from interface:IContentVisualComponentcode for prefix the view XHTML code.- Specified by:
getPrefixViewXHTMLCodein interfaceIContentVisualComponent- Returns:
- XHTML code.
-
getSuffixViewXHTMLCode
public String getSuffixViewXHTMLCode(ContentContext ctx)
Description copied from interface:IContentVisualComponentcode for sufix the view XHTML code.- Specified by:
getSuffixViewXHTMLCodein interfaceIContentVisualComponent- Returns:
- XHTML code.
-
contructViewStyle
protected String contructViewStyle(ContentContext ctx)
-
getForcedPrefixViewXHTMLCode
protected String getForcedPrefixViewXHTMLCode(ContentContext ctx)
-
getCSSStyle
protected String getCSSStyle(ContentContext ctx)
-
getInlineStyle
protected String getInlineStyle(ContentContext ctx)
-
getPreviousComponent
public IContentVisualComponent getPreviousComponent()
Description copied from interface:IContentVisualComponentreturn the previous component in the page sequence.- Specified by:
getPreviousComponentin interfaceIContentVisualComponent- Returns:
-
isPreviousSame
public boolean isPreviousSame()
return true if the previous component have the same type.- Returns:
-
isNextSame
public boolean isNextSame()
return true if the next component have the same type.- Returns:
-
isNextSame
public boolean isNextSame(ContentContext ctx)
-
isPreviousSame
public boolean isPreviousSame(ContentContext ctx)
-
getQuotationLanguageMarkerList
public List<SuffixPrefix> getQuotationLanguageMarkerList(ContentContext ctx)
-
getDefaultRenderer
public String getDefaultRenderer(ContentContext ctx)
-
getRenderes
public Map<String,String> getRenderes(ContentContext ctx)
-
isAutoRenderer
protected boolean isAutoRenderer()
return true if end user could not select the renderer.- Returns:
-
getRenderer
public String getRenderer(ContentContext ctx)
get current renderer file.- Specified by:
getRendererin interfaceIContentVisualComponent
-
getRendererTitle
protected String getRendererTitle()
-
getSearchLevel
public int getSearchLevel()
Description copied from interface:IContentVisualComponentreturn the level of the component is a search.- Specified by:
getSearchLevelin interfaceIContentVisualComponent- Returns:
- 1-LOW 2-MIDDLE 3-HIGH
-
getSelectRendererXHTML
protected String getSelectRendererXHTML(ContentContext ctx, boolean justDisplay) throws Exception, IOException
- Throws:
ExceptionIOException
-
getSpecialInputTag
protected String getSpecialInputTag()
create technical input tag. sample : for know the type of component with only therequest- Returns:
- a part of a form in XHTML
-
getSpecificClass
public String getSpecificClass(ContentContext ctx)
override this method for add specific class to prefix.- Returns:
-
getPreviewCssClass
protected String getPreviewCssClass(ContentContext ctx, String currentClass)
-
getDataAttributes
protected String getDataAttributes(ContentContext ctx)
-
getPrefixCssClass
protected String getPrefixCssClass(ContentContext ctx, String currentClass)
-
getForcedId
protected String getForcedId(ContentContext ctx)
-
setForcedId
protected static void setForcedId(ContentContext ctx, String id)
-
getPreviewCssId
public String getPreviewCssId(ContentContext ctx)
-
getSpecialPreviewCssId
public String getSpecialPreviewCssId(ContentContext ctx)
-
getViewID
protected String getViewID(ContentContext ctx)
-
isAjaxWrapper
public boolean isAjaxWrapper(ContentContext ctx)
-
getAjaxId
public String getAjaxId()
-
getStyle
public String getStyle()
Description copied from interface:IContentVisualComponentget the style of the display (sp. image-left, image-right)- Specified by:
getStylein interfaceIContentVisualComponent- Returns:
-
getComponentCssClass
public final String getComponentCssClass(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the current style of the component.- Specified by:
getComponentCssClassin interfaceIContentVisualComponent- Returns:
- the current style.
-
getSpecificCssClass
public String getSpecificCssClass(ContentContext ctx)
-
isColored
public boolean isColored()
-
isBackgroundColored
public boolean isBackgroundColored()
-
getStyleLabel
public String getStyleLabel(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the label of the current style- Specified by:
getStyleLabelin interfaceIContentVisualComponent- Returns:
-
setRenderer
public void setRenderer(ContentContext ctx, String renderer)
Description copied from interface:IContentVisualComponentset the current renderer for the component view.- Specified by:
setRendererin interfaceIContentVisualComponent
-
getStyleLabelList
public String[] getStyleLabelList(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn a list of label define the style.- Specified by:
getStyleLabelListin interfaceIContentVisualComponent- Returns:
- a list of label.
-
getStyleList
public String[] getStyleList(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the list of style possible for this component.- Specified by:
getStyleListin interfaceIContentVisualComponent- Returns:
- a list of string represent a style.
-
getStyleTitle
public String getStyleTitle(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn the title of the style choice.- Specified by:
getStyleTitlein interfaceIContentVisualComponent
-
getForcedSuffixViewXHTMLCode
protected String getForcedSuffixViewXHTMLCode(ContentContext ctx)
-
getTextForSearch
public String getTextForSearch(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn a text represent the content of the component. sample all the content :-)- Specified by:
getTextForSearchin interfaceIContentVisualComponent- Returns:
- a text represent the content of the component for the search module
-
getTextLabel
public String getTextLabel(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn a string representation of the component- Specified by:
getTextLabelin interfaceIContentVisualComponent
-
getTextTitle
public String getTextTitle(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn a string representation of the component with complete title- Specified by:
getTextTitlein interfaceIContentVisualComponent- Returns:
-
getTitleLevel
public int getTitleLevel(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the level of the title (1,2,3...). return 0 if the component is not a title- Specified by:
getTitleLevelin interfaceIContentVisualComponent- Returns:
- the level of the title, 0 if the component is not a title.
-
getTypeInputName
protected String getTypeInputName()
-
getValue
public String getValue()
-
getBackgroundColor
public String getBackgroundColor()
-
getManualCssClass
protected String getManualCssClass()
-
getTextColor
public String getTextColor()
-
getTextPosition
public String getTextPosition()
-
getValue
public String getValue(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the value of the content without any rendering.- Specified by:
getValuein interfaceIContentVisualComponent- Returns:
- content in a text format.
-
getViewData
public Properties getViewData(ContentContext ctx) throws IOException
- Throws:
IOException
-
getViewDataFile
protected File getViewDataFile(ContentContext ctx) throws IOException
- Throws:
IOException
-
getViewText
public String getViewText(ContentContext ctx, String key) throws ResourceNotFoundException
Description copied from interface:IContentVisualComponentget a internationalized text, in the languague of the view.- Specified by:
getViewTextin interfaceIContentVisualComponentkey- the key of the text- Returns:
- the text in the current language
- Throws:
ResourceNotFoundException
-
executeCurrentRenderer
protected String executeCurrentRenderer(ContentContext ctx) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletExceptionIOException
-
executeRenderer
protected String executeRenderer(ContentContext ctx, String url, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletExceptionIOException
-
isStyleHidden
protected boolean isStyleHidden(ContentContext ctx)
-
renderViewXHTMLCode
protected String renderViewXHTMLCode(ContentContext ctx) throws Exception
- Throws:
Exception
-
cleanValue
protected String cleanValue(ContentContext ctx, String value)
-
getViewXHTMLCode
public String getViewXHTMLCode(ContentContext ctx) throws Exception
- Throws:
Exception
-
getWordCount
public int getWordCount(ContentContext ctx)
Description copied from interface:IContentVisualComponentcount the word in the content.- Specified by:
getWordCountin interfaceIContentVisualComponent- Returns:
-
getXHTMLCode
public String getXHTMLCode(ContentContext ctx)
Description copied from interface:IContentVisualComponentthe code for view the element in XHTML environment.- Specified by:
getXHTMLCodein interfaceIContentVisualComponent- Returns:
-
getLock
protected Object getLock(ContentContext ctx)
-
getPreviewAttributes
protected String getPreviewAttributes(ContentContext ctx)
-
prepareView
public void prepareView(ContentContext ctx) throws Exception
prepare the rendering of a component. default attributes put in request : style, value, type, compid- Specified by:
prepareViewin interfaceIContentVisualComponent- Parameters:
ctx-- Throws:
Exception
-
includeComponentJSP
protected void includeComponentJSP(ContentContext ctx, String jsp) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletExceptionIOException
-
getDisplayAsInputName
protected String getDisplayAsInputName()
-
includePage
protected void includePage(ContentContext ctx, String jsp) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletExceptionIOException
-
init
protected void init() throws ResourceNotFoundException- Throws:
ResourceNotFoundException
-
init
protected void init(ComponentBean bean, ContentContext ctx) throws Exception
- Throws:
Exception
-
forceInit
public void forceInit(ComponentBean bean, ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponentforce a init.- Specified by:
forceInitin interfaceIContentVisualComponent- Throws:
Exception
-
insert
public void insert(String text)
insert a text in the component- Specified by:
insertin interfaceIContentVisualComponent- Parameters:
text- the text to be insered
-
isContentCachable
public boolean isContentCachable(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn the part of header needed for this component- Specified by:
isContentCachablein interfaceIContentVisualComponent- Returns:
-
isContentCachableByQuery
public boolean isContentCachableByQuery(ContentContext ctx)
-
isContentTimeCachable
public boolean isContentTimeCachable(ContentContext ctx)
-
isDefaultValue
public boolean isDefaultValue(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn true if value is never modified.- Specified by:
isDefaultValuein interfaceIContentVisualComponent- Returns:
- true if value contain default value.
-
isFirstElementOfRepeatSequence
protected boolean isFirstElementOfRepeatSequence(ContentContext ctx) throws Exception
- Throws:
Exception
-
isFirstRepeated
public boolean isFirstRepeated()
Description copied from interface:IContentVisualComponentreturn true if component is in the first repeat sequence of the page.- Specified by:
isFirstRepeatedin interfaceIContentVisualComponent- Returns:
-
isHidden
public boolean isHidden(ContentContext ctx)
Description copied from interface:IContentVisualComponenttrue if component marked as hidden (in components.txt the class name start with '.')- Specified by:
isHiddenin interfaceIContentVisualComponent- Returns:
-
isInline
public boolean isInline()
Description copied from interface:IContentVisualComponentcheck if the component can be inserd inline.- Specified by:
isInlinein interfaceIContentVisualComponent- Returns:
- true if component is a inline component. (text, link, image)...
-
isCanAddClass
protected boolean isCanAddClass()
-
isInsertable
public boolean isInsertable()
you can insert a text in this component- Specified by:
isInsertablein interfaceIContentVisualComponent- Returns:
- true if a text is insertable
-
getLabelLevel
public int getLabelLevel(ContentContext ctx)
Description copied from interface:IContentVisualComponentdefine the level of label. If there area most than 1 level on page, the label of the page is the bigger level.- Specified by:
getLabelLevelin interfaceIContentVisualComponent- Returns:
- 0=default, no the components is'nt label.
-
isList
public boolean isList(ContentContext ctx)
Description copied from interface:IContentVisualComponenttrue if the component is in a list- Specified by:
isListin interfaceIContentVisualComponent- Returns:
- true if component is in a list
-
getDeleteDate
protected Date getDeleteDate(ContentContext ctx)
-
isNeedDelete
protected boolean isNeedDelete(ContentContext ctx) throws Exception
- Throws:
Exception
-
isListable
public boolean isListable()
Description copied from interface:IContentVisualComponentyou display the composant as a list (if you want)- Specified by:
isListablein interfaceIContentVisualComponent- Returns:
- true if a text is listable
-
isModify
public boolean isModify()
- Specified by:
isModifyin interfaceIContentVisualComponent- Returns:
- true if the composant was modified.
- See Also:
org.javlo.itf.IContentVisualComponent#isModify()
-
isNeedRefresh
public boolean isNeedRefresh()
Description copied from interface:IContentVisualComponentreturn true if the modifition of the component need a refresh of the edit page (ajax).- Specified by:
isNeedRefreshin interfaceIContentVisualComponent
-
isRealContent
public boolean isRealContent(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn true if component is considered as realContent and the page that contain the component is also considered as real content.- Specified by:
isRealContentin interfaceIContentVisualComponent- Parameters:
ctx- current context- Returns:
-
isRepeat
public boolean isRepeat()
- Specified by:
isRepeatin interfaceIContentVisualComponent- Returns:
- Returns the repeat.
-
isNolink
public boolean isNolink()
- Specified by:
isNolinkin interfaceIContentVisualComponent
-
isRepeatable
public boolean isRepeatable()
- Specified by:
isRepeatablein interfaceIContentVisualComponent
-
isNoLinkable
public boolean isNoLinkable()
-
isUnique
public boolean isUnique()
Description copied from interface:IContentVisualComponentreturn true if the component must be unique on a page- Specified by:
isUniquein interfaceIContentVisualComponent- Returns:
-
isViewDataFile
protected boolean isViewDataFile(ContentContext ctx) throws IOException
- Throws:
IOException
-
isVisible
public boolean isVisible()
- Specified by:
isVisiblein interfaceIContentVisualComponent
-
isVisible
public boolean isVisible(ContentContext ctx)
Description copied from interface:IContentVisualComponentcheck if this element is visible in the format.- Specified by:
isVisiblein interfaceIContentVisualComponent- Returns:
- true if elment visible, false else
-
isVisibleFromCookies
public boolean isVisibleFromCookies(ContentContext ctx)
Description copied from interface:IContentVisualComponentvisible or no, depend of the choice of visitor with cookies- Specified by:
isVisibleFromCookiesin interfaceIContentVisualComponent- Returns:
-
loadViewData
public void loadViewData(ContentContext ctx) throws IOException
Description copied from interface:IContentVisualComponentload special data file.- Specified by:
loadViewDatain interfaceIContentVisualComponent- Throws:
IOException
-
newInstance
public IContentVisualComponent newInstance(ComponentBean bean, ContentContext newCtx, MenuElement page) throws Exception
Description copied from interface:IContentVisualComponentinit the component, do that before all using.- Specified by:
newInstancein interfaceIContentVisualComponentnewCtx- the context of the content manager.- Throws:
Exception
-
next
public IContentVisualComponent next()
Description copied from interface:IContentVisualComponentget the next component on the page. if null this is the last component.- Specified by:
nextin interfaceIContentVisualComponent- Returns:
- a component.
-
onStyleChange
protected void onStyleChange(ContentContext ctx)
-
previous
public IContentVisualComponent previous()
Description copied from interface:IContentVisualComponentget the next component on the page. if null this is the last component.- Specified by:
previousin interfaceIContentVisualComponent- Returns:
- a component.
-
processView
protected String processView(ContentContext ctx) throws Exception
prepare the rendering of the page.- Parameters:
ctx-- Returns:
- Throws:
Exception
-
performColumnable
protected void performColumnable(ContentContext ctx)
-
performEdit
public String performEdit(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponentaction call when update the content page.- Specified by:
performEditin interfaceIContentVisualComponent- Returns:
- the error message, null if no error
- Throws:
Exception
-
performUpdate
public final void performUpdate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception- Throws:
Exception
-
replaceAllInContent
public void replaceAllInContent(Map<String,String> replacement)
Description copied from interface:IContentVisualComponentadd a list of remplacement key, value- Specified by:
replaceAllInContentin interfaceIContentVisualComponent
-
replaceInContent
public void replaceInContent(String source, String target)
Description copied from interface:IContentVisualComponentreplace a content in visual element- Specified by:
replaceInContentin interfaceIContentVisualComponent- Parameters:
source- the source element (sample. : test)target- the target element (sample. : -- test --)
-
resetContentCache
public void resetContentCache(ContentContext ctx)
-
resetViewData
public void resetViewData(ContentContext ctx) throws IOException
Description copied from interface:IContentVisualComponentreset the view data.- Specified by:
resetViewDatain interfaceIContentVisualComponent- Throws:
IOException
-
setComponentBean
public void setComponentBean(ComponentBean componentBean)
-
setContentCache
public void setContentCache(ContentContext ctx, String contentCache)
-
setContentTimeCache
public void setContentTimeCache(ContentContext ctx, String contentCache)
-
setHidden
public void setHidden(boolean hidden)
-
setList
public void setList(boolean inList)
Description copied from interface:IContentVisualComponentput the component is a list- Specified by:
setListin interfaceIContentVisualComponent- Parameters:
inList- true for put in a list, false for remove from a list
-
setDisplayHidden
public void setDisplayHidden(boolean hidden)
Description copied from interface:IContentVisualComponenthide component in display mode- Specified by:
setDisplayHiddenin interfaceIContentVisualComponent
-
isDisplayHidden
public boolean isDisplayHidden()
Description copied from interface:IContentVisualComponentis component displayed for visitor- Specified by:
isDisplayHiddenin interfaceIContentVisualComponent- Returns:
-
setBackgroundColor
public void setBackgroundColor(String bgcol)
-
setTextColor
public void setTextColor(String textcol)
-
setTextPosition
public void setTextPosition(String textPos)
-
setMessage
public void setMessage(GenericMessage inMsg)
-
setModify
public void setModify()
-
updateCache
protected void updateCache()
-
setNeedRefresh
public void setNeedRefresh(boolean needRefresh)
Description copied from interface:IContentVisualComponentif you set true the page is refresh after update- Specified by:
setNeedRefreshin interfaceIContentVisualComponent
-
setNextComponent
public void setNextComponent(IContentVisualComponent nextComponent)
Description copied from interface:IContentVisualComponentchange the previous component- Specified by:
setNextComponentin interfaceIContentVisualComponent
-
setPage
public void setPage(MenuElement inPage)
- Specified by:
setPagein interfaceIContentVisualComponent
-
setPreviousComponent
public void setPreviousComponent(IContentVisualComponent previousComponent)
Description copied from interface:IContentVisualComponentchange the previous component- Specified by:
setPreviousComponentin interfaceIContentVisualComponent
-
setRepeat
public void setRepeat(boolean newRepeat)
- Specified by:
setRepeatin interfaceIContentVisualComponent
-
setNolink
public void setNolink(boolean noLink)
-
setStyle
public void setStyle(ContentContext ctx, String inStyle)
Description copied from interface:IContentVisualComponentset the current style of the component.- Specified by:
setStylein interfaceIContentVisualComponentinStyle- new style
-
setValid
public void setValid(boolean inVisible)
- Specified by:
setValidin interfaceIContentVisualComponent
-
setValue
public void setValue(String inContent)
Description copied from interface:IContentVisualComponentset the content without rendering- Specified by:
setValuein interfaceIContentVisualComponent
-
stored
public void stored()
Description copied from interface:IContentVisualComponentcall this method when the component is stored.- Specified by:
storedin interfaceIContentVisualComponent- See Also:
org.javlo.itf.IContentVisualComponent#stored()
-
storeViewData
public void storeViewData(ContentContext ctx) throws IOException
- Throws:
IOException
-
stringToStream
public InputStream stringToStream(String str)
-
stringToReader
public Reader stringToReader(String str, String encoding) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
stringToReader
public Reader stringToReader(String str) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
textToXHTML
@Deprecated public String textToXHTML(String text)
Deprecated.use XHTMLHelper.textToXHTML(String text)- Parameters:
text-- Returns:
-
isMetaTitle
public boolean isMetaTitle()
Description copied from interface:IContentVisualComponentreturn true is this component is a title of a group of component.- Specified by:
isMetaTitlein interfaceIContentVisualComponent- Returns:
-
getClassName
public String getClassName()
Description copied from interface:IContentVisualComponentreturn the name of the class (use for JSTL)- Specified by:
getClassNamein interfaceIContentVisualComponent- Returns:
-
isValueProperties
public boolean isValueProperties()
if content of the component is a list of properties (key=value) this method must return true. If this method return true prepare method will add a mal called "properties" in request attrivute and this map can be used in renderer (jsp).- Returns:
- true if content is a list of properties.
-
getVersion
public String getVersion()
Description copied from interface:IContentVisualComponentreturn 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- Specified by:
getVersionin interfaceIContentVisualComponent- Returns:
- ? if version undefined.
-
getDescription
public String getDescription(Locale local)
Description copied from interface:IContentVisualComponenta description of the component;- Specified by:
getDescriptionin interfaceIContentVisualComponent- Returns:
-
getAuthors
public String getAuthors()
Description copied from interface:IContentVisualComponentauthors of the component- Specified by:
getAuthorsin interfaceIContentVisualComponent- Returns:
-
initContent
public boolean initContent(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponentinit the content with a default value. sample : "lorem ipsum" for text component.- Specified by:
initContentin interfaceIContentVisualComponent- Returns:
- true if content is create.
- Throws:
Exception
-
getCreationDate
public Date getCreationDate()
- Specified by:
getCreationDatein interfaceIContentVisualComponent
-
getModificationDate
public Date getModificationDate()
- Specified by:
getModificationDatein interfaceIContentVisualComponent
-
isHiddenInMode
public boolean isHiddenInMode(ContentContext ctx, int mode, Boolean mobile)
Description copied from interface:IContentVisualComponentcomponent can be hidded in some mode, like view or preview.- Specified by:
isHiddenInModein interfaceIContentVisualComponentmode- current mode (view, preview, edit...)mobile- render in mobil mode- Returns:
-
isHiddenInModeValue
protected boolean isHiddenInModeValue(ContentContext ctx, int mode)
-
getCookiesDisplayStatus
public int getCookiesDisplayStatus()
-
setHiddenInMode
public void setHiddenInMode(int mode, boolean hidden)
-
getSpecialTagTitle
public String getSpecialTagTitle(ContentContext ctx) throws Exception
- Specified by:
getSpecialTagTitlein interfaceIContentVisualComponent- Throws:
Exception
-
getSpecialTagXHTML
public String getSpecialTagXHTML(ContentContext ctx) throws Exception
- Specified by:
getSpecialTagXHTMLin interfaceIContentVisualComponent- Throws:
Exception
-
isNeedRenderer
protected boolean isNeedRenderer()
return true if this component need renderer from template.- Returns:
-
compareTo
public int compareTo(IContentVisualComponent comp)
- Specified by:
compareToin interfaceComparable<IContentVisualComponent>
-
getLayout
public ComponentLayout getLayout()
Description copied from interface:IContentVisualComponentget a simple layout for the component.- Specified by:
getLayoutin interfaceIContentVisualComponent- Returns:
-
equals
public boolean equals(ContentContext ctx, IContentVisualComponent comp)
Description copied from interface:IContentVisualComponentcheck of component is considered as the same than an other.- Specified by:
equalsin interfaceIContentVisualComponent- Returns:
-
getEmptyXHTMLCode
public String getEmptyXHTMLCode(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponentreturn the code if component contain's no data.- Specified by:
getEmptyXHTMLCodein interfaceIContentVisualComponent- Throws:
Exception
-
getPageDescription
public String getPageDescription(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn the description of the page if this component is or contains description.- Specified by:
getPageDescriptionin interfaceIContentVisualComponent- Returns:
-
getListGroup
public String getListGroup()
Description copied from interface:IContentVisualComponentreturn the name of group component.- Specified by:
getListGroupin interfaceIContentVisualComponent- Returns:
-
isReversedLink
public boolean isReversedLink(ContentContext ctx)
-
getContentMessage
public GenericMessage getContentMessage(ContentContext ctx)
Description copied from interface:IContentVisualComponentwarning message on content tab- Specified by:
getContentMessagein interfaceIContentVisualComponent- Returns:
-
getTextMessage
public GenericMessage getTextMessage(ContentContext ctx)
Description copied from interface:IContentVisualComponentwarning message on text tab- Specified by:
getTextMessagein interfaceIContentVisualComponent- Returns:
-
getConfigMessage
public GenericMessage getConfigMessage(ContentContext ctx)
Description copied from interface:IContentVisualComponentwarning message on config tab- Specified by:
getConfigMessagein interfaceIContentVisualComponent- Returns:
-
markAsNew
public void markAsNew(ContentContext ctx)
mark component as new in the current request- Specified by:
markAsNewin interfaceIContentVisualComponent- Parameters:
ctx-
-
isNew
public boolean isNew(ContentContext ctx)
check if this component has maked has new in the current request- Specified by:
isNewin interfaceIContentVisualComponent- Parameters:
ctx-- Returns:
-
isEditOnCreate
public boolean isEditOnCreate(ContentContext ctx)
return true if the component is directly edited when it is insered.- Specified by:
isEditOnCreatein interfaceIContentVisualComponent- Parameters:
ctx-- Returns:
-
getContentAsMap
public Map<String,Object> getContentAsMap(ContentContext ctx) throws Exception
- Specified by:
getContentAsMapin interfaceIRestItem- Throws:
Exception
-
setMirrorWrapped
public static void setMirrorWrapped(ContentContext ctx, IContentVisualComponent comp, MirrorComponent mirror)
-
isMirrorWrapped
public static boolean isMirrorWrapped(ContentContext ctx, IContentVisualComponent comp)
-
getMirrorWrapper
public static MirrorComponent getMirrorWrapper(ContentContext ctx, IContentVisualComponent comp)
-
isMirroredByDefault
public boolean isMirroredByDefault(ContentContext ctx)
Description copied from interface:IContentVisualComponentif this component is duplicated, by default it is mirrored.- Specified by:
isMirroredByDefaultin interfaceIContentVisualComponent- Returns:
-
getContentAsText
public String getContentAsText(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the text of the component- Specified by:
getContentAsTextin interfaceIContentVisualComponent- Returns:
-
getImportFolderPath
public static String getImportFolderPath(ContentContext ctx, MenuElement page) throws Exception
- Throws:
Exception
-
getImportFolderPath
public String getImportFolderPath(ContentContext ctx) throws Exception
- Throws:
Exception
-
isXML
protected boolean isXML()
-
getErrorMessage
public String getErrorMessage(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn error message on structure of the component.- Specified by:
getErrorMessagein interfaceIContentVisualComponent- Returns:
- null if no errors found
-
isDisplayable
public boolean isDisplayable(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponenttrue if the component can be displayed in preview mode- Specified by:
isDisplayablein interfaceIContentVisualComponent- Returns:
- Throws:
Exception
-
isRestMatch
public boolean isRestMatch(ContentContext ctx, Map<String,String> params)
- Specified by:
isRestMatchin interfaceIContentVisualComponent
-
getFontAwesome
public String getFontAwesome()
- Specified by:
getFontAwesomein interfaceIContentVisualComponent
-
getIcon
public String getIcon()
- Specified by:
getIconin interfaceIContentVisualComponent
-
haveRight
public boolean haveRight(ContentContext ctx, String action)
-
isValueTranslatable
protected boolean isValueTranslatable()
-
transflateFrom
public boolean transflateFrom(ContentContext ctx, ITranslator translator, String lang)
Description copied from interface:IContentVisualComponenttranslate the content of the component to the current language- Specified by:
transflateFromin interfaceIContentVisualComponent- Parameters:
ctx- contextContext of the current renderingtranslator- class to translatelang- the language of the current content (source language)- Returns:
-
getLocalMessage
public GenericMessage getLocalMessage()
-
setLocalMessage
public void setLocalMessage(GenericMessage localMessage)
-
getConfigInValue
public String getConfigInValue(String key, String defaultValue)
Description copied from interface:IContentVisualComponenttransform the value of the component in a config properties file. If key not found a entry is created in the content.- Specified by:
getConfigInValuein interfaceIContentVisualComponent- 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.
-
renderOtherComponent
public String renderOtherComponent(ContentContext ctx, IContentVisualComponent comp)
-
-