|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.importexport.CmsImportExportManager
Provides information about how to handle imported resources.
OpenCms.getImportExportManager()
Field Summary | |
static java.lang.String |
EXPORT_MANIFEST
The name of the XML manifest file used for the description of exported OpenCms VFS properties and atributes. |
static java.lang.String |
EXPORT_VERSION
The current version of the OpenCms export (appears in the EXPORT_MANIFEST header). |
static java.lang.String |
EXPORT_XMLFILENAME
Deprecated. use EXPORT_MANIFEST instead |
static java.lang.String |
N_ACCESS
Tag in the EXPORT_MANIFEST for the "access" node. |
static java.lang.String |
N_ACCESSCONTROL_ALLOWEDPERMISSIONS
Tag in the EXPORT_MANIFEST for the "allowed" node, to identify allowed user permissions. |
static java.lang.String |
N_ACCESSCONTROL_DENIEDPERMISSIONS
Tag in the EXPORT_MANIFEST for the "denied" node, to identify denied user permissions. |
static java.lang.String |
N_ACCESSCONTROL_ENTRIES
Tag in the EXPORT_MANIFEST for the "accesscontrol" node, to identify access control entries. |
static java.lang.String |
N_ACCESSCONTROL_ENTRY
Tag in the EXPORT_MANIFEST for the "accessentry" node, to identify a single access control entry. |
static java.lang.String |
N_ACCESSCONTROL_PERMISSIONSET
Tag in the EXPORT_MANIFEST for the "permissionset" node, to identify a permission set. |
static java.lang.String |
N_ACCESSCONTROL_PRINCIPAL
Tag in the EXPORT_MANIFEST for the "uuidprincipal" node, to identify a principal UUID. |
static java.lang.String |
N_CREATOR
Tag for the "creator" node (appears in the EXPORT_MANIFEST header). |
static java.lang.String |
N_DATE
Tag for the "createdate" node (appears in the EXPORT_MANIFEST header). |
static java.lang.String |
N_DATECREATED
Tag in the EXPORT_MANIFEST for the "datecreated" node, contains the date created VFS file attribute. |
static java.lang.String |
N_DATEEXPIRED
Tag in the EXPORT_MANIFEST for the "dateexpired" node, contains the expiration date VFS file attribute. |
static java.lang.String |
N_DATELASTMODIFIED
Tag in the EXPORT_MANIFEST for the "datelastmodified" node, contains the date last modified VFS file attribute. |
static java.lang.String |
N_DATERELEASED
Tag in the EXPORT_MANIFEST for the "datereleased" node, contains the release date VFS file attribute. |
static java.lang.String |
N_DEFAULTGROUP
Tag in the EXPORT_MANIFEST for the "defaultgroup" node, for backward compatibility with OpenCms 5.x. |
static java.lang.String |
N_DESCRIPTION
Tag in the EXPORT_MANIFEST for the "description" node, contains a users description test. |
static java.lang.String |
N_DESTINATION
Tag in the EXPORT_MANIFEST for the "destination" node, contains target VFS file name. |
static java.lang.String |
N_EMAIL
Tag in the EXPORT_MANIFEST for the "email" node, contains a users email. |
static java.lang.String |
N_EXPORT
Tag in the EXPORT_MANIFEST for the "export" node. |
static java.lang.String |
N_FILE
Tag in the EXPORT_MANIFEST for the "file" node, container node for all VFS resources. |
static java.lang.String |
N_FIRSTNAME
Tag in the EXPORT_MANIFEST for the "firstname" node, contains a users first name. |
static java.lang.String |
N_FLAGS
Tag in the EXPORT_MANIFEST for the "flags" node, contains the flags of a VFS resource. |
static java.lang.String |
N_GROUPDATA
Tag in the EXPORT_MANIFEST for the "groupdata" node, contains a users group data. |
static java.lang.String |
N_GROUPNAME
Tag in the EXPORT_MANIFEST for the "groupname" node, contains a groups name. |
static java.lang.String |
N_ID
Tag in the EXPORT_MANIFEST for the "id" node, only required for backward compatibility with import version 2. |
static java.lang.String |
N_INFO
Tag in the EXPORT_MANIFEST , starts the manifest info header. |
static java.lang.String |
N_LASTMODIFIED
Tag in the EXPORT_MANIFEST for the "lastmodified" node, only required for backward compatibility with import version 2. |
static java.lang.String |
N_LASTNAME
Tag in the EXPORT_MANIFEST for the "lastname" node, contains a users last name. |
static java.lang.String |
N_NAME
Tag in the EXPORT_MANIFEST for the "name" node, contains a users login name. |
static java.lang.String |
N_OC_VERSION
Tag in the EXPORT_MANIFEST for the "opencms_version" node, appears in the manifest info header. |
static java.lang.String |
N_PARENTGROUP
Tag in the EXPORT_MANIFEST for the "parentgroup" node, contains a groups parent group name. |
static java.lang.String |
N_PASSWORD
Tag in the EXPORT_MANIFEST for the "password" node, contains a users encrypted password. |
static java.lang.String |
N_PROJECT
Tag in the EXPORT_MANIFEST for the "project" node, appears in the manifest info header. |
static java.lang.String |
N_PROPERTIES
Tag in the EXPORT_MANIFEST for the "properties" node, starts the list of properties of a VFS resource. |
static java.lang.String |
N_PROPERTY
Tag in the EXPORT_MANIFEST for the "property" node, starts a property for a VFS resource. |
static java.lang.String |
N_PROPERTY_ATTRIB_TYPE
Tag in the EXPORT_MANIFEST for the "type" property attribute, contains a property type. |
static java.lang.String |
N_PROPERTY_ATTRIB_TYPE_SHARED
Tag in the EXPORT_MANIFEST for the "shared" property type attribute value. |
static java.lang.String |
N_SOURCE
Tag in the EXPORT_MANIFEST for the "source" node, contains the source path of a VFS resource in the import zip (or folder). |
static java.lang.String |
N_TAG_ADDRESS
Tag in the EXPORT_MANIFEST for the "address" node, contains a users address. |
static java.lang.String |
N_TYPE
Tag in the EXPORT_MANIFEST for the "type" node, the resource type name of a VFS resource. |
static java.lang.String |
N_USER
Tag in the EXPORT_MANIFEST for the "user" node, starts the user data. |
static java.lang.String |
N_USERCREATED
Tag in the EXPORT_MANIFEST for the "usercreated" node, contains the name of the user who created the VFS resource. |
static java.lang.String |
N_USERDATA
Tag in the EXPORT_MANIFEST for the "userdata" node, starts the list of users. |
static java.lang.String |
N_USERGROUPDATA
Tag in the EXPORT_MANIFEST for the "usergroupdatas" node, starts the users group data. |
static java.lang.String |
N_USERGROUPS
Tag in the EXPORT_MANIFEST for the "usergroups" node, starts the users group data. |
static java.lang.String |
N_USERINFO
Tag in the EXPORT_MANIFEST for the "userinfo" node, contains the additional user info. |
static java.lang.String |
N_USERLASTMODIFIED
Tag in the EXPORT_MANIFEST for the "userlastmodified" node, contains the name of the user who last modified the VFS resource. |
static java.lang.String |
N_UUIDRESOURCE
Tag in the EXPORT_MANIFEST for the "uuidresource" node, contains a the resource UUID of a VFS resource. |
static java.lang.String |
N_UUIDSTRUCTURE
Tag in the EXPORT_MANIFEST for the "uuidstructure" node, only required for backward compatibility with import version 2. |
static java.lang.String |
N_VALUE
Tag in the EXPORT_MANIFEST for the "value" node, contains the value of a property. |
static java.lang.String |
N_VERSION
Tag in the EXPORT_MANIFEST for the "export_version" node, appears in the manifest info header. |
Constructor Summary | |
CmsImportExportManager()
Creates a new instance for the import/export manager, will be called by the import/export configuration manager. |
Method Summary | |
void |
addIgnoredProperty(java.lang.String propertyName)
Adds a property name to the list of properties that should be removed from imported resources. |
void |
addImmutableResource(java.lang.String immutableResource)
Adds a resource to the list of immutable resources that should remain unchanged when resources are imported. |
void |
addImportExportHandler(I_CmsImportExportHandler handler)
Adds an import/export handler to the list of configured handlers. |
void |
addImportPrincipalTranslation(java.lang.String type,
java.lang.String from,
java.lang.String to)
Adds an import princial translation to the configuration. |
void |
addImportVersionClass(I_CmsImport importVersionClass)
Adds a import version class name to the configuration. |
boolean |
convertToXmlPage()
Checks if imported pages should be converted into XML pages. |
void |
exportData(CmsObject cms,
I_CmsImportExportHandler handler,
I_CmsReport report)
Checks if the current user has permissions to export Cms data of a specified export handler, and if so, triggers the handler to write the export. |
protected void |
finalize()
|
java.util.List |
getIgnoredProperties()
Returns the list of property keys that should be removed from imported resources. |
java.util.List |
getImmutableResources()
Returns the list of immutable resources that should remain unchanged when resources are imported. |
I_CmsImportExportHandler |
getImportExportHandler(java.lang.String importFile)
Returns an instance of an import/export handler implementation that is able to import a specified resource. |
java.util.List |
getImportExportHandlers()
Returns the list of configured import/export handlers. |
java.util.Map |
getImportGroupTranslations()
Returns the configured principal group translations. |
java.util.Map |
getImportUserTranslations()
Returns the configured principal user translations. |
java.util.List |
getImportVersionClasses()
Returns the configured import version class names. |
static org.dom4j.Document |
getManifest(java.io.File resource)
Returns the "manifest.xml" of an available import resource as a dom4j document. |
java.lang.String |
getOldWebAppUrl()
Returns the URL of a 4.x OpenCms app. |
void |
importData(CmsObject cms,
java.lang.String importFile,
java.lang.String importPath,
I_CmsReport report)
Checks if the current user has permissions to import data into the Cms, and if so, creates a new import handler instance that imports the data. |
boolean |
overwriteCollidingResources()
Checks if colliding resources should be overwritten during the import. |
void |
setConvertToXmlPage(boolean convertToXmlPage)
Sets if imported pages should be converted into XML pages. |
void |
setConvertToXmlPage(java.lang.String convertToXmlPage)
Sets if imported pages should be converted into XML pages. |
void |
setOldWebAppUrl(java.lang.String webAppUrl)
Sets the URL of a 4.x OpenCms app. |
void |
setOverwriteCollidingResources(boolean overwriteCollidingResources)
Sets whether colliding resources should be overwritten during the import for a specified import implementation. |
void |
setOverwriteCollidingResources(java.lang.String overwriteCollidingResources)
|
java.lang.String |
translateGroup(java.lang.String name)
Returns the translated name for the given group name. |
java.lang.String |
translateUser(java.lang.String name)
Returns the translated name for the given user name. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String EXPORT_MANIFEST
public static final java.lang.String EXPORT_VERSION
EXPORT_MANIFEST
header).
public static final java.lang.String EXPORT_XMLFILENAME
EXPORT_MANIFEST
instead
public static final java.lang.String N_ACCESS
EXPORT_MANIFEST
for the "access" node.
public static final java.lang.String N_ACCESSCONTROL_ALLOWEDPERMISSIONS
EXPORT_MANIFEST
for the "allowed" node, to identify allowed user permissions.
public static final java.lang.String N_ACCESSCONTROL_DENIEDPERMISSIONS
EXPORT_MANIFEST
for the "denied" node, to identify denied user permissions.
public static final java.lang.String N_ACCESSCONTROL_ENTRIES
EXPORT_MANIFEST
for the "accesscontrol" node, to identify access control entries.
public static final java.lang.String N_ACCESSCONTROL_ENTRY
EXPORT_MANIFEST
for the "accessentry" node, to identify a single access control entry.
public static final java.lang.String N_ACCESSCONTROL_PERMISSIONSET
EXPORT_MANIFEST
for the "permissionset" node, to identify a permission set.
public static final java.lang.String N_ACCESSCONTROL_PRINCIPAL
EXPORT_MANIFEST
for the "uuidprincipal" node, to identify a principal UUID.
public static final java.lang.String N_CREATOR
EXPORT_MANIFEST
header).
public static final java.lang.String N_DATE
EXPORT_MANIFEST
header).
public static final java.lang.String N_DATECREATED
EXPORT_MANIFEST
for the "datecreated" node, contains the date created VFS file attribute.
public static final java.lang.String N_DATEEXPIRED
EXPORT_MANIFEST
for the "dateexpired" node, contains the expiration date VFS file attribute.
public static final java.lang.String N_DATELASTMODIFIED
EXPORT_MANIFEST
for the "datelastmodified" node, contains the date last modified VFS file attribute.
public static final java.lang.String N_DATERELEASED
EXPORT_MANIFEST
for the "datereleased" node, contains the release date VFS file attribute.
public static final java.lang.String N_DEFAULTGROUP
EXPORT_MANIFEST
for the "defaultgroup" node, for backward compatibility with OpenCms 5.x.
public static final java.lang.String N_DESCRIPTION
EXPORT_MANIFEST
for the "description" node, contains a users description test.
public static final java.lang.String N_DESTINATION
EXPORT_MANIFEST
for the "destination" node, contains target VFS file name.
public static final java.lang.String N_EMAIL
EXPORT_MANIFEST
for the "email" node, contains a users email.
public static final java.lang.String N_EXPORT
EXPORT_MANIFEST
for the "export" node.
public static final java.lang.String N_FILE
EXPORT_MANIFEST
for the "file" node, container node for all VFS resources.
public static final java.lang.String N_FIRSTNAME
EXPORT_MANIFEST
for the "firstname" node, contains a users first name.
public static final java.lang.String N_FLAGS
EXPORT_MANIFEST
for the "flags" node, contains the flags of a VFS resource.
public static final java.lang.String N_GROUPDATA
EXPORT_MANIFEST
for the "groupdata" node, contains a users group data.
public static final java.lang.String N_GROUPNAME
EXPORT_MANIFEST
for the "groupname" node, contains a groups name.
public static final java.lang.String N_ID
EXPORT_MANIFEST
for the "id" node, only required for backward compatibility with import version 2.
public static final java.lang.String N_INFO
EXPORT_MANIFEST
, starts the manifest info header.
public static final java.lang.String N_LASTMODIFIED
EXPORT_MANIFEST
for the "lastmodified" node, only required for backward compatibility with import version 2.
public static final java.lang.String N_LASTNAME
EXPORT_MANIFEST
for the "lastname" node, contains a users last name.
public static final java.lang.String N_NAME
EXPORT_MANIFEST
for the "name" node, contains a users login name.
public static final java.lang.String N_OC_VERSION
EXPORT_MANIFEST
for the "opencms_version" node, appears in the manifest info header.
public static final java.lang.String N_PARENTGROUP
EXPORT_MANIFEST
for the "parentgroup" node, contains a groups parent group name.
public static final java.lang.String N_PASSWORD
EXPORT_MANIFEST
for the "password" node, contains a users encrypted password.
public static final java.lang.String N_PROJECT
EXPORT_MANIFEST
for the "project" node, appears in the manifest info header.
public static final java.lang.String N_PROPERTIES
EXPORT_MANIFEST
for the "properties" node, starts the list of properties of a VFS resource.
public static final java.lang.String N_PROPERTY
EXPORT_MANIFEST
for the "property" node, starts a property for a VFS resource.
public static final java.lang.String N_PROPERTY_ATTRIB_TYPE
EXPORT_MANIFEST
for the "type" property attribute, contains a property type.
public static final java.lang.String N_PROPERTY_ATTRIB_TYPE_SHARED
EXPORT_MANIFEST
for the "shared" property type attribute value.
public static final java.lang.String N_SOURCE
EXPORT_MANIFEST
for the "source" node, contains the source path of a VFS resource in the import zip (or folder).
public static final java.lang.String N_TAG_ADDRESS
EXPORT_MANIFEST
for the "address" node, contains a users address.
public static final java.lang.String N_TYPE
EXPORT_MANIFEST
for the "type" node, the resource type name of a VFS resource.
public static final java.lang.String N_USER
EXPORT_MANIFEST
for the "user" node, starts the user data.
public static final java.lang.String N_USERCREATED
EXPORT_MANIFEST
for the "usercreated" node, contains the name of the user who created the VFS resource.
public static final java.lang.String N_USERDATA
EXPORT_MANIFEST
for the "userdata" node, starts the list of users.
public static final java.lang.String N_USERGROUPDATA
EXPORT_MANIFEST
for the "usergroupdatas" node, starts the users group data.
public static final java.lang.String N_USERGROUPS
EXPORT_MANIFEST
for the "usergroups" node, starts the users group data.
public static final java.lang.String N_USERINFO
EXPORT_MANIFEST
for the "userinfo" node, contains the additional user info.
public static final java.lang.String N_USERLASTMODIFIED
EXPORT_MANIFEST
for the "userlastmodified" node, contains the name of the user who last modified the VFS resource.
public static final java.lang.String N_UUIDRESOURCE
EXPORT_MANIFEST
for the "uuidresource" node, contains a the resource UUID of a VFS resource.
public static final java.lang.String N_UUIDSTRUCTURE
EXPORT_MANIFEST
for the "uuidstructure" node, only required for backward compatibility with import version 2.
public static final java.lang.String N_VALUE
EXPORT_MANIFEST
for the "value" node, contains the value of a property.
public static final java.lang.String N_VERSION
EXPORT_MANIFEST
for the "export_version" node, appears in the manifest info header.
Constructor Detail |
public CmsImportExportManager()
Method Detail |
public static org.dom4j.Document getManifest(java.io.File resource)
The manifest is either read as a ZIP entry, or from a subfolder of the specified file resource.
resource
- a File resource
public void addIgnoredProperty(java.lang.String propertyName)
propertyName
- a property namepublic void addImmutableResource(java.lang.String immutableResource)
immutableResource
- a resources uri in the OpenCms VFSpublic void addImportExportHandler(I_CmsImportExportHandler handler)
handler
- the import/export handler to addpublic void addImportPrincipalTranslation(java.lang.String type, java.lang.String from, java.lang.String to)
type
- the princial type ("USER" or "GROUP")from
- the "from" translation sourceto
- the "to" translation targetpublic void addImportVersionClass(I_CmsImport importVersionClass)
importVersionClass
- the import version class name to addpublic boolean convertToXmlPage()
public void exportData(CmsObject cms, I_CmsImportExportHandler handler, I_CmsReport report) throws CmsConfigurationException, CmsImportExportException, CmsRoleViolationException
cms
- the current OpenCms context objecthandler
- handler containing the export datareport
- a Cms report to print log messages
CmsRoleViolationException
- if the current user is not a allowed to export the OpenCms database
CmsImportExportException
- if operation was not successful
CmsConfigurationException
- if something goes wrongI_CmsImportExportHandler
public java.util.List getIgnoredProperties()
public java.util.List getImmutableResources()
Certain system resources should not be changed during import. This is the case for the main folders in the /system/ folder. Changes to these folders usually should not be imported to another system.
public I_CmsImportExportHandler getImportExportHandler(java.lang.String importFile) throws CmsImportExportException
importFile
- the name (absolute path) of the resource (zipfile or folder) to be imported
CmsImportExportException
- if somethong goes wrongpublic java.util.List getImportExportHandlers()
public java.util.Map getImportGroupTranslations()
public java.util.Map getImportUserTranslations()
public java.util.List getImportVersionClasses()
public java.lang.String getOldWebAppUrl()
This setting is required to import content of 4.x OpenCms apps. correct into 5.x OpenCms apps.
public void importData(CmsObject cms, java.lang.String importFile, java.lang.String importPath, I_CmsReport report) throws CmsImportExportException, CmsXmlException, CmsRoleViolationException, CmsException
cms
- the current OpenCms context objectimportFile
- the name (absolute path) of the resource (zipfile or folder) to be importedimportPath
- the name (absolute path) of the destination folder in the Cms if required, or nullreport
- a Cms report to print log messages
CmsRoleViolationException
- if the current user is not allowed to import the OpenCms database
CmsImportExportException
- if operation was not successful
CmsXmlException
- if the manifest of the import could not be unmarshalled
CmsException
- in case of errors accessing the VFSI_CmsImportExportHandler
public boolean overwriteCollidingResources()
setOverwriteCollidingResources(boolean)
public void setConvertToXmlPage(boolean convertToXmlPage)
convertToXmlPage
- true, if imported pages should be converted into XML pages.public void setConvertToXmlPage(java.lang.String convertToXmlPage)
convertToXmlPage
- "true"
, if imported pages should be converted into XML pages.public void setOldWebAppUrl(java.lang.String webAppUrl)
This setting is required to import content of 4.x OpenCms apps. correct into 5.x OpenCms apps.
webAppUrl
- a URL of the a OpenCms app. (e.g. http://localhost:8080/opencms/opencms/)public void setOverwriteCollidingResources(boolean overwriteCollidingResources)
v1 and v2 imports (without resource UUIDs in the manifest) *MUST* overwrite colliding resources. Don't forget to set this flag back to it's original value in v1 and v2 import implementations!
This flag must be set to false to force imports > v2 to move colliding resources to /system/lost-found/.
The import implementation has to take care to set this flag correct!
overwriteCollidingResources
- true if colliding resources should be overwritten during the importpublic void setOverwriteCollidingResources(java.lang.String overwriteCollidingResources)
overwriteCollidingResources
- "true"
if colliding resources should be overwritten during the importsetOverwriteCollidingResources(boolean)
public java.lang.String translateGroup(java.lang.String name)
If no matching name is found, the given group name is returned.
name
- the group name to translate
public java.lang.String translateUser(java.lang.String name)
If no matching name is found, the given user name is returned.
name
- the user name to translate
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
Object.finalize()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |