]> 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/editors/DistributionOverviewPage.java
Work in progress - work on modular distributions.
[gpl/argeo-slc.git] / plugins / org.argeo.slc.client.ui.dist / src / main / java / org / argeo / slc / client / ui / dist / editors / DistributionOverviewPage.java
index 3c27a960728b9135ba98f994b8a7fce9dc13a75e..edd848fe98f0a99594e5cfce1598763f901d880f 100644 (file)
@@ -20,9 +20,11 @@ import java.util.List;
 
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
+import javax.jcr.Property;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.nodetype.NodeType;
 import javax.jcr.query.QueryManager;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.qom.Constraint;
@@ -86,12 +88,13 @@ import org.eclipse.ui.forms.editor.FormPage;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
-/** Table giving an overview of an OSGi distribution with corresponding filters */
+/** Show all bundles contained in a given workspace as filter-able table */
 public class DistributionOverviewPage extends FormPage implements SlcNames {
-       final static String PAGE_ID = "distributionOverviewPage";
        // final private static Log log = LogFactory
        // .getLog(DistributionOverviewPage.class);
 
+       final static String PAGE_ID = "distributionOverviewPage";
+
        // Business Objects
        private Session session;
 
@@ -246,8 +249,22 @@ public class DistributionOverviewPage extends FormPage implements SlcNames {
                header.setLayoutData(gd);
 
                // Title: some meta information
-               String desc = ((DistributionEditorInput) getEditorInput())
-                               .getRepositoryDescription();
+               // label = repoNode.isNodeType(NodeType.MIX_TITLE) ? repoNode
+               // .getProperty(Property.JCR_TITLE).getString() : repoNode
+               // .getName();
+
+               String desc = null;
+               Node repoNode = ((DistributionWorkspaceEditor) getEditor())
+                               .getRepoNode();
+               if (repoNode != null)
+                       try {
+                               desc = repoNode.isNodeType(NodeType.MIX_TITLE) ? repoNode
+                                               .getProperty(Property.JCR_TITLE).getString() : repoNode
+                                               .getName();
+                       } catch (RepositoryException e1) {
+                               throw new SlcException("Unable to get repository alias ", e1);
+                       }
+               desc += " (" + ((WorkspaceEditorInput) getEditorInput()).getUri() + ")";
                Label lbl = tk.createLabel(header, desc, SWT.NONE);
 
                gd = new GridData(SWT.FILL, SWT.FILL, false, false);