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

@@ -723,6 +723,7 @@
<action idref="import_space" /> <action idref="import_space" />
<action idref="manage_space_users" /> <action idref="manage_space_users" />
<action idref="manage_space_rules" /> <action idref="manage_space_rules" />
<action idref="regenerate_renditions" />
<!-- NOTE: now found on the User Console <!-- NOTE: now found on the User Console
<action idref="manage_deleted_items" />--> <action idref="manage_deleted_items" />-->
</action-group> </action-group>

View File

@@ -34,6 +34,7 @@ import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.AVMBrowseBean; import org.alfresco.web.bean.wcm.AVMBrowseBean;
import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.bean.wcm.WebProject; import org.alfresco.web.bean.wcm.WebProject;
/** /**
@@ -47,12 +48,15 @@ public class WCMLockEvaluator implements ActionEvaluator
* @return true if the item is not locked by another user * @return true if the item is not locked by another user
*/ */
public boolean evaluate(final Node node) public boolean evaluate(final Node node)
{
boolean result = false;
final String path = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef()).getSecond();
if (!AVMUtil.isMainStore(AVMUtil.getStoreName(path)))
{ {
final FacesContext fc = FacesContext.getCurrentInstance(); final FacesContext fc = FacesContext.getCurrentInstance();
final AVMLockingService avmLockService = Repository.getServiceRegistry(fc).getAVMLockingService(); final AVMLockingService avmLockService = Repository.getServiceRegistry(fc).getAVMLockingService();
final AVMBrowseBean avmBrowseBean = (AVMBrowseBean)FacesHelper.getManagedBean(fc, AVMBrowseBean.BEAN_NAME); final AVMBrowseBean avmBrowseBean = (AVMBrowseBean)FacesHelper.getManagedBean(fc, AVMBrowseBean.BEAN_NAME);
final String path = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef()).getSecond();
final String username = Application.getCurrentUser(fc).getUserName(); final String username = Application.getCurrentUser(fc).getUserName();
WebProject webProject = avmBrowseBean.getWebProject(); WebProject webProject = avmBrowseBean.getWebProject();
@@ -62,6 +66,8 @@ public class WCMLockEvaluator implements ActionEvaluator
// so get the web project associated with the path // so get the web project associated with the path
webProject = new WebProject(path); webProject = new WebProject(path);
} }
return avmLockService.hasAccess(webProject.getNodeRef(), path, username); result = avmLockService.hasAccess(webProject.getNodeRef(), path, username);
}
return result;
} }
} }

View File

@@ -461,11 +461,11 @@ public class CategoriesBean implements IContextListener
NodeRef ref; NodeRef ref;
if (categoryRef == null) 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 else
{ {
ref = categoryService.createCategory(categoryRef, name); ref = categoryService.createCategory(categoryRef, name.trim());
} }
// apply the titled aspect - for description // apply the titled aspect - for description

View File

@@ -155,6 +155,18 @@ public final class AVMUtil
return storeName.indexOf(AVMUtil.STORE_SEPARATOR) != -1; 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. * Extracts the username from the store name.
* *

View File

