Author: ssmiweve
Date: 2008-01-16 17:40:13 +0100 (Wed, 16 Jan 2008)
New Revision: 5974
Removed:
trunk/view-control-spi/src/main/java/no/sesat/search/view/navigation/NavigationHelper.java
Modified:
trunk/core-api/src/main/java/no/sesat/search/view/velocity/VelocityEngineFactory.java
Log:
NavigationHelper no longer used. everything is new Navigation model.
Modified:
trunk/core-api/src/main/java/no/sesat/search/view/velocity/VelocityEngineFactory.java
===================================================================
---
trunk/core-api/src/main/java/no/sesat/search/view/velocity/VelocityEngineFactory.java
2008-01-16 14:24:52 UTC (rev 5973)
+++
trunk/core-api/src/main/java/no/sesat/search/view/velocity/VelocityEngineFactory.java
2008-01-16 16:40:13 UTC (rev 5974)
@@ -37,7 +37,6 @@
import no.sesat.search.site.SiteKeyedFactory;
import no.sesat.search.site.config.*;
import no.sesat.search.result.Decoder;
-import no.sesat.search.view.navigation.NavigationHelper;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.velocity.Template;
@@ -134,8 +133,6 @@
context.put("math", new MathTool());
// date tool
context.put("date", new DateTool());
- // navigation helper
- context.put("navigationHelper", new NavigationHelper());
// boomerang
context.put("boomerang", new Boomerang());
Deleted:
trunk/view-control-spi/src/main/java/no/sesat/search/view/navigation/NavigationHelper.java
===================================================================
---
trunk/view-control-spi/src/main/java/no/sesat/search/view/navigation/NavigationHelper.java
2008-01-16 14:24:52 UTC (rev 5973)
+++
trunk/view-control-spi/src/main/java/no/sesat/search/view/navigation/NavigationHelper.java
2008-01-16 16:40:13 UTC (rev 5974)
@@ -1,104 +0,0 @@
-/* Copyright (2007) Schibsted Søk AS
- * This file is part of SESAT.
- *
- * SESAT is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published
by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * SESAT 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with SESAT. If not, see <http://www.gnu.org/licenses/>.
- *
- * NavigationHelper.java
- *
- * Created on 12/06/2007, 17:13:43
- *
- */
-
-package no.sesat.search.view.navigation;
-
-import no.sesat.search.datamodel.DataModel;
-import no.sesat.search.result.BasicNavigationItem;
-import no.sesat.search.result.NavigationItem;
-import org.apache.log4j.Logger;
-
-/**
- * All public methods require take a datamodel argument. This datamodel must
in VIEW_CONSTRUCTION state.
- * It essentially means that this helper class can only be used from
jsp/velocity code.
- *
- * @author Geir H. Pettersen(T-Rank)
- * @author mick
- * @version $Id$
- *
- *
- * @deprecated This class will be removed.
- */
-public final class NavigationHelper {
-
- // Constants -----------------------------------------------------
- public static String removeQuery(final String url) {
- return url.replaceAll("(&)?q=[^&]*", "");
- }
-
- /**
- * @todo move into domain? (NavigationItem & BasicNavigationItem)
- */
- public static NavigationConfig.Nav getFirstNotSelected(DataModel dm,
NavigationConfig.Nav nav) {
-
- if (dm.getParameters().getValue(nav.getId()) != null
- && !nav.getChildNavs().isEmpty()
- && !nav.getChildNavs().get(0).isVirtual()) {
-
- return getFirstNotSelected(dm, nav.getChildNavs().get(0));
-
- } else {
-
- final int navResultSize = null != nav.getId()
- && null != dm.getNavigation().getNavigation(nav.getId())
- && null !=
dm.getNavigation().getNavigation(nav.getId()).getResults()
- ?
dm.getNavigation().getNavigation(nav.getId()).getResults().size()
- : 0;
-
-// TODO: Specification is a mess, so this becomes ugly. See history in
prio-198 & SEARCH-3320.
-// TODO: Haven't found a general way to solve this. Special case for Oslo.
-// TODO: New JIRA created to resolve this: SEARCH-3451
-// return 1 == navResultSize && !nav.getChildNavs().isEmpty()
-// ? getFirstNotSelected(dm, nav.getChildNavs().get(0))
-// : nav;
-
-
- return 1 == navResultSize && !nav.getChildNavs().isEmpty() &&
(nav.isAutoNavigation() || isOslo(dm, nav))
- ? getFirstNotSelected(dm, nav.getChildNavs().get(0))
- : nav;
- }
- }
-
- public static NavigationItem getSingleNavigationItem(DataModel dm, final
String navId, final String value) {
- final NavigationItem item = dm.getNavigation().getNavigation(navId);
-
- if (item != null && item.getChildByTitle(value) != null) {
-
- return item.getChildByTitle(value);
- } else {
- final BasicNavigationItem navigationItem = new
BasicNavigationItem();
-
- navigationItem.setHitCount(0);
- navigationItem.setTitle(value);
-
- return navigationItem;
- }
- }
-
- public String getResetUrl(final DataModel dm, final String navId) {
- return dm.getNavigation().getNavigation("reset_" + navId).getUrl();
- }
-
- private static boolean isOslo(DataModel dm, NavigationConfig.Nav nav) {
- return
dm.getNavigation().getNavigation(nav.getId()).getResults().get(0).getTitle().equalsIgnoreCase("oslo");
- }
-}
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits