Class IORelationAdapter
- java.lang.Object
-
- org.nuxeo.ecm.platform.io.api.AbstractIOResourceAdapter
-
- org.nuxeo.ecm.platform.relations.io.IORelationAdapter
-
- All Implemented Interfaces:
Serializable,IOResourceAdapter
public class IORelationAdapter extends AbstractIOResourceAdapter
Adapter for import/export of relations- Author:
- Anahide Tchertchian
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.nuxeo.ecm.platform.io.api.AbstractIOResourceAdapter
properties
-
-
Constructor Summary
Constructors Constructor Description IORelationAdapter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IOResourcesextractResources(String repo, Collection<DocumentRef> sources)Extract relations involving given documents.protected List<Statement>filterMatchingStatements(List<Statement> statements)protected DocumentRefgetDocumentRef(RelationManager relManager, QNameResource resource)protected StatementgetFilteredStatement(Statement statement)protected List<Statement>getMatchingStatements(Graph graph, Resource resource)protected RelationManagergetRelationManager()voidgetResourcesAsXML(OutputStream out, IOResources resources)Export resources as XML.IOResourcesloadResourcesFromXML(InputStream in)Returns resources built from given stream.voidsetProperties(Map<String,Serializable> properties)Set properties.voidstoreResources(IOResources resources)Persists resources.IOResourcestranslateResources(String repo, IOResources resources, DocumentTranslationMap map)Returns translated resources once copy has been done, passing a correspondence map.protected static StatementupdateDate(Statement statement, Literal newDate, List<Resource> properties)-
Methods inherited from class org.nuxeo.ecm.platform.io.api.AbstractIOResourceAdapter
getBooleanProperty, getProperties, getStringArrayProperty, getStringProperty, setBooleanProperty, setStringArrayProperty, setStringProperty
-
-
-
-
Constructor Detail
-
IORelationAdapter
public IORelationAdapter()
-
-
Method Detail
-
setProperties
public void setProperties(Map<String,Serializable> properties)
Description copied from interface:IOResourceAdapterSet properties.- Specified by:
setPropertiesin interfaceIOResourceAdapter- Overrides:
setPropertiesin classAbstractIOResourceAdapter
-
getRelationManager
protected RelationManager getRelationManager()
-
getMatchingStatements
protected List<Statement> getMatchingStatements(Graph graph, Resource resource)
-
getFilteredStatement
protected Statement getFilteredStatement(Statement statement)
-
filterMatchingStatements
protected List<Statement> filterMatchingStatements(List<Statement> statements)
-
getDocumentRef
protected DocumentRef getDocumentRef(RelationManager relManager, QNameResource resource)
-
extractResources
public IOResources extractResources(String repo, Collection<DocumentRef> sources)
Extract relations involving given documents.The adapter properties will filter which relations must be taken into account.
- Specified by:
extractResourcesin interfaceIOResourceAdapter- Specified by:
extractResourcesin classAbstractIOResourceAdapter- Parameters:
repo- TODOsources- locations of documents to consider. Has to include documents children if needed.- Returns:
- a structure holding associated resources.
-
getResourcesAsXML
public void getResourcesAsXML(OutputStream out, IOResources resources)
Description copied from interface:IOResourceAdapterExport resources as XML.- Specified by:
getResourcesAsXMLin interfaceIOResourceAdapter- Specified by:
getResourcesAsXMLin classAbstractIOResourceAdapter- Parameters:
out- stream where export will be written.resources- resources previously extracted thanks toIOResourceAdapter.extractResources(String, Collection)orIOResourceAdapter.translateResources(String, IOResources, DocumentTranslationMap)
-
loadResourcesFromXML
public IOResources loadResourcesFromXML(InputStream in)
Description copied from interface:IOResourceAdapterReturns resources built from given stream.- Specified by:
loadResourcesFromXMLin interfaceIOResourceAdapter- Specified by:
loadResourcesFromXMLin classAbstractIOResourceAdapter
-
storeResources
public void storeResources(IOResources resources)
Description copied from interface:IOResourceAdapterPersists resources.- Specified by:
storeResourcesin interfaceIOResourceAdapter- Specified by:
storeResourcesin classAbstractIOResourceAdapter- Parameters:
resources- resources previously extracted thanks toIOResourceAdapter.extractResources(String, Collection)orIOResourceAdapter.translateResources(String, IOResources, DocumentTranslationMap)
-
updateDate
protected static Statement updateDate(Statement statement, Literal newDate, List<Resource> properties)
-
translateResources
public IOResources translateResources(String repo, IOResources resources, DocumentTranslationMap map)
Description copied from interface:IOResourceAdapterReturns translated resources once copy has been done, passing a correspondence map.- Specified by:
translateResourcesin interfaceIOResourceAdapter- Specified by:
translateResourcesin classAbstractIOResourceAdapter- Parameters:
repo- target repository for resources.resources- resources previously extracted thanks toIOResourceAdapter.extractResources(String, Collection)map- correspondence map between old locations and new ones.- Returns:
- translated resources.
-
-