@@ -71,7 +71,7 @@ import org.apache.commons.logging.LogFactory;
*/ */
public class AVMWorkflowUtil extends WorkflowUtil 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 // cached configured lists
private static List<WorkflowDefinition> configuredWorkflowDefs = null; private static List<WorkflowDefinition> configuredWorkflowDefs = null;
@@ -133,6 +133,7 @@ public class AVMWorkflowUtil extends WorkflowUtil
final ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance()); final ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance());
final PermissionService permissionService = services.getPermissionService(); final PermissionService permissionService = services.getPermissionService();
permissionService.setPermission(packageNodeRef, PermissionService.ALL_AUTHORITIES, PermissionService.ALL_PERMISSIONS, true); permissionService.setPermission(packageNodeRef, PermissionService.ALL_AUTHORITIES, PermissionService.ALL_PERMISSIONS, true);
return packageNodeRef; return packageNodeRef;
} }
@@ -209,14 +210,14 @@ public class AVMWorkflowUtil extends WorkflowUtil
ConfigElement config = Application.getConfigService(fc).getGlobalConfig().getConfigElement("wcm"); ConfigElement config = Application.getConfigService(fc).getGlobalConfig().getConfigElement("wcm");
if (config == null) if (config == null)
{ {
LOGGER.warn("WARNING: Unable to find 'wcm' config element definition."); logger.warn("WARNING: Unable to find 'wcm' config element definition.");
} }
else else
{ {
ConfigElement workflowConfig = config.getChild("workflows"); ConfigElement workflowConfig = config.getChild("workflows");
if (workflowConfig == null) 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 else
{ {
@@ -233,7 +234,7 @@ public class AVMWorkflowUtil extends WorkflowUtil
} }
else 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 FacesContext fc = FacesContext.getCurrentInstance();
final WorkflowService workflowService = Repository.getServiceRegistry(fc).getWorkflowService(); final WorkflowService workflowService = Repository.getServiceRegistry(fc).getWorkflowService();
final WorkflowTaskQuery query = new WorkflowTaskQuery(); final WorkflowTaskQuery query = new WorkflowTaskQuery();
final HashMap<QName, Object> props = new HashMap<QName, Object>(1, 1.0f); final HashMap<QName, Object> props = new HashMap<QName, Object>(1, 1.0f);
props.put(WCMWorkflowModel.PROP_FROM_PATH, fromPath); props.put(WCMWorkflowModel.PROP_FROM_PATH, fromPath);
query.setProcessCustomProps(props); query.setProcessCustomProps(props);
final List<WorkflowTask> tasks = workflowService.queryTasks(query); 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; 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 List<WorkflowTask> result = new LinkedList<WorkflowTask>();
final FacesContext fc = FacesContext.getCurrentInstance(); final FacesContext fc = FacesContext.getCurrentInstance();
final AVMService avmService = Repository.getServiceRegistry(fc).getAVMService(); final AVMService avmService = Repository.getServiceRegistry(fc).getAVMService();
for (final WorkflowTask task : tasks) for (final WorkflowTask task : tasks)
{ {
final NodeRef ref = task.path.instance.workflowPackage; final NodeRef ref = task.path.instance.workflowPackage;
final String path = AVMUtil.getCorrespondingPath(node.getPath(), ref.getStoreRef().getIdentifier()); final String path = AVMUtil.getCorrespondingPath(node.getPath(), ref.getStoreRef().getIdentifier());
if (LOGGER.isDebugEnabled()) if (logger.isDebugEnabled())
{ logger.debug("checking store " + ref.getStoreRef().getIdentifier() +
LOGGER.debug("checking store " + ref.getStoreRef().getIdentifier() +
" for " + node.getPath() + " (" + path + ")"); " for " + node.getPath() + " (" + path + ")");
}
try try
{ {
final LayeringDescriptor ld = avmService.getLayeringInfo(-1, path); final LayeringDescriptor ld = avmService.getLayeringInfo(-1, path);
if (!ld.isBackground()) 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); result.add(task);
} }
else
{
// LOGGER.debug(path + " is in the background");
}
} }
catch (final AVMNotFoundException avmnfe) catch (final AVMNotFoundException avmnfe)
{ {
LOGGER.debug(path + " not found"); if (logger.isDebugEnabled())
logger.debug(path + " not found");
} }
} }
return result; 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 @Override
public boolean getNextButtonDisabled() public boolean getNextButtonDisabled()
{ {
return false; boolean disabled = false;
if ("select_renditions".equals(Application.getWizardManager().getCurrentStepName()))
{
disabled = this.selectedWebProject == null;
}
return disabled;
} }
@Override @Override
@@ -413,7 +418,7 @@ public class RegenerateRenditionsWizard
final StoreRef storeRef = AVMNodeConverter.ToStoreRef(webProject.getStagingStore()); final StoreRef storeRef = AVMNodeConverter.ToStoreRef(webProject.getStagingStore());
sp.addStore(storeRef); sp.addStore(storeRef);
sp.setLanguage(SearchService.LANGUAGE_LUCENE); 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_FORM_INSTANCE_DATA + "\"");
query.append("-ASPECT:\"" + WCMAppModel.ASPECT_RENDITION + "\""); query.append("-ASPECT:\"" + WCMAppModel.ASPECT_RENDITION + "\"");
query.append(" +@" + Repository.escapeQName(WCMAppModel.PROP_PARENT_FORM_NAME) + query.append(" +@" + Repository.escapeQName(WCMAppModel.PROP_PARENT_FORM_NAME) +
@@ -438,9 +443,9 @@ public class RegenerateRenditionsWizard
final StoreRef storeRef = AVMNodeConverter.ToStoreRef(webProject.getStagingStore()); final StoreRef storeRef = AVMNodeConverter.ToStoreRef(webProject.getStagingStore());
sp.addStore(storeRef); sp.addStore(storeRef);
sp.setLanguage(SearchService.LANGUAGE_LUCENE); sp.setLanguage(SearchService.LANGUAGE_LUCENE);
StringBuilder query = new StringBuilder(); final StringBuilder query = new StringBuilder();
query.append("+ASPECT:\"" + WCMAppModel.ASPECT_RENDITION + "\""); 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() + "\""); ":\"" + ((RenderingEngineTemplateImpl)ret).getNodeRef() + "\"");
LOGGER.debug("running query " + query); LOGGER.debug("running query " + query);

