public class ContentBackupClientInteraction extends AbstractLogEnabled implements Serviceable, Component
| Modifier and Type | Field and Description | 
|---|---|
private static String | 
__AUTOSAVE_COMMENTS  | 
private static String | 
__AUTOSAVE_CREATOR  | 
private static String | 
__AUTOSAVE_INVALID_VALUES  | 
private static String | 
__AUTOSAVE_NODETYPE  | 
private static String | 
__AUTOSAVE_REPEATERS  | 
private static String | 
__AUTOSAVE_TEMP_DATE  | 
private static String | 
__AUTOSAVE_VALUES  | 
private static String | 
__METADATA_NAME  | 
private static String | 
__METADATA_VALUE  | 
private static String | 
__REPEATER_COUNT  | 
private static String | 
__REPEATER_NAME  | 
private static String | 
__REPEATER_PREFIX  | 
private CurrentUserProvider | 
_currentUserProvider  | 
private JSONUtils | 
_jsonUtils  | 
private AmetysObjectResolver | 
_resolver  | 
| Constructor and Description | 
|---|
ContentBackupClientInteraction()  | 
| Modifier and Type | Method and Description | 
|---|---|
private Object | 
_decodeValue(String value)  | 
private String | 
_encodeValue(Object value)  | 
private Map<String,Object> | 
_getBackupData(CompositeMetadata metadataHolder)  | 
Map<String,Object> | 
deleteContentBackup(String contentId)
Delete an automatic backup for a content. 
 | 
Map<String,Object> | 
getContentBackup(String contentId)
Get the content backup information 
 | 
protected DefaultTraversableAmetysObject | 
getContentNode(String contentId,
              boolean createNew)
Get the storage node for a content in the automatic backup space, or create it if it doesn't exist. 
 | 
protected DefaultTraversableAmetysObject | 
getOrCreateTempRoot()
Get the temporary backup root, or create it if it doesn't exist. 
 | 
protected void | 
removeAllComposites(ModifiableCompositeMetadata meta)
Remove all the composite metadatas of a given composite. 
 | 
void | 
service(ServiceManager manager)  | 
Map<String,Object> | 
setContentBackup(String contentId,
                Map<String,Object> values,
                Map<String,Object> invalidValues,
                String comments,
                Collection<Map<String,String>> repeaters)
Store an automatic backup for a content. 
 | 
protected void | 
storeRepeaters(Collection<Map<String,String>> repeaters,
              ModifiableCompositeMetadata repeatersMeta)
Store the repeater item counts to be able to re-initialize them. 
 | 
protected void | 
storeValues(Map<String,Object> values,
           ModifiableCompositeMetadata valuesMeta)
Store the metadata values (in composites named 1, 2, 3...) 
 | 
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerprivate static final String __AUTOSAVE_NODETYPE
private static final String __AUTOSAVE_CREATOR
private static final String __AUTOSAVE_TEMP_DATE
private static final String __AUTOSAVE_COMMENTS
private static final String __AUTOSAVE_VALUES
private static final String __AUTOSAVE_INVALID_VALUES
private static final String __AUTOSAVE_REPEATERS
private static final String __METADATA_NAME
private static final String __METADATA_VALUE
private static final String __REPEATER_NAME
private static final String __REPEATER_COUNT
private static final String __REPEATER_PREFIX
private AmetysObjectResolver _resolver
private CurrentUserProvider _currentUserProvider
private JSONUtils _jsonUtils
public ContentBackupClientInteraction()
public void service(ServiceManager manager) throws ServiceException
service in interface ServiceableServiceExceptionpublic Map<String,Object> getContentBackup(String contentId)
contentId - The content idprivate Map<String,Object> _getBackupData(CompositeMetadata metadataHolder)
public Map<String,Object> deleteContentBackup(String contentId)
contentId - The content idpublic Map<String,Object> setContentBackup(String contentId, Map<String,Object> values, Map<String,Object> invalidValues, String comments, Collection<Map<String,String>> repeaters)
contentId - The content idvalues - The valid values to storeinvalidValues - The invalid values to storecomments - The comments as JSON stringrepeaters - The repeaters to storeprotected void storeValues(Map<String,Object> values, ModifiableCompositeMetadata valuesMeta)
values - the meta values to store, as a Map of values, indexed by name.valuesMeta - the composite metadata to store the values in.private String _encodeValue(Object value)
private Object _decodeValue(String value)
protected void storeRepeaters(Collection<Map<String,String>> repeaters, ModifiableCompositeMetadata repeatersMeta)
repeaters - the repeaters data.repeatersMeta - the composite metadata to store the repeaters in.protected void removeAllComposites(ModifiableCompositeMetadata meta)
meta - the metadata to clear.protected DefaultTraversableAmetysObject getContentNode(String contentId, boolean createNew)
contentId - the content ID.createNew - true to create automatically the node when missing.protected DefaultTraversableAmetysObject getOrCreateTempRoot()