mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
78403: Merged EOL (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 75700: ACE-2149: EOL AVM / WCM - Remove most of the AVM and WCM beans, scripts, classes, patches, etc - The Explorer client is very broken for compilation - TODO: Remove all WCM-related functionality, which I thought would be best left to a UI dev I've murdered many of the classes and beans but there's more to do - The repository compiles TODO: Get it running again - TODO: Check if we can wipe the 'deployment' project as well git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@82540 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -30,15 +30,10 @@ import java.util.Map;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.admin.BaseInterpreter;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authority.AuthorityDAO;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
@@ -65,7 +60,6 @@ import org.alfresco.service.cmr.workflow.WorkflowTransition;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
@@ -82,8 +76,6 @@ public class WorkflowInterpreter extends BaseInterpreter
|
||||
private NamespaceService namespaceService;
|
||||
private NodeService nodeService;
|
||||
private AuthorityDAO authorityDAO;
|
||||
private AVMService avmService;
|
||||
private AVMSyncService avmSyncService;
|
||||
private PersonService personService;
|
||||
private FileFolderService fileFolderService;
|
||||
private TenantService tenantService;
|
||||
@@ -104,20 +96,12 @@ public class WorkflowInterpreter extends BaseInterpreter
|
||||
private Map<QName, Serializable> vars = new HashMap<QName, Serializable>();
|
||||
|
||||
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.surf.util.AbstractLifecycleBean#onBootstrap(org.springframework.getContext().ApplicationEvent)
|
||||
*/
|
||||
@Override
|
||||
protected void onBootstrap(ApplicationEvent event)
|
||||
{
|
||||
//NOOP
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.surf.util.AbstractLifecycleBean#onShutdown(org.springframework.getContext().ApplicationEvent)
|
||||
*/
|
||||
@Override
|
||||
protected void onShutdown(ApplicationEvent event)
|
||||
{
|
||||
@@ -156,22 +140,6 @@ public class WorkflowInterpreter extends BaseInterpreter
|
||||
this.dictionaryService = dictionaryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param avmService The AVM Service
|
||||
*/
|
||||
public void setAVMService(AVMService avmService)
|
||||
{
|
||||
this.avmService = avmService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param avmSyncService The AVM Sync Service
|
||||
*/
|
||||
public void setAVMSyncService(AVMSyncService avmSyncService)
|
||||
{
|
||||
this.avmSyncService = avmSyncService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param namespaceService namespaceService
|
||||
*/
|
||||
@@ -1183,47 +1151,6 @@ public class WorkflowInterpreter extends BaseInterpreter
|
||||
}
|
||||
out.println("set var " + qname + " = " + vars.get(qname));
|
||||
}
|
||||
else if (command[2].equals("avmpackage"))
|
||||
{
|
||||
// lookup source folder of changes
|
||||
AVMNodeDescriptor avmSource = avmService.lookup(-1, command[3]);
|
||||
if (avmSource == null || !avmSource.isDirectory())
|
||||
{
|
||||
return command[3] + " must refer to a directory.";
|
||||
}
|
||||
|
||||
// create container for avm workflow packages
|
||||
String packagesPath = "workflow-system:/packages";
|
||||
AVMNodeDescriptor packagesDesc = avmService.lookup(-1, packagesPath);
|
||||
if (packagesDesc == null)
|
||||
{
|
||||
avmService.createStore("workflow-system");
|
||||
avmService.createDirectory("workflow-system:/", "packages");
|
||||
}
|
||||
|
||||
// create package (layered to target, if target is specified)
|
||||
String packageName = GUID.generate();
|
||||
String avmSourceIndirection = avmSource.getIndirection();
|
||||
if (avmSourceIndirection != null)
|
||||
{
|
||||
avmService.createLayeredDirectory(avmSourceIndirection, packagesPath, packageName);
|
||||
List<AVMDifference> diff = avmSyncService.compare(-1, avmSource.getPath(), -1, packagesPath + "/" + packageName, null);
|
||||
avmSyncService.update(diff, null, true, true, false, false, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
// copy source folder to package folder
|
||||
avmService.copy(-1, avmSource.getPath(), packagesPath, packageName);
|
||||
}
|
||||
|
||||
// convert package to workflow package
|
||||
AVMNodeDescriptor packageDesc = avmService.lookup(-1, packagesPath + "/" + packageName);
|
||||
NodeRef packageNodeRef = workflowService.createPackage(AVMNodeConverter.ToNodeRef(-1, packageDesc.getPath()));
|
||||
nodeService.setProperty(packageNodeRef, WorkflowModel.PROP_IS_SYSTEM_PACKAGE, true);
|
||||
QName qname = QName.createQName(command[1], namespaceService);
|
||||
vars.put(qname, packageNodeRef);
|
||||
out.println("set var " + qname + " = " + vars.get(qname));
|
||||
}
|
||||
else if (command[2].equals("package"))
|
||||
{
|
||||
QName qname = QName.createQName(command[1], namespaceService);
|
||||
|
@@ -32,10 +32,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.WCMModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
@@ -83,7 +79,6 @@ public class WorkflowServiceImpl implements WorkflowService
|
||||
private WorkflowPackageComponent workflowPackageComponent;
|
||||
private NodeService nodeService;
|
||||
private ContentService contentService;
|
||||
private AVMSyncService avmSyncService;
|
||||
private DictionaryService dictionaryService;
|
||||
private NodeService protectedNodeService;
|
||||
private WorkflowNotificationUtils workflowNotificationUtils;
|
||||
@@ -158,16 +153,6 @@ public class WorkflowServiceImpl implements WorkflowService
|
||||
this.contentService = contentService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the avm sync service
|
||||
*
|
||||
* @param avmSyncService
|
||||
*/
|
||||
public void setAvmSyncService(AVMSyncService avmSyncService)
|
||||
{
|
||||
this.avmSyncService = avmSyncService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the dictionary service
|
||||
*
|
||||
@@ -1347,14 +1332,7 @@ public class WorkflowServiceImpl implements WorkflowService
|
||||
|
||||
public List<NodeRef> getPackageContents(NodeRef packageRef)
|
||||
{
|
||||
if (packageRef.getStoreRef().getProtocol().equals(StoreRef.PROTOCOL_AVM))
|
||||
{
|
||||
return getAvmPackageContents(packageRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
return getRepositoryPackageContents(packageRef);
|
||||
}
|
||||
return getRepositoryPackageContents(packageRef);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1429,34 +1407,6 @@ public class WorkflowServiceImpl implements WorkflowService
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param contents
|
||||
* @param workflowPackage
|
||||
*/
|
||||
private List<NodeRef> getAvmPackageContents(NodeRef workflowPackage)
|
||||
{
|
||||
List<NodeRef> contents = new ArrayList<NodeRef>();
|
||||
if (protectedNodeService.exists(workflowPackage))
|
||||
{
|
||||
final NodeRef stagingNodeRef = (NodeRef) protectedNodeService.getProperty(workflowPackage,
|
||||
WCMModel.PROP_AVM_DIR_INDIRECTION);
|
||||
final String stagingAvmPath = AVMNodeConverter.ToAVMVersionPath(stagingNodeRef).getSecond();
|
||||
final String packageAvmPath = AVMNodeConverter.ToAVMVersionPath(workflowPackage).getSecond();
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("comparing " + packageAvmPath + " with " + stagingAvmPath);
|
||||
for (AVMDifference d : avmSyncService.compare(-1, packageAvmPath, -1, stagingAvmPath, null, true))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("got difference " + d);
|
||||
if (d.getDifferenceCode() == AVMDifference.NEWER || d.getDifferenceCode() == AVMDifference.CONFLICT)
|
||||
{
|
||||
contents.add(AVMNodeConverter.ToNodeRef(d.getSourceVersion(), d.getSourcePath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return contents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the given user is a member of the pooled actors assigned to the task
|
||||
*
|
||||
|
@@ -232,7 +232,7 @@ public class JscriptWorkflowTask extends BaseScopableProcessorExtension implemen
|
||||
Collection<QName> allowedTypes = getAllowedPackageResourceTypes();
|
||||
for (NodeRef node : contents)
|
||||
{
|
||||
if (isAvmResource(node, allowedTypes))
|
||||
if (isValidResource(node, allowedTypes))
|
||||
{
|
||||
ScriptNode scriptNode = new ScriptNode(node, serviceRegistry, getScope());
|
||||
resources.add(scriptNode);
|
||||
@@ -250,10 +250,8 @@ public class JscriptWorkflowTask extends BaseScopableProcessorExtension implemen
|
||||
return allowedTypes;
|
||||
}
|
||||
|
||||
private boolean isAvmResource(NodeRef node, Collection<QName> allowedTypes)
|
||||
private boolean isValidResource(NodeRef node, Collection<QName> allowedTypes)
|
||||
{
|
||||
if(isAvmNode(node))
|
||||
return true;
|
||||
if (nodeService.exists(node))
|
||||
{
|
||||
//Check if the node is one of the allowedTypes.
|
||||
@@ -262,11 +260,6 @@ public class JscriptWorkflowTask extends BaseScopableProcessorExtension implemen
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isAvmNode(NodeRef node)
|
||||
{
|
||||
return StoreRef.PROTOCOL_AVM.equals(node.getStoreRef().getProtocol());
|
||||
}
|
||||
|
||||
private static class DefaultNamespaceProvider implements NamespacePrefixResolverProvider
|
||||
{
|
||||
private static final long serialVersionUID = -7015209142379905617L;
|
||||
|
Reference in New Issue
Block a user