From 751e7716e1a230bc494bab47912b20939229dcb0 Mon Sep 17 00:00:00 2001 From: pb Date: Mon, 2 May 2011 15:33:40 +0000 Subject: [PATCH] =?UTF-8?q?Diverse=20Formatierungen=20und=20Erg=C3=A4nzung?= =?UTF-8?q?en=20Kommentare=20/=20Doku.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@888 8810af33-2d31-482b-a856-94f89814c4df --- .../com/arsdigita/bebop/SimpleContainer.java | 24 +- .../kernel/ui/DomainObjectSelectionModel.java | 11 +- .../arsdigita/portalworkspace/Workspace.java | 55 ++- .../ui/AbstractWorkspaceComponent.java | 128 ++++-- .../ui/ApplicationPortlet.java | 70 +-- .../ui/ApplicationSelector.java | 144 +++--- .../ui/DefaultPortalSelectionModel.java | 159 ++++--- .../portalworkspace/ui/DefaultWorkspace.java | 148 ++++--- .../ui/DefaultWorkspaceSelectionModel.java | 59 ++- .../portalworkspace/ui/PackageWorkspace.java | 141 +++--- .../ui/PackageWorkspaceSelectionModel.java | 39 +- .../portalworkspace/ui/PersistentPortal.java | 410 +++++++++--------- .../ui/PersonalPortalPage.java | 18 + .../portalworkspace/ui/PortalEditForm.java | 147 ++++--- .../ui/PortalEditModelBuilder.java | 274 +++++++----- .../portalworkspace/ui/PortalHelper.java | 62 ++- .../portalworkspace/ui/PortalList.java | 188 ++++---- .../portalworkspace/ui/PortalListViewer.java | 80 ++-- .../ui/PortalSelectionModel.java | 31 +- .../ui/PortalViewModelBuilder.java | 91 ++-- ...ortletConfigFormSection.java.nolongerInUse | 36 -- .../ui/PortletSelectionModel.java | 43 +- .../portalworkspace/ui/UserWorkspace.java | 36 +- .../ui/UserWorkspaceSelectionModel.java | 34 +- .../ui/WorkspaceComponent.java | 25 +- .../portalworkspace/ui/WorkspaceDetails.java | 4 + .../portalworkspace/ui/WorkspaceEditor.java | 282 +++++++----- .../ui/WorkspaceSelectionModel.java | 53 ++- .../portalworkspace/ui/WorkspaceViewer.java | 74 +++- .../templates/ccm-portalworkspace/edit.jsp | 9 +- 30 files changed, 1712 insertions(+), 1163 deletions(-) delete mode 100755 ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletConfigFormSection.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/bebop/SimpleContainer.java b/ccm-core/src/com/arsdigita/bebop/SimpleContainer.java index c035defb5..dd54e2511 100755 --- a/ccm-core/src/com/arsdigita/bebop/SimpleContainer.java +++ b/ccm-core/src/com/arsdigita/bebop/SimpleContainer.java @@ -26,18 +26,20 @@ import com.arsdigita.util.Assert; import com.arsdigita.xml.Element; /** - * A basic implementation of the {@link Container} interface. - *

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. * - *

// 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:
+ *
+ * 

+ * // Java Code:
  * m_container = new SimpleContainer("cms:foo", CMS_XML_NS);
  *
  * // XSL code:
diff --git a/ccm-core/src/com/arsdigita/kernel/ui/DomainObjectSelectionModel.java b/ccm-core/src/com/arsdigita/kernel/ui/DomainObjectSelectionModel.java
index 8c21eef8e..d8321e9e3 100755
--- a/ccm-core/src/com/arsdigita/kernel/ui/DomainObjectSelectionModel.java
+++ b/ccm-core/src/com/arsdigita/kernel/ui/DomainObjectSelectionModel.java
@@ -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);
 
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java
index eefe4345f..7f95274dd 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java
@@ -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 Workspace 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);
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/AbstractWorkspaceComponent.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/AbstractWorkspaceComponent.java
index 5c3fd29db..02e609b0b 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/AbstractWorkspaceComponent.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/AbstractWorkspaceComponent.java
@@ -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,61 +24,92 @@ 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;
+    private WorkspaceSelectionModel m_workspace;
 
-	private DefaultPortalSelectionModel m_portal;
+    private DefaultPortalSelectionModel m_portal;
 
-	private WorkspaceDetails m_details;
+    private WorkspaceDetails m_details;
 
-	private PortalList m_portalList;
+    private PortalList m_portalList;
 
-	private PersistentPortal m_portalDisplay;
+    private PersistentPortal m_portalDisplay;
 
-	public AbstractWorkspaceComponent() {
-		this(null);
-	}
+    /**
+     * Default constructor creates a new, empty
+     * AbstractWorkspaceComponent using parents (SimpleContainer)
+     * default constructor.
+     */
+    public AbstractWorkspaceComponent() {
+        this(null);
+    }
 
-	public AbstractWorkspaceComponent(WorkspaceSelectionModel workspace) {
-		super("portal:workspace", PortalConstants.PORTAL_XML_NS);
+    /**
+     * 
+     * @param workspace
+     */
+    public AbstractWorkspaceComponent(WorkspaceSelectionModel workspace) {
 
-		m_workspace = workspace;
+        /* Creates a WorkspaceComponent (SimpleContainer) that will wrap its
+         * children in the specified tag.                                     */
+        super("portal:workspace", PortalConstants.PORTAL_XML_NS);
 
-		m_details = new WorkspaceDetails(m_workspace);
+        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);
 
-		m_portal = new DefaultPortalSelectionModel(new BigDecimalParameter(
-				"portal"));
+        add(m_details);
+        add(m_portalList);
+        add(m_portalDisplay);
+    }
 
-		m_portalList = createPortalList(m_portal);
+    /**
+     *
+     */
+    public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
+        m_workspace = workspace;
+        m_details.setWorkspaceModel(workspace);
+        m_portalList.setWorkspaceModel(workspace);
+        m_portal.setWorkspaceModel(workspace);
+    }
 
-		m_portalDisplay = createPortalDisplay(m_portal);
+    public Workspace getSelectedWorkspace(PageState state) {
+        return m_workspace.getSelectedWorkspace(state);
+    }
 
-		add(m_details);
-		add(m_portalList);
-		add(m_portalDisplay);
-	}
+    /**
+     * To be overwritten by children class with class specific logic. 
+     * 
+     * @param portal
+     * @return
+     */
+    protected abstract PortalList createPortalList(PortalSelectionModel portal);
 
-	public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
-		m_workspace = workspace;
-		m_details.setWorkspaceModel(workspace);
-		m_portalList.setWorkspaceModel(workspace);
-		m_portal.setWorkspaceModel(workspace);
-	}
+    /**
+     * To be overwritten by children class with class specific logic. 
+     * 
+     * @param portal
+     * @return
+     */
+    protected abstract PersistentPortal createPortalDisplay(
+                                            PortalSelectionModel portal);
 
-	public Workspace getSelectedWorkspace(PageState state) {
-		return m_workspace.getSelectedWorkspace(state);
-	}
+    /**
+     * 
+     */ 
+    public void register(Page page) {
 
-	protected abstract PortalList createPortalList(PortalSelectionModel portal);
+        super.register(page);
+        page.addComponentStateParam(this, m_portal.getStateParameter());
 
-	protected abstract PersistentPortal createPortalDisplay(
-			PortalSelectionModel portal);
-
-	public void register(Page page) {
-		super.register(page);
-
-		page.addComponentStateParam(this, m_portal.getStateParameter());
-	}
+    }
 
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/ApplicationPortlet.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/ApplicationPortlet.java
index cb418e788..973898e1f 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/ApplicationPortlet.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/ApplicationPortlet.java
@@ -27,35 +27,55 @@ import com.arsdigita.xml.Element;
 
 public class ApplicationPortlet extends AbstractPortletRenderer {
 
-	private RequestLocal m_parent;
+    private RequestLocal m_parent;
+    private Component m_portletComponent;
+    private Component m_appComponent;
 
-	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) {
 
-	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);
+        Assert.exists(parent, RequestLocal.class);
+        Assert.exists(portletComponent, Component.class);
+        Assert.exists(appComponent, Component.class);
 
-		m_parent = parent;
-		m_portletComponent = portletComponent;
-		m_appComponent = appComponent;
+        m_parent = parent;
+        m_portletComponent = portletComponent;
+        m_appComponent = appComponent;
 
-		setTitle(title);
-		setCellNumber(column);
-		setSortKey(row);
-	}
+        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);
+        }
+
+    }
 
-	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);
-		}
-	}
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/ApplicationSelector.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/ApplicationSelector.java
index cc7d94a24..903533172 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/ApplicationSelector.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/ApplicationSelector.java
@@ -31,64 +31,83 @@ 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);
 
-	private ApplicationType m_type;
-	private SingleSelect m_apps;
-	private DomainObjectParameter m_app;
-	private SaveCancelSection m_buttons;
+    private ApplicationType m_type;
+    private SingleSelect m_apps;
+    private DomainObjectParameter m_app;
+    private SaveCancelSection m_buttons;
 
     private PrivilegeDescriptor m_privilege;
-	
-	public ApplicationSelector(ApplicationType type,
-							DomainObjectParameter app) {
-								this(type, app, null);	
-							}
 
