Package org.ametys.cms.trash.element
Class DefaultTrashElement
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<TrashElementFactory>
org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<TrashElementFactory>
org.ametys.cms.trash.element.DefaultTrashElement
- All Implemented Interfaces:
ModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataAwareAmetysObject
,IndexableDataHolder
,ModifiableIndexableDataHolder
,ACLAmetysObject
,AmetysObject
,DataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataAwareAmetysObject
,DataHolder
,ModelAwareDataHolder
,ModifiableDataHolder
,ModifiableModelAwareDataHolder
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TrashElement
,TraversableAmetysObject
public class DefaultTrashElement
extends DefaultTraversableAmetysObject<TrashElementFactory>
implements TrashElement, ModifiableModelAwareDataAwareAmetysObject
Class representing a
DefaultTrashElement
-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTrashElement
(javax.jcr.Node node, String parentPath, TrashElementFactory factory) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLinkedObjects
(String... linkedObjectsIds) Add the objects to the list of objects whose thrashing was related to the trashing of this element's object.dataToJSON
(ViewItemAccessor viewItemAccessor, DataContext context) Convert the data in the given view of the currentDataHolder
Get the id of the trashed Ametys objectReturns theDataHolder
of thisAmetysObject
.getLinkedElement
(boolean hiddenOnly) Get the trash element that represent one of the linked objects (seeTrashElement.addLinkedObjects(java.lang.String...)
) of this elementvoid
setHidden
(boolean hidden) Set the hidden status of the trash element.
An element should be hidden if it was trashed because an other object was trashed.
Hidden element should not be visible when listing the trash elements, and should be restored or permanently deleted along with the element that triggered the thrashingMethods 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.data.ametysobject.DataAwareAmetysObject
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
Methods inherited from interface org.ametys.cms.data.ametysobject.ModelAwareDataAwareAmetysObject
getSystemPropertyExtensionPoint, indexData, indexData
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
dataToJSONForEdition, dataToMap, dataToSAX, dataToSAXForEdition, getDataNames, getDefinition, getDifferences, getDifferences, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasDefinition, hasDifferences, hasDifferences, hasDifferences, hasDifferences, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToJSON, dataToJSON, dataToJSON, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, getDataNames, getType, getValue, hasValue, hasValueOrEmpty, isMultiple
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryData
Methods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolder
Methods inherited from interface org.ametys.cms.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getComposite, getComposite, getExternalComposite, getExternalComposite, getExternalRepeater, getExternalRepeater, getLocalComposite, getLocalComposite, getLocalRepeater, getLocalRepeater, getParentDataHolder, getRepeater, getRepeater, getRootDataHolder
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getRepositoryData, removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, removeValue, setExternalValue, setLocalValue, setStatus, setValue, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues
Methods inherited from interface org.ametys.plugins.repository.ModifiableTraversableAmetysObject
createChild
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChild, getChildAt, getChildPosition, getChildren, hasChild
-
Constructor Details
-
DefaultTrashElement
Constructor.- Parameters:
node
- the JCR Node.parentPath
- the parent pathfactory
- the corresponding factory.
-
-
Method Details
-
getDataHolder
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelAwareDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelAwareDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
dataToJSON
public Map<String,Object> dataToJSON(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Description copied from interface:ModelAwareDataHolder
Convert the data in the given view of the currentDataHolder
- Specified by:
dataToJSON
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
dataToJSON
in interfaceModelAwareDataHolder
- Parameters:
viewItemAccessor
- theViewItemAccessor
referencing the items to convertcontext
- The context of the data to convert- Returns:
- The data of the given view as JSON
- Throws:
BadItemTypeException
- if the value's type does not matches the stored data
-
getAmetysObjectId
Description copied from interface:TrashElement
Get the id of the trashed Ametys object- Specified by:
getAmetysObjectId
in interfaceTrashElement
- Returns:
- the id
-
getLinkedElement
Description copied from interface:TrashElement
Get the trash element that represent one of the linked objects (seeTrashElement.addLinkedObjects(java.lang.String...)
) of this element- Specified by:
getLinkedElement
in interfaceTrashElement
- Parameters:
hiddenOnly
- true to only retrieve the hidden elements- Returns:
- the linked elements
-
addLinkedObjects
Description copied from interface:TrashElement
Add the objects to the list of objects whose thrashing was related to the trashing of this element's object. If an element representing these linked objects in the trash is present during restoration or deletion of the current element, they should be restored/deleted at the same time.- Specified by:
addLinkedObjects
in interfaceTrashElement
- Parameters:
linkedObjectsIds
- a list of Ametys object ids
-
setHidden
Description copied from interface:TrashElement
Set the hidden status of the trash element.
An element should be hidden if it was trashed because an other object was trashed.
Hidden element should not be visible when listing the trash elements, and should be restored or permanently deleted along with the element that triggered the thrashing- Specified by:
setHidden
in interfaceTrashElement
- Parameters:
hidden
- true to set hidden
-