From f21589b7f2a19a79edcc213b867c47130faa76cd Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Mon, 26 Oct 2020 08:46:19 +0100 Subject: [PATCH] Improve documents management. --- .../OSGI-INF/documentsFolder.xml | 9 +++ .../OSGI-INF/entryArea.xml | 3 +- library/org.argeo.documents.ui/bnd.bnd | 3 +- .../org.argeo.documents.ui/build.properties | 3 +- .../config/documentsFolder.properties | 1 + .../config/documentsLayer.properties | 3 + .../ui/DocumentsFolderUiProvider.java | 33 ++++++++ .../documents/ui/DocumentsTreeUiProvider.java | 46 ++++++++++++ org.argeo.suite.ui/OSGI-INF/leadPane.xml | 1 + .../config/dashboardLayer.properties | 5 +- .../argeo/suite/ui/DefaultEditionLayer.java | 6 +- .../org/argeo/suite/ui/DefaultLeadPane.java | 47 ++++++++++-- .../src/org/argeo/suite/ui/SuiteApp.java | 75 ++++++++++++------- .../src/org/argeo/suite/ui/SuiteEvent.java | 1 + .../src/org/argeo/suite/ui/SuiteLayer.java | 10 ++- .../src/org/argeo/suite/ui/SuiteUi.java | 11 +++ sdk/argeo-suite-rap.properties | 2 +- sdk/argeo-suite-rcp.properties | 2 +- 18 files changed, 214 insertions(+), 47 deletions(-) create mode 100644 library/org.argeo.documents.ui/OSGI-INF/documentsFolder.xml create mode 100644 library/org.argeo.documents.ui/config/documentsFolder.properties create mode 100644 library/org.argeo.documents.ui/src/org/argeo/documents/ui/DocumentsFolderUiProvider.java diff --git a/library/org.argeo.documents.ui/OSGI-INF/documentsFolder.xml b/library/org.argeo.documents.ui/OSGI-INF/documentsFolder.xml new file mode 100644 index 0000000..a7c2e4b --- /dev/null +++ b/library/org.argeo.documents.ui/OSGI-INF/documentsFolder.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/library/org.argeo.documents.ui/OSGI-INF/entryArea.xml b/library/org.argeo.documents.ui/OSGI-INF/entryArea.xml index eed1520..50fcfe3 100644 --- a/library/org.argeo.documents.ui/OSGI-INF/entryArea.xml +++ b/library/org.argeo.documents.ui/OSGI-INF/entryArea.xml @@ -4,6 +4,7 @@ - + + diff --git a/library/org.argeo.documents.ui/bnd.bnd b/library/org.argeo.documents.ui/bnd.bnd index cf46028..9a3a99c 100644 --- a/library/org.argeo.documents.ui/bnd.bnd +++ b/library/org.argeo.documents.ui/bnd.bnd @@ -1,6 +1,7 @@ Service-Component:\ OSGI-INF/entryArea.xml,\ -OSGI-INF/documentsLayer.xml +OSGI-INF/documentsLayer.xml,\ +OSGI-INF/documentsFolder.xml Import-Package:\ org.eclipse.swt,\ diff --git a/library/org.argeo.documents.ui/build.properties b/library/org.argeo.documents.ui/build.properties index 6ac35f7..0a508e2 100644 --- a/library/org.argeo.documents.ui/build.properties +++ b/library/org.argeo.documents.ui/build.properties @@ -2,5 +2,6 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ OSGI-INF/,\ - OSGI-INF/documentsLayer.xml + OSGI-INF/documentsLayer.xml,\ + OSGI-INF/documentsFolder.xml source.. = src/ diff --git a/library/org.argeo.documents.ui/config/documentsFolder.properties b/library/org.argeo.documents.ui/config/documentsFolder.properties new file mode 100644 index 0000000..349e930 --- /dev/null +++ b/library/org.argeo.documents.ui/config/documentsFolder.properties @@ -0,0 +1 @@ +entity.type=nt:folder \ No newline at end of file diff --git a/library/org.argeo.documents.ui/config/documentsLayer.properties b/library/org.argeo.documents.ui/config/documentsLayer.properties index 2906f2d..1c62222 100644 --- a/library/org.argeo.documents.ui/config/documentsLayer.properties +++ b/library/org.argeo.documents.ui/config/documentsLayer.properties @@ -1 +1,4 @@ service.pid=argeo.documents.ui.documentsLayer + +title=Documents +icon=documents \ No newline at end of file diff --git a/library/org.argeo.documents.ui/src/org/argeo/documents/ui/DocumentsFolderUiProvider.java b/library/org.argeo.documents.ui/src/org/argeo/documents/ui/DocumentsFolderUiProvider.java new file mode 100644 index 0000000..2210b9f --- /dev/null +++ b/library/org.argeo.documents.ui/src/org/argeo/documents/ui/DocumentsFolderUiProvider.java @@ -0,0 +1,33 @@ +package org.argeo.documents.ui; + +import java.nio.file.spi.FileSystemProvider; + +import javax.jcr.Node; +import javax.jcr.RepositoryException; + +import org.argeo.cms.fs.CmsFsUtils; +import org.argeo.cms.ui.CmsUiProvider; +import org.argeo.cms.ui.CmsView; +import org.argeo.cms.ui.util.CmsUiUtils; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; + +/** UI provider of a document folder. */ +public class DocumentsFolderUiProvider implements CmsUiProvider { + private FileSystemProvider nodeFileSystemProvider; + + @Override + public Control createUi(Composite parent, Node context) throws RepositoryException { + CmsView cmsView = CmsView.getCmsView(parent); + DocumentsFolderComposite dfc = new DocumentsFolderComposite(parent, SWT.NONE, context); + dfc.setLayoutData(CmsUiUtils.fillAll()); + dfc.populate(cmsView.doAs(() -> CmsFsUtils.getPath(nodeFileSystemProvider, context))); + return dfc; + } + + public void setNodeFileSystemProvider(FileSystemProvider nodeFileSystemProvider) { + this.nodeFileSystemProvider = nodeFileSystemProvider; + } + +} diff --git a/library/org.argeo.documents.ui/src/org/argeo/documents/ui/DocumentsTreeUiProvider.java b/library/org.argeo.documents.ui/src/org/argeo/documents/ui/DocumentsTreeUiProvider.java index 224576e..c2cda56 100644 --- a/library/org.argeo.documents.ui/src/org/argeo/documents/ui/DocumentsTreeUiProvider.java +++ b/library/org.argeo.documents.ui/src/org/argeo/documents/ui/DocumentsTreeUiProvider.java @@ -1,16 +1,24 @@ package org.argeo.documents.ui; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.spi.FileSystemProvider; +import java.util.HashMap; +import java.util.Map; import javax.jcr.Node; +import javax.jcr.Repository; import javax.jcr.RepositoryException; import org.argeo.api.NodeUtils; import org.argeo.cms.fs.CmsFsUtils; import org.argeo.cms.ui.CmsUiProvider; +import org.argeo.cms.ui.CmsView; import org.argeo.cms.ui.util.CmsUiUtils; import org.argeo.eclipse.ui.fs.FsTreeViewer; +import org.argeo.jcr.Jcr; +import org.argeo.suite.ui.SuiteEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -19,6 +27,7 @@ import org.eclipse.swt.widgets.Control; /** Tree view of a user root folders. */ public class DocumentsTreeUiProvider implements CmsUiProvider { private FileSystemProvider nodeFileSystemProvider; + private Repository repository; @Override public Control createUi(Composite parent, Node context) throws RepositoryException { @@ -27,6 +36,39 @@ public class DocumentsTreeUiProvider implements CmsUiProvider { fsTreeViewer.configureDefaultSingleColumnTable(500); Node homeNode = NodeUtils.getUserHome(context.getSession()); Path homePath = CmsFsUtils.getPath(nodeFileSystemProvider, homeNode); + CmsView cmsView = CmsView.getCmsView(parent); + fsTreeViewer.addSelectionChangedListener((e) -> { + IStructuredSelection selection = (IStructuredSelection) fsTreeViewer.getSelection(); + if (selection.isEmpty()) + return; + else { + Path newSelected = (Path) selection.getFirstElement(); + if (Files.isDirectory(newSelected)) { + Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(repository, newSelected)); + parent.addDisposeListener((e1) -> Jcr.logout(folderNode)); + Map properties = new HashMap<>(); + properties.put(SuiteEvent.NODE_ID, Jcr.getIdentifier(folderNode)); + properties.put(SuiteEvent.WORKSPACE, Jcr.getWorkspaceName(folderNode)); + cmsView.sendEvent(SuiteEvent.refreshPart.topic(), properties); + } + } + }); + fsTreeViewer.addDoubleClickListener((e) -> { + IStructuredSelection selection = (IStructuredSelection) fsTreeViewer.getSelection(); + if (selection.isEmpty()) + return; + else { + Path newSelected = (Path) selection.getFirstElement(); + if (Files.isDirectory(newSelected)) { + Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(repository, newSelected)); + parent.addDisposeListener((e1) -> Jcr.logout(folderNode)); + Map properties = new HashMap<>(); + properties.put(SuiteEvent.NODE_ID, Jcr.getIdentifier(folderNode)); + properties.put(SuiteEvent.WORKSPACE, Jcr.getWorkspaceName(folderNode)); + cmsView.sendEvent(SuiteEvent.openNewPart.topic(), properties); + } + } + }); fsTreeViewer.setPathsInput(homePath); fsTreeViewer.getControl().setLayoutData(CmsUiUtils.fillAll()); fsTreeViewer.getControl().getParent().layout(true, true); @@ -37,4 +79,8 @@ public class DocumentsTreeUiProvider implements CmsUiProvider { this.nodeFileSystemProvider = nodeFileSystemProvider; } + public void setRepository(Repository repository) { + this.repository = repository; + } + } diff --git a/org.argeo.suite.ui/OSGI-INF/leadPane.xml b/org.argeo.suite.ui/OSGI-INF/leadPane.xml index bcbc88b..9d3f2dd 100644 --- a/org.argeo.suite.ui/OSGI-INF/leadPane.xml +++ b/org.argeo.suite.ui/OSGI-INF/leadPane.xml @@ -8,4 +8,5 @@ argeo.suite.ui.dashboardLayer argeo.documents.ui.documentsLayer + diff --git a/org.argeo.suite.ui/config/dashboardLayer.properties b/org.argeo.suite.ui/config/dashboardLayer.properties index c7b815b..79abe4c 100644 --- a/org.argeo.suite.ui/config/dashboardLayer.properties +++ b/org.argeo.suite.ui/config/dashboardLayer.properties @@ -1 +1,4 @@ -service.pid=argeo.suite.ui.dashboardLayer \ No newline at end of file +service.pid=argeo.suite.ui.dashboardLayer + +title=Dashboard +icon=dashboard \ No newline at end of file diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultEditionLayer.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultEditionLayer.java index 9ed12b6..6e77937 100644 --- a/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultEditionLayer.java +++ b/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultEditionLayer.java @@ -27,16 +27,14 @@ public class DefaultEditionLayer implements SuiteLayer { } @Override - public void view(Composite workArea, Node context) { + public void view(CmsUiProvider uiProvider, Composite workArea, Node context) { TabbedArea tabbedArea = ((DefaultEditionArea) workArea).getTabbedArea(); - CmsUiProvider uiProvider = null; tabbedArea.view(uiProvider, context); } @Override - public void open(Composite workArea, Node context) { + public void open(CmsUiProvider uiProvider, Composite workArea, Node context) { TabbedArea tabbedArea = ((DefaultEditionArea) workArea).getTabbedArea(); - CmsUiProvider uiProvider = null; tabbedArea.open(uiProvider, context); } diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultLeadPane.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultLeadPane.java index 77ba555..ed7f9aa 100644 --- a/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultLeadPane.java +++ b/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultLeadPane.java @@ -1,6 +1,8 @@ package org.argeo.suite.ui; +import java.util.Collections; import java.util.Map; +import java.util.TreeMap; import javax.jcr.Node; import javax.jcr.RepositoryException; @@ -13,6 +15,7 @@ import org.argeo.cms.ui.CmsUiProvider; import org.argeo.cms.ui.CmsView; import org.argeo.cms.ui.util.CmsIcon; import org.argeo.cms.ui.util.CmsUiUtils; +import org.argeo.suite.RankedObject; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -20,6 +23,7 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; +import org.osgi.framework.Constants; /** Side pane listing various perspectives. */ public class DefaultLeadPane implements CmsUiProvider { @@ -29,6 +33,7 @@ public class DefaultLeadPane implements CmsUiProvider { defaultLayers; } + private Map> layers = Collections.synchronizedSortedMap(new TreeMap<>()); private String[] defaultLayers; @Override @@ -43,9 +48,24 @@ public class DefaultLeadPane implements CmsUiProvider { Button first = null; for (String layerId : defaultLayers) { - Button b = createButton(parent, layerId, SuiteMsg.dashboard, SuiteIcon.dashboard); - if (first == null) - first = b; + if (layers.containsKey(layerId)) { + RankedObject layerObj = layers.get(layerId); + + // TODO deal with i10n + String titleStr = (String) layerObj.getProperties().get(SuiteLayer.Property.title.name()); + Localized title = null; + if (titleStr != null) + title = new Localized.Untranslated(titleStr); + + String iconName = (String) layerObj.getProperties().get(SuiteLayer.Property.icon.name()); + SuiteIcon icon = null; + if (iconName != null) + icon = SuiteIcon.valueOf(iconName); + + Button b = createButton(parent, layerId, title, icon); + if (first == null) + first = b; + } } // Button dashboardB = createButton(parent, SuiteMsg.dashboard.name(), SuiteMsg.dashboard, SuiteIcon.dashboard); @@ -61,13 +81,16 @@ public class DefaultLeadPane implements CmsUiProvider { CmsTheme theme = CmsTheme.getCmsTheme(parent); Button button = new Button(parent, SWT.PUSH); CmsUiUtils.style(button, SuiteStyle.leadPane); - button.setImage(icon.getBigIcon(theme)); + if (icon != null) + button.setImage(icon.getBigIcon(theme)); button.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, true, false)); // button.setToolTipText(msg.lead()); - Label lbl = new Label(parent, SWT.NONE); - CmsUiUtils.style(lbl, SuiteStyle.leadPane); - lbl.setText(msg.lead()); - lbl.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false)); + if (msg != null) { + Label lbl = new Label(parent, SWT.NONE); + CmsUiUtils.style(lbl, SuiteStyle.leadPane); + lbl.setText(msg.lead()); + lbl.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false)); + } CmsUiUtils.sendEventOnSelect(button, SuiteEvent.switchLayer.topic(), SuiteEvent.LAYER, layer); return button; } @@ -79,4 +102,12 @@ public class DefaultLeadPane implements CmsUiProvider { if (log.isDebugEnabled()) log.debug("Default layers: " + defaultLayers); } + + public void addLayer(SuiteLayer layer, Map properties) { + if (properties.containsKey(Constants.SERVICE_PID)) { + String pid = (String) properties.get(Constants.SERVICE_PID); + RankedObject.putIfHigherRank(layers, pid, layer, properties); + } + } + } diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteApp.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteApp.java index ce6f7f1..44e7d3d 100644 --- a/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteApp.java +++ b/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteApp.java @@ -8,13 +8,16 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.TreeMap; +import java.util.TreeSet; import javax.jcr.Node; import javax.jcr.RepositoryException; import javax.jcr.Session; +import javax.jcr.nodetype.NodeType; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.argeo.api.NodeUtils; import org.argeo.cms.ui.AbstractCmsApp; import org.argeo.cms.ui.CmsTheme; import org.argeo.cms.ui.CmsUiProvider; @@ -22,6 +25,7 @@ import org.argeo.cms.ui.CmsView; import org.argeo.cms.ui.dialogs.CmsFeedback; import org.argeo.cms.ui.util.CmsEvent; import org.argeo.cms.ui.util.CmsUiUtils; +import org.argeo.entity.EntityConstants; import org.argeo.jcr.Jcr; import org.argeo.jcr.JcrUtils; import org.argeo.suite.RankedObject; @@ -47,6 +51,7 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler { private final static String DEFAULT_THEME_ID = "org.argeo.suite.theme.default"; private Map> uiProvidersByPid = Collections.synchronizedMap(new HashMap<>()); + private Map> uiProvidersByType = Collections.synchronizedMap(new HashMap<>()); private Map> layers = Collections.synchronizedSortedMap(new TreeMap<>()); // TODO make more optimal or via CmsSession/CmsView @@ -154,6 +159,35 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler { throw new IllegalArgumentException("No UI provider registered as " + pid); return uiProvidersByPid.get(pid).get(); } + + private CmsUiProvider findUiProvider(Node context) { + try { + Set types = new TreeSet<>(); + for (NodeType nodeType : context.getMixinNodeTypes()) { + String typeName = nodeType.getName(); + if (uiProvidersByType.containsKey(typeName)) { + types.add(typeName); + } + } + NodeType nodeType = context.getPrimaryNodeType(); + String typeName = nodeType.getName(); + if (uiProvidersByType.containsKey(typeName)) { + types.add(typeName); + } +// if (context.getPath().equals("/")) {// root node +// types.add("nt:folder"); +// } + if (NodeUtils.isUserHome(context)) {// home node + types.add("nt:folder"); + } + + if (types.size() == 0) + throw new IllegalArgumentException("No UI provider found for " + context); + return uiProvidersByType.get(types.iterator().next()).get(); + } catch (RepositoryException e) { + throw new IllegalStateException(e); + } + } // private CmsUiProvider findUiProvider(String pid, Node context) { // CmsUiProvider found = null; // if (pid != null) { @@ -248,31 +282,14 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler { */ public void addUiProvider(CmsUiProvider uiProvider, Map properties) { -// RankingKey partKey = new RankingKey(properties); -// if (partKey.getPid() != null || partKey.getDataType() != null) { -// uiProvidersByPid.put(partKey, uiProvider); -// if (log.isDebugEnabled()) -// log.debug("Added UI provider " + partKey + " (" + uiProvider.getClass().getName() + ") to CMS app."); -// } - if (properties.containsKey(Constants.SERVICE_PID)) { String pid = (String) properties.get(Constants.SERVICE_PID); RankedObject.putIfHigherRank(uiProvidersByPid, pid, uiProvider, properties); -// RankedObject rankedObject = new RankedObject<>(uiProvider, properties); -// if (!uiProvidersByPid.containsKey(pid)) { -// uiProvidersByPid.put(pid, rankedObject); -// if (log.isDebugEnabled()) -// log.debug("Added UI provider " + pid + " as " + uiProvider.getClass().getName() + " with rank " -// + rankedObject.getRank()); -// } else { -// RankedObject current = uiProvidersByPid.get(pid); -// if (current.getRank() <= rankedObject.getRank()) { -// uiProvidersByPid.put(pid, rankedObject); -// if (log.isDebugEnabled()) -// log.debug("Replaced UI provider " + pid + " by " + uiProvider.getClass().getName() -// + " with rank " + rankedObject.getRank()); -// } -// } + } + if (properties.containsKey(EntityConstants.TYPE)) { + // TODO manage String arrays as well + String type = (String) properties.get(EntityConstants.TYPE); + RankedObject.putIfHigherRank(uiProvidersByType, type, uiProvider, properties); } } @@ -314,13 +331,19 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler { String currentLayerId = ui.getCurrentLayerId(); SuiteLayer layer = layers.get(currentLayerId).get(); if (isTopic(event, SuiteEvent.refreshPart)) { - Node node = Jcr.getNodeById(ui.getSysSession(), get(event, SuiteEvent.NODE_ID)); - layer.view(ui.getCurrentWorkArea(), node); + String nodeId = get(event, SuiteEvent.NODE_ID); + String workspace = get(event, SuiteEvent.WORKSPACE); + Node node = Jcr.getNodeById(ui.getSession(workspace), nodeId); + CmsUiProvider uiProvider = findUiProvider(node); + layer.view(uiProvider, ui.getCurrentWorkArea(), node); // ui.getTabbedArea().view(findUiProvider(DASHBOARD_PID), node); // ui.layout(true, true); } else if (isTopic(event, SuiteEvent.openNewPart)) { - Node node = Jcr.getNodeById(ui.getSysSession(), get(event, SuiteEvent.NODE_ID)); - layer.open(ui.getCurrentWorkArea(), node); + String nodeId = get(event, SuiteEvent.NODE_ID); + String workspace = get(event, SuiteEvent.WORKSPACE); + Node node = Jcr.getNodeById(ui.getSession(workspace), nodeId); + CmsUiProvider uiProvider = findUiProvider(node); + layer.open(uiProvider, ui.getCurrentWorkArea(), node); // ui.getTabbedArea().open(findUiProvider(DASHBOARD_PID), node); // ui.layout(true, true); } else if (isTopic(event, SuiteEvent.switchLayer)) { diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteEvent.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteEvent.java index cc68d40..36a6ed7 100644 --- a/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteEvent.java +++ b/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteEvent.java @@ -8,6 +8,7 @@ public enum SuiteEvent implements CmsEvent { public final static String LAYER = "layer"; public final static String NODE_ID = "nodeId"; + public final static String WORKSPACE = "workspace"; public String getTopicBase() { return "argeo/suite/ui"; diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteLayer.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteLayer.java index 6770c67..d1fa90d 100644 --- a/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteLayer.java +++ b/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteLayer.java @@ -7,9 +7,13 @@ import org.eclipse.swt.widgets.Composite; /** An UI layer for the main work area. */ public interface SuiteLayer extends CmsUiProvider { - void view(Composite workArea, Node context); + static enum Property { + title,icon; + } + + void view(CmsUiProvider uiProvider, Composite workArea, Node context); - default void open(Composite workArea, Node context) { - view(workArea, context); + default void open(CmsUiProvider uiProvider, Composite workArea, Node context) { + view(uiProvider, workArea, context); } } diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteUi.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteUi.java index c2c3c89..8320f76 100644 --- a/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteUi.java +++ b/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteUi.java @@ -172,4 +172,15 @@ class SuiteUi extends Composite { return sysSession; } + Session getSession(String workspaceName) { + if (workspaceName == null) + return sysSession; + if (NodeConstants.SYS_WORKSPACE.equals(workspaceName)) + return sysSession; + else if (NodeConstants.HOME_WORKSPACE.equals(workspaceName)) + return homeSession; + else + throw new IllegalArgumentException("Unknown workspace " + workspaceName); + } + } diff --git a/sdk/argeo-suite-rap.properties b/sdk/argeo-suite-rap.properties index ef7a063..df068c6 100644 --- a/sdk/argeo-suite-rap.properties +++ b/sdk/argeo-suite-rap.properties @@ -27,7 +27,7 @@ org.osgi.service.http.port=7070 argeo.node.init=../../init -argeo.i18n.locales=en,fr,de,ar +argeo.i18n.locales=en,fr argeo.i18n.defaultLocale=en #tika.config=/home/mbaudier/dev/git/gpl/argeo-suite/sdk/exec/argeo-office-e4-rap/data/indexes/node/tika-config.xml diff --git a/sdk/argeo-suite-rcp.properties b/sdk/argeo-suite-rcp.properties index aff012d..4cc7c87 100644 --- a/sdk/argeo-suite-rcp.properties +++ b/sdk/argeo-suite-rcp.properties @@ -24,7 +24,7 @@ org.osgi.service.http.port=7070 argeo.node.init=../../init -argeo.i18n.locales=en,fr,de,ar +argeo.i18n.locales=en,fr argeo.i18n.defaultLocale=en #tika.config=/home/mbaudier/dev/git/gpl/argeo-suite/sdk/exec/argeo-office-e4-rap/data/indexes/node/tika-config.xml -- 2.30.2