public class DefaultLink extends DefaultTraversableAmetysObject<DefaultLinkFactory> implements Link, SiteAwareAmetysObject, MovableAmetysObject
Link.LinkStatus, Link.LinkType
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_COLOR
Constant for color property.
|
static String |
PROPERTY_CONTENT
Constant for title property.
|
static String |
PROPERTY_DYNAMIC_INFO_PROVIDER
Constant for id of provider of dynamic information.
|
static String |
PROPERTY_INTERNAL_URL
Constant for internal URL property.
|
static String |
PROPERTY_PAGE
Constant for page property.
|
static String |
PROPERTY_PICTURE
Constant for picture data property.
|
static String |
PROPERTY_PICTURE_ALTERNATIVE
Constant for picture alternative property.
|
static String |
PROPERTY_PICTURE_GLYPH
Constant for picture glyph property.
|
static String |
PROPERTY_PICTURE_ID
Constant for picture id property.
|
static String |
PROPERTY_PICTURE_TYPE
Constant for picture type property.
|
static String |
PROPERTY_STATUS
Constant for status property.
|
static String |
PROPERTY_THEMES
Constant for themes property.
|
static String |
PROPERTY_TITLE
Constant for title property.
|
static String |
PROPERTY_URL
Constant for URL property.
|
static String |
PROPERTY_URL_ALTERNATIVE
Constant for URL alternative property.
|
static String |
PROPERTY_URLTYPE
Constant for URL type property.
|
Constructor and Description |
---|
DefaultLink(Node node,
String parentPath,
DefaultLinkFactory factory)
Create a
DefaultLink . |
Modifier and Type | Method and Description |
---|---|
private String[] |
_getListFromMetadataName(String metadataName)
Retrieves the list of values corresponding to the metadata name passed as
parameter
|
private void |
_setListWithMetadataName(String[] list,
String metadataName)
Sets the list of values to the node corresponding to the metadata name
passed as a parameter
|
boolean |
canMoveTo(AmetysObject newParent)
Test if a move can be a success or if it is impossible (e.g.
|
String |
getAlternative()
Get the link alternative.
|
String |
getColor()
Get the color.
|
String |
getContent()
Get the link content.
|
String |
getDynamicInformationProvider()
Get the id of the provider of dynamic information.
|
BinaryMetadata |
getExternalPicture()
Get the picture as a binary metadata.
|
String |
getInternalUrl()
Get the internal URL.
|
String |
getLanguage()
Get the theme language.
|
String |
getPage()
Get the page.
|
String |
getPictureAlternative()
Get the picture alternative.
|
String |
getPictureGlyph()
Get the picture glyph.
|
String |
getPictureType()
Get the picture type.
|
String |
getResourcePictureId()
Get the picture resource ID.
|
Site |
getSite()
Returns this object's site.
|
String |
getSiteName()
Returns this object's site name.
|
Link.LinkStatus |
getStatus()
Get the status.
|
String[] |
getThemes()
Get the themes.
|
String |
getTitle()
Get the link title.
|
String |
getUrl()
Get the URL.
|
Link.LinkType |
getUrlType()
Retrieves the linked URL type.
|
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)
|
protected void |
removePictureMetas()
Remove all picture metas (picture ID and picture binary).
|
void |
removeTheme(String themeId)
Remove theme if exist
|
void |
setAlternative(String alternative)
Set the link alternative.
|
void |
setColor(String color)
Set the color.
|
void |
setContent(String content)
Set the content.
|
void |
setDynamicInformationProvider(String providerId)
Set the id of the provider of dynamic information.
|
void |
setExternalPicture(String mimeType,
String filename,
InputStream stream)
Set the picture from an external file.
|
void |
setInternalUrl(String url)
Set the internal URL.
|
void |
setNoPicture()
Removes any picture currently assigned.
|
void |
setPage(String page)
Set the page.
|
void |
setPictureAlternative(String alternative)
Set the picture alternative.
|
void |
setPictureGlyph(String glyph)
Set the picture glyph.
|
void |
setPictureType(String type)
Set the picture type.
|
void |
setResourcePicture(String resourceId)
Set the picture from an explorer resource.
|
void |
setStatus(Link.LinkStatus status)
Set the status.
|
void |
setThemes(String[] themes)
Set the themes.
|
void |
setTitle(String title)
Set the title.
|
void |
setUrl(Link.LinkType urlType,
String url)
Set the URL.
|
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getChild, getChildren, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, hasChild, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
equals, getId, getName, getParent, getParentPath, getPath, hashCode
getNode
getMetadataHolder
needsSave, rename, revertChanges, saveChanges
remove
getChildAt, getChildPosition
public static final String PROPERTY_URL
public static final String PROPERTY_DYNAMIC_INFO_PROVIDER
public static final String PROPERTY_INTERNAL_URL
public static final String PROPERTY_URLTYPE
public static final String PROPERTY_TITLE
public static final String PROPERTY_CONTENT
public static final String PROPERTY_URL_ALTERNATIVE
public static final String PROPERTY_PICTURE_TYPE
public static final String PROPERTY_PICTURE
public static final String PROPERTY_PICTURE_ID
public static final String PROPERTY_PICTURE_GLYPH
public static final String PROPERTY_PICTURE_ALTERNATIVE
public static final String PROPERTY_THEMES
public static final String PROPERTY_COLOR
public static final String PROPERTY_PAGE
public static final String PROPERTY_STATUS
public DefaultLink(Node node, String parentPath, DefaultLinkFactory factory)
DefaultLink
.node
- the node backing this AmetysObject
.parentPath
- the parent path in the Ametys hierarchy.factory
- the DefaultLinkFactory
which creates the
AmetysObject.public String getUrl() throws AmetysRepositoryException
Link
getUrl
in interface Link
AmetysRepositoryException
- if an error occurs.public void setUrl(Link.LinkType urlType, String url) throws AmetysRepositoryException
Link
setUrl
in interface Link
urlType
- The URL typeurl
- the link URL to set.AmetysRepositoryException
- if an error occurs.public String getInternalUrl() throws AmetysRepositoryException
Link
getInternalUrl
in interface Link
AmetysRepositoryException
- if an error occurs.public void setInternalUrl(String url) throws AmetysRepositoryException
Link
setInternalUrl
in interface Link
url
- the link internal URL to set.AmetysRepositoryException
- if an error occurs.public Link.LinkType getUrlType() throws AmetysRepositoryException
Link
getUrlType
in interface Link
AmetysRepositoryException
- if an error occurs.public String getTitle() throws AmetysRepositoryException
Link
getTitle
in interface Link
AmetysRepositoryException
- if an error occurs.public void setTitle(String title) throws AmetysRepositoryException
Link
setTitle
in interface Link
title
- the link title to set.AmetysRepositoryException
- if an error occurs.public String getContent() throws AmetysRepositoryException
Link
getContent
in interface Link
AmetysRepositoryException
- if an error occurs.public void setContent(String content) throws AmetysRepositoryException
Link
setContent
in interface Link
content
- the link content to set.AmetysRepositoryException
- if an error occurs.public String getAlternative() throws AmetysRepositoryException
Link
getAlternative
in interface Link
AmetysRepositoryException
- if an error occurs.public void setAlternative(String alternative) throws AmetysRepositoryException
Link
setAlternative
in interface Link
alternative
- the link alternative to set.AmetysRepositoryException
- if an error occurs.public BinaryMetadata getExternalPicture() throws AmetysRepositoryException
Link
getExternalPicture
in interface Link
AmetysRepositoryException
- if an error occurs.public void setExternalPicture(String mimeType, String filename, InputStream stream) throws AmetysRepositoryException
Link
setExternalPicture
in interface Link
mimeType
- the file MIME type.filename
- the file name.stream
- an input stream on the file bytes.AmetysRepositoryException
- if an error occurs.public String getResourcePictureId() throws AmetysRepositoryException
Link
getResourcePictureId
in interface Link
AmetysRepositoryException
- if an error occurs.public void setResourcePicture(String resourceId) throws AmetysRepositoryException
Link
setResourcePicture
in interface Link
resourceId
- the resource ID.AmetysRepositoryException
- if an error occurs.public void setNoPicture() throws AmetysRepositoryException
Link
setNoPicture
in interface Link
AmetysRepositoryException
- if an error occurs.public String getPictureType() throws AmetysRepositoryException
Link
getPictureType
in interface Link
AmetysRepositoryException
- if an error occurs.public void setPictureType(String type) throws AmetysRepositoryException
Link
setPictureType
in interface Link
type
- the picture type to set.AmetysRepositoryException
- if an error occurs.public String getPictureGlyph() throws AmetysRepositoryException
Link
getPictureGlyph
in interface Link
AmetysRepositoryException
- if an error occurs.public void setPictureGlyph(String glyph) throws AmetysRepositoryException
Link
setPictureGlyph
in interface Link
glyph
- the glyph picture to set.AmetysRepositoryException
- if an error occurs.public String getPictureAlternative() throws AmetysRepositoryException
Link
getPictureAlternative
in interface Link
AmetysRepositoryException
- if an error occurs.public void setPictureAlternative(String alternative) throws AmetysRepositoryException
Link
setPictureAlternative
in interface Link
alternative
- the picture alternative to set.AmetysRepositoryException
- if an error occurs.public String[] getThemes() throws AmetysRepositoryException
Link
getThemes
in interface Link
AmetysRepositoryException
- if an error occurs.public void setThemes(String[] themes) throws AmetysRepositoryException
Link
setThemes
in interface Link
themes
- the themes to set.AmetysRepositoryException
- if an error occurs.public void removeTheme(String themeId) throws AmetysRepositoryException
Link
removeTheme
in interface Link
themeId
- The id of theme to removeAmetysRepositoryException
- if an error occurspublic Site getSite() throws AmetysRepositoryException
SiteAwareAmetysObject
getSite
in interface SiteAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getSiteName() throws AmetysRepositoryException
SiteAwareAmetysObject
getSiteName
in interface SiteAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getLanguage()
protected void removePictureMetas() throws RepositoryException
RepositoryException
- if an error occurs.public void orderBefore(AmetysObject siblingObject) throws AmetysRepositoryException
MovableAmetysObject
orderBefore
in interface MovableAmetysObject
siblingObject
- 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 void moveTo(AmetysObject newParent, boolean renameIfExist) throws AmetysRepositoryException, RepositoryIntegrityViolationException
MovableAmetysObject
moveTo
in interface MovableAmetysObject
newParent
- 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.public boolean canMoveTo(AmetysObject newParent) throws AmetysRepositoryException
MovableAmetysObject
canMoveTo
in interface MovableAmetysObject
newParent
- See moveTo.AmetysRepositoryException
- if an error occurs.private String[] _getListFromMetadataName(String metadataName)
metadataName
- the name of the metadata to retrieveprivate void _setListWithMetadataName(String[] list, String metadataName)
list
- the list of value to be setmetadataName
- the name of the metadatapublic String getDynamicInformationProvider() throws AmetysRepositoryException
Link
getDynamicInformationProvider
in interface Link
AmetysRepositoryException
- if an error occurs.public void setDynamicInformationProvider(String providerId) throws AmetysRepositoryException
Link
setDynamicInformationProvider
in interface Link
providerId
- the id of providerAmetysRepositoryException
- if an error occurs.public String getColor() throws AmetysRepositoryException
Link
getColor
in interface Link
AmetysRepositoryException
- if an error occurs.public void setColor(String color) throws AmetysRepositoryException
Link
setColor
in interface Link
color
- the color to set.AmetysRepositoryException
- if an error occurs.public String getPage() throws AmetysRepositoryException
Link
getPage
in interface Link
AmetysRepositoryException
- if an error occurs.public void setPage(String page) throws AmetysRepositoryException
Link
setPage
in interface Link
page
- the page id to set.AmetysRepositoryException
- if an error occurs.public Link.LinkStatus getStatus() throws AmetysRepositoryException
Link
getStatus
in interface Link
AmetysRepositoryException
- if an error occurs.public void setStatus(Link.LinkStatus status) throws AmetysRepositoryException
Link
setStatus
in interface Link
status
- the status to set.AmetysRepositoryException
- if an error occurs.