Diverse Formatierungen und Ergänzungen Kommentare / Doku.
git-svn-id: https://svn.libreccm.org/ccm/trunk@888 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
0e77a923bb
commit
751e7716e1
|
|
@ -26,18 +26,20 @@ import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A basic implementation of the {@link Container} interface.
|
* A basic implementation of the {@link Container} interface which, by default,
|
||||||
* <p>By default,
|
* renders all of its children directly, without wrapping them in any kind of
|
||||||
* renders all of its children directly, without wrapping them in any
|
* tag.
|
||||||
* kind of tag.
|
|
||||||
* However, the {@link #SimpleContainer(String, String)} constructor
|
|
||||||
* and/or the {@link #setTag(String)} method can be used to cause the container
|
|
||||||
* to wrap the XML for its children in an arbitrary tag. This functionality
|
|
||||||
* is useful for XSL templating.
|
|
||||||
* For example, a template rule might be
|
|
||||||
* written to arrange the children of this component in paragraphs:
|
|
||||||
*
|
*
|
||||||
* <blockquote><pre><code>// Java Code:
|
* However, the {@link #SimpleContainer(String, String)} constructor and/or the
|
||||||
|
* {@link #setTag(String)} method can be used to cause the container to wrap
|
||||||
|
* the XML for its children in an arbitrary tag. This functionality is useful
|
||||||
|
* for XSL templating.
|
||||||
|
*
|
||||||
|
* For example, a template rule might be written to arrange the children of this
|
||||||
|
* component in paragraphs:
|
||||||
|
*
|
||||||
|
* <blockquote><pre><code>
|
||||||
|
* // Java Code:
|
||||||
* m_container = new SimpleContainer("cms:foo", CMS_XML_NS);
|
* m_container = new SimpleContainer("cms:foo", CMS_XML_NS);
|
||||||
*
|
*
|
||||||
* // XSL code:
|
* // XSL code:
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,14 @@ import com.arsdigita.domain.DomainObject;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link SingleSelectionModel} which loads an item from the
|
* A {@link SingleSelectionModel} which loads an item from the database.
|
||||||
* database. The isSelected() method will return true if it
|
*
|
||||||
* was possible to load the item.
|
* The isSelected() method will return true if it was possible to load the item.
|
||||||
|
*
|
||||||
|
* @version $Id: DomainObjectSelectionModel.java 287 2005-02-22 00:29:02Z sskracic $
|
||||||
*/
|
*/
|
||||||
public interface DomainObjectSelectionModel extends SingleSelectionModel {
|
public interface DomainObjectSelectionModel extends SingleSelectionModel {
|
||||||
|
|
||||||
public static final String versionId = "$Id: DomainObjectSelectionModel.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the item which was selected and loaded from the database,
|
* Return the item which was selected and loaded from the database,
|
||||||
* using the values supplied in PageState.
|
* using the values supplied in PageState.
|
||||||
|
|
@ -38,7 +38,6 @@ public interface DomainObjectSelectionModel extends SingleSelectionModel {
|
||||||
* @param state The page state
|
* @param state The page state
|
||||||
* @return The item domain object, or null if no item is
|
* @return The item domain object, or null if no item is
|
||||||
* selected.
|
* selected.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
DomainObject getSelectedObject(PageState state);
|
DomainObject getSelectedObject(PageState state);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,12 @@ import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Workspace domain class.
|
* Class <b>Workspace</b> is the main domain class (extending Application) for
|
||||||
* A workspace represents an area containing 0...n portals each arranged
|
* the portalworkspace module.
|
||||||
* as a pane of page. Each portal (or pane) manages a number of portlets.
|
*
|
||||||
|
* 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 {
|
public class Workspace extends Application {
|
||||||
|
|
@ -69,11 +72,13 @@ 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);
|
private static final Logger s_log = Logger.getLogger(Workspace.class);
|
||||||
|
|
||||||
|
/** Config object containing various parameter */
|
||||||
private static final WorkspaceConfig s_config = WorkspaceConfig.getConfig();
|
private static final WorkspaceConfig s_config = WorkspaceConfig.getConfig();
|
||||||
|
|
||||||
public static WorkspaceConfig getConfig() {
|
public static WorkspaceConfig getConfig() {
|
||||||
return s_config;
|
return s_config;
|
||||||
}
|
}
|
||||||
|
/** PDL stuff */
|
||||||
public static final String BASE_DATA_OBJECT_TYPE =
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
"com.arsdigita.portalworkspace.Workspace";
|
"com.arsdigita.portalworkspace.Workspace";
|
||||||
public static final String PARTY = "party";
|
public static final String PARTY = "party";
|
||||||
|
|
@ -88,7 +93,7 @@ public class Workspace extends Application {
|
||||||
private static Workspace defaultHomepageWorkspace = null;
|
private static Workspace defaultHomepageWorkspace = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor retrieves the domain object using its DataObject representation
|
||||||
* @param obj
|
* @param obj
|
||||||
*/
|
*/
|
||||||
public Workspace(DataObject obj) {
|
public Workspace(DataObject obj) {
|
||||||
|
|
@ -246,12 +251,12 @@ public class Workspace extends Application {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the workspace that is created during loading of the
|
* Retrieve the workspace that is created during loading of the
|
||||||
* ccm-ldn-portal application and is set as the defaultworkspace for the
|
* ccm-portalworkspace application and is set as the defaultworkspace
|
||||||
* site.
|
* for the site.
|
||||||
*
|
*
|
||||||
* Returns null if there are no workspaces (though presumably if that is the
|
* Returns null if there are no workspaces (though presumably if that is the
|
||||||
* case, ccm-ldn-portal hasn't been loaded and so I don't know how you are
|
* case, ccm-portalworkspace hasn't been loaded and so I don't know how you
|
||||||
* invoking this method!)
|
* are invoking this method!)
|
||||||
*
|
*
|
||||||
* @return default workspace instance (created during load)
|
* @return default workspace instance (created during load)
|
||||||
*/
|
*/
|
||||||
|
|
@ -280,6 +285,9 @@ public class Workspace extends Application {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void beforeSave() {
|
public void beforeSave() {
|
||||||
// If no permissions are configured, then setup empty groups
|
// If no permissions are configured, then setup empty groups
|
||||||
|
|
@ -346,6 +354,11 @@ public class Workspace extends Application {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param title
|
||||||
|
* @param isPublic
|
||||||
|
*/
|
||||||
private void setupGroups(String title, boolean isPublic) {
|
private void setupGroups(String title, boolean isPublic) {
|
||||||
Group members = new Group();
|
Group members = new Group();
|
||||||
members.setName(title);
|
members.setName(title);
|
||||||
|
|
@ -380,10 +393,19 @@ public class Workspace extends Application {
|
||||||
setParty(members);
|
setParty(members);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static WorkspaceCollection retrieveAll() {
|
public static WorkspaceCollection retrieveAll() {
|
||||||
return retrieveAll(null);
|
return retrieveAll(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param parent
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static WorkspaceCollection retrieveAll(Application parent) {
|
public static WorkspaceCollection retrieveAll(Application parent) {
|
||||||
DataCollection wks = SessionManager.getSession().retrieve(
|
DataCollection wks = SessionManager.getSession().retrieve(
|
||||||
BASE_DATA_OBJECT_TYPE);
|
BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
@ -394,11 +416,14 @@ public class Workspace extends Application {
|
||||||
return new WorkspaceCollection(wks);
|
return new WorkspaceCollection(wks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public Workspace retrieveSubworkspaceForParty(Party owner)
|
public Workspace retrieveSubworkspaceForParty(Party owner)
|
||||||
throws DataObjectNotFoundException {
|
throws DataObjectNotFoundException {
|
||||||
|
|
||||||
DataCollection wks = SessionManager.getSession().retrieve(
|
DataCollection wks = SessionManager.getSession()
|
||||||
BASE_DATA_OBJECT_TYPE);
|
.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
||||||
wks.addEqualsFilter("parentResource.id", getID());
|
wks.addEqualsFilter("parentResource.id", getID());
|
||||||
wks.addEqualsFilter(PARTY_ID, owner.getID());
|
wks.addEqualsFilter(PARTY_ID, owner.getID());
|
||||||
|
|
@ -741,6 +766,11 @@ public class Workspace extends Application {
|
||||||
return (User) get("owner");
|
return (User) get("owner");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param owner
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static Workspace createPersonalWorkspace(final User owner) {
|
public static Workspace createPersonalWorkspace(final User owner) {
|
||||||
|
|
||||||
s_log.debug("creating the personal portal for "
|
s_log.debug("creating the personal portal for "
|
||||||
|
|
@ -786,6 +816,11 @@ public class Workspace extends Application {
|
||||||
return workspace;
|
return workspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param owner
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static Workspace retrievePersonalWorkspace(User owner) {
|
public static Workspace retrievePersonalWorkspace(User owner) {
|
||||||
DataCollection personalWorkspaces = SessionManager.getSession().retrieve(
|
DataCollection personalWorkspaces = SessionManager.getSession().retrieve(
|
||||||
BASE_DATA_OBJECT_TYPE);
|
BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -21,6 +24,10 @@ import com.arsdigita.bebop.SimpleContainer;
|
||||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||||
import com.arsdigita.portalworkspace.Workspace;
|
import com.arsdigita.portalworkspace.Workspace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
||||||
|
|
||||||
private WorkspaceSelectionModel m_workspace;
|
private WorkspaceSelectionModel m_workspace;
|
||||||
|
|
@ -33,22 +40,30 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
||||||
|
|
||||||
private PersistentPortal m_portalDisplay;
|
private PersistentPortal m_portalDisplay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default constructor creates a new, empty
|
||||||
|
* <code>AbstractWorkspaceComponent</code> using parents (SimpleContainer)
|
||||||
|
* default constructor.
|
||||||
|
*/
|
||||||
public AbstractWorkspaceComponent() {
|
public AbstractWorkspaceComponent() {
|
||||||
this(null);
|
this(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param workspace
|
||||||
|
*/
|
||||||
public AbstractWorkspaceComponent(WorkspaceSelectionModel workspace) {
|
public AbstractWorkspaceComponent(WorkspaceSelectionModel workspace) {
|
||||||
|
|
||||||
|
/* Creates a WorkspaceComponent (SimpleContainer) that will wrap its
|
||||||
|
* children in the specified tag. */
|
||||||
super("portal:workspace", PortalConstants.PORTAL_XML_NS);
|
super("portal:workspace", PortalConstants.PORTAL_XML_NS);
|
||||||
|
|
||||||
m_workspace = workspace;
|
m_workspace = workspace;
|
||||||
|
|
||||||
m_details = new WorkspaceDetails(m_workspace);
|
m_details = new WorkspaceDetails(m_workspace);
|
||||||
|
|
||||||
m_portal = new DefaultPortalSelectionModel(new BigDecimalParameter(
|
m_portal = new DefaultPortalSelectionModel(new BigDecimalParameter(
|
||||||
"portal"));
|
"portal"));
|
||||||
|
|
||||||
m_portalList = createPortalList(m_portal);
|
m_portalList = createPortalList(m_portal);
|
||||||
|
|
||||||
m_portalDisplay = createPortalDisplay(m_portal);
|
m_portalDisplay = createPortalDisplay(m_portal);
|
||||||
|
|
||||||
add(m_details);
|
add(m_details);
|
||||||
|
|
@ -56,6 +71,9 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
||||||
add(m_portalDisplay);
|
add(m_portalDisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
|
public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
|
||||||
m_workspace = workspace;
|
m_workspace = workspace;
|
||||||
m_details.setWorkspaceModel(workspace);
|
m_details.setWorkspaceModel(workspace);
|
||||||
|
|
@ -67,15 +85,31 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
||||||
return m_workspace.getSelectedWorkspace(state);
|
return m_workspace.getSelectedWorkspace(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be overwritten by children class with class specific logic.
|
||||||
|
*
|
||||||
|
* @param portal
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
protected abstract PortalList createPortalList(PortalSelectionModel portal);
|
protected abstract PortalList createPortalList(PortalSelectionModel portal);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be overwritten by children class with class specific logic.
|
||||||
|
*
|
||||||
|
* @param portal
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
protected abstract PersistentPortal createPortalDisplay(
|
protected abstract PersistentPortal createPortalDisplay(
|
||||||
PortalSelectionModel portal);
|
PortalSelectionModel portal);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public void register(Page page) {
|
public void register(Page page) {
|
||||||
super.register(page);
|
|
||||||
|
|
||||||
|
super.register(page);
|
||||||
page.addComponentStateParam(this, m_portal.getStateParameter());
|
page.addComponentStateParam(this, m_portal.getStateParameter());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,23 @@ import com.arsdigita.xml.Element;
|
||||||
public class ApplicationPortlet extends AbstractPortletRenderer {
|
public class ApplicationPortlet extends AbstractPortletRenderer {
|
||||||
|
|
||||||
private RequestLocal m_parent;
|
private RequestLocal m_parent;
|
||||||
|
|
||||||
private Component m_portletComponent;
|
private Component m_portletComponent;
|
||||||
|
|
||||||
private Component m_appComponent;
|
private Component m_appComponent;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param title
|
||||||
|
* @param column
|
||||||
|
* @param row
|
||||||
|
* @param parent
|
||||||
|
* @param portletComponent
|
||||||
|
* @param appComponent
|
||||||
|
*/
|
||||||
public ApplicationPortlet(String title, int column, int row,
|
public ApplicationPortlet(String title, int column, int row,
|
||||||
RequestLocal parent, Component portletComponent,
|
RequestLocal parent, Component portletComponent,
|
||||||
Component appComponent) {
|
Component appComponent) {
|
||||||
|
|
||||||
Assert.exists(parent, RequestLocal.class);
|
Assert.exists(parent, RequestLocal.class);
|
||||||
Assert.exists(portletComponent, Component.class);
|
Assert.exists(portletComponent, Component.class);
|
||||||
Assert.exists(appComponent, Component.class);
|
Assert.exists(appComponent, Component.class);
|
||||||
|
|
@ -47,15 +56,26 @@ public class ApplicationPortlet extends AbstractPortletRenderer {
|
||||||
setTitle(title);
|
setTitle(title);
|
||||||
setCellNumber(column);
|
setCellNumber(column);
|
||||||
setSortKey(row);
|
setSortKey(row);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
protected void generateBodyXML(PageState state, Element parent) {
|
protected void generateBodyXML(PageState state, Element parent) {
|
||||||
|
|
||||||
Element content = parent.newChildElement("portlet:simple",
|
Element content = parent.newChildElement("portlet:simple",
|
||||||
PortalConstants.PORTLET_XML_NS);
|
PortalConstants.PORTLET_XML_NS);
|
||||||
|
|
||||||
if (m_parent.get(state) == null) {
|
if (m_parent.get(state) == null) {
|
||||||
m_appComponent.generateXML(state, content);
|
m_appComponent.generateXML(state, content);
|
||||||
} else {
|
} else {
|
||||||
m_portletComponent.generateXML(state, content);
|
m_portletComponent.generateXML(state, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,19 +31,25 @@ import com.arsdigita.bebop.form.Option;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.SaveCancelSection;
|
import com.arsdigita.bebop.SaveCancelSection;
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
import com.arsdigita.bebop.SimpleContainer;
|
||||||
import com.arsdigita.web.ApplicationType;
|
|
||||||
import com.arsdigita.web.Application;
|
|
||||||
import com.arsdigita.web.ApplicationCollection;
|
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
|
||||||
import com.arsdigita.kernel.Kernel;
|
import com.arsdigita.kernel.Kernel;
|
||||||
import com.arsdigita.kernel.Party;
|
import com.arsdigita.kernel.Party;
|
||||||
import com.arsdigita.kernel.permissions.PermissionService;
|
import com.arsdigita.kernel.permissions.PermissionService;
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||||
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
import com.arsdigita.web.ApplicationType;
|
||||||
|
import com.arsdigita.web.Application;
|
||||||
|
import com.arsdigita.web.ApplicationCollection;
|
||||||
|
|
||||||
import com.arsdigita.london.util.ui.parameters.DomainObjectParameter;
|
import com.arsdigita.london.util.ui.parameters.DomainObjectParameter;
|
||||||
|
|
||||||
import java.util.TooManyListenersException;
|
import java.util.TooManyListenersException;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class ApplicationSelector extends Form {
|
public class ApplicationSelector extends Form {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(ApplicationSelector.class);
|
private static final Logger s_log = Logger.getLogger(ApplicationSelector.class);
|
||||||
|
|
@ -55,11 +61,21 @@ public class ApplicationSelector extends Form {
|
||||||
|
|
||||||
private PrivilegeDescriptor m_privilege;
|
private PrivilegeDescriptor m_privilege;
|
||||||
|
|
||||||
public ApplicationSelector(ApplicationType type,
|
/**
|
||||||
DomainObjectParameter app) {
|
* Convenient Constructor
|
||||||
|
* @param type
|
||||||
|
* @param app
|
||||||
|
*/
|
||||||
|
public ApplicationSelector(ApplicationType type,DomainObjectParameter app) {
|
||||||
this(type, app, null);
|
this(type, app, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param type
|
||||||
|
* @param app
|
||||||
|
* @param privilege
|
||||||
|
*/
|
||||||
public ApplicationSelector(ApplicationType type,
|
public ApplicationSelector(ApplicationType type,
|
||||||
DomainObjectParameter app,
|
DomainObjectParameter app,
|
||||||
PrivilegeDescriptor privilege) {
|
PrivilegeDescriptor privilege) {
|
||||||
|
|
@ -88,6 +104,9 @@ public class ApplicationSelector extends Form {
|
||||||
addSubmissionListener(new AppSubmissionListener());
|
addSubmissionListener(new AppSubmissionListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class AppSubmissionListener implements FormSubmissionListener {
|
private class AppSubmissionListener implements FormSubmissionListener {
|
||||||
public void submitted(FormSectionEvent e)
|
public void submitted(FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
|
|
@ -99,9 +118,13 @@ public class ApplicationSelector extends Form {
|
||||||
s_log.debug("Falling through for process");
|
s_log.debug("Falling through for process");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class AppProcessListener implements FormProcessListener {
|
private class AppProcessListener implements FormProcessListener {
|
||||||
public void process(FormSectionEvent e)
|
|
||||||
throws FormProcessException {
|
public void process(FormSectionEvent e) throws FormProcessException {
|
||||||
s_log.debug("Firing event for process");
|
s_log.debug("Firing event for process");
|
||||||
|
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
@ -110,7 +133,16 @@ public class ApplicationSelector extends Form {
|
||||||
fireCompletionEvent(e.getPageState());
|
fireCompletionEvent(e.getPageState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class AppPrintListener implements PrintListener {
|
private class AppPrintListener implements PrintListener {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
*/
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
ApplicationCollection apps = Application.retrieveAllApplications();
|
ApplicationCollection apps = Application.retrieveAllApplications();
|
||||||
apps.addEqualsFilter("resourceType.id",
|
apps.addEqualsFilter("resourceType.id",
|
||||||
|
|
@ -125,8 +157,7 @@ public class ApplicationSelector extends Form {
|
||||||
apps.addOrder("primaryURL");
|
apps.addOrder("primaryURL");
|
||||||
|
|
||||||
SingleSelect t = (SingleSelect) e.getTarget();
|
SingleSelect t = (SingleSelect) e.getTarget();
|
||||||
t.addOption(new Option(null,
|
t.addOption(new Option(null, "--select one--"));
|
||||||
"--select one--"));
|
|
||||||
while (apps.next()) {
|
while (apps.next()) {
|
||||||
Application app = apps.getApplication();
|
Application app = apps.getApplication();
|
||||||
t.addOption(new Option(app.getOID().toString(),
|
t.addOption(new Option(app.getOID().toString(),
|
||||||
|
|
@ -134,4 +165,5 @@ public class ApplicationSelector extends Form {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,23 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
|
|
@ -25,11 +26,22 @@ import com.arsdigita.portalworkspace.Workspace;
|
||||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||||
import com.arsdigita.portalworkspace.WorkspacePageCollection;
|
import com.arsdigita.portalworkspace.WorkspacePageCollection;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class DefaultPortalSelectionModel extends ACSObjectSelectionModel
|
public class DefaultPortalSelectionModel extends ACSObjectSelectionModel
|
||||||
implements PortalSelectionModel {
|
implements PortalSelectionModel {
|
||||||
|
|
||||||
private WorkspaceSelectionModel m_workspace;
|
private WorkspaceSelectionModel m_workspace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
*/
|
||||||
public DefaultPortalSelectionModel(BigDecimalParameter param) {
|
public DefaultPortalSelectionModel(BigDecimalParameter param) {
|
||||||
this(null, param);
|
this(null, param);
|
||||||
}
|
}
|
||||||
|
|
@ -42,39 +54,66 @@ public class DefaultPortalSelectionModel extends ACSObjectSelectionModel
|
||||||
m_workspace = workspace;
|
m_workspace = workspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param workspace
|
||||||
|
*/
|
||||||
public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
|
public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
|
||||||
m_workspace = workspace;
|
m_workspace = workspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public Workspace getSelectedWorkspace(PageState state) {
|
public Workspace getSelectedWorkspace(PageState state) {
|
||||||
return m_workspace.getSelectedWorkspace(state);
|
return m_workspace.getSelectedWorkspace(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object getSelectedKey(PageState state) {
|
public Object getSelectedKey(PageState state) {
|
||||||
BigDecimal key = (BigDecimal) super.getSelectedKey(state);
|
BigDecimal key = (BigDecimal) super.getSelectedKey(state);
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
loadDefaultPortal(state);
|
loadDefaultPortal(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getSelectedKey(state);
|
return super.getSelectedKey(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DomainObject getSelectedObject(PageState state) {
|
public DomainObject getSelectedObject(PageState state) {
|
||||||
BigDecimal key = (BigDecimal) super.getSelectedKey(state);
|
BigDecimal key = (BigDecimal) super.getSelectedKey(state);
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
loadDefaultPortal(state);
|
loadDefaultPortal(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getSelectedObject(state);
|
return super.getSelectedObject(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public WorkspacePage getSelectedPortal(PageState state) {
|
public WorkspacePage getSelectedPortal(PageState state) {
|
||||||
return (WorkspacePage) getSelectedObject(state);
|
return (WorkspacePage) getSelectedObject(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
*/
|
||||||
private void loadDefaultPortal(PageState state) {
|
private void loadDefaultPortal(PageState state) {
|
||||||
|
|
||||||
Workspace workspace = getSelectedWorkspace(state);
|
Workspace workspace = getSelectedWorkspace(state);
|
||||||
WorkspacePageCollection portals = workspace.getPages();
|
WorkspacePageCollection portals = workspace.getPages();
|
||||||
portals.addOrder(WorkspacePage.SORT_KEY);
|
portals.addOrder(WorkspacePage.SORT_KEY);
|
||||||
|
|
@ -86,5 +125,7 @@ public class DefaultPortalSelectionModel extends ACSObjectSelectionModel
|
||||||
WorkspacePage portal = workspace.addPage("Main", "Main page");
|
WorkspacePage portal = workspace.addPage("Main", "Main page");
|
||||||
setSelectedObject(state, portal);
|
setSelectedObject(state, portal);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,23 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.event.ActionEvent;
|
import com.arsdigita.bebop.event.ActionEvent;
|
||||||
import com.arsdigita.bebop.event.ActionListener;
|
import com.arsdigita.bebop.event.ActionListener;
|
||||||
|
|
@ -36,11 +35,26 @@ import com.arsdigita.portal.Portlet;
|
||||||
import com.arsdigita.portal.PortletCollection;
|
import com.arsdigita.portal.PortletCollection;
|
||||||
import com.arsdigita.web.LoginSignal;
|
import com.arsdigita.web.LoginSignal;
|
||||||
|
|
||||||
public class DefaultWorkspace extends WorkspaceComponent implements
|
import java.math.BigDecimal;
|
||||||
ActionListener {
|
|
||||||
|
|
||||||
private static final Logger s_log = Logger
|
import org.apache.log4j.Logger;
|
||||||
.getLogger(DefaultWorkspace.class);
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Another specific entry point into a portal workspace page, here based upon
|
||||||
|
* WorkspaceComponent (as an alternative to AbstractWorkspaceComponent.
|
||||||
|
* Presumably intended to construct a (personal) homepage / startpage when a
|
||||||
|
* user logs in / is logged in.
|
||||||
|
*/
|
||||||
|
// As of APLAWS 1.0.4 / CCM 6.6.x this class may never have been used and is
|
||||||
|
// propably unfinished work or undinished port from ccm-portalserver module.
|
||||||
|
// As with WorkspaceViewer it should be invoked by a jsp. It is not directly
|
||||||
|
// used by any java code.
|
||||||
|
public class DefaultWorkspace extends WorkspaceComponent
|
||||||
|
implements ActionListener {
|
||||||
|
|
||||||
|
private static final Logger s_log = Logger.getLogger(DefaultWorkspace.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|
@ -57,7 +71,6 @@ public class DefaultWorkspace extends WorkspaceComponent implements
|
||||||
*/
|
*/
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
||||||
Workspace workspace = getWorkspaceModel().getSelectedWorkspace(state);
|
Workspace workspace = getWorkspaceModel().getSelectedWorkspace(state);
|
||||||
|
|
||||||
Party party = Kernel.getContext().getParty();
|
Party party = Kernel.getContext().getParty();
|
||||||
|
|
@ -80,8 +93,8 @@ public class DefaultWorkspace extends WorkspaceComponent implements
|
||||||
+ party.getID(), "Personal Workspace for "
|
+ party.getID(), "Personal Workspace for "
|
||||||
+ party.getDisplayName(), parent, (User) party);
|
+ party.getDisplayName(), parent, (User) party);
|
||||||
|
|
||||||
BigDecimal old_id = (BigDecimal) getPortalModel().getSelectedKey(
|
BigDecimal old_id = (BigDecimal) getPortalModel()
|
||||||
state);
|
.getSelectedKey(state);
|
||||||
BigDecimal new_id = null;
|
BigDecimal new_id = null;
|
||||||
|
|
||||||
WorkspacePageCollection pages = workspace.getPages();
|
WorkspacePageCollection pages = workspace.getPages();
|
||||||
|
|
@ -89,7 +102,8 @@ public class DefaultWorkspace extends WorkspaceComponent implements
|
||||||
while (pages.next()) {
|
while (pages.next()) {
|
||||||
WorkspacePage old_page = pages.getPage();
|
WorkspacePage old_page = pages.getPage();
|
||||||
WorkspacePage new_page = clone.addPage(old_page.getTitle(),
|
WorkspacePage new_page = clone.addPage(old_page.getTitle(),
|
||||||
old_page.getDescription(), old_page.getLayout(),
|
old_page.getDescription(),
|
||||||
|
old_page.getLayout(),
|
||||||
old_page.getSortKey());
|
old_page.getSortKey());
|
||||||
|
|
||||||
if (old_page.getID().equals(old_id)) {
|
if (old_page.getID().equals(old_id)) {
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -21,21 +24,35 @@ import com.arsdigita.kernel.Kernel;
|
||||||
import com.arsdigita.kernel.Party;
|
import com.arsdigita.kernel.Party;
|
||||||
import com.arsdigita.portalworkspace.Workspace;
|
import com.arsdigita.portalworkspace.Workspace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Used by the jsp, specified in web.xml and used to construct a perspnal
|
||||||
|
* homepage for an loggedIn user
|
||||||
|
*/
|
||||||
public class DefaultWorkspaceSelectionModel extends WorkspaceSelectionModel {
|
public class DefaultWorkspaceSelectionModel extends WorkspaceSelectionModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
protected Workspace getDefaultWorkspace(PageState state) {
|
protected Workspace getDefaultWorkspace(PageState state) {
|
||||||
|
|
||||||
Workspace workspace = (Workspace) Kernel.getContext().getResource();
|
Workspace workspace = (Workspace) Kernel.getContext().getResource();
|
||||||
Party party = Kernel.getContext().getParty();
|
Party party = Kernel.getContext().getParty();
|
||||||
|
|
||||||
if (party != null) {
|
if (party != null) { // the visitor is logged in
|
||||||
try {
|
try {
|
||||||
workspace = workspace.retrieveSubworkspaceForParty(party);
|
workspace = workspace.retrieveSubworkspaceForParty(party);
|
||||||
|
|
||||||
} catch (DataObjectNotFoundException ex) {
|
} catch (DataObjectNotFoundException ex) {
|
||||||
// fall through
|
// fall through
|
||||||
|
// pboy: i.e. a generell default workspace initialized at the
|
||||||
|
// beginning is provided.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return workspace;
|
return workspace;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -28,27 +31,52 @@ import com.arsdigita.portalworkspace.Workspace;
|
||||||
import com.arsdigita.toolbox.ui.SecurityContainer;
|
import com.arsdigita.toolbox.ui.SecurityContainer;
|
||||||
import com.arsdigita.web.LoginSignal;
|
import com.arsdigita.web.LoginSignal;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Another specific entry point into a portal workspace page, here based upon
|
||||||
|
* WorkspaceComponent (as an alternative to AbstractWorkspaceComponent.
|
||||||
|
*/
|
||||||
|
// As of APLAWS 1.0.4 / CCM 6.6.x this class may never have been used and is
|
||||||
|
// propably unfinished work or undinished port from ccm-portalserver module.
|
||||||
|
// As with WorkspaceViewer it should be invoked by a jsp. It is not directly
|
||||||
|
// used by any java code.
|
||||||
public class PackageWorkspace extends WorkspaceComponent {
|
public class PackageWorkspace extends WorkspaceComponent {
|
||||||
|
|
||||||
private RequestLocal m_isAdmin = new RequestLocal();
|
private RequestLocal m_isAdmin = new RequestLocal();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public PackageWorkspace() {
|
public PackageWorkspace() {
|
||||||
super(new PackageWorkspaceSelectionModel());
|
super(new PackageWorkspaceSelectionModel());
|
||||||
|
|
||||||
addCustomizeListener(new CustomizeListener());
|
addCustomizeListener(new CustomizeListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param parent
|
||||||
|
* @param child
|
||||||
|
*/
|
||||||
protected void addCustomizeLinks(Container parent, Component child) {
|
protected void addCustomizeLinks(Container parent, Component child) {
|
||||||
Container secure = new WorkspaceSecurityContainer(child);
|
Container secure = new WorkspaceSecurityContainer(child);
|
||||||
super.addCustomizeLinks(parent, secure);
|
super.addCustomizeLinks(parent, secure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class CustomizeListener implements ActionListener {
|
private class CustomizeListener implements ActionListener {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
*/
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
||||||
Workspace workspace = getWorkspaceModel().getSelectedWorkspace(
|
Workspace workspace = getWorkspaceModel()
|
||||||
state);
|
.getSelectedWorkspace(state);
|
||||||
|
|
||||||
Party party = Kernel.getContext().getParty();
|
Party party = Kernel.getContext().getParty();
|
||||||
if (party == null) {
|
if (party == null) {
|
||||||
|
|
@ -60,19 +88,33 @@ public class PackageWorkspace extends WorkspaceComponent {
|
||||||
"no permission to customize workspace");
|
"no permission to customize workspace");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class WorkspaceSecurityContainer extends SecurityContainer {
|
private class WorkspaceSecurityContainer extends SecurityContainer {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param c
|
||||||
|
*/
|
||||||
public WorkspaceSecurityContainer(Component c) {
|
public WorkspaceSecurityContainer(Component c) {
|
||||||
super(c);
|
super(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param party
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
protected boolean canAccess(Party party, PageState state) {
|
protected boolean canAccess(Party party, PageState state) {
|
||||||
Boolean isAdmin = (Boolean) m_isAdmin.get(state);
|
Boolean isAdmin = (Boolean) m_isAdmin.get(state);
|
||||||
if (isAdmin == null) {
|
if (isAdmin == null) {
|
||||||
Workspace workspace = getWorkspaceModel().getSelectedWorkspace(
|
Workspace workspace = getWorkspaceModel()
|
||||||
state);
|
.getSelectedWorkspace(state);
|
||||||
boolean canAccess = PortalHelper.canCustomize(party, workspace);
|
boolean canAccess = PortalHelper.canCustomize(party, workspace);
|
||||||
isAdmin = new Boolean(canAccess);
|
isAdmin = new Boolean(canAccess);
|
||||||
m_isAdmin.set(state, isAdmin);
|
m_isAdmin.set(state, isAdmin);
|
||||||
|
|
@ -80,4 +122,5 @@ public class PackageWorkspace extends WorkspaceComponent {
|
||||||
return isAdmin.booleanValue();
|
return isAdmin.booleanValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,40 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.kernel.Kernel;
|
import com.arsdigita.kernel.Kernel;
|
||||||
import com.arsdigita.portalworkspace.Workspace;
|
import com.arsdigita.portalworkspace.Workspace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class PackageWorkspaceSelectionModel extends WorkspaceSelectionModel {
|
public class PackageWorkspaceSelectionModel extends WorkspaceSelectionModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
protected Workspace getDefaultWorkspace(PageState state) {
|
protected Workspace getDefaultWorkspace(PageState state) {
|
||||||
return (Workspace) Kernel.getContext().getResource();
|
return (Workspace) Kernel.getContext().getResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -26,7 +29,6 @@ import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
import com.arsdigita.bebop.SimpleContainer;
|
||||||
import com.arsdigita.bebop.Page;
|
import com.arsdigita.bebop.Page;
|
||||||
import com.arsdigita.bebop.Component;
|
|
||||||
import com.arsdigita.bebop.RequestLocal;
|
import com.arsdigita.bebop.RequestLocal;
|
||||||
import com.arsdigita.bebop.event.ChangeListener;
|
import com.arsdigita.bebop.event.ChangeListener;
|
||||||
import com.arsdigita.bebop.event.ChangeEvent;
|
import com.arsdigita.bebop.event.ChangeEvent;
|
||||||
|
|
@ -36,7 +38,6 @@ import com.arsdigita.bebop.event.ActionEvent;
|
||||||
import com.arsdigita.bebop.event.ActionListener;
|
import com.arsdigita.bebop.event.ActionListener;
|
||||||
import com.arsdigita.bebop.jsp.DefinePage;
|
import com.arsdigita.bebop.jsp.DefinePage;
|
||||||
import com.arsdigita.bebop.parameters.IntegerParameter;
|
import com.arsdigita.bebop.parameters.IntegerParameter;
|
||||||
import com.arsdigita.bebop.parameters.BooleanParameter;
|
|
||||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||||
import com.arsdigita.bebop.portal.PortletRenderer;
|
import com.arsdigita.bebop.portal.PortletRenderer;
|
||||||
import com.arsdigita.bebop.portal.PortalModel;
|
import com.arsdigita.bebop.portal.PortalModel;
|
||||||
|
|
@ -44,19 +45,15 @@ import com.arsdigita.bebop.portal.PortalModelBuilder;
|
||||||
|
|
||||||
import com.arsdigita.portal.PortletType;
|
import com.arsdigita.portal.PortletType;
|
||||||
import com.arsdigita.portal.Portlet;
|
import com.arsdigita.portal.Portlet;
|
||||||
import com.arsdigita.portal.PortletCollection;
|
|
||||||
import com.arsdigita.portal.PortletTypeCollection;
|
import com.arsdigita.portal.PortletTypeCollection;
|
||||||
|
|
||||||
import com.arsdigita.kernel.Resource;
|
import com.arsdigita.kernel.Resource;
|
||||||
import com.arsdigita.kernel.Party;
|
import com.arsdigita.kernel.Party;
|
||||||
import com.arsdigita.kernel.Kernel;
|
import com.arsdigita.kernel.Kernel;
|
||||||
import com.arsdigita.kernel.ACSObject;
|
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
|
||||||
import com.arsdigita.kernel.ui.ResourceConfigComponent;
|
import com.arsdigita.kernel.ui.ResourceConfigComponent;
|
||||||
|
|
||||||
import com.arsdigita.dispatcher.AccessDeniedException;
|
import com.arsdigita.dispatcher.AccessDeniedException;
|
||||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
|
||||||
import com.arsdigita.persistence.DataQuery;
|
import com.arsdigita.persistence.DataQuery;
|
||||||
import com.arsdigita.persistence.SessionManager;
|
import com.arsdigita.persistence.SessionManager;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
|
|
@ -68,7 +65,6 @@ import com.arsdigita.london.util.ui.parameters.DomainObjectParameter;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import com.arsdigita.formbuilder.util.FormBuilderUtil;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
|
@ -79,7 +75,7 @@ import org.apache.log4j.Logger;
|
||||||
// XXX this class is disgusting
|
// XXX this class is disgusting
|
||||||
/**
|
/**
|
||||||
* PersistentPortals are able to have more than one column, and the constructor
|
* PersistentPortals are able to have more than one column, and the constructor
|
||||||
* for PersitentPortal takes in an integer argument for number of columns.
|
* for PersistentPortal takes in an integer argument for number of columns.
|
||||||
*
|
*
|
||||||
* HomepagePortals defined on the jsp page each construct instances of this
|
* HomepagePortals defined on the jsp page each construct instances of this
|
||||||
* class, one for the portal in view mode, one in edit mode.
|
* class, one for the portal in view mode, one in edit mode.
|
||||||
|
|
@ -87,6 +83,8 @@ import org.apache.log4j.Logger;
|
||||||
*/
|
*/
|
||||||
public class PersistentPortal extends SimpleContainer {
|
public class PersistentPortal extends SimpleContainer {
|
||||||
|
|
||||||
|
private static final Logger s_log = Logger.getLogger(PersistentPortal.class);
|
||||||
|
|
||||||
public static final String ACTION_CUSTOMIZE = "customize";
|
public static final String ACTION_CUSTOMIZE = "customize";
|
||||||
public static final String ACTION_MOVE_UP = "moveUp";
|
public static final String ACTION_MOVE_UP = "moveUp";
|
||||||
public static final String ACTION_MOVE_DOWN = "moveDown";
|
public static final String ACTION_MOVE_DOWN = "moveDown";
|
||||||
|
|
@ -96,8 +94,6 @@ public class PersistentPortal extends SimpleContainer {
|
||||||
|
|
||||||
public static final String ACTION_DELETE = "delete";
|
public static final String ACTION_DELETE = "delete";
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(PersistentPortal.class);
|
|
||||||
|
|
||||||
private WorkspaceSelectionModel m_workspace;
|
private WorkspaceSelectionModel m_workspace;
|
||||||
private PortalSelectionModel m_portal;
|
private PortalSelectionModel m_portal;
|
||||||
private PortletTypeSelectionModel m_portletType;
|
private PortletTypeSelectionModel m_portletType;
|
||||||
|
|
@ -123,14 +119,27 @@ public class PersistentPortal extends SimpleContainer {
|
||||||
// pixels wide...
|
// pixels wide...
|
||||||
public static final int MAX_COLUMNS = 10;
|
public static final int MAX_COLUMNS = 10;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param portal
|
||||||
|
* @param mode
|
||||||
|
*/
|
||||||
public PersistentPortal(PortalSelectionModel portal,
|
public PersistentPortal(PortalSelectionModel portal,
|
||||||
String mode) {
|
String mode) {
|
||||||
this(portal, "portal", mode);
|
this(portal, "portal", mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param portal
|
||||||
|
* @param name
|
||||||
|
* @param mode
|
||||||
|
*/
|
||||||
public PersistentPortal(PortalSelectionModel portal,
|
public PersistentPortal(PortalSelectionModel portal,
|
||||||
String name,
|
String name,
|
||||||
String mode) {
|
String mode) {
|
||||||
|
|
||||||
setTag("portal:portal");
|
setTag("portal:portal");
|
||||||
setNamespace(PortalConstants.PORTAL_XML_NS);
|
setNamespace(PortalConstants.PORTAL_XML_NS);
|
||||||
|
|
||||||
|
|
@ -152,18 +161,15 @@ public class PersistentPortal extends SimpleContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
m_portlet = new PortletSelectionModel(
|
m_portlet = new PortletSelectionModel(
|
||||||
new BigDecimalParameter("edit")
|
new BigDecimalParameter("edit") );
|
||||||
);
|
|
||||||
m_portletType = new PortletTypeSelectionModel(
|
m_portletType = new PortletTypeSelectionModel(
|
||||||
new BigDecimalParameter("create")
|
new BigDecimalParameter("create") );
|
||||||
);
|
|
||||||
|
|
||||||
m_portal.addChangeListener(new ChangeListener() {
|
m_portal.addChangeListener(new ChangeListener() {
|
||||||
public void stateChanged(ChangeEvent event) {
|
public void stateChanged(ChangeEvent event) {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
if (m_portal.isSelected(state)) {
|
if (m_portal.isSelected(state)) {
|
||||||
WorkspacePage portal =
|
WorkspacePage portal = m_portal.getSelectedPortal(state);
|
||||||
m_portal.getSelectedPortal(state);
|
|
||||||
s_log.debug("Setting portal" + portal);
|
s_log.debug("Setting portal" + portal);
|
||||||
m_parentResource.set(state, portal);
|
m_parentResource.set(state, portal);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -172,6 +178,7 @@ public class PersistentPortal extends SimpleContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
m_portlet.addChangeListener(new ChangeListener() {
|
m_portlet.addChangeListener(new ChangeListener() {
|
||||||
public void stateChanged(ChangeEvent event) {
|
public void stateChanged(ChangeEvent event) {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
@ -188,16 +195,19 @@ public class PersistentPortal extends SimpleContainer {
|
||||||
});
|
});
|
||||||
|
|
||||||
m_parentApp = new DomainObjectParameter("parentApp");
|
m_parentApp = new DomainObjectParameter("parentApp");
|
||||||
|
|
||||||
m_parentResource = new RequestLocal() {
|
m_parentResource = new RequestLocal() {
|
||||||
public Object initialValue(PageState state) {
|
public Object initialValue(PageState state) {
|
||||||
return state.getValue(m_parentApp);
|
return state.getValue(m_parentApp);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
m_currentResource = new RequestLocal() {
|
m_currentResource = new RequestLocal() {
|
||||||
public Object initialValue(PageState state) {
|
public Object initialValue(PageState state) {
|
||||||
return m_portlet.getSelectedPortlet(state);
|
return m_portlet.getSelectedPortlet(state);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
m_currentApp = new RequestLocal() {
|
m_currentApp = new RequestLocal() {
|
||||||
public Object initialValue(PageState state) {
|
public Object initialValue(PageState state) {
|
||||||
return Kernel.getContext().getResource();
|
return Kernel.getContext().getResource();
|
||||||
|
|
@ -224,7 +234,8 @@ public class PersistentPortal extends SimpleContainer {
|
||||||
if (appType != null) {
|
if (appType != null) {
|
||||||
final ResourceConfigComponent appCreate =
|
final ResourceConfigComponent appCreate =
|
||||||
appType.getCreateComponent(m_currentApp);
|
appType.getCreateComponent(m_currentApp);
|
||||||
ApplicationSelector sel = new ApplicationSelector(appType,
|
ApplicationSelector sel = new ApplicationSelector(
|
||||||
|
appType,
|
||||||
m_parentApp,
|
m_parentApp,
|
||||||
appType.getConfig() == null ? null : appType.getConfig().getViewPrivilege());
|
appType.getConfig() == null ? null : appType.getConfig().getViewPrivilege());
|
||||||
appCreate.addCompletionListener(new ActionListener() {
|
appCreate.addCompletionListener(new ActionListener() {
|
||||||
|
|
@ -241,6 +252,7 @@ public class PersistentPortal extends SimpleContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
sel.addCompletionListener(new ActionListener() {
|
sel.addCompletionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
@ -273,14 +285,13 @@ public class PersistentPortal extends SimpleContainer {
|
||||||
m_column.getSelectedKey(state);
|
m_column.getSelectedKey(state);
|
||||||
Assert.exists(column, Integer.class);
|
Assert.exists(column, Integer.class);
|
||||||
|
|
||||||
WorkspacePage portal =
|
WorkspacePage portal = m_portal
|
||||||
m_portal.getSelectedPortal(state);
|
.getSelectedPortal(state);
|
||||||
portal.addPortlet((Portlet)resource,
|
portal.addPortlet((Portlet)resource,
|
||||||
column.intValue());
|
column.intValue());
|
||||||
portal.save();
|
portal.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// added cg - remove cached page if max existing
|
// added cg - remove cached page if max existing
|
||||||
// stateful portlet count is exceeded so page is
|
// stateful portlet count is exceeded so page is
|
||||||
// rebuilt with correct number of renderers
|
// rebuilt with correct number of renderers
|
||||||
|
|
@ -293,8 +304,7 @@ public class PersistentPortal extends SimpleContainer {
|
||||||
DataQuery findMaxInstances =
|
DataQuery findMaxInstances =
|
||||||
SessionManager.getSession().retrieveQuery(
|
SessionManager.getSession().retrieveQuery(
|
||||||
"com.arsdigita.london.portal.MaxPortletInstances");
|
"com.arsdigita.london.portal.MaxPortletInstances");
|
||||||
findMaxInstances.setParameter(
|
findMaxInstances.setParameter("portletType",
|
||||||
"portletType",
|
|
||||||
portletType.getID());
|
portletType.getID());
|
||||||
int maxCount = 0;
|
int maxCount = 0;
|
||||||
while (findMaxInstances.next()) {
|
while (findMaxInstances.next()) {
|
||||||
|
|
@ -303,19 +313,21 @@ public class PersistentPortal extends SimpleContainer {
|
||||||
.get("maxCount"))
|
.get("maxCount"))
|
||||||
.intValue();
|
.intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
String key = portletType.getResourceObjectType();
|
String key = portletType.getResourceObjectType();
|
||||||
|
|
||||||
int previousMax = StatefulPersistentPortal.getCurrentPortletRendererInstances(key);
|
int previousMax = StatefulPersistentPortal
|
||||||
|
.getCurrentPortletRendererInstances(key);
|
||||||
|
|
||||||
s_log.debug(
|
s_log.debug( portletType + ": previous count = "
|
||||||
portletType
|
+ previousMax + " | new max = "
|
||||||
+ ": previous count = "
|
|
||||||
+ previousMax
|
|
||||||
+ " | new max = "
|
|
||||||
+ maxCount);
|
+ maxCount);
|
||||||
if (maxCount > previousMax) {
|
if (maxCount > previousMax) {
|
||||||
DefinePage.invalidatePage(DispatcherHelper.getCurrentResourcePath(state.getRequest())); }
|
DefinePage.invalidatePage(
|
||||||
|
DispatcherHelper
|
||||||
|
.getCurrentResourcePath(state.getRequest())); }
|
||||||
}
|
}
|
||||||
|
|
||||||
m_portletType.clearSelection(e.getPageState());
|
m_portletType.clearSelection(e.getPageState());
|
||||||
state.setValue(m_parentApp, null);
|
state.setValue(m_parentApp, null);
|
||||||
m_parentResource.set(state, null);
|
m_parentResource.set(state, null);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,21 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Page;
|
import com.arsdigita.bebop.Page;
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -45,19 +48,28 @@ public class PortalEditForm extends Form implements FormProcessListener,
|
||||||
FormInitListener {
|
FormInitListener {
|
||||||
|
|
||||||
private WorkspaceSelectionModel m_workspace;
|
private WorkspaceSelectionModel m_workspace;
|
||||||
|
|
||||||
private PortalSelectionModel m_portal;
|
private PortalSelectionModel m_portal;
|
||||||
|
|
||||||
private TextField m_title;
|
private TextField m_title;
|
||||||
|
|
||||||
private Submit m_save;
|
private Submit m_save;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param portal
|
||||||
|
*/
|
||||||
public PortalEditForm(PortalSelectionModel portal) {
|
public PortalEditForm(PortalSelectionModel portal) {
|
||||||
this(null, portal);
|
this(null, portal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param workspace
|
||||||
|
* @param portal
|
||||||
|
*/
|
||||||
public PortalEditForm(WorkspaceSelectionModel workspace,
|
public PortalEditForm(WorkspaceSelectionModel workspace,
|
||||||
PortalSelectionModel portal) {
|
PortalSelectionModel portal) {
|
||||||
|
|
||||||
super("editPortal", new SimpleContainer("portal:editPortal",
|
super("editPortal", new SimpleContainer("portal:editPortal",
|
||||||
PortalConstants.PORTAL_XML_NS));
|
PortalConstants.PORTAL_XML_NS));
|
||||||
|
|
||||||
|
|
@ -66,9 +78,7 @@ public class PortalEditForm extends Form implements FormProcessListener,
|
||||||
|
|
||||||
m_title = new TextField(new StringParameter("title"));
|
m_title = new TextField(new StringParameter("title"));
|
||||||
m_title.addValidationListener(new NotNullValidationListener());
|
m_title.addValidationListener(new NotNullValidationListener());
|
||||||
m_title
|
m_title.addValidationListener(new StringInRangeValidationListener(1,40));
|
||||||
.addValidationListener(new StringInRangeValidationListener(1,
|
|
||||||
40));
|
|
||||||
|
|
||||||
m_save = new Submit("Save");
|
m_save = new Submit("Save");
|
||||||
|
|
||||||
|
|
@ -79,25 +89,43 @@ public class PortalEditForm extends Form implements FormProcessListener,
|
||||||
addInitListener(this);
|
addInitListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param workspace
|
||||||
|
*/
|
||||||
public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
|
public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
|
||||||
m_workspace = workspace;
|
m_workspace = workspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public Workspace getSelectedWorkspace(PageState state) {
|
public Workspace getSelectedWorkspace(PageState state) {
|
||||||
return m_workspace.getSelectedWorkspace(state);
|
return m_workspace.getSelectedWorkspace(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
*/
|
||||||
public void init(FormSectionEvent e) {
|
public void init(FormSectionEvent e) {
|
||||||
PageState state = e.getPageState();
|
|
||||||
|
|
||||||
|
PageState state = e.getPageState();
|
||||||
WorkspacePage portal = (WorkspacePage) m_portal
|
WorkspacePage portal = (WorkspacePage) m_portal
|
||||||
.getSelectedPortal(state);
|
.getSelectedPortal(state);
|
||||||
|
|
||||||
Assert.exists(portal, WorkspacePage.class);
|
|
||||||
|
|
||||||
|
Assert.exists(portal, WorkspacePage.class);
|
||||||
m_title.setValue(state, portal.getTitle());
|
m_title.setValue(state, portal.getTitle());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
*/
|
||||||
public void process(FormSectionEvent e) {
|
public void process(FormSectionEvent e) {
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
||||||
|
|
@ -108,12 +136,13 @@ public class PortalEditForm extends Form implements FormProcessListener,
|
||||||
"no permissions to customize workspace");
|
"no permissions to customize workspace");
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkspacePage portal = (WorkspacePage) m_portal
|
WorkspacePage portal = (WorkspacePage) m_portal.getSelectedPortal(state);
|
||||||
.getSelectedPortal(state);
|
|
||||||
|
|
||||||
Assert.exists(portal, WorkspacePage.class);
|
Assert.exists(portal, WorkspacePage.class);
|
||||||
|
|
||||||
String title = (String) m_title.getValue(state);
|
String title = (String) m_title.getValue(state);
|
||||||
portal.setTitle(title);
|
portal.setTitle(title);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,35 +37,55 @@ import com.arsdigita.portal.PortletType;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
|
||||||
public class PortalEditModelBuilder extends LockableImpl implements
|
/**
|
||||||
PortalModelBuilder {
|
* Builds the logic to modify (edit) a portal pane (remember: 0..n portal panes
|
||||||
|
* make up a workspace, see com.arsdigita.portalworkspace.Workspace).
|
||||||
|
*
|
||||||
|
* It collects the portlets belonging to a portal, determines whether a portlet
|
||||||
|
* is currently (request wise) to be edited or not and constructs the
|
||||||
|
* corresponding modification or display logic and enables the addition of new
|
||||||
|
* portlets.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class PortalEditModelBuilder extends LockableImpl
|
||||||
|
implements PortalModelBuilder {
|
||||||
|
|
||||||
private static final Logger s_log = Logger
|
private static final Logger s_log = Logger
|
||||||
.getLogger(PortalEditModelBuilder.class);
|
.getLogger(PortalEditModelBuilder.class);
|
||||||
|
|
||||||
private Component m_adders[];
|
private Component m_adders[];
|
||||||
|
|
||||||
private PortalSelectionModel m_portal;
|
private PortalSelectionModel m_portal;
|
||||||
|
|
||||||
private PortletTypeSelectionModel m_creating;
|
private PortletTypeSelectionModel m_creating;
|
||||||
|
|
||||||
private SingleSelectionModel m_column;
|
private SingleSelectionModel m_column;
|
||||||
|
|
||||||
private PortletSelectionModel m_editing;
|
private PortletSelectionModel m_editing;
|
||||||
|
|
||||||
private HashMap m_create;
|
private HashMap m_create;
|
||||||
|
|
||||||
private HashMap m_modify;
|
private HashMap m_modify;
|
||||||
|
|
||||||
private HashMap m_createApp;
|
private HashMap m_createApp;
|
||||||
|
|
||||||
private RequestLocal m_parentResource;
|
private RequestLocal m_parentResource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor, checks existence of parameters and initialies internal
|
||||||
|
* variables.
|
||||||
|
*
|
||||||
|
* @param portal
|
||||||
|
* @param adders
|
||||||
|
* @param creating
|
||||||
|
* @param column
|
||||||
|
* @param editing
|
||||||
|
* @param create
|
||||||
|
* @param modify
|
||||||
|
* @param createApp
|
||||||
|
* @param parentResource
|
||||||
|
*/
|
||||||
public PortalEditModelBuilder(PortalSelectionModel portal,
|
public PortalEditModelBuilder(PortalSelectionModel portal,
|
||||||
Component adders[], PortletTypeSelectionModel creating,
|
Component adders[],
|
||||||
SingleSelectionModel column, PortletSelectionModel editing,
|
PortletTypeSelectionModel creating,
|
||||||
HashMap create, HashMap modify, HashMap createApp,
|
SingleSelectionModel column,
|
||||||
|
PortletSelectionModel editing,
|
||||||
|
HashMap create,
|
||||||
|
HashMap modify,
|
||||||
|
HashMap createApp,
|
||||||
RequestLocal parentResource) {
|
RequestLocal parentResource) {
|
||||||
|
|
||||||
Assert.exists(portal, PortalSelectionModel.class);
|
Assert.exists(portal, PortalSelectionModel.class);
|
||||||
Assert.exists(adders, Component.class);
|
Assert.exists(adders, Component.class);
|
||||||
Assert.exists(creating, PortletTypeSelectionModel.class);
|
Assert.exists(creating, PortletTypeSelectionModel.class);
|
||||||
|
|
@ -85,9 +105,18 @@ public class PortalEditModelBuilder extends LockableImpl implements
|
||||||
m_editing = editing;
|
m_editing = editing;
|
||||||
m_parentResource = parentResource;
|
m_parentResource = parentResource;
|
||||||
m_createApp = createApp;
|
m_createApp = createApp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Actually builds the logic for the pane under consideration.
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public PortalModel buildModel(PageState state) {
|
public PortalModel buildModel(PageState state) {
|
||||||
|
|
||||||
WorkspacePage portal = m_portal.getSelectedPortal(state);
|
WorkspacePage portal = m_portal.getSelectedPortal(state);
|
||||||
|
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
|
|
@ -98,9 +127,11 @@ public class PortalEditModelBuilder extends LockableImpl implements
|
||||||
|
|
||||||
if (portlet.getID().equals(m_editing.getSelectedKey(state))) {
|
if (portlet.getID().equals(m_editing.getSelectedKey(state))) {
|
||||||
// If this portlet is being edited, show the edit form
|
// If this portlet is being edited, show the edit form
|
||||||
renderer = new SimplePortlet("Configure portlet", portlet
|
renderer = new SimplePortlet("Configure portlet",
|
||||||
.getCellNumber(), portlet.getSortKey(),
|
portlet.getCellNumber(),
|
||||||
(Component) m_modify.get(portlet.getPortletType()
|
portlet.getSortKey(),
|
||||||
|
(Component) m_modify
|
||||||
|
.get(portlet.getPortletType()
|
||||||
.getResourceObjectType()));
|
.getResourceObjectType()));
|
||||||
} else {
|
} else {
|
||||||
// Otherwise show the normal portlet XML
|
// Otherwise show the normal portlet XML
|
||||||
|
|
@ -129,13 +160,19 @@ public class PortalEditModelBuilder extends LockableImpl implements
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.getProviderApplicationType() == null) {
|
if (type.getProviderApplicationType() == null) {
|
||||||
list.add(new SimplePortlet("Create portlet", column.intValue(),
|
list.add(new SimplePortlet("Create portlet",
|
||||||
99998, component));
|
column.intValue(),
|
||||||
|
99998,
|
||||||
|
component));
|
||||||
} else {
|
} else {
|
||||||
Component appCreate = (Component) m_createApp.get(type
|
Component appCreate = (Component) m_createApp
|
||||||
|
.get(type
|
||||||
.getResourceObjectType());
|
.getResourceObjectType());
|
||||||
list.add(new ApplicationPortlet("Create portlet", column
|
list.add(new ApplicationPortlet("Create portlet",
|
||||||
.intValue(), 99998, m_parentResource, component,
|
column.intValue(),
|
||||||
|
99998,
|
||||||
|
m_parentResource,
|
||||||
|
component,
|
||||||
appCreate));
|
appCreate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -146,30 +183,51 @@ public class PortalEditModelBuilder extends LockableImpl implements
|
||||||
s_log.debug("Adding adder number " + i + m_adders[i]);
|
s_log.debug("Adding adder number " + i + m_adders[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
list.add(new SimplePortlet("Add portlet", i + 1, 999999,
|
list.add(new SimplePortlet("Add portlet",
|
||||||
|
i + 1,
|
||||||
|
999999,
|
||||||
m_adders[i]));
|
m_adders[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PortalEditModel(list.iterator(), portal.getTitle());
|
return new PortalEditModel(list.iterator(), portal.getTitle());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class PortalEditModel implements PortalModel {
|
private class PortalEditModel implements PortalModel {
|
||||||
|
|
||||||
private Iterator m_portlets;
|
private Iterator m_portlets;
|
||||||
|
|
||||||
private String m_title;
|
private String m_title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param portlets
|
||||||
|
* @param title
|
||||||
|
*/
|
||||||
public PortalEditModel(Iterator portlets, String title) {
|
public PortalEditModel(Iterator portlets, String title) {
|
||||||
m_portlets = portlets;
|
m_portlets = portlets;
|
||||||
m_title = title;
|
m_title = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public Iterator getPortletRenderers() {
|
public Iterator getPortletRenderers() {
|
||||||
return m_portlets;
|
return m_portlets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return m_title;
|
return m_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -21,17 +24,40 @@ import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
||||||
import com.arsdigita.kernel.permissions.PermissionService;
|
import com.arsdigita.kernel.permissions.PermissionService;
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Support class to determine users permission for viewing and/or modifying a
|
||||||
|
* portal.
|
||||||
|
*/
|
||||||
public class PortalHelper {
|
public class PortalHelper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if user is allowed to view a portal.
|
||||||
|
*
|
||||||
|
* @param party
|
||||||
|
* @param object
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static boolean canBrowse(Party party, ACSObject object) {
|
public static boolean canBrowse(Party party, ACSObject object) {
|
||||||
PermissionDescriptor perm = new PermissionDescriptor(
|
PermissionDescriptor perm =
|
||||||
PrivilegeDescriptor.READ, object, party);
|
new PermissionDescriptor(PrivilegeDescriptor.READ,
|
||||||
|
object,
|
||||||
|
party);
|
||||||
return PermissionService.checkPermission(perm);
|
return PermissionService.checkPermission(perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if user is allowed to modify (customize) a portal.
|
||||||
|
*
|
||||||
|
* @param party
|
||||||
|
* @param object
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static boolean canCustomize(Party party, ACSObject object) {
|
public static boolean canCustomize(Party party, ACSObject object) {
|
||||||
PermissionDescriptor perm = new PermissionDescriptor(
|
PermissionDescriptor perm =
|
||||||
PrivilegeDescriptor.ADMIN, object, party);
|
new PermissionDescriptor(PrivilegeDescriptor.ADMIN,
|
||||||
|
object,
|
||||||
|
party);
|
||||||
return PermissionService.checkPermission(perm);
|
return PermissionService.checkPermission(perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -39,11 +42,11 @@ import com.arsdigita.xml.XML;
|
||||||
public abstract class PortalList extends SimpleContainer {
|
public abstract class PortalList extends SimpleContainer {
|
||||||
|
|
||||||
private WorkspaceSelectionModel m_workspace;
|
private WorkspaceSelectionModel m_workspace;
|
||||||
|
|
||||||
private PortalSelectionModel m_portal;
|
private PortalSelectionModel m_portal;
|
||||||
|
|
||||||
private Map m_actions = new HashMap();
|
private Map m_actions = new HashMap();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
|
@ -106,15 +109,15 @@ public abstract class PortalList extends SimpleContainer {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void generateXML(PageState state, Element parent) {
|
public void generateXML(PageState state, Element parent) {
|
||||||
|
|
||||||
if (!isVisible(state)) {
|
if (!isVisible(state)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Element content = generateParent(parent);
|
Element content = generateParent(parent);
|
||||||
|
|
||||||
generateChildrenXML(state, content);
|
generateChildrenXML(state, content);
|
||||||
|
|
||||||
generatePortalListXML(state, content);
|
generatePortalListXML(state, content);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -123,6 +126,7 @@ public abstract class PortalList extends SimpleContainer {
|
||||||
* @param parent
|
* @param parent
|
||||||
*/
|
*/
|
||||||
protected void generatePortalListXML(PageState state, Element parent) {
|
protected void generatePortalListXML(PageState state, Element parent) {
|
||||||
|
|
||||||
WorkspacePage current = m_portal.getSelectedPortal(state);
|
WorkspacePage current = m_portal.getSelectedPortal(state);
|
||||||
|
|
||||||
Workspace workspace = getSelectedWorkspace(state);
|
Workspace workspace = getSelectedWorkspace(state);
|
||||||
|
|
@ -131,9 +135,7 @@ public abstract class PortalList extends SimpleContainer {
|
||||||
while (pages.next()) {
|
while (pages.next()) {
|
||||||
Element pageEl = new Element("portal:portalDetails",
|
Element pageEl = new Element("portal:portalDetails",
|
||||||
PortalConstants.PORTAL_XML_NS);
|
PortalConstants.PORTAL_XML_NS);
|
||||||
|
|
||||||
WorkspacePage page = pages.getPage();
|
WorkspacePage page = pages.getPage();
|
||||||
|
|
||||||
generatePageXML(state, pageEl, page);
|
generatePageXML(state, pageEl, page);
|
||||||
|
|
||||||
pageEl.addAttribute("isSelected",
|
pageEl.addAttribute("isSelected",
|
||||||
|
|
@ -142,8 +144,15 @@ public abstract class PortalList extends SimpleContainer {
|
||||||
|
|
||||||
parent.addContent(pageEl);
|
parent.addContent(pageEl);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @param parent
|
||||||
|
* @param page
|
||||||
|
*/
|
||||||
protected void generatePageXML(PageState state, Element parent,
|
protected void generatePageXML(PageState state, Element parent,
|
||||||
WorkspacePage page) {
|
WorkspacePage page) {
|
||||||
DomainObjectXMLRenderer xr = new DomainObjectXMLRenderer(parent);
|
DomainObjectXMLRenderer xr = new DomainObjectXMLRenderer(parent);
|
||||||
|
|
@ -165,4 +174,5 @@ public abstract class PortalList extends SimpleContainer {
|
||||||
state.clearControlEvent();
|
state.clearControlEvent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -26,33 +29,42 @@ import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class PortalListViewer extends PortalList {
|
public class PortalListViewer extends PortalList {
|
||||||
|
|
||||||
|
/** Logger instance to support debugging */
|
||||||
private static final Logger s_log = Logger
|
private static final Logger s_log = Logger
|
||||||
.getLogger(PortalListViewer.class);
|
.getLogger(PortalListViewer.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param portal
|
||||||
|
*/
|
||||||
public PortalListViewer(PortalSelectionModel portal) {
|
public PortalListViewer(PortalSelectionModel portal) {
|
||||||
this(null, portal);
|
this(null, portal);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PortalListViewer(WorkspaceSelectionModel workspace,
|
public PortalListViewer(WorkspaceSelectionModel workspace,
|
||||||
PortalSelectionModel portal) {
|
PortalSelectionModel portal) {
|
||||||
|
|
||||||
super(workspace, portal);
|
super(workspace, portal);
|
||||||
|
|
||||||
addPortalAction("select", new ActionListener() {
|
addPortalAction("select",
|
||||||
|
new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
String value = state.getControlEventValue();
|
String value = state.getControlEventValue();
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
if (s_log.isDebugEnabled()) {
|
||||||
s_log.debug("Selecting portal " + value);
|
s_log.debug("Selecting portal " + value);
|
||||||
}
|
}
|
||||||
|
WorkspacePage portal = (WorkspacePage)
|
||||||
WorkspacePage portal = (WorkspacePage) DomainObjectFactory
|
DomainObjectFactory
|
||||||
.newInstance(new OID(
|
.newInstance(new OID(
|
||||||
WorkspacePage.BASE_DATA_OBJECT_TYPE,
|
WorkspacePage.BASE_DATA_OBJECT_TYPE,
|
||||||
new BigDecimal(value)));
|
new BigDecimal(value)));
|
||||||
|
|
||||||
setSelectedPortal(state, portal);
|
setSelectedPortal(state, portal);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -19,7 +22,17 @@ import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.kernel.ui.DomainObjectSelectionModel;
|
import com.arsdigita.kernel.ui.DomainObjectSelectionModel;
|
||||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public interface PortalSelectionModel extends DomainObjectSelectionModel {
|
public interface PortalSelectionModel extends DomainObjectSelectionModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public WorkspacePage getSelectedPortal(PageState state);
|
public WorkspacePage getSelectedPortal(PageState state);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,19 +30,35 @@ import com.arsdigita.portalworkspace.WorkspacePage;
|
||||||
import com.arsdigita.portal.PortletCollection;
|
import com.arsdigita.portal.PortletCollection;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
|
||||||
public class PortalViewModelBuilder extends LockableImpl implements
|
/**
|
||||||
PortalModelBuilder {
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class PortalViewModelBuilder extends LockableImpl
|
||||||
|
implements PortalModelBuilder {
|
||||||
|
|
||||||
private static final Logger s_log = Logger
|
/** Logger object to support debugging */
|
||||||
.getLogger(PortalViewModelBuilder.class);
|
private static final Logger s_log =
|
||||||
|
Logger.getLogger(PortalViewModelBuilder.class);
|
||||||
|
|
||||||
private PortalSelectionModel m_portal;
|
private PortalSelectionModel m_portal;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param portal
|
||||||
|
*/
|
||||||
public PortalViewModelBuilder(PortalSelectionModel portal) {
|
public PortalViewModelBuilder(PortalSelectionModel portal) {
|
||||||
m_portal = portal;
|
m_portal = portal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public PortalModel buildModel(PageState state) {
|
public PortalModel buildModel(PageState state) {
|
||||||
|
|
||||||
WorkspacePage portal = m_portal.getSelectedPortal(state);
|
WorkspacePage portal = m_portal.getSelectedPortal(state);
|
||||||
|
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
|
|
@ -53,23 +69,34 @@ public class PortalViewModelBuilder extends LockableImpl implements
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PortalViewModel(list.iterator(), portal.getTitle());
|
return new PortalViewModel(list.iterator(), portal.getTitle());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class PortalViewModel implements PortalModel {
|
private class PortalViewModel implements PortalModel {
|
||||||
|
|
||||||
private Iterator m_portlets;
|
private Iterator m_portlets;
|
||||||
|
|
||||||
private String m_title;
|
private String m_title;
|
||||||
|
|
||||||
public PortalViewModel(Iterator portlets, String title) {
|
public PortalViewModel(Iterator portlets, String title) {
|
||||||
m_portlets = portlets;
|
m_portlets = portlets;
|
||||||
m_title = title;
|
m_title = title;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public Iterator getPortletRenderers() {
|
public Iterator getPortletRenderers() {
|
||||||
return m_portlets;
|
return m_portlets;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return m_title;
|
return m_title;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
|
||||||
* License (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of
|
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
|
||||||
*
|
|
||||||
* Software distributed under the License is distributed on an "AS
|
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
||||||
* implied. See the License for the specific language governing
|
|
||||||
* rights and limitations under the License.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.arsdigita.london.portal.ui;
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.RequestLocal;
|
|
||||||
import com.arsdigita.kernel.ResourceType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated use com.arsdigita.bebop.portal.PortletConfigFormSection
|
|
||||||
* @see com.arsdigita.bebop.portal.PortletConfigFormSection
|
|
||||||
*/
|
|
||||||
public class PortletConfigFormSection extends
|
|
||||||
com.arsdigita.bebop.portal.PortletConfigFormSection {
|
|
||||||
|
|
||||||
public PortletConfigFormSection(ResourceType resType,
|
|
||||||
RequestLocal parentAppRL) {
|
|
||||||
super(resType, parentAppRL);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PortletConfigFormSection(RequestLocal application) {
|
|
||||||
super(application);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -28,11 +31,21 @@ import com.arsdigita.portal.Portlet;
|
||||||
*/
|
*/
|
||||||
public class PortletSelectionModel extends ACSObjectSelectionModel {
|
public class PortletSelectionModel extends ACSObjectSelectionModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param p
|
||||||
|
*/
|
||||||
public PortletSelectionModel(BigDecimalParameter p) {
|
public PortletSelectionModel(BigDecimalParameter p) {
|
||||||
super(p);
|
super(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public Portlet getSelectedPortlet(PageState state) {
|
public Portlet getSelectedPortlet(PageState state) {
|
||||||
return (Portlet) getSelectedObject(state);
|
return (Portlet) getSelectedObject(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,35 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Another specific entry point into a portal workspace page, here based upon
|
||||||
|
* WorkspaceComponent (as an alternative to AbstractWorkspaceComponent.
|
||||||
|
*/
|
||||||
|
// As of APLAWS 1.0.4 / CCM 6.6.x this class may never have been used and is
|
||||||
|
// propably unfinished work or undinished port from ccm-portalserver module.
|
||||||
|
// As with WorkspaceViewer it should be invoked by a jsp. It is not directly
|
||||||
|
// used by any java code.
|
||||||
public class UserWorkspace extends WorkspaceComponent {
|
public class UserWorkspace extends WorkspaceComponent {
|
||||||
|
|
||||||
public UserWorkspace() {
|
public UserWorkspace() {
|
||||||
super(new UserWorkspaceSelectionModel());
|
super(new UserWorkspaceSelectionModel());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,13 @@ import com.arsdigita.web.LoginSignal;
|
||||||
|
|
||||||
public class UserWorkspaceSelectionModel extends WorkspaceSelectionModel {
|
public class UserWorkspaceSelectionModel extends WorkspaceSelectionModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
protected Workspace getDefaultWorkspace(PageState state) {
|
protected Workspace getDefaultWorkspace(PageState state) {
|
||||||
|
|
||||||
Workspace workspace = (Workspace) Kernel.getContext().getResource();
|
Workspace workspace = (Workspace) Kernel.getContext().getResource();
|
||||||
Party party = Kernel.getContext().getParty();
|
Party party = Kernel.getContext().getParty();
|
||||||
|
|
||||||
|
|
@ -35,12 +41,12 @@ public class UserWorkspaceSelectionModel extends WorkspaceSelectionModel {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
workspace = workspace.retrieveSubworkspaceForParty(party);
|
workspace = workspace.retrieveSubworkspaceForParty(party);
|
||||||
|
|
||||||
} catch (DataObjectNotFoundException ex) {
|
} catch (DataObjectNotFoundException ex) {
|
||||||
throw new UncheckedWrapperException(
|
throw new UncheckedWrapperException("cannot find workspace for party "
|
||||||
"cannot find workspace for party " + party.getID(), ex);
|
+ party.getID(), ex);
|
||||||
|
}
|
||||||
|
return workspace;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return workspace;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -40,6 +43,10 @@ import com.arsdigita.web.RedirectSignal;
|
||||||
import com.arsdigita.web.URL;
|
import com.arsdigita.web.URL;
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class WorkspaceComponent extends SimpleContainer {
|
public class WorkspaceComponent extends SimpleContainer {
|
||||||
|
|
||||||
private WorkspaceSelectionModel m_workspace;
|
private WorkspaceSelectionModel m_workspace;
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@ import com.arsdigita.portalworkspace.Workspace;
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
import com.arsdigita.xml.XML;
|
import com.arsdigita.xml.XML;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class WorkspaceDetails extends SimpleComponent {
|
public class WorkspaceDetails extends SimpleComponent {
|
||||||
|
|
||||||
private WorkspaceSelectionModel m_workspace;
|
private WorkspaceSelectionModel m_workspace;
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
@ -46,6 +49,28 @@ import com.arsdigita.portalworkspace.Workspace;
|
||||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||||
import com.arsdigita.portalworkspace.util.GlobalizationUtil;
|
import com.arsdigita.portalworkspace.util.GlobalizationUtil;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Another entry point into a standard portal workspace page where the
|
||||||
|
* page is constructed in "edit" mode to allow configuration and modification
|
||||||
|
* by an authorized participant.
|
||||||
|
*
|
||||||
|
* It is used via a jsp page which is invoked at the applications url.
|
||||||
|
*
|
||||||
|
* Example code stub:
|
||||||
|
* <pre>
|
||||||
|
* <define:component name="edit"
|
||||||
|
* classname="com.arsdigita.portalworkspace.ui.WorkspaceEditor" />
|
||||||
|
* <jsp:scriptlet>
|
||||||
|
* ((AbstractWorkspaceComponent)edit).setWorkspaceModel(
|
||||||
|
* new DefaultWorkspaceSelectionModel());
|
||||||
|
* </jsp:scriptlet>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Currently there is a jsp for the default url at
|
||||||
|
* (web)/templates/ccm-portalworkspace/edit.jsp which is mapped via web.xml
|
||||||
|
* to /ccm/portal/edit.jsp in the default, pre-configured configuration.
|
||||||
|
*/
|
||||||
public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(WorkspaceEditor.class);
|
private static final Logger s_log = Logger.getLogger(WorkspaceEditor.class);
|
||||||
|
|
@ -66,18 +91,22 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
||||||
|
|
||||||
private ActionLink m_editBasicPropertiesLink;
|
private ActionLink m_editBasicPropertiesLink;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default Constructor constructs a new, empty WorkspaceEditor object.
|
||||||
|
*/
|
||||||
public WorkspaceEditor() {
|
public WorkspaceEditor() {
|
||||||
this(null);
|
this(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void register(Page page) {
|
/**
|
||||||
super.register(page);
|
* Constructs a WorkspaceViewer for a specific workspace object
|
||||||
page.setVisibleDefault(m_selectForm, !m_workspaceThemes.isEmpty());
|
* and sets the xml tags accordingly.
|
||||||
page.setVisibleDefault(m_createForm, false);
|
*
|
||||||
page.setVisibleDefault(m_basisPropertiesForm, false);
|
* @param workspace
|
||||||
}
|
*/
|
||||||
|
|
||||||
public WorkspaceEditor(WorkspaceSelectionModel workspace) {
|
public WorkspaceEditor(WorkspaceSelectionModel workspace) {
|
||||||
|
|
||||||
super(workspace);
|
super(workspace);
|
||||||
s_log.debug("WorkspaceEditor constructed");
|
s_log.debug("WorkspaceEditor constructed");
|
||||||
|
|
||||||
|
|
@ -126,10 +155,29 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
||||||
add(m_basisPropertiesForm);
|
add(m_basisPropertiesForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param portal
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
protected PortalList createPortalList(PortalSelectionModel portal) {
|
protected PortalList createPortalList(PortalSelectionModel portal) {
|
||||||
return new PortalListEditor(portal);
|
return new PortalListEditor(portal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void register(Page page) {
|
||||||
|
super.register(page);
|
||||||
|
page.setVisibleDefault(m_selectForm, !m_workspaceThemes.isEmpty());
|
||||||
|
page.setVisibleDefault(m_createForm, false);
|
||||||
|
page.setVisibleDefault(m_basisPropertiesForm, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param portal
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
protected PersistentPortal createPortalDisplay(PortalSelectionModel portal) {
|
protected PersistentPortal createPortalDisplay(PortalSelectionModel portal) {
|
||||||
return new PersistentPortal(portal, PortalConstants.MODE_EDITOR);
|
return new PersistentPortal(portal, PortalConstants.MODE_EDITOR);
|
||||||
}
|
}
|
||||||
|
|
@ -156,14 +204,18 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
||||||
m_grp.addOption(opt);
|
m_grp.addOption(opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class SelectThemeForm extends Form implements FormProcessListener,
|
public class SelectThemeForm extends Form implements FormProcessListener,
|
||||||
FormInitListener {
|
FormInitListener {
|
||||||
private Label instruction;
|
private Label instruction;
|
||||||
|
|
||||||
private Submit button;
|
private Submit button;
|
||||||
|
|
||||||
RequestLocal prtlRL;
|
RequestLocal prtlRL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public SelectThemeForm() {
|
public SelectThemeForm() {
|
||||||
super("selectthemeform");
|
super("selectthemeform");
|
||||||
s_log.debug("SelectThemeForm constructed");
|
s_log.debug("SelectThemeForm constructed");
|
||||||
|
|
@ -182,6 +234,10 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
||||||
addInitListener(this);
|
addInitListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
*/
|
||||||
public void process(FormSectionEvent e) {
|
public void process(FormSectionEvent e) {
|
||||||
s_log.debug("process called for SelectThemeForm");
|
s_log.debug("process called for SelectThemeForm");
|
||||||
String selectedkey;
|
String selectedkey;
|
||||||
|
|
@ -218,40 +274,32 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class CreateThemeForm extends Form implements FormProcessListener,
|
public class CreateThemeForm extends Form implements FormProcessListener,
|
||||||
FormInitListener {
|
FormInitListener {
|
||||||
private Label instruction;
|
private Label instruction;
|
||||||
|
|
||||||
private Submit savebutton;
|
private Submit savebutton;
|
||||||
|
|
||||||
private TextField themename;
|
private TextField themename;
|
||||||
|
|
||||||
private ColorPicker background;
|
private ColorPicker background;
|
||||||
|
|
||||||
private ColorPicker text;
|
private ColorPicker text;
|
||||||
|
|
||||||
private ColorPicker activetab;
|
private ColorPicker activetab;
|
||||||
|
|
||||||
private ColorPicker inactivetab;
|
private ColorPicker inactivetab;
|
||||||
|
|
||||||
private ColorPicker activetabtext;
|
private ColorPicker activetabtext;
|
||||||
|
|
||||||
private ColorPicker inactivetabtext;
|
private ColorPicker inactivetabtext;
|
||||||
|
|
||||||
private ColorPicker toprule;
|
private ColorPicker toprule;
|
||||||
|
|
||||||
private ColorPicker bottomrule;
|
private ColorPicker bottomrule;
|
||||||
|
|
||||||
private ColorPicker portletheader;
|
private ColorPicker portletheader;
|
||||||
|
|
||||||
private ColorPicker portletborder;
|
private ColorPicker portletborder;
|
||||||
|
|
||||||
private ColorPicker portletheadertext;
|
private ColorPicker portletheadertext;
|
||||||
|
|
||||||
private ColorPicker portletbodynarrow;
|
private ColorPicker portletbodynarrow;
|
||||||
|
|
||||||
RequestLocal prtlRL;
|
RequestLocal prtlRL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public CreateThemeForm() {
|
public CreateThemeForm() {
|
||||||
super("createthemeform");
|
super("createthemeform");
|
||||||
s_log.debug("CreateThemeForm constructed");
|
s_log.debug("CreateThemeForm constructed");
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -64,4 +68,5 @@ public abstract class WorkspaceSelectionModel {
|
||||||
public void setSelectedWorkspace(PageState state, Workspace workspace) {
|
public void setSelectedWorkspace(PageState state, Workspace workspace) {
|
||||||
m_workspace.set(state, workspace);
|
m_workspace.set(state, workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,58 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the ArsDigita Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.arsdigita.com/ADPL.txt
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* 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.ui;
|
package com.arsdigita.portalworkspace.ui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main (default) entry point into a standard portal workspace page where the
|
||||||
|
* page is constructed in"view" mode to present information to a visitor.
|
||||||
|
*
|
||||||
|
* It is used via a jsp page which is invoked at the applications url.
|
||||||
|
*
|
||||||
|
* Example code stub:
|
||||||
|
* <pre>
|
||||||
|
* <define:component name="view"
|
||||||
|
* classname="com.arsdigita.portalworkspace.ui.WorkspaceViewer" />
|
||||||
|
* <jsp:scriptlet>
|
||||||
|
* ((AbstractWorkspaceComponent) view).setWorkspaceModel(
|
||||||
|
* new DefaultWorkspaceSelectionModel());
|
||||||
|
* </jsp:scriptlet>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Currently there is a jsp for the default url at
|
||||||
|
* (web)/templates/ccm-portalworkspace/index.jsp which is mapped via web.xml
|
||||||
|
* to /ccm/portal/ in the default, pre-configured configuration.
|
||||||
|
*/
|
||||||
public class WorkspaceViewer extends AbstractWorkspaceComponent {
|
public class WorkspaceViewer extends AbstractWorkspaceComponent {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default Constructor constructs a new, empty WorkspaceViewer
|
||||||
|
*/
|
||||||
public WorkspaceViewer() {
|
public WorkspaceViewer() {
|
||||||
this(null);
|
this(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor instantiates a WorkspaceViewer for a specific workspace
|
||||||
|
* object and sets the xml tags accordingly.
|
||||||
|
*
|
||||||
|
* @param workspace
|
||||||
|
*/
|
||||||
public WorkspaceViewer(WorkspaceSelectionModel workspace) {
|
public WorkspaceViewer(WorkspaceSelectionModel workspace) {
|
||||||
super(workspace);
|
super(workspace);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,13 @@
|
||||||
DispatcherHelper.cacheDisable(response);
|
DispatcherHelper.cacheDisable(response);
|
||||||
</jsp:scriptlet>
|
</jsp:scriptlet>
|
||||||
|
|
||||||
<define:page name="editWorkspace" application="portal" title="Workspace Customize" cache="true">
|
<define:page name="editWorkspace" application="portal"
|
||||||
<define:component name="edit" classname="com.arsdigita.portalworkspace.ui.WorkspaceEditor" />
|
title="Workspace Customize" cache="true">
|
||||||
|
<define:component name="edit"
|
||||||
|
classname="com.arsdigita.portalworkspace.ui.WorkspaceEditor" />
|
||||||
<jsp:scriptlet>
|
<jsp:scriptlet>
|
||||||
((AbstractWorkspaceComponent)edit).setWorkspaceModel(new DefaultWorkspaceSelectionModel());
|
((AbstractWorkspaceComponent)edit).setWorkspaceModel(
|
||||||
|
new DefaultWorkspaceSelectionModel());
|
||||||
</jsp:scriptlet>
|
</jsp:scriptlet>
|
||||||
</define:page>
|
</define:page>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue