Class GetOnlyOfficeReponse
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.plugins.workspaces.documents.onlyoffice.GetOnlyOfficeReponse
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
public class GetOnlyOfficeReponse extends ServiceableAction
Action to handle OnlyOffice comunications
-
-
Field Summary
Fields Modifier and Type Field Description protected JSONUtils
_jsonUtils
json utilprotected AmetysObjectResolver
_resolver
resolverprotected WorkspaceExplorerResourceDAO
_workspaceExplorerResourceDAO
workspace explorer resource DAO-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description GetOnlyOfficeReponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
protected List<Map<String,Object>>
actionFromUser(Map<String,Object> message)
take actions parameter and cast all informations insideprotected Integer
callbackHandler(Map<String,Object> message, String resourceId)
Analyze sample of JSON object from document editing service on OnlyOffice Serverprotected Integer
documentClosedWithNoChanges(Map<String,Object> message)
The document is closed for editing with no changes by the last user.protected Integer
documentNotFound(Map<String,Object> message)
no document with the key identifier could be foundprotected Integer
forceSaveDocument(Map<String,Object> message, String resourceId)
the force saving request is performed.protected Map<String,Object>
processSave(String downloadUri, String resourceId)
Save the documentprotected Integer
saveDocument(Map<String,Object> message, String resourceId)
Save the documentvoid
service(ServiceManager smanager)
protected Integer
userConnection(Map<String,Object> message)
Check connection of user-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_jsonUtils
protected JSONUtils _jsonUtils
json util
-
_resolver
protected AmetysObjectResolver _resolver
resolver
-
_workspaceExplorerResourceDAO
protected WorkspaceExplorerResourceDAO _workspaceExplorerResourceDAO
workspace explorer resource DAO
-
-
Constructor Detail
-
GetOnlyOfficeReponse
public GetOnlyOfficeReponse()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
- Throws:
Exception
-
callbackHandler
protected Integer callbackHandler(Map<String,Object> message, String resourceId)
Analyze sample of JSON object from document editing service on OnlyOffice Server- Parameters:
message
- Map <String, Object>resourceId
- id of the file- Returns:
- value of error for the document editing service
-
actionFromUser
protected List<Map<String,Object>> actionFromUser(Map<String,Object> message)
take actions parameter and cast all informations inside- Parameters:
message
- is a JSON object received from Document Editing Service- Returns:
- Lists of actions or null
-
documentNotFound
protected Integer documentNotFound(Map<String,Object> message)
no document with the key identifier could be found- Parameters:
message
- is a JSON object received from Document Editing Service- Returns:
- 0 (success)
-
userConnection
protected Integer userConnection(Map<String,Object> message)
Check connection of user- Parameters:
message
- is a JSON object received from Document Editing Service- Returns:
- 0 (success) or 1 (error)
-
processSave
protected Map<String,Object> processSave(String downloadUri, String resourceId)
Save the document- Parameters:
downloadUri
- link of the new file to saveresourceId
- id of the resource to update- Returns:
- null or the map of the new file
-
forceSaveDocument
protected Integer forceSaveDocument(Map<String,Object> message, String resourceId)
the force saving request is performed.- Parameters:
message
- is a JSON object received from Document Editing ServiceresourceId
- id document- Returns:
- 0 (success) or 1 (error)
-
saveDocument
protected Integer saveDocument(Map<String,Object> message, String resourceId)
Save the document- Parameters:
message
- is a JSON object received from Document Editing ServiceresourceId
- id document- Returns:
- 0 (success) or 1 (error)
-
documentClosedWithNoChanges
protected Integer documentClosedWithNoChanges(Map<String,Object> message)
The document is closed for editing with no changes by the last user. Display who closed it.- Parameters:
message
- is a JSON object received from Document Editing Service- Returns:
- 0 (success) or 1 (error)
-
-