Package org.javlo.component.web2
Class ReactionComponent
- java.lang.Object
-
- org.javlo.component.core.AbstractVisualComponent
-
- org.javlo.component.dynamic.DynamicComponent
-
- org.javlo.component.web2.ReactionComponent
-
- All Implemented Interfaces:
Serializable
,Comparable<IContentVisualComponent>
,IAction
,IContentVisualComponent
,IDate
,ILink
,ISubTitle
,IImageTitle
,ITimeRange
,IRestItem
,IFieldContainer
,IStaticContainer
public class ReactionComponent extends DynamicComponent implements IAction
- Author:
- pvandermaesen
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReactionComponent.Reaction
-
Nested classes/interfaces inherited from class org.javlo.component.dynamic.DynamicComponent
DynamicComponent.FieldOrderComparator
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger
logger
create a static logger.static String
TYPE
-
Fields inherited from class org.javlo.component.dynamic.DynamicComponent
HIDDEN, JSP_HEADER, 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, 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 ReactionComponent()
-
Method Summary
-
Methods inherited from class org.javlo.component.dynamic.DynamicComponent
contains, contentHashCode, contructViewStyle, getAllResources, getAllResourcesLinks, getColumnableDefaultValue, getComponentLabel, getConfigProperties, getContainerType, getContentAsMap, getCSSClass, getDataPath, getDate, getDirSelected, getDynamicId, getExternalResources, getField, getFieldsNames, getFieldValue, getFiles, getIcon, getImageDescription, getImageField, getImageLinkURL, getLabel, getLabelLevel, getLatestValidDate, getList, getList, getNotififyPageName, getPageDescription, getPopularity, getPrefix, getPrefixViewXHTMLCode, getPriority, getProperties, getResourceURL, getSpecificClass, getStyleLabelList, getStyleList, getSubTitle, getSubTitleLevel, getSuffix, getSuffixViewXHTMLCode, getTextForSearch, getTextLabel, getTextTitle, getTimeRangeEnd, getTimeRangeStart, getType, getURL, getViewListXHTMLCode, getViewXHTMLCode, getXHTMLId, init, initContent, isAutoDeletable, isFieldContainer, isImageValid, isLinkValid, isMobileOnly, isNotififyCreation, isRealContent, isRestMatch, isValidDate, isValueTranslatable, isWrapped, prepareView, reload, reloadProperties, renameResource, setConfigProperties, setDirSelected, setDynamicId, setLatestValidDate, setProperties, setValue, storeProperties, transflateFrom
-
Methods inherited from class org.javlo.component.core.AbstractVisualComponent
applyReplacement, cleanResources, cleanValue, clearReplacement, clone, compareTo, countLine, delete, deleteMySelf, drawColumn, equals, equals, executeCurrentRenderer, executeJSP, executeRenderer, executeRenderer, extractFieldsFromRenderer, forceInit, getAjaxId, getArea, getAuthors, getBackgroundColor, getBaseHelpURL, getClassName, getColomnablePrefix, getColomnableSuffix, getColumn, getColumnMaxSize, getColumnSize, getColumnSizes, getColumnStyle, getComponentBean, getComponentCSS, getComponentCssClass, getComponentId, getComponentPath, getConfig, getConfigInValue, getConfigMessage, getContainerPage, 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, getFileDirectory, getFirstPrefix, getForcedId, getForcedPrefixViewXHTMLCode, getForcedRenderer, getForcedSuffixViewXHTMLCode, getFormName, getGroup, getHeaderContent, getHelpText, getHelpType, getHelpURI, getHelpURL, getI18nEditableKeys, getId, getImportFolderPath, getImportFolderPath, getInlineStyle, getInputNameColomn, getInputNameColomnStyle, getInputNameRenderer, getInputNameRendererTitle, getItalicAndStrongLanguageMarkerList, getJSOnSubmit, getLastSufix, getLayout, getListClass, getListGroup, getListItemTag, getListTag, getLocalMessage, getLock, getManualCssClass, getMarkerList, getMessage, getMirrorWrapper, getModificationDate, getNextComponent, getPage, getPrefixCssClass, getPreviewAttributes, getPreviewCssClass, getPreviewCssId, getPreviousComponent, getQuotationLanguageMarkerList, getReferenceComponent, getRemplacement, getRenderer, getRendererTitle, getRenderes, getRequestComponent, getSearchLevel, getSelectRendererXHTML, getSpecialInputTag, getSpecialPreviewCssId, getSpecialTagTitle, getSpecialTagXHTML, getSpecificCssClass, getStyle, getStyleLabel, getStyleTitle, getTag, getTextColor, getTextMessage, getTextPosition, getTitleLevel, getTypeInputName, getValue, getValue, getVersion, getViewData, getViewDataFile, getViewID, getViewText, getWidth, getWordCount, getXHTMLCode, getXHTMLConfig, haveRight, includeComponentJSP, includePage, insert, isAjaxWrapper, isAskWidth, isAutoRenderer, isBackgroundColored, isCanAddClass, isCloseRow, isColored, isColumnable, isConfig, isContentCachableByQuery, isDefaultValue, isDispayEmptyXHTMLCode, isDisplayable, isDisplayHidden, isEditOnCreate, isFirstElementOfRepeatSequence, isFirstRepeated, isFreeInputLayout, isHelpURL, isHiddable, isHidden, isHiddenInMode, isHiddenInModeValue, isInline, isInsertable, isList, isListable, isMetaTitle, isMirroredByDefault, isMirrorWrapped, isModify, isNeedDelete, isNeedRefresh, isNeedRenderer, isNew, isNextSame, isNextSame, isNolink, isNoLinkable, isOpenRow, isPreviousSame, isPreviousSame, isRepeat, isRepeatable, isReversedLink, isStyleHidden, isUnique, isValueProperties, isViewDataFile, isVisible, isVisible, isVisibleFromCookies, isWrapped, isXML, loadViewData, markAsNew, 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 java.lang.Comparable
compareTo
-
Methods inherited from interface org.javlo.component.core.IContentVisualComponent
cleanResources, clearReplacement, delete, equals, extractFieldsFromRenderer, forceInit, getArea, getAuthors, getClassName, getColumnSize, getColumnStyle, getComponentBean, getComponentCssClass, getConfig, getConfigInValue, getConfigMessage, getContentAsText, getContentMessage, getContentName, getCreationDate, getCurrentRenderer, getDescription, getEditText, getEmptyXHTMLCode, getErrorMessage, getErrorMessage, getExternalModules, getFirstPrefix, getGroup, getHeaderContent, getHelpText, getHelpURL, getI18nEditableKeys, getId, getInputNameRenderer, getJSOnSubmit, getLastSufix, getLayout, getListGroup, getMarkerList, getMessage, getModificationDate, getNextComponent, getPreviousComponent, getReferenceComponent, getRenderer, getSearchLevel, getSpecialTagTitle, getSpecialTagXHTML, getStyle, getStyleLabel, getStyleTitle, getTextMessage, getTitleLevel, getValue, getVersion, getViewText, getWordCount, getXHTMLCode, getXHTMLConfig, insert, isColumnable, isConfig, isDefaultValue, isDispayEmptyXHTMLCode, isDisplayable, isDisplayHidden, isEditOnCreate, isFirstRepeated, isHelpURL, isHidden, isHiddenInMode, isInline, isInsertable, isList, isListable, isMetaTitle, isMirroredByDefault, isModify, isNeedRefresh, isNew, isNolink, isRepeat, isRepeatable, isUnique, isVisible, isVisible, isVisibleFromCookies, loadViewData, markAsNew, next, performConfig, previous, replaceAllInContent, replaceInContent, resetViewData, setColumnSize, setContainerPage, setDisplayHidden, setGroup, setList, setNeedRefresh, setNextComponent, setPage, setPreviousComponent, setRenderer, setRepeat, setStyle, setValid, stored
-
Methods inherited from interface org.javlo.fields.IFieldContainer
getPage
-
Methods inherited from interface org.javlo.component.meta.ITimeRange
isTimeRangeValid
-
-
-
-
Method Detail
-
performAdd
public static final String performAdd(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
ACTIONS **- Throws:
Exception
-
performDelete
public static final String performDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
- Throws:
Exception
-
getReactionPrefix
protected String getReactionPrefix(ContentContext ctx)
-
getDelReactionPrefix
protected String getDelReactionPrefix(ContentContext ctx)
-
getEditXHTMLCode
protected String getEditXHTMLCode(ContentContext ctx) throws Exception
- Overrides:
getEditXHTMLCode
in classDynamicComponent
- Throws:
Exception
-
getEmail
protected String getEmail(ContentContext ctx)
-
getTitle
protected String getTitle(ContentContext ctx)
-
isWithTitle
protected boolean isWithTitle(ContentContext ctx)
-
isReplyAllowed
protected boolean isReplyAllowed(ContentContext ctx)
-
isRequestLoginToView
protected boolean isRequestLoginToView(ContentContext ctx)
-
isRequestLoginToAdd
protected boolean isRequestLoginToAdd(ContentContext ctx)
-
getFields
public List<Field> getFields(ContentContext ctx) throws FileNotFoundException, IOException
- Specified by:
getFields
in interfaceIFieldContainer
- Overrides:
getFields
in classDynamicComponent
- Throws:
FileNotFoundException
IOException
-
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 classDynamicComponent
- Returns:
- a exadecimal color (sample : a5b499)
-
getInputName
protected String getInputName(String field)
- Overrides:
getInputName
in classDynamicComponent
-
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
- Overrides:
getKey
in classDynamicComponent
-
getAllReactions
public Collection<ReactionComponent.Reaction> getAllReactions(ContentContext ctx)
-
getReactions
public Collection<ReactionComponent.Reaction> getReactions(ContentContext ctx)
-
getDeletedReactions
public Collection<ReactionComponent.Reaction> getDeletedReactions(ContentContext ctx)
-
getAllDeletedReactions
public Collection<ReactionComponent.Reaction> getAllDeletedReactions(ContentContext ctx)
-
getReactionUnvalidInputName
public String getReactionUnvalidInputName()
-
getType
public String getType()
Description copied from interface:IContentVisualComponent
return the type of the element.- Specified by:
getType
in interfaceIContentVisualComponent
- Overrides:
getType
in classDynamicComponent
- Returns:
- the type of the element.
-
getViewFields
protected List<Field> getViewFields(ContentContext ctx, String reactionId) throws FileNotFoundException, IOException
- Throws:
FileNotFoundException
IOException
-
getViewXHTMLCode
public String getViewXHTMLCode(ContentContext ctx) throws Exception
- Specified by:
getViewXHTMLCode
in interfaceIFieldContainer
- Overrides:
getViewXHTMLCode
in classDynamicComponent
- Throws:
Exception
- See Also:
org.javlo.itf.IContentVisualComponent#getXHTMLCode()
-
init
protected void init() throws ResourceNotFoundException
- Overrides:
init
in classAbstractVisualComponent
- Throws:
ResourceNotFoundException
-
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
- Overrides:
newInstance
in classDynamicComponent
newCtx
- the context of the content manager.- 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 classDynamicComponent
- Returns:
- the error message, null if no error
- Throws:
Exception
-
deleteReaction
public void deleteReaction(ContentContext ctx, String id, boolean store) throws IOException
- Throws:
IOException
-
validReaction
public void validReaction(ContentContext ctx, String id) throws IOException
- Throws:
IOException
-
getActionGroupName
public String getActionGroupName()
Description copied from interface:IAction
the group name of the action- Specified by:
getActionGroupName
in interfaceIAction
- Returns:
- a group name.
-
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 classDynamicComponent
- Returns:
-
isContentTimeCachable
public boolean isContentTimeCachable(ContentContext ctx)
- Overrides:
isContentTimeCachable
in classDynamicComponent
-
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 classDynamicComponent
- Parameters:
ctx
- TODO- Returns:
- see contant
-
isCaptcha
public boolean isCaptcha(ContentContext ctx)
-
isAllowHtml
public boolean isAllowHtml(ContentContext ctx)
-
isWithLink
protected boolean isWithLink(ContentContext ctx)
-
getReactionSize
public int getReactionSize(ContentContext ctx)
-
main
public static void main(String[] args)
-
getFontAwesome
public String getFontAwesome()
- Specified by:
getFontAwesome
in interfaceIContentVisualComponent
- Overrides:
getFontAwesome
in classAbstractVisualComponent
-
-