Author: michiel
Date: 2009-05-18 10:13:21 +0200 (Mon, 18 May 2009)
New Revision: 35234

Modified:
   mmbase/trunk/src/org/mmbase/util/LocalizedEntryListFactory.java
Log:
Forgot to check this in.   MMB-1821

Modified: mmbase/trunk/src/org/mmbase/util/LocalizedEntryListFactory.java
===================================================================
--- mmbase/trunk/src/org/mmbase/util/LocalizedEntryListFactory.java     
2009-05-18 08:12:23 UTC (rev 35233)
+++ mmbase/trunk/src/org/mmbase/util/LocalizedEntryListFactory.java     
2009-05-18 08:13:21 UTC (rev 35234)
@@ -228,16 +228,17 @@
 
 
     /**
-     * Returns a Collection of Map.Entries for the given Locale. The 
collection is kind of 'virtual',
-     * it only reflects the underlying memory structures.
-     *
-     * This collection does have a well defined iteration order.
-     *
-     * @param locale The locale of <code>null</code> for the default locale.
-     * @param cloud  The cloud to use. Can be <code>null</code> if no queries 
added (see {...@link #addQuery}).
-     *               If Locale is <code>null</code>, but cloud isn't, the 
locale of the cloud is used.
+     * @since MMBase-1.9.1
      */
-    public List<Map.Entry<C, String>> get(final Locale locale, final Cloud 
cloud) {
+    public List<Map.Entry<C, String>> get(final Locale locale, Cloud c, final 
org.mmbase.bridge.Node node, final Field field) {
+        if (c == null) {
+            if (node != null) {
+                c = node.getCloud();
+            } else if (field != null) {
+                c = field.getNodeManager().getCloud();
+            }
+        }
+        final Cloud cloud = c;
         return new AbstractSequentialList<Map.Entry<C, String>> () {
 
             public int size() {
@@ -314,7 +315,11 @@
                                                 continue;
                                             }
                                         }
-                                        final Query query = 
QueryReader.parseQuery(element, useCloud, null).query;
+                                        final QueryConfigurer qc = new 
QueryConfigurer();
+                                        if (node != null) {
+                                            qc.variables.put("_node", 
node.getNumber());
+                                        }
+                                        final Query query = 
QueryReader.parseQuery(element, qc, useCloud, null).query;
                                         final org.mmbase.bridge.NodeList list 
= query.getList();
                                         subIterator = new 
Iterator<Map.Entry<C, String>>() {
                                                 final NodeIterator 
nodeIterator = list.nodeIterator();
@@ -413,7 +418,21 @@
             }
         };
     }
+
     /**
+     * Returns a Collection of Map.Entries for the given Locale. The 
collection is kind of 'virtual',
+     * it only reflects the underlying memory structures.
+     *
+     * This collection does have a well defined iteration order.
+     *
+     * @param locale The locale of <code>null</code> for the default locale.
+     * @param cloud  The cloud to use. Can be <code>null</code> if no queries 
added (see {...@link #addQuery}).
+     *               If Locale is <code>null</code>, but cloud isn't, the 
locale of the cloud is used.
+     */
+    public List<Map.Entry<C, String>> get(final Locale locale, final Cloud 
cloud) {
+        return get(locale, cloud, null, null);
+    }
+    /**
      * The size of the collections returned by {...@link #get}
      */
     public int size(Cloud cloud) {

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

Reply via email to