Merged V3.2 to HEAD

17410: Merged V3.1 to V3.2
      16667: (record-only) Fix ETHREEOH-2477 - group-based perms (MT env)
      16883: Fix ETHREEOH-1544 - cannot paste an item, if cut from another web project (modifyLock errror)
      16918: Fix ETHREEOH-3053 - Deployment of non-stale file in a stale layered folder removes the file from FSR
      16947: (record-only) Temporarily comment-out testSubmitChangedAssets1 (intermittent permission failure)
      17162: Fix ETHREEOH-2850 - submitting delete of (web form) xml instance does not submit the associated deleted renditions
      17319: Fix ETHREEOH-3111 - ManageReviewTaskDialog (fix-up contributed patch)
   17418: Merged V3.1 to V3.2
      17141: Fix ETHREEOH-3088: Cut/Paste into self causes stack overflow
      17216: Fixed ETHREEOH-3170: DB errors on MSSQL with Snapshot Isolation enabled while CIFS copying
      17255: Fixed ETHREEOH-3180: Error appears when trying to search resources on Manage Task page
   17419: Fix for ETHREEOH-3296: Enterprise 3.X / Permissions Error When Cut & Paste on Sub-Folder
   17421: Review and tweaks of DB script port
   17423: Follow-on for ETHREEOH-3088
   17424: Missed check-in for ETHREEOH-3032 (CHK-10240)
   17437: ETHREEOH-2790 - OpenOffice-startup-context.xml needs to also initiate the connection to OpenOffice
   17441: Build fix: Fix AVM permission inheritance to match DM and fix common permission dao component
   17470: Fix for ETHREEOH-3350: Admin Console - Viewing user properties for user without home folder throws exception
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /alfresco/BRANCHES/V3.1:r16667,16883,16918,16947,17141,17162,17216,17255,17319
   Merged /alfresco/BRANCHES/V3.2:r17410,17418-17419,17421,17423-17424,17437,17441,17470


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18137 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-01-19 13:18:50 +00:00
parent a5c09bb7c1
commit e80a27b73c
6 changed files with 539 additions and 522 deletions

View File

@@ -64,7 +64,7 @@ public class ManageReviewTaskDialog extends ManageTaskDialog
protected String webapp;
protected NodeRef webProjectRef;
protected AVMBrowseBean avmBrowseBean;
transient protected PermissionService permissionService;
transient private PermissionService permissionService;
private static final Log logger = LogFactory.getLog(ManageReviewTaskDialog.class);

View File

