Class Importer
- java.lang.Object
 - 
- org.apache.jackrabbit.vault.fs.io.Importer
 
 
- 
public class Importer extends java.lang.ObjectImports anArchiveinto a repository. file/directory combinations- plain file
 
+ foo - test.gif - plain files + special folder
 
+ foo - .content.xml + bar - test.gif - special file
 
+ foo - test.gif - test.gif.dir - .content.xml - special file + sub files
 
+ foo - test.gif - test.gif.dir - .content.xml + _jcr_content - thumbnail.gif - special file + sub special files
 
+ foo - test.gif - test.gif.dir - .content.xml + _jcr_content - thumbnail.gif + thumbnail.gif.dir - .content.xml - file/folder structure
 
+ foo + en - .content.xml + _cq_content - thumbnail.gif + company - .content.xml 
 - plain file
 
 
- 
- 
Constructor Summary
Constructors Constructor Description Importer()Default constructor neither setting specific import options nor defaults.Importer(ImportOptions opts)Constructor which is not setting default options.Importer(ImportOptions opts, boolean isStrictByDefault)Shortcut forImporter(ImportOptions, boolean, boolean, IdConflictPolicy)with no default id conflict policy.Importer(ImportOptions opts, boolean isStrictByDefault, boolean overwritePrimaryTypesOfFoldersByDefault)Shortcut forImporter(ImportOptions, boolean, boolean, IdConflictPolicy)with no default id conflict policy.Importer(ImportOptions opts, boolean isStrictByDefault, boolean overwritePrimaryTypesOfFoldersByDefault, IdConflictPolicy defaultIdConflictPolicy)Constructor setting both specific import options as well as some defaults for options not set. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyMemberships(javax.jcr.Session session)voidcheckinNodes(javax.jcr.Session session)ImportOptionsgetOptions()java.util.List<java.lang.String>getSubPackages()booleanhasErrors()booleanisStrictByDefault()voidrun(Archive archive, javax.jcr.Node importRoot)Runs the importer from the given root node.voidrun(Archive archive, javax.jcr.Session session, java.lang.String parentPath)Runs the importer with the given session.voidsetDebugFailAfterSave(int failAfterEach)Debug settings to allows to produce failures after eachfailAfterEachsave. 
 - 
 
- 
- 
Constructor Detail
- 
Importer
public Importer()
Default constructor neither setting specific import options nor defaults. 
- 
Importer
public Importer(ImportOptions opts)
Constructor which is not setting default options.- Parameters:
 opts-- See Also:
 Importer(ImportOptions, boolean, boolean, IdConflictPolicy)
 
- 
Importer
public Importer(ImportOptions opts, boolean isStrictByDefault)
Shortcut forImporter(ImportOptions, boolean, boolean, IdConflictPolicy)with no default id conflict policy. Also primary types of existing nodes are always overwritten.- Parameters:
 opts- the import options to use duringrun(Archive, Node)orrun(Archive, Session, String)isStrictByDefault- is true if packages should be installed in strict mode by default (if not set otherwise inopts)
 
- 
Importer
public Importer(ImportOptions opts, boolean isStrictByDefault, boolean overwritePrimaryTypesOfFoldersByDefault)
Shortcut forImporter(ImportOptions, boolean, boolean, IdConflictPolicy)with no default id conflict policy.- Parameters:
 opts- the import options to use duringrun(Archive, Node)orrun(Archive, Session, String)isStrictByDefault- is true if packages should be installed in strict mode by default (if not set otherwise inopts)overwritePrimaryTypesOfFoldersByDefault- if folder aggregates' JCR primary type should be changed if the node is already existing or not
 
- 
Importer
public Importer(ImportOptions opts, boolean isStrictByDefault, boolean overwritePrimaryTypesOfFoldersByDefault, IdConflictPolicy defaultIdConflictPolicy)
Constructor setting both specific import options as well as some defaults for options not set.- Parameters:
 opts- the import options to use duringrun(Archive, Node)orrun(Archive, Session, String)isStrictByDefault- is true if packages should be installed in strict mode by default (if not set otherwise inopts)overwritePrimaryTypesOfFoldersByDefault- if folder aggregates' JCR primary type should be changed if the node is already existing or notdefaultIdConflictPolicy- the defaultIdConflictPolicyto use if no policy is set inopts. May benull.
 
 - 
 
- 
Method Detail
- 
getOptions
public ImportOptions getOptions()
 
- 
getSubPackages
public java.util.List<java.lang.String> getSubPackages()
 
- 
isStrictByDefault
public boolean isStrictByDefault()
 
- 
setDebugFailAfterSave
public void setDebugFailAfterSave(int failAfterEach)
Debug settings to allows to produce failures after eachfailAfterEachsave.- Parameters:
 failAfterEach- cardinal indicating when to fail
 
- 
run
public void run(Archive archive, javax.jcr.Node importRoot) throws java.io.IOException, javax.jcr.RepositoryException, ConfigurationException
Runs the importer from the given root node. Shortcut forrun(Archive, Session, String)with the session and path from the given node.- Parameters:
 archive- the archive to importimportRoot- the root node to import- Throws:
 ConfigurationException- if the importer is not properly configuredjava.io.IOException- if an I/O error occursjavax.jcr.RepositoryException- if an repository error occurs- Since:
 - 2.3.20
 
 
- 
run
public void run(Archive archive, javax.jcr.Session session, java.lang.String parentPath) throws java.io.IOException, javax.jcr.RepositoryException, ConfigurationException
Runs the importer with the given session.Session.save()and potentiallySession.refresh(boolean)are automatically called during the import in the given session, except whenImportOptions.setAutoSaveThreshold(int)with valueInteger.MAX_VALUEhas been set. In all other cases the changes are automatically persisted (potentially in batches) potentially after advanced retry mechanisms.- Parameters:
 archive- the archive to importsession- the session importing the archiveparentPath- the repository parent path where the archive will be imported- Throws:
 java.io.IOException- if an I/O error occursjavax.jcr.RepositoryException- if a repository error occursConfigurationException- if the importer is not properly configured- Since:
 - 2.7.0
 
 
- 
hasErrors
public boolean hasErrors()
 
- 
checkinNodes
public void checkinNodes(javax.jcr.Session session)
 
- 
applyMemberships
public void applyMemberships(javax.jcr.Session session)
 
 - 
 
 -