|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opencms.importexport.CmsImport
public class CmsImport
Holds the functionaility to import resources from the filesystem or a zip file into the OpenCms VFS.
| Field Summary | |
|---|---|
protected CmsObject |
m_cms
The cms context to do the operations with. |
protected Document |
m_docXml
The xml manifest-file. |
protected String |
m_importFile
The import-file to load resources from. |
protected List |
m_importImplementations
Stores all import interface implementations . |
protected boolean |
m_importingChannelData
Indicates if module data is being imported. |
protected String |
m_importPath
The import-path to write resources into the cms. |
protected File |
m_importResource
The import-resource (folder) to load resources from. |
protected int |
m_importVersion
The version of this import, noted in the info tag of the manifest.xml. |
protected ZipFile |
m_importZip
The import-resource (zip) to load resources from. |
protected I_CmsReport |
m_report
The object to report the log messages. |
| Constructor Summary | |
|---|---|
CmsImport()
Constructs a new uninitialized import, required for special subclass data import. |
|
CmsImport(CmsObject cms,
String importFile,
String importPath,
I_CmsReport report)
Constructs a new import object which imports the resources from an OpenCms export zip file or a folder in the "real" file system. |
|
| Method Summary | |
|---|---|
protected void |
closeImportFile()
Closes the import file. |
static String |
getChildElementTextValue(Element parentElement,
String elementName)
Returns the value of a child element with a specified name for a given parent element. |
List |
getConflictingFilenames()
Returns a list of files which are both in the import and in the virtual file system. |
protected byte[] |
getFileBytes(String filename)
Returns a byte array containing the content of the file. |
protected void |
getImportResource()
Gets the import resource and stores it in object-member. |
List |
getResourcesForProject()
Returns a list of resource names that are needed to create a project for this import. |
void |
importResources()
Imports the resources and writes them to the cms VFS, even if there already exist files with the same name. |
protected void |
openImportFile()
Initalizes the import. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CmsObject m_cms
protected Document m_docXml
protected String m_importFile
protected List m_importImplementations
protected boolean m_importingChannelData
protected String m_importPath
protected File m_importResource
protected int m_importVersion
0 indicates an export file without a version number, that is before version 4.3.23 of OpenCms.
1 indicates an export file of OpenCms with a version before 5.0.0
2 indicates an export file of OpenCms with a version before 5.1.2
3 indicates an export file of OpenCms with a version before 5.1.6
4 indicates an export file of OpenCms with a version after 5.1.6
protected ZipFile m_importZip
protected I_CmsReport m_report
| Constructor Detail |
|---|
public CmsImport()
public CmsImport(CmsObject cms,
String importFile,
String importPath,
I_CmsReport report)
throws CmsRoleViolationException
cms - the current cms objectimportFile - the file or folder to import fromimportPath - the path in the cms VFS to import intoreport - a report object to output the progress information to
CmsRoleViolationException - if the current user dies not have role permissions to import the database| Method Detail |
|---|
public static String getChildElementTextValue(Element parentElement,
String elementName)
parentElement - the parent elementelementName - the child element name
public List getConflictingFilenames()
throws CmsXmlException,
CmsImportExportException
CmsImportExportException - if the import file could not be opened
CmsXmlException - if the manifest of the import could not be unmarshalled
public List getResourcesForProject()
throws CmsImportExportException
It calls the method getConflictingFileNames if needed, to calculate these resources.
CmsImportExportException - if ZIP archive could not be closed
public void importResources()
throws CmsImportExportException,
CmsXmlException
CmsImportExportException - if something goes wrong
CmsXmlException - if the manifest of the import file could not be unmarshalled
protected void closeImportFile()
throws CmsImportExportException
CmsImportExportException - if the ZIP archive could not be closedprotected byte[] getFileBytes(String filename)
filename - the name of the file to read
protected void getImportResource()
throws CmsImportExportException
CmsImportExportException - if the import file could not be opened
protected void openImportFile()
throws CmsXmlException,
CmsImportExportException
CmsImportExportException - if the import file could not be opened
CmsXmlException - if the manifest of the import could not be unmarshalled
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||