X-Git-Url: https://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=blobdiff_plain;f=org.argeo.suite.web%2Fsrc%2Forg%2Fargeo%2Fsuite%2Fweb%2FDefaultMainPage.java;h=3adbc294bdb4b64ecd2572e2911c65e9d6977bd4;hp=d1ecbf272373c88a724529b1d3fb17fc77bd3253;hb=b1e6589f948b00272ba99f4fd5e7326fd72651ef;hpb=0887c47a0a7086f298401cb331462fc0444db41c diff --git a/org.argeo.suite.web/src/org/argeo/suite/web/DefaultMainPage.java b/org.argeo.suite.web/src/org/argeo/suite/web/DefaultMainPage.java index d1ecbf2..3adbc29 100644 --- a/org.argeo.suite.web/src/org/argeo/suite/web/DefaultMainPage.java +++ b/org.argeo.suite.web/src/org/argeo/suite/web/DefaultMainPage.java @@ -11,17 +11,18 @@ import javax.jcr.nodetype.NodeType; import org.argeo.cms.CmsMsg; import org.argeo.cms.auth.CurrentUser; -import org.argeo.cms.text.TextStyles; import org.argeo.cms.ui.CmsUiProvider; import org.argeo.cms.ui.CmsView; import org.argeo.cms.ui.LifeCycleUiProvider; import org.argeo.cms.util.CmsUtils; import org.argeo.cms.widgets.auth.CmsLogin; -import org.argeo.connect.people.PeopleService; -import org.argeo.connect.people.PeopleTypes; -import org.argeo.connect.people.web.pages.PeopleDefaultPage; +import org.argeo.connect.ConnectTypes; +import org.argeo.connect.resources.ResourcesService; import org.argeo.eclipse.ui.EclipseUiUtils; -import org.argeo.suite.fs.MyFilesBrowserPage; +import org.argeo.people.PeopleService; +import org.argeo.people.PeopleTypes; +import org.argeo.people.web.pages.PeopleDefaultPage; +import org.argeo.suite.web.fs.MyFilesBrowserPage; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; @@ -32,8 +33,8 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; /** - * Default entry point for the Argeo Suite CMS. Forwards the request to the relevant - * CmsUiProvider + * Default entry point for the Argeo Suite CMS. Forwards the request to the + * relevant CmsUiProvider */ public class DefaultMainPage implements LifeCycleUiProvider { @@ -42,6 +43,7 @@ public class DefaultMainPage implements LifeCycleUiProvider { private CmsUiProvider fsBrowserPage; /* DEPENDENCY INJECTION */ + private ResourcesService resourcesService; private PeopleService peopleService; private FileSystemProvider nodeFileSystemProvider; private Map peopleIconPaths; @@ -51,8 +53,8 @@ public class DefaultMainPage implements LifeCycleUiProvider { @Override public void init(Session adminSession) throws RepositoryException { - dashboardPage = new DefaultDashboard(peopleService, peopleIconPaths); - peoplePage = new PeopleDefaultPage(peopleService, peopleIconPaths); + dashboardPage = new DefaultDashboard(resourcesService, peopleService, peopleIconPaths); + peoplePage = new PeopleDefaultPage(resourcesService, peopleService, peopleIconPaths); fsBrowserPage = new MyFilesBrowserPage(nodeFileSystemProvider); } @@ -61,9 +63,9 @@ public class DefaultMainPage implements LifeCycleUiProvider { if (CurrentUser.isAnonymous()) return createAnonymousUi(parent, context); - if (context.isNodeType(PeopleTypes.PEOPLE_ENTITY)) + if (context.isNodeType(ConnectTypes.CONNECT_ENTITY)) return peoplePage.createUi(parent, context); - else if (peopleService.getBasePath(null).equals(context.getPath())) + else if (("/"+peopleService.getBaseRelPath(PeopleTypes.PEOPLE_PERSON)).equals(context.getPath())) return peoplePage.createUi(parent, context); else if (context.isNodeType(NodeType.NT_FOLDER) || context.isNodeType(NodeType.NT_FILE)) return fsBrowserPage.createUi(parent, context); @@ -89,7 +91,7 @@ public class DefaultMainPage implements LifeCycleUiProvider { Label anonymousLbl = new Label(body, SWT.WRAP); anonymousLbl.setText("You should login or register to access your private dashboard"); - + return body; } @@ -122,6 +124,10 @@ public class DefaultMainPage implements LifeCycleUiProvider { } /* DEPENDENCY INJECTION */ + public void setResourcesService(ResourcesService resourcesService) { + this.resourcesService = resourcesService; + } + public void setPeopleService(PeopleService peopleService) { this.peopleService = peopleService; }