public class SynchronizableContentsCollectionDAO extends AbstractLogEnabled implements Component, Serviceable, Initializable, Contextualizable, Disposable
SynchronizableContentsCollection
Modifier and Type | Field and Description |
---|---|
private static File |
__CONFIGURATION_FILE |
private ContentTypeExtensionPoint |
_contentTypeEP |
private Context |
_context |
private long |
_lastUpdate |
private ServiceManager |
_smanager |
private SynchronizeContentsCollectionModelExtensionPoint |
_syncCollectionModelEP |
private Map<String,SynchronizableContentsCollection> |
_synchronizableCollections |
private SynchronizingContentOperatorExtensionPoint |
_synchronizingContentOperatorEP |
private UserDirectoryFactory |
_userDirectoryFactory |
private UserPopulationDAO |
_userPopulationDAO |
private WorkflowProvider |
_workflowProvider |
static String |
ROLE
Avalon Role
|
Constructor and Description |
---|
SynchronizableContentsCollectionDAO() |
getLogger, setLogger
private static final File __CONFIGURATION_FILE
private Map<String,SynchronizableContentsCollection> _synchronizableCollections
private long _lastUpdate
private SynchronizeContentsCollectionModelExtensionPoint _syncCollectionModelEP
private ContentTypeExtensionPoint _contentTypeEP
private UserPopulationDAO _userPopulationDAO
private UserDirectoryFactory _userDirectoryFactory
private WorkflowProvider _workflowProvider
private SynchronizingContentOperatorExtensionPoint _synchronizingContentOperatorEP
private ServiceManager _smanager
public SynchronizableContentsCollectionDAO()
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> getSynchronizableContentsCollectionAsJson(String collectionId)
collectionId
- The id of the synchronizable contents collection to getSynchronizableContentsCollection
public Map<String,Object> getSynchronizableContentsCollectionAsJson(SynchronizableContentsCollection collection)
collection
- The synchronizable contents collection to getSynchronizableContentsCollection
public List<SynchronizableContentsCollection> getSynchronizableContentsCollections()
public SynchronizableContentsCollection getSynchronizableContentsCollection(String collectionId)
collectionId
- The id of collectionnull
if not foundprivate void _readFile(boolean forceRead)
private void _createFile(File file) throws IOException, TransformerConfigurationException, SAXException
private SynchronizableContentsCollection _createSynchronizableCollection(Configuration collectionConfig) throws ConfigurationException
ConfigurationException
public Map<String,Object> getEditionConfiguration() throws Exception
Exception
- If an error occurs.private boolean _isValidContentType(ContentType cType)
public Map<String,Object> getCollectionParameterValues(String collectionId)
collectionId
- The id of the collectionpublic List<Map<String,Object>> getSupportedUserDirectories(String populationId)
populationId
- The id of the user populationprivate List<String> _getDatasourceBasedUserDirectories(List<UserDirectory> userDirectories)
private boolean _writeFile()
private File _createBackup()
private void _restoreBackup(File backup, boolean errorOccured)
public String addCollection(Map<String,Object> values) throws ProcessingException
SynchronizableContentsCollection
values
- The parameters' valuesProcessingException
- if creation failedpublic Map<String,Object> editCollection(String id, Map<String,Object> values) throws ProcessingException
id
- The id of collection to editvalues
- The parameters' valuesProcessingException
- if edition failedprivate boolean _addCollection(String id, Map<String,Object> values) throws FileNotFoundException, IOException, TransformerConfigurationException, SAXException
private TransformerHandler _getTransformerHandler(OutputStream os) throws TransformerConfigurationException
public Map<String,Object> removeCollection(String id)
id
- The id of the collection to removeprivate String _generateUniqueId(String label)
private void _toSAX(TransformerHandler handler) throws SAXException
SAXException
private void _saxCollection(ContentHandler handler, String id, Map<String,Object> parameters) throws SAXException
SAXException
private void _saxCollection(ContentHandler handler, SynchronizableContentsCollection collection) throws SAXException
SAXException
private void _saxNonNullValue(ContentHandler handler, String tagName, Object value) throws SAXException
SAXException
private void _saxModel(ContentHandler handler, String modelId, Map<String,Object> paramValues, boolean withPrefix) throws SAXException
SAXException
public void dispose()
dispose
in interface Disposable