Author: fpunt
Date: 2010-04-20 17:34:24 +0200 (Tue, 20 Apr 2010)
New Revision: 41985

Modified:
   
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/ContentSearchAction.java
   
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/SearchForm.java
   
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/contentsearch.jsp
Log:
CMSC-1657 Fixed for the content

Modified: 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/ContentSearchAction.java
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/ContentSearchAction.java
 2010-04-20 15:28:02 UTC (rev 41984)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/ContentSearchAction.java
 2010-04-20 15:34:24 UTC (rev 41985)
@@ -148,6 +148,18 @@
          SearchUtil.addConstraint(query, contentConstraint);
          query.setNodeStep(contentStep);
       }
+      
+      
+      // Search on Workflow status when needed, onlive basicly means not in 
workflow rel
+      String workflowstate = searchForm.getWorkflowstate();
+      if(!StringUtils.isEmpty(workflowstate)) {
+         NodeManager workflowNodeManager = 
cloud.getNodeManager("workflowitem");  
+       Step workflowStep = query.addRelationStep(workflowNodeManager, 
"workflowrel", "SOURCE").getNext();
+         StepField workflowStatusField = query.createStepField(workflowStep, 
workflowNodeManager.getField("status"));
+         FieldValueConstraint workflowConstraint = 
query.createConstraint(workflowStatusField, FieldCompareConstraint.EQUAL,
+               workflowstate);
+         SearchUtil.addConstraint(query, workflowConstraint);
+      }
       // Order the result by:
       String order = searchForm.getOrder();
 

Modified: 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/SearchForm.java
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/SearchForm.java
  2010-04-20 15:28:02 UTC (rev 41984)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/SearchForm.java
  2010-04-20 15:34:24 UTC (rev 41985)
@@ -21,7 +21,7 @@
    private String search = "true";
    private String parentchannelpath = "";
    private String index = "";
-   private String workflowstate = "0";
+   private String workflowstate = "";
 
 
    public String getContenttypes() {

Modified: 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/contentsearch.jsp
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/contentsearch.jsp
      2010-04-20 15:28:02 UTC (rev 41984)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/contentsearch.jsp
      2010-04-20 15:34:24 UTC (rev 41985)
@@ -286,11 +286,12 @@
                           <td><fmt:message key="searchform.workflowstate" 
/></td>
                           <td>
                              <html:select style="width:145px" 
property="workflowstate" size="1">
-                                <html:option value="0"> - </html:option>
-                                <html:option value="1"><fmt:message 
key="content.status.finished" /></html:option>
-                                <html:option value="2"><fmt:message 
key="content.status.approved" /></html:option>
-                                <html:option value="3"><fmt:message 
key="content.status.published" /></html:option>
-                                <html:option value="4"><fmt:message 
key="content.status.onlive" /></html:option>
+                                <html:option value=""><fmt:message 
key="content.status.all" /></html:option>
+                                <html:option value="draft"><fmt:message 
key="content.status.draft" /></html:option>
+                                <html:option value="finished"><fmt:message 
key="content.status.finished" /></html:option>
+                                <html:option value="approved"><fmt:message 
key="content.status.approved" /></html:option>
+                                <html:option value="published"><fmt:message 
key="content.status.published" /></html:option>
+<%--                                <html:option value="onlive"><fmt:message 
key="content.status.onlive" /></html:option> --%>
                              </html:select>
                           </td>
                           <td colspan="2">&nbsp;</td>

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to