View File

@@ -957,9 +957,14 @@ public class SubmitDialog extends BaseDialogBean
Set<String> submittedPaths = new HashSet<String>(selected.size()); Set<String> submittedPaths = new HashSet<String>(selected.size());
this.submitItems = new ArrayList<ItemWrapper>(selected.size()); this.submitItems = new ArrayList<ItemWrapper>(selected.size());
this.warningItems = new ArrayList<ItemWrapper>(selected.size() >> 1); this.warningItems = new ArrayList<ItemWrapper>(selected.size() >> 1);
List<WorkflowTask> tasks = null;
for (AVMNodeDescriptor node : selected) 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)); this.warningItems.add(new ItemWrapper(node));
continue; continue;
@@ -977,7 +982,7 @@ public class SubmitDialog extends BaseDialogBean
} }
// lookup if this item was created via a form - then lookup the workflow defaults // 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 // 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)); this.submitItems.add(new ItemWrapper(node));
submittedPaths.add(node.getPath()); submittedPaths.add(node.getPath());

View File

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

View File

@@ -202,6 +202,13 @@ public abstract class Sort
if (getter != null) if (getter != null)
{ {
// if we have a bean getter method impl use that // if we have a bean getter method impl use that
try
{
getter.setAccessible(true);
}
catch (SecurityException se)
{
}
obj = getter.invoke(data.get(iIndex), (Object [])null); obj = getter.invoke(data.get(iIndex), (Object [])null);
} }
else else

View File

