public class DefaultAlias extends SimpleAmetysObject<DefaultAliasFactory> implements Alias, MovableAmetysObject
DefaultAlias is a URL redirection to an existing page or a module URLAlias.TargetType| Modifier and Type | Field and Description |
|---|---|
static String |
METADATA_CREATED_AT
Constant for origin metadata.
|
static String |
METADATA_EXPIRATION_DATE
Constant for period metadata.
|
static String |
METADATA_TARGET
Constant for target metadata.
|
static String |
METADATA_TYPE
Constant for type metadata.
|
static String |
METADATA_URL
Constant for origin metadata.
|
| Constructor and Description |
|---|
DefaultAlias(Node node,
String parentPath,
DefaultAliasFactory factory)
Creates a
DefaultAlias. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canMoveTo(AmetysObject newParent)
Test if a move can be a success or if it is impossible (e.g.
|
Date |
getCreationDate()
Get the creation date
|
Date |
getExpirationDate()
Get the expiration date
|
String |
getTarget()
Get the target URL
|
Alias.TargetType |
getType()
Retrieves the target type.
|
String |
getUrl()
Get the origin URL
|
void |
moveTo(AmetysObject newParent,
boolean renameIfExist)
Move the current object as a new child of the given object.
|
void |
orderBefore(AmetysObject siblingObject)
Order a node before another sibling node (or as the last node)
|
void |
removeExpirationDate()
Remove the expiration date
|
void |
setCreationDate(Date date)
Set the creation date
|
void |
setExpirationDate(Date date)
Set the expiration date
|
void |
setTarget(String url)
Set the target URL
|
void |
setType(Alias.TargetType type)
Set the type.
|
void |
setUrl(String url)
Set the origin URL
|
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesequals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitequals, getId, getName, getParent, getParentPath, getPath, hashCodepublic static final String METADATA_CREATED_AT
public static final String METADATA_URL
public static final String METADATA_TARGET
public static final String METADATA_TYPE
public static final String METADATA_EXPIRATION_DATE
public DefaultAlias(Node node, String parentPath, DefaultAliasFactory factory)
DefaultAlias.node - the node backing this AmetysObject.parentPath - the parent path in the Ametys hierarchy.factory - the DefaultZoneItemFactory which creates the AmetysObject.public String getUrl() throws AmetysRepositoryException
AliasgetUrl in interface AliasAmetysRepositoryException - if an error occurs.public void setUrl(String url) throws AmetysRepositoryException
AliassetUrl in interface Aliasurl - the origin URLAmetysRepositoryException - if an error occurs.public String getTarget() throws AmetysRepositoryException
AliasgetTarget in interface AliasAmetysRepositoryException - if an error occurs.public void setTarget(String url) throws AmetysRepositoryException
AliassetTarget in interface Aliasurl - the target URLAmetysRepositoryException - if an error occurs.public Date getExpirationDate() throws AmetysRepositoryException
AliasgetExpirationDate in interface AliasAmetysRepositoryException - if an error occurs.public void removeExpirationDate()
AliasremoveExpirationDate in interface Aliaspublic void setExpirationDate(Date date) throws AmetysRepositoryException
AliassetExpirationDate in interface Aliasdate - the expiration dateAmetysRepositoryException - if an error occurs.public Alias.TargetType getType() throws AmetysRepositoryException
AliasgetType in interface AliasAmetysRepositoryException - if an error occurs.Alias.TargetTypepublic void setType(Alias.TargetType type) throws AmetysRepositoryException
AliassetType in interface Aliastype - the type.AmetysRepositoryException - if an error occurs.Alias.TargetTypepublic Date getCreationDate() throws AmetysRepositoryException
AliasgetCreationDate in interface AliasAmetysRepositoryException - if an error occurs.public void setCreationDate(Date date) throws AmetysRepositoryException
AliassetCreationDate in interface Aliasdate - the date to setAmetysRepositoryException - if an error occurs.public void orderBefore(AmetysObject siblingObject) throws AmetysRepositoryException
MovableAmetysObjectorderBefore in interface MovableAmetysObjectsiblingObject - The node that will be the next sibling node of the current node. Must have the same parent as the current node. Can be null to set the current node as the last node.AmetysRepositoryException - if an error occurs.public boolean canMoveTo(AmetysObject newParent) throws AmetysRepositoryException
MovableAmetysObjectcanMoveTo in interface MovableAmetysObjectnewParent - See moveTo.AmetysRepositoryException - if an error occurs.public void moveTo(AmetysObject newParent, boolean renameIfExist) throws AmetysRepositoryException
MovableAmetysObjectmoveTo in interface MovableAmetysObjectnewParent - The new parent for the current object. Can not be null. Can not be a child of the current node. Must be a TraversableAmetyObject.renameIfExist - true to rename moved page if a page with same name already existAmetysRepositoryException - if an error occurs.RepositoryIntegrityViolationException - if a page with the same name already exists.