|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.centrasite.importexport.ExportOperation
public class ExportOperation
Exporting registry objects and their related objects into a zip-archive.
The objects to be added are specified with the addExportXxx methods.
The export can handle single objects as well as more complex like asset types with assets,
taxonomies with its instances or organizations with all their related objects.
For example exporting a taxonomy will additionally export all the corresponding
categories. Together with the objects, their audit trail meaning the history of
their modifications, will be exported.
All the exported registry objects are represented as xml files within the
zip-archive.
Repository objects will be copied into a sub-directory named 'webDAV' within the zip-archive. The entire pathname of the repository object will be kept in the archive.
Using the IEventCallback interface messages like errors, warnings and informational messages are communicated.
Example: OutputStream os = new FileOutputStream("myfile.zip"); ExportOperation eo = new ExportOperation("http://localhost:53305/CentraSite/CentraSite", "usr", "pwd", os); eo.addExportObject(regObj); eo.execute();
The export set may also be determined by a prepared query. This query can be prepared as a 'saved search'
in webdav, see addSavedSearchObjects(String, String)
, or directly be specified as query file,
see addSearchFromFile(java.lang.String)
.
Also the objects to be exported can be filtered with the modifiedSince time stamp. So only objects which
were created or modified after the given time stamp are selected for export, see setModifiedSince(String)
.
Example: export with saved search, modified since 2 hours: OutputStream os = new FileOutputStream("myfile.zip"); ExportOperation eo = new ExportOperation("http://localhost:53305/CentraSite/CentraSite", "usr", "pwd", os); eo.addSavedSearchObjects("MySavedSearch"); eo.setModifiedSince("PT2H"); eo.execute();
Nested Class Summary | |
---|---|
static class |
ExportOperation.CollectorResults
|
static class |
ExportOperation.ExportOrganizationMode
Organization export mode. |
Field Summary | |
---|---|
static ExportOperation.ExportOrganizationMode |
exportOrganizationModeDefault
|
Constructor Summary | |
---|---|
ExportOperation(com.centrasite.jaxr.CentraSiteConnection connection,
java.io.OutputStream outputStream)
|
|
ExportOperation(java.lang.String centraSiteUrl,
java.lang.String user,
java.lang.String password,
java.io.OutputStream outputStream)
Constructs a CentraSite export instance. |
Method Summary | |
---|---|
void |
addExportKey(javax.xml.registry.infomodel.Key key)
Add a key of an object to the collection of keys to be exported. |
void |
addExportKeys(java.util.Collection<javax.xml.registry.infomodel.Key> keyCollection)
Add a collection of object keys to the collection of keys to be exported. |
void |
addExportObject(javax.xml.registry.infomodel.RegistryObject registryObject)
Add a registry object to the collection of objects to be exported. |
void |
addExportObjects(java.util.Collection<javax.xml.registry.infomodel.RegistryObject> registryObjectsCollection)
Add a collection of registry objects to the collection of objects to be exported. |
void |
addSavedSearchObjects(java.lang.String savedSearchName)
Add the objects from a saved search, given by its name to the objects for export. |
void |
addSavedSearchObjects(java.lang.String savedSearchName,
java.lang.String userName)
Add the objects from a saved search, given by its name to the objects for export. |
void |
addSearchFromFile(java.lang.String queryFileName)
Add the objects executed by the search, given by its file name to the objects for export. |
void |
close()
Close connections and resources of an open ExportOperation. |
void |
execute()
Export execution. |
java.util.List<ExportOperation.CollectorResults> |
getCollectorResult()
|
javax.xml.registry.infomodel.Concept |
getConcept(java.lang.String conceptValue)
Get concept using the name of the concept. |
int |
getExportObjectCount()
Return the object count to be exported. |
javax.xml.registry.infomodel.Key |
getKey(java.lang.String keyValue)
Create key of a registryObject using the key given as a String |
java.util.Collection<javax.xml.registry.infomodel.RegistryObject> |
getMainObjectsToExport()
Get all main objects to be exported. |
java.util.Map<javax.xml.registry.infomodel.RegistryObject,java.util.Collection<javax.xml.registry.infomodel.RegistryObject>> |
getMainObjectsToExportMap()
Get all selected objects to be exported as a map. |
static void |
main(java.lang.String[] args)
main entry point. |
void |
removeExportObject(javax.xml.registry.infomodel.RegistryObject registryObject)
Remove the object from the set of objects to be exported. |
void |
removeExportObject(java.lang.String key)
Remove the object from the set of objects to be exported. |
void |
removeExportObjects(java.util.Collection<java.lang.String> keys)
Remove the objects from the set of objects to be exported. |
void |
setCheckUnreferencedAssociations(boolean checkUnreferencedAssociations)
Set whether to check for unreferenced objects during export. |
void |
setDeleteAfterExport(boolean isObjectsDeletedAfterExport)
Set whether to delete registry objects after export. |
void |
setErrorMessageLocale(java.util.Locale locale)
set the error message locale. |
void |
setEventCallback(com.centrasite.jaxr.importexport.IEventCallback eventCallback)
Sets a callback class which is called for messages (errors, warnings, informational). |
void |
setEventCallback(com.centrasite.importexport.IEventCallback eventCallback)
Deprecated. please use setEventCallback(com.centrasite.jaxr.importexport.IEventCallback) |
void |
setExportOrganizationMode(ExportOperation.ExportOrganizationMode mode)
Set the export mode for exporting organizations. |
void |
setHeterogeneousObjectsExport(boolean isHeterogeneousObjectsExport)
|
void |
setIncludeChildOrganizations(boolean includeChildOrganizations)
Indicates if child organization should be exported with its parent organization. |
void |
setIncludeChildren(boolean isChildrenIncluded)
Deprecated. |
void |
setIncludeExternalLinks(boolean isExternalLinksIncluded)
Deprecated. |
void |
setIncludeImports(boolean isImportsIncluded)
Deprecated. |
void |
setIncludeInstances(boolean isInstancesIncluded)
Set whether to include instances of asset types or the classified objects of taxonomies. |
void |
setIncludeInstancesOfLCM(boolean isInstancesIncludedForLCM)
|
void |
setIncludeInstancesOfTaxonomy(boolean isInstancesIncludedForTaxonomy)
|
void |
setIncludeInstancesOfType(boolean isInstancesIncludedForType)
|
void |
setIncludeReferencedAssets(boolean includeReferencedAssets)
Indicates if referenced assets should also be exported. |
void |
setIncludeReferencedAssetsOfAsset(boolean includeReferencedAssetsOfAsset)
|
void |
setIncludeReferencedAssetsOfLCM(boolean includeReferencedAssetsOfLCM)
|
void |
setIncludeReferencedAssetsOfTaxonomy(boolean includeReferencedAssetsOfTaxonomy)
|
void |
setIncludeReferencedAssetsOfType(boolean includeReferencedAssetsOfType)
|
void |
setIncludeTypeInfo(boolean isTypeInfoIncluded)
Deprecated. |
void |
setMinimizeAuditableEvents(boolean minimizeAuditableEvents)
Controls the amount of audit trail for the objects. |
void |
setModifiedSince(java.lang.String timeSpec)
Sets the time stamp for filtering the objects to export which were created/modified after this time stamp. |
void |
setOrgWithAssets(boolean orgWithAssets)
Indicates if assets of organization should be exported with the organization. |
void |
setOutputStream(java.io.OutputStream outputStream)
|
void |
setRepositoryRoot(java.lang.String repositoryRoot)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ExportOperation.ExportOrganizationMode exportOrganizationModeDefault
Constructor Detail |
---|
public ExportOperation(com.centrasite.jaxr.CentraSiteConnection connection, java.io.OutputStream outputStream) throws java.lang.Exception
java.lang.Exception
public ExportOperation(java.lang.String centraSiteUrl, java.lang.String user, java.lang.String password, java.io.OutputStream outputStream) throws java.lang.Exception
centraSiteUrl
- the URL of the CentraSite databaseuser
- the user namepassword
- the password of the useroutputStream
- the stream the export archive goes to
java.lang.Exception
- error connecting to CentraSiteMethod Detail |
---|
public void setExportOrganizationMode(ExportOperation.ExportOrganizationMode mode)
mode
- the ExportOrganizationModepublic void setIncludeChildOrganizations(boolean includeChildOrganizations)
includeChildOrganizations
- true: include child organizations (default);
false: no child organizationspublic void setIncludeReferencedAssets(boolean includeReferencedAssets)
includeReferencedAssets
- true: include referenced assets;
false: do not include referenced assets (default)public void setHeterogeneousObjectsExport(boolean isHeterogeneousObjectsExport)
public void setOrgWithAssets(boolean orgWithAssets)
orgWithAssets
- true: include assets of organizations;
false: no assets with organizations (default)public void setMinimizeAuditableEvents(boolean minimizeAuditableEvents)
minimizeAuditableEvents
- true: minimum auditable events for the objects;
false: full amount of auditable events (default)public final void setEventCallback(com.centrasite.jaxr.importexport.IEventCallback eventCallback)
eventCallback
- the instance of the message callback class;
null: no message callback (default)public final void setEventCallback(com.centrasite.importexport.IEventCallback eventCallback)
public void setIncludeExternalLinks(boolean isExternalLinksIncluded)
public void setIncludeChildren(boolean isChildrenIncluded)
public void setIncludeImports(boolean isImportsIncluded)
public void setIncludeTypeInfo(boolean isTypeInfoIncluded)
public void setIncludeInstances(boolean isInstancesIncluded)
isInstancesIncluded
- true: include the instances (default);
false: no instancespublic void setIncludeInstancesOfTaxonomy(boolean isInstancesIncludedForTaxonomy)
public void setIncludeReferencedAssetsOfTaxonomy(boolean includeReferencedAssetsOfTaxonomy)
public void setIncludeInstancesOfLCM(boolean isInstancesIncludedForLCM)
public void setIncludeReferencedAssetsOfLCM(boolean includeReferencedAssetsOfLCM)
public void setIncludeInstancesOfType(boolean isInstancesIncludedForType)
public void setIncludeReferencedAssetsOfType(boolean includeReferencedAssetsOfType)
public void setIncludeReferencedAssetsOfAsset(boolean includeReferencedAssetsOfAsset)
public void setDeleteAfterExport(boolean isObjectsDeletedAfterExport)
isObjectsDeletedAfterExport
- true: delete objects after export;
false: do not delete objects (default)public final void setCheckUnreferencedAssociations(boolean checkUnreferencedAssociations)
checkUnreferencedAssociations
- true: check for unreferenced objects (default);
false: no checkspublic void setRepositoryRoot(java.lang.String repositoryRoot)
public void setOutputStream(java.io.OutputStream outputStream)
public void addExportKey(javax.xml.registry.infomodel.Key key) throws javax.xml.registry.JAXRException
key
- the key of the object to be exported
javax.xml.registry.JAXRException
public void addExportKeys(java.util.Collection<javax.xml.registry.infomodel.Key> keyCollection) throws javax.xml.registry.JAXRException
keyCollection
- the collection of keys to be exported
javax.xml.registry.JAXRException
public void addExportObject(javax.xml.registry.infomodel.RegistryObject registryObject) throws javax.xml.registry.JAXRException
registryObject
- the registry object
javax.xml.registry.JAXRException
public void addExportObjects(java.util.Collection<javax.xml.registry.infomodel.RegistryObject> registryObjectsCollection)
registryObjectsCollection
- collection of registry objectspublic void removeExportObject(javax.xml.registry.infomodel.RegistryObject registryObject)
getMainObjectsToExportMap()
has already been executed.
registryObject
- the object to be removed from the set.public void removeExportObject(java.lang.String key)
key
- key of a top object to be ignored at exportpublic void removeExportObjects(java.util.Collection<java.lang.String> keys)
key
- keys of a top object to be ignored at exportpublic int getExportObjectCount()
getMainObjectsToExport()
or (getMainObjectsToExport()
.
public void addSavedSearchObjects(java.lang.String savedSearchName) throws com.centrasite.jaxr.importexport.ExportException
QueryExecutor
for more information.
savedSearchName
- the name of the saved search
com.centrasite.jaxr.importexport.ExportException
- query failurepublic void addSavedSearchObjects(java.lang.String savedSearchName, java.lang.String userName) throws com.centrasite.jaxr.importexport.ExportException
QueryExecutor
for more information.
savedSearchName
- the name of the saved searchuserName
- the user name where the saved search is stored (null: take current jaxr user)
com.centrasite.jaxr.importexport.ExportException
- query failurepublic void addSearchFromFile(java.lang.String queryFileName) throws com.centrasite.jaxr.importexport.ExportException
queryFileName
- path name (or URL) of a query file
com.centrasite.jaxr.importexport.ExportException
- query failurepublic void setModifiedSince(java.lang.String timeSpec) throws com.centrasite.jaxr.importexport.ExportException
The time stamp will be checked at:
timeSpec
- the time specification in xs:dateTime or xs:duration syntax (null: no time limit)
com.centrasite.jaxr.importexport.ExportException
- invalid dateTime/duration syntaxpublic void execute() throws java.lang.Exception
java.lang.Exception
public void close()
public java.util.Collection<javax.xml.registry.infomodel.RegistryObject> getMainObjectsToExport() throws java.lang.Exception
java.lang.Exception
public java.util.Map<javax.xml.registry.infomodel.RegistryObject,java.util.Collection<javax.xml.registry.infomodel.RegistryObject>> getMainObjectsToExportMap() throws java.lang.Exception
java.lang.Exception
public java.util.List<ExportOperation.CollectorResults> getCollectorResult() throws java.lang.Exception
java.lang.Exception
public javax.xml.registry.infomodel.Concept getConcept(java.lang.String conceptValue) throws java.lang.Exception
conceptValue
- the name of the concept
java.lang.Exception
public javax.xml.registry.infomodel.Key getKey(java.lang.String keyValue) throws java.lang.Exception
keyValue
- the key as a uddi string
java.lang.Exception
public void setErrorMessageLocale(java.util.Locale locale)
locale
- the locale as stringpublic static void main(java.lang.String[] args)
usage:
ExportOperation [options] < CentraSite URL > < export filename >
< user > < password > [< registry-key > ...]
Options:
Option | Explanation |
-noinstances | Do not export the instances of a Type and/or Taxonomy |
-deleteafterexport | Delete the objects to be exported after export (not for types and organizations) |
-minimizeauditableevents | Export only the minimal set of audit trail |
-withreferencedassets | Export also the directly referenced(associated) assets |
-orgnousers | Do not export the users of exported organizations |
-orgwithpolicyandlifecycle | Export the policies and LCMs of exported organizations |
-orgnochildorganization | Do not export the child organizations of exported organizations |
-orgwithassets | Export all the assets of the exported organizations |
-ignore id | Ignore the top object at export. This option may be specified more than once |
-savedsearch searchname | Add the result of the saved search to the objects to export. This option may be specified more than once |
-savedsearchuser user | Use the given user for the -savedsearch option instead of session user |
-searchfile file | Add the result of the search, specified in the xml file, to the objects to export. This option may be specified more than once |
-modifiedsince timespec | Export only objects created/modified after timespec (syntax: xs:dateTime or xs:duration) |
-displaymainobjects | Display the main objects to be exported and do NOT export |
-displaycollectorresult | Display the collector result and do NOT export |
-full | Full output option of a display |
deprecated option: [-orgnorelated] : use -orgnousers
args
- program arguments
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |