Merged V2.1 to HEAD

6418: Allow getLayeringInfo on deleted nodes.
   6419: fixes for submitting of deleted directories and regenerate renditions related fixes.
   6420: Added installs to build
   6421: Build fix for sdk
   6423: WCM-710 - Submit All feature reintroducted to WCM My Modified Files views
   6424: OpenOffice connection is now tested on bootstrap.
   6425: AWC-1446 - Space Selector would show spaces you do not have access to
   6426: WCM-699 - Staging area user assets
   6427: Rollback exceptions now explicitly handled by RetryingTransactionHelper to extract the cause of the exception.
   6428: Fix for AWC-1340
   6429: Fixed transaction boundaries for full index recovery components
   6433: AR-1660 - SMB and SMB2 signature check 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6732 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-10 21:50:49 +00:00
parent 26172af267
commit a8023d20a2
14 changed files with 111 additions and 51 deletions

View File

@@ -461,11 +461,11 @@ public class CategoriesBean implements IContextListener
NodeRef ref;
if (categoryRef == null)
{
ref = categoryService.createRootCategory(Repository.getStoreRef(), ContentModel.ASPECT_GEN_CLASSIFIABLE, name);
ref = categoryService.createRootCategory(Repository.getStoreRef(), ContentModel.ASPECT_GEN_CLASSIFIABLE, name.trim());
}
else
{
ref = categoryService.createCategory(categoryRef, name);
ref = categoryService.createCategory(categoryRef, name.trim());
}
// apply the titled aspect - for description

View File

@@ -154,6 +154,18 @@ public final class AVMUtil
}
return storeName.indexOf(AVMUtil.STORE_SEPARATOR) != -1;
}
/**
* Indicates whether the store name describes a main store.
*
* @param storeName the store name
*
* @return <tt>true</tt> if the store is a main store, <tt>false</tt> otherwise.
*/
public static boolean isMainStore(String storeName)
{
return (storeName.indexOf(AVMUtil.STORE_SEPARATOR) == -1);
}
/**
* Extracts the username from the store name.

View File

@@ -71,7 +71,7 @@ import org.apache.commons.logging.LogFactory;
*/
public class AVMWorkflowUtil extends WorkflowUtil
{
private static final Log LOGGER = LogFactory.getLog(AVMWorkflowUtil.class);
private static final Log logger = LogFactory.getLog(AVMWorkflowUtil.class);
// cached configured lists
private static List<WorkflowDefinition> configuredWorkflowDefs = null;
@@ -133,6 +133,7 @@ public class AVMWorkflowUtil extends WorkflowUtil
final ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance());
final PermissionService permissionService = services.getPermissionService();
permissionService.setPermission(packageNodeRef, PermissionService.ALL_AUTHORITIES, PermissionService.ALL_PERMISSIONS, true);
return packageNodeRef;
}
@@ -209,14 +210,14 @@ public class AVMWorkflowUtil extends WorkflowUtil
ConfigElement config = Application.getConfigService(fc).getGlobalConfig().getConfigElement("wcm");
if (config == null)
{
LOGGER.warn("WARNING: Unable to find 'wcm' config element definition.");
logger.warn("WARNING: Unable to find 'wcm' config element definition.");
}
else
{
ConfigElement workflowConfig = config.getChild("workflows");
if (workflowConfig == null)
{
LOGGER.warn("WARNING: Unable to find WCM 'workflows' config element definition.");
logger.warn("WARNING: Unable to find WCM 'workflows' config element definition.");
}
else
{
@@ -233,7 +234,7 @@ public class AVMWorkflowUtil extends WorkflowUtil
}
else
{
LOGGER.warn("WARNING: Cannot find WCM workflow def for configured definition name: " + wfName);
logger.warn("WARNING: Cannot find WCM workflow def for configured definition name: " + wfName);
}
}
}
@@ -249,48 +250,54 @@ public class AVMWorkflowUtil extends WorkflowUtil
final FacesContext fc = FacesContext.getCurrentInstance();
final WorkflowService workflowService = Repository.getServiceRegistry(fc).getWorkflowService();
final WorkflowTaskQuery query = new WorkflowTaskQuery();
final HashMap<QName, Object> props = new HashMap<QName, Object>(1, 1.0f);
props.put(WCMWorkflowModel.PROP_FROM_PATH, fromPath);
query.setProcessCustomProps(props);
final List<WorkflowTask> tasks = workflowService.queryTasks(query);
LOGGER.debug("found " + tasks.size() + " tasks originating user sandbox " + fromPath);
if (logger.isDebugEnabled())
logger.debug("found " + tasks.size() + " tasks originating user sandbox " + fromPath);
return tasks;
}
public static List<WorkflowTask> getAssociatedTasksForNode(final AVMNodeDescriptor node)
public static List<WorkflowTask> getAssociatedTasksForNode(AVMNodeDescriptor node, List<WorkflowTask> tasks)
{
final List<WorkflowTask> tasks = AVMWorkflowUtil.getAssociatedTasksForSandbox(AVMUtil.getStoreName(node.getPath()));
final List<WorkflowTask> result = new LinkedList<WorkflowTask>();
final FacesContext fc = FacesContext.getCurrentInstance();
final AVMService avmService = Repository.getServiceRegistry(fc).getAVMService();
for (final WorkflowTask task : tasks)
{
final NodeRef ref = task.path.instance.workflowPackage;
final String path = AVMUtil.getCorrespondingPath(node.getPath(), ref.getStoreRef().getIdentifier());
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("checking store " + ref.getStoreRef().getIdentifier() +
if (logger.isDebugEnabled())
logger.debug("checking store " + ref.getStoreRef().getIdentifier() +
" for " + node.getPath() + " (" + path + ")");
}
try
{
final LayeringDescriptor ld = avmService.getLayeringInfo(-1, path);
if (!ld.isBackground())
{
LOGGER.debug(path + " is in the foreground. workflow active");
if (logger.isDebugEnabled())
logger.debug(path + " is in the foreground. workflow active");
result.add(task);
}
else
{
// LOGGER.debug(path + " is in the background");
}
}
catch (final AVMNotFoundException avmnfe)
{
LOGGER.debug(path + " not found");
if (logger.isDebugEnabled())
logger.debug(path + " not found");
}
}
return result;
}
public static List<WorkflowTask> getAssociatedTasksForNode(AVMNodeDescriptor node)
{
final List<WorkflowTask> tasks = AVMWorkflowUtil.getAssociatedTasksForSandbox(AVMUtil.getStoreName(node.getPath()));
return getAssociatedTasksForNode(node, tasks);
}
}

View File

@@ -201,7 +201,12 @@ public class RegenerateRenditionsWizard
@Override
public boolean getNextButtonDisabled()
{
return false;
boolean disabled = false;
if ("select_renditions".equals(Application.getWizardManager().getCurrentStepName()))
{
disabled = this.selectedWebProject == null;
}
return disabled;
}
@Override
@@ -413,7 +418,7 @@ public class RegenerateRenditionsWizard
final StoreRef storeRef = AVMNodeConverter.ToStoreRef(webProject.getStagingStore());
sp.addStore(storeRef);
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
StringBuilder query = new StringBuilder();
final StringBuilder query = new StringBuilder();
query.append("+ASPECT:\"" + WCMAppModel.ASPECT_FORM_INSTANCE_DATA + "\"");
query.append("-ASPECT:\"" + WCMAppModel.ASPECT_RENDITION + "\"");
query.append(" +@" + Repository.escapeQName(WCMAppModel.PROP_PARENT_FORM_NAME) +
@@ -438,9 +443,9 @@ public class RegenerateRenditionsWizard
final StoreRef storeRef = AVMNodeConverter.ToStoreRef(webProject.getStagingStore());
sp.addStore(storeRef);
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
StringBuilder query = new StringBuilder();
final StringBuilder query = new StringBuilder();
query.append("+ASPECT:\"" + WCMAppModel.ASPECT_RENDITION + "\"");
query.append("+@" + Repository.escapeQName(WCMAppModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE) +
query.append(" +@" + Repository.escapeQName(WCMAppModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE) +
":\"" + ((RenderingEngineTemplateImpl)ret).getNodeRef() + "\"");
LOGGER.debug("running query " + query);

View File

@@ -946,7 +946,7 @@ public class SubmitDialog extends BaseDialogBean
selected = new ArrayList<AVMNodeDescriptor>(1);
selected.add(this.avmService.lookup(-1, this.avmBrowseBean.getAvmActionNode().getPath(), true));
}
if (selected == null)
{
this.submitItems = Collections.<ItemWrapper>emptyList();
@@ -957,9 +957,14 @@ public class SubmitDialog extends BaseDialogBean
Set<String> submittedPaths = new HashSet<String>(selected.size());
this.submitItems = new ArrayList<ItemWrapper>(selected.size());
this.warningItems = new ArrayList<ItemWrapper>(selected.size() >> 1);
List<WorkflowTask> tasks = null;
for (AVMNodeDescriptor node : selected)
{
if (AVMWorkflowUtil.getAssociatedTasksForNode(node).size() != 0)
if (tasks == null)
{
tasks = AVMWorkflowUtil.getAssociatedTasksForSandbox(AVMUtil.getStoreName(node.getPath()));
}
if (AVMWorkflowUtil.getAssociatedTasksForNode(node, tasks).size() != 0)
{
this.warningItems.add(new ItemWrapper(node));
continue;
@@ -977,7 +982,7 @@ public class SubmitDialog extends BaseDialogBean
}
// 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 (! this.nodeService.hasAspect(ref, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
else if (!this.nodeService.hasAspect(ref, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
{
this.submitItems.add(new ItemWrapper(node));
submittedPaths.add(node.getPath());

View File

@@ -819,7 +819,7 @@ public class ManageTaskDialog extends BaseDialogBean
node.addPropertyResolver("url", this.browseBean.resolverUrl);
}
this.resources.add(node);
if (node.isDirectory())
if (node.isDirectory() && !node.getDescriptor().isDeleted())
{
for (final AVMNodeDescriptor d :
this.avmService.getDirectoryListingArray(node.getDescriptor(), true))