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
FieldsModifier and TypeFieldDescriptionprotected CurrentUserProviderThe current user providerprotected HelpManagerThe help manager to get url for each propertyprotected LockContentManagerLock Content Managerprotected org.slf4j.LoggerThe loggerprotected RenderingContextHandlerThe rendering context handlerprotected AmetysObjectResolverThe ametys object resolverprotected UserHelperUser helperFields inherited from class org.apache.cocoon.acting.ServiceableAction
managerFields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP -
Constructor Summary
Constructors -
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 booleancheckRestriction(Content content, ModelItem modelItem) Check if attribute can be editedprotected ModelItemgetDefinition(Content content, String attributePath) Get the definition to the given attribute pathgetLanguages(Request request) list all languages requested by the client in the requestvoidprotected UserIdentityisContentLocked(Content content) Check if the content is lockedvoidservice(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:
servicein interfaceServiceable- Overrides:
servicein classServiceableAction- Throws:
ServiceException
-
initialize
- Specified by:
initializein 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
-