Class ItemCommentsController
java.lang.Object
org.zkoss.zk.ui.event.GenericEventListener
org.zkoss.zk.ui.util.GenericComposer<T>
org.zkoss.zk.ui.util.GenericAutowireComposer<T>
org.zkoss.zk.ui.util.GenericForwardComposer<org.zkoss.zk.ui.Component>
com.hybris.cockpitng.util.ViewAnnotationAwareComposer
com.hybris.cockpitng.util.DefaultWidgetController
com.hybris.backoffice.widgets.itemcomments.ItemCommentsController
- All Implemented Interfaces:
com.hybris.cockpitng.core.WidgetController,com.hybris.cockpitng.dnd.WidgetDragAndDropAware,com.hybris.cockpitng.engine.WidgetInstanceManagerAware,Serializable,org.zkoss.zk.ui.event.EventListener,org.zkoss.zk.ui.event.SerializableEventListener,org.zkoss.zk.ui.util.ComponentActivationListener,org.zkoss.zk.ui.util.ComponentCloneListener,org.zkoss.zk.ui.util.Composer<org.zkoss.zk.ui.Component>,org.zkoss.zk.ui.util.ComposerExt<org.zkoss.zk.ui.Component>
public class ItemCommentsController
extends com.hybris.cockpitng.util.DefaultWidgetController
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final StringDeprecated, for removal: This API element is subject to removal in a future version.since 1811, the field is unusedprotected static final StringDeprecated, for removal: This API element is subject to removal in a future version.since 1811, the field is unusedprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer
_separator, application, applicationScope, arg, componentScope, desktop, desktopScope, execution, page, pageScope, param, requestScope, self, session, sessionScope, spaceOwner, spaceScopeFields inherited from class org.zkoss.zk.ui.util.GenericComposer
_applied -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCommentToItem(CommentModel newComment) protected booleanprotected booleancanReadThisComment(CommentModel comment) protected voidprotected org.zkoss.zul.DivcreateAddCommentContainer(org.zkoss.zul.Textbox textbox, org.zkoss.zul.Button okButton, org.zkoss.zul.Button cancelButton) protected org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>protected Optional<CommentModel>createNewComment(String text, ComponentModel component, CommentTypeModel commentType) protected Optional<CommentModel>createNewComment(org.zkoss.zul.Textbox textbox) protected org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>createOkButtonEventListener(org.zkoss.zul.Textbox textbox) protected List<CommentModel>filterNotPermitted(List<CommentModel> comments) org.zkoss.zul.Buttonorg.zkoss.zul.Divcom.hybris.cockpitng.widgets.common.WidgetComponentRenderer<org.zkoss.zul.Div,Void, CommentModel> org.zkoss.zul.Labelorg.zkoss.zul.Divorg.zkoss.zul.Popupprotected Stringprotected com.hybris.backoffice.widgets.notificationarea.NotificationServicecom.hybris.cockpitng.dataaccess.facades.object.ObjectFacadeprotected Collection<org.zkoss.zk.ui.Component>com.hybris.cockpitng.dataaccess.facades.permissions.PermissionFacadeorg.zkoss.zul.Buttoncom.hybris.cockpitng.dataaccess.facades.type.TypeFacadeprotected voidhandleCommentSavingException(com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectSavingException exception) protected voidinitDataType(ItemModel inputItem) protected voidvoidinitialize(org.zkoss.zk.ui.Component component) protected voidprotected voidprotected booleanisCommentsChanged(ItemModel freshInputItemModel) protected voidprotected voidnotifyUserOfWrongSettings(String wrongSettingsMessage) voidonHeartbeat(com.hybris.cockpitng.core.events.CockpitEvent cockpitEvent) voidonInputItemReceive(ItemModel inputItem) voidprotected voidrender()protected voidprotected voidprotected voidprotected voidprotected voidrunWithReopeningPopup(com.hybris.cockpitng.core.Executable executable) Performs passed operation and closes and reopens comments popup so any modified elements in it will be recalculated correctly.protected voidvoidsetAddCommentButton(org.zkoss.zul.Button addCommentButton) voidsetAddCommentContainer(org.zkoss.zul.Div addCommentContainer) voidsetCommentRenderer(com.hybris.cockpitng.widgets.common.WidgetComponentRenderer<org.zkoss.zul.Div, Void, CommentModel> commentRenderer) voidsetCommentsCountLabel(org.zkoss.zul.Label commentsCountLabel) voidsetCommentService(CommentService commentService) voidsetCommentsListContainer(org.zkoss.zul.Div commentsListContainer) voidsetCommentsPopup(org.zkoss.zul.Popup commentsPopup) voidsetNotificationService(com.hybris.backoffice.widgets.notificationarea.NotificationService notificationService) voidsetObjectFacade(com.hybris.cockpitng.dataaccess.facades.object.ObjectFacade objectFacade) protected voidsetOnClickEventListenersForOpenPopupAwareComponent(org.zkoss.zk.ui.Component component, boolean clickable) protected voidvoidsetPermissionFacade(com.hybris.cockpitng.dataaccess.facades.permissions.PermissionFacade permissionFacade) voidsetPopupPosition(PopupPosition popupPosition) voidsetShowCommentsButton(org.zkoss.zul.Button showCommentsButton) voidsetTypeFacade(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade) voidsetUIDateRendererProvider(UIDateRendererProvider uiDateRendererProvider) protected voidsetUIStateForOpenPopupAwareComponent(org.zkoss.zk.ui.Component component, boolean clickable) voidsetUserService(UserService userService) voidprotected voidsortAndSetComments(List<CommentModel> comments) protected voidtryToSaveItemComment(CommentModel comment) Methods inherited from class com.hybris.cockpitng.util.DefaultWidgetController
doAfterCompose, doBeforeCompose, doBeforeComposeChildren, executeOperation, getDragAndDropStrategy, getLabel, getLabel, getModel, getValue, getWidgetDragAndDropStrategyRepository, getWidgetInstanceManager, getWidgetRoot, getWidgetSettings, getWidgetslot, getWidgetTitle, getWidgetUtils, initDragAndDropAwareness, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, invokeListenerMethod, onSocketInput, preInitialize, sendOutput, sendOutputAfterOperation, sendOutputAfterOperation, sendOutputAfterOperation, setValue, setWidgetInstanceManager, setWidgetTitleMethods inherited from class com.hybris.cockpitng.util.ViewAnnotationAwareComposer
scanEventListenersMethods inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer
alert, didActivate, getPage, willClone, willPassivateMethods inherited from class org.zkoss.zk.ui.util.GenericComposer
doCatch, doFinallyMethods inherited from class org.zkoss.zk.ui.event.GenericEventListener
bindComponent, getController, onEvent, unbindComponent
-
Field Details
-
MODEL_DATE_FORMATTER
- See Also:
-
SOCKET_IN_INPUT_ITEM
- See Also:
-
SETTING_COMMENTS_LIST_RENDERER
- See Also:
-
SETTING_POPUP_POSITION
- See Also:
-
SETTING_DATE_FORMAT
- See Also:
-
SETTING_DEFAULT_COMMENTS_LIST_RENDERER
- See Also:
-
SETTING_DEFAULT_COMMENTS_DOMAIN
- See Also:
-
SETTING_DEFAULT_COMMENTS_COMPONENT
- See Also:
-
SETTING_DEFAULT_COMMENTS_COMMENT_TYPE
- See Also:
-
COMPONENT_SHOW_POPUP_BUTTON
@Deprecated(since="1811", forRemoval=true) protected static final String COMPONENT_SHOW_POPUP_BUTTONDeprecated, for removal: This API element is subject to removal in a future version.since 1811, the field is unused- See Also:
-
COMPONENT_COMMENTS_COUNT_LABEL
@Deprecated(since="1811", forRemoval=true) protected static final String COMPONENT_COMMENTS_COUNT_LABELDeprecated, for removal: This API element is subject to removal in a future version.since 1811, the field is unused- See Also:
-
COMPONENT_ADD_COMMENT_BUTTON
- See Also:
-
SCLASS_ADD_COMMENT_SECTION
- See Also:
-
SCLASS_ADD_COMMENT_SECTION_TEXTBOX
- See Also:
-
SCLASS_ADD_COMMENT_SECTION_BUTTON_OK
- See Also:
-
SCLASS_ADD_COMMENT_SECTION_BUTTON_CANCEL
- See Also:
-
SCLASS_ADD_COMMENT_SECTION_BUTTON_TRANSPARENT
- See Also:
-
SCLASS_COMMENTS_LIST_EMPTY
- See Also:
-
LABEL_NO_COMMENTS
- See Also:
-
MODEL_DATA_TYPE
- See Also:
-
MODEL_COMMENTS
- See Also:
-
MODEL_INPUT_ITEM
- See Also:
-
-
Constructor Details
-
ItemCommentsController
public ItemCommentsController()
-
-
Method Details
-
initialize
public void initialize(org.zkoss.zk.ui.Component component) - Overrides:
initializein classcom.hybris.cockpitng.util.DefaultWidgetController
-
onInputItemReceive
-
scrollToLastComment
protected void scrollToLastComment() -
showNewCommentSection
public void showNewCommentSection() -
onHeartbeat
public void onHeartbeat(com.hybris.cockpitng.core.events.CockpitEvent cockpitEvent) -
openPopup
public void openPopup() -
loadNewCommentsIfPossible
protected void loadNewCommentsIfPossible() throws com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectNotFoundException- Throws:
com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectNotFoundException
-
setOpenPopupAwareComponentsClickability
protected void setOpenPopupAwareComponentsClickability() -
getOpenPopupAwareComponents
-
setUIStateForOpenPopupAwareComponent
protected void setUIStateForOpenPopupAwareComponent(org.zkoss.zk.ui.Component component, boolean clickable) -
setOnClickEventListenersForOpenPopupAwareComponent
protected void setOnClickEventListenersForOpenPopupAwareComponent(org.zkoss.zk.ui.Component component, boolean clickable) -
isCommentsChanged
-
runWithReopeningPopup
protected void runWithReopeningPopup(com.hybris.cockpitng.core.Executable executable) Performs passed operation and closes and reopens comments popup so any modified elements in it will be recalculated correctly. If popup was closed is not opened again (in case to call this method fromonHeartbeat(CockpitEvent))- Parameters:
executable- passed operation which will be executed before popup will be reopened.
-
closePopup
protected void closePopup() -
createAddCommentContainer
protected org.zkoss.zul.Div createAddCommentContainer(org.zkoss.zul.Textbox textbox, org.zkoss.zul.Button okButton, org.zkoss.zul.Button cancelButton) -
createOkButtonEventListener
protected org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> createOkButtonEventListener(org.zkoss.zul.Textbox textbox) -
createCancelButtonListener
protected org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> createCancelButtonListener() -
tryToSaveItemComment
-
handleCommentSavingException
protected void handleCommentSavingException(com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectSavingException exception) -
addCommentToItem
protected void addCommentToItem(CommentModel newComment) throws com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectSavingException - Throws:
com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectSavingException
-
createNewComment
protected Optional<CommentModel> createNewComment(org.zkoss.zul.Textbox textbox) throws com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectCreationException - Throws:
com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectCreationException
-
notifyUserOfWrongSettings
-
createNewComment
protected Optional<CommentModel> createNewComment(String text, ComponentModel component, CommentTypeModel commentType) throws com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectCreationException - Throws:
com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectCreationException
-
getInputItemModel
-
getCommentsFromModel
-
render
protected void render() -
renderCommentsList
protected void renderCommentsList() -
renderContent
protected void renderContent() -
renderEmptyMessage
protected void renderEmptyMessage() -
renderComments
protected void renderComments() -
getDefaultDateFormat
-
initDataType
-
initDateFormatter
protected void initDateFormatter() -
initRenderer
protected void initRenderer() -
initPopupPosition
protected void initPopupPosition() -
sortAndSetComments
-
filterNotPermitted
-
canReadThisComment
-
canCreateComment
protected boolean canCreateComment() -
getCommentsListContainer
public org.zkoss.zul.Div getCommentsListContainer() -
setCommentsListContainer
public void setCommentsListContainer(org.zkoss.zul.Div commentsListContainer) -
getShowCommentsButton
public org.zkoss.zul.Button getShowCommentsButton() -
setShowCommentsButton
public void setShowCommentsButton(org.zkoss.zul.Button showCommentsButton) -
getCommentsCountLabel
public org.zkoss.zul.Label getCommentsCountLabel() -
setCommentsCountLabel
public void setCommentsCountLabel(org.zkoss.zul.Label commentsCountLabel) -
getPopupPosition
-
setPopupPosition
-
getCommentsPopup
public org.zkoss.zul.Popup getCommentsPopup() -
setCommentsPopup
public void setCommentsPopup(org.zkoss.zul.Popup commentsPopup) -
getAddCommentButton
public org.zkoss.zul.Button getAddCommentButton() -
setAddCommentButton
public void setAddCommentButton(org.zkoss.zul.Button addCommentButton) -
getAddCommentContainer
public org.zkoss.zul.Div getAddCommentContainer() -
setAddCommentContainer
public void setAddCommentContainer(org.zkoss.zul.Div addCommentContainer) -
getObjectFacade
public com.hybris.cockpitng.dataaccess.facades.object.ObjectFacade getObjectFacade() -
setObjectFacade
public void setObjectFacade(com.hybris.cockpitng.dataaccess.facades.object.ObjectFacade objectFacade) -
getTypeFacade
public com.hybris.cockpitng.dataaccess.facades.type.TypeFacade getTypeFacade() -
setTypeFacade
public void setTypeFacade(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade) -
getUserService
-
setUserService
-
getCommentService
-
setCommentService
-
getCommentRenderer
public com.hybris.cockpitng.widgets.common.WidgetComponentRenderer<org.zkoss.zul.Div,Void, getCommentRenderer()CommentModel> -
setCommentRenderer
public void setCommentRenderer(com.hybris.cockpitng.widgets.common.WidgetComponentRenderer<org.zkoss.zul.Div, Void, CommentModel> commentRenderer) -
getPermissionFacade
public com.hybris.cockpitng.dataaccess.facades.permissions.PermissionFacade getPermissionFacade() -
setPermissionFacade
public void setPermissionFacade(com.hybris.cockpitng.dataaccess.facades.permissions.PermissionFacade permissionFacade) -
getNotificationService
protected com.hybris.backoffice.widgets.notificationarea.NotificationService getNotificationService() -
setNotificationService
public void setNotificationService(com.hybris.backoffice.widgets.notificationarea.NotificationService notificationService) -
setUIDateRendererProvider
-
getUIDateRendererProvider
-