+    /**
+     * 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) {
-		super("applicationSelector");
+        super("applicationSelector");
 
-		m_type = type;
-		m_app = app;
+        m_type = type;
+        m_app = app;
         m_privilege = privilege;
-        
+
         s_log.debug("displayed applications will be filtered by privilege " +
                     m_privilege);
 
-		m_apps = new SingleSelect(new DomainObjectParameter("apps"));
-		m_apps.addValidationListener(new NotNullValidationListener());
-		try {
-			m_apps.addPrintListener(new AppPrintListener());
-		} catch (TooManyListenersException ex) {
-			throw new UncheckedWrapperException("this cannot happen", ex);
-		}
-		add(m_apps);
+        m_apps = new SingleSelect(new DomainObjectParameter("apps"));
+        m_apps.addValidationListener(new NotNullValidationListener());
+        try {
+            m_apps.addPrintListener(new AppPrintListener());
+        } catch (TooManyListenersException ex) {
+            throw new UncheckedWrapperException("this cannot happen", ex);
+        }
+        add(m_apps);
 
-		m_buttons = new SaveCancelSection(new SimpleContainer());
-		add(m_buttons);
+        m_buttons = new SaveCancelSection(new SimpleContainer());
+        add(m_buttons);
 
-		addProcessListener(new AppProcessListener());
-		addSubmissionListener(new AppSubmissionListener());
-	}
+        addProcessListener(new AppProcessListener());
+        addSubmissionListener(new AppSubmissionListener());
+    }
 
-	private class AppSubmissionListener implements FormSubmissionListener {
+    /**
+     *
+     */
+    private class AppSubmissionListener implements FormSubmissionListener {
         public void submitted(FormSectionEvent e) 
             throws FormProcessException {
 			if (m_buttons.getCancelButton().isSelected(e.getPageState())) {
@@ -98,40 +117,53 @@ public class ApplicationSelector extends Form {
 			}
 			s_log.debug("Falling through for process");
 		}
-	}
-	private class AppProcessListener implements FormProcessListener {
-        public void process(FormSectionEvent e) 
-            throws FormProcessException {
-			s_log.debug("Firing event for process");
+    }
 
-			PageState state = e.getPageState();
+    /**
+     *
+     */
+    private class AppProcessListener implements FormProcessListener {
 
-			state.setValue(m_app, m_apps.getValue(state));
+        public void process(FormSectionEvent e) throws FormProcessException {
+            s_log.debug("Firing event for process");
+
+            PageState state = e.getPageState();
+
+            state.setValue(m_app, m_apps.getValue(state));
 			fireCompletionEvent(e.getPageState());
-		}
-	}
-	private class AppPrintListener implements PrintListener {
-		public void prepare(PrintEvent e) {
-			ApplicationCollection apps = Application.retrieveAllApplications();
+        }
+    }
+
+    /**
+     *
+     */
+    private class AppPrintListener implements PrintListener {
+
+        /**
+         *
+         * @param e
+         */
+        public void prepare(PrintEvent e) {
+            ApplicationCollection apps = Application.retrieveAllApplications();
             apps.addEqualsFilter("resourceType.id",
                                  m_type.getID());
             if (m_privilege != null) {
             	Party user = Kernel.getContext().getParty();
-            	if (user == null) {
-            		user = Kernel.getPublicUser();
-            	}
-            	PermissionService.filterObjects(apps,m_privilege, user.getOID());
+                if (user == null) {
+                    user = Kernel.getPublicUser();
+                }
+                PermissionService.filterObjects(apps,m_privilege, user.getOID());
             }
-			apps.addOrder("primaryURL");
+            apps.addOrder("primaryURL");
 
-			SingleSelect t = (SingleSelect) e.getTarget();
-            t.addOption(new Option(null,
-                                   "--select one--"));
-			while (apps.next()) {
-				Application app = apps.getApplication();
+            SingleSelect t = (SingleSelect) e.getTarget();
+            t.addOption(new Option(null, "--select one--"));
+            while (apps.next()) {
+                Application app = apps.getApplication();
                 t.addOption(new Option(app.getOID().toString(),
                                        app.getTitle() + " (" + app.getPath() + ")"));
-			}
-		}
-	}
+            }
+        }
+    }
+
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultPortalSelectionModel.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultPortalSelectionModel.java
index 715093344..f5f0710a8 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultPortalSelectionModel.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultPortalSelectionModel.java
@@ -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,66 +26,106 @@ 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 {
+		                         implements PortalSelectionModel {
 
-	private WorkspaceSelectionModel m_workspace;
+    private WorkspaceSelectionModel m_workspace;
 
-	public DefaultPortalSelectionModel(BigDecimalParameter param) {
-		this(null, param);
-	}
+    /**
+     *
+     * @param param
+     */
+    public DefaultPortalSelectionModel(BigDecimalParameter param) {
+        this(null, param);
+    }
 
-	public DefaultPortalSelectionModel(WorkspaceSelectionModel workspace,
-			                           BigDecimalParameter param) {
-		super(WorkspacePage.class.getName(),
-				WorkspacePage.BASE_DATA_OBJECT_TYPE, param);
+    public DefaultPortalSelectionModel(WorkspaceSelectionModel workspace,
+                                       BigDecimalParameter param) {
+        super(WorkspacePage.class.getName(),
+              WorkspacePage.BASE_DATA_OBJECT_TYPE, param);
 
-		m_workspace = workspace;
-	}
+        m_workspace = workspace;
+    }
 
-	public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
-		m_workspace = workspace;
-	}
+    /**
+     *
+     * @param workspace
+     */
+    public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
+        m_workspace = workspace;
+    }
 
-	public Workspace getSelectedWorkspace(PageState state) {
-		return m_workspace.getSelectedWorkspace(state);
-	}
+    /**
+     *
+     * @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);
-	}
+    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);
-		}
+    public DomainObject getSelectedObject(PageState state) {
+        BigDecimal key = (BigDecimal) super.getSelectedKey(state);
+        if (key == null) {
+            loadDefaultPortal(state);
+        }
+        return super.getSelectedObject(state);
+    }
 
-		return super.getSelectedObject(state);
-	}
+    /**
+     *
+     * @param state
+     * @return
+     */
+    public WorkspacePage getSelectedPortal(PageState state) {
+        return (WorkspacePage) getSelectedObject(state);
+    }
 
-	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);
+        if (portals.next()) {
+            WorkspacePage portal = portals.getPage();
+            setSelectedObject(state, portal);
+            portals.close();
+        } else {
+            WorkspacePage portal = workspace.addPage("Main", "Main page");
+            setSelectedObject(state, portal);
+        }
+
+    }
 
-	private void loadDefaultPortal(PageState state) {
-		Workspace workspace = getSelectedWorkspace(state);
-		WorkspacePageCollection portals = workspace.getPages();
-		portals.addOrder(WorkspacePage.SORT_KEY);
-		if (portals.next()) {
-			WorkspacePage portal = portals.getPage();
-			setSelectedObject(state, portal);
-			portals.close();
-		} else {
-			WorkspacePage portal = workspace.addPage("Main", "Main page");
-			setSelectedObject(state, portal);
-		}
-	}
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultWorkspace.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultWorkspace.java
index ff5bc0da9..19d340644 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultWorkspace.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultWorkspace.java
@@ -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,79 +35,94 @@ 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
      */
     public DefaultWorkspace() {
-		super(new DefaultWorkspaceSelectionModel());
+        super(new DefaultWorkspaceSelectionModel());
 
-		addCustomizeListener(this);
-	}
+        addCustomizeListener(this);
+    }
 
