[jboss-svn-commits] JBL Code SVN: r15040 - labs/jbossrules/trunk/drools-jbrms/src/main/java/org/drools/brms/server.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Sep 12 00:17:38 EDT 2007


Author: michael.neale at jboss.com
Date: 2007-09-12 00:17:37 -0400 (Wed, 12 Sep 2007)
New Revision: 15040

Modified:
   labs/jbossrules/trunk/drools-jbrms/src/main/java/org/drools/brms/server/ServiceImplementation.java
Log:
updated doco note for future use

Modified: labs/jbossrules/trunk/drools-jbrms/src/main/java/org/drools/brms/server/ServiceImplementation.java
===================================================================
--- labs/jbossrules/trunk/drools-jbrms/src/main/java/org/drools/brms/server/ServiceImplementation.java	2007-09-12 03:36:31 UTC (rev 15039)
+++ labs/jbossrules/trunk/drools-jbrms/src/main/java/org/drools/brms/server/ServiceImplementation.java	2007-09-12 04:17:37 UTC (rev 15040)
@@ -372,6 +372,15 @@
         AssetItem item = repository.loadAssetByUUID( uuid );
         AssetHistoryIterator it = item.getHistory();
 
+
+        //MN Note: this uses the lazy iterator, but then loads the whole lot up, and returns it.
+        //The reason for this is that the GUI needs to show things in numeric order by the version number.
+        //When a version is restored, its previous version is NOT what you thought it was - due to how JCR works
+        // (its more like CVS then SVN). So to get a linear progression of versions, we use the incrementing version number,
+        // and load it all up and sort it. This is not ideal.
+        // In future, we may do a "restore" instead just by copying content into a new version, not restoring a node,
+        // in which case the iterator will be in order (or you can just walk all the way back).
+        //So if there are performance problems with looking at lots of historical versions, look at this nasty bit of code.
         while ( it.hasNext() ) {
             AssetItem historical = (AssetItem) it.next();//new AssetItem(repo, element);
             long versionNumber = historical.getVersionNumber();




More information about the jboss-svn-commits mailing list