public class CopyContentClientInteraction extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Field and Description |
---|---|
protected CopyContentMetadataComponent |
_copyContentComponent
The ametys component that handle content copy
|
protected JSONUtils |
_jsonUtils
JSON helper
|
Constructor and Description |
---|
CopyContentClientInteraction() |
Modifier and Type | Method and Description |
---|---|
protected void |
_buildReport(CopyReport copyReport,
Map<String,Object> mainContent,
List<Map<String,Object>> createdContents,
List<Map<String,Object>> editedContents,
List<Map<String,Object>> failedContentCopies,
List<Map<String,Object>> metadataErrors)
Helper method used to build the report (rootLevel is false)
|
protected void |
_buildReport(CopyReport copyReport,
Map<String,Object> mainContent,
List<Map<String,Object>> createdContents,
List<Map<String,Object>> editedContents,
List<Map<String,Object>> failedContentCopies,
List<Map<String,Object>> metadataErrors,
boolean rootLevel)
Helper method used to build the report
|
protected Map<String,Object> |
_buildReport(List<CopyReport> copyReports)
Build the copy report
|
protected List<String> |
_getCreatedContentIds(CopyReport copyReport)
Retrieve the identifiers of the created contents through the copy report
|
protected List<String> |
_getCreatedContentIds(List<CopyReport> copyReports)
Retrieve the identifiers of the created contents through the copy reports
|
protected List<String> |
_getEditedContentIds(List<CopyReport> copyReports)
Retrieve the identifiers of the edited contents through the copy reports
|
Map<String,Object> |
createContentByCopy(String baseContentId,
String newContentTitle,
String jsonMap,
String metadataSetNameToCopy,
String metadataSetTypeToCopy,
int initActionId,
int editActionId)
Creates a content by copy of another one.
Also handle the possible inner duplication depending on the duplication mode for each metadata of type "content". |
Map<String,Object> |
createContentByCopy(String baseContentId,
String newContentTitle,
String targetContentType,
String jsonMap,
String metadataSetNameToCopy,
String metadataSetTypeToCopy,
int initActionId,
int editActionId)
Creates a content by copy of another one.
Also handle the possible inner duplication depending on the duplication mode for each metadata of type "content". |
Map<String,Object> |
editContentByCopy(String baseContentId,
List<String> targetContentIds,
String jsonMap,
String metadataSetNameToCopy,
String metadataSetTypeToCopy)
Edits contents by copied of another one.
|
void |
service(ServiceManager sManager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected CopyContentMetadataComponent _copyContentComponent
protected JSONUtils _jsonUtils
public CopyContentClientInteraction()
public void service(ServiceManager sManager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> createContentByCopy(String baseContentId, String newContentTitle, String jsonMap, String metadataSetNameToCopy, String metadataSetTypeToCopy, int initActionId, int editActionId) throws Exception
baseContentId
- The id of content to copynewContentTitle
- The title of content to createjsonMap
- The metadata to copy as a JSON stringmetadataSetNameToCopy
- The metadata set name to copy. Can be nullmetadataSetTypeToCopy
- The metadata set type to copy. Can be nullinitActionId
- The init workflow action id for copyeditActionId
- The workflow action for editing contentException
- if an error occurred during copypublic Map<String,Object> createContentByCopy(String baseContentId, String newContentTitle, String targetContentType, String jsonMap, String metadataSetNameToCopy, String metadataSetTypeToCopy, int initActionId, int editActionId) throws Exception
baseContentId
- The id of content to copynewContentTitle
- The title of content to createjsonMap
- The metadata to copy as a JSON stringmetadataSetNameToCopy
- The metadata set name to copy. Can be nullmetadataSetTypeToCopy
- The metadata set type to copy. Can be nulltargetContentType
- The type of content to create. If null the type(s) of created content will be those of base content.initActionId
- The workflow action id for copy to init the new contenteditActionId
- The workflow action id for copy to edit the newly created contentException
- if an error occurred during copypublic Map<String,Object> editContentByCopy(String baseContentId, List<String> targetContentIds, String jsonMap, String metadataSetNameToCopy, String metadataSetTypeToCopy) throws Exception
baseContentId
- The id of content to copytargetContentIds
- The ids of content to editjsonMap
- The metadata to copy as a JSON stringmetadataSetNameToCopy
- The metadata set name to copy. Can be nullmetadataSetTypeToCopy
- The metadata set type to copy. Can be nullException
- if an error occurred during copyprotected Map<String,Object> _buildReport(List<CopyReport> copyReports)
copyReports
- List of copy reportprotected void _buildReport(CopyReport copyReport, Map<String,Object> mainContent, List<Map<String,Object>> createdContents, List<Map<String,Object>> editedContents, List<Map<String,Object>> failedContentCopies, List<Map<String,Object>> metadataErrors)
copyReport
- The report of the copymainContent
- The map that will receive the copy report informations during a creation at rootLevel.createdContents
- The list that will receive the copy report informations during a creation at another level.editedContents
- The list that will receive the copy report informations during something else than a creationfailedContentCopies
- The list that will receive th copy report informations if an error occurred during the copymetadataErrors
- The list of metadata errors reportedprotected void _buildReport(CopyReport copyReport, Map<String,Object> mainContent, List<Map<String,Object>> createdContents, List<Map<String,Object>> editedContents, List<Map<String,Object>> failedContentCopies, List<Map<String,Object>> metadataErrors, boolean rootLevel)
copyReport
- The report of the copymainContent
- The map that will receive the copy report informations during a creation at rootLevel.createdContents
- The list that will receive the copy report informations during a creation at another level.editedContents
- The list that will receive the copy report informations during something else than a creationfailedContentCopies
- The list that will receive th copy report informations if an error occurred during the copymetadataErrors
- The list of metadata errors reportedrootLevel
- True indicates the root level of the report.protected List<String> _getCreatedContentIds(CopyReport copyReport)
copyReport
- The report of the copyprotected List<String> _getCreatedContentIds(List<CopyReport> copyReports)
copyReports
- list of copy reportsprotected List<String> _getEditedContentIds(List<CopyReport> copyReports)
copyReports
- list of copy reports