PortalWorkspaces können jetzt über /ccm/admin angelegt werden.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2286 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
6bf4288e69
commit
bd835ca5fc
|
|
@ -130,3 +130,4 @@ ui.admin.applications.ApplicationInfoSection.desc.label=Description
|
|||
ui.admin.applications.no_settings=This application has no settings (yet).
|
||||
ui.admin.applications.form_not_compatible_now=This application administration form is not yet compatible with this application pane. Please use the applications own administration form.
|
||||
ui.admin.applications.ApplicationInstancePane.manage.heading=Instance specific settings
|
||||
ui.admin.applications.parent.label=Select parent application
|
||||
|
|
|
|||
|
|
@ -130,3 +130,4 @@ ui.admin.applications.ApplicationInfoSection.desc.label=Beschreibung
|
|||
ui.admin.applications.no_settings=Diese Applikation hat (noch) keine Einstellungen.
|
||||
ui.admin.applications.form_not_compatible_now=Das Formular zur Verwaltung dieser Application ist derzeit noch nicht kompatibel mit dieser Administrationsoberfl\u00e4che. Bitte nutzen Sie den Administrationsoberfl\u00e4che der Application.
|
||||
ui.admin.applications.ApplicationInstancePane.manage.heading=Einstellungen der Instanz
|
||||
ui.admin.applications.parent.label=W\u00e4hlen Sie die \u00fcbergeordnete Applikation
|
||||
|
|
|
|||
|
|
@ -130,3 +130,4 @@ ui.admin.applications.ApplicationInfoSection.desc.label=
|
|||
ui.admin.applications.no_settings=
|
||||
ui.admin.applications.form_not_compatible_now=
|
||||
ui.admin.applications.ApplicationInstancePane.manage.heading=
|
||||
ui.admin.applications.parent.label=
|
||||
|
|
|
|||
|
|
@ -116,3 +116,4 @@ ui.admin.applications.ApplicationInfoSection.desc.label=
|
|||
ui.admin.applications.no_settings=
|
||||
ui.admin.applications.form_not_compatible_now=
|
||||
ui.admin.applications.ApplicationInstancePane.manage.heading=
|
||||
ui.admin.applications.parent.label=
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@
|
|||
*/
|
||||
package com.arsdigita.ui.admin.applications;
|
||||
|
||||
import com.arsdigita.bebop.BoxPanel;
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Container;
|
||||
import com.arsdigita.bebop.Form;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
|
|
@ -46,22 +49,25 @@ import com.arsdigita.util.UncheckedWrapperException;
|
|||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.web.ApplicationCollection;
|
||||
import com.arsdigita.web.ApplicationType;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.TooManyListenersException;
|
||||
|
||||
/**
|
||||
* Basic form for creating new Application instances. Should be suitable for
|
||||
* most applications types. If you have special needs... $todo
|
||||
* Basic form for creating new Application instances. Should be suitable for most applications types. If you have
|
||||
* special needs... $todo
|
||||
*
|
||||
* This form does not support parent/child application structures. If
|
||||
* your app needs this, add a widget for selecting the parent application
|
||||
* and extend the process method.
|
||||
* This form does not support parent/child application structures. If your app needs this, add a widget for selecting
|
||||
* the parent application and extend the process method.
|
||||
*
|
||||
* @param <T> Type of application
|
||||
*
|
||||
* @author Jens Pelzetter <jens@jp-digital.de>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ApplicationCreateForm<T extends Application> extends Form {
|
||||
public class ApplicationCreateForm<T extends Application> extends Form implements FormSubmissionListener,
|
||||
FormValidationListener,
|
||||
FormProcessListener {
|
||||
|
||||
public static final String FORM_NAME = "ApplicationCreateForm";
|
||||
private static final String PARENT_APP = "parentAll";
|
||||
|
|
@ -74,6 +80,7 @@ public class ApplicationCreateForm<T extends Application> extends Form {
|
|||
private final TextField applicationUrl;
|
||||
private final TextField applicationTitle;
|
||||
private final TextArea applicationDesc;
|
||||
private final Container widgetSection;
|
||||
private final SaveCancelSection saveCancelSection;
|
||||
|
||||
public ApplicationCreateForm(final Class<T> appClass, final boolean allowRoot) {
|
||||
|
|
@ -95,6 +102,9 @@ public class ApplicationCreateForm<T extends Application> extends Form {
|
|||
applicationType = (ApplicationType) DomainObjectFactory.newInstance(appTypes.getDataObject());
|
||||
appTypes.close();
|
||||
|
||||
widgetSection = new BoxPanel(BoxPanel.VERTICAL);
|
||||
add(widgetSection);
|
||||
|
||||
parentApp = new SingleSelect(PARENT_APP);
|
||||
try {
|
||||
parentApp.addPrintListener(new PrintListener() {
|
||||
|
|
@ -103,12 +113,12 @@ public class ApplicationCreateForm<T extends Application> extends Form {
|
|||
target.addOption(new Option("", ""));
|
||||
|
||||
final ApplicationCollection applications = Application.retrieveAllApplications();
|
||||
applications.addOrder(Application.PRIMARY_URL);
|
||||
while (applications.next()) {
|
||||
target.addOption(new Option(applications.getApplication().getPath(),
|
||||
applications.getApplication().getPath()));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (!allowRoot) {
|
||||
|
|
@ -140,105 +150,111 @@ public class ApplicationCreateForm<T extends Application> extends Form {
|
|||
applicationDesc.addValidationListener(new StringInRangeValidationListener(0, 4000, GlobalizationUtil.globalize(
|
||||
"ui.admin.applications.desc.valiation.minmaxlength")));
|
||||
|
||||
add(new Label(GlobalizationUtil.globalize("ui.admin.applications.parent.label")));
|
||||
add(parentApp);
|
||||
add(new Label(GlobalizationUtil.globalize("ui.admin.applications.url.label")));
|
||||
add(applicationUrl);
|
||||
add(new Label(GlobalizationUtil.globalize("ui.admin.applications.title.label")));
|
||||
add(applicationTitle);
|
||||
add(new Label(GlobalizationUtil.globalize("ui.admin.applications.desc.label")));
|
||||
add(applicationDesc);
|
||||
widgetSection.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.parent.label")));
|
||||
widgetSection.add(parentApp);
|
||||
widgetSection.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.url.label")));
|
||||
widgetSection.add(applicationUrl);
|
||||
widgetSection.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.title.label")));
|
||||
widgetSection.add(applicationTitle);
|
||||
widgetSection.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.desc.label")));
|
||||
widgetSection.add(applicationDesc);
|
||||
|
||||
saveCancelSection = new SaveCancelSection();
|
||||
add(saveCancelSection);
|
||||
|
||||
addValidationListener(new ValidationListener());
|
||||
addSubmissionListener(new SubmissionListener());
|
||||
addProcessListener(new ProcessListener());
|
||||
addValidationListener(this);
|
||||
addSubmissionListener(this);
|
||||
addProcessListener(this);
|
||||
}
|
||||
|
||||
protected Container getWidgetSection() {
|
||||
return widgetSection;
|
||||
}
|
||||
|
||||
public String getAppClassName() {
|
||||
return appClassName;
|
||||
}
|
||||
|
||||
private class SubmissionListener implements FormSubmissionListener {
|
||||
|
||||
public void submitted(final FormSectionEvent event) throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
|
||||
if (saveCancelSection.getCancelButton().isSelected(state)) {
|
||||
parentApp.setValue(state, "");
|
||||
applicationTitle.setValue(state, "");
|
||||
applicationUrl.setValue(state, "");
|
||||
applicationDesc.setValue(state, "");
|
||||
|
||||
throw new FormProcessException("Canceled");
|
||||
}
|
||||
}
|
||||
|
||||
protected SingleSelect getParentApp() {
|
||||
return parentApp;
|
||||
}
|
||||
|
||||
private class ProcessListener implements FormProcessListener {
|
||||
protected TextField getApplicationUrl() {
|
||||
return applicationUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new application instance using the provided data.
|
||||
*
|
||||
* @param event
|
||||
* @throws FormProcessException
|
||||
*/
|
||||
public void process(final FormSectionEvent event) throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
protected TextField getApplicationTitle() {
|
||||
return applicationTitle;
|
||||
}
|
||||
|
||||
if (saveCancelSection.getSaveButton().isSelected(state)) {
|
||||
Application parent;
|
||||
boolean createContainerGroup;
|
||||
protected TextArea getApplicationDesc() {
|
||||
return applicationDesc;
|
||||
}
|
||||
|
||||
final String parentPath = (String) parentApp.getValue(state);
|
||||
if ((parentPath == null) && parentPath.isEmpty()) {
|
||||
protected SaveCancelSection getSaveCancelSection() {
|
||||
return saveCancelSection;
|
||||
}
|
||||
|
||||
public void process(final FormSectionEvent event) throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
|
||||
if (saveCancelSection.getSaveButton().isSelected(state)) {
|
||||
Application parent;
|
||||
boolean createContainerGroup;
|
||||
|
||||
final String parentPath = (String) parentApp.getValue(state);
|
||||
if ((parentPath == null) || parentPath.isEmpty()) {
|
||||
parent = null;
|
||||
createContainerGroup = false;
|
||||
} else {
|
||||
final ApplicationCollection applications = Application.retrieveAllApplications();
|
||||
applications.addEqualsFilter(Application.PRIMARY_URL, parentPath + "/");
|
||||
if (applications.next()) {
|
||||
parent = applications.getApplication();
|
||||
createContainerGroup = true;
|
||||
} else {
|
||||
parent = null;
|
||||
createContainerGroup = false;
|
||||
} else {
|
||||
final ApplicationCollection applications = Application.retrieveAllApplications();
|
||||
applications.addEqualsFilter(Application.PRIMARY_URL, parentPath + "/");
|
||||
if (applications.next()) {
|
||||
parent = applications.getApplication();
|
||||
createContainerGroup = true;
|
||||
} else {
|
||||
parent = null;
|
||||
createContainerGroup = false;
|
||||
}
|
||||
applications.close();
|
||||
}
|
||||
|
||||
final Application application = Application.createApplication(applicationType,
|
||||
(String) applicationUrl.getValue(state),
|
||||
(String) applicationTitle.getValue(state),
|
||||
parent,
|
||||
createContainerGroup);
|
||||
application.setDescription((String) applicationDesc.getValue(state));
|
||||
application.save();
|
||||
applications.close();
|
||||
}
|
||||
}
|
||||
|
||||
final Application application = Application.createApplication(applicationType,
|
||||
(String) applicationUrl.getValue(state),
|
||||
(String) applicationTitle.getValue(state),
|
||||
parent,
|
||||
createContainerGroup);
|
||||
application.setDescription((String) applicationDesc.getValue(state));
|
||||
application.save();
|
||||
}
|
||||
}
|
||||
|
||||
private class ValidationListener implements FormValidationListener {
|
||||
public void submitted(final FormSectionEvent event) throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
|
||||
public void validate(final FormSectionEvent event) throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
if (saveCancelSection.getCancelButton().isSelected(state)) {
|
||||
parentApp.setValue(state, "");
|
||||
applicationTitle.setValue(state, "");
|
||||
applicationUrl.setValue(state, "");
|
||||
applicationDesc.setValue(state, "");
|
||||
|
||||
final String url = (String) applicationUrl.getValue(state);
|
||||
throw new FormProcessException("Canceled");
|
||||
}
|
||||
}
|
||||
|
||||
if (url.contains("/")) {
|
||||
throw new FormProcessException((String) GlobalizationUtil.globalize(
|
||||
"ui.admin.applications.url.validation.no_slash_allowed").localize());
|
||||
}
|
||||
public void validate(final FormSectionEvent event) throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
|
||||
if (Application.isInstalled(Application.BASE_DATA_OBJECT_TYPE, url)) {
|
||||
throw new FormProcessException((String) GlobalizationUtil.globalize(
|
||||
"ui.admin.applications.url.validation.url_already_in_use").localize());
|
||||
}
|
||||
final String url = (String) applicationUrl.getValue(state);
|
||||
|
||||
if (url.contains("/")) {
|
||||
throw new FormProcessException((String) GlobalizationUtil.globalize(
|
||||
"ui.admin.applications.url.validation.no_slash_allowed").localize());
|
||||
}
|
||||
|
||||
if (Application.isInstalled(Application.BASE_DATA_OBJECT_TYPE, url)) {
|
||||
throw new FormProcessException((String) GlobalizationUtil.globalize(
|
||||
"ui.admin.applications.url.validation.url_already_in_use").localize());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@ public class ForumApplicationManager extends AbstractApplicationManager<Forum> {
|
|||
|
||||
final BoxPanel panel = new BoxPanel();
|
||||
panel.add(
|
||||
new Label(new GlobalizedMessage("forum.ui.admin.no_settings", "com.arsdigita.forum.ui.ForumResources")));
|
||||
new Label(new GlobalizedMessage("forum.ui.admin.no_settings",
|
||||
"com.arsdigita.forum.ui.ForumResources")));
|
||||
|
||||
container.add(panel);
|
||||
|
||||
|
|
@ -50,5 +51,4 @@ public class ForumApplicationManager extends AbstractApplicationManager<Forum> {
|
|||
public boolean allowRoot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ import com.arsdigita.runtime.CompoundInitializer;
|
|||
import com.arsdigita.runtime.DomainInitEvent;
|
||||
import com.arsdigita.runtime.PDLInitializer;
|
||||
import com.arsdigita.runtime.RuntimeConfig;
|
||||
import com.arsdigita.ui.admin.ApplicationManagers;
|
||||
import com.arsdigita.xml.XML;
|
||||
|
||||
|
||||
|
|
@ -270,5 +271,8 @@ public class Initializer extends CompoundInitializer {
|
|||
// now moved to navigation ??
|
||||
// ApplicationNavigationModel.register(Workspace.class.getName(),
|
||||
// new DefaultNavigationModel());
|
||||
|
||||
//Register application manager used for creating the admin form in /ccm/admin
|
||||
ApplicationManagers.register(new WorkspaceApplicationManager());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.portalworkspace;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
|
|
@ -56,44 +55,47 @@ import java.util.LinkedList;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* Class <b>Workspace</b> is the main domain class (extending Application)
|
||||
* for the portalworkspace module.
|
||||
* Class <b>Workspace</b> is the main domain class (extending Application) for the portalworkspace module.
|
||||
*
|
||||
* A (portal)workspace represents an area containing 0...n portals each arranged
|
||||
* as a pane of page. Each portal (or pane) manages a number of portlets. So a
|
||||
* workspace is a container for a set of portal panes.
|
||||
* A (portal)workspace represents an area containing 0...n portals each arranged as a pane of page. Each portal (or
|
||||
* pane) manages a number of portlets. So a workspace is a container for a set of portal panes.
|
||||
*
|
||||
*/
|
||||
public class Workspace extends Application {
|
||||
|
||||
/** Private logger instance for debugging purpose */
|
||||
/**
|
||||
* Private logger instance for debugging purpose
|
||||
*/
|
||||
private static final Logger s_log = Logger.getLogger(Workspace.class);
|
||||
|
||||
/** Config object containing various parameter */
|
||||
/**
|
||||
* Config object containing various parameter
|
||||
*/
|
||||
private static final WorkspaceConfig s_config = WorkspaceConfig.getConfig();
|
||||
|
||||
/** Service method to provide client classes access to configuration. */
|
||||
/**
|
||||
* Service method to provide client classes access to configuration.
|
||||
*/
|
||||
public static WorkspaceConfig getConfig() {
|
||||
return s_config;
|
||||
}
|
||||
/** PDL stuff */
|
||||
/**
|
||||
* PDL stuff
|
||||
*/
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.portalworkspace.Workspace";
|
||||
public static final String PARTY = "party";
|
||||
public static final String PARTY_ID = PARTY + "." + ACSObject.ID;
|
||||
public static final String DEFAULT_LAYOUT = "defaultLayout";
|
||||
public static final String PAGES = "pages";
|
||||
|
||||
/**
|
||||
* store this as a static variable as it cannot change during the lifetime
|
||||
* of the ccm service
|
||||
* store this as a static variable as it cannot change during the lifetime of the ccm service
|
||||
*/
|
||||
private static Workspace defaultHomepageWorkspace = null;
|
||||
|
||||
/**
|
||||
* Constructor retrieves the domain object using its DataObject representation
|
||||
*
|
||||
* @param obj
|
||||
*/
|
||||
public Workspace(DataObject obj) {
|
||||
|
|
@ -102,6 +104,7 @@ public class Workspace extends Application {
|
|||
|
||||
/**
|
||||
* Constructor, retrieves the workspace from database using its OID
|
||||
*
|
||||
* @param oid
|
||||
* @throws com.arsdigita.domain.DataObjectNotFoundException
|
||||
*/
|
||||
|
|
@ -112,35 +115,32 @@ public class Workspace extends Application {
|
|||
/*
|
||||
* public String getContextPath() { return "ccm-portalworkspace"; }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns the path name of the location of the applications servlet/JSP.
|
||||
*
|
||||
* The method overwrites the super class to provide an application specific
|
||||
* location for servlets/JSP. This is necessary if you whish to install the
|
||||
* module (application) along with others in one context. If you install the
|
||||
* module into its own context (no longer recommended for versions newer
|
||||
* than 1.0.4) you may use a standard location.
|
||||
* The method overwrites the super class to provide an application specific location for servlets/JSP. This is
|
||||
* necessary if you whish to install the module (application) along with others in one context. If you install the
|
||||
* module into its own context (no longer recommended for versions newer than 1.0.4) you may use a standard
|
||||
* location.
|
||||
*
|
||||
* Usually it is a symbolic name/path, which will be mapped in the web.xml
|
||||
* to the real location in the file system. Example:
|
||||
* Usually it is a symbolic name/path, which will be mapped in the web.xml to the real location in the file system.
|
||||
* Example:
|
||||
* <servlet>
|
||||
* <servlet-name>portalworkspace-files</servlet-name>
|
||||
* <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||
* <init-param>
|
||||
* <param-name>template-path</param-name>
|
||||
* <param-value>/templates/ccm-portalworkspace</param-value>
|
||||
* </init-param>
|
||||
* <servlet-name>portalworkspace-files</servlet-name>
|
||||
* <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||
* <init-param>
|
||||
* <param-name>template-path</param-name>
|
||||
* <param-value>/templates/ccm-portalworkspace</param-value>
|
||||
* </init-param>
|
||||
* </servlet>
|
||||
*
|
||||
* <servlet-mapping>
|
||||
* <servlet-name>portalworkspace-files</servlet-name>
|
||||
* <url-pattern>/ccm-portalworkspace/files/*</url-pattern>
|
||||
* <servlet-name>portalworkspace-files</servlet-name>
|
||||
* <url-pattern>/ccm-portalworkspace/files/*</url-pattern>
|
||||
* </servlet-mapping>
|
||||
*
|
||||
* @return path name to the applications servlet/JSP
|
||||
* @return ServletPath (constant) probably should be synchron with web.xml
|
||||
* entry
|
||||
* @return ServletPath (constant) probably should be synchron with web.xml entry
|
||||
*/
|
||||
@Override
|
||||
public String getServletPath() {
|
||||
|
|
@ -149,15 +149,15 @@ public class Workspace extends Application {
|
|||
}
|
||||
|
||||
/**
|
||||
* Wrapper class to create a new workspace using a limited set of parameters,
|
||||
* here: page layout is set to default layout.
|
||||
* Wrapper class to create a new workspace using a limited set of parameters, here: page layout is set to default
|
||||
* layout.
|
||||
*
|
||||
* NOTE: Parameter isPublic may be a misnomer, the actual usage of it in the
|
||||
* process of application creation uses it as createGroupContainer
|
||||
* NOTE: Parameter isPublic may be a misnomer, the actual usage of it in the process of application creation uses it
|
||||
* as createGroupContainer
|
||||
*
|
||||
* @param url
|
||||
* @param title
|
||||
* @param parent parent application
|
||||
* @param parent parent application
|
||||
* @param isPublic
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -168,12 +168,12 @@ public class Workspace extends Application {
|
|||
}
|
||||
|
||||
/**
|
||||
* Wrapper class to create a new workspace using a limited set of parameters,
|
||||
* here: page layout is set to default layout.
|
||||
* Wrapper class to create a new workspace using a limited set of parameters, here: page layout is set to default
|
||||
* layout.
|
||||
*
|
||||
* @param url
|
||||
* @param title
|
||||
* @param parent parent application
|
||||
* @param parent parent application
|
||||
* @param owner
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -184,11 +184,10 @@ public class Workspace extends Application {
|
|||
}
|
||||
|
||||
/**
|
||||
* Does the real work to create a workspace as a legacy compatible
|
||||
* applicationin the storage (db)
|
||||
* Does the real work to create a workspace as a legacy compatible applicationin the storage (db)
|
||||
*
|
||||
* NOTE: Parameter isPublic may be a misnomer, the actual usage of it in the
|
||||
* process of application creation uses it as createGroupContainer
|
||||
* NOTE: Parameter isPublic may be a misnomer, the actual usage of it in the process of application creation uses it
|
||||
* as createGroupContainer
|
||||
*
|
||||
* @param url
|
||||
* @param title
|
||||
|
|
@ -208,23 +207,22 @@ public class Workspace extends Application {
|
|||
}
|
||||
|
||||
Workspace workspace = (Workspace) Application.createApplication(
|
||||
BASE_DATA_OBJECT_TYPE, url, title, parent);
|
||||
BASE_DATA_OBJECT_TYPE, url, title, parent, true);
|
||||
workspace.setupGroups(title, isPublic);
|
||||
workspace.setDefaultLayout(layout);
|
||||
return workspace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does the real work to create a workspace instance as a
|
||||
* legacy free application in the storage (db)
|
||||
* Does the real work to create a workspace instance as a legacy free application in the storage (db)
|
||||
*
|
||||
*
|
||||
* @param url of the application (last part, its "name")
|
||||
* @param title the application to be created
|
||||
* @param layout layout to use for this instance
|
||||
* @param parent, url of the parent part if any, null otherwise
|
||||
* @param isPublic whether the group that will be created for this instance
|
||||
* should be created with the public user as a member
|
||||
* @param isPublic whether the group that will be created for this instance should be created with the public user
|
||||
* as a member
|
||||
* @return
|
||||
*/
|
||||
public static Workspace createWorkspace(ApplicationType type,
|
||||
|
|
@ -240,13 +238,15 @@ public class Workspace extends Application {
|
|||
+ "and public access is: " + isPublic);
|
||||
}
|
||||
|
||||
if (layout==null) layout = PageLayout.getDefaultLayout();
|
||||
if (layout == null) {
|
||||
layout = PageLayout.getDefaultLayout();
|
||||
}
|
||||
|
||||
/* A container group is always created fo a portal workspace instance. */
|
||||
// MODIFIED
|
||||
/* A container group is NOT created fo a portal workspace instance here. */
|
||||
Workspace workspace = (Workspace) Application.createApplication(
|
||||
type, url, title, parent, true );
|
||||
type, url, title, parent, true);
|
||||
workspace.setupGroups(title, isPublic);
|
||||
workspace.setDefaultLayout(layout);
|
||||
return workspace;
|
||||
|
|
@ -279,13 +279,11 @@ public class Workspace extends Application {
|
|||
}
|
||||
|
||||
/**
|
||||
* Retrieve the workspace that is created during loading of the
|
||||
* ccm-portalworkspace application and is set as the defaultworkspace
|
||||
* for the site.
|
||||
* Retrieve the workspace that is created during loading of the ccm-portalworkspace application and is set as the
|
||||
* defaultworkspace for the site.
|
||||
*
|
||||
* Returns null if there are no workspaces (though presumably if that is the
|
||||
* case, ccm-portalworkspace hasn't been loaded and so I don't know how you
|
||||
* are invoking this method!)
|
||||
* Returns null if there are no workspaces (though presumably if that is the case, ccm-portalworkspace hasn't been
|
||||
* loaded and so I don't know how you are invoking this method!)
|
||||
*
|
||||
* @return default workspace instance (created during load)
|
||||
*/
|
||||
|
|
@ -404,7 +402,7 @@ public class Workspace extends Application {
|
|||
// own groups so doesn't need a hierarchy and (b) hierarchy would
|
||||
// mean for a given workspace, role would be on the same level
|
||||
// as member groups of sub workspaces - messy & confusing
|
||||
// getApplicationType().getGroup().addSubgroup(members);
|
||||
// getApplicationType().getGroup().addSubgroup(members);
|
||||
|
||||
Role admins = members.createRole("Administrators");
|
||||
admins.save();
|
||||
|
|
@ -424,9 +422,9 @@ public class Workspace extends Application {
|
|||
members.save();
|
||||
}
|
||||
|
||||
// getApplicationType().getGroup().addSubgroup(members);
|
||||
// getApplicationType().getGroup().addSubgroup(members);
|
||||
Group container = getGroup(); // Application.getGroup(): get group
|
||||
// associated with this application
|
||||
// associated with this application
|
||||
container.addSubgroup(members);
|
||||
container.save();
|
||||
|
||||
|
|
@ -463,7 +461,7 @@ public class Workspace extends Application {
|
|||
throws DataObjectNotFoundException {
|
||||
|
||||
DataCollection wks = SessionManager.getSession()
|
||||
.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||
.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||
|
||||
wks.addEqualsFilter("parentResource.id", getID());
|
||||
wks.addEqualsFilter(PARTY_ID, owner.getID());
|
||||
|
|
@ -556,7 +554,9 @@ public class Workspace extends Application {
|
|||
group.save();
|
||||
}
|
||||
|
||||
/** Participants are the members of the Party group. */
|
||||
/**
|
||||
* Participants are the members of the Party group.
|
||||
*/
|
||||
public PartyCollection getParticipants() {
|
||||
Party party = getParty();
|
||||
|
||||
|
|
@ -573,24 +573,21 @@ public class Workspace extends Application {
|
|||
"com.arsdigita.kernel.User");
|
||||
// .retrieve("com.arsdigita.kernel.Party");
|
||||
Filter f = dc.addNotInSubqueryFilter(
|
||||
"id",
|
||||
"com.arsdigita.portalworkspace.WorkspaceParticipantIDs");
|
||||
"id",
|
||||
"com.arsdigita.portalworkspace.WorkspaceParticipantIDs");
|
||||
f.set("workspaceID", getID());
|
||||
return new PartyCollection(dc);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Get a list of all the distinct "initials" of participants in
|
||||
* a Portal Site.</p>
|
||||
* <p>Get a list of all the distinct "initials" of participants in a Portal Site.</p>
|
||||
*
|
||||
* <p>A participant's initial is defined as the first letter of
|
||||
* their family name when the participant is a user (i.e. a
|
||||
* person), and the first letter of the group name if the
|
||||
* participant is a group.</p>
|
||||
* <p>A participant's initial is defined as the first letter of their family name when the participant is a user
|
||||
* (i.e. a person), and the first letter of the group name if the participant is a group.</p>
|
||||
*
|
||||
* <p>The returned Iterator contains the initials in increasing
|
||||
* alphabetical order.</p>
|
||||
**/
|
||||
* <p>The returned Iterator contains the initials in increasing alphabetical order.</p>
|
||||
*
|
||||
*/
|
||||
public Iterator getParticipantInitials() {
|
||||
DataQuery query = SessionManager.getSession().retrieveQuery(
|
||||
"com.arsdigita.portalworkspace.WorkspaceParticipantInitials");
|
||||
|
|
@ -605,13 +602,12 @@ public class Workspace extends Application {
|
|||
}
|
||||
|
||||
/**
|
||||
* <p>Get a collection of all participants in the Workspace whose
|
||||
* initial (see {@link getParticipantInitials
|
||||
* getParticipantInitials} for a definition of a participant's
|
||||
* initial) is the specified value.</p>
|
||||
* <p>Get a collection of all participants in the Workspace whose initial (see {@link getParticipantInitials
|
||||
* getParticipantInitials} for a definition of a participant's initial) is the specified value.</p>
|
||||
*
|
||||
* @param initial Single-character string, must be uppercase
|
||||
**/
|
||||
*
|
||||
*/
|
||||
public PartyCollection getParticipantsWithInitial(String initial) {
|
||||
Assert.exists(initial);
|
||||
Assert.isTrue(initial.length() == 1, "Initial needs length 1");
|
||||
|
|
@ -628,8 +624,8 @@ public class Workspace extends Application {
|
|||
"com.arsdigita.kernel.User");
|
||||
Filter f =
|
||||
dc.addInSubqueryFilter(
|
||||
"id",
|
||||
"com.arsdigita.portalworkspace.WorkspaceParticipantsWithInitial");
|
||||
"id",
|
||||
"com.arsdigita.portalworkspace.WorkspaceParticipantsWithInitial");
|
||||
f.set("workspaceID", getID());
|
||||
f.set("nameInitial", initial);
|
||||
|
||||
|
|
@ -811,7 +807,6 @@ public class Workspace extends Application {
|
|||
group.addMember(owner);
|
||||
workspace.setOwner(owner);
|
||||
new KernelExcursion() {
|
||||
|
||||
public void excurse() {
|
||||
setEffectiveParty(Kernel.getSystemParty());
|
||||
PermissionDescriptor pd = new PermissionDescriptor(
|
||||
|
|
@ -851,7 +846,7 @@ public class Workspace extends Application {
|
|||
|
||||
if (personalWorkspaces.next()) {
|
||||
Workspace workspace = (Workspace) Application
|
||||
.retrieveApplication(personalWorkspaces.
|
||||
.retrieveApplication(personalWorkspaces.
|
||||
getDataObject());
|
||||
if (personalWorkspaces.next()) {
|
||||
s_log.error("more than one personal workspaces for this user!!");
|
||||
|
|
|
|||
|
|
@ -28,3 +28,5 @@ cw.workspace.ui.select_user_or_group_to_add=Select user or group to add:
|
|||
cw.permissions.add_a_privilege=Add a privilege
|
||||
cw.workspace.ui.participant_info=Participant Info
|
||||
cw.workspace.ui.participant_roles=Participant Roles
|
||||
cw.workspace.ui.admin.no_settings=No settings yet
|
||||
cw.workspace.default_layout=Layout
|
||||
|
|
|
|||
|
|
@ -28,3 +28,5 @@ cw.workspace.ui.select_user_or_group_to_add=Select user or group to add:
|
|||
cw.permissions.add_a_privilege=Add a privilege
|
||||
cw.workspace.ui.participant_info=Participant Info
|
||||
cw.workspace.ui.participant_roles=Participant Roles
|
||||
cw.workspace.ui.admin.no_settings=Noch keine Einstellungen
|
||||
cw.workspace.default_layout=Layout
|
||||
|
|
|
|||
|
|
@ -28,3 +28,5 @@ cw.workspace.ui.select_user_or_group_to_add=Select user or group to add:
|
|||
cw.permissions.add_a_privilege=Add a privilege
|
||||
cw.workspace.ui.participant_info=Participant Info
|
||||
cw.workspace.ui.participant_roles=Participant Roles
|
||||
cw.workspace.ui.admin.no_settings=
|
||||
cw.workspace.default_layout=
|
||||
|
|
|
|||
|
|
@ -28,3 +28,5 @@ cw.workspace.ui.select_user_or_group_to_add=Select user or group to add:
|
|||
cw.permissions.add_a_privilege=Add a privilege
|
||||
cw.workspace.ui.participant_info=Participant Info
|
||||
cw.workspace.ui.participant_roles=Participant Roles
|
||||
cw.workspace.ui.admin.no_settings=
|
||||
cw.workspace.default_layout=
|
||||
|
|
|
|||
Loading…
Reference in New Issue