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;
|
||||
|
||||
/**
|
||||
* A basic implementation of the {@link Container} interface.
|
||||
* <p>By default,
|
||||
* renders all of its children directly, without wrapping them in any
|
||||
* 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:
|
||||
* A basic implementation of the {@link Container} interface which, by default,
|
||||
* renders all of its children directly, without wrapping them in any kind of
|
||||
* tag.
|
||||
*
|
||||
* <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);
|
||||
*
|
||||
* // XSL code:
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@ import com.arsdigita.domain.DomainObject;
|
|||
import com.arsdigita.bebop.PageState;
|
||||
|
||||
/**
|
||||
* A {@link SingleSelectionModel} which loads an item from the
|
||||
* database. The isSelected() method will return true if it
|
||||
* was possible to load the item.
|
||||
* A {@link SingleSelectionModel} which loads an item from the database.
|
||||
*
|
||||
* 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 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,
|
||||
* using the values supplied in PageState.
|
||||
|
|
@ -38,7 +38,6 @@ public interface DomainObjectSelectionModel extends SingleSelectionModel {
|
|||
* @param state The page state
|
||||
* @return The item domain object, or null if no item is
|
||||
* selected.
|
||||
*
|
||||
*/
|
||||
DomainObject getSelectedObject(PageState state);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,9 +59,12 @@ import org.apache.log4j.Logger;
|
|||
|
||||
|
||||
/**
|
||||
* Workspace domain class.
|
||||
* A workspace represents an area containing 0...n portals each arranged
|
||||
* as a pane of page. Each portal (or pane) manages a number of portlets.
|
||||
* Class <b>Workspace</b> is the main domain class (extending Application) for
|
||||
* the portalworkspace module.
|
||||
*
|
||||
* A (portal)workspace represents an area containing 0...n portals each arranged
|
||||
* as a pane of page. Each portal (or pane) manages a number of portlets. So a
|
||||
* workspace is a container for a set of portal panes.
|
||||
*
|
||||
*/
|
||||
public class Workspace extends Application {
|
||||
|
|
@ -69,11 +72,13 @@ public class Workspace extends Application {
|
|||
/** Private logger instance for debugging purpose */
|
||||
private static final Logger s_log = Logger.getLogger(Workspace.class);
|
||||
|
||||
/** Config object containing various parameter */
|
||||
private static final WorkspaceConfig s_config = WorkspaceConfig.getConfig();
|
||||
|
||||
public static WorkspaceConfig getConfig() {
|
||||
return s_config;
|
||||
}
|
||||
/** PDL stuff */
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.portalworkspace.Workspace";
|
||||
public static final String PARTY = "party";
|
||||
|
|
@ -88,7 +93,7 @@ public class Workspace extends Application {
|
|||
private static Workspace defaultHomepageWorkspace = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor retrieves the domain object using its DataObject representation
|
||||
* @param obj
|
||||
*/
|
||||
public Workspace(DataObject obj) {
|
||||
|
|
@ -246,12 +251,12 @@ public class Workspace extends Application {
|
|||
|
||||
/**
|
||||
* Retrieve the workspace that is created during loading of the
|
||||
* ccm-ldn-portal application and is set as the defaultworkspace for the
|
||||
* site.
|
||||
* ccm-portalworkspace application and is set as the defaultworkspace
|
||||
* for the site.
|
||||
*
|
||||
* Returns null if there are no workspaces (though presumably if that is the
|
||||
* case, ccm-ldn-portal hasn't been loaded and so I don't know how you are
|
||||
* invoking this method!)
|
||||
* case, ccm-portalworkspace hasn't been loaded and so I don't know how you
|
||||
* are invoking this method!)
|
||||
*
|
||||
* @return default workspace instance (created during load)
|
||||
*/
|
||||
|
|
@ -280,6 +285,9 @@ public class Workspace extends Application {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void beforeSave() {
|
||||
// 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) {
|
||||
Group members = new Group();
|
||||
members.setName(title);
|
||||
|
|
@ -380,10 +393,19 @@ public class Workspace extends Application {
|
|||
setParty(members);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static WorkspaceCollection retrieveAll() {
|
||||
return retrieveAll(null);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param parent
|
||||
* @return
|
||||
*/
|
||||
public static WorkspaceCollection retrieveAll(Application parent) {
|
||||
DataCollection wks = SessionManager.getSession().retrieve(
|
||||
BASE_DATA_OBJECT_TYPE);
|
||||
|
|
@ -394,11 +416,14 @@ public class Workspace extends Application {
|
|||
return new WorkspaceCollection(wks);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Workspace retrieveSubworkspaceForParty(Party owner)
|
||||
throws DataObjectNotFoundException {
|
||||
|
||||
DataCollection wks = SessionManager.getSession().retrieve(
|
||||
BASE_DATA_OBJECT_TYPE);
|
||||
DataCollection wks = SessionManager.getSession()
|
||||
.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||
|
||||
wks.addEqualsFilter("parentResource.id", getID());
|
||||
wks.addEqualsFilter(PARTY_ID, owner.getID());
|
||||
|
|
@ -741,6 +766,11 @@ public class Workspace extends Application {
|
|||
return (User) get("owner");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param owner
|
||||
* @return
|
||||
*/
|
||||
public static Workspace createPersonalWorkspace(final User owner) {
|
||||
|
||||
s_log.debug("creating the personal portal for "
|
||||
|
|
@ -786,6 +816,11 @@ public class Workspace extends Application {
|
|||
return workspace;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param owner
|
||||
* @return
|
||||
*/
|
||||
public static Workspace retrievePersonalWorkspace(User owner) {
|
||||
DataCollection personalWorkspaces = SessionManager.getSession().retrieve(
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -21,6 +24,10 @@ import com.arsdigita.bebop.SimpleContainer;
|
|||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
||||
|
||||
private WorkspaceSelectionModel m_workspace;
|
||||
|
|
@ -33,22 +40,30 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
|||
|
||||
private PersistentPortal m_portalDisplay;
|
||||
|
||||
/**
|
||||
* Default constructor creates a new, empty
|
||||
* <code>AbstractWorkspaceComponent</code> using parents (SimpleContainer)
|
||||
* default constructor.
|
||||
*/
|
||||
public AbstractWorkspaceComponent() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param 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);
|
||||
|
||||
m_workspace = workspace;
|
||||
|
||||
m_details = new WorkspaceDetails(m_workspace);
|
||||
|
||||
m_portal = new DefaultPortalSelectionModel(new BigDecimalParameter(
|
||||
"portal"));
|
||||
|
||||
m_portalList = createPortalList(m_portal);
|
||||
|
||||
m_portalDisplay = createPortalDisplay(m_portal);
|
||||
|
||||
add(m_details);
|
||||
|
|
@ -56,6 +71,9 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
|||
add(m_portalDisplay);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
|
||||
m_workspace = workspace;
|
||||
m_details.setWorkspaceModel(workspace);
|
||||
|
|
@ -67,15 +85,31 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
|||
return m_workspace.getSelectedWorkspace(state);
|
||||
}
|
||||
|
||||
/**
|
||||
* To be overwritten by children class with class specific logic.
|
||||
*
|
||||
* @param portal
|
||||
* @return
|
||||
*/
|
||||
protected abstract PortalList createPortalList(PortalSelectionModel portal);
|
||||
|
||||
/**
|
||||
* To be overwritten by children class with class specific logic.
|
||||
*
|
||||
* @param portal
|
||||
* @return
|
||||
*/
|
||||
protected abstract PersistentPortal createPortalDisplay(
|
||||
PortalSelectionModel portal);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void register(Page page) {
|
||||
super.register(page);
|
||||
|
||||
super.register(page);
|
||||
page.addComponentStateParam(this, m_portal.getStateParameter());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,14 +28,23 @@ import com.arsdigita.xml.Element;
|
|||
public class ApplicationPortlet extends AbstractPortletRenderer {
|
||||
|
||||
private RequestLocal m_parent;
|
||||
|
||||
private Component m_portletComponent;
|
||||
|
||||
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,
|
||||
RequestLocal parent, Component portletComponent,
|
||||
Component appComponent) {
|
||||
|
||||
Assert.exists(parent, RequestLocal.class);
|
||||
Assert.exists(portletComponent, Component.class);
|
||||
Assert.exists(appComponent, Component.class);
|
||||
|
|
@ -47,15 +56,26 @@ public class ApplicationPortlet extends AbstractPortletRenderer {
|
|||
setTitle(title);
|
||||
setCellNumber(column);
|
||||
setSortKey(row);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @param parent
|
||||
*/
|
||||
protected void generateBodyXML(PageState state, Element parent) {
|
||||
|
||||
Element content = parent.newChildElement("portlet:simple",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
|
||||
if (m_parent.get(state) == null) {
|
||||
m_appComponent.generateXML(state, content);
|
||||
} else {
|
||||
m_portletComponent.generateXML(state, content);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,19 +31,25 @@ import com.arsdigita.bebop.form.Option;
|
|||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.SaveCancelSection;
|
||||
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.Party;
|
||||
import com.arsdigita.kernel.permissions.PermissionService;
|
||||
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 java.util.TooManyListenersException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ApplicationSelector extends Form {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(ApplicationSelector.class);
|
||||
|
|
@ -55,11 +61,21 @@ public class ApplicationSelector extends Form {
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param type
|
||||
* @param app
|
||||
* @param privilege
|
||||
*/
|
||||
public ApplicationSelector(ApplicationType type,
|
||||
DomainObjectParameter app,
|
||||
PrivilegeDescriptor privilege) {
|
||||
|
|
@ -88,6 +104,9 @@ public class ApplicationSelector extends Form {
|
|||
addSubmissionListener(new AppSubmissionListener());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class AppSubmissionListener implements FormSubmissionListener {
|
||||
public void submitted(FormSectionEvent e)
|
||||
throws FormProcessException {
|
||||
|
|
@ -99,9 +118,13 @@ public class ApplicationSelector extends Form {
|
|||
s_log.debug("Falling through for process");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
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");
|
||||
|
||||
PageState state = e.getPageState();
|
||||
|
|
@ -110,7 +133,16 @@ public class ApplicationSelector extends Form {
|
|||
fireCompletionEvent(e.getPageState());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class AppPrintListener implements PrintListener {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
public void prepare(PrintEvent e) {
|
||||
ApplicationCollection apps = Application.retrieveAllApplications();
|
||||
apps.addEqualsFilter("resourceType.id",
|
||||
|
|
@ -125,8 +157,7 @@ public class ApplicationSelector extends Form {
|
|||
apps.addOrder("primaryURL");
|
||||
|
||||
SingleSelect t = (SingleSelect) e.getTarget();
|
||||
t.addOption(new Option(null,
|
||||
"--select one--"));
|
||||
t.addOption(new Option(null, "--select one--"));
|
||||
while (apps.next()) {
|
||||
Application app = apps.getApplication();
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
|
|
@ -25,11 +26,22 @@ import com.arsdigita.portalworkspace.Workspace;
|
|||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.portalworkspace.WorkspacePageCollection;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DefaultPortalSelectionModel extends ACSObjectSelectionModel
|
||||
implements PortalSelectionModel {
|
||||
|
||||
private WorkspaceSelectionModel m_workspace;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param param
|
||||
*/
|
||||
public DefaultPortalSelectionModel(BigDecimalParameter param) {
|
||||
this(null, param);
|
||||
}
|
||||
|
|
@ -42,39 +54,66 @@ public class DefaultPortalSelectionModel extends ACSObjectSelectionModel
|
|||
m_workspace = workspace;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param workspace
|
||||
*/
|
||||
public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
|
||||
m_workspace = workspace;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public Workspace getSelectedWorkspace(PageState state) {
|
||||
return m_workspace.getSelectedWorkspace(state);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object getSelectedKey(PageState state) {
|
||||
BigDecimal key = (BigDecimal) super.getSelectedKey(state);
|
||||
if (key == null) {
|
||||
loadDefaultPortal(state);
|
||||
}
|
||||
|
||||
return super.getSelectedKey(state);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public DomainObject getSelectedObject(PageState state) {
|
||||
BigDecimal key = (BigDecimal) super.getSelectedKey(state);
|
||||
if (key == null) {
|
||||
loadDefaultPortal(state);
|
||||
}
|
||||
|
||||
return super.getSelectedObject(state);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public WorkspacePage getSelectedPortal(PageState state) {
|
||||
return (WorkspacePage) getSelectedObject(state);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
private void loadDefaultPortal(PageState state) {
|
||||
|
||||
Workspace workspace = getSelectedWorkspace(state);
|
||||
WorkspacePageCollection portals = workspace.getPages();
|
||||
portals.addOrder(WorkspacePage.SORT_KEY);
|
||||
|
|
@ -86,5 +125,7 @@ public class DefaultPortalSelectionModel extends ACSObjectSelectionModel
|
|||
WorkspacePage portal = workspace.addPage("Main", "Main page");
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.ActionEvent;
|
||||
import com.arsdigita.bebop.event.ActionListener;
|
||||
|
|
@ -36,11 +35,26 @@ import com.arsdigita.portal.Portlet;
|
|||
import com.arsdigita.portal.PortletCollection;
|
||||
import com.arsdigita.web.LoginSignal;
|
||||
|
||||
public class DefaultWorkspace extends WorkspaceComponent implements
|
||||
ActionListener {
|
||||
import java.math.BigDecimal;
|
||||
|
||||
private static final Logger s_log = Logger
|
||||
.getLogger(DefaultWorkspace.class);
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
@ -57,7 +71,6 @@ public class DefaultWorkspace extends WorkspaceComponent implements
|
|||
*/
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
PageState state = e.getPageState();
|
||||
|
||||
Workspace workspace = getWorkspaceModel().getSelectedWorkspace(state);
|
||||
|
||||
Party party = Kernel.getContext().getParty();
|
||||
|
|
@ -80,8 +93,8 @@ public class DefaultWorkspace extends WorkspaceComponent implements
|
|||
+ party.getID(), "Personal Workspace for "
|
||||
+ party.getDisplayName(), parent, (User) party);
|
||||
|
||||
BigDecimal old_id = (BigDecimal) getPortalModel().getSelectedKey(
|
||||
state);
|
||||
BigDecimal old_id = (BigDecimal) getPortalModel()
|
||||
.getSelectedKey(state);
|
||||
BigDecimal new_id = null;
|
||||
|
||||
WorkspacePageCollection pages = workspace.getPages();
|
||||
|
|
@ -89,7 +102,8 @@ public class DefaultWorkspace extends WorkspaceComponent implements
|
|||
while (pages.next()) {
|
||||
WorkspacePage old_page = pages.getPage();
|
||||
WorkspacePage new_page = clone.addPage(old_page.getTitle(),
|
||||
old_page.getDescription(), old_page.getLayout(),
|
||||
old_page.getDescription(),
|
||||
old_page.getLayout(),
|
||||
old_page.getSortKey());
|
||||
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -21,21 +24,35 @@ import com.arsdigita.kernel.Kernel;
|
|||
import com.arsdigita.kernel.Party;
|
||||
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 {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
protected Workspace getDefaultWorkspace(PageState state) {
|
||||
|
||||
Workspace workspace = (Workspace) Kernel.getContext().getResource();
|
||||
Party party = Kernel.getContext().getParty();
|
||||
|
||||
if (party != null) {
|
||||
if (party != null) { // the visitor is logged in
|
||||
try {
|
||||
workspace = workspace.retrieveSubworkspaceForParty(party);
|
||||
|
||||
} catch (DataObjectNotFoundException ex) {
|
||||
// fall through
|
||||
// pboy: i.e. a generell default workspace initialized at the
|
||||
// beginning is provided.
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -28,27 +31,52 @@ import com.arsdigita.portalworkspace.Workspace;
|
|||
import com.arsdigita.toolbox.ui.SecurityContainer;
|
||||
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 {
|
||||
|
||||
private RequestLocal m_isAdmin = new RequestLocal();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public PackageWorkspace() {
|
||||
super(new PackageWorkspaceSelectionModel());
|
||||
|
||||
addCustomizeListener(new CustomizeListener());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param parent
|
||||
* @param child
|
||||
*/
|
||||
protected void addCustomizeLinks(Container parent, Component child) {
|
||||
Container secure = new WorkspaceSecurityContainer(child);
|
||||
super.addCustomizeLinks(parent, secure);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class CustomizeListener implements ActionListener {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
PageState state = e.getPageState();
|
||||
|
||||
Workspace workspace = getWorkspaceModel().getSelectedWorkspace(
|
||||
state);
|
||||
Workspace workspace = getWorkspaceModel()
|
||||
.getSelectedWorkspace(state);
|
||||
|
||||
Party party = Kernel.getContext().getParty();
|
||||
if (party == null) {
|
||||
|
|
@ -60,19 +88,33 @@ public class PackageWorkspace extends WorkspaceComponent {
|
|||
"no permission to customize workspace");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class WorkspaceSecurityContainer extends SecurityContainer {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c
|
||||
*/
|
||||
public WorkspaceSecurityContainer(Component c) {
|
||||
super(c);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param party
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
protected boolean canAccess(Party party, PageState state) {
|
||||
Boolean isAdmin = (Boolean) m_isAdmin.get(state);
|
||||
if (isAdmin == null) {
|
||||
Workspace workspace = getWorkspaceModel().getSelectedWorkspace(
|
||||
state);
|
||||
Workspace workspace = getWorkspaceModel()
|
||||
.getSelectedWorkspace(state);
|
||||
boolean canAccess = PortalHelper.canCustomize(party, workspace);
|
||||
isAdmin = new Boolean(canAccess);
|
||||
m_isAdmin.set(state, isAdmin);
|
||||
|
|
@ -80,4 +122,5 @@ public class PackageWorkspace extends WorkspaceComponent {
|
|||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class PackageWorkspaceSelectionModel extends WorkspaceSelectionModel {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
protected Workspace getDefaultWorkspace(PageState state) {
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -26,7 +29,6 @@ import com.arsdigita.bebop.FormProcessException;
|
|||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SimpleContainer;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.RequestLocal;
|
||||
import com.arsdigita.bebop.event.ChangeListener;
|
||||
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.jsp.DefinePage;
|
||||
import com.arsdigita.bebop.parameters.IntegerParameter;
|
||||
import com.arsdigita.bebop.parameters.BooleanParameter;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.bebop.portal.PortletRenderer;
|
||||
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.Portlet;
|
||||
import com.arsdigita.portal.PortletCollection;
|
||||
import com.arsdigita.portal.PortletTypeCollection;
|
||||
|
||||
import com.arsdigita.kernel.Resource;
|
||||
import com.arsdigita.kernel.Party;
|
||||
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.dispatcher.AccessDeniedException;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataQuery;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.util.Assert;
|
||||
|
|
@ -68,7 +65,6 @@ import com.arsdigita.london.util.ui.parameters.DomainObjectParameter;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.arsdigita.formbuilder.util.FormBuilderUtil;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
|
|
@ -79,7 +75,7 @@ import org.apache.log4j.Logger;
|
|||
// XXX this class is disgusting
|
||||
/**
|
||||
* 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
|
||||
* 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 {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(PersistentPortal.class);
|
||||
|
||||
public static final String ACTION_CUSTOMIZE = "customize";
|
||||
public static final String ACTION_MOVE_UP = "moveUp";
|
||||
public static final String ACTION_MOVE_DOWN = "moveDown";
|
||||
|
|
@ -96,8 +94,6 @@ public class PersistentPortal extends SimpleContainer {
|
|||
|
||||
public static final String ACTION_DELETE = "delete";
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(PersistentPortal.class);
|
||||
|
||||
private WorkspaceSelectionModel m_workspace;
|
||||
private PortalSelectionModel m_portal;
|
||||
private PortletTypeSelectionModel m_portletType;
|
||||
|
|
@ -123,14 +119,27 @@ public class PersistentPortal extends SimpleContainer {
|
|||
// pixels wide...
|
||||
public static final int MAX_COLUMNS = 10;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param portal
|
||||
* @param mode
|
||||
*/
|
||||
public PersistentPortal(PortalSelectionModel portal,
|
||||
String mode) {
|
||||
this(portal, "portal", mode);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portal
|
||||
* @param name
|
||||
* @param mode
|
||||
*/
|
||||
public PersistentPortal(PortalSelectionModel portal,
|
||||
String name,
|
||||
String mode) {
|
||||
|
||||
setTag("portal:portal");
|
||||
setNamespace(PortalConstants.PORTAL_XML_NS);
|
||||
|
||||
|
|
@ -152,18 +161,15 @@ public class PersistentPortal extends SimpleContainer {
|
|||
}
|
||||
|
||||
m_portlet = new PortletSelectionModel(
|
||||
new BigDecimalParameter("edit")
|
||||
);
|
||||
new BigDecimalParameter("edit") );
|
||||
m_portletType = new PortletTypeSelectionModel(
|
||||
new BigDecimalParameter("create")
|
||||
);
|
||||
new BigDecimalParameter("create") );
|
||||
|
||||
m_portal.addChangeListener(new ChangeListener() {
|
||||
public void stateChanged(ChangeEvent event) {
|
||||
PageState state = event.getPageState();
|
||||
if (m_portal.isSelected(state)) {
|
||||
WorkspacePage portal =
|
||||
m_portal.getSelectedPortal(state);
|
||||
WorkspacePage portal = m_portal.getSelectedPortal(state);
|
||||
s_log.debug("Setting portal" + portal);
|
||||
m_parentResource.set(state, portal);
|
||||
} else {
|
||||
|
|
@ -172,6 +178,7 @@ public class PersistentPortal extends SimpleContainer {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
m_portlet.addChangeListener(new ChangeListener() {
|
||||
public void stateChanged(ChangeEvent event) {
|
||||
PageState state = event.getPageState();
|
||||
|
|
@ -188,16 +195,19 @@ public class PersistentPortal extends SimpleContainer {
|
|||
});
|
||||
|
||||
m_parentApp = new DomainObjectParameter("parentApp");
|
||||
|
||||
m_parentResource = new RequestLocal() {
|
||||
public Object initialValue(PageState state) {
|
||||
return state.getValue(m_parentApp);
|
||||
}
|
||||
};
|
||||
|
||||
m_currentResource = new RequestLocal() {
|
||||
public Object initialValue(PageState state) {
|
||||
return m_portlet.getSelectedPortlet(state);
|
||||
}
|
||||
};
|
||||
|
||||
m_currentApp = new RequestLocal() {
|
||||
public Object initialValue(PageState state) {
|
||||
return Kernel.getContext().getResource();
|
||||
|
|
@ -224,7 +234,8 @@ public class PersistentPortal extends SimpleContainer {
|
|||
if (appType != null) {
|
||||
final ResourceConfigComponent appCreate =
|
||||
appType.getCreateComponent(m_currentApp);
|
||||
ApplicationSelector sel = new ApplicationSelector(appType,
|
||||
ApplicationSelector sel = new ApplicationSelector(
|
||||
appType,
|
||||
m_parentApp,
|
||||
appType.getConfig() == null ? null : appType.getConfig().getViewPrivilege());
|
||||
appCreate.addCompletionListener(new ActionListener() {
|
||||
|
|
@ -241,6 +252,7 @@ public class PersistentPortal extends SimpleContainer {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
sel.addCompletionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
PageState state = e.getPageState();
|
||||
|
|
@ -273,14 +285,13 @@ public class PersistentPortal extends SimpleContainer {
|
|||
m_column.getSelectedKey(state);
|
||||
Assert.exists(column, Integer.class);
|
||||
|
||||
WorkspacePage portal =
|
||||
m_portal.getSelectedPortal(state);
|
||||
WorkspacePage portal = m_portal
|
||||
.getSelectedPortal(state);
|
||||
portal.addPortlet((Portlet)resource,
|
||||
column.intValue());
|
||||
portal.save();
|
||||
}
|
||||
|
||||
|
||||
// added cg - remove cached page if max existing
|
||||
// stateful portlet count is exceeded so page is
|
||||
// rebuilt with correct number of renderers
|
||||
|
|
@ -293,8 +304,7 @@ public class PersistentPortal extends SimpleContainer {
|
|||
DataQuery findMaxInstances =
|
||||
SessionManager.getSession().retrieveQuery(
|
||||
"com.arsdigita.london.portal.MaxPortletInstances");
|
||||
findMaxInstances.setParameter(
|
||||
"portletType",
|
||||
findMaxInstances.setParameter("portletType",
|
||||
portletType.getID());
|
||||
int maxCount = 0;
|
||||
while (findMaxInstances.next()) {
|
||||
|
|
@ -303,19 +313,21 @@ public class PersistentPortal extends SimpleContainer {
|
|||
.get("maxCount"))
|
||||
.intValue();
|
||||
}
|
||||
|
||||
String key = portletType.getResourceObjectType();
|
||||
|
||||
int previousMax = StatefulPersistentPortal.getCurrentPortletRendererInstances(key);
|
||||
int previousMax = StatefulPersistentPortal
|
||||
.getCurrentPortletRendererInstances(key);
|
||||
|
||||
s_log.debug(
|
||||
portletType
|
||||
+ ": previous count = "
|
||||
+ previousMax
|
||||
+ " | new max = "
|
||||
s_log.debug( portletType + ": previous count = "
|
||||
+ previousMax + " | new max = "
|
||||
+ maxCount);
|
||||
if (maxCount > previousMax) {
|
||||
DefinePage.invalidatePage(DispatcherHelper.getCurrentResourcePath(state.getRequest())); }
|
||||
DefinePage.invalidatePage(
|
||||
DispatcherHelper
|
||||
.getCurrentResourcePath(state.getRequest())); }
|
||||
}
|
||||
|
||||
m_portletType.clearSelection(e.getPageState());
|
||||
state.setValue(m_parentApp, 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;
|
||||
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -45,19 +48,28 @@ public class PortalEditForm extends Form implements FormProcessListener,
|
|||
FormInitListener {
|
||||
|
||||
private WorkspaceSelectionModel m_workspace;
|
||||
|
||||
private PortalSelectionModel m_portal;
|
||||
|
||||
private TextField m_title;
|
||||
|
||||
private Submit m_save;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portal
|
||||
*/
|
||||
public PortalEditForm(PortalSelectionModel portal) {
|
||||
this(null, portal);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param workspace
|
||||
* @param portal
|
||||
*/
|
||||
public PortalEditForm(WorkspaceSelectionModel workspace,
|
||||
PortalSelectionModel portal) {
|
||||
|
||||
super("editPortal", new SimpleContainer("portal:editPortal",
|
||||
PortalConstants.PORTAL_XML_NS));
|
||||
|
||||
|
|
@ -66,9 +78,7 @@ public class PortalEditForm extends Form implements FormProcessListener,
|
|||
|
||||
m_title = new TextField(new StringParameter("title"));
|
||||
m_title.addValidationListener(new NotNullValidationListener());
|
||||
m_title
|
||||
.addValidationListener(new StringInRangeValidationListener(1,
|
||||
40));
|
||||
m_title.addValidationListener(new StringInRangeValidationListener(1,40));
|
||||
|
||||
m_save = new Submit("Save");
|
||||
|
||||
|
|
@ -79,25 +89,43 @@ public class PortalEditForm extends Form implements FormProcessListener,
|
|||
addInitListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param workspace
|
||||
*/
|
||||
public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
|
||||
m_workspace = workspace;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public Workspace getSelectedWorkspace(PageState state) {
|
||||
return m_workspace.getSelectedWorkspace(state);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
public void init(FormSectionEvent e) {
|
||||
PageState state = e.getPageState();
|
||||
|
||||
PageState state = e.getPageState();
|
||||
WorkspacePage portal = (WorkspacePage) m_portal
|
||||
.getSelectedPortal(state);
|
||||
|
||||
Assert.exists(portal, WorkspacePage.class);
|
||||
|
||||
Assert.exists(portal, WorkspacePage.class);
|
||||
m_title.setValue(state, portal.getTitle());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
public void process(FormSectionEvent e) {
|
||||
PageState state = e.getPageState();
|
||||
|
||||
|
|
@ -108,12 +136,13 @@ public class PortalEditForm extends Form implements FormProcessListener,
|
|||
"no permissions to customize workspace");
|
||||
}
|
||||
|
||||
WorkspacePage portal = (WorkspacePage) m_portal
|
||||
.getSelectedPortal(state);
|
||||
WorkspacePage portal = (WorkspacePage) m_portal.getSelectedPortal(state);
|
||||
|
||||
Assert.exists(portal, WorkspacePage.class);
|
||||
|
||||
String title = (String) m_title.getValue(state);
|
||||
portal.setTitle(title);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,35 +37,55 @@ import com.arsdigita.portal.PortletType;
|
|||
import com.arsdigita.util.Assert;
|
||||
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
|
||||
.getLogger(PortalEditModelBuilder.class);
|
||||
|
||||
private Component m_adders[];
|
||||
|
||||
private PortalSelectionModel m_portal;
|
||||
|
||||
private PortletTypeSelectionModel m_creating;
|
||||
|
||||
private SingleSelectionModel m_column;
|
||||
|
||||
private PortletSelectionModel m_editing;
|
||||
|
||||
private HashMap m_create;
|
||||
|
||||
private HashMap m_modify;
|
||||
|
||||
private HashMap m_createApp;
|
||||
|
||||
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,
|
||||
Component adders[], PortletTypeSelectionModel creating,
|
||||
SingleSelectionModel column, PortletSelectionModel editing,
|
||||
HashMap create, HashMap modify, HashMap createApp,
|
||||
Component adders[],
|
||||
PortletTypeSelectionModel creating,
|
||||
SingleSelectionModel column,
|
||||
PortletSelectionModel editing,
|
||||
HashMap create,
|
||||
HashMap modify,
|
||||
HashMap createApp,
|
||||
RequestLocal parentResource) {
|
||||
|
||||
Assert.exists(portal, PortalSelectionModel.class);
|
||||
Assert.exists(adders, Component.class);
|
||||
Assert.exists(creating, PortletTypeSelectionModel.class);
|
||||
|
|
@ -85,9 +105,18 @@ public class PortalEditModelBuilder extends LockableImpl implements
|
|||
m_editing = editing;
|
||||
m_parentResource = parentResource;
|
||||
m_createApp = createApp;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Actually builds the logic for the pane under consideration.
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public PortalModel buildModel(PageState state) {
|
||||
|
||||
WorkspacePage portal = m_portal.getSelectedPortal(state);
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
|
|
@ -98,9 +127,11 @@ public class PortalEditModelBuilder extends LockableImpl implements
|
|||
|
||||
if (portlet.getID().equals(m_editing.getSelectedKey(state))) {
|
||||
// If this portlet is being edited, show the edit form
|
||||
renderer = new SimplePortlet("Configure portlet", portlet
|
||||
.getCellNumber(), portlet.getSortKey(),
|
||||
(Component) m_modify.get(portlet.getPortletType()
|
||||
renderer = new SimplePortlet("Configure portlet",
|
||||
portlet.getCellNumber(),
|
||||
portlet.getSortKey(),
|
||||
(Component) m_modify
|
||||
.get(portlet.getPortletType()
|
||||
.getResourceObjectType()));
|
||||
} else {
|
||||
// Otherwise show the normal portlet XML
|
||||
|
|
@ -129,13 +160,19 @@ public class PortalEditModelBuilder extends LockableImpl implements
|
|||
}
|
||||
|
||||
if (type.getProviderApplicationType() == null) {
|
||||
list.add(new SimplePortlet("Create portlet", column.intValue(),
|
||||
99998, component));
|
||||
list.add(new SimplePortlet("Create portlet",
|
||||
column.intValue(),
|
||||
99998,
|
||||
component));
|
||||
} else {
|
||||
Component appCreate = (Component) m_createApp.get(type
|
||||
Component appCreate = (Component) m_createApp
|
||||
.get(type
|
||||
.getResourceObjectType());
|
||||
list.add(new ApplicationPortlet("Create portlet", column
|
||||
.intValue(), 99998, m_parentResource, component,
|
||||
list.add(new ApplicationPortlet("Create portlet",
|
||||
column.intValue(),
|
||||
99998,
|
||||
m_parentResource,
|
||||
component,
|
||||
appCreate));
|
||||
}
|
||||
}
|
||||
|
|
@ -146,30 +183,51 @@ public class PortalEditModelBuilder extends LockableImpl implements
|
|||
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]));
|
||||
}
|
||||
|
||||
return new PortalEditModel(list.iterator(), portal.getTitle());
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class PortalEditModel implements PortalModel {
|
||||
|
||||
private Iterator m_portlets;
|
||||
|
||||
private String m_title;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portlets
|
||||
* @param title
|
||||
*/
|
||||
public PortalEditModel(Iterator portlets, String title) {
|
||||
m_portlets = portlets;
|
||||
m_title = title;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Iterator getPortletRenderers() {
|
||||
return m_portlets;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getTitle() {
|
||||
return m_title;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,19 @@
|
|||
/*
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -21,17 +24,40 @@ import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
|||
import com.arsdigita.kernel.permissions.PermissionService;
|
||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||
|
||||
/**
|
||||
* Support class to determine users permission for viewing and/or modifying a
|
||||
* portal.
|
||||
*/
|
||||
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) {
|
||||
PermissionDescriptor perm = new PermissionDescriptor(
|
||||
PrivilegeDescriptor.READ, object, party);
|
||||
PermissionDescriptor perm =
|
||||
new PermissionDescriptor(PrivilegeDescriptor.READ,
|
||||
object,
|
||||
party);
|
||||
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) {
|
||||
PermissionDescriptor perm = new PermissionDescriptor(
|
||||
PrivilegeDescriptor.ADMIN, object, party);
|
||||
PermissionDescriptor perm =
|
||||
new PermissionDescriptor(PrivilegeDescriptor.ADMIN,
|
||||
object,
|
||||
party);
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -39,11 +42,11 @@ import com.arsdigita.xml.XML;
|
|||
public abstract class PortalList extends SimpleContainer {
|
||||
|
||||
private WorkspaceSelectionModel m_workspace;
|
||||
|
||||
private PortalSelectionModel m_portal;
|
||||
|
||||
private Map m_actions = new HashMap();
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
|
@ -106,15 +109,15 @@ public abstract class PortalList extends SimpleContainer {
|
|||
*/
|
||||
@Override
|
||||
public void generateXML(PageState state, Element parent) {
|
||||
|
||||
if (!isVisible(state)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Element content = generateParent(parent);
|
||||
|
||||
generateChildrenXML(state, content);
|
||||
|
||||
generatePortalListXML(state, content);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -123,6 +126,7 @@ public abstract class PortalList extends SimpleContainer {
|
|||
* @param parent
|
||||
*/
|
||||
protected void generatePortalListXML(PageState state, Element parent) {
|
||||
|
||||
WorkspacePage current = m_portal.getSelectedPortal(state);
|
||||
|
||||
Workspace workspace = getSelectedWorkspace(state);
|
||||
|
|
@ -131,9 +135,7 @@ public abstract class PortalList extends SimpleContainer {
|
|||
while (pages.next()) {
|
||||
Element pageEl = new Element("portal:portalDetails",
|
||||
PortalConstants.PORTAL_XML_NS);
|
||||
|
||||
WorkspacePage page = pages.getPage();
|
||||
|
||||
generatePageXML(state, pageEl, page);
|
||||
|
||||
pageEl.addAttribute("isSelected",
|
||||
|
|
@ -142,8 +144,15 @@ public abstract class PortalList extends SimpleContainer {
|
|||
|
||||
parent.addContent(pageEl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @param parent
|
||||
* @param page
|
||||
*/
|
||||
protected void generatePageXML(PageState state, Element parent,
|
||||
WorkspacePage page) {
|
||||
DomainObjectXMLRenderer xr = new DomainObjectXMLRenderer(parent);
|
||||
|
|
@ -165,4 +174,5 @@ public abstract class PortalList extends SimpleContainer {
|
|||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -26,33 +29,42 @@ import com.arsdigita.domain.DomainObjectFactory;
|
|||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.persistence.OID;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class PortalListViewer extends PortalList {
|
||||
|
||||
/** Logger instance to support debugging */
|
||||
private static final Logger s_log = Logger
|
||||
.getLogger(PortalListViewer.class);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portal
|
||||
*/
|
||||
public PortalListViewer(PortalSelectionModel portal) {
|
||||
this(null, portal);
|
||||
}
|
||||
|
||||
public PortalListViewer(WorkspaceSelectionModel workspace,
|
||||
PortalSelectionModel portal) {
|
||||
|
||||
super(workspace, portal);
|
||||
|
||||
addPortalAction("select", new ActionListener() {
|
||||
addPortalAction("select",
|
||||
new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
PageState state = e.getPageState();
|
||||
String value = state.getControlEventValue();
|
||||
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Selecting portal " + value);
|
||||
}
|
||||
|
||||
WorkspacePage portal = (WorkspacePage) DomainObjectFactory
|
||||
WorkspacePage portal = (WorkspacePage)
|
||||
DomainObjectFactory
|
||||
.newInstance(new OID(
|
||||
WorkspacePage.BASE_DATA_OBJECT_TYPE,
|
||||
new BigDecimal(value)));
|
||||
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -19,7 +22,17 @@ import com.arsdigita.bebop.PageState;
|
|||
import com.arsdigita.kernel.ui.DomainObjectSelectionModel;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface PortalSelectionModel extends DomainObjectSelectionModel {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public WorkspacePage getSelectedPortal(PageState state);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,19 +30,35 @@ import com.arsdigita.portalworkspace.WorkspacePage;
|
|||
import com.arsdigita.portal.PortletCollection;
|
||||
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
|
||||
.getLogger(PortalViewModelBuilder.class);
|
||||
/** Logger object to support debugging */
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(PortalViewModelBuilder.class);
|
||||
|
||||
private PortalSelectionModel m_portal;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portal
|
||||
*/
|
||||
public PortalViewModelBuilder(PortalSelectionModel portal) {
|
||||
m_portal = portal;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public PortalModel buildModel(PageState state) {
|
||||
|
||||
WorkspacePage portal = m_portal.getSelectedPortal(state);
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
|
|
@ -53,23 +69,34 @@ public class PortalViewModelBuilder extends LockableImpl implements
|
|||
}
|
||||
|
||||
return new PortalViewModel(list.iterator(), portal.getTitle());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class PortalViewModel implements PortalModel {
|
||||
|
||||
private Iterator m_portlets;
|
||||
|
||||
private String m_title;
|
||||
|
||||
public PortalViewModel(Iterator portlets, String title) {
|
||||
m_portlets = portlets;
|
||||
m_title = title;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Iterator getPortletRenderers() {
|
||||
return m_portlets;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getTitle() {
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -28,11 +31,21 @@ import com.arsdigita.portal.Portlet;
|
|||
*/
|
||||
public class PortletSelectionModel extends ACSObjectSelectionModel {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param p
|
||||
*/
|
||||
public PortletSelectionModel(BigDecimalParameter p) {
|
||||
super(p);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public Portlet getSelectedPortlet(PageState 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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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 UserWorkspace() {
|
||||
super(new UserWorkspaceSelectionModel());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,13 @@ import com.arsdigita.web.LoginSignal;
|
|||
|
||||
public class UserWorkspaceSelectionModel extends WorkspaceSelectionModel {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
protected Workspace getDefaultWorkspace(PageState state) {
|
||||
|
||||
Workspace workspace = (Workspace) Kernel.getContext().getResource();
|
||||
Party party = Kernel.getContext().getParty();
|
||||
|
||||
|
|
@ -35,12 +41,12 @@ public class UserWorkspaceSelectionModel extends WorkspaceSelectionModel {
|
|||
|
||||
try {
|
||||
workspace = workspace.retrieveSubworkspaceForParty(party);
|
||||
|
||||
} catch (DataObjectNotFoundException ex) {
|
||||
throw new UncheckedWrapperException(
|
||||
"cannot find workspace for party " + party.getID(), ex);
|
||||
throw new UncheckedWrapperException("cannot find workspace for party "
|
||||
+ 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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -40,6 +43,10 @@ import com.arsdigita.web.RedirectSignal;
|
|||
import com.arsdigita.web.URL;
|
||||
import com.arsdigita.xml.Element;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class WorkspaceComponent extends SimpleContainer {
|
||||
|
||||
private WorkspaceSelectionModel m_workspace;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ import com.arsdigita.portalworkspace.Workspace;
|
|||
import com.arsdigita.xml.Element;
|
||||
import com.arsdigita.xml.XML;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class WorkspaceDetails extends SimpleComponent {
|
||||
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
|
@ -46,6 +49,28 @@ import com.arsdigita.portalworkspace.Workspace;
|
|||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
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 {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(WorkspaceEditor.class);
|
||||
|
|
@ -66,18 +91,22 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
|||
|
||||
private ActionLink m_editBasicPropertiesLink;
|
||||
|
||||
|
||||
/**
|
||||
* Default Constructor constructs a new, empty WorkspaceEditor object.
|
||||
*/
|
||||
public WorkspaceEditor() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a WorkspaceViewer for a specific workspace object
|
||||
* and sets the xml tags accordingly.
|
||||
*
|
||||
* @param workspace
|
||||
*/
|
||||
public WorkspaceEditor(WorkspaceSelectionModel workspace) {
|
||||
|
||||
super(workspace);
|
||||
s_log.debug("WorkspaceEditor constructed");
|
||||
|
||||
|
|
@ -126,10 +155,29 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
|||
add(m_basisPropertiesForm);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portal
|
||||
* @return
|
||||
*/
|
||||
protected PortalList createPortalList(PortalSelectionModel 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) {
|
||||
return new PersistentPortal(portal, PortalConstants.MODE_EDITOR);
|
||||
}
|
||||
|
|
@ -156,14 +204,18 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
|||
m_grp.addOption(opt);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class SelectThemeForm extends Form implements FormProcessListener,
|
||||
FormInitListener {
|
||||
private Label instruction;
|
||||
|
||||
private Submit button;
|
||||
|
||||
RequestLocal prtlRL;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public SelectThemeForm() {
|
||||
super("selectthemeform");
|
||||
s_log.debug("SelectThemeForm constructed");
|
||||
|
|
@ -182,6 +234,10 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
|||
addInitListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
public void process(FormSectionEvent e) {
|
||||
s_log.debug("process called for SelectThemeForm");
|
||||
String selectedkey;
|
||||
|
|
@ -218,40 +274,32 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class CreateThemeForm extends Form implements FormProcessListener,
|
||||
FormInitListener {
|
||||
private Label instruction;
|
||||
|
||||
private Submit savebutton;
|
||||
|
||||
private TextField themename;
|
||||
|
||||
private ColorPicker background;
|
||||
|
||||
private ColorPicker text;
|
||||
|
||||
private ColorPicker activetab;
|
||||
|
||||
private ColorPicker inactivetab;
|
||||
|
||||
private ColorPicker activetabtext;
|
||||
|
||||
private ColorPicker inactivetabtext;
|
||||
|
||||
private ColorPicker toprule;
|
||||
|
||||
private ColorPicker bottomrule;
|
||||
|
||||
private ColorPicker portletheader;
|
||||
|
||||
private ColorPicker portletborder;
|
||||
|
||||
private ColorPicker portletheadertext;
|
||||
|
||||
private ColorPicker portletbodynarrow;
|
||||
|
||||
RequestLocal prtlRL;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public CreateThemeForm() {
|
||||
super("createthemeform");
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -64,4 +68,5 @@ public abstract class WorkspaceSelectionModel {
|
|||
public void setSelectedWorkspace(PageState state, Workspace 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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
|
||||
/**
|
||||
* Default Constructor constructs a new, empty WorkspaceViewer
|
||||
*/
|
||||
public WorkspaceViewer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor instantiates a WorkspaceViewer for a specific workspace
|
||||
* object and sets the xml tags accordingly.
|
||||
*
|
||||
* @param workspace
|
||||
*/
|
||||
public WorkspaceViewer(WorkspaceSelectionModel workspace) {
|
||||
super(workspace);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,10 +12,13 @@
|
|||
DispatcherHelper.cacheDisable(response);
|
||||
</jsp:scriptlet>
|
||||
|
||||
<define:page name="editWorkspace" application="portal" title="Workspace Customize" cache="true">
|
||||
<define:component name="edit" classname="com.arsdigita.portalworkspace.ui.WorkspaceEditor" />
|
||||
<define:page name="editWorkspace" application="portal"
|
||||
title="Workspace Customize" cache="true">
|
||||
<define:component name="edit"
|
||||
classname="com.arsdigita.portalworkspace.ui.WorkspaceEditor" />
|
||||
<jsp:scriptlet>
|
||||
((AbstractWorkspaceComponent)edit).setWorkspaceModel(new DefaultWorkspaceSelectionModel());
|
||||
((AbstractWorkspaceComponent)edit).setWorkspaceModel(
|
||||
new DefaultWorkspaceSelectionModel());
|
||||
</jsp:scriptlet>
|
||||
</define:page>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue