Update of 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/services/contentrepository
In directory 
james.mmbase.org:/tmp/cvs-serv5646/contentrepository/src/java/com/finalist/cmsc/services/contentrepository

Modified Files:
      Tag: b1_5
        ContentRepository.java ContentRepositoryService.java 
        ContentRepositoryServiceMMBaseImpl.java 
Log Message:
CMSC-1189(Add age constraint to contentchannel portlets)


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/services/contentrepository
See also: http://www.mmbase.org/jira/browse/CMSC-1189


Index: ContentRepository.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/services/contentrepository/ContentRepository.java,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -b -r1.4 -r1.4.2.1
--- ContentRepository.java      25 Jul 2008 15:54:04 -0000      1.4
+++ ContentRepository.java      18 Dec 2008 09:22:32 -0000      1.4.2.1
@@ -35,12 +35,16 @@
 
 
    public static int countContentElements(String channel, List<String> 
contenttypes, String orderby, String direction,
+         boolean useLifecycle, String archive, int offset, int maxNumbers, int 
year, int month, int day, int maxDays) {
+      return cService.countContentElements(channel, contenttypes, orderby, 
direction, useLifecycle, archive, offset,
+            maxNumbers, year, month, day, maxDays);
+   }
+   public static int countContentElements(String channel, List<String> 
contenttypes, String orderby, String direction,
          boolean useLifecycle, String archive, int offset, int maxNumbers, int 
year, int month, int day) {
       return cService.countContentElements(channel, contenttypes, orderby, 
direction, useLifecycle, archive, offset,
             maxNumbers, year, month, day);
    }
 
-
    public static List<ContentElement> getContentElements(String channel, 
List<String> contenttypes, String orderby,
          String direction, boolean useLifecycle, String archive, int offset, 
int maxNumbers, int year, int month,
          int day) {
@@ -74,4 +78,14 @@
       return cService.getContentElement(elementId);
    }
 
+
+   public static List<ContentElement> getContentElements(String channel, 
List<String> contenttypes, String orderby,
+         String direction, boolean useLifecycle, String archive, int offset, 
int maxNumbers, int year, int month,
+         int day , int maxDays) {
+      return cService.getContentElements(channel, contenttypes, orderby, 
direction, useLifecycle, archive, offset,
+            maxNumbers, year, month, day, maxDays);
+   }
+
+
+
 }


Index: ContentRepositoryService.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/services/contentrepository/ContentRepositoryService.java,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -b -r1.4 -r1.4.2.1
--- ContentRepositoryService.java       25 Jul 2008 15:54:04 -0000      1.4
+++ ContentRepositoryService.java       18 Dec 2008 09:22:32 -0000      1.4.2.1
@@ -10,7 +10,6 @@
 package com.finalist.cmsc.services.contentrepository;
 
 import java.util.List;
-
 import com.finalist.cmsc.beans.NodetypeBean;
 import com.finalist.cmsc.beans.om.ContentChannel;
 import com.finalist.cmsc.beans.om.ContentElement;
@@ -51,4 +50,13 @@
 
    abstract public ContentElement getContentElement(String elementId);
 
+
+   abstract public int countContentElements(String channel, List<String> 
contenttypes, String orderby,
+         String direction, boolean useLifecycle, String archive, int offset, 
int maxNumbers, int year, int month,
+         int day, int maxDays);
+
+
+   abstract List<ContentElement> getContentElements(String channel, 
List<String> contenttypes, String orderby,
+         String direction, boolean useLifecycle, String archive, int offset, 
int maxNumber, int year, int month,
+         int day, int maxDays);
 }


Index: ContentRepositoryServiceMMBaseImpl.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/services/contentrepository/ContentRepositoryServiceMMBaseImpl.java,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -b -r1.9 -r1.9.2.1
--- ContentRepositoryServiceMMBaseImpl.java     25 Jul 2008 15:54:04 -0000      
1.9
+++ ContentRepositoryServiceMMBaseImpl.java     18 Dec 2008 09:22:32 -0000      
1.9.2.1
@@ -105,6 +105,24 @@
     }
 
        @Override
+    public int countContentElements(String channel, List<String> contenttypes, 
String orderby, String direction,
+          boolean useLifecycle, String archive, int offset, int maxNumber, int 
year, int month, int day, int maxDays) {
+       Cloud cloud = getCloud();
+       if (channel != null) {
+           Node chan = cloud.getNode(channel);
+           return countContentElements(chan, contenttypes, orderby, direction, 
useLifecycle, archive, offset, maxNumber, year, month, day, maxDays);
+       }
+       return -1;
+    }
+   private int countContentElements(Node channel, List<String> contenttypes, 
String orderby, String direction,
+         boolean useLifecycle, String archive, int offset, int maxNumber, int 
year, int month, int day, int maxDays) {
+      if (channel != null) {
+         return RepositoryUtil.countLinkedElements(channel, contenttypes, 
orderby, direction, useLifecycle, archive, offset, maxNumber, year, month, day, 
maxDays);
+     }
+     return -1;
+   }
+
+   @Override
     public List<ContentElement> getContentElements(String channel, 
List<String> contenttypes, String orderby, String direction, boolean 
useLifecycle, String archive, int offset, int maxNumber, int year, int month, 
int day) {
                Cloud cloud = getCloud();
                if (channel != null) {
@@ -221,4 +239,24 @@
                return cloud;
        }
 
+   @Override
+   public List<ContentElement> getContentElements(String channel, List<String> 
contenttypes, String orderby, String direction, boolean useLifecycle, String 
archive, int offset, int maxNumber, int year, int month, int day,int maxDays) {
+      Cloud cloud = getCloud();
+      List<ContentElement> result = new ArrayList<ContentElement>();
+      if (channel != null) {
+         Node chan = cloud.getNode(channel);
+      
+         if (chan != null) {
+            NodeList l = RepositoryUtil.getLinkedElements(chan, contenttypes, 
orderby, direction, useLifecycle, archive, offset, maxNumber, year, month, day, 
maxDays);
+            for (int i = 0; i < l.size(); i++) {
+               Node currentNode = l.getNode(i);
+               ContentElement e = MMBaseNodeMapper.copyNode(currentNode, 
ContentElement.class);
+               result.add(e);
+            }
+         }
+      }
+      return result;
+   }
+
+
 }
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to