org.opencms.importexport
Class CmsImportVersion2

java.lang.Object
  extended by org.opencms.importexport.A_CmsImport
      extended by org.opencms.importexport.CmsImportVersion2
All Implemented Interfaces:
I_CmsImport

Deprecated. this import class is no longer in use and should only be used to import old export files

public class CmsImportVersion2
extends A_CmsImport

Implementation of the OpenCms Import Interface (I_CmsImport) for the import version 2.

This import format was used in OpenCms 5.0.0 - 5.1.2.

Since:
6.0.0
Version:
$Revision: 1.121 $
Author:
Michael Emmerich, Thomas Weckert
See Also:
A_CmsImport

Field Summary
protected  java.util.List m_webAppNames
          Deprecated. Web application names for conversion support.
protected  java.lang.String m_webappUrl
          Deprecated. Old webapp URL for import conversion.
static java.lang.String VFS_PATH_BODIES
          Deprecated. Parameter for content body folder.
 
Fields inherited from class org.opencms.importexport.A_CmsImport
A_NAME, A_TYPE, m_cms, m_convertToXmlPage, m_docXml, m_groupsToCreate, m_importPath, m_importResource, m_importZip, m_linkPropertyStorage, m_linkStorage, m_report, m_userMessages, N_ACCESS, N_ACCESSCONTROL_ALLOWEDPERMISSIONS, N_ACCESSCONTROL_DENIEDPERMISSIONS, N_ACCESSCONTROL_ENTRIES, N_ACCESSCONTROL_ENTRY, N_ACCESSCONTROL_PERMISSIONSET, N_ACCESSCONTROL_PRINCIPAL, N_DATECREATED, N_DATEEXPIRED, N_DATELASTMODIFIED, N_DATERELEASED, N_DEFAULTGROUP, N_DESCRIPTION, N_DESTINATION, N_EMAIL, N_FILE, N_FIRSTNAME, N_FLAGS, N_GROUPDATA, N_GROUPNAME, N_ID, N_LASTMODIFIED, N_LASTNAME, N_NAME, N_ORGUNITDATA, N_PARENTGROUP, N_PASSWORD, N_PROPERTIES, N_PROPERTY, N_PROPERTY_ATTRIB_TYPE, N_PROPERTY_ATTRIB_TYPE_SHARED, N_RELATION, N_RELATION_ATTRIBUTE_ID, N_RELATION_ATTRIBUTE_PATH, N_RELATION_ATTRIBUTE_TYPE, N_RELATIONS, N_SOURCE, N_TAG_ADDRESS, N_TYPE, N_USER, N_USERCREATED, N_USERDATA, N_USERGROUPDATA, N_USERGROUPS, N_USERINFO, N_USERINFO_ENTRY, N_USERLASTMODIFIED, N_UUIDRESOURCE, N_UUIDSTRUCTURE, N_VALUE, RESOURCE_TYPE_LEGACY_PAGE_NAME, RESOURCE_TYPE_LINK_ID, RESOURCE_TYPE_LINK_NAME, RESOURCE_TYPE_NEWPAGE_ID, RESOURCE_TYPE_NEWPAGE_NAME
 
Constructor Summary
CmsImportVersion2()
          Deprecated.  
 
Method Summary
protected  void cleanUp()
          Deprecated. Cleans up member variables after the import is finished.
protected  byte[] convertContent(java.lang.String source, java.lang.String destination, byte[] content, java.lang.String resType)
          Deprecated. Performs all required pre-import steps.
protected  java.lang.String getEncoding(java.lang.String content)
          Deprecated. Gets the encoding from the <?
 int getVersion()
          Deprecated. Returns the version of the import implementation.
 void importData(CmsObject cms, I_CmsReport report, CmsImportParameters params)
          Deprecated. Imports the data.
 void importResources(CmsObject cms, java.lang.String importPath, I_CmsReport report, java.io.File importResource, java.util.zip.ZipFile importZip, org.dom4j.Document docXml)
          Deprecated. use importData(CmsObject, I_CmsReport, CmsImportParameters) instead
protected  void importUser(java.lang.String name, java.lang.String flags, java.lang.String password, java.lang.String firstname, java.lang.String lastname, java.lang.String email, long dateCreated, java.util.Map userInfo, java.util.List userGroups)
          Deprecated. Imports a single user.
protected  void initialize()
          Deprecated. Initializes all member variables before the import is started.
static java.lang.String setDirectories(java.lang.String content, java.lang.String[] rules)
          Deprecated. Translates directory Strings from OpenCms 4.x structure to new 5.0 structure.
protected  java.lang.String setEncoding(java.lang.String content, java.lang.String encoding)
          Deprecated. Sets the right encoding and returns the result.
 
