. WCM UI is now sensitive to the 'wcmwf:submitted' aspect marking an item as currently part of a live workflow process

- most actions such as Submit, Edit, Delete, Revert etc. are unavailable when an item is within a workflow
. Fix to preview url generation after executing an action in the Staging area that changed the UI context
. Another icon from Linton

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4638 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-12-18 15:57:49 +00:00
parent c890a3d2c4
commit fd7c24cfd3
7 changed files with 64 additions and 10 deletions

View File

@@ -380,11 +380,12 @@
<action>wizard:createForm</action>
</action>
<action id="edit_form">
<evaluator>org.alfresco.web.action.evaluator.EditFormEvaluator</evaluator>
<!-- Edit XML content type -->
<action id="edit_form">
<permissions>
<permission allow="true">Write,CreateChildren</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.EditFormEvaluator</evaluator>
<label-id>edit_form</label-id>
<image>/images/icons/edit_form.gif</image>
<action>wizard:editForm</action>

View File

@@ -8,6 +8,7 @@
<permissions>
<permission allow="true">Write</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
<label-id>edit</label-id>
<image>/images/icons/edit_icon.gif</image>
<action-listener>#{AVMEditBean.setupEditAction}</action-listener>
@@ -21,6 +22,7 @@
<permissions>
<permission allow="true">Delete</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
<label-id>delete</label-id>
<image>/images/icons/delete.gif</image>
<action-listener>#{AVMBrowseBean.setupContentAction}</action-listener>
@@ -35,6 +37,7 @@
<permissions>
<permission allow="true">Delete</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
<label-id>delete</label-id>
<image>/images/icons/delete.gif</image>
<action-listener>#{AVMBrowseBean.setupContentAction}</action-listener>
@@ -49,6 +52,7 @@
<permissions>
<permission allow="true">Delete</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
<label-id>delete</label-id>
<image>/images/icons/delete.gif</image>
<action-listener>#{AVMBrowseBean.setupContentAction}</action-listener>
@@ -63,6 +67,7 @@
<permissions>
<permission allow="true">Delete</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
<label-id>delete</label-id>
<image>/images/icons/delete.gif</image>
<action-listener>#{AVMBrowseBean.setupContentAction}</action-listener>
@@ -77,6 +82,7 @@
<permissions>
<permission allow="true">Read</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
<label-id>submit</label-id>
<image>/images/icons/submit.gif</image>
<action-listener>#{AVMBrowseBean.setupContentAction}</action-listener>
@@ -91,6 +97,7 @@
<permissions>
<permission allow="true">Read</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
<label-id>revert</label-id>
<image>/images/icons/revert.gif</image>
<action-listener>#{AVMBrowseBean.revertNode}</action-listener>
@@ -161,6 +168,7 @@
<permissions>
<permission allow="true">Write</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
<label-id>update</label-id>
<image>/images/icons/update.gif</image>
<action-listener>#{AVMBrowseBean.setupContentAction}</action-listener>

View File

@@ -0,0 +1,44 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.web.action.evaluator;
import javax.faces.context.FacesContext;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.avm.wf.AVMSubmittedAspect;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* UI Action Evaluator - return true if the node is not part of an in-progress WCM workflow.
*
* @author Kevin Roast
*/
public class WCMWorkflowEvaluator implements ActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
AVMService avm = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAVMService();
String path = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef()).getSecond();
return !avm.hasAspect(-1, path, AVMSubmittedAspect.ASPECT);
}
}

View File

@@ -863,7 +863,14 @@ public class AVMBrowseBean implements IContextListener
String[] parts = path.split("[-:]");
String storename = parts[0];
String username = parts[1];
setupSandboxActionImpl(AVMConstants.buildAVMUserMainStoreName(storename, username), username, false);
if (username.equals(AVMConstants.STORE_STAGING.substring(1)))
{
setupSandboxActionImpl(null, null, false);
}
else
{
setupSandboxActionImpl(AVMConstants.buildAVMUserMainStoreName(storename, username), username, false);
}
// setup the action node
AVMNodeDescriptor node = avmService.lookup(-1, path, true);

View File

@@ -471,7 +471,7 @@ public class SubmitDialog extends BaseDialogBean
this.warningItems = new ArrayList<ItemWrapper>(selected.size() >> 1);
for (AVMNodeDescriptor node : selected)
{
if (hasAssociatedWorkflow(AVMNodeConverter.ToNodeRef(-1, node.getPath())) == false)
if (this.avmService.hasAspect(-1, node.getPath(), AVMSubmittedAspect.ASPECT) == false)
{
NodeRef ref = AVMNodeConverter.ToNodeRef(-1, node.getPath());
if (submittedPaths.contains(node.getPath()) == false)
@@ -555,12 +555,6 @@ public class SubmitDialog extends BaseDialogBean
}
}
private boolean hasAssociatedWorkflow(NodeRef ref)
{
// TODO: does not appear to work for AVM - need a specific impl instead
return (this.workflowService.getWorkflowsForContent(ref, true).size() != 0);
}
/**
* Construct a workflow package as a layered directory over the staging sandbox. The items for
* submission are pushed into the layer and the package constructed around it.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB