cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jer...@apache.org
Subject svn commit: r157445 - in cocoon/blocks/unsupported/querybean/trunk/samples: flow/QueryFavourites.js flow/query.js forms/advanced-model.xml forms/simple-model.xml i18n/messages.xml i18n/messages_en.xml
Date Mon, 14 Mar 2005 18:24:56 GMT
Author: jeremy
Date: Mon Mar 14 10:24:54 2005
New Revision: 157445

URL: http://svn.apache.org/viewcvs?view=rev&rev=157445
Log:
bug fixes: validation on 'field' field too large for supplied values, no default i18n catalogue

Added:
    cocoon/blocks/unsupported/querybean/trunk/samples/i18n/messages.xml
      - copied unchanged from r157443, cocoon/blocks/unsupported/querybean/trunk/samples/i18n/messages_en.xml
Removed:
    cocoon/blocks/unsupported/querybean/trunk/samples/i18n/messages_en.xml
Modified:
    cocoon/blocks/unsupported/querybean/trunk/samples/flow/QueryFavourites.js
    cocoon/blocks/unsupported/querybean/trunk/samples/flow/query.js
    cocoon/blocks/unsupported/querybean/trunk/samples/forms/advanced-model.xml
    cocoon/blocks/unsupported/querybean/trunk/samples/forms/simple-model.xml

Modified: cocoon/blocks/unsupported/querybean/trunk/samples/flow/QueryFavourites.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/querybean/trunk/samples/flow/QueryFavourites.js?view=diff&r1=157444&r2=157445
==============================================================================
--- cocoon/blocks/unsupported/querybean/trunk/samples/flow/QueryFavourites.js (original)
+++ cocoon/blocks/unsupported/querybean/trunk/samples/flow/QueryFavourites.js Mon Mar 14 10:24:54
2005
@@ -14,7 +14,7 @@
   limitations under the License.
 */
 
-importClass(Packages.org.apache.cocoon.ojb.broker.components.PBFactory);
+importClass(Packages.org.apache.ojb.broker.PersistenceBrokerFactory);
 importClass(Packages.org.apache.ojb.broker.query.Criteria);
 importClass(Packages.org.apache.ojb.broker.query.QueryByCriteria);
 importPackage(Packages.org.apache.cocoon.bean.query);
@@ -23,7 +23,6 @@
 // QueryFavourites constructor
 function QueryFavourites(user) {
 	this._user = user;
-	this._factory = cocoon.getComponent(PBFactory.ROLE);
 }
 
 // add a Query to the QueryFavourites
