F - the actual type of factory.public class DefaultAmetysObject<F extends DefaultAmetysObjectFactory> extends SimpleAmetysObject<F> implements ModifiableMetadataAwareVersionableAmetysObject, ModifiableACLAmetysObject
JCRAmetysObject, which is also a VersionableAmetysObject.| Modifier and Type | Field and Description |
|---|---|
private Node |
_baseNode |
private Node |
_currentNode |
private VersionHistory |
_versionHistory |
private Version |
_versionNode |
protected static List<String> |
PROTECTED_PROPERTIES
Properties that are auto-created or protected, which mustn't be copied when copying a node.
|
| Constructor and Description |
|---|
DefaultAmetysObject(Node node,
String parentPath,
F factory)
Creates an
DefaultAmetysObject. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAllowedGroups(Set<GroupIdentity> groups,
String profileId)
Associates some groups with an allowed profile on this ametys object
|
void |
addAllowedProfilesForAnonymous(Set<String> profileIds)
Adds allowed profiles an anonymous user has on this ametys object
|
void |
addAllowedProfilesForAnyConnectedUser(Set<String> profileIds)
Adds allowed profiles any connected user has on this ametys object
|
void |
addAllowedUsers(Set<UserIdentity> users,
String profileId)
Associates some users with an allowed profile on this ametys object
|
void |
addDeniedGroups(Set<GroupIdentity> groups,
String profileId)
Associates some groups with an allowed profile on this ametys object
|
void |
addDeniedProfilesForAnonymous(Set<String> profileIds)
Adds denied profiles an anonymous user has on this ametys object
|
void |
addDeniedProfilesForAnyConnectedUser(Set<String> profileIds)
Adds denied profiles any connected user has on this ametys object
|
void |
addDeniedUsers(Set<UserIdentity> users,
String profileId)
Associates some users with a denied profile on this ametys object
|
void |
addLabel(String label,
boolean moveIfPresent)
Add a label on this object.
|
void |
checkpoint()
Persists the current version of this
AmetysObject |
protected void |
copyNode(Node parentDest,
Node src)
Copy the source node in parent node
|
String[] |
getAllLabels()
List all labels that exist on this object, whatever the revision.
|
Set<GroupIdentity> |
getAllowedGroups(String profileId)
Gets the groups that have the given allowed profile on this ametys object
|
Set<String> |
getAllowedProfilesForAnonymous()
Gets the allowed profiles an anonymous user has on this ametys object
|
Set<String> |
getAllowedProfilesForAnyConnectedUser()
Gets the allowed profiles any connected user has on this ametys object
|
Map<GroupIdentity,Set<String>> |
getAllowedProfilesForGroups()
Gets the groups that have allowed profiles assigned on this ametys object
|
Set<String> |
getAllowedProfilesForUser(UserIdentity user)
Gets the allowed profiles assigned on this ametys object for this user
|
Map<UserIdentity,Set<String>> |
getAllowedProfilesForUsers()
Gets the users that have allowed profiles assigned on this ametys object
|
Set<UserIdentity> |
getAllowedUsers(String profileId)
Gets the users that have the given allowed profile on this ametys object
|
String[] |
getAllRevisions()
List all revisions of this object.
|
Node |
getBaseNode()
Returns the JCR node backing this
AmetysObject in the default JCR workspace |
protected Version |
getBaseVersion()
Returns the JCR base version of the node.
|
Set<GroupIdentity> |
getDeniedGroups(String profileId)
Gets the groups that have the given allowed profile on this ametys object
|
Set<String> |
getDeniedProfilesForAnonymous()
Gets the denied profiles an anonymous user has on this ametys object
|
Set<String> |
getDeniedProfilesForAnyConnectedUser()
Gets the denied profiles any connected user has on this ametys object
|
Map<GroupIdentity,Set<String>> |
getDeniedProfilesForGroups()
Gets the groups that have allowed profiles assigned on this ametys object
|
Set<String> |
getDeniedProfilesForUser(UserIdentity user)
Gets the denied profiles assigned on this ametys object for this user
|
Map<UserIdentity,Set<String>> |
getDeniedProfilesForUsers()
Gets the users that have denied profiles assigned on this ametys object
|
Set<UserIdentity> |
getDeniedUsers(String profileId)
Gets the users that have the given denied profile on this ametys object
|
String[] |
getLabels()
Get the labels for this object, in the current revision (a single revision can hold several labels).
|
String[] |
getLabels(String revision)
Get the labels for this object fot the given revision (a single revision can hold several labels).
|
Node |
getNode()
Gives access to the underlying JCR node.
|
String |
getRevision()
Get the revision of this object, if any.
|
Date |
getRevisionTimestamp()
Get the creation time of the current revision, if any.
|
Date |
getRevisionTimestamp(String revision)
Get the creation time of the given revision.
|
ModifiableCompositeMetadata |
getUnversionedMetadataHolder()
Returns an unversioned
ModifiableCompositeMetadata. |
protected VersionHistory |
getVersionHistory()
Returns the JCR
VersionHistory of the base node. |
void |
removeAllowedGroups(Set<GroupIdentity> groups)
Removes the association between some groups and all allowed profiles on this ametys object
|
void |
removeAllowedGroups(Set<GroupIdentity> groups,
String profileId)
Removes the association between some groups and an allowed profile on this ametys object
|
void |
removeAllowedProfilesForAnonymous(Set<String> profileIds)
Removes allowed profiles an anonymous user has on this ametys object
|
void |
removeAllowedProfilesForAnyConnectedUser(Set<String> profileIds)
Removes allowed profiles any connected user has on this ametys object
|
void |
removeAllowedUsers(Set<UserIdentity> users)
Removes the association between some users and all allowed profiles on this ametys object
|
void |
removeAllowedUsers(Set<UserIdentity> users,
String profileId)
Removes the association between some users and an allowed profile on this ametys object
|
void |
removeDeniedGroups(Set<GroupIdentity> groups)
Removes the association between some groups and all allowed profiles on this ametys object
|
void |
removeDeniedGroups(Set<GroupIdentity> groups,
String profileId)
Removes the association between some groups and an allowed profile on this ametys object
|
void |
removeDeniedProfilesForAnonymous(Set<String> profileIds)
Removes denied profiles an anonymous user has on this ametys object
|
void |
removeDeniedProfilesForAnyConnectedUser(Set<String> profileIds)
Removes denied profiles any connected user has on this ametys object
|
void |
removeDeniedUsers(Set<UserIdentity> users)
Removes the association between some users and all denied profiles on this ametys object
|
void |
removeDeniedUsers(Set<UserIdentity> users,
String profileId)
Removes the association between some users and an denied profile on this ametys object
|
void |
removeLabel(String label)
Remove a label from this object.
If the label doesn't exist, it is silently ignored. |
void |
restoreFromLabel(String label)
Restore data from the specified label.
|
protected void |
restoreFromNode(Node node)
Restore from a node
|
void |
restoreFromRevision(String revision)
Restore data from the specified revision.
|
void |
switchToLabel(String label)
Switch to the revision corresponding to the specified label.
All subsequent method calls on this AmetysObject will concern that version. |
void |
switchToRevision(String revision)
Switch to the revision corresponding to the specified revision.
All subsequent method calls on this AmetysObject will concern that version. |
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesequals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetMetadataHolderneedsSave, rename, revertChanges, saveChangesequals, getId, getName, getParent, getParentPath, getPath, hashCodeprotected static final List<String> PROTECTED_PROPERTIES
private Version _versionNode
private Node _currentNode
private VersionHistory _versionHistory
public DefaultAmetysObject(Node node, String parentPath, F factory)
DefaultAmetysObject.node - the node backing this AmetysObjectparentPath - the parentPath in the Ametys hierarchyfactory - the DefaultAmetysObjectFactory which created the AmetysObjectpublic Node getNode()
JCRAmetysObjectgetNode in interface JCRAmetysObjectgetNode in class SimpleAmetysObject<F extends DefaultAmetysObjectFactory>public Node getBaseNode()
AmetysObject in the default JCR workspaceAmetysObject in the default JCR workspaceprotected VersionHistory getVersionHistory() throws RepositoryException
VersionHistory of the base node.VersionHistory of the base node.RepositoryException - if something wrong occurs retrieving the VersionHistory.protected Version getBaseVersion() throws RepositoryException
RepositoryException - if something wrong occurs retrieving the base version.public void checkpoint() throws AmetysRepositoryException
VersionableAmetysObjectAmetysObjectcheckpoint in interface VersionableAmetysObjectAmetysRepositoryException - if a problem occurspublic void switchToLabel(String label) throws UnknownAmetysObjectException, AmetysRepositoryException
VersionAwareAmetysObjectAmetysObject will concern that version.switchToLabel in interface VersionAwareAmetysObjectlabel - the label to switch to, or null to specify the current versionUnknownAmetysObjectException - if the label does not correspond to any revisionAmetysRepositoryException - if a problem occurspublic void switchToRevision(String revision) throws UnknownAmetysObjectException, AmetysRepositoryException
VersionAwareAmetysObjectAmetysObject will concern that version.switchToRevision in interface VersionAwareAmetysObjectrevision - the revision, or null to specify the current versionUnknownAmetysObjectException - if the revision does not existAmetysRepositoryException - if a problem occurspublic void restoreFromLabel(String label) throws UnknownAmetysObjectException, AmetysRepositoryException
VersionableAmetysObjectrestoreFromLabel in interface VersionableAmetysObjectlabel - the labelUnknownAmetysObjectException - if the label does not correspond to any revisionAmetysRepositoryException - if a problem occurspublic void restoreFromRevision(String revision) throws UnknownAmetysObjectException, AmetysRepositoryException
VersionableAmetysObjectrestoreFromRevision in interface VersionableAmetysObjectrevision - the revisionUnknownAmetysObjectException - if the revision does not existAmetysRepositoryException - if a problem occursprotected void restoreFromNode(Node node) throws RepositoryException
node - The node to restoreRepositoryException - If error occursprotected void copyNode(Node parentDest, Node src) throws RepositoryException
parentDest - The dest nodesrc - The source node to copyRepositoryException - If error occurspublic void addLabel(String label, boolean moveIfPresent) throws AmetysRepositoryException
VersionableAmetysObjectaddLabel in interface VersionableAmetysObjectlabel - the label to add.moveIfPresent - what to do if the content already has this label : move it to the current revision if true, keep it unchanged if false.AmetysRepositoryException - if some problem arises.public void removeLabel(String label) throws AmetysRepositoryException
VersionableAmetysObjectremoveLabel in interface VersionableAmetysObjectlabel - the label to removeAmetysRepositoryException - if some problem arises.public String[] getAllLabels() throws AmetysRepositoryException
VersionAwareAmetysObjectgetAllLabels in interface VersionAwareAmetysObjectnull).AmetysRepositoryException - if the labels cannot be known.public String[] getLabels() throws AmetysRepositoryException
VersionAwareAmetysObjectgetLabels in interface VersionAwareAmetysObjectnull).AmetysRepositoryException - if the labels cannot be known.public String[] getLabels(String revision) throws UnknownAmetysObjectException, AmetysRepositoryException
VersionAwareAmetysObjectgetLabels in interface VersionAwareAmetysObjectrevision - the revisionnull).UnknownAmetysObjectException - if the given revision does not exist for this object.AmetysRepositoryException - if the labels cannot be known.public String getRevision() throws AmetysRepositoryException
VersionAwareAmetysObjectgetRevision in interface VersionAwareAmetysObjectAmetysRepositoryException - if the revision cannot be known.public Date getRevisionTimestamp() throws AmetysRepositoryException
VersionAwareAmetysObjectgetRevisionTimestamp in interface VersionAwareAmetysObjectAmetysRepositoryException - if an error occurspublic Date getRevisionTimestamp(String revision) throws UnknownAmetysObjectException, AmetysRepositoryException
VersionAwareAmetysObjectgetRevisionTimestamp in interface VersionAwareAmetysObjectrevision - the revision.UnknownAmetysObjectException - if the given revision does not exist for this object.AmetysRepositoryException - if an error occurspublic String[] getAllRevisions() throws AmetysRepositoryException
VersionAwareAmetysObjectgetAllRevisions in interface VersionAwareAmetysObjectnull)AmetysRepositoryException - if the revisions cannot be known.public ModifiableCompositeMetadata getUnversionedMetadataHolder()
ModifiableMetadataAwareVersionableAmetysObjectModifiableCompositeMetadata.getUnversionedMetadataHolder in interface MetadataAndVersionAwareAmetysObjectgetUnversionedMetadataHolder in interface ModifiableMetadataAwareVersionableAmetysObjectModifiableCompositeMetadata.public Set<String> getAllowedProfilesForAnyConnectedUser()
ACLAmetysObjectgetAllowedProfilesForAnyConnectedUser in interface ACLAmetysObjectpublic void addAllowedProfilesForAnyConnectedUser(Set<String> profileIds)
ModifiableACLAmetysObjectaddAllowedProfilesForAnyConnectedUser in interface ModifiableACLAmetysObjectprofileIds - The profiles to addpublic void removeAllowedProfilesForAnyConnectedUser(Set<String> profileIds)
ModifiableACLAmetysObjectremoveAllowedProfilesForAnyConnectedUser in interface ModifiableACLAmetysObjectprofileIds - The profiles to removepublic Set<String> getDeniedProfilesForAnyConnectedUser()
ACLAmetysObjectgetDeniedProfilesForAnyConnectedUser in interface ACLAmetysObjectpublic void addDeniedProfilesForAnyConnectedUser(Set<String> profileIds)
ModifiableACLAmetysObjectaddDeniedProfilesForAnyConnectedUser in interface ModifiableACLAmetysObjectprofileIds - The profiles to addpublic void removeDeniedProfilesForAnyConnectedUser(Set<String> profileIds)
ModifiableACLAmetysObjectremoveDeniedProfilesForAnyConnectedUser in interface ModifiableACLAmetysObjectprofileIds - The profiles to removepublic Set<String> getAllowedProfilesForAnonymous()
ACLAmetysObjectgetAllowedProfilesForAnonymous in interface ACLAmetysObjectpublic void addAllowedProfilesForAnonymous(Set<String> profileIds)
ModifiableACLAmetysObjectaddAllowedProfilesForAnonymous in interface ModifiableACLAmetysObjectprofileIds - The profiles to addpublic void removeAllowedProfilesForAnonymous(Set<String> profileIds)
ModifiableACLAmetysObjectremoveAllowedProfilesForAnonymous in interface ModifiableACLAmetysObjectprofileIds - The profiles to removepublic Set<String> getDeniedProfilesForAnonymous()
ACLAmetysObjectgetDeniedProfilesForAnonymous in interface ACLAmetysObjectpublic void addDeniedProfilesForAnonymous(Set<String> profileIds)
ModifiableACLAmetysObjectaddDeniedProfilesForAnonymous in interface ModifiableACLAmetysObjectprofileIds - The profiles to addpublic void removeDeniedProfilesForAnonymous(Set<String> profileIds)
ModifiableACLAmetysObjectremoveDeniedProfilesForAnonymous in interface ModifiableACLAmetysObjectprofileIds - The profiles to removepublic Set<String> getAllowedProfilesForUser(UserIdentity user)
ACLAmetysObjectgetAllowedProfilesForUser in interface ACLAmetysObjectuser - The user identitypublic Map<UserIdentity,Set<String>> getAllowedProfilesForUsers()
ACLAmetysObjectgetAllowedProfilesForUsers in interface ACLAmetysObjectpublic Set<UserIdentity> getAllowedUsers(String profileId)
ACLAmetysObjectgetAllowedUsers in interface ACLAmetysObjectprofileId - The id of the profilepublic void addAllowedUsers(Set<UserIdentity> users, String profileId)
ModifiableACLAmetysObjectaddAllowedUsers in interface ModifiableACLAmetysObjectusers - The users to addprofileId - The id of the profilepublic void removeAllowedUsers(Set<UserIdentity> users, String profileId)
ModifiableACLAmetysObjectremoveAllowedUsers in interface ModifiableACLAmetysObjectusers - The users to removeprofileId - The id of the profilepublic void removeAllowedUsers(Set<UserIdentity> users)
ModifiableACLAmetysObjectremoveAllowedUsers in interface ModifiableACLAmetysObjectusers - The users to removepublic Map<GroupIdentity,Set<String>> getAllowedProfilesForGroups()
ACLAmetysObjectgetAllowedProfilesForGroups in interface ACLAmetysObjectpublic Set<GroupIdentity> getAllowedGroups(String profileId)
ACLAmetysObjectgetAllowedGroups in interface ACLAmetysObjectprofileId - The id of the profilepublic void addAllowedGroups(Set<GroupIdentity> groups, String profileId)
ModifiableACLAmetysObjectaddAllowedGroups in interface ModifiableACLAmetysObjectgroups - The groups to addprofileId - The id of the profilepublic void removeAllowedGroups(Set<GroupIdentity> groups, String profileId)
ModifiableACLAmetysObjectremoveAllowedGroups in interface ModifiableACLAmetysObjectgroups - The groups to removeprofileId - The id of the profilepublic void removeAllowedGroups(Set<GroupIdentity> groups)
ModifiableACLAmetysObjectremoveAllowedGroups in interface ModifiableACLAmetysObjectgroups - The groups to removepublic Set<String> getDeniedProfilesForUser(UserIdentity user)
ACLAmetysObjectgetDeniedProfilesForUser in interface ACLAmetysObjectuser - The user identitypublic Map<UserIdentity,Set<String>> getDeniedProfilesForUsers()
ACLAmetysObjectgetDeniedProfilesForUsers in interface ACLAmetysObjectpublic Set<UserIdentity> getDeniedUsers(String profileId)
ACLAmetysObjectgetDeniedUsers in interface ACLAmetysObjectprofileId - The id of the profilepublic void addDeniedUsers(Set<UserIdentity> users, String profileId)
ModifiableACLAmetysObjectaddDeniedUsers in interface ModifiableACLAmetysObjectusers - The users to addprofileId - The id of the profilepublic void removeDeniedUsers(Set<UserIdentity> users, String profileId)
ModifiableACLAmetysObjectremoveDeniedUsers in interface ModifiableACLAmetysObjectusers - The users to removeprofileId - The id of the profilepublic void removeDeniedUsers(Set<UserIdentity> users)
ModifiableACLAmetysObjectremoveDeniedUsers in interface ModifiableACLAmetysObjectusers - The users to removepublic Map<GroupIdentity,Set<String>> getDeniedProfilesForGroups()
ACLAmetysObjectgetDeniedProfilesForGroups in interface ACLAmetysObjectpublic Set<GroupIdentity> getDeniedGroups(String profileId)
ACLAmetysObjectgetDeniedGroups in interface ACLAmetysObjectprofileId - The id of the profilepublic void addDeniedGroups(Set<GroupIdentity> groups, String profileId)
ModifiableACLAmetysObjectaddDeniedGroups in interface ModifiableACLAmetysObjectgroups - The groups to addprofileId - The id of the profilepublic void removeDeniedGroups(Set<GroupIdentity> groups, String profileId)
ModifiableACLAmetysObjectremoveDeniedGroups in interface ModifiableACLAmetysObjectgroups - The groups to removeprofileId - The id of the profilepublic void removeDeniedGroups(Set<GroupIdentity> groups)
ModifiableACLAmetysObjectremoveDeniedGroups in interface ModifiableACLAmetysObjectgroups - The groups to remove