Package org.ametys.plugins.frontedition
Class GetServerValuesAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.plugins.frontedition.GetServerValuesAction
- All Implemented Interfaces:
Initializable
,Component
,LogEnabled
,Serviceable
,Action
Check if the content can be edited, and return the value
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerprotected HelpManager
The help manager to get url for each propertyprotected LockContentManager
Lock Content Managerprotected Logger
The loggerprotected RenderingContextHandler
The rendering context handlerprotected AmetysObjectResolver
The ametys object resolverprotected UserHelper
User helperFields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_contentAttribute2Json
(Content content, ModelItem modelItem, String attributePath, List<String> languages) Convert the content attribute at the given path into a JSON objectprotected String
_getModelItemHelpLink
(ModelItem modelItem, List<String> languages) Retrieves the Help link for the given model itemact
(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) protected boolean
checkRestriction
(Content content, ModelItem modelItem) Check if attribute can be editedprotected ModelItem
getDefinition
(Content content, String attributePath) Get the definition to the given attribute pathgetLanguages
(Request request) list all languages requested by the client in the requestvoid
protected UserIdentity
isContentLocked
(Content content) Check if the content is lockedvoid
service
(ServiceManager serviceManager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_logger
The logger -
_resolver
The ametys object resolver -
_currentUserProvider
The current user provider -
_renderingContextHandler
The rendering context handler -
_userHelper
User helper -
_lockContentManager
Lock Content Manager -
_helpManager
The help manager to get url for each property
-
-
Constructor Details
-
GetServerValuesAction
public GetServerValuesAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception -
checkRestriction
Check if attribute can be edited- Parameters:
content
- the contentmodelItem
- the definition of attribute- Returns:
- true if the attribute can be edited
-
isContentLocked
Check if the content is locked- Parameters:
content
- The content- Returns:
- UserIdentity of the locker, of null if not locked
-
getLanguages
list all languages requested by the client in the request- Parameters:
request
- the request- Returns:
- an ordered list of all languages requested by the client (or server default locale if none requested by the client)
-
getDefinition
protected ModelItem getDefinition(Content content, String attributePath) throws ProcessingException, AmetysRepositoryException Get the definition to the given attribute path- Parameters:
content
- the contentattributePath
- the path of the attribute- Returns:
- the model item
- Throws:
ProcessingException
- if the attribute is not defined by the modelAmetysRepositoryException
- if an error occurred
-
_contentAttribute2Json
protected Map<String,Object> _contentAttribute2Json(Content content, ModelItem modelItem, String attributePath, List<String> languages) throws ProcessingException Convert the content attribute at the given path into a JSON object- Parameters:
content
- the contentmodelItem
- the attribute definitionattributePath
- the path of the attribute to convertlanguages
- all languages requested by the client- Returns:
- the attribute as a JSON object
- Throws:
ProcessingException
- if an error occurs
-
_getModelItemHelpLink
Retrieves the Help link for the given model item- Parameters:
modelItem
- the model itemlanguages
- all languages requested by the client- Returns:
- the help link
-