@@ -65,9 +65,7 @@ import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.BrowseBean;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.forms.Form;
import org.alfresco.web.forms.FormInstanceData;
import org.alfresco.web.forms.FormNotFoundException;
import org.alfresco.web.forms.FormsService;
import org.alfresco.web.forms.Rendition;
import org.alfresco.web.ui.common.Utils;
@@ -737,81 +735,63 @@ public class SubmitDialog extends BaseDialogBean
this.warningItems.add(new ItemWrapper(node));
continue;
}
NodeRef ref = AVMNodeConverter.ToNodeRef(-1, node.getPath());
if (submittedPaths.contains(node.getPath()))
{
continue;
}
if (node.isDeleted())
{
// found a deleted node for submit
this.submitItems.add(new ItemWrapper(node));
submittedPaths.add(node.getPath());
}
// lookup if this item was created via a form - then lookup the workflow defaults
// for that form and store into the list of available workflows
else if (!getNodeService().hasAspect(ref, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
boolean isForm = getNodeService().hasAspect(ref, WCMAppModel.ASPECT_FORM_INSTANCE_DATA);
boolean isRendition = getNodeService().hasAspect(ref, WCMAppModel.ASPECT_RENDITION);
if (((!isForm) && (!isRendition)) || (node.isDeleted() && (!isForm)))
{
// found single item for submit
// note: could be a single deleted rendition - to enable deletion of old renditions (eg. if template no longer applicable)
this.submitItems.add(new ItemWrapper(node));
submittedPaths.add(node.getPath());
}
else
{
// item is a form (note: could be deleted) or a rendition
FormInstanceData fid = null;
// check if this is a rendition - as they also have the forminstancedata aspect
if (getNodeService().hasAspect(ref, WCMAppModel.ASPECT_RENDITION))
if (isRendition)
{
// found a generated rendition asset - locate the parent form instance data file
// and use this to find all generated assets that are appropriate
// NOTE: this path value is store relative
fid = getFormsService().getRendition(ref).getPrimaryFormInstanceData();
fid = getFormsService().getRendition(ref).getPrimaryFormInstanceData(true);
}
else
{
fid = getFormsService().getFormInstanceData(ref);
}
// check form's default workflow (if any)
Form f = null;
try
{
f = fid.getForm();
}
catch (FormNotFoundException fnfe)
{
String formName = (String)getNodeService().getProperty(ref, WCMAppModel.PROP_PARENT_FORM_NAME);
logger.warn("Cannot check default workflow (if any) for missing form '"+formName+"' (may have been deleted) - when submitting '"+node.getPath()+"'");
//Utils.addErrorMessage(fnfe.getMessage(), fnfe);
}
// add the form instance data file to the list for submission
if (!submittedPaths.contains(fid.getPath()))
{
this.submitItems.add(new ItemWrapper(getAvmService().lookup(-1, fid.getPath())));
this.submitItems.add(new ItemWrapper(getAvmService().lookup(-1, fid.getPath(), true)));
submittedPaths.add(fid.getPath());
}
// locate renditions for this form instance data file and add to list for submission
for (final Rendition rendition : fid.getRenditions())
for (final Rendition rendition : fid.getRenditions(true))
{
final String renditionPath = rendition.getPath();
if (!submittedPaths.contains(renditionPath))
{
this.submitItems.add(new ItemWrapper(getAvmService().lookup(-1, renditionPath)));
this.submitItems.add(new ItemWrapper(getAvmService().lookup(-1, renditionPath, true)));
submittedPaths.add(renditionPath);
}
}
if (f != null)
{
WorkflowDefinition defaultWfDef = f.getDefaultWorkflow();
// lookup the workflow defaults for that form and store into the list of available workflows
WorkflowDefinition defaultWfDef = fid.getForm().getDefaultWorkflow();
if (defaultWfDef != null)
{
this.workflows.add(new FormWorkflowWrapper(defaultWfDef.getName(),
f.getDefaultWorkflowParameters()));
}
fid.getForm().getDefaultWorkflowParameters()));
}
// See WCM-1090 ACT-1551

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -123,4 +123,7 @@ public interface FormInstanceData
/** returns all renditions of this form instance data */
public List<Rendition> getRenditions();
/** returns all renditions of this form instance data (include deleted AVM nodes) */
public List<Rendition> getRenditions(boolean includeDeleted);
}

View File

