]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java
Improve job progress bar
[gpl/argeo-slc.git] / plugins / org.argeo.slc.client.ui.dist / src / main / java / org / argeo / slc / client / ui / dist / views / DistributionsView.java
index 25e67382a7c264f27f3bd6069c864d2d7f1053ac..f4d2de99d7f493e83fa6c58db2d66e4926bb1ff2 100644 (file)
@@ -30,6 +30,8 @@ import javax.jcr.RepositoryException;
 import javax.jcr.RepositoryFactory;
 import javax.jcr.Session;
 import javax.jcr.nodetype.NodeType;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryResult;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -588,8 +590,19 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames
                                // QueryResult result = countQuery.execute();
                                // Long expectedCount = result.getNodes().getSize();
 
-                               Long expectedCount = JcrUtils.countFiles(sourceSession
-                                               .getRootNode());
+                               Query countQuery = sourceSession
+                                               .getWorkspace()
+                                               .getQueryManager()
+                                               .createQuery("select file from [nt:file] as file",
+                                                               Query.JCR_SQL2);
+                               QueryResult result = countQuery.execute();
+                               Long expectedCount = result.getNodes().getSize();
+                               // Long expectedCount =
+                               // result.getRows().nextRow().getValues()[0]
+                               // .getLong();
+
+                               // Long expectedCount = JcrUtils.countFiles(sourceSession
+                               // .getRootNode());
                                if (log.isDebugEnabled())
                                        log.debug("Will copy " + expectedCount + " files...");