@@ -790,6 +790,24 @@ public abstract class AbstractItemSelector extends UIInput
* @return Node Service bean instance or throws exception if not found * @return Node Service bean instance or throws exception if not found
*/ */
protected static NodeService getNodeService(FacesContext context) protected static NodeService getNodeService(FacesContext context)
{
NodeService service = Repository.getServiceRegistry(context).getNodeService();
if (service == null)
{
throw new IllegalStateException("Unable to obtain NodeService bean reference.");
}
return service;
}
/**
* Use Spring JSF integration to return the node Service bean instance
*
* @param context FacesContext
*
* @return Node Service bean instance or throws exception if not found
*/
protected static NodeService getFastNodeService(FacesContext context)
{ {
NodeService service = (NodeService)FacesContextUtils.getRequiredWebApplicationContext( NodeService service = (NodeService)FacesContextUtils.getRequiredWebApplicationContext(
context).getBean("nodeService"); context).getBean("nodeService");

View File

@@ -91,7 +91,7 @@ public class UICategorySelector extends AbstractItemSelector
if (this.navigationId != null) if (this.navigationId != null)
{ {
ChildAssociationRef parentRef = getNodeService(context).getPrimaryParent( ChildAssociationRef parentRef = getFastNodeService(context).getPrimaryParent(
new NodeRef(Repository.getStoreRef(), this.navigationId)); new NodeRef(Repository.getStoreRef(), this.navigationId));
Node parentNode = new Node(parentRef.getParentRef()); Node parentNode = new Node(parentRef.getParentRef());

View File

@@ -70,7 +70,7 @@ public class UISpaceSelector extends AbstractItemSelector
{ {
try try
{ {
ChildAssociationRef parentRef = getNodeService(context).getPrimaryParent( ChildAssociationRef parentRef = getFastNodeService(context).getPrimaryParent(
new NodeRef(Repository.getStoreRef(), this.navigationId)); new NodeRef(Repository.getStoreRef(), this.navigationId));
id = parentRef.getParentRef().getId(); id = parentRef.getParentRef().getId();
} }
@@ -89,7 +89,7 @@ public class UISpaceSelector extends AbstractItemSelector
List<ChildAssociationRef> allKids = getNodeService(context).getChildAssocs(nodeRef, List<ChildAssociationRef> allKids = getNodeService(context).getChildAssocs(nodeRef,
ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL); ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
DictionaryService dd = getDictionaryService(context); DictionaryService dd = getDictionaryService(context);
NodeService service = getNodeService(context); NodeService service = getFastNodeService(context);
// filter out those children that are not spaces // filter out those children that are not spaces
List<NodeRef> spaceKids = new ArrayList<NodeRef>(); List<NodeRef> spaceKids = new ArrayList<NodeRef>();
@@ -126,7 +126,7 @@ public class UISpaceSelector extends AbstractItemSelector
public String getItemIcon(FacesContext context, NodeRef ref) public String getItemIcon(FacesContext context, NodeRef ref)
{ {
String icon = (String)getNodeService(context).getProperty(ref, ApplicationModel.PROP_ICON); String icon = (String)getFastNodeService(context).getProperty(ref, ApplicationModel.PROP_ICON);
if (icon != null) if (icon != null)
{ {
icon = "/images/icons/" + icon + "-16.gif"; icon = "/images/icons/" + icon + "-16.gif";

View File

@@ -142,10 +142,10 @@ public class UIWebProjectFolderSelector extends AbstractItemSelector
public Collection<NodeRef> getRootChildren(FacesContext context) public Collection<NodeRef> getRootChildren(FacesContext context)
{ {
// query for all nodes under the "Web Projects" foler in company home. // query for all nodes under the "Web Projects" folder in company home.
FacesContext fc = FacesContext.getCurrentInstance(); FacesContext fc = FacesContext.getCurrentInstance();
String xpath = Application.getRootPath(fc) + "/" + Application.getWebsitesFolderName(fc) + "/*"; String xpath = Application.getRootPath(fc) + "/" + Application.getWebsitesFolderName(fc) + "/*";
NodeRef rootNodeRef = getNodeService(fc).getRootNode(Repository.getStoreRef()); NodeRef rootNodeRef = getFastNodeService(fc).getRootNode(Repository.getStoreRef());
NamespaceService resolver = Repository.getServiceRegistry(fc).getNamespaceService(); NamespaceService resolver = Repository.getServiceRegistry(fc).getNamespaceService();
SearchService searchService = Repository.getServiceRegistry(fc).getSearchService(); SearchService searchService = Repository.getServiceRegistry(fc).getSearchService();
List<NodeRef> nodes = searchService.selectNodes(rootNodeRef, xpath, null, resolver, false); List<NodeRef> nodes = searchService.selectNodes(rootNodeRef, xpath, null, resolver, false);
@@ -179,7 +179,7 @@ public class UIWebProjectFolderSelector extends AbstractItemSelector
public String getItemIcon(FacesContext context, NodeRef ref) public String getItemIcon(FacesContext context, NodeRef ref)
{ {
String icon = (String)getNodeService(context).getProperty(ref, ApplicationModel.PROP_ICON); String icon = (String)getFastNodeService(context).getProperty(ref, ApplicationModel.PROP_ICON);
if (icon != null) if (icon != null)
{ {
icon = "/images/icons/" + icon + "-16.gif"; icon = "/images/icons/" + icon + "-16.gif";

View File

@@ -409,11 +409,10 @@ public class UIUserSandboxes extends SelfRenderingComponent
out.write("&nbsp;&nbsp;"); out.write("&nbsp;&nbsp;");
// Submit All Items // Submit All Items
// NOTE: removed for 2.0 final Utils.encodeRecursive(context, aquireAction(
/*Utils.encodeRecursive(context, aquireAction(
context, mainStore, username, ACT_SANDBOX_SUBMITALL, "/images/icons/submit_all.gif", context, mainStore, username, ACT_SANDBOX_SUBMITALL, "/images/icons/submit_all.gif",
"#{AVMBrowseBean.setupAllItemsAction}", "dialog:submitSandboxItems")); "#{AVMBrowseBean.setupAllItemsAction}", "dialog:submitSandboxItems"));
out.write("&nbsp;&nbsp;");*/ out.write("&nbsp;&nbsp;");
// Revert All Items // Revert All Items
Utils.encodeRecursive(context, aquireAction( Utils.encodeRecursive(context, aquireAction(