Removed unused code, removed user themeing capabilities, added documentation, improved code structure. Update Script required (not yet provided).
git-svn-id: https://svn.libreccm.org/ccm/trunk@2062 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
f8596d5890
commit
bbff4ab565
|
|
@ -2,7 +2,7 @@
|
|||
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||
name="ccm-portalworkspace"
|
||||
prettyName="Portal Workspace"
|
||||
version="6.6.2"
|
||||
version="6.6.3"
|
||||
release="1"
|
||||
webapp="ROOT">
|
||||
<ccm:dependencies>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
MyWorkspacePortlet:
|
||||
Code is broken and aborts program flow unrecoverable.
|
||||
No documentation at all, seems to create a list of personaö Workspaces.
|
||||
Not usefule for PortalWorkspace, as it is meant as a system wide frontpage
|
||||
or as leaf for navigation. No option for personal homepages here.
|
||||
May be useful for PortalServer and its personal homepages.
|
||||
|
||||
WorkspaceNavigatorPortlet
|
||||
Code is broken, no documentation at all. Seems to provide a list of child
|
||||
Workspaces and related Workspaces. Not useful for PortalWorkspace because
|
||||
it is not meant to form a interwoven system of portal pages.
|
||||
Portlet of the same name is part of PortalServer where it should be useful.
|
||||
|
||||
WorkspaceSummaryPortlet
|
||||
Code is broken, no documentation at all. Seems to provide a list of objects,
|
||||
probably participants.
|
||||
|
||||
All 3 portlets have internal classes to provide a PortletRenderer. XML files
|
||||
are missing, but the tags may be part of the PortalWorkspace applications XML.
|
||||
Not checked.
|
||||
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ object type Workspace extends Application {
|
|||
to pw_workspace_pages.workspace_id;
|
||||
PageLayout[1..1] defaultLayout = join pw_workspaces.default_layout_id
|
||||
to pw_workspace_page_layouts.layout_id;
|
||||
WorkspaceTheme[0..1] theme = join pw_workspaces.theme_id to pw_workspace_themes.theme_id;
|
||||
// WorkspaceTheme[0..1] theme = join pw_workspaces.theme_id to pw_workspace_themes.theme_id;
|
||||
User[0..1] owner = join pw_workspaces.owner_id to users.user_id;
|
||||
|
||||
Workspace[0..n] relatedWorkspace =
|
||||
|
|
@ -55,7 +55,7 @@ query childWorkspacesForApplicationID {
|
|||
acs_objects.display_name,
|
||||
acs_objects.default_domain_class,
|
||||
applications.parent_application_id,
|
||||
applications.package_id,
|
||||
// applications.package_id,
|
||||
applications.title,
|
||||
applications.primary_url,
|
||||
applications.description
|
||||
|
|
|
|||
|
|
@ -27,4 +27,8 @@
|
|||
<!-- Refactored Legacy Free -->
|
||||
<script sql="ccm-portalworkspace/upgrade/::database::-6.6.1-6.6.2.sql"/>
|
||||
</version>
|
||||
<version from="6.6.2" to="6.6.3">
|
||||
<!-- Removed separate theme modifications -->
|
||||
<script sql="ccm-portalworkspace/upgrade/::database::-6.6.1-6.6.2.sql"/>
|
||||
</version>
|
||||
</upgrade>
|
||||
|
|
|
|||
|
|
@ -37,9 +37,6 @@ import com.arsdigita.portalworkspace.portlet.FreeformHTMLPortlet;
|
|||
import com.arsdigita.portalworkspace.portlet.LoginPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.RSSFeedPortlet;
|
||||
// import com.arsdigita.portlet.TimeOfDayPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.MyWorkspacesPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.WorkspaceNavigatorPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.WorkspaceSummaryPortlet;
|
||||
import com.arsdigita.portalworkspace.ui.admin.WorkspaceConfigFormSection;
|
||||
import com.arsdigita.portalworkspace.ui.portlet.ContentDirectoryPortletEditor;
|
||||
import com.arsdigita.portalworkspace.ui.portlet.FreeformHTMLPortletEditor;
|
||||
|
|
@ -151,15 +148,6 @@ public class Initializer extends CompoundInitializer {
|
|||
}
|
||||
});
|
||||
|
||||
e.getFactory().registerInstantiator(
|
||||
MyWorkspacesPortlet.BASE_DATA_OBJECT_TYPE,
|
||||
new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new MyWorkspacesPortlet(dataObject);
|
||||
}
|
||||
});
|
||||
|
||||
e.getFactory().registerInstantiator(
|
||||
RSSFeedPortlet.BASE_DATA_OBJECT_TYPE,
|
||||
new ACSObjectInstantiator() {
|
||||
|
|
@ -179,33 +167,6 @@ public class Initializer extends CompoundInitializer {
|
|||
});
|
||||
*/
|
||||
|
||||
// WorkspaceDirectoryPortlet, imports ccm-ldn-rss
|
||||
// e.getFactory().registerInstantiator(
|
||||
// WorkspaceDirectoryPortlet.BASE_DATA_OBJECT_TYPE,
|
||||
// new ACSObjectInstantiator() {
|
||||
// public DomainObject doNewInstance(DataObject dataObject) {
|
||||
// return new WorkspaceDirectoryPortlet(dataObject);
|
||||
// }
|
||||
// });
|
||||
|
||||
e.getFactory().registerInstantiator(
|
||||
WorkspaceNavigatorPortlet.BASE_DATA_OBJECT_TYPE,
|
||||
new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new WorkspaceNavigatorPortlet(dataObject);
|
||||
}
|
||||
});
|
||||
|
||||
e.getFactory().registerInstantiator(
|
||||
WorkspaceSummaryPortlet.BASE_DATA_OBJECT_TYPE,
|
||||
new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new WorkspaceSummaryPortlet(dataObject);
|
||||
}
|
||||
});
|
||||
|
||||
new ResourceTypeConfig(Workspace.BASE_DATA_OBJECT_TYPE) {
|
||||
@Override
|
||||
public ResourceConfigFormSection getCreateFormSection(
|
||||
|
|
|
|||
|
|
@ -26,11 +26,8 @@ import com.arsdigita.portalworkspace.portlet.ApplicationDirectoryPortlet;
|
|||
import com.arsdigita.portalworkspace.portlet.ContentDirectoryPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.FreeformHTMLPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.LoginPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.MyWorkspacesPortlet ;
|
||||
import com.arsdigita.portalworkspace.portlet.RSSFeedPortlet;
|
||||
// import com.arsdigita.portlet.TimeOfDayPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.WorkspaceNavigatorPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.WorkspaceSummaryPortlet;
|
||||
import com.arsdigita.portal.PortletType;
|
||||
import com.arsdigita.runtime.ScriptContext;
|
||||
import com.arsdigita.util.Assert;
|
||||
|
|
@ -111,11 +108,8 @@ public class Loader extends PackageLoader {
|
|||
loadContentDirectoryPortlet();
|
||||
loadFreeformHTMLPortlet();
|
||||
loadLoginPortlet();
|
||||
loadMyWorkspacesPortlet();
|
||||
loadRSSFeedPortlet();
|
||||
// loadTimeOfDayPortlet();
|
||||
loadWorkspaceNavigatorPortlet();
|
||||
loadWorkspaceSummaryPortlet();
|
||||
}
|
||||
}.run();
|
||||
}
|
||||
|
|
@ -225,13 +219,13 @@ public class Loader extends PackageLoader {
|
|||
*/
|
||||
private void loadApplicationDirectoryPortlet() {
|
||||
PortletType type = PortletType.createPortletType(
|
||||
"Application Directory", PortletType.WIDE_PROFILE,
|
||||
"PW Application Directory", PortletType.WIDE_PROFILE,
|
||||
ApplicationDirectoryPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDescription("Displays a list of portal workspace applications");
|
||||
}
|
||||
|
||||
private void loadContentDirectoryPortlet() {
|
||||
PortletType type = PortletType.createPortletType("Content Directory",
|
||||
PortletType type = PortletType.createPortletType("PW Content Directory",
|
||||
PortletType.WIDE_PROFILE,
|
||||
ContentDirectoryPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDescription("Displays the content directory categories");
|
||||
|
|
@ -250,12 +244,6 @@ public class Loader extends PackageLoader {
|
|||
type.setDescription("Display a login form or user details");
|
||||
}
|
||||
|
||||
private void loadMyWorkspacesPortlet() {
|
||||
PortletType type = PortletType.createPortletType("My Workspaces",
|
||||
PortletType.WIDE_PROFILE, MyWorkspacesPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDescription("MyWorkspaces: Display ????");
|
||||
}
|
||||
|
||||
private void loadRSSFeedPortlet() {
|
||||
PortletType type = PortletType.createPortletType("RSS Feed",
|
||||
PortletType.WIDE_PROFILE, RSSFeedPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
|
|
@ -272,18 +260,4 @@ public class Loader extends PackageLoader {
|
|||
// type.setDescription("Displays the current date and time");
|
||||
// }
|
||||
|
||||
private void loadWorkspaceNavigatorPortlet() {
|
||||
PortletType type = PortletType.createPortletType(
|
||||
"Workspace Navigator Portlet", PortletType.WIDE_PROFILE,
|
||||
WorkspaceNavigatorPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDescription("Displays ??");
|
||||
}
|
||||
|
||||
private void loadWorkspaceSummaryPortlet() {
|
||||
PortletType type = PortletType.createPortletType(
|
||||
"Workspace Summary Portlet", PortletType.WIDE_PROFILE,
|
||||
WorkspaceSummaryPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDescription("Displays ???");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ import com.arsdigita.util.UncheckedWrapperException;
|
|||
*/
|
||||
public class PageLayout extends DomainObject {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.portalworkspace.PageLayout";
|
||||
|
||||
public static final String ID = "id";
|
||||
public static final String TITLE = "title";
|
||||
public static final String DESCRIPTION = "description";
|
||||
|
|
@ -45,8 +48,6 @@ public class PageLayout extends DomainObject {
|
|||
public static final String FORMAT_TWO_COLUMNS = "50%,50%";
|
||||
public static final String FORMAT_THREE_COLUMNS = "30%,40%,30%";
|
||||
public static final String FORMAT_FOUR_COLUMNS = "25%,25%,25%,25%";
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.portalworkspace.PageLayout";
|
||||
|
||||
public PageLayout() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
|
|
|
|||
|
|
@ -28,32 +28,24 @@ import java.util.Map;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
// import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||
import com.arsdigita.bebop.SimpleContainer;
|
||||
// import com.arsdigita.bebop.SingleSelectionModel;
|
||||
// import com.arsdigita.bebop.parameters.IntegerParameter;
|
||||
// import com.arsdigita.bebop.portal.Portal;
|
||||
import com.arsdigita.bebop.portal.PortalModel;
|
||||
import com.arsdigita.bebop.portal.PortalModelBuilder;
|
||||
import com.arsdigita.bebop.portal.PortletRenderer;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
||||
import com.arsdigita.portalworkspace.ui.PortletSelectionModel;
|
||||
// import com.arsdigita.portalworkspace.ui.PortletTypeSelectionModel;
|
||||
import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel;
|
||||
import com.arsdigita.persistence.DataQuery;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
// import com.arsdigita.persistence.metadata.ObjectType;
|
||||
// import com.arsdigita.portal.Portlet;
|
||||
import com.arsdigita.portal.PortletType;
|
||||
import com.arsdigita.portal.PortletTypeCollection;
|
||||
import com.arsdigita.xml.Element;
|
||||
|
||||
|
||||
/**
|
||||
* Dynamically render the portlets for the current portal. If any portlets are
|
||||
* stateful, retrieve a renderer from cache so that the page can manage the
|
||||
* state of the portlet.
|
||||
* Dynamically render the portlets for the current portal. If any portlets
|
||||
* are stateful, retrieve a renderer from cache so that the page can manage
|
||||
* the state of the portlet.
|
||||
*
|
||||
* ONLY VALID FOR BROWSE MODE, use com.arsdigita.portal.ui.PersistentPortal
|
||||
* for edit mode!
|
||||
|
|
@ -66,8 +58,8 @@ public class StatefulPersistentPortal extends SimpleContainer {
|
|||
private static final Logger s_log =
|
||||
Logger.getLogger(StatefulPersistentPortal.class);
|
||||
|
||||
private WorkspaceSelectionModel m_workspace;
|
||||
private PortletSelectionModel m_portlet;
|
||||
// private WorkspaceSelectionModel m_workspace;
|
||||
// private PortletSelectionModel m_portlet;
|
||||
private PortalModelBuilder m_portalModelBuilder;
|
||||
private PortalSelectionModel m_portal;
|
||||
|
||||
|
|
@ -96,7 +88,7 @@ public class StatefulPersistentPortal extends SimpleContainer {
|
|||
|
||||
m_portal = portal;
|
||||
setTag("portal:portal");
|
||||
setNamespace(PortalConstants.PORTAL_XML_NS);
|
||||
setNamespace(WorkspacePage.PORTAL_XML_NS);
|
||||
|
||||
// retrieve empty renderers for any stateful portlets and add them
|
||||
// to the component hierarchy
|
||||
|
|
|
|||
|
|
@ -16,6 +16,15 @@
|
|||
|
||||
package com.arsdigita.portalworkspace;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.portal.PortalModel;
|
||||
import com.arsdigita.bebop.portal.PortalModelBuilder;
|
||||
import com.arsdigita.bebop.portal.PortletRenderer;
|
||||
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
||||
import com.arsdigita.portal.Portal;
|
||||
import com.arsdigita.portal.PortletCollection;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
|
@ -24,20 +33,9 @@ import java.util.Map;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
// import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.portal.PortalModel;
|
||||
import com.arsdigita.bebop.portal.PortalModelBuilder;
|
||||
import com.arsdigita.bebop.portal.PortletRenderer;
|
||||
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
||||
// import com.arsdigita.portalworkspace.ui.SimplePortlet;
|
||||
import com.arsdigita.portal.Portal;
|
||||
import com.arsdigita.portal.PortletCollection;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
/**
|
||||
* Portal Model Builder that should only be applied to portal in browse mode,
|
||||
* as it does not allow for editing.
|
||||
* Portal Model Builder that should only be applied to portal in
|
||||
* browse mode, as it does not allow for editing.
|
||||
* Portal in edit mode should have a
|
||||
* com.arsdigita.london.portal.ui.PersistentPortalModelBuilder.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import java.util.Map;
|
|||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.portal.AbstractPortletRenderer;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.portal.Portlet;
|
||||
import com.arsdigita.xml.Element;
|
||||
|
|
@ -192,12 +191,13 @@ public abstract class StatefulPortlet extends Portlet {
|
|||
* the portletrenderer is contained within a SimplePortlet which is not stateful
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
protected final AbstractPortletRenderer doGetPortletRenderer() {
|
||||
return new AbstractPortletRenderer() {
|
||||
protected void generateBodyXML(PageState state, Element document) {
|
||||
document.newChildElement(
|
||||
"portlet:stateful-portlet-in-edit-mode",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import com.arsdigita.domain.DataObjectNotFoundException;
|
|||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.kernel.ACSObject;
|
||||
import com.arsdigita.kernel.Group;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
// import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.KernelExcursion;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.Party;
|
||||
|
|
@ -34,8 +34,7 @@ import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
|||
import com.arsdigita.kernel.permissions.PermissionManager;
|
||||
import com.arsdigita.kernel.permissions.PermissionService;
|
||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||
import com.arsdigita.portalworkspace.ui.PersonalPortalPage;
|
||||
import com.arsdigita.portalworkspace.ui.WorkspaceTheme;
|
||||
import com.arsdigita.portalworkspace.ui.personalws.PersonalPortalPage;
|
||||
import com.arsdigita.persistence.DataAssociation;
|
||||
import com.arsdigita.persistence.DataAssociationCursor;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
|
|
@ -59,8 +58,8 @@ import org.apache.log4j.Logger;
|
|||
|
||||
|
||||
/**
|
||||
* Class <b>Workspace</b> is the main domain class (extending Application) for
|
||||
* the portalworkspace module.
|
||||
* Class <b>Workspace</b> is the main domain class (extending Application)
|
||||
* for the portalworkspace module.
|
||||
*
|
||||
* A (portal)workspace represents an area containing 0...n portals each arranged
|
||||
* as a pane of page. Each portal (or pane) manages a number of portlets. So a
|
||||
|
|
@ -723,23 +722,6 @@ public class Workspace extends Application {
|
|||
return WorkspacePage.create(title, description, layout, this, sortKey);
|
||||
}
|
||||
|
||||
public void setTheme(WorkspaceTheme theme) {
|
||||
set("theme", theme);
|
||||
}
|
||||
|
||||
public WorkspaceTheme getTheme() {
|
||||
DataObject dobj;
|
||||
|
||||
dobj = (DataObject) get("theme");
|
||||
|
||||
if (dobj == null) {
|
||||
return null;
|
||||
} else {
|
||||
WorkspaceTheme theme = new WorkspaceTheme(dobj);
|
||||
return theme;
|
||||
}
|
||||
}
|
||||
|
||||
public static Workspace getCurrentlySelectedWorkspace() {
|
||||
Application current = Web.getContext().getApplication();
|
||||
if (current instanceof Workspace) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@ public class WorkspacePage extends Portal {
|
|||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.portalworkspace.WorkspacePage";
|
||||
public static final String MODE_EDITOR = "editor";
|
||||
public static final String PORTAL_XML_NS = "http://www.uk.arsdigita.com/portal/1.0";
|
||||
public static final String PORTLET_XML_NS = "http://www.uk.arsdigita.com/portlet/1.0";
|
||||
public static final String MODE_DISPLAY = "display";
|
||||
|
||||
public WorkspacePage() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
|
|
@ -55,16 +59,23 @@ public class WorkspacePage extends Portal {
|
|||
super(oid);
|
||||
}
|
||||
|
||||
static WorkspacePage create(String title, String description,
|
||||
PageLayout layout, Workspace workspace, int sortKey) {
|
||||
WorkspacePage page = (WorkspacePage) Resource.createResource(
|
||||
WorkspacePage.BASE_DATA_OBJECT_TYPE, title, null);
|
||||
static WorkspacePage create(String title,
|
||||
String description,
|
||||
PageLayout layout,
|
||||
Workspace workspace,
|
||||
int sortKey) {
|
||||
WorkspacePage page = (WorkspacePage) Resource
|
||||
.createResource(WorkspacePage.BASE_DATA_OBJECT_TYPE,
|
||||
title,
|
||||
null);
|
||||
page.setup(description, layout, workspace, sortKey);
|
||||
return page;
|
||||
}
|
||||
|
||||
protected void setup(String description, PageLayout layout,
|
||||
Workspace workspace, int sortKey) {
|
||||
protected void setup(String description,
|
||||
PageLayout layout,
|
||||
Workspace workspace,
|
||||
int sortKey) {
|
||||
setDescription(description);
|
||||
setLayout(layout);
|
||||
setWorkspace(workspace);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import com.arsdigita.bebop.PageState;
|
|||
import com.arsdigita.bebop.SimpleContainer;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -42,8 +43,8 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
|||
|
||||
/**
|
||||
* Default constructor creates a new, empty
|
||||
* <code>AbstractWorkspaceComponent</code> using parents (SimpleContainer)
|
||||
* default constructor.
|
||||
* <code>AbstractWorkspaceComponent</code> using parents
|
||||
* (SimpleContainer) default constructor.
|
||||
*/
|
||||
public AbstractWorkspaceComponent() {
|
||||
this(null);
|
||||
|
|
@ -57,7 +58,7 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer {
|
|||
|
||||
/* Creates a WorkspaceComponent (SimpleContainer) that will wrap its
|
||||
* children in the specified tag. */
|
||||
super("portal:workspace", PortalConstants.PORTAL_XML_NS);
|
||||
super("portal:workspace", WorkspacePage.PORTAL_XML_NS);
|
||||
|
||||
m_workspace = workspace;
|
||||
m_details = new WorkspaceDetails(m_workspace);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.arsdigita.bebop.Component;
|
|||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.RequestLocal;
|
||||
import com.arsdigita.bebop.portal.AbstractPortletRenderer;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.util.Assert;
|
||||
import com.arsdigita.xml.Element;
|
||||
|
||||
|
|
@ -33,7 +34,8 @@ public class ApplicationPortlet extends AbstractPortletRenderer {
|
|||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor.
|
||||
*
|
||||
* @param title
|
||||
* @param column
|
||||
* @param row
|
||||
|
|
@ -68,7 +70,7 @@ public class ApplicationPortlet extends AbstractPortletRenderer {
|
|||
protected void generateBodyXML(PageState state, Element parent) {
|
||||
|
||||
Element content = parent.newChildElement("portlet:simple",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
|
||||
if (m_parent.get(state) == null) {
|
||||
m_appComponent.generateXML(state, content);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class LayoutForm extends Form implements FormProcessListener,
|
|||
public LayoutForm(WorkspaceSelectionModel workspace,
|
||||
PortalSelectionModel portal) {
|
||||
super("editLayout", new SimpleContainer("portal:editLayout",
|
||||
PortalConstants.PORTAL_XML_NS));
|
||||
WorkspacePage.PORTAL_XML_NS));
|
||||
|
||||
m_workspace = workspace;
|
||||
m_portal = portal;
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ public class PersistentPortal extends SimpleContainer {
|
|||
String mode) {
|
||||
|
||||
setTag("portal:portal");
|
||||
setNamespace(PortalConstants.PORTAL_XML_NS);
|
||||
setNamespace(WorkspacePage.PORTAL_XML_NS);
|
||||
|
||||
s_log.debug("IN constructor" + name + " " + mode);
|
||||
m_adders = new PortletTypeForm[MAX_COLUMNS];
|
||||
|
|
@ -151,7 +151,7 @@ public class PersistentPortal extends SimpleContainer {
|
|||
m_column = new ParameterSingleSelectionModel(new IntegerParameter("column"));
|
||||
|
||||
|
||||
if (m_mode.equals(PortalConstants.MODE_EDITOR)) {
|
||||
if (m_mode.equals(WorkspacePage.MODE_EDITOR)) {
|
||||
for (int i = 0; i < m_adders.length; i++) {
|
||||
m_adders[i] = new PortletTypeForm("add" + name + i);
|
||||
m_adders[i].setRedirecting(true);
|
||||
|
|
@ -440,7 +440,7 @@ public class PersistentPortal extends SimpleContainer {
|
|||
BigDecimal portlet,
|
||||
String name) {
|
||||
Element action = parent.newChildElement("portlet:action",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
try {
|
||||
state.setControlEvent(this,
|
||||
name,
|
||||
|
|
@ -457,7 +457,7 @@ public class PersistentPortal extends SimpleContainer {
|
|||
public void respond(PageState state) {
|
||||
WorkspacePage portal = m_portal.getSelectedPortal(state);
|
||||
|
||||
if (m_mode.equals(PortalConstants.MODE_EDITOR)) {
|
||||
if (m_mode.equals(WorkspacePage.MODE_EDITOR)) {
|
||||
|
||||
// check permission on Workspace, not WorkspacePage,
|
||||
// as this is where the permissiones/groups are set
|
||||
|
|
|
|||
|
|
@ -1,35 +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.portalworkspace.ui;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* <strong>Experimental</strong>
|
||||
* </p>
|
||||
*
|
||||
* @author <a href="mailto:justin@arsdigita.com">Justin Ross</a>
|
||||
* @version $Id: PortalConstants.java 1174 2006-06-14 14:14:15Z fabrice $
|
||||
*/
|
||||
public class PortalConstants {
|
||||
|
||||
public static final String PORTAL_XML_NS = "http://www.uk.arsdigita.com/portal/1.0";
|
||||
|
||||
public static final String PORTLET_XML_NS = "http://www.uk.arsdigita.com/portlet/1.0";
|
||||
|
||||
public static final String MODE_DISPLAY = "display";
|
||||
|
||||
public static final String MODE_EDITOR = "editor";
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@ public class PortalEditForm extends Form implements FormProcessListener,
|
|||
PortalSelectionModel portal) {
|
||||
|
||||
super("editPortal", new SimpleContainer("portal:editPortal",
|
||||
PortalConstants.PORTAL_XML_NS));
|
||||
WorkspacePage.PORTAL_XML_NS));
|
||||
|
||||
m_workspace = workspace;
|
||||
m_portal = portal;
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ import com.arsdigita.util.Assert;
|
|||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
/**
|
||||
* Builds the logic to modify (edit) a portal pane (remember: 0..n portal panes
|
||||
* make up a workspace, see com.arsdigita.portalworkspace.Workspace).
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public abstract class PortalList extends SimpleContainer {
|
|||
*/
|
||||
public PortalList(WorkspaceSelectionModel workspace,
|
||||
PortalSelectionModel portal) {
|
||||
super("portal:portalList", PortalConstants.PORTAL_XML_NS);
|
||||
super("portal:portalList", WorkspacePage.PORTAL_XML_NS);
|
||||
|
||||
m_workspace = workspace;
|
||||
m_portal = portal;
|
||||
|
|
@ -134,7 +134,7 @@ public abstract class PortalList extends SimpleContainer {
|
|||
pages.addOrder(WorkspacePage.SORT_KEY);
|
||||
while (pages.next()) {
|
||||
Element pageEl = new Element("portal:portalDetails",
|
||||
PortalConstants.PORTAL_XML_NS);
|
||||
WorkspacePage.PORTAL_XML_NS);
|
||||
WorkspacePage page = pages.getPage();
|
||||
generatePageXML(state, pageEl, page);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package com.arsdigita.portalworkspace.ui;
|
|||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.portal.AbstractPortletRenderer;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.util.Assert;
|
||||
import com.arsdigita.xml.Element;
|
||||
|
||||
|
|
@ -36,7 +37,7 @@ public class SimplePortlet extends AbstractPortletRenderer {
|
|||
|
||||
protected void generateBodyXML(PageState state, Element parent) {
|
||||
Element content = parent.newChildElement("portlet:simple",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
m_contents.generateXML(state, content);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class WorkspaceComponent extends SimpleContainer {
|
|||
|
||||
public WorkspaceComponent(WorkspaceSelectionModel workspace) {
|
||||
setTag("portal:workspace");
|
||||
setNamespace(PortalConstants.PORTAL_XML_NS);
|
||||
setNamespace(WorkspacePage.PORTAL_XML_NS);
|
||||
|
||||
m_multiPortal = true;
|
||||
|
||||
|
|
@ -85,8 +85,8 @@ public class WorkspaceComponent extends SimpleContainer {
|
|||
m_portals_edit = new PortalListEditor(workspace, m_portal);
|
||||
m_portals_view = new PortalListViewer(workspace, m_portal);
|
||||
|
||||
m_display = new PersistentPortal(m_portal, PortalConstants.MODE_DISPLAY);
|
||||
m_editor = new PersistentPortal(m_portal, PortalConstants.MODE_EDITOR);
|
||||
m_display = new PersistentPortal(m_portal, WorkspacePage.MODE_DISPLAY);
|
||||
m_editor = new PersistentPortal(m_portal, WorkspacePage.MODE_EDITOR);
|
||||
|
||||
m_add = new ActionLink("add pane");
|
||||
m_add.setClassAttr("actionLink");
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
|||
import com.arsdigita.kernel.permissions.PermissionService;
|
||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.xml.Element;
|
||||
import com.arsdigita.xml.XML;
|
||||
|
||||
|
|
@ -50,11 +51,12 @@ public class WorkspaceDetails extends SimpleComponent {
|
|||
return m_workspace.getSelectedWorkspace(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateXML(PageState state, Element parent) {
|
||||
Workspace workspace = getSelectedWorkspace(state);
|
||||
|
||||
Element content = new Element("portal:workspaceDetails",
|
||||
PortalConstants.PORTAL_XML_NS);
|
||||
WorkspacePage.PORTAL_XML_NS);
|
||||
exportAttributes(content);
|
||||
|
||||
generateWorkspaceXML(state, content, workspace);
|
||||
|
|
|
|||
|
|
@ -1,479 +0,0 @@
|
|||
/*
|
||||
* 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 java.math.BigDecimal;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.arsdigita.bebop.ActionLink;
|
||||
import com.arsdigita.bebop.Form;
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.RequestLocal;
|
||||
import com.arsdigita.bebop.event.ActionEvent;
|
||||
import com.arsdigita.bebop.event.ActionListener;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.RadioGroup;
|
||||
import com.arsdigita.bebop.form.Submit;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.dispatcher.AccessDeniedException;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.Party;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.portalworkspace.util.GlobalizationUtil;
|
||||
|
||||
|
||||
/**
|
||||
* Another entry point into a standard portal workspace page where the
|
||||
* page is constructed in "edit" mode to allow configuration and modification
|
||||
* by an authorized participant.
|
||||
*
|
||||
* It is used via a jsp page which is invoked at the applications url.
|
||||
*
|
||||
* Example code stub:
|
||||
* <pre>
|
||||
* <define:component name="edit"
|
||||
* classname="com.arsdigita.portalworkspace.ui.WorkspaceEditor" />
|
||||
* <jsp:scriptlet>
|
||||
* ((AbstractWorkspaceComponent)edit).setWorkspaceModel(
|
||||
* new DefaultWorkspaceSelectionModel());
|
||||
* </jsp:scriptlet>
|
||||
* </pre>
|
||||
*
|
||||
* Currently there is a jsp for the default url at
|
||||
* (web)/templates/ccm-portalworkspace/edit.jsp which is mapped via web.xml
|
||||
* to /ccm/portal/edit.jsp in the default, pre-configured configuration.
|
||||
*/
|
||||
public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(WorkspaceEditor.class);
|
||||
|
||||
private ActionLink m_add;
|
||||
|
||||
private SelectThemeForm m_selectForm;
|
||||
|
||||
private RadioGroup m_grp;
|
||||
|
||||
private CreateThemeForm m_createForm;
|
||||
|
||||
private ActionLink m_createThemeLink;
|
||||
|
||||
private WorkspaceThemeCollection m_workspaceThemes;
|
||||
|
||||
private BasicPropertiesForm m_basisPropertiesForm;
|
||||
|
||||
private ActionLink m_editBasicPropertiesLink;
|
||||
|
||||
|
||||
/**
|
||||
* Default Constructor constructs a new, empty WorkspaceEditor object.
|
||||
*/
|
||||
public WorkspaceEditor() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a WorkspaceViewer for a specific workspace object
|
||||
* and sets the xml tags accordingly.
|
||||
*
|
||||
* @param workspace
|
||||
*/
|
||||
public WorkspaceEditor(WorkspaceSelectionModel workspace) {
|
||||
|
||||
super(workspace);
|
||||
s_log.debug("WorkspaceEditor constructed");
|
||||
|
||||
m_add = new ActionLink("add pane");
|
||||
m_add.setClassAttr("actionLink");
|
||||
m_add.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent 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 page = workspace.addPage("New page",
|
||||
"New portal page");
|
||||
}
|
||||
});
|
||||
|
||||
add(m_add);
|
||||
|
||||
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();
|
||||
|
||||
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
|
||||
.globalize("portal.ui.admin.edit_basic_properties").localize());
|
||||
m_editBasicPropertiesLink
|
||||
.addActionListener(new BasicPropertiesLinkListener());
|
||||
m_editBasicPropertiesLink.setClassAttr("actionLink");
|
||||
add(m_editBasicPropertiesLink);
|
||||
m_basisPropertiesForm = new BasicPropertiesForm();
|
||||
add(m_basisPropertiesForm);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portal
|
||||
* @return
|
||||
*/
|
||||
protected PortalList createPortalList(PortalSelectionModel portal) {
|
||||
return new PortalListEditor(portal);
|
||||
}
|
||||
|
||||
|
||||
public void register(Page page) {
|
||||
super.register(page);
|
||||
page.setVisibleDefault(m_selectForm, !m_workspaceThemes.isEmpty());
|
||||
page.setVisibleDefault(m_createForm, false);
|
||||
page.setVisibleDefault(m_basisPropertiesForm, false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portal
|
||||
* @return
|
||||
*/
|
||||
protected PersistentPortal createPortalDisplay(PortalSelectionModel portal) {
|
||||
return new PersistentPortal(portal, PortalConstants.MODE_EDITOR);
|
||||
}
|
||||
|
||||
// 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()) {
|
||||
String id = m_workspaceThemes.getWorkspaceTheme().getID()
|
||||
.toString();
|
||||
String name = m_workspaceThemes.getWorkspaceTheme().getName();
|
||||
addOption(id, 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;
|
||||
private Submit button;
|
||||
RequestLocal prtlRL;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public SelectThemeForm() {
|
||||
super("selectthemeform");
|
||||
s_log.debug("SelectThemeForm constructed");
|
||||
instruction = new Label(GlobalizationUtil
|
||||
.globalize("portal.ui.admin.select_theme_for_portal"));
|
||||
button = new Submit("selecttheme", GlobalizationUtil
|
||||
.globalize("portal.ui.select_theme"));
|
||||
button.setButtonLabel("Select Theme");
|
||||
|
||||
add(instruction);
|
||||
add(button);
|
||||
m_grp.addValidationListener(new NotNullValidationListener(
|
||||
"Select a Theme"));
|
||||
add(m_grp);
|
||||
addProcessListener(this);
|
||||
addInitListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
public void process(FormSectionEvent e) {
|
||||
s_log.debug("process called for SelectThemeForm");
|
||||
String selectedkey;
|
||||
PageState s = e.getPageState();
|
||||
|
||||
if (button.isSelected(s)) {
|
||||
selectedkey = (String) m_grp.getValue(s);
|
||||
BigDecimal bd = new BigDecimal(selectedkey);
|
||||
|
||||
WorkspaceTheme theme = WorkspaceTheme
|
||||
.retrieveWorkspaceTheme(bd);
|
||||
Workspace workspace = getSelectedWorkspace(s);
|
||||
workspace.setTheme(theme);
|
||||
workspace.save();
|
||||
}
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent e) throws FormProcessException {
|
||||
s_log.debug("init called for SelectThemeForm");
|
||||
PageState ps = e.getPageState();
|
||||
if (m_workspaceThemes.isEmpty())
|
||||
this.setVisible(ps, false);
|
||||
if (this.isVisible(ps)) {
|
||||
m_createThemeLink.setVisible(ps, true);
|
||||
m_createForm.setVisible(ps, false);
|
||||
m_basisPropertiesForm.setVisible(ps, false);
|
||||
}
|
||||
FormData fd = e.getFormData();
|
||||
Workspace workspace = getSelectedWorkspace(ps);
|
||||
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;
|
||||
private TextField themename;
|
||||
private ColorPicker background;
|
||||
private ColorPicker text;
|
||||
private ColorPicker activetab;
|
||||
private ColorPicker inactivetab;
|
||||
private ColorPicker activetabtext;
|
||||
private ColorPicker inactivetabtext;
|
||||
private ColorPicker toprule;
|
||||
private ColorPicker bottomrule;
|
||||
private ColorPicker portletheader;
|
||||
private ColorPicker portletborder;
|
||||
private ColorPicker portletheadertext;
|
||||
private ColorPicker portletbodynarrow;
|
||||
RequestLocal prtlRL;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public CreateThemeForm() {
|
||||
super("createthemeform");
|
||||
s_log.debug("CreateThemeForm constructed");
|
||||
setClassAttr("themecreator");
|
||||
savebutton = new Submit("savetheme");
|
||||
savebutton.setButtonLabel("Save Theme");
|
||||
instruction = new Label(GlobalizationUtil
|
||||
.globalize("portal.ui.admin.create_theme_instruction"));
|
||||
text = new ColorPicker("Page Text Color ", "#112233");
|
||||
background = new ColorPicker("Page Background Color ", "#112233");
|
||||
activetab = new ColorPicker("Selected Tab Color ", "#1F22B3");
|
||||
inactivetab = new ColorPicker("Unselected Tab Color ", "#112233");
|
||||
activetabtext = new ColorPicker("Selected Tab Text Color",
|
||||
"#FFFFFF");
|
||||
inactivetabtext = new ColorPicker("Unselected Tab Text Color ",
|
||||
"#11CC33");
|
||||
toprule = new ColorPicker("Top Rule Color ", "#FFFFFF");
|
||||
bottomrule = new ColorPicker("Bottom Rule Color ", "#FFFFFF");
|
||||
portletheader = new ColorPicker("Portlet Header Color ", "#FFFFFF");
|
||||
portletborder = new ColorPicker("Portlet Border Color ", "#FFFFFF");
|
||||
portletheadertext = new ColorPicker("Portlet Header Text Color ",
|
||||
"#FFFFFF");
|
||||
portletbodynarrow = new ColorPicker(
|
||||
"Narrow Column Portlet Body Color ", "#FFFFFF");
|
||||
|
||||
themename = new TextField("themename");
|
||||
themename.addValidationListener(new NotNullValidationListener(
|
||||
"Please provide a name for this theme."));
|
||||
|
||||
add(instruction);
|
||||
add(themename);
|
||||
add(background);
|
||||
add(text);
|
||||
add(activetab);
|
||||
add(inactivetab);
|
||||
add(activetabtext);
|
||||
add(inactivetabtext);
|
||||
add(toprule);
|
||||
add(bottomrule);
|
||||
add(portletheader);
|
||||
add(portletheadertext);
|
||||
add(portletborder);
|
||||
add(portletbodynarrow);
|
||||
add(savebutton);
|
||||
|
||||
addProcessListener(this);
|
||||
addInitListener(this);
|
||||
}
|
||||
|
||||
public void process(FormSectionEvent e) {
|
||||
s_log.debug("processing the create theme form");
|
||||
PageState ps = e.getPageState();
|
||||
if (savebutton.isSelected(ps)) {
|
||||
WorkspaceTheme theme = new WorkspaceTheme((String) themename
|
||||
.getValue(ps));
|
||||
theme.setActiveTabColor(activetab.getValue(ps));
|
||||
theme.setInactiveTabColor(inactivetab.getValue(ps));
|
||||
theme.setActiveTabTextColor(activetabtext.getValue(ps));
|
||||
theme.setInactiveTabTextColor(inactivetabtext.getValue(ps));
|
||||
theme.setTopRuleColor(toprule.getValue(ps));
|
||||
theme.setBottomRuleColor(bottomrule.getValue(ps));
|
||||
theme.setPortletHeaderColor(portletheader.getValue(ps));
|
||||
theme.setPortletIconColor(portletheader.getValue(ps));
|
||||
theme.setPortletBorderColor(portletborder.getValue(ps));
|
||||
theme.setPortletHeaderTextColor(portletheadertext.getValue(ps));
|
||||
theme.setPageBGColor(background.getValue(ps));
|
||||
theme.setBodyTextColor(text.getValue(ps));
|
||||
theme.setNarrowBGColor(portletbodynarrow.getValue(ps));
|
||||
s_log.debug("saving the theme");
|
||||
theme.save();
|
||||
}
|
||||
m_selectForm.setVisible(ps, true);
|
||||
m_createThemeLink.setVisible(ps, true);
|
||||
m_editBasicPropertiesLink.setVisible(ps, true);
|
||||
this.setVisible(ps, false);
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent e) throws FormProcessException {
|
||||
// PageState ps = e.getPageState();
|
||||
// this.setVisible(ps, false);
|
||||
}
|
||||
}
|
||||
|
||||
private class CreateThemeLinkListener implements ActionListener {
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
PageState ps = event.getPageState();
|
||||
m_createForm.setVisible(ps, true);
|
||||
m_selectForm.setVisible(ps, false);
|
||||
m_createThemeLink.setVisible(ps, false);
|
||||
m_editBasicPropertiesLink.setVisible(ps, false);
|
||||
}
|
||||
}
|
||||
|
||||
private class BasicPropertiesLinkListener implements ActionListener {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
PageState ps = e.getPageState();
|
||||
m_createForm.setVisible(ps, false);
|
||||
m_selectForm.setVisible(ps, false);
|
||||
m_createThemeLink.setVisible(ps, false);
|
||||
m_editBasicPropertiesLink.setVisible(ps, false);
|
||||
m_basisPropertiesForm.setVisible(ps, true);
|
||||
}
|
||||
}
|
||||
|
||||
public class BasicPropertiesForm extends Form implements
|
||||
FormProcessListener, FormInitListener {
|
||||
private Label title;
|
||||
|
||||
private TextField m_title;
|
||||
|
||||
private Label description;
|
||||
|
||||
private Submit savebutton;
|
||||
|
||||
private Submit cancelbutton;
|
||||
|
||||
private TextArea m_description;
|
||||
|
||||
public BasicPropertiesForm() {
|
||||
super("basicpropertiesform");
|
||||
setClassAttr("basicprops");
|
||||
|
||||
title = new Label(GlobalizationUtil
|
||||
.globalize("portal.ui.admin.workspace_title"));
|
||||
|
||||
m_title = new TextField("title");
|
||||
m_title.setSize(40);
|
||||
m_title.getParameterModel().addParameterListener(
|
||||
new NotEmptyValidationListener());
|
||||
|
||||
m_description = new TextArea("description");
|
||||
m_description.setRows(10);
|
||||
m_description.setCols(40);
|
||||
|
||||
description = new Label(GlobalizationUtil
|
||||
.globalize("portal.ui.admin.workspace_description"));
|
||||
|
||||
savebutton = new Submit("save", "Save");
|
||||
cancelbutton = new Submit("cancel", "Cancel");
|
||||
|
||||
add(title);
|
||||
add(m_title);
|
||||
add(description);
|
||||
add(m_description);
|
||||
add(cancelbutton);
|
||||
add(savebutton);
|
||||
addProcessListener(this);
|
||||
addInitListener(this);
|
||||
}
|
||||
|
||||
public void process(FormSectionEvent e) {
|
||||
s_log.debug("processing the basic properties form");
|
||||
PageState ps = e.getPageState();
|
||||
if (savebutton.isSelected(ps)) {
|
||||
|
||||
Workspace workspace = getSelectedWorkspace(ps);
|
||||
workspace.setTitle((String) m_title.getValue(ps));
|
||||
workspace.setDescription((String) m_description.getValue(ps));
|
||||
workspace.save();
|
||||
}
|
||||
m_selectForm.setVisible(ps, true);
|
||||
m_createThemeLink.setVisible(ps, true);
|
||||
m_editBasicPropertiesLink.setVisible(ps, true);
|
||||
this.setVisible(ps, false);
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent e) throws FormProcessException {
|
||||
// s_log.debug("initialising the basic properties form");
|
||||
PageState ps = e.getPageState();
|
||||
Workspace workspace = getSelectedWorkspace(ps);
|
||||
m_title.setValue(ps, workspace.getTitle());
|
||||
m_description.setValue(ps, workspace.getDescription());
|
||||
// s_log.debug("setting visibility to false");
|
||||
// this.setVisible(ps, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -15,8 +15,6 @@
|
|||
|
||||
package com.arsdigita.portalworkspace.ui.admin;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.arsdigita.bebop.Form;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SimpleContainer;
|
||||
|
|
@ -24,33 +22,51 @@ import com.arsdigita.kernel.Group;
|
|||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.Role;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author
|
||||
*/
|
||||
public class AdminPane extends SimpleContainer {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(AdminPane.class);
|
||||
|
||||
private ApplicationSelectionModel m_app;
|
||||
|
||||
private CategoryComponent m_catComponent;
|
||||
|
||||
private DeleteApplicationComponent m_deleteApplicationComponent;
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(AdminPane.class);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public AdminPane() {
|
||||
|
||||
setTag("portal:admin");
|
||||
setNamespace(PortalConstants.PORTAL_XML_NS);
|
||||
setNamespace(WorkspacePage.PORTAL_XML_NS);
|
||||
|
||||
m_app = new ApplicationSelectionModel("application", true);
|
||||
|
||||
|
||||
/* Add component to select a Navigatgion Category for this portal */
|
||||
m_catComponent = new CategoryComponent(m_app);
|
||||
m_catComponent.setIdAttr("categoryComponent");
|
||||
add(m_catComponent);
|
||||
|
||||
|
||||
/* Add component "Extrem Action": Delete this portal */
|
||||
m_deleteApplicationComponent = new DeleteApplicationComponent(m_app,
|
||||
m_app.getDefaultApplication().getApplicationType());
|
||||
m_deleteApplicationComponent.setIdAttr("deleteComponent");
|
||||
add(m_deleteApplicationComponent);
|
||||
|
||||
|
||||
/* Add component to manage Members group members for this portal */
|
||||
GroupMemberDisplay members = new GroupMemberDisplay() {
|
||||
public Group getGroup(PageState state) {
|
||||
Workspace workspace = (Workspace) Kernel.getContext()
|
||||
|
|
@ -62,7 +78,7 @@ public class AdminPane extends SimpleContainer {
|
|||
add(members);
|
||||
|
||||
Form form = new Form("userPicker", new SimpleContainer(
|
||||
"portal:memberPicker", PortalConstants.PORTAL_XML_NS));
|
||||
"portal:memberPicker", WorkspacePage.PORTAL_XML_NS));
|
||||
form.add(new GroupMemberPicker() {
|
||||
public Group getGroup(PageState state) {
|
||||
Workspace workspace = (Workspace) Kernel.getContext()
|
||||
|
|
@ -73,6 +89,8 @@ public class AdminPane extends SimpleContainer {
|
|||
form.setIdAttr("memberUserPicker");
|
||||
add(form);
|
||||
|
||||
|
||||
/* Add component to manage Admins group members for this portal */
|
||||
GroupMemberDisplay admins = new GroupMemberDisplay() {
|
||||
public Group getGroup(PageState state) {
|
||||
Workspace workspace = (Workspace) Kernel.getContext()
|
||||
|
|
@ -90,7 +108,7 @@ public class AdminPane extends SimpleContainer {
|
|||
add(admins);
|
||||
|
||||
Form adminForm = new Form("adminPicker", new SimpleContainer(
|
||||
"portal:adminPicker", PortalConstants.PORTAL_XML_NS));
|
||||
"portal:adminPicker", WorkspacePage.PORTAL_XML_NS));
|
||||
adminForm.add(new GroupMemberPicker() {
|
||||
public Group getGroup(PageState state) {
|
||||
Workspace workspace = (Workspace) Kernel.getContext()
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.apache.log4j.Logger;
|
|||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SimpleContainer;
|
||||
import com.arsdigita.domain.DomainObjectXMLRenderer;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.xml.Element;
|
||||
|
||||
|
|
@ -34,11 +34,17 @@ public class ApplicationDetails extends SimpleContainer {
|
|||
private ApplicationSelectionModel m_app;
|
||||
|
||||
public ApplicationDetails(ApplicationSelectionModel app) {
|
||||
super("portal:applicationDetails", PortalConstants.PORTAL_XML_NS);
|
||||
super("portal:applicationDetails", WorkspacePage.PORTAL_XML_NS);
|
||||
|
||||
m_app = app;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @param parent
|
||||
*/
|
||||
@Override
|
||||
public void generateXML(PageState state, Element parent) {
|
||||
Element content = generateParent(parent);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ import com.arsdigita.bebop.PageState;
|
|||
import com.arsdigita.bebop.SimpleContainer;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.domain.DomainObjectXMLRenderer;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.web.ApplicationCollection;
|
||||
|
|
@ -50,15 +50,17 @@ public class ApplicationList extends SimpleContainer {
|
|||
* @param app
|
||||
*/
|
||||
public ApplicationList(ApplicationSelectionModel app) {
|
||||
super("portal:applicationList", PortalConstants.PORTAL_XML_NS);
|
||||
|
||||
super("portal:applicationList", WorkspacePage.PORTAL_XML_NS);
|
||||
m_app = app;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
@Override
|
||||
public void respond(PageState state) {
|
||||
String key = state.getControlEventName();
|
||||
String value = state.getControlEventValue();
|
||||
|
|
@ -75,12 +77,13 @@ public class ApplicationList extends SimpleContainer {
|
|||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of installed applications and creates the xml to show
|
||||
* a listing.
|
||||
* Retrieves a list of installed applications and creates the xml
|
||||
* to show a listing.
|
||||
*
|
||||
* @param state
|
||||
* @param parent
|
||||
*/
|
||||
@Override
|
||||
public void generateXML(PageState state, Element parent) {
|
||||
|
||||
Element content = generateParent(parent);
|
||||
|
|
@ -92,7 +95,7 @@ public class ApplicationList extends SimpleContainer {
|
|||
Application app = (Application) apps.getDomainObject();
|
||||
|
||||
Element appEl = content.newChildElement("portal:application",
|
||||
PortalConstants.PORTAL_XML_NS);
|
||||
WorkspacePage.PORTAL_XML_NS);
|
||||
try {
|
||||
state.setControlEvent(this, SELECT, app.getOID().toString());
|
||||
appEl.addAttribute("appClass", app.getClass().getName());
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ import com.arsdigita.bebop.event.ActionListener;
|
|||
import com.arsdigita.categorization.Category;
|
||||
import com.arsdigita.kernel.Resource;
|
||||
import com.arsdigita.kernel.ui.ResourceConfigComponent;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.web.ApplicationType;
|
||||
import com.arsdigita.web.ApplicationTypeCollection;
|
||||
|
|
@ -52,7 +52,7 @@ public class ApplicationPane extends SimpleContainer {
|
|||
* @param app
|
||||
*/
|
||||
public ApplicationPane(ApplicationSelectionModel app) {
|
||||
super("portal:applicationPane", PortalConstants.PORTAL_XML_NS);
|
||||
super("portal:applicationPane", WorkspacePage.PORTAL_XML_NS);
|
||||
|
||||
m_app = app;
|
||||
|
||||
|
|
@ -71,6 +71,7 @@ public class ApplicationPane extends SimpleContainer {
|
|||
add(m_newApp);
|
||||
|
||||
final RequestLocal appRL = new RequestLocal() {
|
||||
@Override
|
||||
public Object initialValue(PageState state) {
|
||||
return m_app.getSelectedObject(state);
|
||||
}
|
||||
|
|
@ -97,6 +98,7 @@ public class ApplicationPane extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(Page p) {
|
||||
super.register(p);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,10 +26,9 @@ import com.arsdigita.web.Application;
|
|||
import com.arsdigita.web.Web;
|
||||
|
||||
/**
|
||||
* This selection model adds an (optional?) default value which will be returned
|
||||
* when nothing is selected.
|
||||
* This selection model adds an (optional?) default value which will be
|
||||
* returned when nothing is selected.
|
||||
*/
|
||||
|
||||
public class ApplicationSelectionModel extends ACSObjectSelectionModel {
|
||||
|
||||
public static final String DEFAULT_PARAM_NAME = "app_id";
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ import com.arsdigita.categorization.CategoryTreeModelLite;
|
|||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.Filter;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.util.Assert;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
import com.arsdigita.web.Application;
|
||||
|
|
@ -64,6 +64,10 @@ public class CategoryComponent extends SimpleContainer {
|
|||
|
||||
private static final Category m_root = Category.getRootForObject(m_app);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param appModel
|
||||
*/
|
||||
public CategoryComponent(ApplicationSelectionModel appModel) {
|
||||
// this model means that the server needs a restart
|
||||
// if you want to map a category to this personal portal
|
||||
|
|
@ -71,7 +75,7 @@ public class CategoryComponent extends SimpleContainer {
|
|||
// restart the server otherwise you will get an exception next time
|
||||
// this Component is viewed.
|
||||
if (m_root != null) {
|
||||
setNamespace(PortalConstants.PORTAL_XML_NS);
|
||||
setNamespace(WorkspacePage.PORTAL_XML_NS);
|
||||
setTag("portal:categoryPanel");
|
||||
|
||||
m_appModel = appModel;
|
||||
|
|
@ -87,6 +91,9 @@ public class CategoryComponent extends SimpleContainer {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class CategoryTree extends Tree {
|
||||
public CategoryTree(ACSObjectSelectionModel categoryModel) {
|
||||
super(new SectionTreeModelBuilder());
|
||||
|
|
@ -96,6 +103,9 @@ public class CategoryComponent extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class CategoryTreeActionListener implements ActionListener {
|
||||
private ACSObjectSelectionModel m_catModel;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import com.arsdigita.bebop.event.ActionEvent;
|
|||
import com.arsdigita.bebop.event.ActionListener;
|
||||
import com.arsdigita.portalworkspace.util.GlobalizationUtil;
|
||||
import com.arsdigita.categorization.Category;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.web.ApplicationType;
|
||||
import com.arsdigita.web.RedirectSignal;
|
||||
|
|
@ -133,7 +133,7 @@ public class DeleteApplicationComponent extends SimpleContainer {
|
|||
ApplicationSelectionModel applicationSelectionModel) {
|
||||
s_log.debug("DeleteApplicationComponent instantiated");
|
||||
|
||||
setNamespace(PortalConstants.PORTAL_XML_NS);
|
||||
setNamespace(WorkspacePage.PORTAL_XML_NS);
|
||||
setTag("portal:workspaceDelete");
|
||||
m_appModel = applicationSelectionModel;
|
||||
if (m_delete == null)
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ import com.arsdigita.bebop.form.SingleSelect;
|
|||
import com.arsdigita.bebop.form.Submit;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.toolbox.ui.OIDParameter;
|
||||
import com.arsdigita.web.ApplicationType;
|
||||
import com.arsdigita.web.ApplicationTypeCollection;
|
||||
|
|
@ -41,7 +41,7 @@ public class NewApplicationForm extends Form {
|
|||
|
||||
public NewApplicationForm() {
|
||||
super("newApp", new SimpleContainer("portal:newApplication",
|
||||
PortalConstants.PORTAL_XML_NS));
|
||||
WorkspacePage.PORTAL_XML_NS));
|
||||
|
||||
m_app = new SingleSelect(new OIDParameter("app"));
|
||||
ApplicationTypeCollection types = ApplicationType
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ import com.arsdigita.kernel.permissions.PermissionService;
|
|||
import com.arsdigita.portalworkspace.util.GlobalizationUtil;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
import com.arsdigita.portalworkspace.ui.ParticipantBrowsePane;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.london.util.ui.DomainObjectSelectionModel;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
//?
|
||||
import com.arsdigita.toolbox.ui.ACSObjectCollectionListModel;
|
||||
// import com.arsdigita.toolbox.ui.ACSObjectCollectionListModel;
|
||||
import com.arsdigita.toolbox.ui.IteratorListModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -94,12 +94,13 @@ public class PeoplePane extends SimpleContainer {
|
|||
|
||||
public PeoplePane() {
|
||||
setTag("portal:admin");
|
||||
setNamespace(PortalConstants.PORTAL_XML_NS);
|
||||
setNamespace(WorkspacePage.PORTAL_XML_NS);
|
||||
}
|
||||
|
||||
public void init(StringParameter sp) {
|
||||
|
||||
m_workspaceRL = new RequestLocal() {
|
||||
@Override
|
||||
protected Object initialValue(PageState ps) {
|
||||
return Kernel.getContext().getResource();
|
||||
}
|
||||
|
|
@ -188,6 +189,7 @@ public class PeoplePane extends SimpleContainer {
|
|||
|
||||
final DomainObjectSelectionModel selectionModel =
|
||||
new DomainObjectSelectionModel("selectedRole") {
|
||||
@Override
|
||||
public void setSelectedKey(PageState state,
|
||||
Object key) {
|
||||
if (key != null) {
|
||||
|
|
@ -210,6 +212,7 @@ public class PeoplePane extends SimpleContainer {
|
|||
al.add(r.getOID());
|
||||
}
|
||||
return new IteratorListModel(al.iterator()) {
|
||||
@Override
|
||||
public Object getElement() {
|
||||
OID oid = (OID) super.getElement();
|
||||
Role r = (Role) new Role(oid);
|
||||
|
|
@ -231,6 +234,7 @@ public class PeoplePane extends SimpleContainer {
|
|||
return true;
|
||||
}
|
||||
}) {
|
||||
@Override
|
||||
public Object getSelectedKey(PageState state) {
|
||||
Object key = super.getSelectedKey(state);
|
||||
if (key != null) {
|
||||
|
|
@ -254,6 +258,7 @@ public class PeoplePane extends SimpleContainer {
|
|||
("Workspace Roles", rList, selectionModel, "Add a role", new Label(""));
|
||||
|
||||
final RequestLocal role = new RequestLocal() {
|
||||
@Override
|
||||
public Object initialValue(PageState ps) {
|
||||
return (Role) selectionModel.getSelectedObject(ps);
|
||||
}
|
||||
|
|
@ -338,6 +343,7 @@ public class PeoplePane extends SimpleContainer {
|
|||
properties.add(new Label(GlobalizationUtil.globalize("cw.workspace.ui.admin.role_name")));
|
||||
|
||||
final TextField roleNameEntry = new TextField("roleName") {
|
||||
@Override
|
||||
public boolean isVisible(PageState ps) {
|
||||
Role r = (Role)roleRL.get(ps);
|
||||
return ((r != null) && !isSystem(r));
|
||||
|
|
@ -346,6 +352,7 @@ public class PeoplePane extends SimpleContainer {
|
|||
roleNameEntry.addValidationListener(new NotEmptyValidationListener());
|
||||
|
||||
final Label roleNameDisplay = new Label(GlobalizationUtil.globalize("cw.workspace.ui.admin.null_role")) {
|
||||
@Override
|
||||
public boolean isVisible(PageState ps) {
|
||||
Role r = (Role)roleRL.get(ps);
|
||||
return !roleNameEntry.isVisible(ps);
|
||||
|
|
@ -400,6 +407,7 @@ public class PeoplePane extends SimpleContainer {
|
|||
|
||||
properties.add(new Label());
|
||||
properties.add(new Submit("Update Role") {
|
||||
@Override
|
||||
public boolean isVisible(PageState ps) {
|
||||
return roleNameEntry.isVisible(ps);
|
||||
}
|
||||
|
|
@ -430,6 +438,7 @@ public class PeoplePane extends SimpleContainer {
|
|||
result.add(properties);
|
||||
|
||||
final ActionLink deleteRole = new ActionLink( (String) GlobalizationUtil.globalize("cw.workspace.ui.admin.delete_role").localize()) {
|
||||
@Override
|
||||
public boolean isVisible(PageState ps) {
|
||||
Role r = (Role) roleRL.get(ps);
|
||||
return !isSystem(r);
|
||||
|
|
|
|||
|
|
@ -18,16 +18,16 @@
|
|||
|
||||
package com.arsdigita.portalworkspace.ui.admin;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SimpleContainer;
|
||||
import com.arsdigita.bebop.event.ChangeEvent;
|
||||
import com.arsdigita.bebop.event.ChangeListener;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.web.Application;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Entry page for Application administration as part of ccm portal. Invocation
|
||||
* by /web/templates/ccm-ldn-portal/admin/sitemap.jsp
|
||||
|
|
@ -38,21 +38,21 @@ import com.arsdigita.web.Application;
|
|||
*/
|
||||
public class SiteMapPane extends SimpleContainer {
|
||||
|
||||
/** Private Logger instance */
|
||||
private static final Logger s_log = Logger.getLogger(SiteMapPane.class);
|
||||
|
||||
private ApplicationSelectionModel m_app;
|
||||
|
||||
private ApplicationList m_appList;
|
||||
|
||||
private ApplicationPane m_appPane;
|
||||
|
||||
/** Private Logger instance */
|
||||
private static final Logger s_log = Logger.getLogger(SiteMapPane.class);
|
||||
|
||||
/**
|
||||
* Constructor creates a new application admin pane instance
|
||||
*/
|
||||
public SiteMapPane() {
|
||||
setTag("portal:sitemap");
|
||||
setNamespace(PortalConstants.PORTAL_XML_NS);
|
||||
setNamespace(WorkspacePage.PORTAL_XML_NS);
|
||||
|
||||
m_app = new ApplicationSelectionModel("application", false);
|
||||
m_app.addChangeListener(new ApplicationEditListener());
|
||||
|
|
@ -69,6 +69,7 @@ public class SiteMapPane extends SimpleContainer {
|
|||
*
|
||||
* @param p
|
||||
*/
|
||||
@Override
|
||||
public void register(Page p) {
|
||||
super.register(p);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.portalworkspace.ui;
|
||||
package com.arsdigita.portalworkspace.ui.jsp;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.ActionEvent;
|
||||
|
|
@ -33,6 +33,7 @@ import com.arsdigita.portalworkspace.WorkspacePageCollection;
|
|||
import com.arsdigita.london.util.DomainObjectCopier;
|
||||
import com.arsdigita.portal.Portlet;
|
||||
import com.arsdigita.portal.PortletCollection;
|
||||
import com.arsdigita.portalworkspace.ui.WorkspaceComponent;
|
||||
import com.arsdigita.web.LoginSignal;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -42,13 +43,14 @@ import org.apache.log4j.Logger;
|
|||
|
||||
|
||||
/**
|
||||
* Another specific entry point into a portal workspace page, here based upon
|
||||
* WorkspaceComponent (as an alternative to AbstractWorkspaceComponent.
|
||||
* Another specific entry point into a portal workspace page, here based
|
||||
* upon WorkspaceComponent (as an alternative to be based on
|
||||
* 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.
|
||||
// propably unfinished work or unfinished 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
|
||||
|
|
@ -16,8 +16,9 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.portalworkspace.ui;
|
||||
package com.arsdigita.portalworkspace.ui.jsp;
|
||||
|
||||
import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.portalworkspace.ui;
|
||||
package com.arsdigita.portalworkspace.ui.jsp;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Container;
|
||||
|
|
@ -28,6 +28,8 @@ import com.arsdigita.dispatcher.AccessDeniedException;
|
|||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.Party;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
import com.arsdigita.portalworkspace.ui.PortalHelper;
|
||||
import com.arsdigita.portalworkspace.ui.WorkspaceComponent;
|
||||
import com.arsdigita.toolbox.ui.SecurityContainer;
|
||||
import com.arsdigita.web.LoginSignal;
|
||||
|
||||
|
|
@ -16,8 +16,9 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.portalworkspace.ui;
|
||||
package com.arsdigita.portalworkspace.ui.jsp;
|
||||
|
||||
import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
|
|
@ -0,0 +1,244 @@
|
|||
/*
|
||||
* 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.jsp;
|
||||
|
||||
import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel;
|
||||
import com.arsdigita.bebop.ActionLink;
|
||||
import com.arsdigita.bebop.Form;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.ActionEvent;
|
||||
import com.arsdigita.bebop.event.ActionListener;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.form.Submit;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||
import com.arsdigita.dispatcher.AccessDeniedException;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.Party;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.portalworkspace.ui.AbstractWorkspaceComponent;
|
||||
import com.arsdigita.portalworkspace.ui.PersistentPortal;
|
||||
import com.arsdigita.portalworkspace.ui.PortalHelper;
|
||||
import com.arsdigita.portalworkspace.ui.PortalList;
|
||||
import com.arsdigita.portalworkspace.ui.PortalListEditor;
|
||||
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
||||
import com.arsdigita.portalworkspace.util.GlobalizationUtil;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* Another entry point into a standard portal workspace page where the
|
||||
* page is constructed in "edit" mode to allow configuration and
|
||||
* modification by an authorized participant.
|
||||
*
|
||||
* It is used via a jsp page which is invoked at the applications url.
|
||||
*
|
||||
* Example code stub:
|
||||
* <pre>
|
||||
* <define:component name="edit"
|
||||
* classname="com.arsdigita.portalworkspace.ui.WorkspaceEditor" />
|
||||
* <jsp:scriptlet>
|
||||
* ((AbstractWorkspaceComponent)edit).setWorkspaceModel(
|
||||
* new DefaultWorkspaceSelectionModel());
|
||||
* </jsp:scriptlet>
|
||||
* </pre>
|
||||
*
|
||||
* Currently there is a jsp for the default url at
|
||||
* (web)/templates/ccm-portalworkspace/edit.jsp which is mapped via web.xml
|
||||
* to /ccm/portal/edit.jsp in the default, pre-configured configuration.
|
||||
*/
|
||||
public class WorkspaceEditor extends AbstractWorkspaceComponent {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(WorkspaceEditor.class);
|
||||
|
||||
private ActionLink m_add;
|
||||
|
||||
private BasicPropertiesForm m_basisPropertiesForm;
|
||||
|
||||
private ActionLink m_editBasicPropertiesLink;
|
||||
|
||||
|
||||
/**
|
||||
* Default Constructor constructs a new, empty WorkspaceEditor object.
|
||||
*/
|
||||
public WorkspaceEditor() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a WorkspaceViewer for a specific workspace object
|
||||
* and sets the xml tags accordingly.
|
||||
*
|
||||
* @param workspace
|
||||
*/
|
||||
public WorkspaceEditor(WorkspaceSelectionModel workspace) {
|
||||
|
||||
super(workspace);
|
||||
s_log.debug("WorkspaceEditor constructed");
|
||||
|
||||
m_add = new ActionLink("add pane");
|
||||
m_add.setClassAttr("actionLink");
|
||||
m_add.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent 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 page = workspace.addPage("New page",
|
||||
"New portal page");
|
||||
}
|
||||
});
|
||||
|
||||
add(m_add);
|
||||
|
||||
// now add the basic properties controls
|
||||
m_editBasicPropertiesLink = new ActionLink((String) GlobalizationUtil
|
||||
.globalize("portal.ui.admin.edit_basic_properties").localize());
|
||||
m_editBasicPropertiesLink
|
||||
.addActionListener(new BasicPropertiesLinkListener());
|
||||
m_editBasicPropertiesLink.setClassAttr("actionLink");
|
||||
add(m_editBasicPropertiesLink);
|
||||
m_basisPropertiesForm = new BasicPropertiesForm();
|
||||
add(m_basisPropertiesForm);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portal
|
||||
* @return
|
||||
*/
|
||||
protected PortalList createPortalList(PortalSelectionModel portal) {
|
||||
return new PortalListEditor(portal);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void register(Page page) {
|
||||
super.register(page);
|
||||
// Modigyable themes removed, cf. above
|
||||
// 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, WorkspacePage.MODE_EDITOR);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class BasicPropertiesLinkListener implements ActionListener {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
PageState ps = e.getPageState();
|
||||
m_editBasicPropertiesLink.setVisible(ps, false);
|
||||
m_basisPropertiesForm.setVisible(ps, true);
|
||||
}
|
||||
}
|
||||
|
||||
public class BasicPropertiesForm extends Form implements
|
||||
FormProcessListener, FormInitListener {
|
||||
private Label title;
|
||||
|
||||
private TextField m_title;
|
||||
|
||||
private Label description;
|
||||
|
||||
private Submit savebutton;
|
||||
|
||||
private Submit cancelbutton;
|
||||
|
||||
private TextArea m_description;
|
||||
|
||||
public BasicPropertiesForm() {
|
||||
super("basicpropertiesform");
|
||||
setClassAttr("basicprops");
|
||||
|
||||
title = new Label(GlobalizationUtil
|
||||
.globalize("portal.ui.admin.workspace_title"));
|
||||
|
||||
m_title = new TextField("title");
|
||||
m_title.setSize(40);
|
||||
m_title.getParameterModel().addParameterListener(
|
||||
new NotEmptyValidationListener());
|
||||
|
||||
m_description = new TextArea("description");
|
||||
m_description.setRows(10);
|
||||
m_description.setCols(40);
|
||||
|
||||
description = new Label(GlobalizationUtil
|
||||
.globalize("portal.ui.admin.workspace_description"));
|
||||
|
||||
savebutton = new Submit("save", "Save");
|
||||
cancelbutton = new Submit("cancel", "Cancel");
|
||||
|
||||
add(title);
|
||||
add(m_title);
|
||||
add(description);
|
||||
add(m_description);
|
||||
add(cancelbutton);
|
||||
add(savebutton);
|
||||
addProcessListener(this);
|
||||
addInitListener(this);
|
||||
}
|
||||
|
||||
public void process(FormSectionEvent e) {
|
||||
s_log.debug("processing the basic properties form");
|
||||
PageState ps = e.getPageState();
|
||||
if (savebutton.isSelected(ps)) {
|
||||
|
||||
Workspace workspace = getSelectedWorkspace(ps);
|
||||
workspace.setTitle((String) m_title.getValue(ps));
|
||||
workspace.setDescription((String) m_description.getValue(ps));
|
||||
workspace.save();
|
||||
}
|
||||
m_editBasicPropertiesLink.setVisible(ps, true);
|
||||
this.setVisible(ps, false);
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent e) throws FormProcessException {
|
||||
// s_log.debug("initialising the basic properties form");
|
||||
PageState ps = e.getPageState();
|
||||
Workspace workspace = getSelectedWorkspace(ps);
|
||||
m_title.setValue(ps, workspace.getTitle());
|
||||
m_description.setValue(ps, workspace.getDescription());
|
||||
// s_log.debug("setting visibility to false");
|
||||
// this.setVisible(ps, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,7 +16,15 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.portalworkspace.ui;
|
||||
package com.arsdigita.portalworkspace.ui.jsp;
|
||||
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel;
|
||||
import com.arsdigita.portalworkspace.ui.AbstractWorkspaceComponent;
|
||||
import com.arsdigita.portalworkspace.ui.PersistentPortal;
|
||||
import com.arsdigita.portalworkspace.ui.PortalList;
|
||||
import com.arsdigita.portalworkspace.ui.PortalListViewer;
|
||||
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
||||
|
||||
/**
|
||||
* Main (default) entry point into a standard portal workspace page where the
|
||||
|
|
@ -57,12 +65,22 @@ public class WorkspaceViewer extends AbstractWorkspaceComponent {
|
|||
super(workspace);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portal
|
||||
* @return
|
||||
*/
|
||||
protected PortalList createPortalList(PortalSelectionModel portal) {
|
||||
return new PortalListViewer(portal);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param portal
|
||||
* @return
|
||||
*/
|
||||
protected PersistentPortal createPortalDisplay(PortalSelectionModel portal) {
|
||||
return new PersistentPortal(portal, PortalConstants.MODE_DISPLAY);
|
||||
return new PersistentPortal(portal, WorkspacePage.MODE_DISPLAY);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.portalworkspace.ui;
|
||||
package com.arsdigita.portalworkspace.ui.personalws;
|
||||
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.event.RequestEvent;
|
||||
|
|
@ -16,7 +16,9 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.portalworkspace.ui;
|
||||
package com.arsdigita.portalworkspace.ui.personalws;
|
||||
|
||||
import com.arsdigita.portalworkspace.ui.WorkspaceComponent;
|
||||
|
||||
/**
|
||||
* Another specific entry point into a portal workspace page, here based upon
|
||||
|
|
@ -13,8 +13,9 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.portalworkspace.ui;
|
||||
package com.arsdigita.portalworkspace.ui.personalws;
|
||||
|
||||
import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
|
|
@ -22,8 +22,8 @@ import com.arsdigita.kernel.Party;
|
|||
import com.arsdigita.kernel.Resource;
|
||||
import com.arsdigita.kernel.permissions.PermissionService;
|
||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.portalworkspace.portlet.ApplicationDirectoryPortlet;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.web.ApplicationCollection;
|
||||
import com.arsdigita.web.URL;
|
||||
|
|
@ -41,7 +41,7 @@ public class ApplicationDirectoryPortletRenderer extends
|
|||
|
||||
public void generateBodyXML(PageState state, Element parent) {
|
||||
Element content = parent.newChildElement(
|
||||
"portlet:applicationDirectory", PortalConstants.PORTLET_XML_NS);
|
||||
"portlet:applicationDirectory", WorkspacePage.PORTLET_XML_NS);
|
||||
|
||||
Application current = Web.getContext().getApplication();
|
||||
Party party = Kernel.getContext().getParty();
|
||||
|
|
@ -55,7 +55,7 @@ public class ApplicationDirectoryPortletRenderer extends
|
|||
Application app = apps.getApplication();
|
||||
Element child = content.newChildElement(
|
||||
"portlet:applicationDirectoryEntry",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
|
||||
child.addAttribute("title", app.getTitle());
|
||||
child.addAttribute("description", app.getDescription());
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ import com.arsdigita.bebop.portal.AbstractPortletRenderer;
|
|||
import com.arsdigita.categorization.Category;
|
||||
import com.arsdigita.categorization.CategoryCollection;
|
||||
import com.arsdigita.portalworkspace.portlet.ContentDirectoryPortlet;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.web.ParameterMap;
|
||||
import com.arsdigita.web.URL;
|
||||
import com.arsdigita.web.Web;
|
||||
|
|
@ -58,7 +58,7 @@ public class ContentDirectoryPortletRenderer extends AbstractPortletRenderer {
|
|||
*/
|
||||
public void generateBodyXML(PageState state, Element parent) {
|
||||
Element element = parent.newChildElement("portlet:contentDirectory",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
element.addAttribute("id", getIdAttr());
|
||||
element.addAttribute("layout", m_portlet.getLayout());
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ public class ContentDirectoryPortletRenderer extends AbstractPortletRenderer {
|
|||
BigDecimal childSortKey) {
|
||||
Element el = new Element(depth == 1 ? "portlet:contentDirectoryEntry"
|
||||
: "portlet:contentDirectorySubentry",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
|
||||
el.addAttribute("id", XML.format(cat.getID()));
|
||||
el.addAttribute("name", cat.getName());
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ import java.util.Map;
|
|||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.portal.AbstractPortletRenderer;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.portalworkspace.portlet.FlashPortlet;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.xml.Element;
|
||||
|
||||
/**
|
||||
|
|
@ -51,7 +51,7 @@ public class FlashPortletRenderer extends AbstractPortletRenderer
|
|||
*/
|
||||
public void generateBodyXML(PageState state, Element parentElement)
|
||||
{
|
||||
Element portletElement = parentElement.newChildElement("portlet:flash", PortalConstants.PORTLET_XML_NS);
|
||||
Element portletElement = parentElement.newChildElement("portlet:flash", WorkspacePage.PORTLET_XML_NS);
|
||||
|
||||
portletElement.addAttribute(FlashPortlet.BACKGROUND_COLOUR, m_portlet.getBackgroundColour());
|
||||
portletElement.addAttribute(FlashPortlet.DETECT_KEY, m_portlet.getDetectKey());
|
||||
|
|
@ -67,13 +67,13 @@ public class FlashPortletRenderer extends AbstractPortletRenderer
|
|||
if (!parameters.isEmpty())
|
||||
{
|
||||
Element parametersElement = portletElement.newChildElement("portlet:parameters",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
for (Iterator i = parameters.keySet().iterator(); i.hasNext();)
|
||||
{
|
||||
String key = (String) i.next();
|
||||
String value = (String) parameters.get(key);
|
||||
Element parameterElement = parametersElement.newChildElement("portlet:parameter",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
parameterElement.addAttribute("name", key);
|
||||
parameterElement.addAttribute("value", value);
|
||||
}
|
||||
|
|
@ -82,13 +82,13 @@ public class FlashPortletRenderer extends AbstractPortletRenderer
|
|||
if (!variables.isEmpty())
|
||||
{
|
||||
Element variablesElement = portletElement.newChildElement("portlet:variables",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
for (Iterator i = variables.keySet().iterator(); i.hasNext();)
|
||||
{
|
||||
String key = (String) i.next();
|
||||
String value = (String) variables.get(key);
|
||||
Element variableElement = variablesElement.newChildElement("portlet:variable",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
variableElement.addAttribute("name", key);
|
||||
variableElement.addAttribute("value", value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ package com.arsdigita.portalworkspace.ui.portlet;
|
|||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.portal.AbstractPortletRenderer;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.portalworkspace.portlet.FreeformHTMLPortlet;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.xml.Element;
|
||||
|
||||
public class FreeformHTMLPortletRenderer extends AbstractPortletRenderer {
|
||||
|
|
@ -30,7 +30,7 @@ public class FreeformHTMLPortletRenderer extends AbstractPortletRenderer {
|
|||
|
||||
public void generateBodyXML(PageState state, Element parent) {
|
||||
Element content = parent.newChildElement("portlet:freeformHTML",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
content.setText(m_portlet.getContent());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ import com.arsdigita.kernel.permissions.UniversalPermissionDescriptor;
|
|||
import com.arsdigita.kernel.security.Credential;
|
||||
import com.arsdigita.kernel.security.CredentialEncodingException;
|
||||
import com.arsdigita.portalworkspace.portlet.LoginPortlet;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.persistence.DataQuery;
|
||||
import com.arsdigita.persistence.Session;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.ui.UI;
|
||||
import com.arsdigita.ui.login.LoginConstants;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
|
|
@ -63,7 +63,7 @@ public class LoginPortletRenderer extends AbstractPortletRenderer {
|
|||
*/
|
||||
public void generateBodyXML(PageState state, Element parent) {
|
||||
Element login = parent.newChildElement("portlet:login",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
|
||||
Party party = Kernel.getContext().getParty();
|
||||
if (party == null) {
|
||||
|
|
@ -81,7 +81,7 @@ public class LoginPortletRenderer extends AbstractPortletRenderer {
|
|||
}
|
||||
|
||||
Element content = login.newChildElement("portlet:loginform",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
|
||||
// content.addAttribute("url", LegacyInitializer
|
||||
// .getURL(LegacyInitializer.LOGIN_PAGE_KEY));
|
||||
|
|
@ -90,7 +90,7 @@ public class LoginPortletRenderer extends AbstractPortletRenderer {
|
|||
} else {
|
||||
User user = (User) party;
|
||||
Element content = login.newChildElement("portlet:loginuser",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
content.addAttribute("email", user.getPrimaryEmail().toString());
|
||||
content.addAttribute("givenName", user.getPersonName()
|
||||
.getGivenName());
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ package com.arsdigita.portalworkspace.ui.portlet;
|
|||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.portal.AbstractPortletRenderer;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.portalworkspace.portlet.RSSFeedPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.RSSFeedPortletHelper;
|
||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
||||
import com.arsdigita.xml.Element;
|
||||
|
||||
public class RSSFeedPortletRenderer extends AbstractPortletRenderer {
|
||||
|
|
@ -31,7 +31,7 @@ public class RSSFeedPortletRenderer extends AbstractPortletRenderer {
|
|||
|
||||
public void generateBodyXML(PageState state, Element parent) {
|
||||
Element content = parent.newChildElement("portlet:RSSFeed",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
|
||||
String feed = m_portlet.getURL();
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ public class RSSFeedPortletRenderer extends AbstractPortletRenderer {
|
|||
content.addContent(data);
|
||||
} else {
|
||||
Element error = content.newChildElement("portlet:RSSFeedError",
|
||||
PortalConstants.PORTLET_XML_NS);
|
||||
WorkspacePage.PORTLET_XML_NS);
|
||||
error.setText("There was an error fetching this content feed");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,13 +12,15 @@
|
|||
DispatcherHelper.cacheDisable(response);
|
||||
</jsp:scriptlet>
|
||||
|
||||
<define:page name="adminPage" application="portal" title="Workspace Admin" cache="true">
|
||||
<define:page name="adminPage" application="portal"
|
||||
title="Workspace Admin" cache="true">
|
||||
|
||||
<jsp:scriptlet>
|
||||
adminPage.addRequestListener(new ApplicationAuthenticationListener());
|
||||
</jsp:scriptlet>
|
||||
|
||||
<define:component name="admin" classname="com.arsdigita.portalworkspace.ui.admin.PeoplePane" />
|
||||
<define:component name="admin"
|
||||
classname="com.arsdigita.portalworkspace.ui.admin.PeoplePane" />
|
||||
|
||||
<jsp:scriptlet>
|
||||
StringParameter action = new StringParameter("action");
|
||||
|
|
@ -29,4 +31,3 @@
|
|||
</define:page>
|
||||
|
||||
<show:all/>
|
||||
</jsp:root>
|
||||
|
|
|
|||
|
|
@ -11,11 +11,13 @@
|
|||
DispatcherHelper.cacheDisable(response);
|
||||
</jsp:scriptlet>
|
||||
|
||||
<define:page name="adminPage" application="portal" title="Workspace Admin" cache="true">
|
||||
<define:page name="adminPage" application="portal"
|
||||
title="Workspace Admin" cache="true">
|
||||
<jsp:scriptlet>
|
||||
adminPage.addRequestListener(new ApplicationAuthenticationListener());
|
||||
</jsp:scriptlet>
|
||||
<define:component name="admin" classname="com.arsdigita.portalworkspace.ui.admin.AdminPane" />
|
||||
<define:component name="admin"
|
||||
classname="com.arsdigita.portalworkspace.ui.admin.AdminPane" />
|
||||
</define:page>
|
||||
|
||||
<show:all/>
|
||||
|
|
|
|||
|
|
@ -11,11 +11,13 @@
|
|||
DispatcherHelper.cacheDisable(response);
|
||||
</jsp:scriptlet>
|
||||
|
||||
<define:page name="sitemapPage" application="portal" title="Workspace Admin Sitemap" cache="true">
|
||||
<define:page name="sitemapPage" application="portal"
|
||||
title="Workspace Admin Sitemap" cache="true">
|
||||
<jsp:scriptlet>
|
||||
sitemapPage.addRequestListener(new ApplicationAuthenticationListener());
|
||||
</jsp:scriptlet>
|
||||
<define:component name="admin" classname="com.arsdigita.portalworkspace.ui.admin.SiteMapPane" />
|
||||
<define:component name="admin"
|
||||
classname="com.arsdigita.portalworkspace.ui.admin.SiteMapPane" />
|
||||
</define:page>
|
||||
|
||||
<show:all/>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<jsp:directive.page import="com.arsdigita.dispatcher.DispatcherHelper"/>
|
||||
<jsp:directive.page import="com.arsdigita.portalworkspace.ui.AbstractWorkspaceComponent"/>
|
||||
<jsp:directive.page import="com.arsdigita.portalworkspace.ui.DefaultWorkspaceSelectionModel"/>
|
||||
<jsp:directive.page import="com.arsdigita.portalworkspace.ui.jsp.DefaultWorkspaceSelectionModel"/>
|
||||
|
||||
<jsp:scriptlet>
|
||||
DispatcherHelper.cacheDisable(response);
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
<define:page name="editWorkspace" application="portal"
|
||||
title="Workspace Customize" cache="true">
|
||||
<define:component name="edit"
|
||||
classname="com.arsdigita.portalworkspace.ui.WorkspaceEditor" />
|
||||
classname="com.arsdigita.portalworkspace.ui.jsp.WorkspaceEditor" />
|
||||
<jsp:scriptlet>
|
||||
((AbstractWorkspaceComponent)edit).setWorkspaceModel(
|
||||
new DefaultWorkspaceSelectionModel());
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<jsp:directive.page import="com.arsdigita.kernel.permissions.PrivilegeDescriptor"/>
|
||||
<jsp:directive.page import="com.arsdigita.portalworkspace.Workspace"/>
|
||||
<jsp:directive.page import="com.arsdigita.portalworkspace.ui.AbstractWorkspaceComponent"/>
|
||||
<jsp:directive.page import="com.arsdigita.portalworkspace.ui.DefaultWorkspaceSelectionModel"/>
|
||||
<jsp:directive.page import="com.arsdigita.portalworkspace.ui.jsp.DefaultWorkspaceSelectionModel"/>
|
||||
<jsp:directive.page import="com.arsdigita.toolbox.ui.ApplicationAuthenticationListener"/>
|
||||
|
||||
<jsp:scriptlet>
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
</jsp:scriptlet>
|
||||
|
||||
<define:component name="view"
|
||||
classname="com.arsdigita.portalworkspace.ui.WorkspaceViewer" />
|
||||
classname="com.arsdigita.portalworkspace.ui.jsp.WorkspaceViewer" />
|
||||
<jsp:scriptlet>
|
||||
((AbstractWorkspaceComponent) view).setWorkspaceModel(
|
||||
new DefaultWorkspaceSelectionModel());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
|
||||
xmlns:define="/WEB-INF/bebop-define.tld"
|
||||
xmlns:show="/WEB-INF/bebop-show.tld"
|
||||
version="1.2">
|
||||
|
||||
<!-- JSP template to use a portal page as index page in navigation -->
|
||||
|
||||
<jsp:directive.page import="com.arsdigita.dispatcher.DispatcherHelper"/>
|
||||
<jsp:directive.page import="com.arsdigita.navigation.Navigation"/>
|
||||
<jsp:directive.page import="com.arsdigita.bebop.parameters.BigDecimalParameter"/>
|
||||
<jsp:directive.page import="com.arsdigita.portalworkspace.ui.CategoryPortalSelectionModel"/>
|
||||
|
||||
<jsp:scriptlet>
|
||||
long age = Navigation.getConfig().getIndexPageCacheLifetime();
|
||||
if (age == 0) {
|
||||
DispatcherHelper.cacheDisable(response);
|
||||
} else {
|
||||
DispatcherHelper.cacheForWorld(response, (int)age);
|
||||
}
|
||||
</jsp:scriptlet>
|
||||
|
||||
<define:page name="portalsPage" application="navigation"
|
||||
title="Navigation" ache="true">
|
||||
|
||||
<define:component name="categoryPath"
|
||||
classname="com.arsdigita.navigation.ui.category.Path"/>
|
||||
<define:component name="categoryMenu"
|
||||
classname="com.arsdigita.navigation.ui.category.Menu"/>
|
||||
<define:component name="portalWorkspace"
|
||||
classname="com.arsdigita.portalworkspace.ui.jsp.WorkspaceViewer"/>
|
||||
<jsp:scriptlet>
|
||||
((com.arsdigita.portalworkspace.ui.WorkspaceViewer) portalWorkspace).setWorkspaceModel(new CategoryPortalSelectionModel());
|
||||
</jsp:scriptlet>
|
||||
</define:page>
|
||||
|
||||
<show:all/>
|
||||
</jsp:root>
|
||||
Loading…
Reference in New Issue