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, saveChangesequals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitequals, getId, getName, getParent, getParentPath, getPath, hashCodegetNodegetMetadataHolderneedsSave, rename, revertChanges, saveChangesremovegetChildAt, getChildPositionpublic 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
LinkgetUrl in interface LinkAmetysRepositoryException - if an error occurs.public void setUrl(Link.LinkType urlType, String url) throws AmetysRepositoryException
LinksetUrl in interface LinkurlType - The URL typeurl - the link URL to set.AmetysRepositoryException - if an error occurs.public String getInternalUrl() throws AmetysRepositoryException
LinkgetInternalUrl in interface LinkAmetysRepositoryException - if an error occurs.public void setInternalUrl(String url) throws AmetysRepositoryException
LinksetInternalUrl in interface Linkurl - the link internal URL to set.AmetysRepositoryException - if an error occurs.public Link.LinkType getUrlType() throws AmetysRepositoryException
LinkgetUrlType in interface LinkAmetysRepositoryException - if an error occurs.public String getTitle() throws AmetysRepositoryException
LinkgetTitle in interface LinkAmetysRepositoryException - if an error occurs.public void setTitle(String title) throws AmetysRepositoryException
LinksetTitle in interface Linktitle - the link title to set.AmetysRepositoryException - if an error occurs.public String getContent() throws AmetysRepositoryException
LinkgetContent in interface LinkAmetysRepositoryException - if an error occurs.public void setContent(String content) throws AmetysRepositoryException
LinksetContent in interface Linkcontent - the link content to set.AmetysRepositoryException - if an error occurs.public String getAlternative() throws AmetysRepositoryException
LinkgetAlternative in interface LinkAmetysRepositoryException - if an error occurs.public void setAlternative(String alternative) throws AmetysRepositoryException
LinksetAlternative in interface Linkalternative - the link alternative to set.AmetysRepositoryException - if an error occurs.public BinaryMetadata getExternalPicture() throws AmetysRepositoryException
LinkgetExternalPicture in interface LinkAmetysRepositoryException - if an error occurs.public void setExternalPicture(String mimeType, String filename, InputStream stream) throws AmetysRepositoryException
LinksetExternalPicture in interface LinkmimeType - 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
LinkgetResourcePictureId in interface LinkAmetysRepositoryException - if an error occurs.public void setResourcePicture(String resourceId) throws AmetysRepositoryException
LinksetResourcePicture in interface LinkresourceId - the resource ID.AmetysRepositoryException - if an error occurs.public void setNoPicture() throws AmetysRepositoryException
LinksetNoPicture in interface LinkAmetysRepositoryException - if an error occurs.public String getPictureType() throws AmetysRepositoryException
LinkgetPictureType in interface LinkAmetysRepositoryException - if an error occurs.public void setPictureType(String type) throws AmetysRepositoryException
LinksetPictureType in interface Linktype - the picture type to set.AmetysRepositoryException - if an error occurs.public String getPictureGlyph() throws AmetysRepositoryException
LinkgetPictureGlyph in interface LinkAmetysRepositoryException - if an error occurs.public void setPictureGlyph(String glyph) throws AmetysRepositoryException
LinksetPictureGlyph in interface Linkglyph - the glyph picture to set.AmetysRepositoryException - if an error occurs.public String getPictureAlternative() throws AmetysRepositoryException
LinkgetPictureAlternative in interface LinkAmetysRepositoryException - if an error occurs.public void setPictureAlternative(String alternative) throws AmetysRepositoryException
LinksetPictureAlternative in interface Linkalternative - the picture alternative to set.AmetysRepositoryException - if an error occurs.public String[] getThemes() throws AmetysRepositoryException
LinkgetThemes in interface LinkAmetysRepositoryException - if an error occurs.public void setThemes(String[] themes) throws AmetysRepositoryException
LinksetThemes in interface Linkthemes - the themes to set.AmetysRepositoryException - if an error occurs.public void removeTheme(String themeId) throws AmetysRepositoryException
LinkremoveTheme in interface LinkthemeId - The id of theme to removeAmetysRepositoryException - if an error occurspublic Site getSite() throws AmetysRepositoryException
SiteAwareAmetysObjectgetSite in interface SiteAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getSiteName() throws AmetysRepositoryException
SiteAwareAmetysObjectgetSiteName in interface SiteAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getLanguage()
protected void removePictureMetas() throws RepositoryException
RepositoryException - 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 void moveTo(AmetysObject newParent, boolean renameIfExist) throws AmetysRepositoryException, RepositoryIntegrityViolationException
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.public boolean canMoveTo(AmetysObject newParent) throws AmetysRepositoryException
MovableAmetysObjectcanMoveTo in interface MovableAmetysObjectnewParent - 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
LinkgetDynamicInformationProvider in interface LinkAmetysRepositoryException - if an error occurs.public void setDynamicInformationProvider(String providerId) throws AmetysRepositoryException
LinksetDynamicInformationProvider in interface LinkproviderId - the id of providerAmetysRepositoryException - if an error occurs.public String getColor() throws AmetysRepositoryException
LinkgetColor in interface LinkAmetysRepositoryException - if an error occurs.public void setColor(String color) throws AmetysRepositoryException
LinksetColor in interface Linkcolor - the color to set.AmetysRepositoryException - if an error occurs.public String getPage() throws AmetysRepositoryException
LinkgetPage in interface LinkAmetysRepositoryException - if an error occurs.public void setPage(String page) throws AmetysRepositoryException
LinksetPage in interface Linkpage - the page id to set.AmetysRepositoryException - if an error occurs.public Link.LinkStatus getStatus() throws AmetysRepositoryException
LinkgetStatus in interface LinkAmetysRepositoryException - if an error occurs.public void setStatus(Link.LinkStatus status) throws AmetysRepositoryException
LinksetStatus in interface Linkstatus - the status to set.AmetysRepositoryException - if an error occurs.