Merge from HEAD into WCM-DEV2. Also fixes build breakage in

jndi-client and catalina-virtual that I introduced earlier. 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3393 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-24 18:27:41 +00:00
parent ca9496d090
commit f6355ea108
171 changed files with 11880 additions and 3450 deletions

View File

@@ -34,8 +34,7 @@ public final class ApproveDocEvaluator implements ActionEvaluator
public boolean evaluate(Node node)
{
return (node.getProperties().get("app:approveStep") != null &&
node.isLocked() == false &&
node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false);
node.isLocked() == false);
}
}
/*

View File

@@ -0,0 +1,42 @@
/*
* 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 org.alfresco.model.ContentModel;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.bean.repository.Node;
/**
* UI Action Evaluator - 'Approve' workflow step for document.
*
* @author Kevin Roast
*/
public final class ApproveNonDraftDocEvaluator implements ActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
return (node.getProperties().get("app:approveStep") != null &&
node.isLocked() == false &&
node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false);
}
}
/*
<a:booleanEvaluator value='#{r["app:approveStep"] != null && r.workingCopy == false && r.locked == false}'>
*/

View File

@@ -16,7 +16,6 @@
*/
package org.alfresco.web.action.evaluator;
import org.alfresco.model.ContentModel;
import org.alfresco.model.ForumModel;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.bean.repository.Node;

View File

@@ -16,10 +16,17 @@
*/
package org.alfresco.web.action.evaluator;
import org.alfresco.model.ContentModel;
import java.util.List;
import javax.faces.context.FacesContext;
import org.alfresco.model.ForumModel;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* UI Action Evaluator - Discuss a node.
@@ -33,7 +40,24 @@ public final class DiscussNodeEvaluator implements ActionEvaluator
*/
public boolean evaluate(Node node)
{
return (node.hasAspect(ForumModel.ASPECT_DISCUSSABLE) == true);
boolean result = false;
if (node.hasAspect(ForumModel.ASPECT_DISCUSSABLE))
{
NodeService nodeService = Repository.getServiceRegistry(
FacesContext.getCurrentInstance()).getNodeService();
List<ChildAssociationRef> children = nodeService.getChildAssocs(
node.getNodeRef(), ForumModel.ASSOC_DISCUSSION,
RegexQNamePattern.MATCH_ALL);
// make sure there is one visible child association for the node
if (children.size() == 1)
{
result = true;
}
}
return result;
}
}
/*

View File

@@ -0,0 +1,45 @@
package org.alfresco.web.action.evaluator;
import javax.faces.context.FacesContext;
import org.alfresco.model.ForumModel;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* Evaluates whether the cut or copy action should be visible.
*
* If the node is a discussion don't allow the action.
*
* @author gavinc
*/
public class DiscussionCutCopyEvaluator implements ActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
boolean result = true;
// if the node in question is a forum...
if (node.getType().equals(ForumModel.TYPE_FORUM))
{
// get the association type
FacesContext context = FacesContext.getCurrentInstance();
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
ChildAssociationRef parentAssoc = nodeService.getPrimaryParent(node.getNodeRef());
QName assocType = parentAssoc.getTypeQName();
// only allow the action if the association type is not the discussion assoc
result = (assocType.equals(ForumModel.ASSOC_DISCUSSION) == false);
}
return result;
}
}

View File

@@ -34,8 +34,7 @@ public final class RejectDocEvaluator implements ActionEvaluator
public boolean evaluate(Node node)
{
return (node.getProperties().get("app:rejectStep") != null &&
node.isLocked() == false &&
node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false);
node.isLocked() == false);
}
}
/*

View File

@@ -0,0 +1,42 @@
/*
* 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 org.alfresco.model.ContentModel;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.bean.repository.Node;
/**
* UI Action Evaluator - 'Reject' workflow step for document.
*
* @author Kevin Roast
*/
public final class RejectNonDraftDocEvaluator implements ActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
return (node.getProperties().get("app:rejectStep") != null &&
node.isLocked() == false &&
node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false);
}
}
/*
<a:booleanEvaluator value='#{r["app:rejectStep"] != null && r.workingCopy == false && r.locked == false}'>
*/