|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.opencms.file.CmsImport
Holds the functionaility to import resources from the filesystem or a zip file into the OpenCms VFS.
| Field Summary | |
static String |
C_IMPORT_DIGEST
The algorithm for the message digest |
protected CmsObject |
m_cms
The cms contect to do the operations on the VFS/COS with |
protected Document |
m_docXml
The xml manifest-file |
protected String |
m_importFile
The import-file to load resources from |
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 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 the module 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. |
Vector |
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. |
Vector |
getResourcesForProject()
Returns a Vector of resource names that are needed to create a project for this import. |
protected String |
getTextNodeValue(Element elem,
String tag)
Returns the text for a node. |
protected void |
importAllResources(Vector excludeList,
Vector writtenFilenames,
Vector fileCodes,
String propertyName,
String propertyValue)
Imports the resources and writes them to the cms. |
void |
importResources()
Imports the resources and writes them to the cms VFS, even if there already exist files with the same name. |
void |
importResources(Vector excludeList,
Vector writtenFilenames,
Vector fileCodes,
String propertyName,
String propertyValue)
Imports the resources for a module. |
protected void |
openImportFile()
Initilizes the import. |
static String |
setDirectories(String content,
String[] rules)
Translates directory Strings from OpenCms 4.x structure to new 5.0 structure. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String C_IMPORT_DIGEST
protected CmsObject m_cms
protected Document m_docXml
protected I_CmsReport m_report
protected File m_importResource
protected ZipFile m_importZip
protected boolean m_importingChannelData
protected String m_importFile
protected String m_importPath
| Constructor Detail |
public CmsImport()
CmsImportModuledata
public CmsImport(CmsObject cms,
String importFile,
String importPath,
I_CmsReport report)
throws CmsException
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
CmsException - if something goes wrong| Method Detail |
public void importResources()
throws CmsException
CmsException - if something goes wrong
public void importResources(Vector excludeList,
Vector writtenFilenames,
Vector fileCodes,
String propertyName,
String propertyValue)
throws CmsException
excludeList - filenames of files and folders which should not
be (over)written in the virtual file system (not used when null)writtenFilenames - filenames of the files and folder which have actually been
successfully written (not used when null)fileCodes - code of the written files (for the registry)
(not used when null)propertyName - name of a property to be added to all resourcespropertyValue - value of that property
CmsException - if something goes wrong
protected void openImportFile()
throws CmsException
CmsException - if something goes wrong
protected void closeImportFile()
throws CmsException
CmsException - if something goes wrong
public Vector getConflictingFilenames()
throws CmsException
CmsExceptionprotected byte[] getFileBytes(String filename)
filename - the name of the file to read
protected void getImportResource()
throws CmsException
CmsException
public Vector getResourcesForProject()
throws CmsException
It calls the method getConflictingFileNames if needed, to calculate these resources.
CmsException
protected String getTextNodeValue(Element elem,
String tag)
elem - the parent elementtag - the tagname to get the value from
protected void importAllResources(Vector excludeList,
Vector writtenFilenames,
Vector fileCodes,
String propertyName,
String propertyValue)
throws CmsException
excludeList - filenames of files and folders which should not
be (over)written in the virtual file system (not used when null)writtenFilenames - filenames of the files and folder which have actually been
successfully written (not used when null)fileCodes - code of the written files (for the registry)
(not used when null)propertyName - name of a property to be added to all resourcespropertyValue - value of that property
CmsException - if something goes wrong
public static String setDirectories(String content,
String[] rules)
content - the filecontent
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||