Package org.opencms.gwt
Class CmsAliasHelper
java.lang.Object
org.opencms.gwt.CmsAliasHelper
This class contains the real implementations of service methods related to aliases.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
checkValidAliasPath
(String path, Locale locale) Checks whether a given string is a valid alias path.protected CmsAliasBean
convertAliasToBean
(CmsAlias alias) Converts a server-side alias object to an alias bean.Returns the comma separated alias data.protected List<CmsAliasBean>
getAliasesForPage
(CmsUUID uuid) Implementation of the getAliasesForPage method.void
saveAliases
(CmsUUID structureId, List<CmsAliasBean> aliasBeans) Saves aliases.void
Sets the CMS object.validateAliases
(CmsUUID uuid, Map<String, String> aliasPaths) The internal method used for validating aliases.
-
Constructor Details
-
CmsAliasHelper
public CmsAliasHelper()
-
-
Method Details
-
exportAliasesAsCsv
Returns the comma separated alias data.- Parameters:
cms
- the OpenCms context- Returns:
- the comma separated alias data
- Throws:
CmsException
- if something goes wrong reading the alias data
-
saveAliases
Saves aliases.- Parameters:
structureId
- the structure idaliasBeans
- the alias beans- Throws:
CmsException
- if something goes wrong
-
setCms
Sets the CMS object.- Parameters:
cms
- the CMS object
-
checkValidAliasPath
Checks whether a given string is a valid alias path.- Parameters:
path
- the path to checklocale
- the locale to use for validation messages- Returns:
- null if the string is a valid alias path, else an error message
-
convertAliasToBean
Converts a server-side alias object to an alias bean.- Parameters:
alias
- the server-side alias object- Returns:
- the client-side alias bean
-
getAliasesForPage
Implementation of the getAliasesForPage method.- Parameters:
uuid
- the structure id of the page- Returns:
- the aliases for the given page
- Throws:
CmsException
- if something goes wrong
-
validateAliases
protected Map<String,String> validateAliases(CmsUUID uuid, Map<String, String> aliasPaths) throws CmsExceptionThe internal method used for validating aliases.- Parameters:
uuid
- the structure id of the resource whose aliases are being validatedaliasPaths
- a map from (arbitrary) ids to alias paths- Returns:
- a map from the same ids to validation error messages
- Throws:
CmsException
- if something goes wrong
-