-	/**
+    /**
      * 
      * @param e
      */
     public void actionPerformed(ActionEvent e) {
-		PageState state = e.getPageState();
+        PageState state = e.getPageState();
+        Workspace workspace = getWorkspaceModel().getSelectedWorkspace(state);
 
-		Workspace workspace = getWorkspaceModel().getSelectedWorkspace(state);
+        Party party = Kernel.getContext().getParty();
+        if (party == null) {
+            throw new LoginSignal(state.getRequest());
+        }
 
-		Party party = Kernel.getContext().getParty();
-		if (party == null) {
-			throw new LoginSignal(state.getRequest());
-		}
+        PermissionDescriptor admin = new PermissionDescriptor(
+                PrivilegeDescriptor.ADMIN, workspace, party);
 
-		PermissionDescriptor admin = new PermissionDescriptor(
-				PrivilegeDescriptor.ADMIN, workspace, party);
+        // don't create user workspaces if the required parameter is set
+        if (!party.equals(workspace.getParty())
+                && !PermissionService.checkPermission(admin)
+                && Workspace.getConfig().getCreateUserWorkspaces()) {
 
-		// don't create user workspaces if the required parameter is set
-		if (!party.equals(workspace.getParty())
-				&& !PermissionService.checkPermission(admin)
-				&& Workspace.getConfig().getCreateUserWorkspaces()) {
+            // Clone the workspace
+            Workspace parent = (Workspace) Kernel.getContext().getResource();
 
-			// Clone the workspace
-			Workspace parent = (Workspace) Kernel.getContext().getResource();
+            Workspace clone = Workspace.createWorkspace("personal-"
+                    + party.getID(), "Personal Workspace for "
+                    + party.getDisplayName(), parent, (User) party);
 
-			Workspace clone = Workspace.createWorkspace("personal-"
-					+ party.getID(), "Personal Workspace for "
-					+ party.getDisplayName(), parent, (User) party);
+            BigDecimal old_id = (BigDecimal) getPortalModel()
+                                                 .getSelectedKey(state);
+            BigDecimal new_id = null;
 
-			BigDecimal old_id = (BigDecimal) getPortalModel().getSelectedKey(
-					state);
-			BigDecimal new_id = null;
+            WorkspacePageCollection pages = workspace.getPages();
+            pages.addOrder(WorkspacePage.SORT_KEY);
+            while (pages.next()) {
+                WorkspacePage old_page = pages.getPage();
+                WorkspacePage new_page = clone.addPage(old_page.getTitle(),
+                                                       old_page.getDescription(),
+                                                       old_page.getLayout(),
+                                                       old_page.getSortKey());
 
-			WorkspacePageCollection pages = workspace.getPages();
-			pages.addOrder(WorkspacePage.SORT_KEY);
-			while (pages.next()) {
-				WorkspacePage old_page = pages.getPage();
-				WorkspacePage new_page = clone.addPage(old_page.getTitle(),
-						old_page.getDescription(), old_page.getLayout(),
-						old_page.getSortKey());
+                if (old_page.getID().equals(old_id)) {
+                    new_id = new_page.getID();
+                }
 
-				if (old_page.getID().equals(old_id)) {
-					new_id = new_page.getID();
-				}
+                PortletCollection portlets = old_page.getPortlets();
+                while (portlets.next()) {
+                    Portlet old_portlet = portlets.getPortlet();
+                    Portlet new_portlet = (Portlet) new DomainObjectCopier()
+                                                            .copy(old_portlet);
+                    new_page.addPortlet(new_portlet, old_portlet
+                                                         .getCellNumber());
+                }
+            }
+            clone.save();
 
-				PortletCollection portlets = old_page.getPortlets();
-				while (portlets.next()) {
-					Portlet old_portlet = portlets.getPortlet();
-					Portlet new_portlet = (Portlet) new DomainObjectCopier()
-							.copy(old_portlet);
-					new_page.addPortlet(new_portlet, old_portlet
-							.getCellNumber());
-				}
-			}
-			clone.save();
-
-			getPortalModel().setSelectedKey(state, new_id);
-			getWorkspaceModel().setSelectedWorkspace(state, workspace);
-		}
-	}
+            getPortalModel().setSelectedKey(state, new_id);
+            getWorkspaceModel().setSelectedWorkspace(state, workspace);
+        }
+    }
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultWorkspaceSelectionModel.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultWorkspaceSelectionModel.java
index 6729b7eaf..72fb369ac 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultWorkspaceSelectionModel.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/DefaultWorkspaceSelectionModel.java
@@ -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 {
 
-	protected Workspace getDefaultWorkspace(PageState state) {
-		Workspace workspace = (Workspace) Kernel.getContext().getResource();
-		Party party = Kernel.getContext().getParty();
+    /**
+     *
+     * @param state
+     * @return
+     */
+    protected Workspace getDefaultWorkspace(PageState state) {
 
-		if (party != null) {
-			try {
-				workspace = workspace.retrieveSubworkspaceForParty(party);
+        Workspace workspace = (Workspace) Kernel.getContext().getResource();
+        Party party = Kernel.getContext().getParty();
 
-			} catch (DataObjectNotFoundException ex) {
-				// fall through
-			}
-		}
+        if (party != null) {  // the visitor is logged in
+            try {
+                 workspace = workspace.retrieveSubworkspaceForParty(party);
 
-		return workspace;
-	}
+            } catch (DataObjectNotFoundException ex) {
+                // fall through
+                // pboy: i.e. a generell default workspace initialized at the
+                // beginning is provided.
+            }
+        }
+
+        return workspace;
+
+    }
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PackageWorkspace.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PackageWorkspace.java
index 1720abaee..8495e003f 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PackageWorkspace.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PackageWorkspace.java
@@ -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,56 +31,96 @@ 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();
+    private RequestLocal m_isAdmin = new RequestLocal();
+    
+    /**
+     * 
+     */
+    public PackageWorkspace() {
+        super(new PackageWorkspaceSelectionModel());
+        addCustomizeListener(new CustomizeListener());
+    }
 
-	public PackageWorkspace() {
-		super(new PackageWorkspaceSelectionModel());
+    /**
+     * 
+     * @param parent
+     * @param child
+     */
+    protected void addCustomizeLinks(Container parent, Component child) {
+        Container secure = new WorkspaceSecurityContainer(child);
+        super.addCustomizeLinks(parent, secure);
+    }
 
-		addCustomizeListener(new CustomizeListener());
-	}
 
-	protected void addCustomizeLinks(Container parent, Component child) {
-		Container secure = new WorkspaceSecurityContainer(child);
-		super.addCustomizeLinks(parent, secure);
-	}
+    /**
+     *
+     */
+    private class CustomizeListener implements ActionListener {
 
-	private class CustomizeListener implements ActionListener {
-		public void actionPerformed(ActionEvent e) {
-			PageState state = e.getPageState();
+        /**
+         * 
+         * @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) {
-				throw new LoginSignal(state.getRequest());
-			}
+            Party party = Kernel.getContext().getParty();
+            if (party == null) {
+                throw new LoginSignal(state.getRequest());
+            }
 
-			if (!PortalHelper.canCustomize(party, workspace)) {
-				throw new AccessDeniedException(
-						"no permission to customize workspace");
-			}
-		}
-	}
+            if (!PortalHelper.canCustomize(party, workspace)) {
+                throw new AccessDeniedException(
+                        "no permission to customize workspace");
+            }
+        }
 
-	private class WorkspaceSecurityContainer extends SecurityContainer {
+    }
 
-		public WorkspaceSecurityContainer(Component c) {
-			super(c);
-		}
+    /**
+     *
+     */
+    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);
+                boolean canAccess = PortalHelper.canCustomize(party, workspace);
+                isAdmin = new Boolean(canAccess);
+                m_isAdmin.set(state, isAdmin);
+            }
+            return isAdmin.booleanValue();
+        }
+    }
 
-		protected boolean canAccess(Party party, PageState state) {
-			Boolean isAdmin = (Boolean) m_isAdmin.get(state);
-			if (isAdmin == null) {
-				Workspace workspace = getWorkspaceModel().getSelectedWorkspace(
-						state);
-				boolean canAccess = PortalHelper.canCustomize(party, workspace);
-				isAdmin = new Boolean(canAccess);
-				m_isAdmin.set(state, isAdmin);
-			}
-			return isAdmin.booleanValue();
-		}
-	}
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PackageWorkspaceSelectionModel.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PackageWorkspaceSelectionModel.java
index aee552953..a82f9ea32 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PackageWorkspaceSelectionModel.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PackageWorkspaceSelectionModel.java
@@ -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 {
 
-	protected Workspace getDefaultWorkspace(PageState state) {
-		return (Workspace) Kernel.getContext().getResource();
-	}
+    /**
+     * 
+     * @param state
+     * @return
+     */
+    protected Workspace getDefaultWorkspace(PageState state) {
+        return (Workspace) Kernel.getContext().getResource();
+    }
+
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PersistentPortal.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PersistentPortal.java
index 88c8a10a5..13b24d552 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PersistentPortal.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PersistentPortal.java
@@ -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,131 +83,145 @@ import org.apache.log4j.Logger;
  */
 public class PersistentPortal extends SimpleContainer {
 
-	public static final String ACTION_CUSTOMIZE = "customize";
-	public static final String ACTION_MOVE_UP = "moveUp";
-	public static final String ACTION_MOVE_DOWN = "moveDown";
-	public static final String ACTION_MOVE_LEFT = "moveLeft";
-	public static final String ACTION_MOVE_RIGHT = "moveRight";
-
-
-	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;
-	private PortletSelectionModel m_portlet;
+    public static final String ACTION_CUSTOMIZE = "customize";
+    public static final String ACTION_MOVE_UP = "moveUp";
+    public static final String ACTION_MOVE_DOWN = "moveDown";
+    public static final String ACTION_MOVE_LEFT = "moveLeft";
+    public static final String ACTION_MOVE_RIGHT = "moveRight";
 
-	private String m_mode;
-	private int m_columns;
 
-	private PortletTypeForm m_adders[];
-	private HashMap m_create;
-	private HashMap m_modify;
-	private HashMap m_createApp;
+    public static final String ACTION_DELETE = "delete";
 
-	private RequestLocal m_parentResource;
-	private RequestLocal m_currentResource;
-	private RequestLocal m_currentApp;
-	private PortalModelBuilder m_portalModelBuilder;
-	private DomainObjectParameter m_parentApp;
+    private WorkspaceSelectionModel m_workspace;
+    private PortalSelectionModel m_portal;
+    private PortletTypeSelectionModel m_portletType;
+    private PortletSelectionModel m_portlet;
 
-	private SingleSelectionModel m_column;
+    private String m_mode;
+    private int m_columns;
 
-	// Ought to be enough until browser window size is a few thousand
-	// pixels wide...
-	public static final int MAX_COLUMNS = 10;
+    private PortletTypeForm m_adders[];
+    private HashMap m_create;
+    private HashMap m_modify;
+    private HashMap m_createApp;
 
+    private RequestLocal m_parentResource;
+    private RequestLocal m_currentResource;
+    private RequestLocal m_currentApp;
+    private PortalModelBuilder m_portalModelBuilder;
+    private DomainObjectParameter m_parentApp;
+
+    private SingleSelectionModel m_column;
+
+    // Ought to be enough until browser window size is a few thousand
+    // pixels wide...
+    public static final int MAX_COLUMNS = 10;
+
+
+    /**
+     * Constructor
+     * @param portal
+     * @param mode
+     */
     public PersistentPortal(PortalSelectionModel portal,
                             String mode) {
-		this(portal, "portal", 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);
+                            String mode) {
+        
+        setTag("portal:portal");
+        setNamespace(PortalConstants.PORTAL_XML_NS);
 
-		s_log.debug("IN constructor" + name + " " + mode);
-		m_adders = new PortletTypeForm[MAX_COLUMNS];
-		m_mode = mode;
-		m_portal = portal;
+        s_log.debug("IN constructor" + name + " " + mode);
+        m_adders = new PortletTypeForm[MAX_COLUMNS];
+        m_mode = mode;
+        m_portal = portal;
 
         m_column = new ParameterSingleSelectionModel(new IntegerParameter("column"));
-        
 
-		if (m_mode.equals(PortalConstants.MODE_EDITOR)) {
-			for (int i = 0; i < m_adders.length; i++) {
-				m_adders[i] = new PortletTypeForm("add" + name + i);
-				m_adders[i].setRedirecting(true);
-				add(m_adders[i]);
-				m_adders[i].addProcessListener(new PortletAddListener(m_portal,
-						i + 1));
-			}
+
+        if (m_mode.equals(PortalConstants.MODE_EDITOR)) {
+            for (int i = 0; i < m_adders.length; i++) {
+                m_adders[i] = new PortletTypeForm("add" + name + i);
+                m_adders[i].setRedirecting(true);
+                add(m_adders[i]);
+                m_adders[i].addProcessListener(new PortletAddListener(m_portal,
+                                                                      i + 1));
+            }
 
             m_portlet = new PortletSelectionModel(
-                new BigDecimalParameter("edit")
-            );
-			m_portletType = new PortletTypeSelectionModel(
-                new BigDecimalParameter("create")
-            );
+                                new BigDecimalParameter("edit") );
+            m_portletType = new PortletTypeSelectionModel(
+                                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);
-						s_log.debug("Setting portal" + portal);
-						m_parentResource.set(state, portal);
-					} else {
-						s_log.debug("Clearing portal");
-						m_parentResource.set(state, null);
-					}
-				}
-			});
-			m_portlet.addChangeListener(new ChangeListener() {
-				public void stateChanged(ChangeEvent event) {
-					PageState state = event.getPageState();
-					if (m_portal.isSelected(state)) {
-                            com.arsdigita.portal.Portlet portlet = 
+            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);
+                        s_log.debug("Setting portal" + portal);
+                        m_parentResource.set(state, portal);
+                    } else {
+                        s_log.debug("Clearing portal");
+                        m_parentResource.set(state, null);
+                    }
+                }
+            });
+            
+            m_portlet.addChangeListener(new ChangeListener() {
+                public void stateChanged(ChangeEvent event) {
+                    PageState state = event.getPageState();
+                    if (m_portal.isSelected(state)) {
+                        com.arsdigita.portal.Portlet portlet = 
                                 m_portlet.getSelectedPortlet(state);
-						s_log.debug("Setting portlet" + portlet);
-						m_currentResource.set(state, portlet);
-					} else {
-						s_log.debug("Clearing portlet");
-						m_currentResource.set(state, null);
-					}
-				}
-			});
+                        s_log.debug("Setting portlet" + portlet);
+                        m_currentResource.set(state, portlet);
+                    } else {
+                        s_log.debug("Clearing portlet");
+                        m_currentResource.set(state, null);
+                    }
+                }
+            });
 
