Author: gttersen
Date: 2007-05-08 20:21:23 +0200 (Tue, 08 May 2007)
New Revision: 5020

Modified:
   
branches/2.12/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/NewsEspSearchCommand.java
   
branches/2.12/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/NavigationCommandConfig.java
   branches/2.12/war/src/webapp/WEB-INF/jsp/decorators/httpDecorator.jsp
Log:
NewsAggregator changes

Modified: 
branches/2.12/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/NewsEspSearchCommand.java
===================================================================
--- 
branches/2.12/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/NewsEspSearchCommand.java
    2007-05-08 14:54:07 UTC (rev 5019)
+++ 
branches/2.12/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/NewsEspSearchCommand.java
    2007-05-08 18:21:23 UTC (rev 5020)
@@ -18,6 +18,8 @@
 import no.schibstedsok.searchportal.query.NotClause;
 import no.schibstedsok.searchportal.query.OperationClause;
 import no.schibstedsok.searchportal.query.OrClause;
+import no.schibstedsok.searchportal.query.Visitor;
+import no.schibstedsok.searchportal.query.XorClause;
 import no.schibstedsok.searchportal.result.BasicSearchResult;
 import no.schibstedsok.searchportal.result.BasicSearchResultItem;
 import no.schibstedsok.searchportal.result.FastSearchResult;
@@ -113,7 +115,7 @@
 
     @Override
     protected void visitImpl(final Object clause) {
-        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause));
+        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause) + ", rootClause=" + 
getQuery().getRootClause());
         super.visitImpl(clause);
         if (clause instanceof Clause) {
             addMedium((Clause) clause);
@@ -121,7 +123,7 @@
     }
 
     protected void visitImpl(final Clause clause) {
-        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause));
+        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause) + ", rootClause=" + 
getQuery().getRootClause());
         super.visitImpl(clause);
         addMedium(clause);
     }
@@ -129,54 +131,62 @@
 
     @Override
     protected void visitImpl(final LeafClause clause) {
-        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause));
+        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause) + ", rootClause=" + 
getQuery().getRootClause());
         super.visitImpl(clause);
         addMedium(clause);
     }
 
     @Override
     protected void visitImpl(final OperationClause clause) {
-        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause));
+        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause) + ", rootClause=" + 
getQuery().getRootClause());
         super.visitImpl(clause);
         addMedium(clause);
     }
 
     @Override
     protected void visitImpl(final AndClause clause) {
-        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause));
+        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause) + ", rootClause=" + 
getQuery().getRootClause());
         super.visitImpl(clause);
         addMedium(clause);
     }
 
     @Override
     protected void visitImpl(final OrClause clause) {
-        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause));
+        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause) + ", rootClause=" + 
getQuery().getRootClause());
         super.visitImpl(clause);
         addMedium(clause);
     }
 
     @Override
     protected void visitImpl(final DefaultOperatorClause clause) {
-        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause));
+        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause) + ", rootClause=" + 
getQuery().getRootClause());
         super.visitImpl(clause);
         addMedium(clause);
     }
 
     @Override
     protected void visitImpl(final NotClause clause) {
-        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause));
+        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause) + ", rootClause=" + 
getQuery().getRootClause());
         super.visitImpl(clause);
         addMedium(clause);
     }
 
     @Override
     protected void visitImpl(final AndNotClause clause) {
-        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause));
+        LOG.debug("Visiting me with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause) + ", rootClause=" + 
getQuery().getRootClause());
         super.visitImpl(clause);
         addMedium(clause);
     }
 
+
     @Override
+    protected void visitXorClause(final Visitor visitor, final XorClause 
clause) {
+        LOG.debug("Visit xorClause called with: " + clause + ", isroot=" + 
(getQuery().getRootClause() == clause) + ", rootClause=" + 
getQuery().getRootClause());
+        super.visitXorClause(visitor, clause);
+        addMedium(clause);
+    }
+
+    @Override
     public NewsEspCommandConfig getSearchConfiguration() {
         return (NewsEspCommandConfig) super.getSearchConfiguration();
     }

Modified: 
branches/2.12/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/NavigationCommandConfig.java
===================================================================
--- 
branches/2.12/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/NavigationCommandConfig.java
 2007-05-08 14:54:07 UTC (rev 5019)
+++ 
branches/2.12/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/NavigationCommandConfig.java
 2007-05-08 18:21:23 UTC (rev 5020)
@@ -137,12 +137,7 @@
             final List<Element> navElements = 
getDirectChildren(navigationElement, NAV_ELEMENT);
             navList = new ArrayList<Nav>(navElements.size());
             this.navMap = new HashMap<String, Nav>();
