|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.importexport.A_CmsImport
Collection of common used methods for implementing OpenCms Import classes.
This class does not implement a real OpenCms import, real import implmentation should be inherited form this class.
I_CmsImport
Field Summary | |
protected static int |
DEBUG
Debug flag to show debug output. |
protected CmsObject |
m_cms
The cms context to do the import operations with. |
protected boolean |
m_convertToXmlPage
Flag for conversion to xml pages. |
protected org.dom4j.Document |
m_docXml
The xml manifest-file. |
protected java.util.Stack |
m_groupsToCreate
Groups to create during import are stored here. |
protected java.lang.String |
m_importPath
The import-path to write resources into the cms. |
protected java.io.File |
m_importResource
The import-resource (folder) to load resources from. |
protected java.util.zip.ZipFile |
m_importZip
The import-resource (zip) to load resources from. |
protected java.util.Map |
m_linkPropertyStorage
Storage for all pointer properties which must be converted into links. |
protected java.util.Map |
m_linkStorage
Storage for all pointers which must be converted into links. |
protected I_CmsReport |
m_report
The object to report the log messages. |
protected I_CmsMessageBundle |
m_userMessages
Messages object with the locale of the current user. |
static java.lang.String |
RESOURCE_TYPE_LEGACY_PAGE_NAME
The name of the legacy resource type "page". |
protected static int |
RESOURCE_TYPE_LINK_ID
The id of the legacy resource type "link". |
protected static java.lang.String |
RESOURCE_TYPE_LINK_NAME
The name of the legacy resource type "link". |
protected static int |
RESOURCE_TYPE_NEWPAGE_ID
The id of the legacy resource type "newpage". |
protected static java.lang.String |
RESOURCE_TYPE_NEWPAGE_NAME
The name of the legacy resource type "newpage". |
Constructor Summary | |
A_CmsImport()
|
Method Summary | |
protected boolean |
checkImmutable(java.lang.String translatedName,
java.util.List immutableResources)
Checks if the resources is in the list of immutalbe resources. |
protected void |
cleanUp()
Cleans up member variables after the import is finished. |
java.lang.String |
convertDigestEncoding(java.lang.String value)
Converts a given digest to base64 encoding. |
protected void |
convertPointerToSiblings()
Converts old style pointers to siblings if possible. |
protected byte[] |
getFileBytes(java.lang.String filename)
Returns a byte array containing the content of the file. |
protected CmsAccessControlEntry |
getImportAccessControlEntry(CmsResource res,
java.lang.String id,
java.lang.String allowed,
java.lang.String denied,
java.lang.String flags)
Creates a new access control entry and stores it for later write out. |
protected java.util.Locale |
getLocale(java.lang.String destination,
java.util.List properties)
Returns the appropriate locale for the given destination. |
protected void |
importAccessControlEntries(CmsResource resource,
java.util.List aceList)
Writes alread imported access control entries for a given resource. |
protected void |
importGroup(java.lang.String name,
java.lang.String description,
java.lang.String flags,
java.lang.String parentgroupName)
Imports a single group. |
protected void |
importGroups()
Imports the OpenCms groups. |
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)
Imports a single user. |
protected void |
importUsers()
Imports the OpenCms users. |
protected void |
initialize()
Initializes all member variables before the import is started. |
protected java.util.List |
readPropertiesFromManifest(org.dom4j.Element parentElement,
java.util.List ignoredPropertyKeys)
Reads all properties below a specified parent element from the manifest.xml . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opencms.importexport.I_CmsImport |
getVersion, importResources |
Field Detail |
public static final java.lang.String RESOURCE_TYPE_LEGACY_PAGE_NAME
protected static final int DEBUG
protected static final int RESOURCE_TYPE_LINK_ID
protected static final java.lang.String RESOURCE_TYPE_LINK_NAME
protected static final int RESOURCE_TYPE_NEWPAGE_ID
protected static final java.lang.String RESOURCE_TYPE_NEWPAGE_NAME
protected CmsObject m_cms
protected boolean m_convertToXmlPage
protected org.dom4j.Document m_docXml
protected java.util.Stack m_groupsToCreate
protected java.lang.String m_importPath
protected java.io.File m_importResource
protected java.util.zip.ZipFile m_importZip
protected java.util.Map m_linkPropertyStorage
protected java.util.Map m_linkStorage
protected I_CmsReport m_report
protected I_CmsMessageBundle m_userMessages
Constructor Detail |
public A_CmsImport()
Method Detail |
public java.lang.String convertDigestEncoding(java.lang.String value)
value
- the digest value in the legacy encoding
protected boolean checkImmutable(java.lang.String translatedName, java.util.List immutableResources)
translatedName
- the name of the resourceimmutableResources
- the list of the immutable resources
protected void cleanUp()
This is required since there is only one instance for each import version that is kept in memory and reused.
protected void convertPointerToSiblings()
protected byte[] getFileBytes(java.lang.String filename)
filename
- the name of the file to read
protected CmsAccessControlEntry getImportAccessControlEntry(CmsResource res, java.lang.String id, java.lang.String allowed, java.lang.String denied, java.lang.String flags)
res
- the resourceid
- the id of the principalallowed
- the allowed permissionsdenied
- the denied permissionsflags
- the flags
protected java.util.Locale getLocale(java.lang.String destination, java.util.List properties)
destination
- the destination path (parent must exist)properties
- the properties to check at first
protected void importAccessControlEntries(CmsResource resource, java.util.List aceList)
resource
- the resource assigned to the access control entriesaceList
- the access control entries to createprotected void importGroup(java.lang.String name, java.lang.String description, java.lang.String flags, java.lang.String parentgroupName) throws CmsImportExportException
name
- the name of the groupdescription
- group descriptionflags
- group flagsparentgroupName
- name of the parent group
CmsImportExportException
- if something goes wrongprotected void importGroups() throws CmsImportExportException
CmsImportExportException
- if something goes wrongprotected 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
name
- user nameflags
- user flagspassword
- user passwordfirstname
- firstname of the userlastname
- lastname of the useremail
- user emaildateCreated
- creation dateuserInfo
- user infouserGroups
- user groups
CmsImportExportException
- in case something goes wrongprotected void importUsers() throws CmsImportExportException
CmsImportExportException
- if something goes wrongprotected void initialize()
This is required since there is only one instance for each import version that is kept in memory and reused.
protected java.util.List readPropertiesFromManifest(org.dom4j.Element parentElement, java.util.List ignoredPropertyKeys)
manifest.xml
.
parentElement
- the current file nodeignoredPropertyKeys
- a list of properies to be ignored
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |