Class AbstractSurveyElement<F extends SurveyElementFactory>
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<F>
org.ametys.plugins.survey.repository.AbstractSurveyElement<F>
- Type Parameters:
F
- the actual type of factory.
- All Implemented Interfaces:
ACLAmetysObject
,AmetysObject
,CopiableAmetysObject
,DataAwareAmetysObject
,ModelLessDataAwareAmetysObject
,ModifiableModelLessDataAwareAmetysObject
,DataHolder
,ModelLessDataHolder
,ModifiableDataHolder
,ModifiableModelLessDataHolder
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TraversableAmetysObject
- Direct Known Subclasses:
Survey
,SurveyPage
,SurveyQuestion
public abstract class AbstractSurveyElement<F extends SurveyElementFactory>
extends DefaultTraversableAmetysObject<F>
implements CopiableAmetysObject, ModifiableModelLessDataAwareAmetysObject
Abstract
AmetysObject
for storing elements of a survey-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractSurveyElement
(javax.jcr.Node node, String parentPath, F factory) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Copy the picture of thisAbstractSurveyElement
to the element in argumentsReturns theDataHolder
of thisAmetysObject
.Get the picture as a binary metadata.Get the picture alternative.Get the picture type.Get the picture resource ID.protected void
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
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.Methods inherited from class org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, disallowInheritance, getChild, getChildren, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, hasChild, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
Methods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
Methods inherited from interface org.ametys.plugins.repository.CopiableAmetysObject
copyTo, copyTo
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getDataNames
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelLessDataAwareAmetysObject
dataToJSON, dataToSAX, getModelItemTypeExtensionPoint, getType, getValue, getValue, getValueOfType, getValueOfType, hasDifferences, hasValue, hasValue, hasValueOrEmpty, isMultiple, isMultiple
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToJSON, dataToSAX, hasValue, hasValueOrEmpty
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
Methods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolder
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelLessDataAwareAmetysObject
getComposite, getComposite, getParentDataHolder, getRepositoryData, getRootDataHolder, removeValue, setValue, setValue, synchronizeValues
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
Field Details
-
PROPERTY_PICTURE
Constant for picture data property.- See Also:
-
PROPERTY_PICTURE_TYPE
Constant for picture type property.- See Also:
-
PROPERTY_PICTURE_ID
Constant for picture id property.- See Also:
-
PROPERTY_PICTURE_ALTERNATIVE
Constant for picture alternative property.- See Also:
-
-
Constructor Details
-
AbstractSurveyElement
Constructor- Parameters:
node
- the node backing thisAmetysObject
.parentPath
- the parent path in the Ametys hierarchy.factory
- theDefaultTraversableAmetysObjectFactory
which creates the AmetysObject.
-
-
Method Details
-
getExternalPicture
Get the picture as a binary metadata.- Returns:
- the picture as a binary metadata.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setExternalPicture
public void setExternalPicture(String mimeType, String filename, InputStream stream) throws AmetysRepositoryException Set the picture from an external file.- Parameters:
mimeType
- the file MIME type.filename
- the file name.stream
- an input stream on the file bytes.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getResourcePictureId
Get the picture resource ID.- Returns:
- the resource ID.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setResourcePicture
Set the picture from an explorer resource.- Parameters:
resourceId
- the resource ID.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setNoPicture
Removes any picture currently assigned.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getPictureType
Get the picture type.- Returns:
- the picture type.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setPictureType
Set the picture type.- Parameters:
type
- the picture type to set.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getPictureAlternative
Get the picture alternative.- Returns:
- the picture alternative.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setPictureAlternative
Set the picture alternative.- Parameters:
alternative
- the picture alternative to set.- Throws:
AmetysRepositoryException
- if an error occurs.
-
removePictureMetas
Remove all picture metas (picture ID and picture binary).- Throws:
javax.jcr.RepositoryException
- if an error occurs.
-
copyPictureTo
Copy the picture of thisAbstractSurveyElement
to the element in arguments- Parameters:
elmt
- The element
-
getDataHolder
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelLessDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelLessDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-