-			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();
-				}
-			};
+            m_parentApp = new DomainObjectParameter("parentApp");
 
-			PortletTypeCollection types = PortletType.retrieveAllPortletTypes();
-			m_create = new HashMap();
-			m_modify = new HashMap();
-			m_createApp = new HashMap();
-			s_log.debug("Do add types");
-			while (types.next()) {
-				PortletType type = types.getPortletType();
-				s_log.debug("Add type " + type.getResourceObjectType());
+            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();
+                }
+            };
+
+            PortletTypeCollection types = PortletType.retrieveAllPortletTypes();
+            m_create = new HashMap();
+            m_modify = new HashMap();
+            m_createApp = new HashMap();
+            s_log.debug("Do add types");
+            while (types.next()) {
+                PortletType type = types.getPortletType();
+                s_log.debug("Add type " + type.getResourceObjectType());
 
                 final ResourceConfigComponent create = 
                     type.getCreateComponent(m_parentResource);
@@ -219,104 +229,106 @@ public class PersistentPortal extends SimpleContainer {
                     type.getModifyComponent(m_currentResource);
 
 
-				ApplicationType appType = type.getProviderApplicationType();
-				SimpleContainer createApp = null;
-				if (appType != null) {
+                ApplicationType appType = type.getProviderApplicationType();
+                SimpleContainer createApp = null;
+                if (appType != null) {
                     final ResourceConfigComponent appCreate = 
                         appType.getCreateComponent(m_currentApp);
-					ApplicationSelector sel = new ApplicationSelector(appType,
-                                                                      m_parentApp,
-                                                                      appType.getConfig() == null ? null : appType.getConfig().getViewPrivilege());
-					appCreate.addCompletionListener(new ActionListener() {
-						public void actionPerformed(ActionEvent e) {
-							PageState state = e.getPageState();
-							s_log.debug("Do create of portlet");
-							Resource resource = appCreate.createResource(state);
-							if (resource == null) {
-								s_log.debug("No resource, reset");
-								m_portletType.clearSelection(e.getPageState());
-							} else {
-								s_log.debug("Seting res to " + resource);
-								state.setValue(m_parentApp, resource);
-							}
-						}
-					});
-					sel.addCompletionListener(new ActionListener() {
-						public void actionPerformed(ActionEvent e) {
-							PageState state = e.getPageState();
-							if (state.getValue(m_parentApp) == null) {
-								s_log.debug("Sel no resource, reset");
-								m_portletType.clearSelection(e.getPageState());
-							} else {
-                                    s_log.debug("Got res " + 
-                                                state.getValue(m_parentApp));
-							}
-						}
-					});
+                    ApplicationSelector sel = new ApplicationSelector(
+                                                      appType,
+                                                      m_parentApp,
+                                                      appType.getConfig() == null ? null : appType.getConfig().getViewPrivilege());
+                    appCreate.addCompletionListener(new ActionListener() {
+                        public void actionPerformed(ActionEvent e) {
+                            PageState state = e.getPageState();
+                            s_log.debug("Do create of portlet");
+                            Resource resource = appCreate.createResource(state);
+                            if (resource == null) {
+                                s_log.debug("No resource, reset");
+                                m_portletType.clearSelection(e.getPageState());
+                            } else {
+                                s_log.debug("Seting res to " + resource);
+                                state.setValue(m_parentApp, resource);
+                            }
+                        }
+                    });
 
-					createApp = new SimpleContainer();
-					createApp.add(appCreate);
-					createApp.add(sel);
-				}
+                    sel.addCompletionListener(new ActionListener() {
+                        public void actionPerformed(ActionEvent e) {
+                            PageState state = e.getPageState();
+                            if (state.getValue(m_parentApp) == null) {
+                                s_log.debug("Sel no resource, reset");
+                                m_portletType.clearSelection(e.getPageState());
+                            } else {
+                                s_log.debug("Got res " + 
+                                            state.getValue(m_parentApp));
+                            }
+                        }
+                    });
 
-				s_log.debug("Create component is " + create);
-				s_log.debug("Modify component is " + modify);
+                    createApp = new SimpleContainer();
+                    createApp.add(appCreate);
+                    createApp.add(sel);
+                }
 
-				create.addCompletionListener(new ActionListener() {
-					public void actionPerformed(ActionEvent e) {
-						PageState state = e.getPageState();
-						s_log.debug("Do create of portlet");
-						Resource resource = create.createResource(state);
+                s_log.debug("Create component is " + create);
+                s_log.debug("Modify component is " + modify);
 
-						if (resource != null) {
-                                Integer column = (Integer)
-                                    m_column.getSelectedKey(state);
-							Assert.exists(column, Integer.class);
+                create.addCompletionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        PageState state = e.getPageState();
+                        s_log.debug("Do create of portlet");
+                        Resource resource = create.createResource(state);
 
-                                WorkspacePage portal = 
-                                    m_portal.getSelectedPortal(state);
-                                portal.addPortlet((Portlet)resource, 
+                        if (resource != null) {
+                            Integer column = (Integer)
+                                             m_column.getSelectedKey(state);
+                            Assert.exists(column, Integer.class);
+
+                            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
-						if (resource instanceof StatefulPortlet) {
-							s_log.debug("Stateful portlet added");
-							// check if the maximum number of stateful
-							// portlets has increased
-                                PortletType portletType =
+                            portal.save();
+                        }
+
+                        // added cg - remove cached page if max existing
+                        // stateful portlet count is exceeded so page is
+                        // rebuilt with correct number of renderers
+                        if (resource instanceof StatefulPortlet) {
+                            s_log.debug("Stateful portlet added");
+                            // check if the maximum number of stateful
+                            // portlets has increased
+                            PortletType portletType =
                                     ((Portlet) resource).getPortletType();
-                                DataQuery findMaxInstances =
+                            DataQuery findMaxInstances =
                                     SessionManager.getSession().retrieveQuery(
                                         "com.arsdigita.london.portal.MaxPortletInstances");
-                                findMaxInstances.setParameter(
-                                    "portletType",
-									portletType.getID());
-							int maxCount = 0;
-							while (findMaxInstances.next()) {
+                            findMaxInstances.setParameter("portletType",
+                                                          portletType.getID());
+                            int maxCount = 0;
+                            while (findMaxInstances.next()) {
                                     maxCount =
                                         ((Integer) findMaxInstances
                                             .get("maxCount"))
                                             .intValue();
-							}
-							String key = portletType.getResourceObjectType();
+                            }
 
-                                int previousMax = StatefulPersistentPortal.getCurrentPortletRendererInstances(key);
+                            String key = portletType.getResourceObjectType();
 
-                                s_log.debug(
-                                    portletType
-                                        + ": previous count = "
-                                        + previousMax
-                                        + " | new max = "
+                            int previousMax = StatefulPersistentPortal
+                                              .getCurrentPortletRendererInstances(key);
+
+                            s_log.debug(  portletType + ": previous count = "
+                                        + previousMax + " | new max = "
                                         + maxCount);
-							if (maxCount > previousMax) {
-									DefinePage.invalidatePage(DispatcherHelper.getCurrentResourcePath(state.getRequest())); }
-						}
-						m_portletType.clearSelection(e.getPageState());
+                            if (maxCount > previousMax) {
+                                DefinePage.invalidatePage(
+                                    DispatcherHelper
+                                    .getCurrentResourcePath(state.getRequest())); }
+                        }
+
+                        m_portletType.clearSelection(e.getPageState());
 						state.setValue(m_parentApp, null);
 						m_parentResource.set(state, null);
 					}
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PersonalPortalPage.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PersonalPortalPage.java
index 568299e50..f8bfd6333 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PersonalPortalPage.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PersonalPortalPage.java
@@ -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;
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalEditForm.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalEditForm.java
index 49a3a4bb2..68449ed44 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalEditForm.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalEditForm.java
@@ -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;
@@ -44,76 +47,102 @@ import com.arsdigita.util.Assert;
 public class PortalEditForm extends Form implements FormProcessListener,
 		FormInitListener {
 
-	private WorkspaceSelectionModel m_workspace;
+    private WorkspaceSelectionModel m_workspace;
+    private PortalSelectionModel m_portal;
+    private TextField m_title;
+    private Submit m_save;
 
-	private PortalSelectionModel m_portal;
 
-	private TextField m_title;
+    /**
+     *
+     * @param portal
+     */
+    public PortalEditForm(PortalSelectionModel portal) {
+        this(null, portal);
+    }
 
-	private Submit m_save;
 
-	public PortalEditForm(PortalSelectionModel portal) {
-		this(null, portal);
-	}
+    /** 
+     * 
+     * @param workspace
+     * @param portal
+     */
+    public PortalEditForm(WorkspaceSelectionModel workspace,
+                          PortalSelectionModel portal) {
 
-	public PortalEditForm(WorkspaceSelectionModel workspace,
-			PortalSelectionModel portal) {
-		super("editPortal", new SimpleContainer("portal:editPortal",
-				PortalConstants.PORTAL_XML_NS));
+        super("editPortal", new SimpleContainer("portal:editPortal",
+                                                PortalConstants.PORTAL_XML_NS));
 
-		m_workspace = workspace;
-		m_portal = portal;
+        m_workspace = workspace;
+        m_portal = portal;
 
-		m_title = new TextField(new StringParameter("title"));
-		m_title.addValidationListener(new NotNullValidationListener());
-		m_title
-				.addValidationListener(new StringInRangeValidationListener(1,
-						40));
+        m_title = new TextField(new StringParameter("title"));
+        m_title.addValidationListener(new NotNullValidationListener());
+        m_title.addValidationListener(new StringInRangeValidationListener(1,40));
 
-		m_save = new Submit("Save");
+        m_save = new Submit("Save");
 
-		add(m_title);
-		add(m_save);
+        add(m_title);
+        add(m_save);
 
-		addProcessListener(this);
-		addInitListener(this);
-	}
+        addProcessListener(this);
+        addInitListener(this);
+    }
 
-	public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
-		m_workspace = workspace;
-	}
+    /**
+     *
+     * @param workspace
+     */
+    public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
+        m_workspace = workspace;
+    }
 
-	public Workspace getSelectedWorkspace(PageState state) {
-		return m_workspace.getSelectedWorkspace(state);
-	}
+    /**
+     * 
+     * @param state
+     * @return
+     */
+    public Workspace getSelectedWorkspace(PageState state) {
+        return m_workspace.getSelectedWorkspace(state);
+    }
 
-	public void init(FormSectionEvent e) {
-		PageState state = e.getPageState();
+    /**
+     * 
+     * @param e
+     */
+    public void init(FormSectionEvent e) {
 
-		WorkspacePage portal = (WorkspacePage) m_portal
-				.getSelectedPortal(state);
+        PageState state = e.getPageState();
+        WorkspacePage portal = (WorkspacePage) m_portal
+                .getSelectedPortal(state);
 
-		Assert.exists(portal, WorkspacePage.class);
 
-		m_title.setValue(state, portal.getTitle());
-	}
+        Assert.exists(portal, WorkspacePage.class);
+        m_title.setValue(state, portal.getTitle());
 
-	public void process(FormSectionEvent e) {
-		PageState state = e.getPageState();
+    }
 
-		Workspace workspace = getSelectedWorkspace(state);
-		Party party = Kernel.getContext().getParty();
-		if (!PortalHelper.canCustomize(party, workspace)) {
-			throw new AccessDeniedException(
-					"no permissions to customize workspace");
+    /**
+     * 
+     * @param e
+     */
+    public void process(FormSectionEvent e) {
+        PageState state = e.getPageState();
+
+        Workspace workspace = getSelectedWorkspace(state);
+        Party party = Kernel.getContext().getParty();
+        if (!PortalHelper.canCustomize(party, workspace)) {
+                              throw new AccessDeniedException(
+                                  "no permissions to customize workspace");
 		}
 
-		WorkspacePage portal = (WorkspacePage) m_portal
-				.getSelectedPortal(state);
+        WorkspacePage portal = (WorkspacePage) m_portal.getSelectedPortal(state);
 
-		Assert.exists(portal, WorkspacePage.class);
+        Assert.exists(portal, WorkspacePage.class);
+
+        String title = (String) m_title.getValue(state);
+        portal.setTitle(title);
+
+    }
 
-		String title = (String) m_title.getValue(state);
-		portal.setTitle(title);
-	}
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalEditModelBuilder.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalEditModelBuilder.java
index 23de06a67..c91737665 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalEditModelBuilder.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalEditModelBuilder.java
@@ -37,139 +37,197 @@ 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 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;
 
-	private Component m_adders[];
+    /**
+     * 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,
+                                  RequestLocal parentResource) {
 
-	private PortalSelectionModel m_portal;
+        Assert.exists(portal, PortalSelectionModel.class);
+        Assert.exists(adders, Component.class);
+        Assert.exists(creating, PortletTypeSelectionModel.class);
+        Assert.exists(column, SingleSelectionModel.class);
+        Assert.exists(editing, PortletSelectionModel.class);
+        Assert.exists(create, HashMap.class);
+        Assert.exists(modify, HashMap.class);
+        Assert.exists(createApp, HashMap.class);
+        Assert.exists(parentResource, RequestLocal.class);
 
-	private PortletTypeSelectionModel m_creating;
+        m_portal = portal;
+        m_adders = adders;
+        m_create = create;
+        m_modify = modify;
+        m_creating = creating;
+        m_column = column;
+        m_editing = editing;
+        m_parentResource = parentResource;
+        m_createApp = createApp;
 
-	private SingleSelectionModel m_column;
+    }
 
-	private PortletSelectionModel m_editing;
 
-	private HashMap m_create;
+    /**
+     * Actually builds the logic for the pane under consideration.
+     * 
+     * @param state
+     * @return
+     */
+    public PortalModel buildModel(PageState state) {
 
-	private HashMap m_modify;
+        WorkspacePage portal = m_portal.getSelectedPortal(state);
 
-	private HashMap m_createApp;
+        ArrayList list = new ArrayList();
+        PortletCollection portlets = portal.getPortlets();
+        while (portlets.next()) {
+            com.arsdigita.portal.Portlet portlet = portlets.getPortlet();
+            PortletRenderer renderer = null;
 
-	private RequestLocal m_parentResource;
+            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()
+                                                     .getResourceObjectType()));
+            } else {
+                // Otherwise show the normal portlet XML
+                renderer = (PortletRenderer) portlet.getPortletRenderer();
+            }
+            list.add(new Object[] { renderer, portlet.getID() });
+        }
 
-	public PortalEditModelBuilder(PortalSelectionModel portal,
-			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);
-		Assert.exists(column, SingleSelectionModel.class);
-		Assert.exists(editing, PortletSelectionModel.class);
-		Assert.exists(create, HashMap.class);
-		Assert.exists(modify, HashMap.class);
-		Assert.exists(createApp, HashMap.class);
-		Assert.exists(parentResource, RequestLocal.class);
+        // If we've selected a portlet type then show the form
+        // for creating that portlet
+        if (m_creating.isSelected(state)) {
+            PortletType type = m_creating.getSelectedPortletType(state);
 
-		m_portal = portal;
-		m_adders = adders;
-		m_create = create;
-		m_modify = modify;
-		m_creating = creating;
-		m_column = column;
-		m_editing = editing;
-		m_parentResource = parentResource;
-		m_createApp = createApp;
-	}
+            if (s_log.isDebugEnabled()) {
+                s_log.debug("Selected type " + m_creating.getSelectedKey(state)
+                                             + (type == null ? null : type.getID()));
+            }
 
-	public PortalModel buildModel(PageState state) {
-		WorkspacePage portal = m_portal.getSelectedPortal(state);
+            Component component = (Component) m_create.get(type
+                                                      .getResourceObjectType());
+            Integer column = (Integer) m_column.getSelectedKey(state);
 
-		ArrayList list = new ArrayList();
-		PortletCollection portlets = portal.getPortlets();
-		while (portlets.next()) {
-			com.arsdigita.portal.Portlet portlet = portlets.getPortlet();
-			PortletRenderer renderer = null;
+            if (s_log.isDebugEnabled()) {
+                s_log.debug("Component is " + component + " "
+                           + type.getResourceObjectType());
+            }
 
-			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()
-								.getResourceObjectType()));
-			} else {
-				// Otherwise show the normal portlet XML
-				renderer = (PortletRenderer) portlet.getPortletRenderer();
-			}
-			list.add(new Object[] { renderer, portlet.getID() });
-		}
+            if (type.getProviderApplicationType() == null) {
+                list.add(new SimplePortlet("Create portlet",
+                                           column.intValue(),
+                                           99998,
+                                           component));
+            } else {
+                Component appCreate = (Component) m_createApp
+                                                     .get(type
+                                                     .getResourceObjectType());
+                list.add(new ApplicationPortlet("Create portlet",
+                                                column.intValue(),
+                                                99998,
+                                                m_parentResource,
+                                                component,
+                                                appCreate));
+            }
+        }
 
-		// If we've selected a portlet type then show the form
-		// for creating that portlet
-		if (m_creating.isSelected(state)) {
-			PortletType type = m_creating.getSelectedPortletType(state);
+        // Show the forms for picking a portlet type to create
+        for (int i = 0; i < portal.getLayout().getColumns(); i++) {
+            if (s_log.isDebugEnabled()) {
+                s_log.debug("Adding adder number " + i + m_adders[i]);
+            }
 
-			if (s_log.isDebugEnabled()) {
-				s_log.debug("Selected type " + m_creating.getSelectedKey(state)
-						+ (type == null ? null : type.getID()));
-			}
+            list.add(new SimplePortlet("Add portlet",
+                                       i + 1,
+                                       999999,
+                                       m_adders[i]));
+        }
 
-			Component component = (Component) m_create.get(type
-					.getResourceObjectType());
-			Integer column = (Integer) m_column.getSelectedKey(state);
+        return new PortalEditModel(list.iterator(), portal.getTitle());
 
-			if (s_log.isDebugEnabled()) {
-				s_log.debug("Component is " + component + " "
-						+ type.getResourceObjectType());
-			}
+    }
 
-			if (type.getProviderApplicationType() == null) {
-				list.add(new SimplePortlet("Create portlet", column.intValue(),
-						99998, component));
-			} else {
-				Component appCreate = (Component) m_createApp.get(type
-						.getResourceObjectType());
-				list.add(new ApplicationPortlet("Create portlet", column
-						.intValue(), 99998, m_parentResource, component,
-						appCreate));
-			}
-		}
 
-		// Show the forms for picking a portlet type to create
-		for (int i = 0; i < portal.getLayout().getColumns(); i++) {
-			if (s_log.isDebugEnabled()) {
-				s_log.debug("Adding adder number " + i + m_adders[i]);
-			}
+    /**
+     *
+     */
+    private class PortalEditModel implements PortalModel {
 
-			list.add(new SimplePortlet("Add portlet", i + 1, 999999,
-					m_adders[i]));
-		}
+        private Iterator m_portlets;
+        private String m_title;
 
-		return new PortalEditModel(list.iterator(), portal.getTitle());
-	}
+        /**
+         * 
+         * @param portlets
+         * @param title
+         */
+        public PortalEditModel(Iterator portlets, String title) {
+            m_portlets = portlets;
+            m_title = title;
+        }
 
-	private class PortalEditModel implements PortalModel {
+        /**
+         * 
+         * @return
+         */
+        public Iterator getPortletRenderers() {
+            return m_portlets;
+        }
 
-		private Iterator m_portlets;
+        /**
+         * 
+         * @return
+         */
+        public String getTitle() {
+            return m_title;
+        }
 
-		private String m_title;
+    }
 
-		public PortalEditModel(Iterator portlets, String title) {
-			m_portlets = portlets;
-			m_title = title;
-		}
-
-		public Iterator getPortletRenderers() {
-			return m_portlets;
-		}
-
-		public String getTitle() {
-			return m_title;
-		}
-	}
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalHelper.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalHelper.java
index 92e43a3e0..11d30f34d 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalHelper.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalHelper.java
@@ -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 {
 
-	public static boolean canBrowse(Party party, ACSObject object) {
-		PermissionDescriptor perm = new PermissionDescriptor(
-				PrivilegeDescriptor.READ, object, party);
-		return PermissionService.checkPermission(perm);
-	}
+    /**
+     * 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);
+        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);
+        return PermissionService.checkPermission(perm);
+    }
 
-	public static boolean canCustomize(Party party, ACSObject object) {
-		PermissionDescriptor perm = new PermissionDescriptor(
-				PrivilegeDescriptor.ADMIN, object, party);
-		return PermissionService.checkPermission(perm);
-	}
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalList.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalList.java
index 60263cdae..e84001b60 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalList.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalList.java
@@ -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;
@@ -38,66 +41,66 @@ import com.arsdigita.xml.XML;
  */
 public abstract class PortalList extends SimpleContainer {
 
-	private WorkspaceSelectionModel m_workspace;
+    private WorkspaceSelectionModel m_workspace;
+    private PortalSelectionModel m_portal;
 
-	private PortalSelectionModel m_portal;
+    private Map m_actions = new HashMap();
 
-	private Map m_actions = new HashMap();
 
-	/**
+    /**
      * Constructor.
      * 
      * @param portal
      */
     public PortalList(PortalSelectionModel portal) {
-		this(null, portal);
-	}
+        this(null, portal);
+    }
 
-	/**
+    /**
      * Constructor
      * @param workspace
      * @param portal
      */
     public PortalList(WorkspaceSelectionModel workspace,
                       PortalSelectionModel portal) {
-		super("portal:portalList", PortalConstants.PORTAL_XML_NS);
+        super("portal:portalList", PortalConstants.PORTAL_XML_NS);
 
-		m_workspace = workspace;
-		m_portal = portal;
-	}
+        m_workspace = workspace;
+        m_portal = portal;
+    }
 
-	public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
-		m_workspace = workspace;
-	}
+    public void setWorkspaceModel(WorkspaceSelectionModel workspace) {
+        m_workspace = workspace;
+    }
 
-	protected void addPortalAction(String name, ActionListener listener) {
-		m_actions.put(name, listener);
-	}
+    protected void addPortalAction(String name, ActionListener listener) {
+        m_actions.put(name, listener);
+    }
 
-	public void respond(PageState state) {
-		String name = state.getControlEventName();
+    public void respond(PageState state) {
+        String name = state.getControlEventName();
 
-		ActionListener listener = (ActionListener) m_actions.get(name);
-		if (listener != null) {
-			listener.actionPerformed(new ActionEvent(this, state));
-		}
-	}
+        ActionListener listener = (ActionListener) m_actions.get(name);
+        if (listener != null) {
+            listener.actionPerformed(new ActionEvent(this, state));
+        }
+    }
 
-	public void setSelectedPortal(PageState state, WorkspacePage portal) {
-		m_portal.setSelectedObject(state, portal);
-	}
+    public void setSelectedPortal(PageState state, WorkspacePage portal) {
+        m_portal.setSelectedObject(state, portal);
+    }
 
-	public WorkspacePage getSelectedPortal(PageState state) {
-		return (WorkspacePage) m_portal.getSelectedPortal(state);
-	}
+    public WorkspacePage getSelectedPortal(PageState state) {
+        return (WorkspacePage) m_portal.getSelectedPortal(state);
+    }
 