-            for (Element navElement : navElements) {
-                Nav nav = new Nav(this, navElement);
-                navList.add(nav);
-                updateNavMap(nav, navMap);
-                updateNavMap(nav, this.navMap);
-            }
+            addNavElements(navElements, navMap);
             final List<Element> resetNavElements = 
getDirectChildren(navigationElement, RESET_NAV_ELEMENT);
             resetNavSet = new HashSet<String>(resetNavElements.size());
             for (Element resetNavElement : resetNavElements) {
@@ -153,6 +148,19 @@
             }
         }
 
+        private void addNavElements(List<Element> navElements, HashMap<String, 
Nav> navMap) {
+            for (Element navElement : navElements) {
+                Nav nav = new Nav(this, navElement);
+                navList.add(nav);
+                updateNavMap(nav, navMap);
+                updateNavMap(nav, this.navMap);
+                List<Element> childNavElements = getDirectChildren(navElement, 
NAV_ELEMENT);
+                if (childNavElements.size() > 0) {
+                    addNavElements(childNavElements, navMap);
+                }
+            }
+        }
+
         private void updateNavMap(Nav nav, HashMap<String, Nav> navMap) {
             navMap.put(nav.getId(), nav);
             if (nav.getChildNavs() != null && nav.getChildNavs().size() > 0) {

Modified: branches/2.12/war/src/webapp/WEB-INF/jsp/decorators/httpDecorator.jsp
===================================================================
--- branches/2.12/war/src/webapp/WEB-INF/jsp/decorators/httpDecorator.jsp       
2007-05-08 14:54:07 UTC (rev 5019)
+++ branches/2.12/war/src/webapp/WEB-INF/jsp/decorators/httpDecorator.jsp       
2007-05-08 18:21:23 UTC (rev 5020)
@@ -10,105 +10,107 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
 <html>
-    <head>
-        <search:velocity template="/fragments/head"/>
-    </head>
+<head>
+    <search:velocity template="/fragments/head"/>
+</head>
 
-    <body onload="SesamInit.onLoad('<c:out value="${tab.key}"/>', '<c:out 
value="${vertikal}"/>', '<c:out value="${datamodel.query.xmlEscaped}"/>', 
<c:out value="${null != page}"/>);">
-        <%-- This is the real thing. The new templating system all should use. 
--%>
+<body onload="SesamInit.onLoad('<c:out value="${tab.key}"/>', '<c:out 
value="${vertikal}"/>', '<c:out value="${datamodel.query.xmlEscaped}"/>', 
<c:out value="${null != page}"/>);">
+<%-- This is the real thing. The new templating system all should use. --%>
 
 
-               
-        <% // If velocity debug is turned on, display developer bar . 
-           // TODO Move to wanted place or add show/hide function to the 
developerbar
-          if("true".equals(System.getProperty("VELOCITY_DEBUG")) && 
!"true".equals(System.getProperty("VELOCITY_DEVELOPERBAR_HIDDEN"))) {
-            String loadPath = 
System.getProperty("VELOCITY_DEBUG_TEMPLATE_DIR");
-            if(loadPath == null) {
-              loadPath = "(URLResourceLoader)";
-            }
-            %>
-            <%
-                boolean VELOCITY_DEBUG_ON = 
"true".equals(System.getProperty("VELOCITY_DEBUG_ON"));
-                String background =  "#DDDDDD";
-                String color = "black";
-                String linkText = VELOCITY_DEBUG_ON ? "Off" : "On";
-            %>
+<% // If velocity debug is turned on, display developer bar .
+    // TODO Move to wanted place or add show/hide function to the developerbar
+    if ("true".equals(System.getProperty("VELOCITY_DEBUG")) && 
!"true".equals(System.getProperty("VELOCITY_DEVELOPERBAR_HIDDEN"))) {
+        String loadPath = System.getProperty("VELOCITY_DEBUG_TEMPLATE_DIR");
+        if (loadPath == null) {
+            loadPath = "(URLResourceLoader)";
+        }
+%>
+<%
+    boolean VELOCITY_DEBUG_ON = 
"true".equals(System.getProperty("VELOCITY_DEBUG_ON"));
+    String background = "#DDDDDD";
+    String color = "black";
+    String linkText = VELOCITY_DEBUG_ON ? "Off" : "On";
+%>
 
-            <div width="100%" 
style="font-size:12px;background-color:<%=background%>;border:1px solid 
#C0C0C0; color:<%=color%>">
-                DeveloperBar:
-                VelocityDebug: <a style="color: blue" 
href="/servlet/VelocityDebug?<%= request.getQueryString()%>"> <%= linkText %> 
</a>
-                |
-                TemplatePath:  <%= loadPath %> 
-                </div> 
-              </font>
-            </div>
-            <%
-          }
-        %>
+<div width="100%" 
style="font-size:12px;background-color:<%=background%>;border:1px solid 
#C0C0C0; color:<%=color%>">
+    DeveloperBar:
+    VelocityDebug: <a style="color: blue" href="/servlet/VelocityDebug?<%= 
request.getQueryString()%>"><%= linkText %>
+</a>
+    |
+    TemplatePath:  <%= loadPath %>
+</div>
+</font>
+</div>
+<%
+    }
+%>
 
