mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
. 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:
@@ -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);
|
||||
}
|
||||
}
|
@@ -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);
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user