@@ -32,7 +31,7 @@
 	query.date = new java.util.Date();
 	var broker = null;
 	try {
-		broker = this._factory.defaultPersistenceBroker();
+		broker = PersistenceBrokerFactory.defaultPersistenceBroker();
 		broker.beginTransaction();
 		broker.store(query);
 		broker.commitTransaction();
@@ -49,7 +48,7 @@
 	var broker = null;
 	var result = null;
 	try {
-		broker = this._factory.defaultPersistenceBroker();
+		broker = PersistenceBrokerFactory.defaultPersistenceBroker();
 		var criteria = criteria = new Criteria();
 		criteria.addEqualTo("id", new java.lang.Long(id));
 		//criteria.addEqualTo("user", new String(this._user));
@@ -72,7 +71,7 @@
 	var broker = null;
 	var result = null;
 	try {
-		broker = this._factory.defaultPersistenceBroker();
+		broker = PersistenceBrokerFactory.defaultPersistenceBroker();
 		var criteria = criteria = new Criteria();
 		criteria.addEqualTo("id", new java.lang.Long(id));
 		//criteria.addEqualTo("user", new String(this._user));
@@ -92,7 +91,7 @@
 	var broker = null;
 	var result = null;
 	try {
-		broker = this._factory.defaultPersistenceBroker();
+		broker = PersistenceBrokerFactory.defaultPersistenceBroker();
 		var criteria = criteria = new Criteria();
 		criteria.addEqualTo("user", new String(this._user));
     var query = new QueryByCriteria(SimpleLuceneQueryBean, criteria);
@@ -102,9 +101,4 @@
 		if (broker != null) broker.close();
 	}
 	return result;	
-}
-
-// close the QueryFavourites
-QueryFavourites.prototype.close = function() {
-	cocoon.releaseComponent(this._factory);
 }

Modified: cocoon/blocks/unsupported/querybean/trunk/samples/flow/query.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/querybean/trunk/samples/flow/query.js?view=diff&r1=157444&r2=157445
==============================================================================
--- cocoon/blocks/unsupported/querybean/trunk/samples/flow/query.js (original)
+++ cocoon/blocks/unsupported/querybean/trunk/samples/flow/query.js Mon Mar 14 10:24:54 2005
@@ -41,11 +41,9 @@
 	try {
 		favourites = new QueryFavourites(cocoon.parameters["user-id"]);
 		cocoon.sendPage(cocoon.parameters["screen"], {queries: favourites.list()});
-	/*} catch (error) {
+	} catch (error) {
 		cocoon.log.error("BLAH:" + error);
-		cocoon.sendPage("screen/error", {message: error});*/
-	} finally {
-		if (favourites != null) favourites.close();
+		cocoon.sendPage("screen/error", {message: error});
 	}
 }
 
@@ -64,8 +62,6 @@
 	} catch (error) {
 		cocoon.log.error(error);
 		cocoon.sendPage("screen/error", {message: error});
-	} finally {
-		if (favourites != null) favourites.close();
 	}
 }
 
@@ -79,8 +75,6 @@
 	} catch (error) {
 		cocoon.log.error(error);
 		cocoon.sendPage("screen/error", {message: error});
-	} finally {
-		if (favourites != null) favourites.close();
 	}
 }
 
@@ -123,7 +117,6 @@
 		cocoon.sendPage("screen/error", {message: error});	
 	} finally {
 		if (searcher != null) searcher.close();
-		if (favourites != null) favourites.close();
 	}
 }
 

Modified: cocoon/blocks/unsupported/querybean/trunk/samples/forms/advanced-model.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/querybean/trunk/samples/forms/advanced-model.xml?view=diff&r1=157444&r2=157445
==============================================================================
--- cocoon/blocks/unsupported/querybean/trunk/samples/forms/advanced-model.xml (original)
+++ cocoon/blocks/unsupported/querybean/trunk/samples/forms/advanced-model.xml Mon Mar 14
10:24:54 2005
@@ -106,7 +106,7 @@
 					<fd:hint><i18n:text i18n:catalogue="local">criterion.field.hint</i18n:text></fd:hint>
 					<fd:datatype base="string">
 						<fd:validation>
-							<fd:length min="2" max="64"/>
+							<fd:length min="1" max="64"/>
 						</fd:validation>
 					</fd:datatype>
 					<fd:selection-list src="forms/advanced-fields.xml"/>

Modified: cocoon/blocks/unsupported/querybean/trunk/samples/forms/simple-model.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/querybean/trunk/samples/forms/simple-model.xml?view=diff&r1=157444&r2=157445
==============================================================================
--- cocoon/blocks/unsupported/querybean/trunk/samples/forms/simple-model.xml (original)
+++ cocoon/blocks/unsupported/querybean/trunk/samples/forms/simple-model.xml Mon Mar 14 10:24:54
2005
@@ -89,7 +89,7 @@
 			<fd:hint><i18n:text i18n:catalogue="local">criterion.field.hint</i18n:text></fd:hint>
 			<fd:datatype base="string">
 				<fd:validation>
-					<fd:length min="2" max="64"/>
+					<fd:length min="1" max="64"/>
 				</fd:validation>
 			</fd:datatype>
 			<fd:selection-list src="forms/simple-fields.xml"/>



Mime
View raw message