portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r345857 - /portals/jetspeed-2/trunk/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java
Date Mon, 21 Nov 2005 07:06:00 GMT
Author: taylor
Date: Sun Nov 20 23:05:58 2005
New Revision: 345857

URL: http://svn.apache.org/viewcvs?rev=345857&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-412

lookupPreference(String nodeName, String propertyName, String propertyValue)
uses this to lookup email addresses out of user preferences in the forgotten password feature

Modified:
    portals/jetspeed-2/trunk/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java

Modified: portals/jetspeed-2/trunk/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java?rev=345857&r1=345856&r2=345857&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java
(original)
+++ portals/jetspeed-2/trunk/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java
Sun Nov 20 23:05:58 2005
@@ -326,4 +326,27 @@
     {
         return this.enablePropertyManager;
     }
+    
+    public Collection lookupPreference(String nodeName, String propertyName, String propertyValue)
+    {
+// if the OJB fails, try this
+//        String LOOKUP_BY_EMAIL = 
+//            "SELECT p.full_path, k.property_name, v.text_value " +
+//            "FROM `prefs_node` p, prefs_property_key k, prefs_property_value v " +
+//            "WHERE p.NODE_NAME = 'userinfo' and v.node_id = p.node_id " + 
+//            "AND v.property_key_id = k.property_key_id " +
+//            "AND k.property_name = '";
+
+        Criteria c = new Criteria();
+        if (nodeName != null)
+            c.addEqualTo("nodeName", nodeName);
+        if (propertyName != null)
+            c.addEqualTo("nodeKeys.propertyKeyName", propertyName);
+        if (propertyValue != null)
+            c.addEqualTo("nodeProperties.textPropertyValue", propertyValue);
+        Query query = QueryFactory.newQuery(NodeImpl.class, c);
+        Collection children = getPersistenceBrokerTemplate().getCollectionByQuery(query);
+        return children;
+        
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message