use of org.alfresco.repo.version.traitextender.VersionServiceTrait in project alfresco-repository by Alfresco.
the class VirtualVersionServiceExtension method revert.
@Override
public void revert(NodeRef nodeRef) {
VersionServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(nodeRef);
if (reference == null) {
theTrait.revert(nodeRef);
} else {
NodeRef materialNode = smartStore.materialize(reference);
theTrait.revert(materialNode);
}
}
use of org.alfresco.repo.version.traitextender.VersionServiceTrait in project alfresco-repository by Alfresco.
the class VirtualVersionServiceExtension method createVersion.
@Override
public Collection<Version> createVersion(NodeRef nodeRef, Map<String, Serializable> versionProperties, boolean versionChildren) throws ReservedVersionNameException, AspectMissingException {
VersionServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(nodeRef);
if (reference == null) {
return theTrait.createVersion(nodeRef, versionProperties, versionChildren);
} else {
NodeRef materialNode = smartStore.materializeIfPossible(nodeRef);
Collection<Version> actualVersions = theTrait.createVersion(materialNode, versionProperties, versionChildren);
return virtualizeVersions(reference, actualVersions);
}
}
use of org.alfresco.repo.version.traitextender.VersionServiceTrait in project alfresco-repository by Alfresco.
the class VirtualVersionServiceExtension method restore.
@Override
public NodeRef restore(NodeRef nodeRef, NodeRef parentNodeRef, QName assocTypeQName, QName assocQName, boolean deep) {
VersionServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(nodeRef);
if (reference == null) {
return theTrait.restore(nodeRef, parentNodeRef, assocTypeQName, assocQName, deep);
} else {
NodeRef materialNode = smartStore.materialize(reference);
return theTrait.restore(materialNode, parentNodeRef, assocTypeQName, assocQName, deep);
}
}
use of org.alfresco.repo.version.traitextender.VersionServiceTrait in project alfresco-repository by Alfresco.
the class VirtualVersionServiceExtension method createVersion.
@Override
public Version createVersion(NodeRef nodeRef, Map<String, Serializable> versionProperties) throws ReservedVersionNameException, AspectMissingException {
VersionServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(nodeRef);
if (reference == null) {
return theTrait.createVersion(nodeRef, versionProperties);
} else {
NodeRef materialNode = smartStore.materializeIfPossible(nodeRef);
Version actualVersion = theTrait.createVersion(materialNode, versionProperties);
return virtualizeVersion(reference, actualVersion);
}
}
use of org.alfresco.repo.version.traitextender.VersionServiceTrait in project alfresco-repository by Alfresco.
the class VirtualVersionServiceExtension method getCurrentVersion.
@Override
public Version getCurrentVersion(NodeRef nodeRef) {
VersionServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(nodeRef);
if (reference == null) {
return theTrait.getCurrentVersion(nodeRef);
} else {
NodeRef materialNode = smartStore.materialize(reference);
Reference versionedReference = Reference.fromNodeRef(nodeRef);
Version actualVersion = theTrait.getCurrentVersion(materialNode);
return virtualizeVersion(versionedReference, actualVersion);
}
}
Aggregations