Homepage Code aus aplaws/bundle in ein eigenes Package verschoben, um es leichter loswerden zu können.
Änderungen in ccm-bundle sowie ccm-sci-bundle jeweils devel & demo nachgeführt. git-svn-id: https://svn.libreccm.org/ccm/trunk@1402 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
34fe862e3d
commit
eae02b9f3d
|
|
@ -1,6 +1,6 @@
|
||||||
# Libre CMS demo bundle integration.properties
|
# Libre CMS demo bundle integration.properties
|
||||||
#
|
#
|
||||||
waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage
|
waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage
|
||||||
#
|
#
|
||||||
; dhtml editor to use (system wide)
|
; dhtml editor to use (system wide)
|
||||||
; Xinha is default
|
; Xinha is default
|
||||||
|
|
@ -39,7 +39,7 @@ waf.xml.activate_full_date_formatter=true
|
||||||
|
|
||||||
# ccm-cms parameters
|
# ccm-cms parameters
|
||||||
|
|
||||||
com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker
|
com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker
|
||||||
|
|
||||||
com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp
|
com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp
|
||||||
com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
|
com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
|
||||||
|
|
@ -105,7 +105,7 @@ com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/g
|
||||||
com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt
|
com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt
|
||||||
|
|
||||||
|
|
||||||
# ccm-ldn-search application
|
# ccm-search application
|
||||||
com.arsdigita.london.search.show_sponsored_links=true
|
com.arsdigita.london.search.show_sponsored_links=true
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
|
||||||
<!-- project.xml LibreCMS devel - containing only modules used for LibreCMS -->
|
<!-- project.xml LibreCMS demo - containing only modules used for
|
||||||
|
LibreCMS DEMO edition -->
|
||||||
|
|
||||||
<ccm:project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<ccm:project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||||
|
|
@ -21,7 +22,7 @@
|
||||||
<ccm:build>
|
<ccm:build>
|
||||||
|
|
||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||||
<!-- Scientific CMS set of CORE packages -->
|
<!-- LibreCMS set of CORE packages -->
|
||||||
<!-- NONE can be omitted for technical reasons / internal dependencies -->
|
<!-- NONE can be omitted for technical reasons / internal dependencies -->
|
||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||||
|
|
||||||
|
|
@ -43,12 +44,14 @@
|
||||||
<ccm:application name="ccm-navigation"/>
|
<ccm:application name="ccm-navigation"/>
|
||||||
<!-- ccm-portalworkspace depends on ccm-subsite -->
|
<!-- ccm-portalworkspace depends on ccm-subsite -->
|
||||||
<ccm:application name="ccm-portalworkspace"/>
|
<ccm:application name="ccm-portalworkspace"/>
|
||||||
|
<ccm:application name="ccm-portalworkspace-homepage"/>
|
||||||
|
<ccm:application name="ccm-shortcuts"/>
|
||||||
<ccm:application name="ccm-subsite"/>
|
<ccm:application name="ccm-subsite"/>
|
||||||
|
|
||||||
<ccm:application name="ccm-themedirector"/>
|
<ccm:application name="ccm-themedirector"/>
|
||||||
|
|
||||||
<!-- LDN extension -->
|
<!-- LDN extension -->
|
||||||
<ccm:application name="ccm-ldn-search"/>
|
<ccm:application name="ccm-ldn-search"/>
|
||||||
<ccm:application name="ccm-ldn-shortcuts"/>
|
|
||||||
<ccm:application name="ccm-ldn-terms"/>
|
<ccm:application name="ccm-ldn-terms"/>
|
||||||
<ccm:application name="ccm-ldn-util"/>
|
<ccm:application name="ccm-ldn-util"/>
|
||||||
|
|
||||||
|
|
@ -85,22 +88,13 @@
|
||||||
<ccm:application name="ccm-ldn-rss"/>
|
<ccm:application name="ccm-ldn-rss"/>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- SCI extension -->
|
|
||||||
<!--
|
|
||||||
<ccm:application name="ccm-sci-personalprojects"/>
|
|
||||||
-->
|
|
||||||
<ccm:application name="ccm-sci-personalpublications"/>
|
|
||||||
<ccm:application name="ccm-sci-publications"/>
|
|
||||||
|
|
||||||
<ccm:application name="ccm-sci-types-member"/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||||
<!-- Scientific CMS potential ADD-ONS packages -->
|
<!-- Scientific CMS potential ADD-ONS packages -->
|
||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||||
|
|
||||||
<!-- Content Types -->
|
<!-- CMS Content Types -->
|
||||||
<!--
|
<!--
|
||||||
<ccm:application name="ccm-cms-types-agenda"/>
|
<ccm:application name="ccm-cms-types-agenda"/>
|
||||||
<ccm:application name="ccm-cms-types-faqitem"/>
|
<ccm:application name="ccm-cms-types-faqitem"/>
|
||||||
|
|
@ -117,7 +111,7 @@
|
||||||
<ccm:application name="ccm-cms-types-xmlfeed"/>
|
<ccm:application name="ccm-cms-types-xmlfeed"/>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Applications -->
|
<!-- Applications -->
|
||||||
<!--
|
<!--
|
||||||
<ccm:application name="ccm-auth-http"/>
|
<ccm:application name="ccm-auth-http"/>
|
||||||
<ccm:application name="ccm-bookmarks"/>
|
<ccm:application name="ccm-bookmarks"/>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Libre CMS based on OpenCCM devel bundle integration.properties
|
# Libre CMS based on OpenCCM devel bundle integration.properties
|
||||||
#
|
#
|
||||||
waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage
|
waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage
|
||||||
#
|
#
|
||||||
; dhtml editor to use (system wide)
|
; dhtml editor to use (system wide)
|
||||||
; Xinha is default
|
; Xinha is default
|
||||||
|
|
@ -39,7 +39,7 @@ waf.xml.activate_full_date_formatter=true
|
||||||
|
|
||||||
# ccm-cms parameters
|
# ccm-cms parameters
|
||||||
|
|
||||||
com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker
|
com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker
|
||||||
|
|
||||||
com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp
|
com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp
|
||||||
com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
|
com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
|
||||||
|
|
@ -105,7 +105,7 @@ com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/g
|
||||||
com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt
|
com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt
|
||||||
|
|
||||||
|
|
||||||
# ccm-ldn-search application
|
# ccm-search application
|
||||||
com.arsdigita.london.search.show_sponsored_links=true
|
com.arsdigita.london.search.show_sponsored_links=true
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,14 @@
|
||||||
<ccm:application name="ccm-navigation"/>
|
<ccm:application name="ccm-navigation"/>
|
||||||
<!-- ccm-portalworkspace depends on ccm-subsite -->
|
<!-- ccm-portalworkspace depends on ccm-subsite -->
|
||||||
<ccm:application name="ccm-portalworkspace"/>
|
<ccm:application name="ccm-portalworkspace"/>
|
||||||
|
<ccm:application name="ccm-portalworkspace-homepage"/>
|
||||||
|
<ccm:application name="ccm-shortcuts"/>
|
||||||
<ccm:application name="ccm-subsite"/>
|
<ccm:application name="ccm-subsite"/>
|
||||||
|
|
||||||
<ccm:application name="ccm-themedirector"/>
|
<ccm:application name="ccm-themedirector"/>
|
||||||
|
|
||||||
<!-- LDN extension -->
|
<!-- LDN extension -->
|
||||||
<ccm:application name="ccm-ldn-search"/>
|
<ccm:application name="ccm-ldn-search"/>
|
||||||
<ccm:application name="ccm-ldn-shortcuts"/>
|
|
||||||
<ccm:application name="ccm-ldn-terms"/>
|
<ccm:application name="ccm-ldn-terms"/>
|
||||||
<ccm:application name="ccm-ldn-util"/>
|
<ccm:application name="ccm-ldn-util"/>
|
||||||
|
|
||||||
|
|
@ -109,20 +111,21 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Applications -->
|
<!-- Applications -->
|
||||||
<!-- - - - - - - -->
|
|
||||||
<!--
|
<!--
|
||||||
<ccm:application name="ccm-auth-http"/>
|
<ccm:application name="ccm-auth-http"/>
|
||||||
<ccm:application name="ccm-bookmarks"/>
|
<ccm:application name="ccm-bookmarks"/>
|
||||||
<ccm:application name="ccm-docmgr"/>
|
<ccm:application name="ccm-docmgr"/>
|
||||||
<ccm:application name="ccm-portalserver"/>
|
<ccm:application name="ccm-docrepo"/>
|
||||||
-->
|
-->
|
||||||
|
<ccm:application name="ccm-forum"/>
|
||||||
|
<ccm:application name="ccm-forum-categorised"/>
|
||||||
<!--
|
<!--
|
||||||
|
<ccm:application name="ccm-portalserver"/>
|
||||||
<ccm:application name="ccm-weblog"/>
|
<ccm:application name="ccm-weblog"/>
|
||||||
<ccm:application name="ccm-webpage"/>
|
<ccm:application name="ccm-webpage"/>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- LDN extension -->
|
<!-- LDN extension -->
|
||||||
<!-- - - - - - - - -->
|
|
||||||
<!--
|
<!--
|
||||||
<ccm:application name="ccm-ldn-exporter"/>
|
<ccm:application name="ccm-ldn-exporter"/>
|
||||||
<ccm:application name="ccm-ldn-freeform"/>
|
<ccm:application name="ccm-ldn-freeform"/>
|
||||||
|
|
|
||||||
|
|
@ -1,88 +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.aplaws.ui;
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.AbstractSingleSelectionModel;
|
|
||||||
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
|
||||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
|
||||||
import com.arsdigita.domain.DomainObject;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
public class HomepagePortalSelectionModel extends AbstractSingleSelectionModel
|
|
||||||
implements PortalSelectionModel {
|
|
||||||
|
|
||||||
/** Private logger instance for debugging */
|
|
||||||
private static Logger s_log = Logger.getLogger(
|
|
||||||
HomepagePortalSelectionModel.class);
|
|
||||||
|
|
||||||
private HomepageWorkspaceSelectionModel m_workspace;
|
|
||||||
private int m_column;
|
|
||||||
|
|
||||||
public HomepagePortalSelectionModel(HomepageWorkspaceSelectionModel workspace,
|
|
||||||
int column) {
|
|
||||||
m_workspace = workspace;
|
|
||||||
m_column = column;
|
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("Constructor HomepageWorkspaceSelectionModel " + " [" +
|
|
||||||
"Workspace: " + m_workspace + "," +
|
|
||||||
"Columns: " + column + "]");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCustomize(PageState state) {
|
|
||||||
m_workspace.onCustomize(state, m_column);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onReset(PageState state) {
|
|
||||||
m_workspace.onReset(state, m_column);
|
|
||||||
}
|
|
||||||
|
|
||||||
public HomepageWorkspaceSelectionModel getWorkspaceModel() {
|
|
||||||
return m_workspace;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getSelectedKey(PageState state) {
|
|
||||||
return getSelectedPortal(state).getID();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelectedKey(PageState state,
|
|
||||||
Object key) {
|
|
||||||
throw new UnsupportedOperationException("cannot set key");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelectedObject(PageState state,
|
|
||||||
DomainObject key) {
|
|
||||||
throw new UnsupportedOperationException("cannot set object");
|
|
||||||
}
|
|
||||||
|
|
||||||
public ParameterModel getStateParameter() {
|
|
||||||
throw new UnsupportedOperationException("not state param");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public DomainObject getSelectedObject(PageState state) {
|
|
||||||
return getSelectedPortal(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public WorkspacePage getSelectedPortal(PageState state) {
|
|
||||||
return m_workspace.getPortal(state, m_column);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,174 +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.aplaws.ui;
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
|
||||||
import com.arsdigita.bebop.ActionLink;
|
|
||||||
import com.arsdigita.bebop.Page;
|
|
||||||
import com.arsdigita.bebop.event.ActionEvent;
|
|
||||||
import com.arsdigita.bebop.event.ActionListener;
|
|
||||||
import com.arsdigita.portalworkspace.ui.PersistentPortal;
|
|
||||||
import com.arsdigita.portalworkspace.Workspace;
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
import com.arsdigita.xml.Element;
|
|
||||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
|
||||||
import com.arsdigita.kernel.permissions.PermissionService;
|
|
||||||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
|
||||||
import com.arsdigita.kernel.Party;
|
|
||||||
import com.arsdigita.kernel.Kernel;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class HomepageWorkspace extends SimpleContainer {
|
|
||||||
|
|
||||||
/** Private logger instance for debugging */
|
|
||||||
private static Logger s_log = Logger.getLogger(
|
|
||||||
HomepageWorkspace.class);
|
|
||||||
|
|
||||||
private HomepagePortalSelectionModel m_model;
|
|
||||||
private ActionLink m_reset;
|
|
||||||
private ActionLink m_browse;
|
|
||||||
private ActionLink m_edit;
|
|
||||||
private PersistentPortal m_browser;
|
|
||||||
private PersistentPortal m_editor;
|
|
||||||
private boolean m_customizable;
|
|
||||||
private boolean m_readOnly;
|
|
||||||
private String m_name;
|
|
||||||
|
|
||||||
public HomepageWorkspace() {
|
|
||||||
super("portal:homepageWorkspace", PortalConstants.PORTAL_XML_NS);
|
|
||||||
m_customizable = false;
|
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("Constructor HomepageWorkspace finished. " );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModel(HomepagePortalSelectionModel model) {
|
|
||||||
m_model = model;
|
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("setModel: " + m_model );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCustomizable(boolean customizable) {
|
|
||||||
m_customizable = customizable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReadOnly(boolean readOnly) {
|
|
||||||
m_readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
m_name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addWidgets() {
|
|
||||||
m_edit = new ActionLink("customize");
|
|
||||||
m_browse = new ActionLink("browse");
|
|
||||||
m_reset = new ActionLink("reset");
|
|
||||||
m_reset.setConfirmation("Are you sure you wish to reset this column? " +
|
|
||||||
"This will permanently remove all portlets.");
|
|
||||||
|
|
||||||
m_browser = new PersistentPortal(m_model,
|
|
||||||
m_name,
|
|
||||||
PortalConstants.MODE_DISPLAY);
|
|
||||||
m_editor = new PersistentPortal(m_model,
|
|
||||||
m_name,
|
|
||||||
PortalConstants.MODE_EDITOR);
|
|
||||||
|
|
||||||
m_edit.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
PageState state = e.getPageState();
|
|
||||||
setDisplayMode(state, false);
|
|
||||||
|
|
||||||
m_model.onCustomize(state);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
m_browse.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
PageState state = e.getPageState();
|
|
||||||
setDisplayMode(state, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
m_reset.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
PageState state = e.getPageState();
|
|
||||||
setDisplayMode(state, true);
|
|
||||||
|
|
||||||
m_model.onReset(state);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
add(m_edit);
|
|
||||||
add(m_browse);
|
|
||||||
add(m_reset);
|
|
||||||
add(m_editor);
|
|
||||||
add(m_browser);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDisplayMode(PageState state,
|
|
||||||
boolean browse) {
|
|
||||||
if (m_readOnly) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_browse.setVisible(state, !browse);
|
|
||||||
m_reset.setVisible(state, !browse);
|
|
||||||
m_edit.setVisible(state, browse);
|
|
||||||
m_browser.setVisible(state, browse);
|
|
||||||
m_editor.setVisible(state, !browse);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void register(Page page) {
|
|
||||||
super.register(page);
|
|
||||||
|
|
||||||
page.setVisibleDefault(m_browse, false);
|
|
||||||
page.setVisibleDefault(m_reset, false);
|
|
||||||
page.setVisibleDefault(m_edit, !m_readOnly);
|
|
||||||
page.setVisibleDefault(m_browser, true);
|
|
||||||
page.setVisibleDefault(m_editor, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void generateXML(PageState state,
|
|
||||||
Element parent) {
|
|
||||||
Party party = Kernel.getContext().getParty();
|
|
||||||
Workspace global = m_model.getWorkspaceModel().getGlobalWorkspace(state);
|
|
||||||
PermissionDescriptor admin =
|
|
||||||
new PermissionDescriptor(PrivilegeDescriptor.ADMIN,
|
|
||||||
global,
|
|
||||||
party);
|
|
||||||
boolean hasAdmin = PermissionService.checkPermission(admin);
|
|
||||||
boolean userWorkspaces = Workspace.getConfig().getCreateUserWorkspaces();
|
|
||||||
|
|
||||||
if (party == null || m_readOnly ||
|
|
||||||
(!hasAdmin && !m_customizable) || (!hasAdmin && !userWorkspaces)) {
|
|
||||||
m_reset.setVisible(state, false);
|
|
||||||
m_browse.setVisible(state, false);
|
|
||||||
m_edit.setVisible(state, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.generateXML(state, parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,287 +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.aplaws.ui;
|
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.RequestLocal;
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.kernel.Party;
|
|
||||||
import com.arsdigita.kernel.User;
|
|
||||||
import com.arsdigita.kernel.Kernel;
|
|
||||||
import com.arsdigita.kernel.permissions.PermissionService;
|
|
||||||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
|
||||||
|
|
||||||
import com.arsdigita.portalworkspace.Workspace;
|
|
||||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
|
||||||
import com.arsdigita.portalworkspace.WorkspacePageCollection;
|
|
||||||
|
|
||||||
import com.arsdigita.subsite.Subsite;
|
|
||||||
|
|
||||||
import com.arsdigita.util.Assert;
|
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
|
||||||
|
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
|
|
||||||
public class HomepageWorkspaceSelectionModel {
|
|
||||||
private RequestLocal m_loaded = new RequestLocal();
|
|
||||||
private RequestLocal m_global = new RequestLocal();
|
|
||||||
private RequestLocal m_personal = new RequestLocal();
|
|
||||||
private RequestLocal m_left = new RequestLocal();
|
|
||||||
private RequestLocal m_middle = new RequestLocal();
|
|
||||||
private RequestLocal m_right = new RequestLocal();
|
|
||||||
private RequestLocal m_custom = new RequestLocal();
|
|
||||||
|
|
||||||
private static Logger s_log = Logger.getLogger
|
|
||||||
(HomepageWorkspaceSelectionModel.class.getName());
|
|
||||||
|
|
||||||
public WorkspacePage getPortal(PageState state,
|
|
||||||
int column) {
|
|
||||||
if (!Boolean.TRUE.equals(m_loaded.get(state))) {
|
|
||||||
loadWorkspacePages(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (column == 0) { // Always global portal
|
|
||||||
return (WorkspacePage)m_left.get(state);
|
|
||||||
} else if (column == 1) { // Always global portal
|
|
||||||
return (WorkspacePage)m_middle.get(state);
|
|
||||||
} else if (column == 2) { // Personal portal, fallback on global
|
|
||||||
Party party = (Party)Kernel.getContext().getParty();
|
|
||||||
WorkspacePage right = (WorkspacePage)m_right.get(state);
|
|
||||||
PermissionDescriptor admin =
|
|
||||||
new PermissionDescriptor(PrivilegeDescriptor.ADMIN,
|
|
||||||
right,
|
|
||||||
party);
|
|
||||||
// Always ensure admin gets global portal
|
|
||||||
// don't use custom portals if asked not to
|
|
||||||
if (m_custom.get(state) == null ||
|
|
||||||
PermissionService.checkPermission(admin) ||
|
|
||||||
!Workspace.getConfig().getCreateUserWorkspaces()) {
|
|
||||||
s_log.debug("Returning global portal");
|
|
||||||
return (WorkspacePage)m_right.get(state);
|
|
||||||
} else {
|
|
||||||
s_log.debug("Returning personal portal");
|
|
||||||
return (WorkspacePage)m_custom.get(state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new UncheckedWrapperException("column out of range (0..2)");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCustomize(PageState state,
|
|
||||||
int column) {
|
|
||||||
if (!Boolean.TRUE.equals(m_loaded.get(state))) {
|
|
||||||
loadWorkspacePages(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
Party party = (Party)Kernel.getContext().getParty();
|
|
||||||
|
|
||||||
Assert.exists(party, Party.class);
|
|
||||||
|
|
||||||
// When customizing right column, may need to clone
|
|
||||||
// for a personal portal
|
|
||||||
// don't use custom portals if asked not to
|
|
||||||
if (column == 2 &&
|
|
||||||
Workspace.getConfig().getCreateUserWorkspaces()) {
|
|
||||||
Workspace global = getTopWorkspace();
|
|
||||||
|
|
||||||
WorkspacePage right = (WorkspacePage)m_right.get(state);
|
|
||||||
PermissionDescriptor admin =
|
|
||||||
new PermissionDescriptor(PrivilegeDescriptor.ADMIN,
|
|
||||||
right,
|
|
||||||
party);
|
|
||||||
if (PermissionService.checkPermission(admin)) {
|
|
||||||
s_log.debug("Party has admin on global portal");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_custom.get(state) != null) {
|
|
||||||
s_log.debug("Party has custom portal already");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
s_log.debug("Looking for custom column 2");
|
|
||||||
|
|
||||||
Workspace custom = null;
|
|
||||||
try {
|
|
||||||
custom = global.retrieveSubworkspaceForParty(party);
|
|
||||||
s_log.debug("Found exsting personal workspce");
|
|
||||||
} catch (DataObjectNotFoundException ex) {
|
|
||||||
s_log.debug("Created new personal workspace");
|
|
||||||
custom = Workspace.createWorkspace(
|
|
||||||
"personal-" + party.getID(),
|
|
||||||
"Personal Workspace for " + party.getDisplayName(),
|
|
||||||
global,
|
|
||||||
(User)party
|
|
||||||
);
|
|
||||||
}
|
|
||||||
s_log.debug("Looking for portal");
|
|
||||||
m_personal.set(state, custom);
|
|
||||||
WorkspacePageCollection portals = custom.getPages();
|
|
||||||
portals.addOrder(WorkspacePage.SORT_KEY);
|
|
||||||
WorkspacePage portal;
|
|
||||||
if (portals.next()) {
|
|
||||||
s_log.debug("Found portal");
|
|
||||||
portal = portals.getPage();
|
|
||||||
portals.close();
|
|
||||||
} else {
|
|
||||||
s_log.debug("Create portal");
|
|
||||||
portal = custom.addPage("Custom", "Custom page");
|
|
||||||
}
|
|
||||||
m_custom.set(state, portal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void onReset(PageState state,
|
|
||||||
int column) {
|
|
||||||
if (!Boolean.TRUE.equals(m_loaded.get(state))) {
|
|
||||||
loadWorkspacePages(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
Party party = Kernel.getContext().getParty();
|
|
||||||
|
|
||||||
Assert.exists(party, Party.class);
|
|
||||||
|
|
||||||
WorkspacePage clear = null;
|
|
||||||
|
|
||||||
// don't use custom portals if asked not to
|
|
||||||
if (column == 2 &&
|
|
||||||
Workspace.getConfig().getCreateUserWorkspaces()) {
|
|
||||||
// If we find a custom workspace, then delete it,
|
|
||||||
// otherwise just clear the portlets.
|
|
||||||
Workspace global = getTopWorkspace();
|
|
||||||
Workspace custom = null;
|
|
||||||
try {
|
|
||||||
custom = global.retrieveSubworkspaceForParty(party);
|
|
||||||
Assert.isTrue(custom.getParty() != null &&
|
|
||||||
custom.getParty().equals(party),
|
|
||||||
"party is not null and not admin");
|
|
||||||
s_log.debug("Found exsting personal workspce");
|
|
||||||
custom.delete();
|
|
||||||
m_custom.set(state, null);
|
|
||||||
} catch (DataObjectNotFoundException ex) {
|
|
||||||
clear = (WorkspacePage)m_right.get(state);
|
|
||||||
}
|
|
||||||
} else if (column == 1) {
|
|
||||||
clear = (WorkspacePage)m_middle.get(state);
|
|
||||||
} else if (column == 0) {
|
|
||||||
clear = (WorkspacePage)m_left.get(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clear != null) {
|
|
||||||
clear.clearPortlets();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Workspace getGlobalWorkspace(PageState state) {
|
|
||||||
if (!Boolean.TRUE.equals(m_loaded.get(state))) {
|
|
||||||
loadWorkspacePages(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (Workspace)m_global.get(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Workspace getPersonalWorkspace(PageState state) {
|
|
||||||
if (!Boolean.TRUE.equals(m_loaded.get(state))) {
|
|
||||||
loadWorkspacePages(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (Workspace)m_personal.get(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadWorkspacePages(PageState state) {
|
|
||||||
Workspace global = getTopWorkspace();
|
|
||||||
m_global.set(state, global);
|
|
||||||
|
|
||||||
WorkspacePage left = null;
|
|
||||||
WorkspacePage middle = null;
|
|
||||||
WorkspacePage right = null;
|
|
||||||
|
|
||||||
WorkspacePageCollection portals = global.getPages();
|
|
||||||
portals.addOrder(WorkspacePage.SORT_KEY);
|
|
||||||
while (portals.next()) {
|
|
||||||
WorkspacePage portal = portals.getPage();
|
|
||||||
|
|
||||||
if (portal.getSortKey() == 0) {
|
|
||||||
left = portal;
|
|
||||||
} else if (portal.getSortKey() == 1) {
|
|
||||||
middle = portal;
|
|
||||||
} else if (portal.getSortKey() == 2) {
|
|
||||||
right = portal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (left == null) {
|
|
||||||
left = global.addPage("Left", "Left hand page");
|
|
||||||
}
|
|
||||||
if (middle == null) {
|
|
||||||
middle = global.addPage("Middle", "Middle page");
|
|
||||||
}
|
|
||||||
if (right == null) {
|
|
||||||
right = global.addPage("Right", "Right hand page");
|
|
||||||
}
|
|
||||||
m_left.set(state, left);
|
|
||||||
m_middle.set(state, middle);
|
|
||||||
m_right.set(state, right);
|
|
||||||
|
|
||||||
|
|
||||||
Party party = (Party)Kernel.getContext().getParty();
|
|
||||||
m_custom.set(state, null);
|
|
||||||
if (party != null) {
|
|
||||||
Workspace custom = null;
|
|
||||||
try {
|
|
||||||
custom = global.retrieveSubworkspaceForParty(party);
|
|
||||||
} catch (DataObjectNotFoundException ex) {
|
|
||||||
// nada
|
|
||||||
}
|
|
||||||
if (custom != null) {
|
|
||||||
portals = custom.getPages();
|
|
||||||
portals.addOrder(WorkspacePage.SORT_KEY);
|
|
||||||
if (portals.next()) {
|
|
||||||
WorkspacePage portal = portals.getPage();
|
|
||||||
m_custom.set(state, portal);
|
|
||||||
}
|
|
||||||
portals.close();
|
|
||||||
}
|
|
||||||
s_log.debug("Is there a custom portal ?" + custom +
|
|
||||||
" - " + m_custom.get(state));
|
|
||||||
m_personal.set(state, custom);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_loaded.set(state, Boolean.TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Workspace getTopWorkspace() {
|
|
||||||
if (Subsite.getContext().hasSite()) {
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("Return a subsite front page");
|
|
||||||
}
|
|
||||||
return (Workspace)Subsite.getContext().getSite().getFrontPage();
|
|
||||||
} else {
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("Return the main front page");
|
|
||||||
}
|
|
||||||
return (Workspace)Kernel.getContext().getResource();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
<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:directive.page
|
|
||||||
import="com.arsdigita.dispatcher.DispatcherHelper,
|
|
||||||
com.arsdigita.aplaws.ui.*"/>
|
|
||||||
|
|
||||||
<jsp:scriptlet>
|
|
||||||
DispatcherHelper.cacheDisable(response);
|
|
||||||
</jsp:scriptlet>
|
|
||||||
|
|
||||||
<define:page name="itemPage" application="portal" title="APLAWS" cache="true">
|
|
||||||
|
|
||||||
<define:component name="left" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
<define:component name="middle" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
<define:component name="right" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
|
|
||||||
<jsp:scriptlet>
|
|
||||||
HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel();
|
|
||||||
((HomepageWorkspace)left).setModel(new HomepagePortalSelectionModel(workspace, 0));
|
|
||||||
((HomepageWorkspace)left).setName("left");
|
|
||||||
((HomepageWorkspace)left).addWidgets();
|
|
||||||
((HomepageWorkspace)middle).setModel(new HomepagePortalSelectionModel(workspace, 1));
|
|
||||||
((HomepageWorkspace)middle).setName("middle");
|
|
||||||
((HomepageWorkspace)middle).addWidgets();
|
|
||||||
((HomepageWorkspace)right).setModel(new HomepagePortalSelectionModel(workspace, 2));
|
|
||||||
((HomepageWorkspace)right).setCustomizable(true);
|
|
||||||
((HomepageWorkspace)right).setName("right");
|
|
||||||
((HomepageWorkspace)right).addWidgets();
|
|
||||||
</jsp:scriptlet>
|
|
||||||
</define:page>
|
|
||||||
|
|
||||||
<show:all/>
|
|
||||||
|
|
||||||
</jsp:root>
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
<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:directive.page
|
|
||||||
import="com.arsdigita.dispatcher.DispatcherHelper,
|
|
||||||
com.arsdigita.aplaws.ui.*"/>
|
|
||||||
|
|
||||||
<jsp:scriptlet>
|
|
||||||
DispatcherHelper.cacheForWorld(response,900);
|
|
||||||
</jsp:scriptlet>
|
|
||||||
|
|
||||||
<define:page name="itemPage" application="portal" title="APLAWS" cache="true">
|
|
||||||
|
|
||||||
<define:component name="left" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
<define:component name="middle" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
<define:component name="right" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
|
|
||||||
<jsp:scriptlet>
|
|
||||||
HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel();
|
|
||||||
((HomepageWorkspace)left).setModel(new HomepagePortalSelectionModel(workspace, 0));
|
|
||||||
((HomepageWorkspace)left).setReadOnly(true);
|
|
||||||
((HomepageWorkspace)left).setName("left");
|
|
||||||
((HomepageWorkspace)left).addWidgets();
|
|
||||||
((HomepageWorkspace)middle).setModel(new HomepagePortalSelectionModel(workspace, 1));
|
|
||||||
((HomepageWorkspace)middle).setReadOnly(true);
|
|
||||||
((HomepageWorkspace)middle).setName("middle");
|
|
||||||
((HomepageWorkspace)middle).addWidgets();
|
|
||||||
((HomepageWorkspace)right).setModel(new HomepagePortalSelectionModel(workspace, 2));
|
|
||||||
((HomepageWorkspace)right).setReadOnly(true);
|
|
||||||
((HomepageWorkspace)right).setName("right");
|
|
||||||
((HomepageWorkspace)right).addWidgets();
|
|
||||||
</jsp:scriptlet>
|
|
||||||
</define:page>
|
|
||||||
|
|
||||||
<show:all/>
|
|
||||||
|
|
||||||
</jsp:root>
|
|
||||||
|
|
@ -15,6 +15,8 @@
|
||||||
|
|
||||||
package com.arsdigita.aplaws.ui;
|
package com.arsdigita.aplaws.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.portalworkspace.ui.HomepagePortalSelectionModel;
|
||||||
|
import com.arsdigita.portalworkspace.ui.HomepageWorkspaceSelectionModel;
|
||||||
import com.arsdigita.bebop.AbstractSingleSelectionModel;
|
import com.arsdigita.bebop.AbstractSingleSelectionModel;
|
||||||
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
||||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@
|
||||||
|
|
||||||
package com.arsdigita.aplaws.ui;
|
package com.arsdigita.aplaws.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.portalworkspace.ui.HomepagePortalSelectionModel;
|
||||||
|
import com.arsdigita.portalworkspace.ui.HomepageWorkspace;
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
import com.arsdigita.bebop.SimpleContainer;
|
||||||
import com.arsdigita.bebop.ActionLink;
|
import com.arsdigita.bebop.ActionLink;
|
||||||
import com.arsdigita.bebop.Page;
|
import com.arsdigita.bebop.Page;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
package com.arsdigita.aplaws.ui;
|
package com.arsdigita.aplaws.ui;
|
||||||
|
|
||||||
|
|
||||||
|
import com.arsdigita.portalworkspace.ui.HomepageWorkspaceSelectionModel;
|
||||||
import com.arsdigita.bebop.RequestLocal;
|
import com.arsdigita.bebop.RequestLocal;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@
|
||||||
<ccm:application name="ccm-ldn-aplaws"/>
|
<ccm:application name="ccm-ldn-aplaws"/>
|
||||||
<ccm:application name="ccm-ldn-atoz"/>
|
<ccm:application name="ccm-ldn-atoz"/>
|
||||||
<ccm:application name="ccm-ldn-dublin"/>
|
<ccm:application name="ccm-ldn-dublin"/>
|
||||||
<ccm:application name="ccm-ldn-shortcuts"/>
|
|
||||||
<ccm:application name="ccm-ldn-subsite"/>
|
<ccm:application name="ccm-ldn-subsite"/>
|
||||||
<ccm:application name="ccm-ldn-rss"/>
|
<ccm:application name="ccm-ldn-rss"/>
|
||||||
<ccm:application name="ccm-ldn-terms"/>
|
<ccm:application name="ccm-ldn-terms"/>
|
||||||
|
|
@ -44,7 +43,9 @@
|
||||||
|
|
||||||
<ccm:application name="ccm-navigation"/>
|
<ccm:application name="ccm-navigation"/>
|
||||||
<ccm:application name="ccm-portalworkspace"/>
|
<ccm:application name="ccm-portalworkspace"/>
|
||||||
|
<ccm:application name="ccm-portalworkspace-homepage"/>
|
||||||
<ccm:application name="ccm-search"/>
|
<ccm:application name="ccm-search"/>
|
||||||
|
<ccm:application name="ccm-shortcuts"/>
|
||||||
<ccm:application name="ccm-themedirector"/>
|
<ccm:application name="ccm-themedirector"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,12 @@
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>shortcuts</filter-name>
|
<filter-name>shortcuts</filter-name>
|
||||||
<filter-class>com.arsdigita.london.shortcuts.ShortcutFilter</filter-class>
|
<filter-class>com.arsdigita.shortcuts.ShortcutFilter</filter-class>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>subsite</filter-name>
|
<filter-name>subsite</filter-name>
|
||||||
<filter-class>com.arsdigita.london.subsite.SubsiteFilter</filter-class>
|
<filter-class>com.arsdigita.subsite.SubsiteFilter</filter-class>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
<!-- NOT USED HERE
|
<!-- NOT USED HERE
|
||||||
|
|
@ -271,26 +271,26 @@
|
||||||
</servlet>
|
</servlet>
|
||||||
<!-- module ccm-ldn-search - servlet declarations END -->
|
<!-- module ccm-ldn-search - servlet declarations END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-shortcuts - servlet definitions -->
|
<!-- module ccm-shortcuts - servlet definitions -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>shortcuts-files</servlet-name>
|
<servlet-name>shortcuts-files</servlet-name>
|
||||||
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>template-path</param-name>
|
<param-name>template-path</param-name>
|
||||||
<param-value>/templates/ccm-ldn-shortcuts</param-value>
|
<param-value>/templates/ccm-shortcuts</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
<!-- module ccm-ldn-subsite - servlet declarations BEGIN -->
|
<!-- module ccm-subsite - servlet declarations BEGIN -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>subsite-files</servlet-name>
|
<servlet-name>subsite-files</servlet-name>
|
||||||
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>template-path</param-name>
|
<param-name>template-path</param-name>
|
||||||
<param-value>/templates/ccm-ldn-subsite</param-value>
|
<param-value>/templates/ccm-subsite</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
</servlet>
|
</servlet>
|
||||||
<!-- module ccm-ldn-subsite - servlet declarations END -->
|
<!-- module ccm-subsite - servlet declarations END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-terms - servlet declarations BEGIN -->
|
<!-- module ccm-ldn-terms - servlet declarations BEGIN -->
|
||||||
<servlet>
|
<servlet>
|
||||||
|
|
@ -382,18 +382,18 @@
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
<!-- module ccm-ldn-search - servlet mappings END -->
|
<!-- module ccm-ldn-search - servlet mappings END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-shortcuts - servlet mappings -->
|
<!-- module ccm-shortcuts - servlet mappings -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>shortcuts-files</servlet-name>
|
<servlet-name>shortcuts-files</servlet-name>
|
||||||
<url-pattern>/ccm-ldn-shortcuts/files/*</url-pattern>
|
<url-pattern>/ccm-shortcuts/files/*</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- module ccm-ldn-subsite - servlet mappings BEGIN -->
|
<!-- module ccm-subsite - servlet mappings BEGIN -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>subsite-files</servlet-name>
|
<servlet-name>subsite-files</servlet-name>
|
||||||
<url-pattern>/ccm-ldn-subsite/files/*</url-pattern>
|
<url-pattern>/ccm-subsite/files/*</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
<!-- module ccm-ldn-subsite - servlet mappings END -->
|
<!-- module ccm-subsite - servlet mappings END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-terms - servlet mappings BEGIN -->
|
<!-- module ccm-ldn-terms - servlet mappings BEGIN -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,6 @@
|
||||||
<ccm:application name="ccm-ldn-importer"/>
|
<ccm:application name="ccm-ldn-importer"/>
|
||||||
<ccm:application name="ccm-ldn-rss"/>
|
<ccm:application name="ccm-ldn-rss"/>
|
||||||
<ccm:application name="ccm-ldn-search"/>
|
<ccm:application name="ccm-ldn-search"/>
|
||||||
<ccm:application name="ccm-ldn-shortcuts"/>
|
|
||||||
<ccm:application name="ccm-ldn-terms"/>
|
<ccm:application name="ccm-ldn-terms"/>
|
||||||
<ccm:application name="ccm-ldn-util"/>
|
<ccm:application name="ccm-ldn-util"/>
|
||||||
|
|
||||||
|
|
@ -81,6 +80,8 @@
|
||||||
<ccm:application name="ccm-navigation"/>
|
<ccm:application name="ccm-navigation"/>
|
||||||
<ccm:application name="ccm-portalserver"/>
|
<ccm:application name="ccm-portalserver"/>
|
||||||
<ccm:application name="ccm-portalworkspace"/>
|
<ccm:application name="ccm-portalworkspace"/>
|
||||||
|
<ccm:application name="ccm-portalworkspace-homepage"/>
|
||||||
|
<ccm:application name="ccm-shortcuts"/>
|
||||||
<ccm:application name="ccm-subsite"/>
|
<ccm:application name="ccm-subsite"/>
|
||||||
<ccm:application name="ccm-themedirector"/>
|
<ccm:application name="ccm-themedirector"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,12 @@
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>shortcuts</filter-name>
|
<filter-name>shortcuts</filter-name>
|
||||||
<filter-class>com.arsdigita.london.shortcuts.ShortcutFilter</filter-class>
|
<filter-class>com.arsdigita.shortcuts.ShortcutFilter</filter-class>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>subsite</filter-name>
|
<filter-name>subsite</filter-name>
|
||||||
<filter-class>com.arsdigita.london.subsite.SubsiteFilter</filter-class>
|
<filter-class>com.arsdigita.subsite.SubsiteFilter</filter-class>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
<filter-mapping>
|
<filter-mapping>
|
||||||
|
|
@ -249,26 +249,26 @@
|
||||||
</servlet>
|
</servlet>
|
||||||
<!-- module ccm-ldn-search - servlet declarations END -->
|
<!-- module ccm-ldn-search - servlet declarations END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-shortcuts - servlet definitions -->
|
<!-- module ccm-shortcuts - servlet definitions -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>shortcuts-files</servlet-name>
|
<servlet-name>shortcuts-files</servlet-name>
|
||||||
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>template-path</param-name>
|
<param-name>template-path</param-name>
|
||||||
<param-value>/templates/ccm-ldn-shortcuts</param-value>
|
<param-value>/templates/ccm-shortcuts</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
<!-- module ccm-ldn-subsite - servlet declarations BEGIN -->
|
<!-- module ccm-subsite - servlet declarations BEGIN -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>subsite-files</servlet-name>
|
<servlet-name>subsite-files</servlet-name>
|
||||||
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>template-path</param-name>
|
<param-name>template-path</param-name>
|
||||||
<param-value>/templates/ccm-ldn-subsite</param-value>
|
<param-value>/templates/ccm-subsite</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
</servlet>
|
</servlet>
|
||||||
<!-- module ccm-ldn-subsite - servlet declarations END -->
|
<!-- module ccm-subsite - servlet declarations END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-terms - servlet declarations BEGIN -->
|
<!-- module ccm-ldn-terms - servlet declarations BEGIN -->
|
||||||
<servlet>
|
<servlet>
|
||||||
|
|
@ -360,18 +360,18 @@
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
<!-- module ccm-ldn-search - servlet mappings END -->
|
<!-- module ccm-ldn-search - servlet mappings END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-shortcuts - servlet mappings -->
|
<!-- module ccm-shortcuts - servlet mappings -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>shortcuts-files</servlet-name>
|
<servlet-name>shortcuts-files</servlet-name>
|
||||||
<url-pattern>/ccm-ldn-shortcuts/files/*</url-pattern>
|
<url-pattern>/ccm-shortcuts/files/*</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- module ccm-ldn-subsite - servlet mappings BEGIN -->
|
<!-- module ccm-subsite - servlet mappings BEGIN -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>subsite-files</servlet-name>
|
<servlet-name>subsite-files</servlet-name>
|
||||||
<url-pattern>/ccm-ldn-subsite/files/*</url-pattern>
|
<url-pattern>/ccm-subsite/files/*</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
<!-- module ccm-ldn-subsite - servlet mappings END -->
|
<!-- module ccm-subsite - servlet mappings END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-terms - servlet mappings BEGIN -->
|
<!-- module ccm-ldn-terms - servlet mappings BEGIN -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
|
|
|
||||||
|
|
@ -80,13 +80,14 @@
|
||||||
<ccm:application name="ccm-ldn-importer"/>
|
<ccm:application name="ccm-ldn-importer"/>
|
||||||
<ccm:application name="ccm-ldn-rss"/>
|
<ccm:application name="ccm-ldn-rss"/>
|
||||||
<ccm:application name="ccm-ldn-search"/>
|
<ccm:application name="ccm-ldn-search"/>
|
||||||
<ccm:application name="ccm-ldn-shortcuts"/>
|
|
||||||
<ccm:application name="ccm-ldn-terms"/>
|
<ccm:application name="ccm-ldn-terms"/>
|
||||||
<ccm:application name="ccm-ldn-util"/>
|
<ccm:application name="ccm-ldn-util"/>
|
||||||
|
|
||||||
<ccm:application name="ccm-navigation"/>
|
<ccm:application name="ccm-navigation"/>
|
||||||
<ccm:application name="ccm-portalserver"/>
|
<ccm:application name="ccm-portalserver"/>
|
||||||
<ccm:application name="ccm-portalworkspace"/>
|
<ccm:application name="ccm-portalworkspace"/>
|
||||||
|
<ccm:application name="ccm-portalworkspace-homepage"/>
|
||||||
|
<ccm:application name="ccm-shortcuts"/>
|
||||||
<ccm:application name="ccm-subsite"/>
|
<ccm:application name="ccm-subsite"/>
|
||||||
<!-- Currently broken.
|
<!-- Currently broken.
|
||||||
Missing file: ccm-portlet/postgres-create.sql
|
Missing file: ccm-portlet/postgres-create.sql
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,12 @@
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>shortcuts</filter-name>
|
<filter-name>shortcuts</filter-name>
|
||||||
<filter-class>com.arsdigita.london.shortcuts.ShortcutFilter</filter-class>
|
<filter-class>com.arsdigita.shortcuts.ShortcutFilter</filter-class>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>subsite</filter-name>
|
<filter-name>subsite</filter-name>
|
||||||
<filter-class>com.arsdigita.london.subsite.SubsiteFilter</filter-class>
|
<filter-class>com.arsdigita.subsite.SubsiteFilter</filter-class>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
<!-- NOT USED HERE
|
<!-- NOT USED HERE
|
||||||
|
|
@ -271,26 +271,26 @@
|
||||||
</servlet>
|
</servlet>
|
||||||
<!-- module ccm-ldn-search - servlet declarations END -->
|
<!-- module ccm-ldn-search - servlet declarations END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-shortcuts - servlet definitions -->
|
<!-- module ccm-shortcuts - servlet definitions -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>shortcuts-files</servlet-name>
|
<servlet-name>shortcuts-files</servlet-name>
|
||||||
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>template-path</param-name>
|
<param-name>template-path</param-name>
|
||||||
<param-value>/templates/ccm-ldn-shortcuts</param-value>
|
<param-value>/templates/ccm-shortcuts</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
<!-- module ccm-ldn-subsite - servlet declarations BEGIN -->
|
<!-- module ccm-subsite - servlet declarations BEGIN -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>subsite-files</servlet-name>
|
<servlet-name>subsite-files</servlet-name>
|
||||||
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>template-path</param-name>
|
<param-name>template-path</param-name>
|
||||||
<param-value>/templates/ccm-ldn-subsite</param-value>
|
<param-value>/templates/ccm-subsite</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
</servlet>
|
</servlet>
|
||||||
<!-- module ccm-ldn-subsite - servlet declarations END -->
|
<!-- module ccm-subsite - servlet declarations END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-terms - servlet declarations BEGIN -->
|
<!-- module ccm-ldn-terms - servlet declarations BEGIN -->
|
||||||
<servlet>
|
<servlet>
|
||||||
|
|
@ -382,18 +382,18 @@
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
<!-- module ccm-ldn-search - servlet mappings END -->
|
<!-- module ccm-ldn-search - servlet mappings END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-shortcuts - servlet mappings -->
|
<!-- module ccm-shortcuts - servlet mappings -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>shortcuts-files</servlet-name>
|
<servlet-name>shortcuts-files</servlet-name>
|
||||||
<url-pattern>/ccm-ldn-shortcuts/files/*</url-pattern>
|
<url-pattern>/ccm-shortcuts/files/*</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- module ccm-ldn-subsite - servlet mappings BEGIN -->
|
<!-- module ccm-subsite - servlet mappings BEGIN -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>subsite-files</servlet-name>
|
<servlet-name>subsite-files</servlet-name>
|
||||||
<url-pattern>/ccm-ldn-subsite/files/*</url-pattern>
|
<url-pattern>/ccm-subsite/files/*</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
<!-- module ccm-ldn-subsite - servlet mappings END -->
|
<!-- module ccm-subsite - servlet mappings END -->
|
||||||
|
|
||||||
<!-- module ccm-ldn-terms - servlet mappings BEGIN -->
|
<!-- module ccm-ldn-terms - servlet mappings BEGIN -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
|
|
|
||||||
|
|
@ -1,57 +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.aplaws.ui;
|
|
||||||
|
|
||||||
import com.arsdigita.navigation.Navigation;
|
|
||||||
import com.arsdigita.navigation.NavigationModel;
|
|
||||||
|
|
||||||
import com.arsdigita.persistence.SessionManager;
|
|
||||||
import com.arsdigita.persistence.DataCollection;
|
|
||||||
|
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
|
||||||
|
|
||||||
import com.arsdigita.categorization.Category;
|
|
||||||
import com.arsdigita.util.Assert;
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
|
|
||||||
import com.arsdigita.portalworkspace.Workspace;
|
|
||||||
import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel;
|
|
||||||
|
|
||||||
public class CategoryPortalSelectionModel extends WorkspaceSelectionModel {
|
|
||||||
|
|
||||||
protected Workspace getDefaultWorkspace(PageState state) {
|
|
||||||
NavigationModel model = Navigation.getConfig().getDefaultModel();
|
|
||||||
Category cat = model.getCategory();
|
|
||||||
Assert.exists(cat);
|
|
||||||
|
|
||||||
DataCollection workspaces
|
|
||||||
= SessionManager.getSession().retrieve(
|
|
||||||
Workspace.BASE_DATA_OBJECT_TYPE);
|
|
||||||
workspaces.addEqualsFilter("categories.id", cat.getID());
|
|
||||||
|
|
||||||
if (workspaces.next()) {
|
|
||||||
Workspace wk = (Workspace)DomainObjectFactory
|
|
||||||
.newInstance(workspaces.getDataObject());
|
|
||||||
workspaces.close();
|
|
||||||
return wk;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
jsp files replace files provided by ccm-ldn-portal.
|
|
||||||
|
|
||||||
goal: Make the portal homepage read-only and cached for 15min. EXPERIMENTAL
|
|
||||||
|
|
||||||
Dynamic no-cache version is available at /ccm/portal/custom.jsp for admins
|
|
||||||
to get the 'customize area' links.
|
|
||||||
see r1082
|
|
||||||
|
|
||||||
Actually:
|
|
||||||
In the default configuration BaseDispatcher searches in the following order:
|
|
||||||
1. /templates/ccm-ldn-portal/portal/index.jsp
|
|
||||||
2. /templates/ccm-ldn-portal/portal/index.html
|
|
||||||
3. /templates/ccm-ldn-portal/index.jsp
|
|
||||||
4. /templates/ccm-ldn-portal/index.html (probably, not tested)
|
|
||||||
|
|
||||||
So, currently the first try is successfull and
|
|
||||||
aplaws/ui/HomepageWorkspaceSelectionModel is always used via index.jsp
|
|
||||||
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
<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:directive.page
|
|
||||||
import="com.arsdigita.dispatcher.DispatcherHelper,
|
|
||||||
com.arsdigita.aplaws.ui.*" />
|
|
||||||
|
|
||||||
<jsp:scriptlet>
|
|
||||||
DispatcherHelper.cacheForWorld(response,900);
|
|
||||||
</jsp:scriptlet>
|
|
||||||
|
|
||||||
<define:page name="itemPage" application="portal" title="APLAWS" cache="true">
|
|
||||||
|
|
||||||
<define:component name="left" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
<define:component name="middle" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
<define:component name="right" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
|
|
||||||
<jsp:scriptlet>
|
|
||||||
HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel();
|
|
||||||
|
|
||||||
((HomepageWorkspace)left).setModel(new HomepagePortalSelectionModel(workspace, 0));
|
|
||||||
((HomepageWorkspace)left).setReadOnly(true);
|
|
||||||
((HomepageWorkspace)left).setName("left");
|
|
||||||
((HomepageWorkspace)left).addWidgets();
|
|
||||||
((HomepageWorkspace)middle).setModel(new HomepagePortalSelectionModel(workspace, 1));
|
|
||||||
((HomepageWorkspace)middle).setReadOnly(true);
|
|
||||||
((HomepageWorkspace)middle).setName("middle");
|
|
||||||
((HomepageWorkspace)middle).addWidgets();
|
|
||||||
((HomepageWorkspace)right).setModel(new HomepagePortalSelectionModel(workspace, 2));
|
|
||||||
((HomepageWorkspace)right).setReadOnly(true);
|
|
||||||
((HomepageWorkspace)right).setName("right");
|
|
||||||
((HomepageWorkspace)right).addWidgets();
|
|
||||||
</jsp:scriptlet>
|
|
||||||
</define:page>
|
|
||||||
|
|
||||||
<show:all/>
|
|
||||||
|
|
||||||
</jsp:root>
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||||
|
name="ccm-portalworkspace-frontpage"
|
||||||
|
prettyName="OpenCCM Portalworkspace Custom Frontpage"
|
||||||
|
version="6.6.0"
|
||||||
|
release="1"
|
||||||
|
webapp="ROOT">
|
||||||
|
<ccm:dependencies>
|
||||||
|
<ccm:requires name="ccm-core" version="6.6.0" release="ge"/>
|
||||||
|
<ccm:requires name="ccm-portalworkspace" version="6.6.0" release="ge"/>
|
||||||
|
<ccm:requires name="ccm-subsite" version="6.6.0" release="ge"/>
|
||||||
|
<!-- Navigation used in CategoryPortalSelectionModel, which seems not to
|
||||||
|
be used anywhere in the code. Check jsp's for usage. May be not part
|
||||||
|
of custom homepage model -->
|
||||||
|
<ccm:requires name="ccm-navigation" version="6.6.0" release="ge"/>
|
||||||
|
</ccm:dependencies>
|
||||||
|
<ccm:directories>
|
||||||
|
<ccm:directory name="src"/>
|
||||||
|
<ccm:directory name="web"/>
|
||||||
|
</ccm:directories>
|
||||||
|
<ccm:contacts>
|
||||||
|
<ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/>
|
||||||
|
<ccm:contact uri="mailto:rhea@redhat.com" type="support"/>
|
||||||
|
</ccm:contacts>
|
||||||
|
<ccm:description>
|
||||||
|
Extension for ccm-portalworkspace to provide a custom frontpage for a site.
|
||||||
|
It uses a popular 3 column design (hardcoded unmutable) using 3 panes
|
||||||
|
which may further be divided into columns.
|
||||||
|
</ccm:description>
|
||||||
|
</ccm:application>
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<registry>
|
||||||
|
<!-- NOTHING TO CONFIG -->
|
||||||
|
</registry>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<load>
|
||||||
|
<requires>
|
||||||
|
<!-- NOTHING
|
||||||
|
<table name="pw_workspaces"/> -->
|
||||||
|
</requires>
|
||||||
|
<provides>
|
||||||
|
<!-- NOTHING to provide -->
|
||||||
|
</provides>
|
||||||
|
</load>
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.bundle.ui;
|
package com.arsdigita.portalworkspace.ui.homepage;
|
||||||
|
|
||||||
import com.arsdigita.navigation.Navigation;
|
import com.arsdigita.navigation.Navigation;
|
||||||
import com.arsdigita.navigation.NavigationModel;
|
import com.arsdigita.navigation.NavigationModel;
|
||||||
|
|
@ -33,8 +33,17 @@ import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.portalworkspace.Workspace;
|
import com.arsdigita.portalworkspace.Workspace;
|
||||||
import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel;
|
import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class CategoryPortalSelectionModel extends WorkspaceSelectionModel {
|
public class CategoryPortalSelectionModel extends WorkspaceSelectionModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
protected Workspace getDefaultWorkspace(PageState state) {
|
protected Workspace getDefaultWorkspace(PageState state) {
|
||||||
NavigationModel model = Navigation.getConfig().getDefaultModel();
|
NavigationModel model = Navigation.getConfig().getDefaultModel();
|
||||||
Category cat = model.getCategory();
|
Category cat = model.getCategory();
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.aplaws.ui;
|
package com.arsdigita.portalworkspace.ui.homepage;
|
||||||
|
|
||||||
import com.arsdigita.bebop.AbstractSingleSelectionModel;
|
import com.arsdigita.bebop.AbstractSingleSelectionModel;
|
||||||
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
||||||
|
|
@ -24,6 +24,10 @@ import com.arsdigita.domain.DomainObject;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used via jsp! See ~/templates/ccm-portalworkspace/portal/index.jsp
|
||||||
|
* Service class for HomepageWorkspace
|
||||||
|
*/
|
||||||
public class HomepagePortalSelectionModel extends AbstractSingleSelectionModel
|
public class HomepagePortalSelectionModel extends AbstractSingleSelectionModel
|
||||||
implements PortalSelectionModel {
|
implements PortalSelectionModel {
|
||||||
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.aplaws.ui;
|
package com.arsdigita.portalworkspace.ui.homepage;
|
||||||
|
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
import com.arsdigita.bebop.SimpleContainer;
|
||||||
import com.arsdigita.bebop.ActionLink;
|
import com.arsdigita.bebop.ActionLink;
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.aplaws.ui;
|
package com.arsdigita.portalworkspace.ui.homepage;
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.RequestLocal;
|
import com.arsdigita.bebop.RequestLocal;
|
||||||
|
|
@ -41,7 +41,7 @@ import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
@ -75,10 +75,11 @@ public class HomepageWorkspaceSelectionModel {
|
||||||
right,
|
right,
|
||||||
party);
|
party);
|
||||||
// Always ensure admin gets global portal
|
// Always ensure admin gets global portal
|
||||||
// don't use custom portals if asked not to
|
// don't use custom portals if asked not to
|
||||||
if (m_custom.get(state) == null ||
|
if (m_custom.get(state) == null
|
||||||
PermissionService.checkPermission(admin) ||
|
|| PermissionService.checkPermission(admin)
|
||||||
!Workspace.getConfig().getCreateUserWorkspaces()) {
|
|| !Workspace.getConfig()
|
||||||
|
.getCreateUserWorkspaces()) {
|
||||||
s_log.debug("Returning global portal");
|
s_log.debug("Returning global portal");
|
||||||
return (WorkspacePage)m_right.get(state);
|
return (WorkspacePage)m_right.get(state);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -102,9 +103,8 @@ public class HomepageWorkspaceSelectionModel {
|
||||||
|
|
||||||
// When customizing right column, may need to clone
|
// When customizing right column, may need to clone
|
||||||
// for a personal portal
|
// for a personal portal
|
||||||
// don't use custom portals if asked not to
|
// don't use custom portals if asked not to
|
||||||
if (column == 2 &&
|
if (column == 2 && Workspace.getConfig().getCreateUserWorkspaces()) {
|
||||||
Workspace.getConfig().getCreateUserWorkspaces()) {
|
|
||||||
Workspace global = getTopWorkspace();
|
Workspace global = getTopWorkspace();
|
||||||
|
|
||||||
WorkspacePage right = (WorkspacePage)m_right.get(state);
|
WorkspacePage right = (WorkspacePage)m_right.get(state);
|
||||||
|
|
@ -167,9 +167,8 @@ public class HomepageWorkspaceSelectionModel {
|
||||||
|
|
||||||
WorkspacePage clear = null;
|
WorkspacePage clear = null;
|
||||||
|
|
||||||
// don't use custom portals if asked not to
|
// don't use custom portals if asked not to
|
||||||
if (column == 2 &&
|
if (column == 2 && Workspace.getConfig().getCreateUserWorkspaces()) {
|
||||||
Workspace.getConfig().getCreateUserWorkspaces()) {
|
|
||||||
// If we find a custom workspace, then delete it,
|
// If we find a custom workspace, then delete it,
|
||||||
// otherwise just clear the portlets.
|
// otherwise just clear the portlets.
|
||||||
Workspace global = getTopWorkspace();
|
Workspace global = getTopWorkspace();
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
jsp files replace files provided by ccm-ldn-portal.
|
jsp files to provide a custom frontpage for a site based on ccm-portalworkspace.
|
||||||
|
|
||||||
goal: Make the portal homepage read-only and cached for 15min. EXPERIMENTAL
|
goal: Make the portal homepage read-only and cached for 15min. EXPERIMENTAL
|
||||||
|
|
||||||
Dynamic no-cache version is available at /ccm/portal/custom.jsp for admins to get the 'customize area' links.
|
Dynamic no-cache version is available at /ccm/portal/custom.jsp for admins
|
||||||
|
to get the 'customize area' links.
|
||||||
see r1082
|
see r1082
|
||||||
|
|
@ -5,17 +5,20 @@
|
||||||
|
|
||||||
<jsp:directive.page
|
<jsp:directive.page
|
||||||
import="com.arsdigita.dispatcher.DispatcherHelper,
|
import="com.arsdigita.dispatcher.DispatcherHelper,
|
||||||
com.arsdigita.aplaws.ui.*"/>
|
com.arsdigita.portalworkspace.ui.homepage.*"/>
|
||||||
|
|
||||||
<jsp:scriptlet>
|
<jsp:scriptlet>
|
||||||
DispatcherHelper.cacheDisable(response);
|
DispatcherHelper.cacheDisable(response);
|
||||||
</jsp:scriptlet>
|
</jsp:scriptlet>
|
||||||
|
|
||||||
<define:page name="itemPage" application="portal" title="APLAWS" cache="true">
|
<define:page name="itemPage" application="portal" title="OpenCCM" cache="true">
|
||||||
|
|
||||||
<define:component name="left" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
<define:component name="left"
|
||||||
<define:component name="middle" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
classname="com.arsdigita.portalworkspace.ui.homepage.HomepageWorkspace" />
|
||||||
<define:component name="right" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
<define:component name="middle"
|
||||||
|
classname="com.arsdigita.portalworkspace.ui.homepage.HomepageWorkspace" />
|
||||||
|
<define:component name="right"
|
||||||
|
classname="com.arsdigita.portalworkspace.ui.homepage.HomepageWorkspace" />
|
||||||
|
|
||||||
<jsp:scriptlet>
|
<jsp:scriptlet>
|
||||||
HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel();
|
HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel();
|
||||||
|
|
@ -5,17 +5,20 @@
|
||||||
|
|
||||||
<jsp:directive.page
|
<jsp:directive.page
|
||||||
import="com.arsdigita.dispatcher.DispatcherHelper,
|
import="com.arsdigita.dispatcher.DispatcherHelper,
|
||||||
com.arsdigita.aplaws.ui.*"/>
|
com.arsdigita.portalworkspace.ui.homepage.*"/>
|
||||||
|
|
||||||
<jsp:scriptlet>
|
<jsp:scriptlet>
|
||||||
DispatcherHelper.cacheForWorld(response,900);
|
DispatcherHelper.cacheForWorld(response,900);
|
||||||
</jsp:scriptlet>
|
</jsp:scriptlet>
|
||||||
|
|
||||||
<define:page name="itemPage" application="portal" title="APLAWS" cache="true">
|
<define:page name="itemPage" application="portal" title="OpenCCM" cache="true">
|
||||||
|
|
||||||
<define:component name="left" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
<define:component name="left"
|
||||||
<define:component name="middle" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
classname="com.arsdigita.portalworkspace.ui.homepage.HomepageWorkspace" />
|
||||||
<define:component name="right" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
<define:component name="middle"
|
||||||
|
classname="com.arsdigita.portalworkspace.ui.homepage.HomepageWorkspace" />
|
||||||
|
<define:component name="right"
|
||||||
|
classname="com.arsdigita.portalworkspace.ui.homepage.HomepageWorkspace" />
|
||||||
|
|
||||||
<jsp:scriptlet>
|
<jsp:scriptlet>
|
||||||
HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel();
|
HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel();
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Scientific CMS demo bundle integration.properties
|
# Scientific CMS demo bundle integration.properties
|
||||||
#
|
#
|
||||||
waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage
|
waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage
|
||||||
#
|
#
|
||||||
; dhtml editor to use (system wide)
|
; dhtml editor to use (system wide)
|
||||||
; Xinha is default
|
; Xinha is default
|
||||||
|
|
@ -39,14 +39,14 @@ waf.xml.activate_full_date_formatter=true
|
||||||
|
|
||||||
# ccm-cms parameters
|
# ccm-cms parameters
|
||||||
|
|
||||||
com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker
|
com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker
|
||||||
|
|
||||||
com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp
|
com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp
|
||||||
com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
|
com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
|
||||||
com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver
|
com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver
|
||||||
|
|
||||||
; Configure dhtml editor for use in cms content-center
|
; Configure dhtml editor for use in cms content-center
|
||||||
; Xinha is default and does work out of the box
|
; Xinha is default and should work out of the box
|
||||||
; A CCM specific configuration file is used to prevent a mess with the standard
|
; A CCM specific configuration file is used to prevent a mess with the standard
|
||||||
; configuration, default is:
|
; configuration, default is:
|
||||||
; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js
|
; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js
|
||||||
|
|
@ -117,7 +117,8 @@ themedirector.file_extensions=bmp css gif jpeg jpg js png xml xsl
|
||||||
|
|
||||||
# ccm-sci-bundle (Loader only)
|
# ccm-sci-bundle (Loader only)
|
||||||
#com.arsdigita.bundle.loader.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml
|
#com.arsdigita.bundle.loader.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml
|
||||||
|
#com.arsdigita.bundle.loader.custom_app_instances=com.arsdigita.navigation.Navigation:scimenu:ScientificCMS Navigation Menu,com.arsdigita.navigation.Navigation:libmenu:LibreCMS Navigation Menu
|
||||||
|
#com.arsdigita.bundle.loader.domain_mappings=STD-NAV:/navigation/,STD-NAV:/generic/,STD-NAV:/portal/
|
||||||
# =============================================================================================
|
# =============================================================================================
|
||||||
# runtime specific configurations
|
# runtime specific configurations
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
|
||||||
<!-- project.xml SCI devel - containing only modules used for ScientificCMS -->
|
<!-- project.xml SCI demo - containing only modules used for
|
||||||
|
ScientificCMS DEMO exition -->
|
||||||
|
|
||||||
<ccm:project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<ccm:project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||||
|
|
@ -13,6 +14,11 @@
|
||||||
webapp="ROOT"
|
webapp="ROOT"
|
||||||
xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools-ng/common/xsd/project.xsd">
|
xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools-ng/common/xsd/project.xsd">
|
||||||
|
|
||||||
|
<ccm:databases>
|
||||||
|
<ccm:database name="postgres"/>
|
||||||
|
</ccm:databases>
|
||||||
|
|
||||||
|
|
||||||
<ccm:build>
|
<ccm:build>
|
||||||
|
|
||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||||
|
|
@ -38,12 +44,14 @@
|
||||||
<ccm:application name="ccm-navigation"/>
|
<ccm:application name="ccm-navigation"/>
|
||||||
<!-- ccm-portalworkspace depends on ccm-subsite -->
|
<!-- ccm-portalworkspace depends on ccm-subsite -->
|
||||||
<ccm:application name="ccm-portalworkspace"/>
|
<ccm:application name="ccm-portalworkspace"/>
|
||||||
|
<ccm:application name="ccm-portalworkspace-homepage"/>
|
||||||
|
<ccm:application name="ccm-shortcuts"/>
|
||||||
<ccm:application name="ccm-subsite"/>
|
<ccm:application name="ccm-subsite"/>
|
||||||
|
|
||||||
<ccm:application name="ccm-themedirector"/>
|
<ccm:application name="ccm-themedirector"/>
|
||||||
|
|
||||||
<!-- LDN extension -->
|
<!-- LDN extension -->
|
||||||
<ccm:application name="ccm-ldn-search"/>
|
<ccm:application name="ccm-ldn-search"/>
|
||||||
<ccm:application name="ccm-ldn-shortcuts"/>
|
|
||||||
<ccm:application name="ccm-ldn-terms"/>
|
<ccm:application name="ccm-ldn-terms"/>
|
||||||
<ccm:application name="ccm-ldn-util"/>
|
<ccm:application name="ccm-ldn-util"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Scientific CMS devel bundle integration.properties
|
# Scientific CMS devel bundle integration.properties
|
||||||
#
|
#
|
||||||
waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage
|
waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage
|
||||||
#
|
#
|
||||||
; dhtml editor to use (system wide)
|
; dhtml editor to use (system wide)
|
||||||
; Xinha is default
|
; Xinha is default
|
||||||
|
|
@ -39,7 +39,7 @@ waf.xml.activate_full_date_formatter=true
|
||||||
|
|
||||||
# ccm-cms parameters
|
# ccm-cms parameters
|
||||||
|
|
||||||
com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker
|
com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker
|
||||||
|
|
||||||
com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp
|
com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp
|
||||||
com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
|
com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
|
||||||
|
|
|
||||||
|
|
@ -44,13 +44,14 @@
|
||||||
<ccm:application name="ccm-navigation"/>
|
<ccm:application name="ccm-navigation"/>
|
||||||
<!-- ccm-portalworkspace depends on ccm-subsite -->
|
<!-- ccm-portalworkspace depends on ccm-subsite -->
|
||||||
<ccm:application name="ccm-portalworkspace"/>
|
<ccm:application name="ccm-portalworkspace"/>
|
||||||
|
<ccm:application name="ccm-portalworkspace-homepage"/>
|
||||||
|
<ccm:application name="ccm-shortcuts"/>
|
||||||
<ccm:application name="ccm-subsite"/>
|
<ccm:application name="ccm-subsite"/>
|
||||||
|
|
||||||
<ccm:application name="ccm-themedirector"/>
|
<ccm:application name="ccm-themedirector"/>
|
||||||
|
|
||||||
<!-- LDN extension -->
|
<!-- LDN extension -->
|
||||||
<ccm:application name="ccm-ldn-search"/>
|
<ccm:application name="ccm-ldn-search"/>
|
||||||
<ccm:application name="ccm-ldn-shortcuts"/>
|
|
||||||
<ccm:application name="ccm-ldn-terms"/>
|
<ccm:application name="ccm-ldn-terms"/>
|
||||||
<ccm:application name="ccm-ldn-util"/>
|
<ccm:application name="ccm-ldn-util"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,57 +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.bundle.ui;
|
|
||||||
|
|
||||||
import com.arsdigita.navigation.Navigation;
|
|
||||||
import com.arsdigita.navigation.NavigationModel;
|
|
||||||
|
|
||||||
import com.arsdigita.persistence.SessionManager;
|
|
||||||
import com.arsdigita.persistence.DataCollection;
|
|
||||||
|
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
|
||||||
|
|
||||||
import com.arsdigita.categorization.Category;
|
|
||||||
import com.arsdigita.util.Assert;
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
|
|
||||||
import com.arsdigita.portalworkspace.Workspace;
|
|
||||||
import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel;
|
|
||||||
|
|
||||||
public class CategoryPortalSelectionModel extends WorkspaceSelectionModel {
|
|
||||||
|
|
||||||
protected Workspace getDefaultWorkspace(PageState state) {
|
|
||||||
NavigationModel model = Navigation.getConfig().getDefaultModel();
|
|
||||||
Category cat = model.getCategory();
|
|
||||||
Assert.exists(cat);
|
|
||||||
|
|
||||||
DataCollection workspaces
|
|
||||||
= SessionManager.getSession().retrieve(
|
|
||||||
Workspace.BASE_DATA_OBJECT_TYPE);
|
|
||||||
workspaces.addEqualsFilter("categories.id", cat.getID());
|
|
||||||
|
|
||||||
if (workspaces.next()) {
|
|
||||||
Workspace wk = (Workspace)DomainObjectFactory
|
|
||||||
.newInstance(workspaces.getDataObject());
|
|
||||||
workspaces.close();
|
|
||||||
return wk;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,88 +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.bundle.ui;
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.AbstractSingleSelectionModel;
|
|
||||||
import com.arsdigita.portalworkspace.ui.PortalSelectionModel;
|
|
||||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
|
||||||
import com.arsdigita.domain.DomainObject;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
public class HomepagePortalSelectionModel extends AbstractSingleSelectionModel
|
|
||||||
implements PortalSelectionModel {
|
|
||||||
|
|
||||||
/** Private logger instance for debugging */
|
|
||||||
private static Logger s_log = Logger.getLogger(
|
|
||||||
HomepagePortalSelectionModel.class);
|
|
||||||
|
|
||||||
private HomepageWorkspaceSelectionModel m_workspace;
|
|
||||||
private int m_column;
|
|
||||||
|
|
||||||
public HomepagePortalSelectionModel(HomepageWorkspaceSelectionModel workspace,
|
|
||||||
int column) {
|
|
||||||
m_workspace = workspace;
|
|
||||||
m_column = column;
|
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("Constructor HomepageWorkspaceSelectionModel " + " [" +
|
|
||||||
"Workspace: " + m_workspace + "," +
|
|
||||||
"Columns: " + column + "]");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCustomize(PageState state) {
|
|
||||||
m_workspace.onCustomize(state, m_column);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onReset(PageState state) {
|
|
||||||
m_workspace.onReset(state, m_column);
|
|
||||||
}
|
|
||||||
|
|
||||||
public HomepageWorkspaceSelectionModel getWorkspaceModel() {
|
|
||||||
return m_workspace;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getSelectedKey(PageState state) {
|
|
||||||
return getSelectedPortal(state).getID();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelectedKey(PageState state,
|
|
||||||
Object key) {
|
|
||||||
throw new UnsupportedOperationException("cannot set key");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelectedObject(PageState state,
|
|
||||||
DomainObject key) {
|
|
||||||
throw new UnsupportedOperationException("cannot set object");
|
|
||||||
}
|
|
||||||
|
|
||||||
public ParameterModel getStateParameter() {
|
|
||||||
throw new UnsupportedOperationException("not state param");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public DomainObject getSelectedObject(PageState state) {
|
|
||||||
return getSelectedPortal(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public WorkspacePage getSelectedPortal(PageState state) {
|
|
||||||
return m_workspace.getPortal(state, m_column);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,174 +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.bundle.ui;
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
|
||||||
import com.arsdigita.bebop.ActionLink;
|
|
||||||
import com.arsdigita.bebop.Page;
|
|
||||||
import com.arsdigita.bebop.event.ActionEvent;
|
|
||||||
import com.arsdigita.bebop.event.ActionListener;
|
|
||||||
import com.arsdigita.portalworkspace.ui.PersistentPortal;
|
|
||||||
import com.arsdigita.portalworkspace.Workspace;
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
import com.arsdigita.xml.Element;
|
|
||||||
import com.arsdigita.portalworkspace.ui.PortalConstants;
|
|
||||||
import com.arsdigita.kernel.permissions.PermissionService;
|
|
||||||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
|
||||||
import com.arsdigita.kernel.Party;
|
|
||||||
import com.arsdigita.kernel.Kernel;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class HomepageWorkspace extends SimpleContainer {
|
|
||||||
|
|
||||||
/** Private logger instance for debugging */
|
|
||||||
private static Logger s_log = Logger.getLogger(
|
|
||||||
HomepageWorkspace.class);
|
|
||||||
|
|
||||||
private HomepagePortalSelectionModel m_model;
|
|
||||||
private ActionLink m_reset;
|
|
||||||
private ActionLink m_browse;
|
|
||||||
private ActionLink m_edit;
|
|
||||||
private PersistentPortal m_browser;
|
|
||||||
private PersistentPortal m_editor;
|
|
||||||
private boolean m_customizable;
|
|
||||||
private boolean m_readOnly;
|
|
||||||
private String m_name;
|
|
||||||
|
|
||||||
public HomepageWorkspace() {
|
|
||||||
super("portal:homepageWorkspace", PortalConstants.PORTAL_XML_NS);
|
|
||||||
m_customizable = false;
|
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("Constructor HomepageWorkspace finished. " );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModel(HomepagePortalSelectionModel model) {
|
|
||||||
m_model = model;
|
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("setModel: " + m_model );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCustomizable(boolean customizable) {
|
|
||||||
m_customizable = customizable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReadOnly(boolean readOnly) {
|
|
||||||
m_readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
m_name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addWidgets() {
|
|
||||||
m_edit = new ActionLink("customize");
|
|
||||||
m_browse = new ActionLink("browse");
|
|
||||||
m_reset = new ActionLink("reset");
|
|
||||||
m_reset.setConfirmation("Are you sure you wish to reset this column? " +
|
|
||||||
"This will permanently remove all portlets.");
|
|
||||||
|
|
||||||
m_browser = new PersistentPortal(m_model,
|
|
||||||
m_name,
|
|
||||||
PortalConstants.MODE_DISPLAY);
|
|
||||||
m_editor = new PersistentPortal(m_model,
|
|
||||||
m_name,
|
|
||||||
PortalConstants.MODE_EDITOR);
|
|
||||||
|
|
||||||
m_edit.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
PageState state = e.getPageState();
|
|
||||||
setDisplayMode(state, false);
|
|
||||||
|
|
||||||
m_model.onCustomize(state);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
m_browse.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
PageState state = e.getPageState();
|
|
||||||
setDisplayMode(state, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
m_reset.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
PageState state = e.getPageState();
|
|
||||||
setDisplayMode(state, true);
|
|
||||||
|
|
||||||
m_model.onReset(state);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
add(m_edit);
|
|
||||||
add(m_browse);
|
|
||||||
add(m_reset);
|
|
||||||
add(m_editor);
|
|
||||||
add(m_browser);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDisplayMode(PageState state,
|
|
||||||
boolean browse) {
|
|
||||||
if (m_readOnly) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_browse.setVisible(state, !browse);
|
|
||||||
m_reset.setVisible(state, !browse);
|
|
||||||
m_edit.setVisible(state, browse);
|
|
||||||
m_browser.setVisible(state, browse);
|
|
||||||
m_editor.setVisible(state, !browse);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void register(Page page) {
|
|
||||||
super.register(page);
|
|
||||||
|
|
||||||
page.setVisibleDefault(m_browse, false);
|
|
||||||
page.setVisibleDefault(m_reset, false);
|
|
||||||
page.setVisibleDefault(m_edit, !m_readOnly);
|
|
||||||
page.setVisibleDefault(m_browser, true);
|
|
||||||
page.setVisibleDefault(m_editor, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void generateXML(PageState state,
|
|
||||||
Element parent) {
|
|
||||||
Party party = Kernel.getContext().getParty();
|
|
||||||
Workspace global = m_model.getWorkspaceModel().getGlobalWorkspace(state);
|
|
||||||
PermissionDescriptor admin =
|
|
||||||
new PermissionDescriptor(PrivilegeDescriptor.ADMIN,
|
|
||||||
global,
|
|
||||||
party);
|
|
||||||
boolean hasAdmin = PermissionService.checkPermission(admin);
|
|
||||||
boolean userWorkspaces = Workspace.getConfig().getCreateUserWorkspaces();
|
|
||||||
|
|
||||||
if (party == null || m_readOnly ||
|
|
||||||
(!hasAdmin && !m_customizable) || (!hasAdmin && !userWorkspaces)) {
|
|
||||||
m_reset.setVisible(state, false);
|
|
||||||
m_browse.setVisible(state, false);
|
|
||||||
m_edit.setVisible(state, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.generateXML(state, parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,287 +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.bundle.ui;
|
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.RequestLocal;
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.kernel.Party;
|
|
||||||
import com.arsdigita.kernel.User;
|
|
||||||
import com.arsdigita.kernel.Kernel;
|
|
||||||
import com.arsdigita.kernel.permissions.PermissionService;
|
|
||||||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
|
||||||
|
|
||||||
import com.arsdigita.portalworkspace.Workspace;
|
|
||||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
|
||||||
import com.arsdigita.portalworkspace.WorkspacePageCollection;
|
|
||||||
|
|
||||||
import com.arsdigita.subsite.Subsite;
|
|
||||||
|
|
||||||
import com.arsdigita.util.Assert;
|
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
|
||||||
|
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
|
|
||||||
public class HomepageWorkspaceSelectionModel {
|
|
||||||
private RequestLocal m_loaded = new RequestLocal();
|
|
||||||
private RequestLocal m_global = new RequestLocal();
|
|
||||||
private RequestLocal m_personal = new RequestLocal();
|
|
||||||
private RequestLocal m_left = new RequestLocal();
|
|
||||||
private RequestLocal m_middle = new RequestLocal();
|
|
||||||
private RequestLocal m_right = new RequestLocal();
|
|
||||||
private RequestLocal m_custom = new RequestLocal();
|
|
||||||
|
|
||||||
private static Logger s_log = Logger.getLogger
|
|
||||||
(HomepageWorkspaceSelectionModel.class.getName());
|
|
||||||
|
|
||||||
public WorkspacePage getPortal(PageState state,
|
|
||||||
int column) {
|
|
||||||
if (!Boolean.TRUE.equals(m_loaded.get(state))) {
|
|
||||||
loadWorkspacePages(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (column == 0) { // Always global portal
|
|
||||||
return (WorkspacePage)m_left.get(state);
|
|
||||||
} else if (column == 1) { // Always global portal
|
|
||||||
return (WorkspacePage)m_middle.get(state);
|
|
||||||
} else if (column == 2) { // Personal portal, fallback on global
|
|
||||||
Party party = (Party)Kernel.getContext().getParty();
|
|
||||||
WorkspacePage right = (WorkspacePage)m_right.get(state);
|
|
||||||
PermissionDescriptor admin =
|
|
||||||
new PermissionDescriptor(PrivilegeDescriptor.ADMIN,
|
|
||||||
right,
|
|
||||||
party);
|
|
||||||
// Always ensure admin gets global portal
|
|
||||||
// don't use custom portals if asked not to
|
|
||||||
if (m_custom.get(state) == null ||
|
|
||||||
PermissionService.checkPermission(admin) ||
|
|
||||||
!Workspace.getConfig().getCreateUserWorkspaces()) {
|
|
||||||
s_log.debug("Returning global portal");
|
|
||||||
return (WorkspacePage)m_right.get(state);
|
|
||||||
} else {
|
|
||||||
s_log.debug("Returning personal portal");
|
|
||||||
return (WorkspacePage)m_custom.get(state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new UncheckedWrapperException("column out of range (0..2)");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCustomize(PageState state,
|
|
||||||
int column) {
|
|
||||||
if (!Boolean.TRUE.equals(m_loaded.get(state))) {
|
|
||||||
loadWorkspacePages(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
Party party = (Party)Kernel.getContext().getParty();
|
|
||||||
|
|
||||||
Assert.exists(party, Party.class);
|
|
||||||
|
|
||||||
// When customizing right column, may need to clone
|
|
||||||
// for a personal portal
|
|
||||||
// don't use custom portals if asked not to
|
|
||||||
if (column == 2 &&
|
|
||||||
Workspace.getConfig().getCreateUserWorkspaces()) {
|
|
||||||
Workspace global = getTopWorkspace();
|
|
||||||
|
|
||||||
WorkspacePage right = (WorkspacePage)m_right.get(state);
|
|
||||||
PermissionDescriptor admin =
|
|
||||||
new PermissionDescriptor(PrivilegeDescriptor.ADMIN,
|
|
||||||
right,
|
|
||||||
party);
|
|
||||||
if (PermissionService.checkPermission(admin)) {
|
|
||||||
s_log.debug("Party has admin on global portal");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_custom.get(state) != null) {
|
|
||||||
s_log.debug("Party has custom portal already");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
s_log.debug("Looking for custom column 2");
|
|
||||||
|
|
||||||
Workspace custom = null;
|
|
||||||
try {
|
|
||||||
custom = global.retrieveSubworkspaceForParty(party);
|
|
||||||
s_log.debug("Found exsting personal workspce");
|
|
||||||
} catch (DataObjectNotFoundException ex) {
|
|
||||||
s_log.debug("Created new personal workspace");
|
|
||||||
custom = Workspace.createWorkspace(
|
|
||||||
"personal-" + party.getID(),
|
|
||||||
"Personal Workspace for " + party.getDisplayName(),
|
|
||||||
global,
|
|
||||||
(User)party
|
|
||||||
);
|
|
||||||
}
|
|
||||||
s_log.debug("Looking for portal");
|
|
||||||
m_personal.set(state, custom);
|
|
||||||
WorkspacePageCollection portals = custom.getPages();
|
|
||||||
portals.addOrder(WorkspacePage.SORT_KEY);
|
|
||||||
WorkspacePage portal;
|
|
||||||
if (portals.next()) {
|
|
||||||
s_log.debug("Found portal");
|
|
||||||
portal = portals.getPage();
|
|
||||||
portals.close();
|
|
||||||
} else {
|
|
||||||
s_log.debug("Create portal");
|
|
||||||
portal = custom.addPage("Custom", "Custom page");
|
|
||||||
}
|
|
||||||
m_custom.set(state, portal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void onReset(PageState state,
|
|
||||||
int column) {
|
|
||||||
if (!Boolean.TRUE.equals(m_loaded.get(state))) {
|
|
||||||
loadWorkspacePages(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
Party party = Kernel.getContext().getParty();
|
|
||||||
|
|
||||||
Assert.exists(party, Party.class);
|
|
||||||
|
|
||||||
WorkspacePage clear = null;
|
|
||||||
|
|
||||||
// don't use custom portals if asked not to
|
|
||||||
if (column == 2 &&
|
|
||||||
Workspace.getConfig().getCreateUserWorkspaces()) {
|
|
||||||
// If we find a custom workspace, then delete it,
|
|
||||||
// otherwise just clear the portlets.
|
|
||||||
Workspace global = getTopWorkspace();
|
|
||||||
Workspace custom = null;
|
|
||||||
try {
|
|
||||||
custom = global.retrieveSubworkspaceForParty(party);
|
|
||||||
Assert.isTrue(custom.getParty() != null &&
|
|
||||||
custom.getParty().equals(party),
|
|
||||||
"party is not null and not admin");
|
|
||||||
s_log.debug("Found exsting personal workspce");
|
|
||||||
custom.delete();
|
|
||||||
m_custom.set(state, null);
|
|
||||||
} catch (DataObjectNotFoundException ex) {
|
|
||||||
clear = (WorkspacePage)m_right.get(state);
|
|
||||||
}
|
|
||||||
} else if (column == 1) {
|
|
||||||
clear = (WorkspacePage)m_middle.get(state);
|
|
||||||
} else if (column == 0) {
|
|
||||||
clear = (WorkspacePage)m_left.get(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clear != null) {
|
|
||||||
clear.clearPortlets();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Workspace getGlobalWorkspace(PageState state) {
|
|
||||||
if (!Boolean.TRUE.equals(m_loaded.get(state))) {
|
|
||||||
loadWorkspacePages(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (Workspace)m_global.get(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Workspace getPersonalWorkspace(PageState state) {
|
|
||||||
if (!Boolean.TRUE.equals(m_loaded.get(state))) {
|
|
||||||
loadWorkspacePages(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (Workspace)m_personal.get(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadWorkspacePages(PageState state) {
|
|
||||||
Workspace global = getTopWorkspace();
|
|
||||||
m_global.set(state, global);
|
|
||||||
|
|
||||||
WorkspacePage left = null;
|
|
||||||
WorkspacePage middle = null;
|
|
||||||
WorkspacePage right = null;
|
|
||||||
|
|
||||||
WorkspacePageCollection portals = global.getPages();
|
|
||||||
portals.addOrder(WorkspacePage.SORT_KEY);
|
|
||||||
while (portals.next()) {
|
|
||||||
WorkspacePage portal = portals.getPage();
|
|
||||||
|
|
||||||
if (portal.getSortKey() == 0) {
|
|
||||||
left = portal;
|
|
||||||
} else if (portal.getSortKey() == 1) {
|
|
||||||
middle = portal;
|
|
||||||
} else if (portal.getSortKey() == 2) {
|
|
||||||
right = portal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (left == null) {
|
|
||||||
left = global.addPage("Left", "Left hand page");
|
|
||||||
}
|
|
||||||
if (middle == null) {
|
|
||||||
middle = global.addPage("Middle", "Middle page");
|
|
||||||
}
|
|
||||||
if (right == null) {
|
|
||||||
right = global.addPage("Right", "Right hand page");
|
|
||||||
}
|
|
||||||
m_left.set(state, left);
|
|
||||||
m_middle.set(state, middle);
|
|
||||||
m_right.set(state, right);
|
|
||||||
|
|
||||||
|
|
||||||
Party party = (Party)Kernel.getContext().getParty();
|
|
||||||
m_custom.set(state, null);
|
|
||||||
if (party != null) {
|
|
||||||
Workspace custom = null;
|
|
||||||
try {
|
|
||||||
custom = global.retrieveSubworkspaceForParty(party);
|
|
||||||
} catch (DataObjectNotFoundException ex) {
|
|
||||||
// nada
|
|
||||||
}
|
|
||||||
if (custom != null) {
|
|
||||||
portals = custom.getPages();
|
|
||||||
portals.addOrder(WorkspacePage.SORT_KEY);
|
|
||||||
if (portals.next()) {
|
|
||||||
WorkspacePage portal = portals.getPage();
|
|
||||||
m_custom.set(state, portal);
|
|
||||||
}
|
|
||||||
portals.close();
|
|
||||||
}
|
|
||||||
s_log.debug("Is there a custom portal ?" + custom +
|
|
||||||
" - " + m_custom.get(state));
|
|
||||||
m_personal.set(state, custom);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_loaded.set(state, Boolean.TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Workspace getTopWorkspace() {
|
|
||||||
if (Subsite.getContext().hasSite()) {
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("Return a subsite front page");
|
|
||||||
}
|
|
||||||
return (Workspace)Subsite.getContext().getSite().getFrontPage();
|
|
||||||
} else {
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("Return the main front page");
|
|
||||||
}
|
|
||||||
return (Workspace)Kernel.getContext().getResource();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
jsp files replace files provided by ccm-ldn-portal.
|
|
||||||
|
|
||||||
goal: Make the portal homepage read-only and cached for 15min. EXPERIMENTAL
|
|
||||||
|
|
||||||
Dynamic no-cache version is available at /ccm/portal/custom.jsp for admins to get the 'customize area' links.
|
|
||||||
see r1082
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
<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:directive.page
|
|
||||||
import="com.arsdigita.dispatcher.DispatcherHelper,
|
|
||||||
com.arsdigita.aplaws.ui.*"/>
|
|
||||||
|
|
||||||
<jsp:scriptlet>
|
|
||||||
DispatcherHelper.cacheDisable(response);
|
|
||||||
</jsp:scriptlet>
|
|
||||||
|
|
||||||
<define:page name="itemPage" application="portal" title="APLAWS" cache="true">
|
|
||||||
|
|
||||||
<define:component name="left" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
<define:component name="middle" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
<define:component name="right" classname="com.arsdigita.aplaws.ui.HomepageWorkspace" />
|
|
||||||
|
|
||||||
<jsp:scriptlet>
|
|
||||||
HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel();
|
|
||||||
((HomepageWorkspace)left).setModel(new HomepagePortalSelectionModel(workspace, 0));
|
|
||||||
((HomepageWorkspace)left).setName("left");
|
|
||||||
((HomepageWorkspace)left).addWidgets();
|
|
||||||
((HomepageWorkspace)middle).setModel(new HomepagePortalSelectionModel(workspace, 1));
|
|
||||||
((HomepageWorkspace)middle).setName("middle");
|
|
||||||
((HomepageWorkspace)middle).addWidgets();
|
|
||||||
((HomepageWorkspace)right).setModel(new HomepagePortalSelectionModel(workspace, 2));
|
|
||||||
((HomepageWorkspace)right).setCustomizable(true);
|
|
||||||
((HomepageWorkspace)right).setName("right");
|
|
||||||
((HomepageWorkspace)right).addWidgets();
|
|
||||||
</jsp:scriptlet>
|
|
||||||
</define:page>
|
|
||||||
|
|
||||||
<show:all/>
|
|
||||||
|
|
||||||
</jsp:root>
|
|
||||||
Loading…
Reference in New Issue