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 :
String
compid : the id of the components. SeegetId()
String
compPage : a page bean of the page contain's the component.String
value : the raw value of the component. SeegetValue()
String
type : the component type. SeeIContentVisualComponent.getType()
String
layout : the layout of the component is css (can be null).String
componentWidth : the width of component forced by contributor (if component manage it)String
style : the style selected for the component. SeeString
previewAttributes : 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 String
CACHE_KEY_SUFFIX_PARAM_NAME
static String
COMPONENT_KEY
protected ComponentConfig
config
protected static String
EDIT_CLASS
static int
FLUID_COL_SIZE
static String
FORCE_COMPONENT_ID
static String
HIDDEN
static String
I18N_FILE
static Logger
logger
static int
MAX_COL_VALUE
static String
MOBILE_TYPE
static String
NOT_EDIT_PREVIEW_PARAM_NAME
static String
SCROLL_TO_COMP_ID_ATTRIBUTE_NAME
static String
TIME_CACHE_NAME
protected static String
VALUE_SEPARATOR
-
Fields inherited from interface org.javlo.component.core.IContentVisualComponent
COLORED_WRAPPER_CLASS, COMP_ID_REQUEST_PARAM, COMPLEXITY_ADMIN, COMPLEXITY_EASY, COMPLEXITY_STANDARD, CONTAINER_COLOR, DEFAULT_COLOR, DYN_COMP_COLOR, ECOM_COLOR, EDIT_ACTION_CSS_CLASS, GRAPHIC_COLOR, HIGH_LABEL_LEVEL, ID_SEPARATOR, LINK_COLOR, LOW_LABEL_LEVEL, META_COLOR, MIDDLE_LABEL_LEVEL, SEARCH_LEVEL_HIGH, SEARCH_LEVEL_LOW, SEARCH_LEVEL_MIDDLE, SEARCH_LEVEL_NONE, TEXT_COLOR, VIEW_DEFINITION_REQUEST_ID, WEB2_COLOR
-
-
Constructor Summary
Constructors Constructor Description AbstractVisualComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected String
applyReplacement(String content)
boolean
cleanResources(ContentContext ctx)
clean resources.protected String
cleanValue(ContentContext ctx, String value)
void
clearReplacement()
clear remplacement valuesprotected Object
clone()
int
compareTo(IContentVisualComponent comp)
protected String
contructViewStyle(ContentContext ctx)
protected int
countLine()
void
delete(ContentContext ctx)
this method is called when component is deleted.protected void
deleteMySelf(ContentContext ctx)
protected String
drawColumn(ContentContext ctx, int size)
boolean
equals(Object obj)
boolean
equals(ContentContext ctx, IContentVisualComponent comp)
check of component is considered as the same than an other.protected String
executeCurrentRenderer(ContentContext ctx)
protected String
executeJSP(ContentContext ctx, String jsp)
protected String
executeRenderer(ContentContext ctx)
protected String
executeRenderer(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 renderervoid
forceInit(ComponentBean bean, ContentContext ctx)
force a init.String
getAjaxId()
String
getArea()
get the area where the component must be renderedString
getAuthors()
authors of the componentString
getBackgroundColor()
protected String
getBaseHelpURL(ContentContext ctx)
String
getClassName()
return the name of the class (use for JSTL)protected String
getColomnablePrefix(ContentContext ctx)
protected String
getColomnableSuffix(ContentContext ctx)
protected String
getColumn(ContentContext ctx)
protected boolean
getColumnableDefaultValue()
protected Integer
getColumnMaxSize(ContentContext ctx)
int
getColumnSize(ContentContext ctx)
get the size of the column, the column contains the componentprotected List<Integer>
getColumnSizes(ContentContext ctx)
String
getColumnStyle(ContentContext ctx)
int
getComplexityLevel(ContentContext ctx)
return the complexity level of the component.ComponentBean
getComponentBean()
get the internal dataprotected String
getComponentCSS(javax.servlet.ServletContext application, String css)
String
getComponentCssClass(ContentContext ctx)
get the current style of the component.static String
getComponentId(javax.servlet.http.HttpServletRequest request)
String
getComponentLabel(ContentContext ctx, String lg)
return the label of the element.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.ComponentConfig
getConfig(ContentContext ctx)
get the configuration of the component. from project or from template.String
getConfigInValue(String key, String defaultValue)
transform the value of the component in a config properties file.GenericMessage
getConfigMessage(ContentContext ctx)
warning message on config tabMenuElement
getContainerPage(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)
String
getContentAsText(ContentContext ctx)
get the text of the componentString
getContentCache(ContentContext ctx)
GenericMessage
getContentMessage(ContentContext ctx)
warning message on content tabString
getContentName()
get the XHTML input field name for the contentString
getContentTimeCache(ContentContext ctx)
int
getCookiesDisplayStatus()
Date
getCreationDate()
protected String
getCSSStyle(ContentContext ctx)
MenuElement
getCurrentPage(ContentContext ctx, boolean componentPage)
get the current pageString
getCurrentRenderer(ContentContext ctx)
get current renderer keyprotected String
getDataAttributes(ContentContext ctx)
String
getDebugHeader(ContentContext ctx)
protected String
getDefaultHelpURI(ContentContext ctx)
String
getDefaultRenderer(ContentContext ctx)
protected Date
getDeleteDate(ContentContext ctx)
String
getDescription(Locale local)
a description of the component;protected String
getDisplayAsInputName()
String
getDisplayMessage()
protected String
getEditorComplexity(ContentContext ctx)
return the wysiwyg editor complexityString
getEditRenderer(ContentContext ctx)
String
getEditText(ContentContext ctx, String key)
get a internationalized text, in the languague of the edition.protected String
getEditXHTMLCode(ContentContext ctx)
protected String
getEmptyCode(ContentContext ctx)
String
getEmptyXHTMLCode(ContentContext ctx)
return the code if component contain's no data.String
getErrorMessage(String fieldName)
return a error message in current view languageString
getErrorMessage(ContentContext ctx)
return error message on structure of the component.Collection<String>
getExternalModules(ContentContext ctx)
Collection<String>
getExternalResources(ContentContext ctx)
return the external resources needed from component as css, javascript...String
getFileDirectory(ContentContext ctx)
String
getFirstPrefix(ContentContext ctx)
get the prefix must be insered before a list of the current component (warning: one element is a list) #return XHTML code of prefixString
getFontAwesome()
protected String
getForcedId(ContentContext ctx)
protected String
getForcedPrefixViewXHTMLCode(ContentContext ctx)
protected String
getForcedRenderer(ContentContext ctx)
protected String
getForcedSuffixViewXHTMLCode(ContentContext ctx)
String
getFormName()
String
getGroup()
get the group of the component (meta, text, links, media,...)String
getHeaderContent(ContentContext ctx)
return the part of header needed for this componentString
getHelpText(ContentContext ctx)
protected String
getHelpType()
protected String
getHelpURI(ContentContext ctx)
String
getHelpURL(ContentContext ctx)
a url to descripe the usage of the componentString
getHexColor()
get the exadecimal color for representation of the component.List<String>
getI18nEditableKeys(ContentContext ctx)
get i18n keys for editionString
getIcon()
String
getId()
return a unique id for the coponentString
getImportFolderPath(ContentContext ctx)
static String
getImportFolderPath(ContentContext ctx, MenuElement page)
protected String
getInlineStyle(ContentContext ctx)
protected String
getInputName(String field)
protected String
getInputNameColomn()
protected String
getInputNameColomnStyle()
String
getInputNameRenderer()
get the input name of the renderer.String
getInputNameRendererTitle()
List<SuffixPrefix>
getItalicAndStrongLanguageMarkerList(ContentContext ctx)
String
getJSOnSubmit()
return the java script code called when global form is submited.String
getKey()
get a unic key of the component.int
getLabelLevel(ContentContext ctx)
define the level of label.String
getLastSufix(ContentContext ctx)
get the sufix before must be insered after a list of the current component.ComponentLayout
getLayout()
get a simple layout for the component.protected String
getListClass(ContentContext ctx)
String
getListGroup()
return the name of group component.protected String
getListItemTag(ContentContext ctx)
protected String
getListTag(ContentContext ctx)
GenericMessage
getLocalMessage()
protected Object
getLock(ContentContext ctx)
protected String
getManualCssClass()
List<SuffixPrefix>
getMarkerList(ContentContext ctx)
return the title of the style choice.GenericMessage
getMessage()
get a message for the component.static MirrorComponent
getMirrorWrapper(ContentContext ctx, IContentVisualComponent comp)
Date
getModificationDate()
IContentVisualComponent
getNextComponent()
return the next component in the page sequence.MenuElement
getPage()
get the page contains the componentString
getPageDescription(ContentContext ctx)
return the description of the page if this component is or contains description.protected String
getPrefixCssClass(ContentContext ctx, String currentClass)
String
getPrefixViewXHTMLCode(ContentContext ctx)
code for prefix the view XHTML code.protected String
getPreviewAttributes(ContentContext ctx)
protected String
getPreviewCssClass(ContentContext ctx, String currentClass)
String
getPreviewCssId(ContentContext ctx)
IContentVisualComponent
getPreviousComponent()
return the previous component in the page sequence.List<SuffixPrefix>
getQuotationLanguageMarkerList(ContentContext ctx)
IContentVisualComponent
getReferenceComponent(ContentContext ctx)
search the equivalent component in the default language content.Map<String,String>
getRemplacement()
String
getRenderer(ContentContext ctx)
get current renderer file.protected String
getRendererTitle()
Map<String,String>
getRenderes(ContentContext ctx)
static IContentVisualComponent
getRequestComponent(javax.servlet.http.HttpServletRequest request)
get a component in the request if there are.int
getSearchLevel()
return the level of the component is a search.protected String
getSelectRendererXHTML(ContentContext ctx, boolean justDisplay)
protected String
getSpecialInputTag()
create technical input tag. sample : for know the type of component with only therequest
String
getSpecialPreviewCssId(ContentContext ctx)
String
getSpecialTagTitle(ContentContext ctx)
String
getSpecialTagXHTML(ContentContext ctx)
String
getSpecificClass(ContentContext ctx)
override this method for add specific class to prefix.String
getSpecificCssClass(ContentContext ctx)
String
getStyle()
get the style of the display (sp. image-left, image-right)String
getStyleLabel(ContentContext ctx)
get the label of the current styleString[]
getStyleLabelList(ContentContext ctx)
return a list of label define the style.String[]
getStyleList(ContentContext ctx)
get the list of style possible for this component.String
getStyleTitle(ContentContext ctx)
return the title of the style choice.String
getSuffixViewXHTMLCode(ContentContext ctx)
code for sufix the view XHTML code.protected String
getTag(ContentContext ctx)
String
getTextColor()
String
getTextForSearch(ContentContext ctx)
return a text represent the content of the component. sample all the content :-)String
getTextLabel(ContentContext ctx)
return a string representation of the componentGenericMessage
getTextMessage(ContentContext ctx)
warning message on text tabString
getTextPosition()
String
getTextTitle(ContentContext ctx)
return a string representation of the component with complete titleint
getTitleLevel(ContentContext ctx)
get the level of the title (1,2,3...). return 0 if the component is not a titleprotected String
getTypeInputName()
String
getValue()
String
getValue(ContentContext ctx)
get the value of the content without any rendering.String
getVersion()
return the version of the component : A.B.C A : major version, no compatibility with the older data B : new function but compatibilty with older data C : bug correctionProperties
getViewData(ContentContext ctx)
protected File
getViewDataFile(ContentContext ctx)
protected String
getViewID(ContentContext ctx)
String
getViewText(ContentContext ctx, String key)
get a internationalized text, in the languague of the view.String
getViewXHTMLCode(ContentContext ctx)
String
getWidth()
int
getWordCount(ContentContext ctx)
count the word in the content.String
getXHTMLCode(ContentContext ctx)
the code for view the element in XHTML environment.String
getXHTMLConfig(ContentContext ctx)
xhtml code for config the componentboolean
haveRight(ContentContext ctx, String action)
protected void
includeComponentJSP(ContentContext ctx, String jsp)
protected void
includePage(ContentContext ctx, String jsp)
protected void
init()
protected void
init(ComponentBean bean, ContentContext ctx)
boolean
initContent(ContentContext ctx)
init the content with a default value. sample : "lorem ipsum" for text component.void
insert(String text)
insert a text in the componentboolean
isAjaxWrapper(ContentContext ctx)
boolean
isAskWidth(ContentContext ctx)
protected boolean
isAutoDeletable()
protected boolean
isAutoRenderer()
return true if end user could not select the renderer.boolean
isBackgroundColored()
protected boolean
isCanAddClass()
protected boolean
isCloseRow(ContentContext ctx)
boolean
isColored()
boolean
isColumnable(ContentContext ctx)
contributor can select size of column to wrap componentboolean
isConfig(ContentContext ctx)
return true if there the component is configurable.boolean
isContentCachable(ContentContext ctx)
return the part of header needed for this componentboolean
isContentCachableByQuery(ContentContext ctx)
boolean
isContentTimeCachable(ContentContext ctx)
boolean
isDefaultValue(ContentContext ctx)
return true if value is never modified.boolean
isDispayEmptyXHTMLCode(ContentContext ctx)
display empty xhtml code if emptyboolean
isDisplayable(ContentContext ctx)
true if the component can be displayed in preview modeboolean
isDisplayHidden()
is component displayed for visitorboolean
isEditOnCreate(ContentContext ctx)
return true if the component is directly edited when it is insered.protected boolean
isFirstElementOfRepeatSequence(ContentContext ctx)
boolean
isFirstRepeated()
return true if component is in the first repeat sequence of the page.protected boolean
isFreeInputLayout()
boolean
isHelpURL(ContentContext ctx)
protected boolean
isHiddable()
boolean
isHidden(ContentContext ctx)
true if component marked as hidden (in components.txt the class name start with '.')boolean
isHiddenInMode(ContentContext ctx, int mode, Boolean mobile)
component can be hidded in some mode, like view or preview.protected boolean
isHiddenInModeValue(ContentContext ctx, int mode)
boolean
isInline()
check if the component can be inserd inline.boolean
isInsertable()
you can insert a text in this componentboolean
isList(ContentContext ctx)
true if the component is in a listboolean
isListable()
you display the composant as a list (if you want)boolean
isMetaTitle()
return true is this component is a title of a group of component.boolean
isMirroredByDefault(ContentContext ctx)
if this component is duplicated, by default it is mirrored.static boolean
isMirrorWrapped(ContentContext ctx, IContentVisualComponent comp)
boolean
isModify()
protected boolean
isNeedDelete(ContentContext ctx)
boolean
isNeedRefresh()
return true if the modifition of the component need a refresh of the edit page (ajax).protected boolean
isNeedRenderer()
return true if this component need renderer from template.boolean
isNew(ContentContext ctx)
check if this component has maked has new in the current requestboolean
isNextSame()
return true if the next component have the same type.boolean
isNextSame(ContentContext ctx)
boolean
isNolink()
boolean
isNoLinkable()
protected boolean
isOpenRow(ContentContext ctx)
boolean
isPreviousSame()
return true if the previous component have the same type.boolean
isPreviousSame(ContentContext ctx)
boolean
isRealContent(ContentContext ctx)
return true if component is considered as realContent and the page that contain the component is also considered as real content.boolean
isRepeat()
boolean
isRepeatable()
boolean
isRestMatch(ContentContext ctx, Map<String,String> params)
boolean
isReversedLink(ContentContext ctx)
protected boolean
isStyleHidden(ContentContext ctx)
boolean
isUnique()
return true if the component must be unique on a pageboolean
isValueProperties()
if content of the component is a list of properties (key=value) this method must return true.protected boolean
isValueTranslatable()
protected boolean
isViewDataFile(ContentContext ctx)
boolean
isVisible()
boolean
isVisible(ContentContext ctx)
check if this element is visible in the format.boolean
isVisibleFromCookies(ContentContext ctx)
visible or no, depend of the choice of visitor with cookiesprotected boolean
isWrapped(ContentContext ctx)
protected boolean
isXML()
void
loadViewData(ContentContext ctx)
load special data file.void
markAsNew(ContentContext ctx)
mark component as new in the current requestIContentVisualComponent
newInstance(ComponentBean bean, ContentContext newCtx, MenuElement page)
init the component, do that before all using.IContentVisualComponent
next()
get the next component on the page. if null this is the last component.protected void
onStyleChange(ContentContext ctx)
protected void
performColumnable(ContentContext ctx)
String
performConfig(ContentContext ctx)
action to manage the config, call when global content form is saved.String
performEdit(ContentContext ctx)
action call when update the content page.void
performUpdate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
void
prepareEdit(ContentContext ctx)
void
prepareView(ContentContext ctx)
prepare the rendering of a component. default attributes put in request : style, value, type, compidIContentVisualComponent
previous()
get the next component on the page. if null this is the last component.protected String
processView(ContentContext ctx)
prepare the rendering of the page.String
renderOtherComponent(ContentContext ctx, IContentVisualComponent comp)
protected String
renderViewXHTMLCode(ContentContext ctx)
void
replaceAllInContent(Map<String,String> replacement)
add a list of remplacement key, valuevoid
replaceInContent(String source, String target)
replace a content in visual elementvoid
resetContentCache(ContentContext ctx)
void
resetViewData(ContentContext ctx)
reset the view data.void
setBackgroundColor(String bgcol)
void
setColumnSize(int size)
set the size of the column, the column contains the componentvoid
setColumnStyle(String style)
void
setComponentBean(ComponentBean componentBean)
void
setContainerPage(ContentContext ctx, MenuElement page)
set the page of a container (page mirror, component mirror).void
setContentCache(ContentContext ctx, String contentCache)
void
setContentTimeCache(ContentContext ctx, String contentCache)
void
setDisplayHidden(boolean hidden)
hide component in display modeprotected static void
setForcedId(ContentContext ctx, String id)
protected void
setForcedRenderer(ContentContext ctx, String renderer)
void
setGroup(String group)
void
setHidden(boolean hidden)
void
setHiddenInMode(int mode, boolean hidden)
void
setList(boolean inList)
put the component is a listvoid
setLocalMessage(GenericMessage localMessage)
void
setMessage(GenericMessage inMsg)
static void
setMirrorWrapped(ContentContext ctx, IContentVisualComponent comp, MirrorComponent mirror)
void
setModify()
void
setNeedRefresh(boolean needRefresh)
if you set true the page is refresh after updatevoid
setNextComponent(IContentVisualComponent nextComponent)
change the previous componentvoid
setNolink(boolean noLink)
void
setPage(MenuElement inPage)
void
setPreviousComponent(IContentVisualComponent previousComponent)
change the previous componentvoid
setRenderer(ContentContext ctx, String renderer)
set the current renderer for the component view.void
setRepeat(boolean newRepeat)
void
setStyle(ContentContext ctx, String inStyle)
set the current style of the component.void
setTextColor(String textcol)
void
setTextPosition(String textPos)
void
setValid(boolean inVisible)
void
setValue(String inContent)
set the content without renderingvoid
setWidth(String width)
void
stored()
call this method when the component is stored.void
storeViewData(ContentContext ctx)
Reader
stringToReader(String str)
Reader
stringToReader(String str, String encoding)
InputStream
stringToStream(String str)
String
textToXHTML(String text)
Deprecated.use XHTMLHelper.textToXHTML(String text)String
toString()
boolean
transflateFrom(ContentContext ctx, ITranslator translator, String lang)
translate the content of the component to the current languageprotected void
updateCache()
-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.javlo.component.core.IContentVisualComponent
getType
-
-
-
-
Field Detail
-
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:IContentVisualComponent
get the group of the component (meta, text, links, media,...)- Specified by:
getGroup
in interfaceIContentVisualComponent
- Returns:
-
setGroup
public void setGroup(String group)
- Specified by:
setGroup
in 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:IContentVisualComponent
clear remplacement values- Specified by:
clearReplacement
in interfaceIContentVisualComponent
-
clone
protected Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
- See Also:
Object.clone()
-
countLine
protected int countLine()
-
delete
public void delete(ContentContext ctx)
Description copied from interface:IContentVisualComponent
this method is called when component is deleted.- Specified by:
delete
in interfaceIContentVisualComponent
-
getFileDirectory
public String getFileDirectory(ContentContext ctx)
-
cleanResources
public boolean cleanResources(ContentContext ctx)
Description copied from interface:IContentVisualComponent
clean resources. By default remove import folder- Specified by:
cleanResources
in interfaceIContentVisualComponent
- Returns:
-
executeJSP
protected String executeJSP(ContentContext ctx, String jsp) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletException
IOException
-
executeRenderer
protected String executeRenderer(ContentContext ctx) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletException
IOException
-
getArea
public String getArea()
Description copied from interface:IContentVisualComponent
get the area where the component must be rendered- Specified by:
getArea
in 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:
getReferenceComponent
in interfaceIContentVisualComponent
- Throws:
Exception
-
isHelpURL
public boolean isHelpURL(ContentContext ctx)
- Specified by:
isHelpURL
in interfaceIContentVisualComponent
-
getComplexityLevel
public int getComplexityLevel(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return the complexity level of the component.- Specified by:
getComplexityLevel
in interfaceIContentVisualComponent
- Parameters:
ctx
- TODO- Returns:
- see contant
-
getComponentBean
public ComponentBean getComponentBean()
Description copied from interface:IContentVisualComponent
get the internal data- Specified by:
getComponentBean
in interfaceIContentVisualComponent
- Returns:
-
getComponentCSS
protected String getComponentCSS(javax.servlet.ServletContext application, String css) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletException
IOException
-
getComponentLabel
public String getComponentLabel(ContentContext ctx, String lg)
Description copied from interface:IContentVisualComponent
return the label of the element.- Specified by:
getComponentLabel
in interfaceIContentVisualComponent
lg
- 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:IContentVisualComponent
get the configuration of the component. from project or from template.- Specified by:
getConfig
in interfaceIContentVisualComponent
- Returns:
-
getContentTimeCache
public String getContentTimeCache(ContentContext ctx)
-
getContentName
public String getContentName()
get the XHTML input field name for the content- Specified by:
getContentName
in 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:
getCurrentRenderer
in interfaceIContentVisualComponent
- Returns:
-
extractFieldsFromRenderer
public List<String> extractFieldsFromRenderer(ContentContext ctx) throws IOException
Description copied from interface:IContentVisualComponent
extract field define in the current renderer- Specified by:
extractFieldsFromRenderer
in 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:IContentVisualComponent
contributor can select size of column to wrap component- Specified by:
isColumnable
in interfaceIContentVisualComponent
- Returns:
- 0:auto -1:undefined
-
getColumnableDefaultValue
protected boolean getColumnableDefaultValue()
-
getColumnSize
public int getColumnSize(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get the size of the column, the column contains the component- Specified by:
getColumnSize
in interfaceIContentVisualComponent
- Returns:
-
getColumnStyle
public String getColumnStyle(ContentContext ctx)
- Specified by:
getColumnStyle
in interfaceIContentVisualComponent
-
setColumnSize
public void setColumnSize(int size)
Description copied from interface:IContentVisualComponent
set the size of the column, the column contains the component- Specified by:
setColumnSize
in 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:IContentVisualComponent
get a internationalized text, in the languague of the edition.- Specified by:
getEditText
in interfaceIContentVisualComponent
key
- 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:IContentVisualComponent
xhtml code for config the component- Specified by:
getXHTMLConfig
in interfaceIContentVisualComponent
- Returns:
- Throws:
Exception
-
isHiddable
protected boolean isHiddable()
-
isConfig
public boolean isConfig(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return true if there the component is configurable.- Specified by:
isConfig
in interfaceIContentVisualComponent
- Returns:
-
performConfig
public String performConfig(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponent
action to manage the config, call when global content form is saved.- Specified by:
performConfig
in 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:IContentVisualComponent
display empty xhtml code if empty- Specified by:
isDispayEmptyXHTMLCode
in interfaceIContentVisualComponent
- Returns:
- Throws:
Exception
-
getErrorMessage
public String getErrorMessage(String fieldName) throws ResourceNotFoundException
Description copied from interface:IContentVisualComponent
return a error message in current view language- Specified by:
getErrorMessage
in interfaceIContentVisualComponent
- Returns:
- a error message in current view language
- Throws:
ResourceNotFoundException
-
getExternalResources
public Collection<String> getExternalResources(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return the external resources needed from component as css, javascript...- Specified by:
getExternalResources
in interfaceIContentVisualComponent
- Returns:
-
getExternalModules
public Collection<String> getExternalModules(ContentContext ctx)
- Specified by:
getExternalModules
in interfaceIContentVisualComponent
-
getFirstPrefix
public String getFirstPrefix(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get 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:
getFirstPrefix
in 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:IContentVisualComponent
return the part of header needed for this component- Specified by:
getHeaderContent
in interfaceIContentVisualComponent
- Returns:
-
getHelpText
public String getHelpText(ContentContext ctx) throws IOException
- Specified by:
getHelpText
in interfaceIContentVisualComponent
- Throws:
IOException
-
getHelpURL
public final String getHelpURL(ContentContext ctx)
Description copied from interface:IContentVisualComponent
a url to descripe the usage of the component- Specified by:
getHelpURL
in 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:IContentVisualComponent
get the exadecimal color for representation of the component.- Specified by:
getHexColor
in interfaceIContentVisualComponent
- Returns:
- a exadecimal color (sample : a5b499)
-
getI18nEditableKeys
public List<String> getI18nEditableKeys(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get i18n keys for edition- Specified by:
getI18nEditableKeys
in interfaceIContentVisualComponent
- Returns:
- a list of i18n keys.
-
getId
public final String getId()
Description copied from interface:IContentVisualComponent
return a unique id for the coponent- Specified by:
getId
in interfaceIContentVisualComponent
- See Also:
org.javlo.itf.IContentVisualComponent#getContentLanguage()
-
getInputNameRenderer
public String getInputNameRenderer()
Description copied from interface:IContentVisualComponent
get the input name of the renderer.- Specified by:
getInputNameRenderer
in interfaceIContentVisualComponent
- Returns:
-
getInputNameRendererTitle
public String getInputNameRendererTitle()
-
getItalicAndStrongLanguageMarkerList
public List<SuffixPrefix> getItalicAndStrongLanguageMarkerList(ContentContext ctx)
-
getJSOnSubmit
public String getJSOnSubmit()
Description copied from interface:IContentVisualComponent
return the java script code called when global form is submited.- Specified by:
getJSOnSubmit
in interfaceIContentVisualComponent
- Returns:
- java script code.
-
getKey
public String getKey()
Description copied from interface:IContentVisualComponent
get a unic key of the component. User special for DynamicComponent.- Specified by:
getKey
in interfaceIContentVisualComponent
-
getLastSufix
public String getLastSufix(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get the sufix before must be insered after a list of the current component.- Specified by:
getLastSufix
in interfaceIContentVisualComponent
- Returns:
- XHTML code of sufix.
-
getMarkerList
public List<SuffixPrefix> getMarkerList(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return the title of the style choice.- Specified by:
getMarkerList
in interfaceIContentVisualComponent
-
getMessage
public GenericMessage getMessage()
Description copied from interface:IContentVisualComponent
get a message for the component.- Specified by:
getMessage
in 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:IContentVisualComponent
return the next component in the page sequence.- Specified by:
getNextComponent
in interfaceIContentVisualComponent
- Returns:
-
getPage
public MenuElement getPage()
Description copied from interface:IContentVisualComponent
get the page contains the component- Specified by:
getPage
in interfaceIContentVisualComponent
- Returns:
- a page of the navigation
-
setContainerPage
public void setContainerPage(ContentContext ctx, MenuElement page)
Description copied from interface:IContentVisualComponent
set the page of a container (page mirror, component mirror).- Specified by:
setContainerPage
in 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:IContentVisualComponent
code for prefix the view XHTML code.- Specified by:
getPrefixViewXHTMLCode
in interfaceIContentVisualComponent
- Returns:
- XHTML code.
-
getSuffixViewXHTMLCode
public String getSuffixViewXHTMLCode(ContentContext ctx)
Description copied from interface:IContentVisualComponent
code for sufix the view XHTML code.- Specified by:
getSuffixViewXHTMLCode
in interfaceIContentVisualComponent
- 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:IContentVisualComponent
return the previous component in the page sequence.- Specified by:
getPreviousComponent
in 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:
getRenderer
in interfaceIContentVisualComponent
-
getRendererTitle
protected String getRendererTitle()
-
getSearchLevel
public int getSearchLevel()
Description copied from interface:IContentVisualComponent
return the level of the component is a search.- Specified by:
getSearchLevel
in interfaceIContentVisualComponent
- Returns:
- 1-LOW 2-MIDDLE 3-HIGH
-
getSelectRendererXHTML
protected String getSelectRendererXHTML(ContentContext ctx, boolean justDisplay) throws Exception, IOException
- Throws:
Exception
IOException
-
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:IContentVisualComponent
get the style of the display (sp. image-left, image-right)- Specified by:
getStyle
in interfaceIContentVisualComponent
- Returns:
-
getComponentCssClass
public final String getComponentCssClass(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get the current style of the component.- Specified by:
getComponentCssClass
in 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:IContentVisualComponent
get the label of the current style- Specified by:
getStyleLabel
in interfaceIContentVisualComponent
- Returns:
-
setRenderer
public void setRenderer(ContentContext ctx, String renderer)
Description copied from interface:IContentVisualComponent
set the current renderer for the component view.- Specified by:
setRenderer
in interfaceIContentVisualComponent
-
getStyleLabelList
public String[] getStyleLabelList(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return a list of label define the style.- Specified by:
getStyleLabelList
in interfaceIContentVisualComponent
- Returns:
- a list of label.
-
getStyleList
public String[] getStyleList(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get the list of style possible for this component.- Specified by:
getStyleList
in interfaceIContentVisualComponent
- Returns:
- a list of string represent a style.
-
getStyleTitle
public String getStyleTitle(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return the title of the style choice.- Specified by:
getStyleTitle
in interfaceIContentVisualComponent
-
getForcedSuffixViewXHTMLCode
protected String getForcedSuffixViewXHTMLCode(ContentContext ctx)
-
getTextForSearch
public String getTextForSearch(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return a text represent the content of the component. sample all the content :-)- Specified by:
getTextForSearch
in interfaceIContentVisualComponent
- Returns:
- a text represent the content of the component for the search module
-
getTextLabel
public String getTextLabel(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return a string representation of the component- Specified by:
getTextLabel
in interfaceIContentVisualComponent
-
getTextTitle
public String getTextTitle(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return a string representation of the component with complete title- Specified by:
getTextTitle
in interfaceIContentVisualComponent
- Returns:
-
getTitleLevel
public int getTitleLevel(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get the level of the title (1,2,3...). return 0 if the component is not a title- Specified by:
getTitleLevel
in 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:IContentVisualComponent
get the value of the content without any rendering.- Specified by:
getValue
in 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:IContentVisualComponent
get a internationalized text, in the languague of the view.- Specified by:
getViewText
in interfaceIContentVisualComponent
key
- 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.ServletException
IOException
-
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.ServletException
IOException
-
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:IContentVisualComponent
count the word in the content.- Specified by:
getWordCount
in interfaceIContentVisualComponent
- Returns:
-
getXHTMLCode
public String getXHTMLCode(ContentContext ctx)
Description copied from interface:IContentVisualComponent
the code for view the element in XHTML environment.- Specified by:
getXHTMLCode
in 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:
prepareView
in interfaceIContentVisualComponent
- Parameters:
ctx
-- Throws:
Exception
-
includeComponentJSP
protected void includeComponentJSP(ContentContext ctx, String jsp) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletException
IOException
-
getDisplayAsInputName
protected String getDisplayAsInputName()
-
includePage
protected void includePage(ContentContext ctx, String jsp) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletException
IOException
-
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:IContentVisualComponent
force a init.- Specified by:
forceInit
in interfaceIContentVisualComponent
- Throws:
Exception
-
insert
public void insert(String text)
insert a text in the component- Specified by:
insert
in interfaceIContentVisualComponent
- Parameters:
text
- the text to be insered
-
isContentCachable
public boolean isContentCachable(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return the part of header needed for this component- Specified by:
isContentCachable
in interfaceIContentVisualComponent
- Returns:
-
isContentCachableByQuery
public boolean isContentCachableByQuery(ContentContext ctx)
-
isContentTimeCachable
public boolean isContentTimeCachable(ContentContext ctx)
-
isDefaultValue
public boolean isDefaultValue(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return true if value is never modified.- Specified by:
isDefaultValue
in 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:IContentVisualComponent
return true if component is in the first repeat sequence of the page.- Specified by:
isFirstRepeated
in interfaceIContentVisualComponent
- Returns:
-
isHidden
public boolean isHidden(ContentContext ctx)
Description copied from interface:IContentVisualComponent
true if component marked as hidden (in components.txt the class name start with '.')- Specified by:
isHidden
in interfaceIContentVisualComponent
- Returns:
-
isInline
public boolean isInline()
Description copied from interface:IContentVisualComponent
check if the component can be inserd inline.- Specified by:
isInline
in 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:
isInsertable
in interfaceIContentVisualComponent
- Returns:
- true if a text is insertable
-
getLabelLevel
public int getLabelLevel(ContentContext ctx)
Description copied from interface:IContentVisualComponent
define the level of label. If there area most than 1 level on page, the label of the page is the bigger level.- Specified by:
getLabelLevel
in interfaceIContentVisualComponent
- Returns:
- 0=default, no the components is'nt label.
-
isList
public boolean isList(ContentContext ctx)
Description copied from interface:IContentVisualComponent
true if the component is in a list- Specified by:
isList
in 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:IContentVisualComponent
you display the composant as a list (if you want)- Specified by:
isListable
in interfaceIContentVisualComponent
- Returns:
- true if a text is listable
-
isModify
public boolean isModify()
- Specified by:
isModify
in interfaceIContentVisualComponent
- Returns:
- true if the composant was modified.
- See Also:
org.javlo.itf.IContentVisualComponent#isModify()
-
isNeedRefresh
public boolean isNeedRefresh()
Description copied from interface:IContentVisualComponent
return true if the modifition of the component need a refresh of the edit page (ajax).- Specified by:
isNeedRefresh
in interfaceIContentVisualComponent
-
isRealContent
public boolean isRealContent(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return true if component is considered as realContent and the page that contain the component is also considered as real content.- Specified by:
isRealContent
in interfaceIContentVisualComponent
- Parameters:
ctx
- current context- Returns:
-
isRepeat
public boolean isRepeat()
- Specified by:
isRepeat
in interfaceIContentVisualComponent
- Returns:
- Returns the repeat.
-
isNolink
public boolean isNolink()
- Specified by:
isNolink
in interfaceIContentVisualComponent
-
isRepeatable
public boolean isRepeatable()
- Specified by:
isRepeatable
in interfaceIContentVisualComponent
-
isNoLinkable
public boolean isNoLinkable()
-
isUnique
public boolean isUnique()
Description copied from interface:IContentVisualComponent
return true if the component must be unique on a page- Specified by:
isUnique
in interfaceIContentVisualComponent
- Returns:
-
isViewDataFile
protected boolean isViewDataFile(ContentContext ctx) throws IOException
- Throws:
IOException
-
isVisible
public boolean isVisible()
- Specified by:
isVisible
in interfaceIContentVisualComponent
-
isVisible
public boolean isVisible(ContentContext ctx)
Description copied from interface:IContentVisualComponent
check if this element is visible in the format.- Specified by:
isVisible
in interfaceIContentVisualComponent
- Returns:
- true if elment visible, false else
-
isVisibleFromCookies
public boolean isVisibleFromCookies(ContentContext ctx)
Description copied from interface:IContentVisualComponent
visible or no, depend of the choice of visitor with cookies- Specified by:
isVisibleFromCookies
in interfaceIContentVisualComponent
- Returns:
-
loadViewData
public void loadViewData(ContentContext ctx) throws IOException
Description copied from interface:IContentVisualComponent
load special data file.- Specified by:
loadViewData
in interfaceIContentVisualComponent
- Throws:
IOException
-
newInstance
public IContentVisualComponent newInstance(ComponentBean bean, ContentContext newCtx, MenuElement page) throws Exception
Description copied from interface:IContentVisualComponent
init the component, do that before all using.- Specified by:
newInstance
in interfaceIContentVisualComponent
newCtx
- the context of the content manager.- Throws:
Exception
-
next
public IContentVisualComponent next()
Description copied from interface:IContentVisualComponent
get the next component on the page. if null this is the last component.- Specified by:
next
in interfaceIContentVisualComponent
- Returns:
- a component.
-
onStyleChange
protected void onStyleChange(ContentContext ctx)
-
previous
public IContentVisualComponent previous()
Description copied from interface:IContentVisualComponent
get the next component on the page. if null this is the last component.- Specified by:
previous
in 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:IContentVisualComponent
action call when update the content page.- Specified by:
performEdit
in 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:IContentVisualComponent
add a list of remplacement key, value- Specified by:
replaceAllInContent
in interfaceIContentVisualComponent
-
replaceInContent
public void replaceInContent(String source, String target)
Description copied from interface:IContentVisualComponent
replace a content in visual element- Specified by:
replaceInContent
in 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:IContentVisualComponent
reset the view data.- Specified by:
resetViewData
in 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:IContentVisualComponent
put the component is a list- Specified by:
setList
in 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:IContentVisualComponent
hide component in display mode- Specified by:
setDisplayHidden
in interfaceIContentVisualComponent
-
isDisplayHidden
public boolean isDisplayHidden()
Description copied from interface:IContentVisualComponent
is component displayed for visitor- Specified by:
isDisplayHidden
in 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:IContentVisualComponent
if you set true the page is refresh after update- Specified by:
setNeedRefresh
in interfaceIContentVisualComponent
-
setNextComponent
public void setNextComponent(IContentVisualComponent nextComponent)
Description copied from interface:IContentVisualComponent
change the previous component- Specified by:
setNextComponent
in interfaceIContentVisualComponent
-
setPage
public void setPage(MenuElement inPage)
- Specified by:
setPage
in interfaceIContentVisualComponent
-
setPreviousComponent
public void setPreviousComponent(IContentVisualComponent previousComponent)
Description copied from interface:IContentVisualComponent
change the previous component- Specified by:
setPreviousComponent
in interfaceIContentVisualComponent
-
setRepeat
public void setRepeat(boolean newRepeat)
- Specified by:
setRepeat
in interfaceIContentVisualComponent
-
setNolink
public void setNolink(boolean noLink)
-
setStyle
public void setStyle(ContentContext ctx, String inStyle)
Description copied from interface:IContentVisualComponent
set the current style of the component.- Specified by:
setStyle
in interfaceIContentVisualComponent
inStyle
- new style
-
setValid
public void setValid(boolean inVisible)
- Specified by:
setValid
in interfaceIContentVisualComponent
-
setValue
public void setValue(String inContent)
Description copied from interface:IContentVisualComponent
set the content without rendering- Specified by:
setValue
in interfaceIContentVisualComponent
-
stored
public void stored()
Description copied from interface:IContentVisualComponent
call this method when the component is stored.- Specified by:
stored
in 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:IContentVisualComponent
return true is this component is a title of a group of component.- Specified by:
isMetaTitle
in interfaceIContentVisualComponent
- Returns:
-
getClassName
public String getClassName()
Description copied from interface:IContentVisualComponent
return the name of the class (use for JSTL)- Specified by:
getClassName
in 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:IContentVisualComponent
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- Specified by:
getVersion
in interfaceIContentVisualComponent
- Returns:
- ? if version undefined.
-
getDescription
public String getDescription(Locale local)
Description copied from interface:IContentVisualComponent
a description of the component;- Specified by:
getDescription
in interfaceIContentVisualComponent
- Returns:
-
getAuthors
public String getAuthors()
Description copied from interface:IContentVisualComponent
authors of the component- Specified by:
getAuthors
in interfaceIContentVisualComponent
- Returns:
-
initContent
public boolean initContent(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponent
init the content with a default value. sample : "lorem ipsum" for text component.- Specified by:
initContent
in interfaceIContentVisualComponent
- Returns:
- true if content is create.
- Throws:
Exception
-
getCreationDate
public Date getCreationDate()
- Specified by:
getCreationDate
in interfaceIContentVisualComponent
-
getModificationDate
public Date getModificationDate()
- Specified by:
getModificationDate
in interfaceIContentVisualComponent
-
isHiddenInMode
public boolean isHiddenInMode(ContentContext ctx, int mode, Boolean mobile)
Description copied from interface:IContentVisualComponent
component can be hidded in some mode, like view or preview.- Specified by:
isHiddenInMode
in interfaceIContentVisualComponent
mode
- 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:
getSpecialTagTitle
in interfaceIContentVisualComponent
- Throws:
Exception
-
getSpecialTagXHTML
public String getSpecialTagXHTML(ContentContext ctx) throws Exception
- Specified by:
getSpecialTagXHTML
in 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:
compareTo
in interfaceComparable<IContentVisualComponent>
-
getLayout
public ComponentLayout getLayout()
Description copied from interface:IContentVisualComponent
get a simple layout for the component.- Specified by:
getLayout
in interfaceIContentVisualComponent
- Returns:
-
equals
public boolean equals(ContentContext ctx, IContentVisualComponent comp)
Description copied from interface:IContentVisualComponent
check of component is considered as the same than an other.- Specified by:
equals
in interfaceIContentVisualComponent
- Returns:
-
getEmptyXHTMLCode
public String getEmptyXHTMLCode(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponent
return the code if component contain's no data.- Specified by:
getEmptyXHTMLCode
in interfaceIContentVisualComponent
- Throws:
Exception
-
getPageDescription
public String getPageDescription(ContentContext ctx)
Description copied from interface:IContentVisualComponent
return the description of the page if this component is or contains description.- Specified by:
getPageDescription
in interfaceIContentVisualComponent
- Returns:
-
getListGroup
public String getListGroup()
Description copied from interface:IContentVisualComponent
return the name of group component.- Specified by:
getListGroup
in interfaceIContentVisualComponent
- Returns:
-
isReversedLink
public boolean isReversedLink(ContentContext ctx)
-
getContentMessage
public GenericMessage getContentMessage(ContentContext ctx)
Description copied from interface:IContentVisualComponent
warning message on content tab- Specified by:
getContentMessage
in interfaceIContentVisualComponent
- Returns:
-
getTextMessage
public GenericMessage getTextMessage(ContentContext ctx)
Description copied from interface:IContentVisualComponent
warning message on text tab- Specified by:
getTextMessage
in interfaceIContentVisualComponent
- Returns:
-
getConfigMessage
public GenericMessage getConfigMessage(ContentContext ctx)
Description copied from interface:IContentVisualComponent
warning message on config tab- Specified by:
getConfigMessage
in interfaceIContentVisualComponent
- Returns:
-
markAsNew
public void markAsNew(ContentContext ctx)
mark component as new in the current request- Specified by:
markAsNew
in interfaceIContentVisualComponent
- Parameters:
ctx
-
-
isNew
public boolean isNew(ContentContext ctx)
check if this component has maked has new in the current request- Specified by:
isNew
in interfaceIContentVisualComponent
- Parameters:
ctx
-- Returns:
-
isEditOnCreate
public boolean isEditOnCreate(ContentContext ctx)
return true if the component is directly edited when it is insered.- Specified by:
isEditOnCreate
in interfaceIContentVisualComponent
- Parameters:
ctx
-- Returns:
-
getContentAsMap
public Map<String,Object> getContentAsMap(ContentContext ctx) throws Exception
- Specified by:
getContentAsMap
in 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:IContentVisualComponent
if this component is duplicated, by default it is mirrored.- Specified by:
isMirroredByDefault
in interfaceIContentVisualComponent
- Returns:
-
getContentAsText
public String getContentAsText(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get the text of the component- Specified by:
getContentAsText
in 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:IContentVisualComponent
return error message on structure of the component.- Specified by:
getErrorMessage
in interfaceIContentVisualComponent
- Returns:
- null if no errors found
-
isDisplayable
public boolean isDisplayable(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponent
true if the component can be displayed in preview mode- Specified by:
isDisplayable
in interfaceIContentVisualComponent
- Returns:
- Throws:
Exception
-
isRestMatch
public boolean isRestMatch(ContentContext ctx, Map<String,String> params)
- Specified by:
isRestMatch
in interfaceIContentVisualComponent
-
getFontAwesome
public String getFontAwesome()
- Specified by:
getFontAwesome
in interfaceIContentVisualComponent
-
getIcon
public String getIcon()
- Specified by:
getIcon
in 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:IContentVisualComponent
translate the content of the component to the current language- Specified by:
transflateFrom
in 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:IContentVisualComponent
transform the value of the component in a config properties file. If key not found a entry is created in the content.- Specified by:
getConfigInValue
in 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)
-
-