-	public void clearSelectedPortal(PageState state) {
-		m_portal.clearSelection(state);
-	}
+    public void clearSelectedPortal(PageState state) {
+        m_portal.clearSelection(state);
+    }
 
-	public Workspace getSelectedWorkspace(PageState state) {
-		return m_workspace.getSelectedWorkspace(state);
-	}
+    public Workspace getSelectedWorkspace(PageState state) {
+        return m_workspace.getSelectedWorkspace(state);
+    }
 
     /**
      *
@@ -105,64 +108,71 @@ public abstract class PortalList extends SimpleContainer {
      * @param parent
      */
     @Override
-	public void generateXML(PageState state, Element parent) {
-		if (!isVisible(state)) {
-			return;
-		}
+    public void generateXML(PageState state, Element parent) {
+        
+        if (!isVisible(state)) {
+            return;
+        }
 
-		Element content = generateParent(parent);
+        Element content = generateParent(parent);
+        generateChildrenXML(state, content);
+        generatePortalListXML(state, content);
 
-		generateChildrenXML(state, content);
+    }
 
-		generatePortalListXML(state, content);
-	}
-
-	/**
+    /**
      * 
      * @param state
      * @param parent
      */
     protected void generatePortalListXML(PageState state, Element parent) {
-		WorkspacePage current = m_portal.getSelectedPortal(state);
 
-		Workspace workspace = getSelectedWorkspace(state);
-		WorkspacePageCollection pages = workspace.getPages();
-		pages.addOrder(WorkspacePage.SORT_KEY);
-		while (pages.next()) {
-			Element pageEl = new Element("portal:portalDetails",
-					PortalConstants.PORTAL_XML_NS);
+        WorkspacePage current = m_portal.getSelectedPortal(state);
 
-			WorkspacePage page = pages.getPage();
+        Workspace workspace = getSelectedWorkspace(state);
+        WorkspacePageCollection pages = workspace.getPages();
+        pages.addOrder(WorkspacePage.SORT_KEY);
+        while (pages.next()) {
+            Element pageEl = new Element("portal:portalDetails",
+                                         PortalConstants.PORTAL_XML_NS);
+            WorkspacePage page = pages.getPage();
+            generatePageXML(state, pageEl, page);
 
-			generatePageXML(state, pageEl, page);
+            pageEl.addAttribute("isSelected",
+                                XML.format(page.equals(current) ? Boolean.TRUE
+                                                                : Boolean.FALSE));
 
-			pageEl.addAttribute("isSelected",
-					XML.format(page.equals(current) ? Boolean.TRUE
-							: Boolean.FALSE));
+            parent.addContent(pageEl);
+        }
 
-			parent.addContent(pageEl);
-		}
-	}
+    }
 
