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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSurveyElement(javax.jcr.Node node, String parentPath, F factory) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCopy the picture of thisAbstractSurveyElementto the element in argumentsReturns theDataHolderof thisAmetysObject.Get the picture as a binary metadata.Get the picture alternative.Get the picture type.Get the picture resource ID.protected voidRemove all picture metas (picture ID and picture binary).voidsetExternalPicture(String mimeType, String filename, InputStream stream) Set the picture from an external file.voidRemoves any picture currently assigned.voidsetPictureAlternative(String alternative) Set the picture alternative.voidsetPictureType(String type) Set the picture type.voidsetResourcePicture(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, removeDeniedUsersMethods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesMethods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCodeMethods inherited from interface org.ametys.plugins.repository.CopiableAmetysObject
copyTo, copyToMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getDataNamesMethods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNodeMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelLessDataAwareAmetysObject
dataToJSON, dataToSAX, getModelItemTypeExtensionPoint, getType, getValue, getValue, getValueOfType, getValueOfType, hasValue, hasValue, hasValueOrEmpty, isMultiple, isMultipleMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToJSON, dataToSAX, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChangesMethods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolderMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelLessDataAwareAmetysObject
getComposite, getComposite, getParentDataHolder, getRepositoryData, getRootDataHolder, removeValue, setValue, setValue, synchronizeValuesMethods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
removeMethods 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- theDefaultTraversableAmetysObjectFactorywhich 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 thisAbstractSurveyElementto the element in arguments- Parameters:
elmt- The element
-
getDataHolder
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Specified by:
getDataHolderin interfaceDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelLessDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModifiableModelLessDataAwareAmetysObject- Returns:
- the
DataHolderof thisAmetysObject
-