From ee53b65ba03c7b927a7768325b9bfc6f8185965f Mon Sep 17 00:00:00 2001 From: Bruno Sinou Date: Thu, 26 Feb 2015 11:37:43 +0000 Subject: [PATCH] Adapt to Commons 2.x and some subtle comments cleaning. git-svn-id: https://svn.argeo.org/slc/trunk@7970 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../META-INF/spring/commands.xml | 17 ++++++++--------- .../META-INF/spring/editors.xml | 4 ++-- .../META-INF/spring/jcr.xml | 2 +- .../META-INF/spring/views.xml | 2 +- .../controllers/DistTreeContentProvider.java | 6 +++--- .../client/ui/dist/views/DistributionsView.java | 5 +---- 6 files changed, 16 insertions(+), 20 deletions(-) diff --git a/org.argeo.slc.client.ui.dist/META-INF/spring/commands.xml b/org.argeo.slc.client.ui.dist/META-INF/spring/commands.xml index df2e07a1e..a9eb9af74 100644 --- a/org.argeo.slc.client.ui.dist/META-INF/spring/commands.xml +++ b/org.argeo.slc.client.ui.dist/META-INF/spring/commands.xml @@ -21,8 +21,8 @@ - + - + - + + @@ -79,14 +80,14 @@ - + - + - - + - + @@ -123,7 +123,6 @@ - + @@ -28,4 +28,4 @@ scope="prototype"> - + \ No newline at end of file diff --git a/org.argeo.slc.client.ui.dist/META-INF/spring/jcr.xml b/org.argeo.slc.client.ui.dist/META-INF/spring/jcr.xml index b5413793e..9bde05fc1 100644 --- a/org.argeo.slc.client.ui.dist/META-INF/spring/jcr.xml +++ b/org.argeo.slc.client.ui.dist/META-INF/spring/jcr.xml @@ -18,4 +18,4 @@ - + \ No newline at end of file diff --git a/org.argeo.slc.client.ui.dist/META-INF/spring/views.xml b/org.argeo.slc.client.ui.dist/META-INF/spring/views.xml index e18ed1137..7089965b6 100644 --- a/org.argeo.slc.client.ui.dist/META-INF/spring/views.xml +++ b/org.argeo.slc.client.ui.dist/META-INF/spring/views.xml @@ -76,4 +76,4 @@ - + \ No newline at end of file diff --git a/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/controllers/DistTreeContentProvider.java b/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/controllers/DistTreeContentProvider.java index aab7f06f1..6eea82f3f 100644 --- a/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/controllers/DistTreeContentProvider.java +++ b/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/controllers/DistTreeContentProvider.java @@ -39,7 +39,7 @@ public class DistTreeContentProvider implements ITreeContentProvider { // Context private Session nodeSession; List repositories = new ArrayList(); - + public Object[] getElements(Object input) { Repository nodeRepository = (Repository) input; try { @@ -105,7 +105,6 @@ public class DistTreeContentProvider implements ITreeContentProvider { private void initializeModel(Session nodeSession) { try { - Node homeNode = UserJcrUtils.getUserHome(nodeSession); if (homeNode == null) // anonymous throw new SlcException("User must be authenticated."); @@ -113,7 +112,8 @@ public class DistTreeContentProvider implements ITreeContentProvider { // make sure base directory is available Node repos = JcrUtils.mkdirs(nodeSession, homeNode.getPath() + RepoConstants.REPOSITORIES_BASE_PATH); - nodeSession.save(); + if (nodeSession.hasPendingChanges()) + nodeSession.save(); // register default local java repository String alias = RepoConstants.DEFAULT_JAVA_REPOSITORY_ALIAS; diff --git a/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/views/DistributionsView.java b/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/views/DistributionsView.java index 908ce05ad..8948bccfd 100644 --- a/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/views/DistributionsView.java +++ b/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/views/DistributionsView.java @@ -101,7 +101,6 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames viewer.setContentProvider(treeContentProvider); viewer.addDoubleClickListener(new DistTreeDoubleClickListener(viewer)); viewer.setComparer(new DistTreeComparer()); - viewer.setComparator(new DistTreeComparator()); @SuppressWarnings("unused") @@ -374,9 +373,7 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames viewer.expandToLevel(2); } - /* - * DEPENDENCY INJECTION - */ + /* DEPENDENCY INJECTION */ public void setNodeRepository(Repository nodeRepository) { this.nodeRepository = nodeRepository; } -- 2.39.2