Ticket #1468: /ccm/search Application ist nicht (mehr) Subsite-Aware

Problem ist, daß das DefaultNavigationModel nichts von Subsite weiß. Daher muß für die Suche ein anderes NavigationModel verwendet werden. DIe Integration ist noch nicht schön, aber ich habe zur Zeit keine bessere Idee.

Hinzugefügt
 * SearchNavigationModel
 * JSPs für search

git-svn-id: https://svn.libreccm.org/ccm/trunk@2223 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2013-06-20 13:30:39 +00:00
parent 6b8b421da0
commit 9c7a80b93d
5 changed files with 164 additions and 0 deletions

View File

@ -0,0 +1,21 @@
--
-- Copyright (C) 2010 Peter Boy. 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
--
-- $Id: upd_acs_objects.sql $
alter table cms_item_image_attachement add column sort_key integer set default 1;

View File

@ -0,0 +1,28 @@
<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"/>
<jsp:directive.page import="com.arsdigita.navigation.Navigation"/>
<jsp:directive.page import="com.arsdigita.toolbox.ui.ApplicationAuthenticationListener"/>
<jsp:scriptlet>
DispatcherHelper.cacheDisable(response);
</jsp:scriptlet>
<define:page name="advanced" application="search"
title="Search" cache="true">
<define:component name="categoryPath"
classname="com.arsdigita.navigation.ui.category.Path"/>
<define:component name="categoryMenu"
classname="com.arsdigita.navigation.ui.category.Menu"/>
<jsp:scriptlet>
((com.arsdigita.navigation.ui.category.Path) categoryPath).setModel(new com.arsdigita.subsite.SearchNavigationModel());
((com.arsdigita.navigation.ui.category.Menu) categoryMenu).setModel(new com.arsdigita.subsite.SearchNavigationModel());
</jsp:scriptlet>
<define:component name="search" classname="com.arsdigita.london.search.ui.AdvancedSearchPane"/>
</define:page>
<show:all/>
</jsp:root>

View File

@ -0,0 +1,29 @@
<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"/>
<jsp:directive.page import="com.arsdigita.navigation.Navigation"/>
<jsp:directive.page import="com.arsdigita.toolbox.ui.ApplicationAuthenticationListener"/>
<jsp:scriptlet>
DispatcherHelper.cacheDisable(response);
</jsp:scriptlet>
<define:page name="search" application="search"
title="Search" cache="true">
<define:component name="categoryPath"
classname="com.arsdigita.navigation.ui.category.Path"/>
<define:component name="categoryMenu"
classname="com.arsdigita.navigation.ui.category.Menu"/>
<jsp:scriptlet>
((com.arsdigita.navigation.ui.category.Path) categoryPath).setModel(new com.arsdigita.subsite.SearchNavigationModel());
((com.arsdigita.navigation.ui.category.Menu) categoryMenu).setModel(new com.arsdigita.subsite.SearchNavigationModel());
</jsp:scriptlet>
<define:component name="simpleSearch" classname="com.arsdigita.london.search.ui.SimpleSearchPane"/>
</define:page>
<show:all/>
</jsp:root>

View File

@ -0,0 +1,28 @@
<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"/>
<jsp:directive.page import="com.arsdigita.navigation.Navigation"/>
<jsp:directive.page import="com.arsdigita.toolbox.ui.ApplicationAuthenticationListener"/>
<jsp:scriptlet>
DispatcherHelper.cacheDisable(response);
</jsp:scriptlet>
<define:page name="remote" application="search"
title="Remote Search" cache="true">
<define:component name="categoryPath"
classname="com.arsdigita.navigation.ui.category.Path"/>
<define:component name="categoryMenu"
classname="com.arsdigita.navigation.ui.category.Menu"/>
<jsp:scriptlet>
((com.arsdigita.navigation.ui.category.Path) categoryPath).setModel(new com.arsdigita.subsite.SearchNavigationModel());
((com.arsdigita.navigation.ui.category.Menu) categoryMenu).setModel(new com.arsdigita.subsite.SearchNavigationModel());
</jsp:scriptlet>
<define:component name="search" classname="com.arsdigita.london.search.ui.RemoteSearchPane"/>
</define:page>
<show:all/>
</jsp:root>

View File

@ -0,0 +1,58 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.arsdigita.subsite;
import com.arsdigita.categorization.Category;
import com.arsdigita.kernel.ACSObject;
import com.arsdigita.navigation.AbstractNavigationModel;
/**
*
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
*/
public class SearchNavigationModel extends AbstractNavigationModel {
@Override
protected ACSObject loadObject() {
Category category = getCategory();
if (category == null) {
return null;
}
return category.getIndexObject();
}
@Override
protected Category loadCategory() {
Category[] path = getCategoryPath();
if (path == null
|| path.length == 0) {
return null;
}
return path[path.length - 1];
}
@Override
protected Category[] loadCategoryPath() {
if (Subsite.getContext().hasSite()) {
Category path[] = new Category[1];
Site subsite = Subsite.getContext().getSite();
path[0] = subsite.getRootCategory();
return path;
} else {
return null;
}
}
@Override
protected Category loadRootCategory() {
if (Subsite.getContext().hasSite()) {
Site subsite = Subsite.getContext().getSite();
return subsite.getRootCategory();
} else {
return null;
}
}
}