|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.db.CmsAliasManager
public class CmsAliasManager
The alias manager provides access to the aliases stored in the database.
| Field Summary | |
|---|---|
protected CmsSecurityManager |
m_securityManager
The security manager for accessing the database. |
| Constructor Summary | |
|---|---|
CmsAliasManager(CmsSecurityManager securityManager)
Creates a new alias manager instance. |
|
| Method Summary | |
|---|---|
protected void |
checkPermissionsForMassEdit(CmsObject cms)
Checks whether the current user has the permissions to mass edit the alias table, and throws an exception otherwise. |
java.util.List<CmsAlias> |
getAliasesForPath(CmsObject cms,
java.lang.String siteRoot,
java.lang.String aliasPath)
Gets the list of aliases for a path in a given site. |
java.util.List<CmsAlias> |
getAliasesForSite(CmsObject cms,
java.lang.String siteRoot)
Gets the list of aliases for a given site root. |
java.util.List<CmsAlias> |
getAliasesForStructureId(CmsObject cms,
CmsUUID structureId)
Gets the aliases for a given structure id. |
java.util.List<CmsRewriteAlias> |
getRewriteAliases(CmsObject cms,
java.lang.String siteRoot)
Reads the rewrite aliases for a given site root. |
CmsRewriteAliasMatcher |
getRewriteAliasMatcher(CmsObject cms,
java.lang.String siteRoot)
Gets the rewrite alias matcher for the given site. |
boolean |
hasPermissionsForMassEdit(CmsObject cms,
java.lang.String siteRoot)
Checks whether the current user has permissions for mass editing the alias table. |
protected CmsAliasImportResult |
importAlias(CmsObject cms,
java.lang.String siteRoot,
java.lang.String aliasPath,
java.lang.String vfsPath,
CmsAliasMode mode)
Imports a single alias. |
java.util.List<CmsAliasImportResult> |
importAliases(CmsObject cms,
byte[] aliasData,
java.lang.String siteRoot,
java.lang.String separator)
Imports alias CSV data. |
protected CmsAliasImportResult |
processAliasImport(CmsObject cms,
java.lang.String siteRoot,
java.lang.String aliasPath,
java.lang.String vfsPath,
CmsAliasMode mode)
Processes a single alias import operation which has already been parsed into fields. |
protected CmsAliasImportResult |
processAliasLine(CmsObject cms,
java.lang.String siteRoot,
java.lang.String line,
java.lang.String separator)
Processes a line from a CSV file containing the alias data to be imported. |
void |
saveAliases(CmsObject cms,
CmsUUID structureId,
java.util.List<CmsAlias> aliases)
Saves the aliases for a given structure id, completely replacing any existing aliases for the same structure id. |
void |
saveRewriteAliases(CmsObject cms,
java.lang.String siteRoot,
java.util.List<CmsRewriteAlias> newAliases)
Saves the rewrite alias for a given site root. |
void |
updateAliases(CmsObject cms,
java.util.Collection<CmsAlias> toDelete,
java.util.Collection<CmsAlias> toAdd)
Updates the aliases in the database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CmsSecurityManager m_securityManager
| Constructor Detail |
|---|
public CmsAliasManager(CmsSecurityManager securityManager)
securityManager - the security manager| Method Detail |
|---|
public java.util.List<CmsAlias> getAliasesForPath(CmsObject cms,
java.lang.String siteRoot,
java.lang.String aliasPath)
throws CmsException
This should only return either an empty list or a list with a single element.
cms - the current CMS contextsiteRoot - the site root for which we want the aliasesaliasPath - the alias path
CmsException - if something goes wrong
public java.util.List<CmsAlias> getAliasesForSite(CmsObject cms,
java.lang.String siteRoot)
throws CmsException
cms - the current CMS contextsiteRoot - the site root
CmsException - if something goes wrong
public java.util.List<CmsAlias> getAliasesForStructureId(CmsObject cms,
CmsUUID structureId)
throws CmsException
cms - the current CMS contextstructureId - the structure id of a resource
CmsException - if something goes wrong
public java.util.List<CmsRewriteAlias> getRewriteAliases(CmsObject cms,
java.lang.String siteRoot)
throws CmsException
cms - the current CMS contextsiteRoot - the site root for which the rewrite aliases should be retrieved
CmsException - if something goes wrong
public CmsRewriteAliasMatcher getRewriteAliasMatcher(CmsObject cms,
java.lang.String siteRoot)
throws CmsException
cms - the CMS context to usesiteRoot - the site root
CmsException - if something goes wrong
public boolean hasPermissionsForMassEdit(CmsObject cms,
java.lang.String siteRoot)
cms - the current CMS contextsiteRoot - the site root to check
public java.util.List<CmsAliasImportResult> importAliases(CmsObject cms,
byte[] aliasData,
java.lang.String siteRoot,
java.lang.String separator)
throws java.lang.Exception
cms - the current CMS contextaliasData - the alias datasiteRoot - the root of the site into which the alias data should be importedseparator - the field separator which is used by the imported data
java.lang.Exception - if something goes wrong
public void saveAliases(CmsObject cms,
CmsUUID structureId,
java.util.List<CmsAlias> aliases)
throws CmsException
cms - the current CMS contextstructureId - the structure id of a resourcealiases - the list of aliases which should be written
CmsException - if something goes wrong
public void saveRewriteAliases(CmsObject cms,
java.lang.String siteRoot,
java.util.List<CmsRewriteAlias> newAliases)
throws CmsException
cms - the current CMS contextsiteRoot - the site root for which the rewrite aliases should be savednewAliases - the list of aliases to save
CmsException - if something goes wrong
public void updateAliases(CmsObject cms,
java.util.Collection<CmsAlias> toDelete,
java.util.Collection<CmsAlias> toAdd)
throws CmsException
cms - the current CMS contexttoDelete - the collection of aliases to deletetoAdd - the collection of aliases to add
CmsException - if something goes wrong
protected void checkPermissionsForMassEdit(CmsObject cms)
throws CmsException
cms - the current CMS context
CmsException
protected CmsAliasImportResult importAlias(CmsObject cms,
java.lang.String siteRoot,
java.lang.String aliasPath,
java.lang.String vfsPath,
CmsAliasMode mode)
throws CmsException
cms - the current CMS contextsiteRoot - the site rootaliasPath - the alias pathvfsPath - the VFS pathmode - the alias mode
CmsException - if something goes wrong
protected CmsAliasImportResult processAliasImport(CmsObject cms,
java.lang.String siteRoot,
java.lang.String aliasPath,
java.lang.String vfsPath,
CmsAliasMode mode)
cms - the current CMS contextsiteRoot - the site rootaliasPath - the alias pathvfsPath - the VFS resource pathmode - the alias mode
protected CmsAliasImportResult processAliasLine(CmsObject cms,
java.lang.String siteRoot,
java.lang.String line,
java.lang.String separator)
cms - the current CMS contextsiteRoot - the site rootline - the line with the data to importseparator - the field separator
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||