-	protected void generatePageXML(PageState state, Element parent,
-			WorkspacePage page) {
-		DomainObjectXMLRenderer xr = new DomainObjectXMLRenderer(parent);
-		xr.setWrapRoot(false);
-		xr.setWrapAttributes(true);
-		xr.setWrapObjects(false);
+    /**
+     * 
+     * @param state
+     * @param parent
+     * @param page
+     */
+    protected void generatePageXML(PageState state, Element parent,
+                                   WorkspacePage page) {
+        DomainObjectXMLRenderer xr = new DomainObjectXMLRenderer(parent);
+        xr.setWrapRoot(false);
+        xr.setWrapAttributes(true);
+        xr.setWrapObjects(false);
 
-		xr.walk(page, PortalList.class.getName());
+        xr.walk(page, PortalList.class.getName());
+
+        Iterator actions = m_actions.keySet().iterator();
+        while (actions.hasNext()) {
+            String name = (String) actions.next();
+            state.setControlEvent(this, name, page.getID().toString());
+            try {
+                parent.addAttribute(name + "Action", state.stateAsURL());
+            } catch (IOException ex) {
+                throw new UncheckedWrapperException("cannot get state url", ex);
+            }
+            state.clearControlEvent();
+        }
+    }
 
-		Iterator actions = m_actions.keySet().iterator();
-		while (actions.hasNext()) {
-			String name = (String) actions.next();
-			state.setControlEvent(this, name, page.getID().toString());
-			try {
-				parent.addAttribute(name + "Action", state.stateAsURL());
-			} catch (IOException ex) {
-				throw new UncheckedWrapperException("cannot get state url", ex);
-			}
-			state.clearControlEvent();
-		}
-	}
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalListViewer.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalListViewer.java
index 9bdbb35e4..7255c65a2 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalListViewer.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalListViewer.java
@@ -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,36 +29,45 @@ import com.arsdigita.domain.DomainObjectFactory;
 import com.arsdigita.portalworkspace.WorkspacePage;
 import com.arsdigita.persistence.OID;
 
+/**
+ * 
+ * 
+ */
 public class PortalListViewer extends PortalList {
 
-	private static final Logger s_log = Logger
-			.getLogger(PortalListViewer.class);
+    /** Logger instance to support debugging                                  */
+    private static final Logger s_log = Logger
+                                        .getLogger(PortalListViewer.class);
 
-	public PortalListViewer(PortalSelectionModel portal) {
-		this(null, portal);
-	}
+    /**
+     *
+     * @param portal
+     */
+    public PortalListViewer(PortalSelectionModel portal) {
+        this(null, portal);
+    }
 
-	public PortalListViewer(WorkspaceSelectionModel workspace,
-			PortalSelectionModel portal) {
-		super(workspace, portal);
+    public PortalListViewer(WorkspaceSelectionModel workspace,
+                            PortalSelectionModel portal) {
 
-		addPortalAction("select", new ActionListener() {
-			public void actionPerformed(ActionEvent e) {
-				PageState state = e.getPageState();
-				String value = state.getControlEventValue();
+        super(workspace, portal);
 
-				if (s_log.isDebugEnabled()) {
-					s_log.debug("Selecting portal " + value);
-				}
-
-				WorkspacePage portal = (WorkspacePage) DomainObjectFactory
-						.newInstance(new OID(
-								WorkspacePage.BASE_DATA_OBJECT_TYPE,
-								new BigDecimal(value)));
-
-				setSelectedPortal(state, portal);
-			}
-		});
-	}
+        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
+                                    .newInstance(new OID(
+                                         WorkspacePage.BASE_DATA_OBJECT_TYPE,
+                                         new BigDecimal(value)));
+                                setSelectedPortal(state, portal);
+                            }
+        });
+    }
 
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalSelectionModel.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalSelectionModel.java
index eba668480..a7664a3ab 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalSelectionModel.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalSelectionModel.java
@@ -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);
+
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalViewModelBuilder.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalViewModelBuilder.java
index 5a4667f39..fbf2fbd71 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalViewModelBuilder.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortalViewModelBuilder.java
@@ -30,48 +30,75 @@ 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;
+    private PortalSelectionModel m_portal;
 
-	public PortalViewModelBuilder(PortalSelectionModel portal) {
-		m_portal = portal;
-	}
 