@@ -176,7 +176,9 @@ import org.xml.sax.SAXException;
throws FormNotFoundException
{
if (logger.isDebugEnabled())
{
logger.debug("regenerating renditions of " + this);
}
AVMLockingService avmLockService = this.getServiceRegistry().getAVMLockingService();
final AVMService avmService = this.getServiceRegistry().getAVMService();
@@ -220,7 +222,9 @@ import org.xml.sax.SAXException;
try
{
if (logger.isDebugEnabled())
{
logger.debug("regenerating rendition " + r + " using template " + ret);
}
renditionLockedBefore = false;
path = r.getPath();
@@ -230,8 +234,10 @@ import org.xml.sax.SAXException;
renditionLockedBefore = true;
if (logger.isDebugEnabled())
{
logger.debug("Lock already exists for " + path);
}
}
ret.render(this, r);
allRets.remove(ret);
@@ -247,10 +253,12 @@ import org.xml.sax.SAXException;
avmLockService.removeLock(AVMUtil.getStoreId(path), AVMUtil.getStoreRelativePath(path));
if (logger.isDebugEnabled())
{
logger.debug("Removed lock for " + path + " as it failed to generate");
}
}
}
}
// render all renditions for newly added templates
for (final RenderingEngineTemplate ret : allRets)
@@ -261,8 +269,10 @@ import org.xml.sax.SAXException;
path = ret.getOutputPathForRendition(this, originalParentAvmPath, getName());
if (logger.isDebugEnabled())
{
logger.debug("regenerating rendition of " + this.getPath() +
" at " + path + " using template " + ret);
}
AVMLock lock = avmLockService.getLock(AVMUtil.getStoreId(path), AVMUtil.getStoreRelativePath(path));
if (lock != null)
@@ -270,8 +280,10 @@ import org.xml.sax.SAXException;
renditionLockedBefore = true;
if (logger.isDebugEnabled())
{
logger.debug("Lock already exists for " + path);
}
}
result.add(new RegenerateResult(ret, path, ret.render(this, path)));
}
@@ -285,14 +297,21 @@ import org.xml.sax.SAXException;
avmLockService.removeLock(AVMUtil.getStoreId(path), AVMUtil.getStoreRelativePath(path));
if (logger.isDebugEnabled())
{
logger.debug("Removed lock for " + path + " as it failed to generate");
}
}
}
}
return result;
}
public List<Rendition> getRenditions()
{
return getRenditions(false);
}
public List<Rendition> getRenditions(boolean includeDeleted)
{
final AVMService avmService = this.getServiceRegistry().getAVMLockingAwareService();
final PropertyValue pv =
@@ -304,24 +323,29 @@ import org.xml.sax.SAXException;
final List<Rendition> result = new ArrayList<Rendition>(renditionPaths.size());
for (Serializable path : renditionPaths)
{
if (avmService.lookup(-1, storeName + ':' + (String)path) == null)
String avmRenditionPath = AVMUtil.buildAVMPath(storeName, (String)path);
if (avmService.lookup(-1, avmRenditionPath, includeDeleted) == null)
{
if (logger.isDebugEnabled())
logger.debug("ignoring dangling rendition at " + storeName + ':' + (String)path);
{
logger.debug("ignoring dangling rendition at: " + avmRenditionPath);
}
}
else
{
final Rendition r = new RenditionImpl(-1,
storeName + ':' + (String)path,
avmRenditionPath,
this.getFormsService());
try
{
if (!this.equals(r.getPrimaryFormInstanceData()))
if (!this.equals(r.getPrimaryFormInstanceData(includeDeleted)))
{
if (logger.isDebugEnabled())
{
logger.debug("rendition " + r +
" points at form instance data " + r.getPrimaryFormInstanceData() +
" points at form instance data " + r.getPrimaryFormInstanceData(includeDeleted) +
" instead of " + this + ". Not including in renditions list.");
}
continue;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -52,6 +52,10 @@ public interface Rendition
public FormInstanceData getPrimaryFormInstanceData()
throws FileNotFoundException;
/** the primary form instance data used to generate this rendition (include deleted AVM nodes) */
public FormInstanceData getPrimaryFormInstanceData(boolean includeDeleted)
throws FileNotFoundException;
/** the rendering engine template that generated this rendition */
public RenderingEngineTemplate getRenderingEngineTemplate();

View File

@@ -136,6 +136,12 @@ import org.xml.sax.SAXException;
public FormInstanceData getPrimaryFormInstanceData()
throws FileNotFoundException
{
return getPrimaryFormInstanceData(false);
}
public FormInstanceData getPrimaryFormInstanceData(boolean includeDeleted)
throws FileNotFoundException
{
final AVMService avmService = this.getServiceRegistry().getAVMLockingAwareService();
final String fidAVMStoreRelativePath = (String)
@@ -145,7 +151,7 @@ import org.xml.sax.SAXException;
String avmStore = AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond();
avmStore = avmStore.substring(0, avmStore.indexOf(':'));
final String path = avmStore + ':' + fidAVMStoreRelativePath;
if (avmService.lookup(-1, path) == null)
if (avmService.lookup(-1, path, includeDeleted) == null)
{
throw new FileNotFoundException("unable to find primary form instance data " + path);
}