use of org.alfresco.repo.version.traitextender.VersionServiceTrait in project alfresco-repository by Alfresco.
the class VirtualVersionServiceExtension method ensureVersioningEnabled.
@Override
public void ensureVersioningEnabled(NodeRef nodeRef, Map<QName, Serializable> versionProperties) {
VersionServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(nodeRef);
if (reference == null) {
theTrait.ensureVersioningEnabled(nodeRef, versionProperties);
} else {
NodeRef materialNode = smartStore.materialize(reference);
theTrait.ensureVersioningEnabled(materialNode, versionProperties);
}
}
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, Version version) {
VersionServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(nodeRef);
if (reference == null) {
theTrait.revert(nodeRef, version);
} else {
NodeRef materialNode = smartStore.materialize(reference);
Version actualVersion = VirtualVersionServiceExtension.this.materializeVersionIfReference(version);
theTrait.revert(materialNode, actualVersion);
}
}
use of org.alfresco.repo.version.traitextender.VersionServiceTrait in project alfresco-repository by Alfresco.
the class VirtualVersionServiceExtension method isVersioned.
@Override
public boolean isVersioned(NodeRef nodeRef) {
VersionServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(nodeRef);
if (reference == null) {
return theTrait.isVersioned(nodeRef);
} else {
NodeRef materialNode = smartStore.materialize(reference);
return theTrait.isVersioned(materialNode);
}
}
use of org.alfresco.repo.version.traitextender.VersionServiceTrait in project alfresco-repository by Alfresco.
the class VirtualVersionServiceExtension method deleteVersion.
@Override
public void deleteVersion(NodeRef nodeRef, Version version) {
VersionServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(nodeRef);
if (reference == null) {
theTrait.deleteVersion(nodeRef, version);
} else {
NodeRef materialNode = smartStore.materialize(reference);
Version actualVersion = materializeVersionIfReference(version);
theTrait.deleteVersion(materialNode, actualVersion);
}
}
use of org.alfresco.repo.version.traitextender.VersionServiceTrait in project alfresco-repository by Alfresco.
the class VirtualVersionServiceExtension method getVersionHistory.
@Override
public VersionHistory getVersionHistory(NodeRef nodeRef) throws AspectMissingException {
VersionServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(nodeRef);
if (reference == null) {
return theTrait.getVersionHistory(nodeRef);
} else {
NodeRef materialNode = smartStore.materialize(reference);
VersionHistory actualVersionHistory = theTrait.getVersionHistory(materialNode);
if (actualVersionHistory == null) {
return null;
} else {
Reference versionedReference = Reference.fromNodeRef(nodeRef);
return new VirtualVersionHistory(versionedReference, actualVersionHistory);
}
}
}
Aggregations