Package org.ametys.web.alias
Class AliasDAO
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.web.alias.AliasDAO
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
Class managing
Alias
creation, modification, deletion and moving-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionalias2Json
(DefaultAlias alias) Represent anAlias
in JSONCreate an aliasdeleteAlias
(List<String> ids) Delete an aliasGet an aliasMove an aliasvoid
service
(ServiceManager smanager) Update an aliasMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
The component's role -
PAGE_PATTERN
The PAGE pattern -
URL_PATTERN
The URL pattern -
TARGET_URL_PATTERN
The URL pattern ... Copy of the regexp in Ametys.plugins.web.alias.AliasActions.js#_delayedInitialize -
DEFAULT_ALIAS_NAME
The alias default name- See Also:
-
-
Constructor Details
-
AliasDAO
public AliasDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getAlias
Get an alias- Parameters:
id
- the id of the alias to get- Returns:
- the JSON representation of the alias
-
createAlias
public Map<String,String> createAlias(String type, String url, String target, String siteName, String dateStr) Create an alias- Parameters:
type
- the type (page or url)url
- the origin urltarget
- the target urlsiteName
- the site's namedateStr
- the optional expiration date of the alias- Returns:
- a map
-
updateAlias
public Map<String,String> updateAlias(String id, String type, String url, String target, String siteName, String dateStr) Update an alias- Parameters:
id
- the id of the alias to updatetype
- the type (page or url)url
- the origin urltarget
- the target urlsiteName
- the site's namedateStr
- the optional expiration date of the alias- Returns:
- a map
-
deleteAlias
Delete an alias- Parameters:
ids
- the list of ids of aliases to delete- Returns:
- a map
-
moveAlias
Move an alias- Parameters:
id
- the id of the alias to moverole
- the action to perform- Returns:
- an empty map
- Throws:
javax.jcr.RepositoryException
- if an error occurs
-
alias2Json
Represent anAlias
in JSON- Parameters:
alias
- The alias- Returns:
- the alias in JSON
-