mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
CM-690 extensions
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@117489 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -40,6 +40,8 @@ import org.alfresco.repo.version.common.VersionHistoryImpl;
|
||||
import org.alfresco.repo.version.common.VersionImpl;
|
||||
import org.alfresco.repo.version.common.VersionUtil;
|
||||
import org.alfresco.repo.version.common.versionlabel.SerialVersionLabelPolicy;
|
||||
import org.alfresco.repo.version.traitextender.VersionServiceExtension;
|
||||
import org.alfresco.repo.version.traitextender.VersionServiceTrait;
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.AspectMissingException;
|
||||
@@ -56,6 +58,11 @@ import org.alfresco.service.cmr.version.VersionServiceException;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.alfresco.traitextender.AJProxyTrait;
|
||||
import org.alfresco.traitextender.Extend;
|
||||
import org.alfresco.traitextender.ExtendedTrait;
|
||||
import org.alfresco.traitextender.Extensible;
|
||||
import org.alfresco.traitextender.Trait;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -65,11 +72,18 @@ import org.springframework.extensions.surf.util.ParameterCheck;
|
||||
/**
|
||||
* Version2 Service - implements version2Store (a lighter implementation of the lightWeightVersionStore)
|
||||
*/
|
||||
public class Version2ServiceImpl extends VersionServiceImpl implements VersionService, Version2Model
|
||||
public class Version2ServiceImpl extends VersionServiceImpl implements VersionService, Version2Model,Extensible
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(Version2ServiceImpl.class);
|
||||
|
||||
private PermissionService permissionService;
|
||||
|
||||
private ExtendedTrait<VersionServiceTrait> versionServiceTrait;
|
||||
|
||||
public Version2ServiceImpl()
|
||||
{
|
||||
versionServiceTrait=new ExtendedTrait<VersionServiceTrait>(AJProxyTrait.create(this, VersionServiceTrait.class));
|
||||
}
|
||||
|
||||
public void setPermissionService(PermissionService permissionService)
|
||||
{
|
||||
@@ -87,6 +101,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public StoreRef getVersionStoreReference()
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -99,6 +114,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public Version createVersion(
|
||||
NodeRef nodeRef,
|
||||
Map<String, Serializable> versionProperties)
|
||||
@@ -126,6 +142,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public Collection<Version> createVersion(
|
||||
Collection<NodeRef> nodeRefs,
|
||||
Map<String, Serializable> versionProperties)
|
||||
@@ -361,6 +378,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public VersionHistory getVersionHistory(NodeRef nodeRef)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -381,6 +399,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public Version getCurrentVersion(NodeRef nodeRef)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -940,6 +959,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public void revert(NodeRef nodeRef)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -952,6 +972,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public void revert(NodeRef nodeRef, boolean deep)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -964,6 +985,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public void revert(NodeRef nodeRef, Version version)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -976,6 +998,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public void revert(NodeRef nodeRef, Version version, boolean deep)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -1263,6 +1286,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public NodeRef restore(
|
||||
NodeRef nodeRef,
|
||||
NodeRef parentNodeRef,
|
||||
@@ -1273,6 +1297,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public NodeRef restore(
|
||||
NodeRef nodeRef,
|
||||
NodeRef parentNodeRef,
|
||||
@@ -1358,6 +1383,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public void deleteVersionHistory(NodeRef nodeRef)
|
||||
throws AspectMissingException
|
||||
{
|
||||
@@ -1396,6 +1422,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public void deleteVersion(NodeRef nodeRef, Version version)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -1432,6 +1459,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public boolean isAVersion(NodeRef nodeRef)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -1449,6 +1477,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
|
||||
public boolean isVersioned(NodeRef nodeRef)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -1464,4 +1493,10 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
|
||||
}
|
||||
return this.dbNodeService.hasAspect(realNodeRef, ContentModel.ASPECT_VERSIONABLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Trait> ExtendedTrait<T> getTrait(Class<? extends T> traitAPI)
|
||||
{
|
||||
return (ExtendedTrait<T>) versionServiceTrait;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user