F
- the actual type of factory.public abstract class AbstractSurveyElement<F extends DefaultTraversableAmetysObjectFactory> extends DefaultTraversableAmetysObject<F> implements CopiableAmetysObject
AmetysObject
for storing elements of a surveyModifier and Type | Field and Description |
---|---|
static String |
PROPERTY_PICTURE
Constant for picture data property.
|
static String |
PROPERTY_PICTURE_ALTERNATIVE
Constant for picture alternative property.
|
static String |
PROPERTY_PICTURE_ID
Constant for picture id property.
|
static String |
PROPERTY_PICTURE_TYPE
Constant for picture type property.
|
Constructor and Description |
---|
AbstractSurveyElement(Node node,
String parentPath,
F factory)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
copyPictureTo(AbstractSurveyElement elmt)
Copy the picture of this
AbstractSurveyElement to the element in arguments |
BinaryMetadata |
getExternalPicture()
Get the picture as a binary metadata.
|
String |
getPictureAlternative()
Get the picture alternative.
|
String |
getPictureType()
Get the picture type.
|
String |
getResourcePictureId()
Get the picture resource ID.
|
protected void |
removePictureMetas()
Remove all picture metas (picture ID and picture binary).
|
void |
setExternalPicture(String mimeType,
String filename,
InputStream stream)
Set the picture from an external file.
|
void |
setNoPicture()
Removes any picture currently assigned.
|
void |
setPictureAlternative(String alternative)
Set the picture alternative.
|
void |
setPictureType(String type)
Set the picture type.
|
void |
setResourcePicture(String resourceId)
Set the picture from an explorer resource.
|
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
copyTo, copyTo
equals, getId, getName, getParent, getParentPath, getPath, hashCode
getNode
getMetadataHolder
needsSave, rename, revertChanges, saveChanges
remove
getChildAt, getChildPosition
public static final String PROPERTY_PICTURE
public static final String PROPERTY_PICTURE_TYPE
public static final String PROPERTY_PICTURE_ID
public static final String PROPERTY_PICTURE_ALTERNATIVE
public AbstractSurveyElement(Node node, String parentPath, F factory)
node
- the node backing this AmetysObject
.parentPath
- the parent path in the Ametys hierarchy.factory
- the DefaultTraversableAmetysObjectFactory
which creates the AmetysObject.public BinaryMetadata getExternalPicture() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs.public void setExternalPicture(String mimeType, String filename, InputStream stream) throws AmetysRepositoryException
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
AmetysRepositoryException
- if an error occurs.public void setResourcePicture(String resourceId) throws AmetysRepositoryException
resourceId
- the resource ID.AmetysRepositoryException
- if an error occurs.public void setNoPicture() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs.public String getPictureType() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs.public void setPictureType(String type) throws AmetysRepositoryException
type
- the picture type to set.AmetysRepositoryException
- if an error occurs.public String getPictureAlternative() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs.public void setPictureAlternative(String alternative) throws AmetysRepositoryException
alternative
- the picture alternative to set.AmetysRepositoryException
- if an error occurs.protected void removePictureMetas() throws RepositoryException
RepositoryException
- if an error occurs.protected void copyPictureTo(AbstractSurveyElement elmt)
AbstractSurveyElement
to the element in argumentselmt
- The element