X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.client.ui.dist%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fdist%2Fmodel%2FWkspGroupElem.java;fp=org.argeo.slc.client.ui.dist%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fdist%2Fmodel%2FWkspGroupElem.java;h=0000000000000000000000000000000000000000;hb=ecc22e604e47533c79de9cecdcdeacbc752cbff1;hp=0c10777ead4319e6e0d35c09d8a866d50b7ccb0d;hpb=e07ded4632e53f8b8869763bc1f1f4091361e76e;p=gpl%2Fargeo-slc.git 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 index 0c10777ea..000000000 --- a/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/model/WkspGroupElem.java +++ /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