]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/model/WkspGroupElem.java
Clarify SLC project structure.
[gpl/argeo-slc.git] / org.argeo.slc.client.ui.dist / src / org / argeo / slc / client / ui / dist / model / WkspGroupElem.java
diff --git a/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/model/WkspGroupElem.java b/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/model/WkspGroupElem.java
deleted file mode 100644 (file)
index 0c10777..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.argeo.slc.client.ui.dist.model;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.argeo.jcr.JcrUtils;
-import org.argeo.slc.SlcException;
-
-/**
- * Abstract set of similar workspaces, that is a bunch of workspaces with same
- * prefix.
- */
-public class WkspGroupElem extends DistParentElem {
-
-       private Session defaultSession;
-
-       public WkspGroupElem(RepoElem repoElem, String prefix) {
-               super(prefix, repoElem.inHome(), repoElem.isReadOnly());
-               setParent(repoElem);
-               // Directly adds children upon creation
-               try {
-                       defaultSession = repoElem.repositoryLogin(null);
-                       String[] wkpNames = defaultSession.getWorkspace()
-                                       .getAccessibleWorkspaceNames();
-                       for (String wkpName : wkpNames) {
-                               if (prefix.equals(getPrefix(wkpName))
-                               // if (wkpName.startsWith(prefix)
-                                               && repoElem.isWorkspaceVisible(wkpName))
-                                       addChild(new WorkspaceElem(WkspGroupElem.this, repoElem,
-                                                       wkpName));
-                       }
-               } catch (RepositoryException e) {
-                       throw new SlcException("Cannot retrieve workspace names", e);
-               }
-       }
-
-       // FIXME - we rely on a "hard coded" convention : Workspace name must have
-       // this format: name-major.minor
-       // We might expose this method as static public, to be used among others by
-       // the RepoElem parent objects when building its children
-       private String getPrefix(String workspaceName) {
-               if (workspaceName.lastIndexOf(VERSION_SEP) > 0)
-                       return workspaceName.substring(0,
-                                       workspaceName.lastIndexOf(VERSION_SEP));
-               else
-                       return workspaceName;
-       }
-
-       public void dispose() {
-               JcrUtils.logoutQuietly(defaultSession);
-               super.dispose();
-       }
-}
\ No newline at end of file