org.opencms.gwt
Class CmsAliasHelper

java.lang.Object
  extended by org.opencms.gwt.CmsAliasHelper

public class CmsAliasHelper
extends java.lang.Object

This class contains the real implementations of service methods related to aliases.


Constructor Summary
CmsAliasHelper()
           
 
Method Summary
protected  java.lang.String checkValidAliasPath(java.lang.String path, java.util.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.
 java.lang.String exportAliasesAsCsv(CmsObject cms)
          Returns the comma separated alias data.
protected  java.util.List<CmsAliasBean> getAliasesForPage(CmsUUID uuid)
          Implementation of the getAliasesForPage method.
 void saveAliases(CmsUUID structureId, java.util.List<CmsAliasBean> aliasBeans)
          Saves aliases.
 void setCms(CmsObject cms)
          Sets the CMS object.
protected  java.util.Map<java.lang.String,java.lang.String> validateAliases(CmsUUID uuid, java.util.Map<java.lang.String,java.lang.String> aliasPaths)
          The internal method used for validating aliases.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsAliasHelper

public CmsAliasHelper()
Method Detail

exportAliasesAsCsv

public java.lang.String exportAliasesAsCsv(CmsObject cms)
                                    throws CmsException
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

public void saveAliases(CmsUUID structureId,
                        java.util.List<CmsAliasBean> aliasBeans)
                 throws CmsException
Saves aliases.

Parameters:
structureId - the structure id
aliasBeans - the alias beans
Throws:
CmsException - if something goes wrong

setCms

public void setCms(CmsObject cms)
Sets the CMS object.

Parameters:
cms - the CMS object

checkValidAliasPath

protected java.lang.String checkValidAliasPath(java.lang.String path,
                                               java.util.Locale locale)
Checks whether a given string is a valid alias path.

Parameters:
path - the path to check
locale - the locale to use for validation messages
Returns:
null if the string is a valid alias path, else an error message

convertAliasToBean

protected CmsAliasBean convertAliasToBean(CmsAlias alias)
Converts a server-side alias object to an alias bean.

Parameters:
alias - the server-side alias object
Returns:
the client-side alias bean

getAliasesForPage

protected java.util.List<CmsAliasBean> getAliasesForPage(CmsUUID uuid)
                                                  throws CmsException
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 java.util.Map<java.lang.String,java.lang.String> validateAliases(CmsUUID uuid,
                                                                           java.util.Map<java.lang.String,java.lang.String> aliasPaths)
                                                                    throws CmsException
The internal method used for validating aliases.

Parameters:
uuid - the structure id of the resource whose aliases are being validated
aliasPaths - 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