Methods inherited from class org.opencms.importexport.A_CmsImport
checkImmutable, convertDigestEncoding, convertPointerToSiblings, getChildElementTextValue, getFileBytes, getImportAccessControlEntry, getLocale, importAccessControlEntries, importGroup, importGroups, importUsers, matches, readPropertiesFromManifest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VFS_PATH_BODIES

public static final java.lang.String VFS_PATH_BODIES
Deprecated. 
Parameter for content body folder.

See Also:
Constant Field Values

m_webAppNames

protected java.util.List m_webAppNames
Deprecated. 
Web application names for conversion support.


m_webappUrl

protected java.lang.String m_webappUrl
Deprecated. 
Old webapp URL for import conversion.

Constructor Detail

CmsImportVersion2

public CmsImportVersion2()
Deprecated. 
Method Detail

setDirectories

public static java.lang.String setDirectories(java.lang.String content,
                                              java.lang.String[] rules)
Deprecated. 
Translates directory Strings from OpenCms 4.x structure to new 5.0 structure.

Parameters:
content - the filecontent
rules - the translation rules
Returns:
String the manipulated file content

getVersion

public int getVersion()
Deprecated. 
Description copied from interface: I_CmsImport
Returns the version of the import implementation.

Returns:
the version number of this import implementation
See Also:
I_CmsImport.getVersion()

importData

public void importData(CmsObject cms,
                       I_CmsReport report,
                       CmsImportParameters params)
                throws CmsImportExportException,
                       CmsXmlException
Deprecated. 
Description copied from interface: I_CmsImport
Imports the data.

Parameters:
cms - the current users OpenCms context
report - a report object to output the progress information to
params - the parameters to use during the import
Throws:
CmsImportExportException - if something goes wrong
CmsXmlException - if the manifest file could not be unmarshalled
See Also:
I_CmsImport.importData(CmsObject, I_CmsReport, CmsImportParameters)

importResources

public void importResources(CmsObject cms,
                            java.lang.String importPath,
                            I_CmsReport report,
                            java.io.File importResource,
                            java.util.zip.ZipFile importZip,
                            org.dom4j.Document docXml)
                     throws CmsImportExportException
Deprecated. use importData(CmsObject, I_CmsReport, CmsImportParameters) instead

Description copied from interface: I_CmsImport
Imports the resources.

Parameters:
cms - the current users OpenCms context
importPath - the path in the OpenCms VFS to import into
report - a report object to output the progress information to
importResource - the import-resource (folder) to load resources from
importZip - the import-resource (zip) to load resources from
docXml - the manifest.xml file which contains the meta information of the imported files
Throws:
CmsImportExportException - if something goes wrong
See Also:
I_CmsImport.importResources(org.opencms.file.CmsObject, java.lang.String, org.opencms.report.I_CmsReport, java.io.File, java.util.zip.ZipFile, org.dom4j.Document)

cleanUp

protected void cleanUp()
Deprecated. 
Cleans up member variables after the import is finished.

This is required since there is only one instance for each import version that is kept in memory and reused.

Overrides:
cleanUp in class A_CmsImport

convertContent

protected byte[] convertContent(java.lang.String source,
                                java.lang.String destination,
                                byte[] content,
                                java.lang.String resType)
Deprecated. 
Performs all required pre-import steps.

The content is *NOT* changed in the implementation of this class.

Parameters:
source - the source path of the resource
destination - the destination path of the resource
content - the content of the resource
resType - the type of the resource
Returns:
the (prepared) content of the resource

getEncoding

protected java.lang.String getEncoding(java.lang.String content)
Deprecated. 
Gets the encoding from the <?XML ...> tag if present.

Parameters:
content - the file content
Returns:
String the found encoding

importUser

protected void importUser(java.lang.String name,
                          java.lang.String flags,
                          java.lang.String password,
                          java.lang.String firstname,
                          java.lang.String lastname,
                          java.lang.String email,
                          long dateCreated,
                          java.util.Map userInfo,
                          java.util.List userGroups)
                   throws CmsImportExportException
Deprecated. 
Description copied from class: A_CmsImport
Imports a single user.

Overrides:
importUser in class A_CmsImport
Parameters:
name - user name
flags - user flags
password - user password
firstname - firstname of the user
lastname - lastname of the user
email - user email
dateCreated - creation date
userInfo - user info
userGroups - user groups
Throws:
CmsImportExportException - in case something goes wrong
See Also:
A_CmsImport.importUser(String, String, String, String, String, String, long, Map, List)

initialize

protected void initialize()
Deprecated. 
Initializes all member variables before the import is started.

This is required since there is only one instance for each import version that is kept in memory and reused.

Overrides:
initialize in class A_CmsImport

setEncoding

protected java.lang.String setEncoding(java.lang.String content,
                                       java.lang.String encoding)
Deprecated. 
Sets the right encoding and returns the result.

Parameters:
content - the filecontent
encoding - the encoding to use
Returns:
modified content