Package org.javlo.component.links
Class SmartExternalLink
- java.lang.Object
-
- org.javlo.component.core.AbstractVisualComponent
-
- org.javlo.component.core.ComplexPropertiesLink
-
- org.javlo.component.links.SmartExternalLink
-
- All Implemented Interfaces:
Serializable,Comparable<IContentVisualComponent>,IContentVisualComponent,IReverseLinkComponent,IImageTitle,IRestItem
public class SmartExternalLink extends ComplexPropertiesLink implements IReverseLinkComponent, IImageTitle
- Author:
- pvandermaesen
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSmartExternalLink.UndateInfo
-
Field Summary
Fields Modifier and Type Field Description protected static StringDESCRIPTION_KEYprotected static StringIMAGE_KEYprotected static StringIMAGE_LINK_KEYprotected static StringIMAGE_URI_KEYprotected static Loggerloggercreate a static logger.protected static StringRESPONSE_KEYstatic StringSTYLE_NORMALstatic StringSTYLE_PRIORITYprotected static StringTITLE_KEYstatic StringTYPEprotected static StringVALID_CONNECTION_KEYprotected static StringVALID_LINK-
Fields inherited from class org.javlo.component.core.ComplexPropertiesLink
HEADER_V1_0, LABEL_KEY, LINK_KEY, properties
-
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
-
Fields inherited from interface org.javlo.component.image.IImageTitle
NO_LINK
-
-
Constructor Summary
Constructors Constructor Description SmartExternalLink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRequestURL(ContentContext ctx, String url)voiddelete(ContentContext ctx)this method is called when component is deleted.protected voiddeleteImage(ContentContext ctx)intgetComplexityLevel(ContentContext ctx)return the complexity level of the component.protected StringgetDescriptionInputName()protected StringgetEditXHTMLCode(ContentContext ctx)StringgetHexColor()get the exadecimal color for representation of the component.longgetImageCRC32(ContentContext ctx)StringgetImageDescription(ContentContext ctx)protected StringgetImageLink()StringgetImageLinkURL(ContentContext ctx)StringgetImageURI(ContentContext ctx)StringgetLabel(ContentContext ctx)StringgetLinkText(ContentContext ctx)this text must be replace with a link.StringgetLinkURL(ContentContext ctx)return the link code (in HTML) with the link text in.intgetPriority(ContentContext ctx)return the priority of the picture inside the page (9=max)StringgetResourceURL(ContentContext ctx)StringgetReverseLinkName()String[]getStyleLabelList(ContentContext ctx)return a list of label define the style.String[]getStyleList(ContentContext ctx)get the list of style possible for this component.StringgetTitle(ContentContext ctx)protected StringgetTitleInputName()StringgetType()return the type of the element.StringgetViewXHTMLCode(ContentContext ctx)intgetWordCount(ContentContext ctx)count the word in the content.voidinit(ComponentBean bean, ContentContext newContext)protected booleanisContentValid(ContentContext ctx, String pageContent)booleanisDisplayable(ContentContext ctx)true if the component can be displayed in preview modebooleanisImageValid(ContentContext ctx)booleanisInline()check if the component can be inserd inline.booleanisListable()you display the composant as a list (if you want)booleanisMobileOnly(ContentContext ctx)booleanisOnlyFirstOccurrence()only modify the first occurrence on the pagebooleanisOnlyPreviousComponent()change only the component juste before link componentbooleanisOnlyThisPage()only if reverse link change text only on the same page than the component.booleanisReverseLink()return true if the component must be use as reverselink.booleanisURLinRequest(ContentContext ctx, String url)BooleanisValidConnection(ContentContext ctx)protected voidloadData(ContentContext ctx)booleanmustBeRemoved(ContentContext ctx)StringperformEdit(ContentContext ctx)action call when update the content page.voidprepareView(ContentContext ctx)prepare the rendering of a component. default attributes put in request : style, value, type, compidprotected voidrefreshAutoInfo(ContentContext ctx)voidremoveValidConnection(ContentContext ctx)voidsetDescription(ContentContext ctx, String desc)voidsetImageCRC32(ContentContext ctx, long mustBeRemoved)voidsetImageURI(ContentContext ctx, String uri)voidsetLinkValid(ContentContext ctx, boolean visible)voidsetMustBeRemoved(ContentContext ctx, boolean mustBeRemoved)voidsetTitle(ContentContext ctx, String title)voidsetValidConnection(ContentContext ctx, boolean isValid)-
Methods inherited from class org.javlo.component.core.ComplexPropertiesLink
equals, getField, getField, getFontAwesome, getLinkLabelName, getLinkName, init, isContentCachable, isRealContent, isValueTranslatable, reloadProperties, setField, setValue, storeProperties, transflateFrom
-
Methods inherited from class org.javlo.component.core.AbstractVisualComponent
applyReplacement, cleanResources, cleanValue, clearReplacement, clone, compareTo, contructViewStyle, countLine, deleteMySelf, drawColumn, equals, executeCurrentRenderer, executeJSP, executeRenderer, executeRenderer, extractFieldsFromRenderer, forceInit, getAjaxId, getArea, getAuthors, getBackgroundColor, getBaseHelpURL, getClassName, getColomnablePrefix, getColomnableSuffix, getColumn, getColumnableDefaultValue, getColumnMaxSize, getColumnSize, getColumnSizes, getColumnStyle, getComponentBean, getComponentCSS, getComponentCssClass, getComponentId, getComponentLabel, getComponentPath, getConfig, getConfigInValue, getConfigMessage, getContainerPage, getContentAsMap, getContentAsText, getContentCache, getContentMessage, getContentName, getContentTimeCache, getCookiesDisplayStatus, getCreationDate, getCSSStyle, getCurrentPage, getCurrentRenderer, getDataAttributes, getDebugHeader, getDefaultHelpURI, getDefaultRenderer, getDeleteDate, getDescription, getDisplayAsInputName, getDisplayMessage, getEditorComplexity, getEditRenderer, getEditText, getEmptyCode, getEmptyXHTMLCode, getErrorMessage, getErrorMessage, getExternalModules, getExternalResources, getFileDirectory, getFirstPrefix, getForcedId, getForcedPrefixViewXHTMLCode, getForcedRenderer, getForcedSuffixViewXHTMLCode, getFormName, getGroup, getHeaderContent, getHelpText, getHelpType, getHelpURI, getHelpURL, getI18nEditableKeys, getIcon, getId, getImportFolderPath, getImportFolderPath, getInlineStyle, getInputName, getInputNameColomn, getInputNameColomnStyle, getInputNameRenderer, getInputNameRendererTitle, getItalicAndStrongLanguageMarkerList, getJSOnSubmit, getKey, getLabelLevel, getLastSufix, getLayout, getListClass, getListGroup, getListItemTag, getListTag, getLocalMessage, getLock, getManualCssClass, getMarkerList, getMessage, getMirrorWrapper, getModificationDate, getNextComponent, getPage, getPageDescription, getPrefixCssClass, getPrefixViewXHTMLCode, getPreviewAttributes, getPreviewCssClass, getPreviewCssId, getPreviousComponent, getQuotationLanguageMarkerList, getReferenceComponent, getRemplacement, getRenderer, getRendererTitle, getRenderes, getRequestComponent, getSearchLevel, getSelectRendererXHTML, getSpecialInputTag, getSpecialPreviewCssId, getSpecialTagTitle, getSpecialTagXHTML, getSpecificClass, getSpecificCssClass, getStyle, getStyleLabel, getStyleTitle, getSuffixViewXHTMLCode, getTag, getTextColor, getTextForSearch, getTextLabel, getTextMessage, getTextPosition, getTextTitle, getTitleLevel, getTypeInputName, getValue, getValue, getVersion, getViewData, getViewDataFile, getViewID, getViewText, getWidth, getXHTMLCode, getXHTMLConfig, haveRight, includeComponentJSP, includePage, initContent, insert, isAjaxWrapper, isAskWidth, isAutoDeletable, isAutoRenderer, isBackgroundColored, isCanAddClass, isCloseRow, isColored, isColumnable, isConfig, isContentCachableByQuery, isContentTimeCachable, isDefaultValue, isDispayEmptyXHTMLCode, isDisplayHidden, isEditOnCreate, isFirstElementOfRepeatSequence, isFirstRepeated, isFreeInputLayout, isHelpURL, isHiddable, isHidden, isHiddenInMode, isHiddenInModeValue, isInsertable, isList, isMetaTitle, isMirroredByDefault, 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
-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.javlo.component.core.IReverseLinkComponent
getPage
-
-
-
-
Field Detail
-
IMAGE_LINK_KEY
protected static final String IMAGE_LINK_KEY
- See Also:
- Constant Field Values
-
STYLE_NORMAL
public static final String STYLE_NORMAL
- See Also:
- Constant Field Values
-
STYLE_PRIORITY
public static final String STYLE_PRIORITY
- See Also:
- Constant Field Values
-
logger
protected static Logger logger
create a static logger.
-
TITLE_KEY
protected static final String TITLE_KEY
- See Also:
- Constant Field Values
-
DESCRIPTION_KEY
protected static final String DESCRIPTION_KEY
- See Also:
- Constant Field Values
-
IMAGE_URI_KEY
protected static final String IMAGE_URI_KEY
- See Also:
- Constant Field Values
-
IMAGE_KEY
protected static final String IMAGE_KEY
- See Also:
- Constant Field Values
-
RESPONSE_KEY
protected static final String RESPONSE_KEY
- See Also:
- Constant Field Values
-
VALID_CONNECTION_KEY
protected static final String VALID_CONNECTION_KEY
- See Also:
- Constant Field Values
-
VALID_LINK
protected static final String VALID_LINK
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
addRequestURL
public void addRequestURL(ContentContext ctx, String url)
-
delete
public void delete(ContentContext ctx)
Description copied from interface:IContentVisualComponentthis method is called when component is deleted.- Specified by:
deletein interfaceIContentVisualComponent- Overrides:
deletein classAbstractVisualComponent
-
deleteImage
protected void deleteImage(ContentContext ctx) throws IOException
- Throws:
IOException
-
getDescriptionInputName
protected String getDescriptionInputName()
-
getEditXHTMLCode
protected 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)
-
getImageCRC32
public long getImageCRC32(ContentContext ctx) throws IOException
- Throws:
IOException
-
getImageDescription
public String getImageDescription(ContentContext ctx)
- Specified by:
getImageDescriptionin interfaceIImageTitle
-
getImageLink
protected String getImageLink()
-
getImageURI
public String getImageURI(ContentContext ctx) throws IOException
- Throws:
IOException
-
getResourceURL
public String getResourceURL(ContentContext ctx)
- Specified by:
getResourceURLin interfaceIImageTitle
-
getLabel
public String getLabel(ContentContext ctx) throws IOException
- Throws:
IOException
-
getLinkText
public String getLinkText(ContentContext ctx)
Description copied from interface:IReverseLinkComponentthis text must be replace with a link.- Specified by:
getLinkTextin interfaceIReverseLinkComponent- Returns:
-
getLinkURL
public String getLinkURL(ContentContext ctx)
Description copied from interface:IReverseLinkComponentreturn the link code (in HTML) with the link text in.- Specified by:
getLinkURLin interfaceIReverseLinkComponent- Returns:
-
getReverseLinkName
public String getReverseLinkName()
-
getStyleLabelList
public String[] getStyleLabelList(ContentContext ctx)
Description copied from interface:IContentVisualComponentreturn a list of label define the style.- Specified by:
getStyleLabelListin interfaceIContentVisualComponent- Overrides:
getStyleLabelListin classAbstractVisualComponent- Returns:
- a list of label.
-
getStyleList
public String[] getStyleList(ContentContext ctx)
Description copied from interface:IContentVisualComponentget the list of style possible for this component.- Specified by:
getStyleListin interfaceIContentVisualComponent- Overrides:
getStyleListin classAbstractVisualComponent- Returns:
- a list of string represent a style.
-
getTitle
public String getTitle(ContentContext ctx) throws IOException
- Throws:
IOException
-
getTitleInputName
protected String getTitleInputName()
-
getType
public String getType()
Description copied from interface:IContentVisualComponentreturn the type of the element.- Specified by:
getTypein interfaceIContentVisualComponent- Returns:
- the type of the element.
-
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
-
getViewXHTMLCode
public String getViewXHTMLCode(ContentContext ctx) throws Exception
- Overrides:
getViewXHTMLCodein classAbstractVisualComponent- Throws:
Exception- See Also:
org.javlo.itf.IContentVisualComponent#getXHTMLCode()
-
getWordCount
public int getWordCount(ContentContext ctx)
Description copied from interface:IContentVisualComponentcount the word in the content.- Specified by:
getWordCountin interfaceIContentVisualComponent- Overrides:
getWordCountin classAbstractVisualComponent- Returns:
-
init
public void init(ComponentBean bean, ContentContext newContext) throws Exception
- Overrides:
initin classAbstractVisualComponent- Throws:
Exception
-
isContentValid
protected boolean isContentValid(ContentContext ctx, String pageContent)
-
isDisplayable
public boolean isDisplayable(ContentContext ctx) throws IOException
Description copied from interface:IContentVisualComponenttrue if the component can be displayed in preview mode- Specified by:
isDisplayablein interfaceIContentVisualComponent- Overrides:
isDisplayablein classAbstractVisualComponent- Returns:
- Throws:
IOException
-
isImageValid
public boolean isImageValid(ContentContext ctx)
- Specified by:
isImageValidin interfaceIImageTitle
-
isInline
public boolean isInline()
Description copied from interface:IContentVisualComponentcheck if the component can be inserd inline.- Specified by:
isInlinein interfaceIContentVisualComponent- Overrides:
isInlinein classAbstractVisualComponent- Returns:
- true if component is a inline component. (text, link, image)...
-
isListable
public boolean isListable()
Description copied from interface:IContentVisualComponentyou display the composant as a list (if you want)- Specified by:
isListablein interfaceIContentVisualComponent- Overrides:
isListablein classAbstractVisualComponent- Returns:
- true if a text is listable
-
isOnlyFirstOccurrence
public boolean isOnlyFirstOccurrence()
Description copied from interface:IReverseLinkComponentonly modify the first occurrence on the page- Specified by:
isOnlyFirstOccurrencein interfaceIReverseLinkComponent
-
isOnlyPreviousComponent
public boolean isOnlyPreviousComponent()
Description copied from interface:IReverseLinkComponentchange only the component juste before link component- Specified by:
isOnlyPreviousComponentin interfaceIReverseLinkComponent- Returns:
-
isOnlyThisPage
public boolean isOnlyThisPage()
Description copied from interface:IReverseLinkComponentonly if reverse link change text only on the same page than the component.- Specified by:
isOnlyThisPagein interfaceIReverseLinkComponent- Returns:
-
isReverseLink
public boolean isReverseLink()
Description copied from interface:IReverseLinkComponentreturn true if the component must be use as reverselink.- Specified by:
isReverseLinkin interfaceIReverseLinkComponent- Returns:
-
isURLinRequest
public boolean isURLinRequest(ContentContext ctx, String url)
-
isValidConnection
public Boolean isValidConnection(ContentContext ctx) throws IOException
- Throws:
IOException
-
loadData
protected void loadData(ContentContext ctx) throws IOException
- Throws:
IOException
-
mustBeRemoved
public boolean mustBeRemoved(ContentContext ctx) throws IOException
- Throws:
IOException
-
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
-
refreshAutoInfo
protected void refreshAutoInfo(ContentContext ctx) throws Exception
- Throws:
Exception
-
removeValidConnection
public void removeValidConnection(ContentContext ctx) throws IOException
- Throws:
IOException
-
setDescription
public void setDescription(ContentContext ctx, String desc) throws IOException
- Throws:
IOException
-
setImageCRC32
public void setImageCRC32(ContentContext ctx, long mustBeRemoved) throws IOException
- Throws:
IOException
-
setImageURI
public void setImageURI(ContentContext ctx, String uri) throws IOException
- Throws:
IOException
-
setLinkValid
public void setLinkValid(ContentContext ctx, boolean visible) throws IOException
- Throws:
IOException
-
setMustBeRemoved
public void setMustBeRemoved(ContentContext ctx, boolean mustBeRemoved) throws IOException
- Throws:
IOException
-
setTitle
public void setTitle(ContentContext ctx, String title) throws IOException
- Throws:
IOException
-
setValidConnection
public void setValidConnection(ContentContext ctx, boolean isValid) throws IOException
- Throws:
IOException
-
getImageLinkURL
public String getImageLinkURL(ContentContext ctx)
- Specified by:
getImageLinkURLin interfaceIImageTitle
-
getPriority
public int getPriority(ContentContext ctx)
Description copied from interface:IImageTitlereturn the priority of the picture inside the page (9=max)- Specified by:
getPriorityin interfaceIImageTitle- Returns:
-
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
-
isMobileOnly
public boolean isMobileOnly(ContentContext ctx)
- Specified by:
isMobileOnlyin interfaceIImageTitle
-
-