Update of /var/cvs/contributions/CMSContainer/cmsc/servicemanagement/src/java/com/finalist/cmsc/services/workflow In directory james.mmbase.org:/tmp/cvs-serv2329/CMSContainer/cmsc/servicemanagement/src/java/com/finalist/cmsc/services/workflow
Modified Files: WorkflowStatusInfo.java Log Message: CMSC-1243 List Summary for "All content" should contain the proper content types See also: http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/servicemanagement/src/java/com/finalist/cmsc/services/workflow See also: http://www.mmbase.org/jira/browse/CMSC-1243 Index: WorkflowStatusInfo.java =================================================================== RCS file: /var/cvs/contributions/CMSContainer/cmsc/servicemanagement/src/java/com/finalist/cmsc/services/workflow/WorkflowStatusInfo.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -b -r1.7 -r1.8 --- WorkflowStatusInfo.java 19 Jan 2009 12:30:40 -0000 1.7 +++ WorkflowStatusInfo.java 20 Jan 2009 05:51:25 -0000 1.8 @@ -7,16 +7,15 @@ */ package com.finalist.cmsc.services.workflow; -import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.struts.util.LabelValueBean; +import org.mmbase.bridge.Cloud; import org.mmbase.bridge.Node; import org.mmbase.bridge.NodeList; -import org.mmbase.bridge.NodeManager; import com.finalist.cmsc.services.ServiceUtil; @@ -25,8 +24,8 @@ private static String CONTENTELEMENT = "contentelement"; private static String ASSETELEMENT = "assetelement"; - private List<LabelValueBean> contentChildTypes = ServiceUtil.getDirectChildTypes(CONTENTELEMENT); - private List<LabelValueBean> assetChildTypes = ServiceUtil.getDirectChildTypes(ASSETELEMENT); + private List<LabelValueBean> contentChildTypes ; + private List<LabelValueBean> assetChildTypes ; private int allcontentDraft; private int allcontentFinished; @@ -68,7 +67,10 @@ private int pageApproved; private int pagePublished; - public WorkflowStatusInfo(NodeList statusList) { + public WorkflowStatusInfo(Cloud cloud,NodeList statusList) { + + contentChildTypes = ServiceUtil.getDirectChildTypes(cloud,CONTENTELEMENT); + assetChildTypes = ServiceUtil.getDirectChildTypes(cloud,ASSETELEMENT); // initialization for (LabelValueBean childType : contentChildTypes) { contentChildrenDraft.put(childType.getValue(), 0); @@ -92,47 +94,47 @@ if ("content".equals(type)) { if (Workflow.STATUS_DRAFT.equals(status)) { contentDraft += count; - setNodetypeStatus(contentChildTypes, contentChildrenDraft, nodetype, count); + setNodetypeStatus(cloud,contentChildTypes, contentChildrenDraft, nodetype, count); } if (Workflow.STATUS_FINISHED.equals(status)) { contentFinished += count; - setNodetypeStatus(contentChildTypes, contentChildrenFinished, nodetype, count); + setNodetypeStatus(cloud,contentChildTypes, contentChildrenFinished, nodetype, count); } if (Workflow.STATUS_APPROVED.equals(status)) { if (Workflow.isAcceptedStepEnabled()) { contentApproved += count; - setNodetypeStatus(contentChildTypes, contentChildrenApproved, nodetype, count); + setNodetypeStatus(cloud,contentChildTypes, contentChildrenApproved, nodetype, count); } else { contentFinished += count; - setNodetypeStatus(contentChildTypes, contentChildrenFinished, nodetype, count); + setNodetypeStatus(cloud,contentChildTypes, contentChildrenFinished, nodetype, count); } } if (Workflow.STATUS_PUBLISHED.equals(status)) { contentPublished += count; - setNodetypeStatus(contentChildTypes, contentChildrenPublished, nodetype, count); + setNodetypeStatus(cloud,contentChildTypes, contentChildrenPublished, nodetype, count); } } if ("asset".equals(type)) { if (Workflow.STATUS_DRAFT.equals(status)) { assetDraft += count; - setNodetypeStatus(assetChildTypes, assetChildrenDraft, nodetype, count); + setNodetypeStatus(cloud,assetChildTypes, assetChildrenDraft, nodetype, count); } if (Workflow.STATUS_FINISHED.equals(status)) { assetFinished += count; - setNodetypeStatus(assetChildTypes, assetChildrenFinished, nodetype, count); + setNodetypeStatus(cloud,assetChildTypes, assetChildrenFinished, nodetype, count); } if (Workflow.STATUS_APPROVED.equals(status)) { if (Workflow.isAcceptedStepEnabled()) { assetApproved += count; - setNodetypeStatus(assetChildTypes, assetChildrenApproved, nodetype, count); + setNodetypeStatus(cloud,assetChildTypes, assetChildrenApproved, nodetype, count); } else { assetFinished += count; - setNodetypeStatus(assetChildTypes, assetChildrenFinished, nodetype, count); + setNodetypeStatus(cloud,assetChildTypes, assetChildrenFinished, nodetype, count); } } if (Workflow.STATUS_PUBLISHED.equals(status)) { assetPublished = count; - setNodetypeStatus(assetChildTypes, assetChildrenPublished, nodetype, count); + setNodetypeStatus(cloud,assetChildTypes, assetChildrenPublished, nodetype, count); } } if ("link".equals(type)) { @@ -168,11 +170,11 @@ allcontentPublished = contentPublished + assetPublished; } - private void setNodetypeStatus(List<LabelValueBean> childTypes, Map<String, Integer> childrenStatus, String nodetype, + private void setNodetypeStatus(Cloud cloud,List<LabelValueBean> childTypes, Map<String, Integer> childrenStatus, String nodetype, int count) { for (LabelValueBean childType : childTypes) { String childTypeName = childType.getValue(); - if (nodetype.equals(childTypeName)||ServiceUtil.getAllChildTypes(childTypeName).contains(nodetype)) { + if (nodetype.equals(childTypeName)||ServiceUtil.getAllChildTypes(cloud,childTypeName).contains(nodetype)) { int temp = 0; if (childrenStatus.containsKey(childType)) { temp = childrenStatus.get(childType); _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs