com.cognifide.slice.cq.model
Class WcmModeModel
java.lang.Object
com.cognifide.slice.cq.model.WcmModeModel
public class WcmModeModel
- extends Object
Stores WCM mode properties. WCM mode is a state of the page - can be either one of:
- DISABLED - (a.k.a publish mode), default mode on publish instance, no controls visible
- EDIT - default mode on author instance, blue boxes visible
- PREVIEW - default mode for author's preview, should render exactly what DISABLED does
- READ_ONLY - default mode for author when a permission to write is not granted
- DESIGN - allows setting e.g. paragraph system design properties on author instance
The class stores the raw WCM mode and a set of boolean variables to be set for ease of access in the view.
- Author:
- Jan Kuźniak
- See Also:
WCMMode
|
Constructor Summary |
WcmModeModel(com.day.cq.wcm.api.WCMMode wcmMode)
Creates model instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REAL_AUTHOR
public static final String REAL_AUTHOR
- TODO what is this?
- See Also:
- Constant Field Values
WcmModeModel
@Inject
public WcmModeModel(com.day.cq.wcm.api.WCMMode wcmMode)
- Creates model instance.
- Parameters:
wcmMode - the WCM mode.
getWcmMode
public com.day.cq.wcm.api.WCMMode getWcmMode()
- Returns:
- the native WCM mode
isDisabled
public boolean isDisabled()
- Returns:
- true if WCM is disabled, false otherwise
isEdit
public boolean isEdit()
- Returns:
- true if WCM is in edit mode, false otherwise
isPreview
public boolean isPreview()
- Returns:
- true if WCM is in preview mode, false otherwise
isReadOnly
public boolean isReadOnly()
- Returns:
- true if WCM is in read only mode, false otherwise
isDesign
public boolean isDesign()
- Returns:
- true if WCM is in design, false otherwise
isAuthor
public boolean isAuthor()
- Returns:
- true if WCM is in edit mode or design mode, false otherwise
isPublish
public boolean isPublish()
- Returns:
- true if WCM is neither in edit mode nor design mode, false otherwise
Copyright © 2012-2013 Cognifide Limited. All Rights Reserved.