Author: fpunt
Date: 2010-04-21 10:38:23 +0200 (Wed, 21 Apr 2010)
New Revision: 42002

Modified:
   
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/AssetSearchAction.java
   
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/ContentSearchAction.java
   
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/SearchForm.java
   
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/assetsearch.jsp
   
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/contentsearch.jsp
Log:
Fixed back CMSC-1657 to CMSc branch 1.7

Modified: 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/AssetSearchAction.java
===================================================================
--- 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/AssetSearchAction.java
   2010-04-21 08:20:36 UTC (rev 42001)
+++ 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/AssetSearchAction.java
   2010-04-21 08:38:23 UTC (rev 42002)
@@ -122,6 +122,17 @@
          query.setNodeStep(assetStep);
       }
    
+      // 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/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/ContentSearchAction.java
===================================================================
--- 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/ContentSearchAction.java
 2010-04-21 08:20:36 UTC (rev 42001)
+++ 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/ContentSearchAction.java
 2010-04-21 08:38:23 UTC (rev 42002)
@@ -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/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/SearchForm.java
===================================================================
--- 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/SearchForm.java
  2010-04-21 08:20:36 UTC (rev 42001)
+++ 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/SearchForm.java
  2010-04-21 08:38:23 UTC (rev 42002)
@@ -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/branches/b1_7/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/assetsearch.jsp
===================================================================
--- 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/assetsearch.jsp
        2010-04-21 08:20:36 UTC (rev 42001)
+++ 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/assetsearch.jsp
        2010-04-21 08:38:23 UTC (rev 42002)
@@ -241,21 +241,22 @@
                            <td><fmt:message key="searchform.number" /></td>
                            <td><html:text style="width:145px" 
property="objectid"/></td>
                         </tr>
-                         <c:if test="${hasWorkflow}">
-                           <tr height="31px">
-                              <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="asset.status.finished" /></html:option>
-                                    <html:option value="2"><fmt:message 
key="asset.status.approved" /></html:option>
-                                    <html:option value="3"><fmt:message 
key="asset.status.published" /></html:option>
-                                    <html:option value="4"><fmt:message 
key="asset.status.onlive" /></html:option>
-                                 </html:select>
-                              </td>
-                              <td colspan="2">&nbsp;</td>
-                           </tr>
-                         </c:if>
+                     <c:if test="${hasWorkflow}">
+                       <tr height="31px">
+                          <td><fmt:message key="searchform.workflowstate" 
/></td>
+                          <td>
+                             <html:select style="width:145px" 
property="workflowstate" size="1">
+                                <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>
+                       </tr>
+                     </c:if>
                         <tr>
                            <td></td>
                            <td></td>

Modified: 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/contentsearch.jsp
===================================================================
--- 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/contentsearch.jsp
      2010-04-21 08:20:36 UTC (rev 42001)
+++ 
CMSContainer/branches/b1_7/CMSContainer/cmsc/contentrepository/src/webapp/editors/repository/contentsearch.jsp
      2010-04-21 08:38:23 UTC (rev 42002)
@@ -287,11 +287,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