public class AmetysFrontEditionHelper extends Object implements Serviceable
Modifier and Type | Field and Description |
---|---|
private static AmetysObjectResolver |
_ametysObjectResolver |
private static ContentWorkflowHelper |
_contentWorkflowHelper |
private static HashCache |
_hashCache |
private static JSONUtils |
_jsonUtils |
private static PageHelper |
_pageHelper |
private static RichTextConfigurationExtensionPoint |
_richTextConfigurationExtensionPoint |
private static RightManager |
_rightManager |
private static SiteManager |
_siteManager |
private static WorkflowHelper |
_workflowHelper |
static String |
FRONT_EDITION_RIGHT_ID
The right's id from front-edition access
|
Constructor and Description |
---|
AmetysFrontEditionHelper() |
Modifier and Type | Method and Description |
---|---|
private static void |
_addRichTextConfigurationFiles(Map<String,Map<String,String>> files,
Map<String,String> filesInfos,
String locale,
boolean rtlMode,
boolean scripts) |
private static List<ClientSideElement.ScriptFile> |
_getRichTextConfigurationFiles(boolean scripts,
Map<String,Object> contextParameters) |
static String |
getContentModifiables(int actionId,
String inputPageId,
boolean checkEditionMode)
Get a string representing a json map of the contentIds with true/false if they can/can't be modified
|
String |
getContentStatus(Content content)
check if a content is published ot not
|
String |
getContentStatus(String contentId)
check if a content is published ot not
|
long |
getContentWorkflowId(Content content)
Get the workflow step id of a content
|
long |
getContentWorkflowId(String contentId)
Get the workflow step id of a content
|
String |
getPageStatus(String pageId)
Get the status (validated/draft) of all contents in a page
|
static String |
getWorkflowName(String workflowName,
int actionId)
Get the name of a workflow action
|
long |
getZoneItemPosition(String zoneItemId,
String pageId)
Get the position of this zoneItem in the zone, or -1 if not found
|
long |
getZoneSize(String zoneName,
String pageId)
Return the size of a zone
|
static boolean |
hasFrontEditionRight()
Check if the current user has the Front_Edition_Access_Right right
|
static boolean |
hasFrontEditionRight(String rightId,
String inputPageId)
Deprecated.
Use the version with three arguments
|
static boolean |
hasFrontEditionRight(String rightId,
String objectId,
boolean editionModeOnly)
Check if we can display the front edition button for a specific right
Checks :
* Rendering context == front
* Edition mode
* Front_Edition_Access_Right
* RightId available
|
static boolean |
hasWorkflowRight(int actionId,
String contentId,
boolean checkEditionMode)
Check if the current workflow action is available on this content
|
static boolean |
hasWorkflowRight(List<Integer> actionIds,
Content content,
boolean checkEditionMode)
Check if a list of workflow actions are available on this content
|
static boolean |
hasWorkflowRight(List<Integer> actionIds,
String contentId,
boolean checkEditionMode)
Check if a list of workflow actions are available on this content
|
boolean |
isContentLive(Content content)
check if a content is published ot not
|
boolean |
isContentLive(String contentId)
check if a content is published ot not
|
static String |
prepareCSSFiles(String locale,
boolean rtlMode)
Prepare a hashcode for css files
|
static String |
prepareJSFiles(String locale,
boolean rtlMode)
Prepare a hashcode for js files
|
void |
service(ServiceManager manager) |
public static final String FRONT_EDITION_RIGHT_ID
private static AmetysObjectResolver _ametysObjectResolver
private static HashCache _hashCache
private static RichTextConfigurationExtensionPoint _richTextConfigurationExtensionPoint
private static RightManager _rightManager
private static ContentWorkflowHelper _contentWorkflowHelper
private static PageHelper _pageHelper
private static WorkflowHelper _workflowHelper
private static JSONUtils _jsonUtils
private static SiteManager _siteManager
public AmetysFrontEditionHelper()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public static String prepareJSFiles(String locale, boolean rtlMode)
locale
- The language code to usertlMode
- Is for right-to-left language?public static String prepareCSSFiles(String locale, boolean rtlMode)
locale
- The language code to usertlMode
- Is for right-to-left language?private static List<ClientSideElement.ScriptFile> _getRichTextConfigurationFiles(boolean scripts, Map<String,Object> contextParameters)
private static void _addRichTextConfigurationFiles(Map<String,Map<String,String>> files, Map<String,String> filesInfos, String locale, boolean rtlMode, boolean scripts)
@Deprecated public static boolean hasFrontEditionRight(String rightId, String inputPageId)
rightId
- right to check (can be null)inputPageId
- page to checkpublic static boolean hasFrontEditionRight(String rightId, String objectId, boolean editionModeOnly)
rightId
- right to check (can be null)objectId
- page/content to checkeditionModeOnly
- Check if the user is in edition modepublic static boolean hasFrontEditionRight()
public static boolean hasWorkflowRight(int actionId, String contentId, boolean checkEditionMode)
actionId
- action to checkcontentId
- content to checkcheckEditionMode
- check also if we are in edition modepublic static boolean hasWorkflowRight(List<Integer> actionIds, String contentId, boolean checkEditionMode)
actionIds
- list of action idscontentId
- id of the content to checkcheckEditionMode
- check also if we are in edition modepublic static boolean hasWorkflowRight(List<Integer> actionIds, Content content, boolean checkEditionMode)
actionIds
- list of action idscontent
- content to checkcheckEditionMode
- check also if we are in edition modepublic static String getContentModifiables(int actionId, String inputPageId, boolean checkEditionMode)
actionId
- action to checkinputPageId
- page (can be null)checkEditionMode
- check also if we are in edition modepublic static String getWorkflowName(String workflowName, int actionId)
workflowName
- workflow nameactionId
- action id in the workflowpublic String getPageStatus(String pageId)
pageId
- id of the page to checkpublic long getContentWorkflowId(String contentId)
contentId
- id of the contentpublic long getContentWorkflowId(Content content)
content
- contentpublic String getContentStatus(String contentId)
contentId
- id of the contentpublic String getContentStatus(Content content)
content
- contentpublic boolean isContentLive(String contentId)
contentId
- id of the contentpublic boolean isContentLive(Content content)
content
- contentpublic long getZoneItemPosition(String zoneItemId, String pageId) throws UnknownAmetysObjectException, AmetysRepositoryException, RepositoryException
zoneItemId
- zoneitem to searchpageId
- page idUnknownAmetysObjectException
- If an error occurredAmetysRepositoryException
- If an error occurredRepositoryException
- If an error occurredpublic long getZoneSize(String zoneName, String pageId)
zoneName
- zone namepageId
- page Id