-        <search:include include="topBar"/>
-        <search:include include="header"/>
+<search:include include="topBar"/>
+<search:include include="header"/>
 
-        <table cellspacing="0" cellpadding="0" id="body_table">
-            <tr>
-                <c:choose>
-                    <c:when test="${tab.layout.properties['left-column-hide'] 
== 'true'}">
-                        <td valign="top" colspan="3">
-                    </c:when>
-                    <c:otherwise>
-                        <td class="cell_one" valign="top">
-                            <search:include include="left-col-one"/>
+<table cellspacing="0" cellpadding="0" id="body_table">
+    <tr>
+        <c:choose>
+        <c:when test="${tab.layout.properties['left-column-hide'] == 'true'}">
+        <td valign="top" colspan="3">
+            </c:when>
+            <c:otherwise>
+        <td class="cell_one" valign="top">
+            <search:include include="left-col-one"/>
 
-                            <search:include include="left-col-two"/>
+            <search:include include="left-col-two"/>
 
-                            <search:include include="left-col-three"/>
+            <search:include include="left-col-three"/>
 
-                            <c:if test="${tab.showRss}">
-                                <search:include include="left-col-four"/>
-                            </c:if>
-                        </td>
-                        <td class="cell_three" valign="top" colspan="2">
-                    </c:otherwise>
-                </c:choose>
+            <c:if test="${tab.showRss}">
+                <search:include include="left-col-four"/>
+            </c:if>
 
-                <search:include include="middle-col-one"/>
+            <search:include include="left-col-five"/>
+        </td>
+        <td class="cell_three" valign="top" colspan="2">
+            </c:otherwise>
+            </c:choose>
 
-                <search:include include="spellcheck"/>
-                <search:include include="middle-col-two"/>
-                <search:include include="middle-col-three"/>
-                <search:include include="middle-col-four"/>
-                <search:include include="middle-col-five"/>
+            <search:include include="middle-col-one"/>
 
-                </td>
-                <td class="cell_four">
-                    <search:include include="right-col-one"/>
-                    <search:include include="right-col-two"/>
-                </td>
-            </tr>
-            <search:include include="bottom-ads"/>
-            <c:if test="${tab.layout.properties['offset-pager-hide'] != 
'true'}">
-                <tr>
-                    <td>&nbsp;</td>
-                    <td colspan="2">
-                        <search:include include="offsetPager"/>
-                    </td>
-                </tr>
-            </c:if>
-            <c:if test="${tab.layout.properties['top3-ads-bottom-hide'] != 
'true'}">
-                <tr>
-                    <td>&nbsp;</td>
-                    <td>
-                        <search:include include="top3-ads-bottom"/>
-                    </td>
-                    <td>&nbsp;</td>
-                </tr>
-            </c:if>
-        </table>
-        <search:include include="verbosePager"/>
-        <search:include include="footer"/>
+            <search:include include="spellcheck"/>
+            <search:include include="middle-col-two"/>
+            <search:include include="middle-col-three"/>
+            <search:include include="middle-col-four"/>
+            <search:include include="middle-col-five"/>
 
-        <search:include include="map-script"/>
+        </td>
+        <td class="cell_four">
+            <search:include include="right-col-one"/>
+            <search:include include="right-col-two"/>
+        </td>
+    </tr>
+    <search:include include="bottom-ads"/>
+    <c:if test="${tab.layout.properties['offset-pager-hide'] != 'true'}">
+        <tr>
+            <td>&nbsp;</td>
+            <td colspan="2">
+                <search:include include="offsetPager"/>
+            </td>
+        </tr>
+    </c:if>
+    <c:if test="${tab.layout.properties['top3-ads-bottom-hide'] != 'true'}">
+        <tr>
+            <td>&nbsp;</td>
+            <td>
+                <search:include include="top3-ads-bottom"/>
+            </td>
+            <td>&nbsp;</td>
+        </tr>
+    </c:if>
+</table>
+<search:include include="verbosePager"/>
+<search:include include="footer"/>
 
-        <search:include include="gallup" />
-    </body>
+<search:include include="map-script"/>
+
+<search:include include="gallup"/>
+</body>
 </html>

_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits

Reply via email to