-	public PortalModel buildModel(PageState state) {
-		WorkspacePage portal = m_portal.getSelectedPortal(state);
+    /**
+     *
+     * @param portal
+     */
+    public PortalViewModelBuilder(PortalSelectionModel portal) {
+        m_portal = portal;
+    }
 
-		ArrayList list = new ArrayList();
-		PortletCollection portlets = portal.getPortlets();
-		while (portlets.next()) {
-			com.arsdigita.portal.Portlet portlet = portlets.getPortlet();
-			list.add(portlet.getPortletRenderer());
-		}
+    /**
+     * 
+     * @param state
+     * @return
+     */
+    public PortalModel buildModel(PageState state) {
 
-		return new PortalViewModel(list.iterator(), portal.getTitle());
-	}
+        WorkspacePage portal = m_portal.getSelectedPortal(state);
 
-	private class PortalViewModel implements PortalModel {
+        ArrayList list = new ArrayList();
+        PortletCollection portlets = portal.getPortlets();
+        while (portlets.next()) {
+            com.arsdigita.portal.Portlet portlet = portlets.getPortlet();
+            list.add(portlet.getPortletRenderer());
+        }
 
-		private Iterator m_portlets;
+        return new PortalViewModel(list.iterator(), portal.getTitle());
 
-		private String m_title;
+    }
 
-		public PortalViewModel(Iterator portlets, String title) {
-			m_portlets = portlets;
-			m_title = title;
-		}
+    /**
+     *
+     */
+    private class PortalViewModel implements PortalModel {
 
-		public Iterator getPortletRenderers() {
-			return m_portlets;
-		}
+        private Iterator m_portlets;
+        private String m_title;
+        public PortalViewModel(Iterator portlets, String title) {
+            m_portlets = portlets;
+            m_title = title;
 
-		public String getTitle() {
-			return m_title;
-		}
-	}
+        }
+
+        /**
+         * 
+         * @return
+         */
+        public Iterator getPortletRenderers() {
+            return m_portlets;
+        };
+
+        /**
+         *
+         * @return
+         */
+        public String getTitle() {
+            return m_title;
+        }
+    }
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletConfigFormSection.java.nolongerInUse b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletConfigFormSection.java.nolongerInUse
deleted file mode 100755
index bbd1b3a45..000000000
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletConfigFormSection.java.nolongerInUse
+++ /dev/null
@@ -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);
-	}
-}
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletSelectionModel.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletSelectionModel.java
index 121447bb3..e0e94f5c8 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletSelectionModel.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletSelectionModel.java
@@ -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 {
 
-	public PortletSelectionModel(BigDecimalParameter p) {
-		super(p);
-	}
+    /**
+     * 
+     * @param p
+     */
+    public PortletSelectionModel(BigDecimalParameter p) {
+        super(p);
+    }
+
+    /**
+     * 
+     * @param state
+     * @return
+     */
+    public Portlet getSelectedPortlet(PageState state) {
+        return (Portlet) getSelectedObject(state);
+    }
 
-	public Portlet getSelectedPortlet(PageState state) {
-		return (Portlet) getSelectedObject(state);
-	}
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/UserWorkspace.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/UserWorkspace.java
index 1556b054c..ee28e2862 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/UserWorkspace.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/UserWorkspace.java
@@ -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());
-	}
+    public UserWorkspace() {
+        super(new UserWorkspaceSelectionModel());
+    }
+
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/UserWorkspaceSelectionModel.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/UserWorkspaceSelectionModel.java
index ef38b04ac..a69b81442 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/UserWorkspaceSelectionModel.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/UserWorkspaceSelectionModel.java
@@ -25,22 +25,28 @@ import com.arsdigita.web.LoginSignal;
 
 public class UserWorkspaceSelectionModel extends WorkspaceSelectionModel {
 
-	protected Workspace getDefaultWorkspace(PageState state) {
-		Workspace workspace = (Workspace) Kernel.getContext().getResource();
-		Party party = Kernel.getContext().getParty();
+    /**
+     *
+     * @param state
+     * @return
+     */
+    protected Workspace getDefaultWorkspace(PageState state) {
+        
+        Workspace workspace = (Workspace) Kernel.getContext().getResource();
+        Party party = Kernel.getContext().getParty();
 
-		if (party == null) {
-			throw new LoginSignal(state.getRequest());
-		}
+        if (party == null) {
+            throw new LoginSignal(state.getRequest());
+        }
 
-		try {
-			workspace = workspace.retrieveSubworkspaceForParty(party);
+        try {
+            workspace = workspace.retrieveSubworkspaceForParty(party);
+        } catch (DataObjectNotFoundException ex) {
+            throw new UncheckedWrapperException("cannot find workspace for party "
+                                                + party.getID(), ex);
+        }
+        return workspace;
 
-		} catch (DataObjectNotFoundException ex) {
-			throw new UncheckedWrapperException(
-					"cannot find workspace for party " + party.getID(), ex);
-		}
+    }
 
-		return workspace;
-	}
 }
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceComponent.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceComponent.java
index 58248a05c..f8e553420 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceComponent.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceComponent.java
@@ -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;
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceDetails.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceDetails.java
index 8e024fdf9..cae9887cb 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceDetails.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceDetails.java
@@ -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;
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceEditor.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceEditor.java
index cced5e961..a18db9ee9 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceEditor.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceEditor.java
@@ -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,44 +49,70 @@ 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:
+ * 
+ * 
+ * 
+ *    ((AbstractWorkspaceComponent)edit).setWorkspaceModel(
+ *                                           new DefaultWorkspaceSelectionModel());
+ * 
+ * 
+ * + * 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); + private static final Logger s_log = Logger.getLogger(WorkspaceEditor.class); - private ActionLink m_add; + private ActionLink m_add; - private SelectThemeForm m_selectForm; + private SelectThemeForm m_selectForm; - private RadioGroup m_grp; + private RadioGroup m_grp; - private CreateThemeForm m_createForm; + private CreateThemeForm m_createForm; - private ActionLink m_createThemeLink; + private ActionLink m_createThemeLink; - private WorkspaceThemeCollection m_workspaceThemes; + private WorkspaceThemeCollection m_workspaceThemes; - private BasicPropertiesForm m_basisPropertiesForm; + private BasicPropertiesForm m_basisPropertiesForm; - private ActionLink m_editBasicPropertiesLink; + private ActionLink m_editBasicPropertiesLink; - 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); - } + /** + * Default Constructor constructs a new, empty WorkspaceEditor object. + */ + public WorkspaceEditor() { + this(null); + } - public WorkspaceEditor(WorkspaceSelectionModel workspace) { - super(workspace); - s_log.debug("WorkspaceEditor constructed"); + /** + * Constructs a WorkspaceViewer for a specific workspace object + * and sets the xml tags accordingly. + * + * @param workspace + */ + public WorkspaceEditor(WorkspaceSelectionModel workspace) { - m_add = new ActionLink("add pane"); - m_add.setClassAttr("actionLink"); - m_add.addActionListener(new ActionListener() { + super(workspace); + s_log.debug("WorkspaceEditor constructed"); + + m_add = new ActionLink("add pane"); + m_add.setClassAttr("actionLink"); + m_add.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PageState state = e.getPageState(); @@ -99,48 +128,67 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent { } }); - add(m_add); + add(m_add); - m_createThemeLink = new ActionLink((String) GlobalizationUtil + m_createThemeLink = new ActionLink((String) GlobalizationUtil .globalize("portal.ui.admin.create_theme").localize()); - m_createThemeLink.setClassAttr("actionLink"); - m_createThemeLink.addActionListener(new CreateThemeLinkListener()); - m_grp = new RadioGroup("themes"); - m_grp.setClassAttr("vertical"); - populateOptionGroup(); - m_selectForm = new SelectThemeForm(); - m_createForm = new CreateThemeForm(); + m_createThemeLink.setClassAttr("actionLink"); + m_createThemeLink.addActionListener(new CreateThemeLinkListener()); + m_grp = new RadioGroup("themes"); + m_grp.setClassAttr("vertical"); + populateOptionGroup(); + m_selectForm = new SelectThemeForm(); + m_createForm = new CreateThemeForm(); - add(m_selectForm); - add(m_createForm); - add(m_createThemeLink); // nb. this line is commented in the undp src + add(m_selectForm); + add(m_createForm); + add(m_createThemeLink); // nb. this line is commented in the undp src - // now add the basic properties controls - m_editBasicPropertiesLink = new ActionLink((String) GlobalizationUtil + // now add the basic properties controls + m_editBasicPropertiesLink = new ActionLink((String) GlobalizationUtil .globalize("portal.ui.admin.edit_basic_properties").localize()); - m_editBasicPropertiesLink + m_editBasicPropertiesLink .addActionListener(new BasicPropertiesLinkListener()); - m_editBasicPropertiesLink.setClassAttr("actionLink"); - add(m_editBasicPropertiesLink); - m_basisPropertiesForm = new BasicPropertiesForm(); - add(m_basisPropertiesForm); - } + m_editBasicPropertiesLink.setClassAttr("actionLink"); + add(m_editBasicPropertiesLink); + m_basisPropertiesForm = new BasicPropertiesForm(); + add(m_basisPropertiesForm); + } - protected PortalList createPortalList(PortalSelectionModel portal) { - return new PortalListEditor(portal); - } + /** + * + * @param portal + * @return + */ + protected PortalList createPortalList(PortalSelectionModel portal) { + return new PortalListEditor(portal); + } - protected PersistentPortal createPortalDisplay(PortalSelectionModel portal) { - return new PersistentPortal(portal, PortalConstants.MODE_EDITOR); - } - // TODO - // there is a big problem with this model - // the options are locked and therefore you can't see - // the theme created until after a server restart - // however this is as the code came from skylift so - // I'm leaving it like this. - private void populateOptionGroup() { + 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); + } + + // TODO + // there is a big problem with this model + // the options are locked and therefore you can't see + // the theme created until after a server restart + // however this is as the code came from skylift so + // I'm leaving it like this. + private void populateOptionGroup() { m_grp.clearOptions(); m_workspaceThemes = WorkspaceTheme.retrieveAllWorkspaceThemes(); while (m_workspaceThemes.next()) { @@ -149,22 +197,26 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent { String name = m_workspaceThemes.getWorkspaceTheme().getName(); addOption(id, name); } - } + } - private void addOption(String id, String name) { + private void addOption(String id, String name) { Option opt = new Option(id, name); m_grp.addOption(opt); - } + } - public class SelectThemeForm extends Form implements FormProcessListener, - FormInitListener { - private Label instruction; + /** + * + */ + public class SelectThemeForm extends Form implements FormProcessListener, + FormInitListener { + private Label instruction; + private Submit button; + RequestLocal prtlRL; - private Submit button; - - RequestLocal prtlRL; - - public SelectThemeForm() { + /** + * + */ + public SelectThemeForm() { super("selectthemeform"); s_log.debug("SelectThemeForm constructed"); instruction = new Label(GlobalizationUtil @@ -180,9 +232,13 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent { add(m_grp); addProcessListener(this); addInitListener(this); - } + } - public void process(FormSectionEvent e) { + /** + * + * @param e + */ + public void process(FormSectionEvent e) { s_log.debug("process called for SelectThemeForm"); String selectedkey; PageState s = e.getPageState(); @@ -197,9 +253,9 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent { workspace.setTheme(theme); workspace.save(); } - } + } - public void init(FormSectionEvent e) throws FormProcessException { + public void init(FormSectionEvent e) throws FormProcessException { s_log.debug("init called for SelectThemeForm"); PageState ps = e.getPageState(); if (m_workspaceThemes.isEmpty()) @@ -214,45 +270,37 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent { WorkspaceTheme theme = workspace.getTheme(); if (theme != null) fd.put("themes", theme.getID().toString()); - } + } - } + } - public class CreateThemeForm extends Form implements FormProcessListener, - FormInitListener { - private Label instruction; - private Submit savebutton; + /** + * + */ + 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; - 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() { + /** + * + */ + public CreateThemeForm() { super("createthemeform"); s_log.debug("CreateThemeForm constructed"); setClassAttr("themecreator"); @@ -299,7 +347,7 @@ public class WorkspaceEditor extends AbstractWorkspaceComponent { addProcessListener(this); addInitListener(this); - } + } public void process(FormSectionEvent e) { s_log.debug("processing the create theme form"); diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceSelectionModel.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceSelectionModel.java index d9620da07..a2a687a39 100755 --- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceSelectionModel.java +++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceSelectionModel.java @@ -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 * */ @@ -25,43 +29,44 @@ import com.arsdigita.portalworkspace.Workspace; */ public abstract class WorkspaceSelectionModel { - /** Workspace. Bound to the current HTTP request. */ + /** Workspace. Bound to the current HTTP request. */ private RequestLocal m_workspace; - /** + /** * Constructor. */ public WorkspaceSelectionModel() { - m_workspace = new RequestLocal() { + m_workspace = new RequestLocal() { @Override - public Object initialValue(PageState state) { - return getDefaultWorkspace(state); - } - }; - } + public Object initialValue(PageState state) { + return getDefaultWorkspace(state); + } + }; + } - /** + /** * * @param state * @return */ protected abstract Workspace getDefaultWorkspace(PageState state); - /** + /** * * @param state * @return */ public Workspace getSelectedWorkspace(PageState state) { - return (Workspace) m_workspace.get(state); - } + return (Workspace) m_workspace.get(state); + } - /** + /** * * @param state * @param workspace */ public void setSelectedWorkspace(PageState state, Workspace workspace) { - m_workspace.set(state, workspace); - } + m_workspace.set(state, workspace); + } + } diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceViewer.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceViewer.java index 27c6addd2..ac8d78155 100755 --- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceViewer.java +++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/WorkspaceViewer.java @@ -1,36 +1,68 @@ /* - * 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: + *
+ * 
+ * 
+ *    ((AbstractWorkspaceComponent) view).setWorkspaceModel(
+ *                                        new DefaultWorkspaceSelectionModel());
+ * 
+ * 
+ * + * Currently there is a jsp for the default url at + * (web)/templates/ccm-portalworkspace/index.jsp which is mapped via web.xml + * to /ccm/portal/ in the default, pre-configured configuration. + */ public class WorkspaceViewer extends AbstractWorkspaceComponent { - public WorkspaceViewer() { - this(null); - } + /** + * Default Constructor constructs a new, empty WorkspaceViewer + */ + public WorkspaceViewer() { + this(null); + } - public WorkspaceViewer(WorkspaceSelectionModel workspace) { - super(workspace); - } + /** + * Constructor instantiates a WorkspaceViewer for a specific workspace + * object and sets the xml tags accordingly. + * + * @param workspace + */ + public WorkspaceViewer(WorkspaceSelectionModel workspace) { + super(workspace); + } - protected PortalList createPortalList(PortalSelectionModel portal) { - return new PortalListViewer(portal); - } + protected PortalList createPortalList(PortalSelectionModel portal) { + return new PortalListViewer(portal); + } - protected PersistentPortal createPortalDisplay(PortalSelectionModel portal) { - return new PersistentPortal(portal, PortalConstants.MODE_DISPLAY); - } + protected PersistentPortal createPortalDisplay(PortalSelectionModel portal) { + return new PersistentPortal(portal, PortalConstants.MODE_DISPLAY); + } } diff --git a/ccm-portalworkspace/web/templates/ccm-portalworkspace/edit.jsp b/ccm-portalworkspace/web/templates/ccm-portalworkspace/edit.jsp index eab5c0a83..e81bc959b 100755 --- a/ccm-portalworkspace/web/templates/ccm-portalworkspace/edit.jsp +++ b/ccm-portalworkspace/web/templates/ccm-portalworkspace/edit.jsp @@ -12,10 +12,13 @@ DispatcherHelper.cacheDisable(response); - - + + - ((AbstractWorkspaceComponent)edit).setWorkspaceModel(new DefaultWorkspaceSelectionModel()); + ((AbstractWorkspaceComponent)edit).setWorkspaceModel( + new DefaultWorkspaceSelectionModel());