Package org.javlo.component.links
Class PageReferenceComponent
- java.lang.Object
-
- org.javlo.component.core.AbstractVisualComponent
-
- org.javlo.component.core.ComplexPropertiesLink
-
- org.javlo.component.links.PageReferenceComponent
-
- All Implemented Interfaces:
Comparable<IContentVisualComponent>,IAction,IContentVisualComponent,IRestItem,ITaxonomyContainer
public class PageReferenceComponent extends ComplexPropertiesLink implements IAction, ITaxonomyContainer
list of links to a subset of pages.exposed variable :
- inherited from
AbstractVisualComponent PageBeanpages : list of pages selected to display.Stringtitle : title of the page list. SeegetContentTitle()PageReferenceComponentcomp : current component.StringfirstPage : first page rendered in xHTML.
- Author:
- pvandermaesen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPageReferenceComponent.PageEventstatic classPageReferenceComponent.PagesStatus
-
Field Summary
Fields Modifier and Type Field Description static StringMOUNT_FORMATstatic StringTYPE-
Fields inherited from class org.javlo.component.core.ComplexPropertiesLink
HEADER_V1_0, LABEL_KEY, LINK_KEY, properties, REVERSE_LINK_KEY
-
Fields inherited from class org.javlo.component.core.AbstractVisualComponent
CACHE_KEY_SUFFIX_PARAM_NAME, COMPONENT_KEY, config, EDIT_CLASS, FLUID_COL_SIZE, FORCE_COMPONENT_ID, HIDDEN, I18N_FILE, MAX_COL_VALUE, MOBILE_TYPE, NOT_EDIT_PREVIEW_PARAM_NAME, SCROLL_TO_COMP_ID_ATTRIBUTE_NAME, TIME_CACHE_NAME, VALUE_SEPARATOR
-
Fields inherited from interface org.javlo.component.core.IContentVisualComponent
COLORED_WRAPPER_CLASS, COMP_ID_REQUEST_PARAM, COMPLEXITY_ADMIN, COMPLEXITY_EASY, COMPLEXITY_STANDARD, CONTAINER_COLOR, DEFAULT_COLOR, DYN_COMP_COLOR, ECOM_COLOR, EDIT_ACTION_CSS_CLASS, GRAPHIC_COLOR, HIGH_LABEL_LEVEL, ID_SEPARATOR, LINK_COLOR, LOW_LABEL_LEVEL, META_COLOR, MIDDLE_LABEL_LEVEL, SEARCH_LEVEL_HIGH, SEARCH_LEVEL_LOW, SEARCH_LEVEL_MIDDLE, SEARCH_LEVEL_NONE, TEXT_COLOR, VIEW_DEFINITION_REQUEST_ID, WEB2_COLOR
-
-
Constructor Summary
Constructors Constructor Description PageReferenceComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanfilterPage(ContentContext ctx, MenuElement page, Collection<MenuElement> currentSelection, Collection<String> commands, String filter, boolean widthUnactive)filter the pageStringgetActionGroupName()the group name of the actionprotected booleangetColumnableDefaultValue()protected StringgetCompInputName()intgetComplexityLevel(ContentContext ctx)return the complexity level of the component.ComponentConfiggetConfig(ContentContext ctx)get the configuration of the component. from project or from template.StringgetContentAsText(ContentContext ctx)get the text of the componentStringgetCSSClassName(ContentContext ctx)static IntegergetCurrentMonth(javax.servlet.http.HttpSession session)StringgetCurrentRenderer(ContentContext ctx)get current renderer keystatic IntegergetCurrentYear(javax.servlet.http.HttpSession session)protected StringgetDefaultSelectedInputName()protected StringgetDirectLinkInputName()protected StringgetDisplayAsInputName()protected StringgetDynamicOrderInput()StringgetEditXHTMLCode(ContentContext ctx)protected StringgetEventInputName()StringgetHexColor()get the exadecimal color for representation of the component.StringgetIcon()protected StringgetInputFirstPageFull()protected StringgetIntranetModeInputName()protected ObjectgetLock(ContentContext ctx)protected StringgetOnlyWithoutChildrenInputName()protected StringgetOrder()protected StringgetOrderInputName()protected StringgetPageDisplayedId(MenuElement page)protected StringgetPageId(MenuElement page)intgetPageSize(ContentContext ctx)protected StringgetParentNode(ContentContext ctx)protected StringgetParentNodeInputName()StringgetPrefixViewXHTMLCode(ContentContext ctx)code for prefix the view XHTML code.protected PageReferenceComponentgetRefComponent(ContentContext ctx)protected StringgetReverseOrderInput()intgetSearchLevel()return the level of the component is a search.protected List<MenuElement>getSelectedPages(ContentContext ctx, List<MenuElement> children)protected Collection<String>getSelectedTag(ContentContext ctx)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 StringgetTagsInputName()Set<String>getTaxonomy()protected StringgetTimeSelectionInputName(String option)StringgetType()return the type of the element.protected StringgetWidthEmptyPageInputName()voidinit(ComponentBean bean, ContentContext newContext)booleaninitContent(ContentContext ctx)init the content with a default value. sample : "lorem ipsum" for text component.booleanisContentCachable(ContentContext ctx)return the part of header needed for this componentbooleanisContentCachableByQuery(ContentContext ctx)booleanisContentTimeCachable(ContentContext ctx)protected booleanisDateRangeSelection(ContentContext ctx)booleanisDisplayable(ContentContext ctx)true if the component can be displayed in preview modebooleanisDisplayDate()protected booleanisDisplayFirstPage()protected booleanisInteractive()booleanisMirroredByDefault(ContentContext ctx)if this component is duplicated, by default it is mirrored.booleanisPopup()booleanisRealContent(ContentContext ctx)return true if component is considered as realContent and the page that contain the component is also considered as real content.protected booleanisRedisplay(ContentContext ctx)booleanisRefDefaultLang()protected booleanisReverseOrder(ContentContext ctx)protected booleanisSessionTaxonomy(ContentContext ctx)protected booleanisUIFilterOnEditUsers(ContentContext ctx)protected booleanisUIFullDisplayFirstPage(ContentContext ctx)protected booleanisUILargeSorting(ContentContext ctx)protected booleanisUITimeSelection(ContentContext ctx)static voidmain(String[] args)static StringperformCalendar(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)StringperformEdit(ContentContext ctx)action call when update the content page.static StringperformPages(ContentContext ctx)voidprepareView(ContentContext ctx)prepare the rendering of a component. default attributes put in request : style, value, type, compidstatic voidsetCurrentMonth(javax.servlet.http.HttpSession session, int currentMonth)static voidsetCurrentYear(javax.servlet.http.HttpSession session, int currentYear)protected voidsetDisplayFirstPage(boolean value)protected voidsetDynamicOrder(boolean dynamicOrder)protected voidsetEventOnly(boolean onlyEvent)protected voidsetIntranetMode(boolean mode)protected voidsetOrder(String order)protected voidsetParentNode(String node)protected voidsetRefDefaultLanguage(boolean onlyEvent)protected voidsetReverseOrder(boolean reverseOrder)protected voidsetSessionTaxonomy(boolean sessionTaxo)protected voidsetTag(String tag)-
Methods inherited from class org.javlo.component.core.ComplexPropertiesLink
equals, getField, getField, getFontAwesome, getLinkLabelName, getLinkName, init, isValueTranslatable, reloadProperties, setField, setValue, storeProperties, transflateFrom
-
Methods inherited from class org.javlo.component.core.AbstractVisualComponent
applyReplacement, cleanResources, cleanValue, clearReplacement, clone, compareTo, contructViewStyle, countLine, delete, deleteMySelf, drawColumn, equals, executeCurrentRenderer, executeJSP, executeRenderer, executeRenderer, extractFieldsFromRenderer, forceInit, getAjaxId, getArea, getAuthors, getBackgroundColor, getBaseHelpURL, getClassName, getColomnablePrefix, getColomnableSuffix, getColumn, getColumnMaxSize, getColumnSize, getColumnSizes, getColumnStyle, getComponentBean, getComponentCSS, getComponentCssClass, getComponentId, getComponentLabel, getComponentPath, getConfigInValue, getConfigMessage, getContainerPage, getContentAsMap, getContentCache, getContentMessage, getContentName, getContentTimeCache, getCookiesDisplayStatus, getCreationDate, getCSSStyle, getCurrentPage, getDataAttributes, getDebugHeader, getDefaultHelpURI, getDefaultRenderer, getDeleteDate, getDescription, getDisplayMessage, getEditorComplexity, getEditRenderer, getEditText, getEmptyCode, getEmptyXHTMLCode, getErrorMessage, getErrorMessage, getExternalModules, getExternalResources, getFileDirectory, getFirstPrefix, getForcedId, getForcedPrefixViewXHTMLCode, getForcedRenderer, getForcedSuffixViewXHTMLCode, getFormName, getGroup, getHeaderContent, getHelpText, getHelpType, getHelpURI, getHelpURL, getI18nEditableKeys, getId, getImportFolderPath, getImportFolderPath, getInlineStyle, getInputName, getInputNameColomn, getInputNameColomnStyle, getInputNameRenderer, getInputNameRendererTitle, getItalicAndStrongLanguageMarkerList, getJSOnSubmit, getKey, getLabelLevel, getLastSufix, getLayout, getListClass, getListGroup, getListItemTag, getListTag, getLocalMessage, getManualCssClass, getMarkerList, getMessage, getMirrorWrapper, getModificationDate, getNextComponent, getPage, getPageDescription, getPrefixCssClass, getPreviewAttributes, getPreviewCssClass, getPreviewCssId, getPreviousComponent, getQuotationLanguageMarkerList, getReferenceComponent, getRemplacement, getRenderer, getRendererTitle, getRenderes, getRequestComponent, getSelectRendererXHTML, getSpecialInputTag, getSpecialPreviewCssId, getSpecialTagTitle, getSpecialTagXHTML, getSpecificClass, getSpecificCssClass, getStyle, getStyleLabel, getStyleLabelList, getTag, getTextColor, getTextForSearch, getTextLabel, getTextMessage, getTextPosition, getTextTitle, getTitleLevel, getTypeInputName, getValue, getValue, getVersion, getViewData, getViewDataFile, getViewID, getViewText, getViewXHTMLCode, getWidth, getWordCount, getXHTMLCode, getXHTMLConfig, haveRight, includeComponentJSP, includePage, insert, isAjaxWrapper, isAskWidth, isAutoDeletable, isAutoRenderer, isBackgroundColored, isCanAddClass, isCloseRow, isColored, isColumnable, isConfig, isDefaultValue, isDispayEmptyXHTMLCode, isDisplayHidden, isEditOnCreate, isFirstElementOfRepeatSequence, isFirstRepeated, isFreeInputLayout, isHelpURL, isHiddable, isHidden, isHiddenInMode, isHiddenInModeValue, isInline, isInsertable, isList, isListable, isMetaTitle, isMirrorWrapped, isModify, isNeedDelete, isNeedRefresh, isNeedRenderer, isNew, isNextSame, isNextSame, isNolink, isNoLinkable, isOpenRow, isPreviousSame, isPreviousSame, isRepeat, isRepeatable, isRestMatch, isReversedLink, isStyleHidden, isUnique, isValueProperties, isViewDataFile, isVisible, isVisible, isVisibleFromCookies, isWrapped, isXML, loadViewData, markAsNew, newInstance, next, onStyleChange, performColumnable, performConfig, performUpdate, prepareEdit, previous, processView, renderOtherComponent, renderViewXHTMLCode, replaceAllInContent, replaceInContent, resetContentCache, resetViewData, setBackgroundColor, setColumnSize, setColumnStyle, setComponentBean, setContainerPage, setContentCache, setContentTimeCache, setDisplayHidden, setForcedId, setForcedRenderer, setGroup, setHidden, setHiddenInMode, setList, setLocalMessage, setMessage, setMirrorWrapped, setModify, setNeedRefresh, setNextComponent, setNolink, setPage, setPreviousComponent, setRenderer, setRepeat, setStyle, setTextColor, setTextPosition, setValid, setWidth, stored, storeViewData, stringToReader, stringToReader, stringToStream, textToXHTML, toString, updateCache
-
-
-
-
Field Detail
-
MOUNT_FORMAT
public static final String MOUNT_FORMAT
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCurrentMonth
public static final Integer getCurrentMonth(javax.servlet.http.HttpSession session)
-
getCurrentYear
public static final Integer getCurrentYear(javax.servlet.http.HttpSession session)
-
performCalendar
public static final String performCalendar(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
setCurrentMonth
public static final void setCurrentMonth(javax.servlet.http.HttpSession session, int currentMonth)
-
setCurrentYear
public static final void setCurrentYear(javax.servlet.http.HttpSession session, int currentYear)
-
filterPage
protected boolean filterPage(ContentContext ctx, MenuElement page, Collection<MenuElement> currentSelection, Collection<String> commands, String filter, boolean widthUnactive) throws Exception
filter the page- Parameters:
ctx- current contentcontextpage- a page- Returns:
- true if page is accepted
- Throws:
Exception
-
isInteractive
protected boolean isInteractive()
-
getCompInputName
protected String getCompInputName()
-
getComplexityLevel
public int getComplexityLevel(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn the complexity level of the component.- Specified by:
getComplexityLevelin interfaceIContentVisualComponent- Overrides:
getComplexityLevelin classAbstractVisualComponent- Parameters:
ctx- TODO- Returns:
- see contant
-
isPopup
public boolean isPopup()
-
isRefDefaultLang
public boolean isRefDefaultLang()
-
isDisplayDate
public boolean isDisplayDate()
-
getCSSClassName
public String getCSSClassName(ContentContext ctx)
-
getDefaultSelectedInputName
protected String getDefaultSelectedInputName()
-
getDisplayAsInputName
protected String getDisplayAsInputName()
- Overrides:
getDisplayAsInputNamein classAbstractVisualComponent
-
isUITimeSelection
protected boolean isUITimeSelection(ContentContext ctx)
-
isDateRangeSelection
protected boolean isDateRangeSelection(ContentContext ctx)
-
isUIFullDisplayFirstPage
protected boolean isUIFullDisplayFirstPage(ContentContext ctx)
-
isUIFilterOnEditUsers
protected boolean isUIFilterOnEditUsers(ContentContext ctx)
-
isUILargeSorting
protected boolean isUILargeSorting(ContentContext ctx)
-
getEditXHTMLCode
public String getEditXHTMLCode(ContentContext ctx) throws Exception
- Overrides:
getEditXHTMLCodein classAbstractVisualComponent- Throws:
Exception
-
getHexColor
public String getHexColor()
Description copied from interface:IContentVisualComponentget the exadecimal color for representation of the component.- Specified by:
getHexColorin interfaceIContentVisualComponent- Overrides:
getHexColorin classAbstractVisualComponent- Returns:
- a exadecimal color (sample : a5b499)
-
getOrder
protected String getOrder()
-
getOrderInputName
protected String getOrderInputName()
-
getDirectLinkInputName
protected String getDirectLinkInputName()
-
getPageId
protected String getPageId(MenuElement page)
-
getPageDisplayedId
protected String getPageDisplayedId(MenuElement page)
-
getSelectedPages
protected List<MenuElement> getSelectedPages(ContentContext ctx, List<MenuElement> children) throws Exception
- Throws:
Exception
-
getParentNode
protected String getParentNode(ContentContext ctx)
-
getParentNodeInputName
protected String getParentNodeInputName()
-
getPrefixViewXHTMLCode
public String getPrefixViewXHTMLCode(ContentContext ctx)
Description copied from interface:IContentVisualComponentcode for prefix the view XHTML code.- Specified by:
getPrefixViewXHTMLCodein interfaceIContentVisualComponent- Overrides:
getPrefixViewXHTMLCodein classAbstractVisualComponent- Returns:
- XHTML code.
-
getReverseOrderInput
protected String getReverseOrderInput()
-
getDynamicOrderInput
protected String getDynamicOrderInput()
-
getStyleList
public String[] getStyleList(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the list of style possible for this component.- Specified by:
getStyleListin interfaceIContentVisualComponent- Overrides:
getStyleListin classAbstractVisualComponent- 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- Overrides:
getStyleTitlein classAbstractVisualComponent
-
getSuffixViewXHTMLCode
public String getSuffixViewXHTMLCode(ContentContext ctx)
Description copied from interface:IContentVisualComponentcode for sufix the view XHTML code.- Specified by:
getSuffixViewXHTMLCodein interfaceIContentVisualComponent- Overrides:
getSuffixViewXHTMLCodein classAbstractVisualComponent- Returns:
- XHTML code.
-
getSelectedTag
protected Collection<String> getSelectedTag(ContentContext ctx)
-
getTagsInputName
protected String getTagsInputName()
-
isDisplayFirstPage
protected boolean isDisplayFirstPage()
-
setDisplayFirstPage
protected void setDisplayFirstPage(boolean value)
-
setIntranetMode
protected void setIntranetMode(boolean mode)
-
getInputFirstPageFull
protected String getInputFirstPageFull()
-
getType
public String getType()
Description copied from interface:IContentVisualComponentreturn the type of the element.- Specified by:
getTypein interfaceIContentVisualComponent- Returns:
- the type of the element.
-
getWidthEmptyPageInputName
protected String getWidthEmptyPageInputName()
-
getOnlyWithoutChildrenInputName
protected String getOnlyWithoutChildrenInputName()
-
getEventInputName
protected String getEventInputName()
-
getIntranetModeInputName
protected String getIntranetModeInputName()
-
init
public void init(ComponentBean bean, ContentContext newContext) throws Exception
- Overrides:
initin classAbstractVisualComponent- Throws:
Exception
-
isContentCachable
public boolean isContentCachable(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn the part of header needed for this component- Specified by:
isContentCachablein interfaceIContentVisualComponent- Overrides:
isContentCachablein classComplexPropertiesLink- Returns:
-
isContentCachableByQuery
public boolean isContentCachableByQuery(ContentContext ctx)
- Overrides:
isContentCachableByQueryin classAbstractVisualComponent
-
isContentTimeCachable
public boolean isContentTimeCachable(ContentContext ctx)
- Overrides:
isContentTimeCachablein classAbstractVisualComponent
-
isReverseOrder
protected boolean isReverseOrder(ContentContext ctx)
-
isSessionTaxonomy
protected boolean isSessionTaxonomy(ContentContext ctx)
-
getPageSize
public int getPageSize(ContentContext ctx)
-
isRedisplay
protected boolean isRedisplay(ContentContext ctx)
-
getRefComponent
protected PageReferenceComponent getRefComponent(ContentContext ctx)
-
prepareView
public void prepareView(ContentContext ctx) throws Exception
Description copied from class:AbstractVisualComponentprepare the rendering of a component. default attributes put in request : style, value, type, compid- Specified by:
prepareViewin interfaceIContentVisualComponent- Overrides:
prepareViewin classAbstractVisualComponent- Throws:
Exception
-
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- Overrides:
getConfigin classAbstractVisualComponent- Returns:
-
getCurrentRenderer
public String getCurrentRenderer(ContentContext ctx)
Description copied from class:AbstractVisualComponentget current renderer key- Specified by:
getCurrentRendererin interfaceIContentVisualComponent- Overrides:
getCurrentRendererin classAbstractVisualComponent- Returns:
-
main
public static void main(String[] args)
-
performPages
public static String performPages(ContentContext ctx) throws Exception
- Throws:
Exception
-
performEdit
public String performEdit(ContentContext ctx) throws Exception
Description copied from interface:IContentVisualComponentaction call when update the content page.- Specified by:
performEditin interfaceIContentVisualComponent- Overrides:
performEditin classAbstractVisualComponent- Returns:
- the error message, null if no error
- Throws:
Exception
-
setOrder
protected void setOrder(String order)
-
setSessionTaxonomy
protected void setSessionTaxonomy(boolean sessionTaxo)
-
setParentNode
protected void setParentNode(String node)
-
setReverseOrder
protected void setReverseOrder(boolean reverseOrder)
-
setEventOnly
protected void setEventOnly(boolean onlyEvent)
-
setRefDefaultLanguage
protected void setRefDefaultLanguage(boolean onlyEvent)
-
setDynamicOrder
protected void setDynamicOrder(boolean dynamicOrder)
-
setTag
protected void setTag(String tag)
-
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- Overrides:
isRealContentin classComplexPropertiesLink- Parameters:
ctx- current context- Returns:
-
getActionGroupName
public String getActionGroupName()
Description copied from interface:IActionthe group name of the action- Specified by:
getActionGroupNamein interfaceIAction- Returns:
- a group name.
-
getSearchLevel
public int getSearchLevel()
Description copied from interface:IContentVisualComponentreturn the level of the component is a search.- Specified by:
getSearchLevelin interfaceIContentVisualComponent- Overrides:
getSearchLevelin classAbstractVisualComponent- Returns:
- 1-LOW 2-MIDDLE 3-HIGH
-
getLock
protected Object getLock(ContentContext ctx)
- Overrides:
getLockin classAbstractVisualComponent
-
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- Overrides:
initContentin classAbstractVisualComponent- Returns:
- true if content is create.
- Throws:
Exception
-
isMirroredByDefault
public boolean isMirroredByDefault(ContentContext ctx)
Description copied from interface:IContentVisualComponentif this component is duplicated, by default it is mirrored.- Specified by:
isMirroredByDefaultin interfaceIContentVisualComponent- Overrides:
isMirroredByDefaultin classAbstractVisualComponent- Returns:
-
getContentAsText
public String getContentAsText(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the text of the component- Specified by:
getContentAsTextin interfaceIContentVisualComponent- Overrides:
getContentAsTextin classAbstractVisualComponent- Returns:
-
getTaxonomy
public Set<String> getTaxonomy()
- Specified by:
getTaxonomyin interfaceITaxonomyContainer
-
getIcon
public String getIcon()
- Specified by:
getIconin interfaceIContentVisualComponent- Overrides:
getIconin classAbstractVisualComponent
-
getColumnableDefaultValue
protected boolean getColumnableDefaultValue()
- Overrides:
getColumnableDefaultValuein classAbstractVisualComponent
-
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- Overrides:
isDisplayablein classAbstractVisualComponent- Returns:
- Throws:
Exception
-
-