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
PageBean
pages : list of pages selected to display.String
title : title of the page list. SeegetContentTitle()
PageReferenceComponent
comp : current component.String
firstPage : first page rendered in xHTML.
- Author:
- pvandermaesen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PageReferenceComponent.PageEvent
static class
PageReferenceComponent.PagesStatus
-
Field Summary
Fields Modifier and Type Field Description static String
MOUNT_FORMAT
static String
TYPE
-
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 boolean
filterPage(ContentContext ctx, MenuElement page, Collection<MenuElement> currentSelection, Collection<String> commands, String filter, boolean widthUnactive)
filter the pageString
getActionGroupName()
the group name of the actionprotected boolean
getColumnableDefaultValue()
protected String
getCompInputName()
int
getComplexityLevel(ContentContext ctx)
return the complexity level of the component.ComponentConfig
getConfig(ContentContext ctx)
get the configuration of the component. from project or from template.String
getContentAsText(ContentContext ctx)
get the text of the componentString
getCSSClassName(ContentContext ctx)
static Integer
getCurrentMonth(javax.servlet.http.HttpSession session)
String
getCurrentRenderer(ContentContext ctx)
get current renderer keystatic Integer
getCurrentYear(javax.servlet.http.HttpSession session)
protected String
getDefaultSelectedInputName()
protected String
getDirectLinkInputName()
protected String
getDisplayAsInputName()
protected String
getDynamicOrderInput()
String
getEditXHTMLCode(ContentContext ctx)
protected String
getEventInputName()
String
getHexColor()
get the exadecimal color for representation of the component.String
getIcon()
protected String
getInputFirstPageFull()
protected String
getIntranetModeInputName()
protected Object
getLock(ContentContext ctx)
protected String
getOnlyWithoutChildrenInputName()
protected String
getOrder()
protected String
getOrderInputName()
protected String
getPageDisplayedId(MenuElement page)
protected String
getPageId(MenuElement page)
int
getPageSize(ContentContext ctx)
protected String
getParentNode(ContentContext ctx)
protected String
getParentNodeInputName()
String
getPrefixViewXHTMLCode(ContentContext ctx)
code for prefix the view XHTML code.protected PageReferenceComponent
getRefComponent(ContentContext ctx)
protected String
getReverseOrderInput()
int
getSearchLevel()
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.String
getStyleTitle(ContentContext ctx)
return the title of the style choice.String
getSuffixViewXHTMLCode(ContentContext ctx)
code for sufix the view XHTML code.protected String
getTagsInputName()
Set<String>
getTaxonomy()
protected String
getTimeSelectionInputName(String option)
String
getType()
return the type of the element.protected String
getWidthEmptyPageInputName()
void
init(ComponentBean bean, ContentContext newContext)
boolean
initContent(ContentContext ctx)
init the content with a default value. sample : "lorem ipsum" for text component.boolean
isContentCachable(ContentContext ctx)
return the part of header needed for this componentboolean
isContentCachableByQuery(ContentContext ctx)
boolean
isContentTimeCachable(ContentContext ctx)
protected boolean
isDateRangeSelection(ContentContext ctx)
boolean
isDisplayable(ContentContext ctx)
true if the component can be displayed in preview modeboolean
isDisplayDate()
protected boolean
isDisplayFirstPage()
protected boolean
isInteractive()
boolean
isMirroredByDefault(ContentContext ctx)
if this component is duplicated, by default it is mirrored.boolean
isPopup()
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.protected boolean
isRedisplay(ContentContext ctx)
boolean
isRefDefaultLang()
protected boolean
isReverseOrder(ContentContext ctx)
protected boolean
isSessionTaxonomy(ContentContext ctx)
protected boolean
isUIFilterOnEditUsers(ContentContext ctx)
protected boolean
isUIFullDisplayFirstPage(ContentContext ctx)
protected boolean
isUILargeSorting(ContentContext ctx)
protected boolean
isUITimeSelection(ContentContext ctx)
static void
main(String[] args)
static String
performCalendar(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
String
performEdit(ContentContext ctx)
action call when update the content page.static String
performPages(ContentContext ctx)
void
prepareView(ContentContext ctx)
prepare the rendering of a component. default attributes put in request : style, value, type, compidstatic void
setCurrentMonth(javax.servlet.http.HttpSession session, int currentMonth)
static void
setCurrentYear(javax.servlet.http.HttpSession session, int currentYear)
protected void
setDisplayFirstPage(boolean value)
protected void
setDynamicOrder(boolean dynamicOrder)
protected void
setEventOnly(boolean onlyEvent)
protected void
setIntranetMode(boolean mode)
protected void
setOrder(String order)
protected void
setParentNode(String node)
protected void
setRefDefaultLanguage(boolean onlyEvent)
protected void
setReverseOrder(boolean reverseOrder)
protected void
setSessionTaxonomy(boolean sessionTaxo)
protected void
setTag(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:IContentVisualComponent
return the complexity level of the component.- Specified by:
getComplexityLevel
in interfaceIContentVisualComponent
- Overrides:
getComplexityLevel
in 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:
getDisplayAsInputName
in 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:
getEditXHTMLCode
in classAbstractVisualComponent
- Throws:
Exception
-
getHexColor
public String getHexColor()
Description copied from interface:IContentVisualComponent
get the exadecimal color for representation of the component.- Specified by:
getHexColor
in interfaceIContentVisualComponent
- Overrides:
getHexColor
in 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:IContentVisualComponent
code for prefix the view XHTML code.- Specified by:
getPrefixViewXHTMLCode
in interfaceIContentVisualComponent
- Overrides:
getPrefixViewXHTMLCode
in classAbstractVisualComponent
- Returns:
- XHTML code.
-
getReverseOrderInput
protected String getReverseOrderInput()
-
getDynamicOrderInput
protected String getDynamicOrderInput()
-
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
- Overrides:
getStyleList
in classAbstractVisualComponent
- 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
- Overrides:
getStyleTitle
in classAbstractVisualComponent
-
getSuffixViewXHTMLCode
public String getSuffixViewXHTMLCode(ContentContext ctx)
Description copied from interface:IContentVisualComponent
code for sufix the view XHTML code.- Specified by:
getSuffixViewXHTMLCode
in interfaceIContentVisualComponent
- Overrides:
getSuffixViewXHTMLCode
in 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:IContentVisualComponent
return the type of the element.- Specified by:
getType
in 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:
init
in classAbstractVisualComponent
- Throws:
Exception
-
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
- Overrides:
isContentCachable
in classComplexPropertiesLink
- Returns:
-
isContentCachableByQuery
public boolean isContentCachableByQuery(ContentContext ctx)
- Overrides:
isContentCachableByQuery
in classAbstractVisualComponent
-
isContentTimeCachable
public boolean isContentTimeCachable(ContentContext ctx)
- Overrides:
isContentTimeCachable
in 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:AbstractVisualComponent
prepare the rendering of a component. default attributes put in request : style, value, type, compid- Specified by:
prepareView
in interfaceIContentVisualComponent
- Overrides:
prepareView
in classAbstractVisualComponent
- Throws:
Exception
-
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
- Overrides:
getConfig
in classAbstractVisualComponent
- Returns:
-
getCurrentRenderer
public String getCurrentRenderer(ContentContext ctx)
Description copied from class:AbstractVisualComponent
get current renderer key- Specified by:
getCurrentRenderer
in interfaceIContentVisualComponent
- Overrides:
getCurrentRenderer
in 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:IContentVisualComponent
action call when update the content page.- Specified by:
performEdit
in interfaceIContentVisualComponent
- Overrides:
performEdit
in 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: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
- Overrides:
isRealContent
in classComplexPropertiesLink
- Parameters:
ctx
- current context- Returns:
-
getActionGroupName
public String getActionGroupName()
Description copied from interface:IAction
the group name of the action- Specified by:
getActionGroupName
in interfaceIAction
- Returns:
- a group name.
-
getSearchLevel
public int getSearchLevel()
Description copied from interface:IContentVisualComponent
return the level of the component is a search.- Specified by:
getSearchLevel
in interfaceIContentVisualComponent
- Overrides:
getSearchLevel
in classAbstractVisualComponent
- Returns:
- 1-LOW 2-MIDDLE 3-HIGH
-
getLock
protected Object getLock(ContentContext ctx)
- Overrides:
getLock
in classAbstractVisualComponent
-
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
- Overrides:
initContent
in classAbstractVisualComponent
- Returns:
- true if content is create.
- Throws:
Exception
-
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
- Overrides:
isMirroredByDefault
in classAbstractVisualComponent
- Returns:
-
getContentAsText
public String getContentAsText(ContentContext ctx)
Description copied from interface:IContentVisualComponent
get the text of the component- Specified by:
getContentAsText
in interfaceIContentVisualComponent
- Overrides:
getContentAsText
in classAbstractVisualComponent
- Returns:
-
getTaxonomy
public Set<String> getTaxonomy()
- Specified by:
getTaxonomy
in interfaceITaxonomyContainer
-
getIcon
public String getIcon()
- Specified by:
getIcon
in interfaceIContentVisualComponent
- Overrides:
getIcon
in classAbstractVisualComponent
-
getColumnableDefaultValue
protected boolean getColumnableDefaultValue()
- Overrides:
getColumnableDefaultValue
in classAbstractVisualComponent
-
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
- Overrides:
isDisplayable
in classAbstractVisualComponent
- Returns:
- Throws:
Exception
-
-