Author: ssmiweve
Date: 2008-03-14 11:08:59 +0100 (Fri, 14 Mar 2008)
New Revision: 6260

Added:
   
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/footer.jsp
   
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/head.jsp
   
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/no-hits.jsp
   
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/offsetPager.jsp
   
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/offsetPagerYahooLogo.jsp
   
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/searchbar-bottom.jsp
   
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/searchbar-top.jsp
   trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/SearchPortal.tld
   trunk/war/src/main/java/no/sesat/search/view/taglib/FindResourceTag.java
Modified:
   trunk/generic.sesam/pom.xml
   trunk/generic.sesam/sesam.com/war/src/main/conf/messages_en.properties
   trunk/generic.sesam/sesam.com/war/src/main/conf/views.xml
   trunk/generic.sesam/sesam.com/war/src/main/templates/pages/sesam.com/main.jsp
Log:
SEARCH-4302


Modified: trunk/generic.sesam/pom.xml
===================================================================
--- trunk/generic.sesam/pom.xml 2008-03-14 09:55:31 UTC (rev 6259)
+++ trunk/generic.sesam/pom.xml 2008-03-14 10:08:59 UTC (rev 6260)
@@ -42,6 +42,7 @@
       <module>search-command-control</module>
       <module>view-control</module>
       <module>velocity-directives</module>
+      <module>sesam.com</module>
     </modules>
 
     <build>

Modified: trunk/generic.sesam/sesam.com/war/src/main/conf/messages_en.properties
===================================================================
--- trunk/generic.sesam/sesam.com/war/src/main/conf/messages_en.properties      
2008-03-14 09:55:31 UTC (rev 6259)
+++ trunk/generic.sesam/sesam.com/war/src/main/conf/messages_en.properties      
2008-03-14 10:08:59 UTC (rev 6260)
@@ -1,10 +1,19 @@
+# This is the default messages bundle.
+#  When internationalising other languages you only need to override values 
that are altered.
 
+
 international_icon_alt=International search results
+logo_alt=Sesam
 atom_link=Atom
 rss_link=RSS
 international_search_results=Showing {0} - {1} of {2} results for <b>{3}</b>
 moreHitsFrom=similar hits
 goTopDomain=top of domain
+result_pages=Pages:
+noHits=No results for {0}
+noHitsPossibleReasons=
+poweredBySesat=Powered by <a href="http://sesat.no";>Sesat</a>
+poweredByYahoo=Results from Yahoo index
 
 # different file formats detected by FindFileFormatResultHandler
 fileformat_text/html=

Modified: trunk/generic.sesam/sesam.com/war/src/main/conf/views.xml
===================================================================
--- trunk/generic.sesam/sesam.com/war/src/main/conf/views.xml   2008-03-14 
09:55:31 UTC (rev 6259)
+++ trunk/generic.sesam/sesam.com/war/src/main/conf/views.xml   2008-03-14 
10:08:59 UTC (rev 6260)
@@ -34,14 +34,14 @@
             </navigation>
         </navigation>
         <layout main="sesam.com/main.jsp">
-            <!--include key="header-element" template="sesam.com/head.jsp"/>
-            <include key="top-col-one" 
template="sesam.com/searchbar-top.jsp"/-->
+            <include key="header-element" template="sesam.com/head.jsp"/>
+            <include key="top-col-one" template="sesam.com/searchbar-top.jsp"/>
             <include key="main-col-three" 
template="sesam.com/globalSearch.jsp"/>
-            <!--include key="bottom-col-one" 
template="sesam.com/offsetPager.jsp"/>
+            <include key="bottom-col-one" 
template="sesam.com/offsetPager.jsp"/>
             <include key="bottom-col-three" template="sesam.com/footer.jsp"/>
             <include key="bottom-col-two" 
template="sesam.com/searchbar-bottom.jsp"/>
             <include key="offsetPagerLogo" 
template="sesam.com/offsetPagerYahooLogo.jsp"/>          
-            <include key="no-hits" template="sesam.com/no-hits.jsp"/-->   
+            <include key="no-hits" template="sesam.com/no-hits.jsp"/>   
         </layout>
     </tab>
 </views>

Added: 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/footer.jsp
===================================================================
--- 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/footer.jsp
                          (rev 0)
+++ 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/footer.jsp
  2008-03-14 10:08:59 UTC (rev 6260)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jsp:root version="2.0"
+        xmlns:jsp="http://java.sun.com/JSP/Page";
+        xmlns:c="http://java.sun.com/jsp/jstl/core";
+        xmlns:search="urn:jsptld:/WEB-INF/SearchPortal.tld"><!-- XXX a little 
awkward since SearchPortal.tld never exists in the skin -->
+<!-- 
+ * Copyright (2008) 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/>.
+ *
+    Document   : main
+    Author     : mick
+    Version    : $Id$
+-->
+<div id="footer_help">
+    <span>&copy;2008</span>
+    <jsp:text><![CDATA[&nbsp;&nbsp;]]></jsp:text>
+    <search:boomerang key="poweredBySesat"/>
+</div>
+</jsp:root>
\ No newline at end of file

Added: 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/head.jsp
===================================================================
--- 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/head.jsp
                            (rev 0)
+++ 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/head.jsp
    2008-03-14 10:08:59 UTC (rev 6260)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jsp:root version="2.0"
+    xmlns:jsp="http://java.sun.com/JSP/Page";
+    xmlns:c="http://java.sun.com/jsp/jstl/core";
+    xmlns:search="urn:jsptld:/WEB-INF/SearchPortal.tld"><!-- XXX a little 
awkward since this never exists in the skin -->
+<!-- 
+ * Copyright (2008) 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/>.
+ *
+    Author     : mick
+    Version    : $Id$
+-->
+<title><c:if test="${not empty 
DataModel.query.utf8UrlEncoded}">${DataModel.query.xmlEscaped} - </c:if> 
Sesam</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Rss -->
+<c:set var="msg_rss_link"><search:text key="rss_link"/></c:set>
+<link rel="alternate" type="application/rss+xml" title="${msg_rss_link}" 
href=""/>
+
+<!-- Css -->
+<c:forEach var="ww" items="${tab.css}">
+    <c:set var="ww_link"><search:findResource 
url="/css/tab/${ww.id}.css"/></c:set>
+    <link rel="stylesheet" type="text/css" href="${ww_link}" media="screen"/>
+</c:forEach>
+<c:forEach var="w" items="${tab.ancestry}">
+    <c:set var="w_link"><search:findResource 
url="/css/tab/${w.id}.css"/></c:set>
+    <link rel="stylesheet" type="text/css" href="${w_link}" media="screen"/>
+</c:forEach>
+<c:set var="w_link"><search:findResource url="/css/print-style.css"/></c:set>
+<link rel="stylesheet" type="text/css" href="${w_link}" media="print"/>
+
+<!-- Page Icons -->
+<link rel="icon" href="/images/favicon.gif" type="image/x-icon" />
+<link rel="shortcut icon" href="/images/favicon.gif" type="image/x-icon" />
+
+<link rel="search" type="application/opensearchdescription+xml" 
title="Sesam.no" href="/search/?q=*&#38;c=${tab.key}&#38;output=opensearch"/>
+
+<!-- JavaScript -->
+<c:set var="js_link"><search:findResource 
url="/javascript/external/prototype.js"/></c:set>
+<script type='text/javascript' src="${js_link}"></script>
+<c:set var="js_link"><search:findResource url="/javascript/common.js"/></c:set>
+<script type='text/javascript' src="${js_link}"></script>
+
+<c:forEach var="js" items="${tab.javascript}">
+    <c:set var="js_link"><search:findResource 
url="/javascript/${js}.js"/></c:set>
+    <script type='text/javascript' src="${js_link}"></script>
+</c:forEach>
+
+</jsp:root>

Added: 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/no-hits.jsp
===================================================================
--- 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/no-hits.jsp
                         (rev 0)
+++ 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/no-hits.jsp
 2008-03-14 10:08:59 UTC (rev 6260)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jsp:root version="2.0"
+    xmlns:jsp="http://java.sun.com/JSP/Page";
+    xmlns:c="http://java.sun.com/jsp/jstl/core";
+    xmlns:search="urn:jsptld:/WEB-INF/SearchPortal.tld"><!-- XXX a little 
awkward since this never exists in the skin -->
+<!-- 
+ * Copyright (2008) 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/>.
+ *
+    Author     : mick
+    Version    : $Id$
+-->
+<div id="nohits">
+    <p><search:text key="noHits" arg0="${DataModel.query.xmlEscaped}"/></p>
+    <p><search:text key="noHitsPossibleReasons"/></p>
+</div>
+</jsp:root>
\ No newline at end of file

Added: 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/offsetPager.jsp
===================================================================
--- 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/offsetPager.jsp
                             (rev 0)
+++ 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/offsetPager.jsp
     2008-03-14 10:08:59 UTC (rev 6260)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jsp:root version="2.0"
+        xmlns:jsp="http://java.sun.com/JSP/Page";
+        xmlns:c="http://java.sun.com/jsp/jstl/core";
+        xmlns:search="urn:jsptld:/WEB-INF/SearchPortal.tld"><!-- XXX a little 
awkward since SearchPortal.tld never exists in the skin -->
+<!-- 
+ * Copyright (2008) 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/>.
+ *
+    Document   : main
+    Author     : mick
+    Version    : $Id$
+-->
+<c:set var="pages" 
value="${DataModel.navigation.navigations['offset'].results}"/>
+<c:if test="${pages.size gt 1}">
+<!-- #if ($pages.size() > 1) -->
+    <div id="offset">
+        <search:text 
key="result_pages"/><jsp:text><![CDATA[&nbsp;]]></jsp:text>
+        <ul id="offsetList">
+        <c:forEach var="page" items="${pages}">
+            <c:choose>
+                <c:when test="${page.selected}">
+                    <li class="active">${page.title}</li>
+                </c:when><c:otherwise>
+                    <c:set var="link_page"><search:boomerang url="${page.url}" 
param="category:navigation;subcategory:paging"/></c:set>                    
+                    <li><a href="${link_page}">${item.title}</a></li>
+                </c:otherwise>
+            </c:choose>
+        </c:forEach>
+        </ul>
+        <search:include template="offsetPagerLogo"/>
+    </div>
+</c:if>
+</jsp:root>
\ No newline at end of file

Added: 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/offsetPagerYahooLogo.jsp
===================================================================
--- 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/offsetPagerYahooLogo.jsp
                            (rev 0)
+++ 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/offsetPagerYahooLogo.jsp
    2008-03-14 10:08:59 UTC (rev 6260)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jsp:root version="2.0"
+        xmlns:jsp="http://java.sun.com/JSP/Page";
+        xmlns:c="http://java.sun.com/jsp/jstl/core";
+        xmlns:search="urn:jsptld:/WEB-INF/SearchPortal.tld"><!-- XXX a little 
awkward since SearchPortal.tld never exists in the skin -->
+<!-- 
+ * Copyright (2008) 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/>.
+ *
+    Document   : main
+    Author     : mick
+    Version    : $Id$
+-->
+<c:set var="img_yahooLogo"><search:findResource 
url="/images/yahoo.gif"/></c:set>
+<c:set var="msg_logo_alt"><search:text key="poweredByYahoo"/></c:set>
+<img src="${img_yahooLogo}" id="yahooSearch" alt="${msg_logo_alt}" />
+</jsp:root>
\ No newline at end of file

Added: 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/searchbar-bottom.jsp
===================================================================
--- 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/searchbar-bottom.jsp
                                (rev 0)
+++ 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/searchbar-bottom.jsp
        2008-03-14 10:08:59 UTC (rev 6260)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jsp:root version="2.0"
+        xmlns:jsp="http://java.sun.com/JSP/Page";
+        xmlns:c="http://java.sun.com/jsp/jstl/core";
+        xmlns:search="urn:jsptld:/WEB-INF/SearchPortal.tld"><!-- XXX a little 
awkward since this never exists in the skin -->
+<!-- 
+ * Copyright (2008) 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/>.
+ *
+    Author     : mick
+    Version    : $Id$
+-->
+<c:set var="link_action"><search:boomerang url="/search/" 
param="category:search;subcategory:bottom"/></c:set>
+<form name="sf" id="sf" action="${link_action}">
+    <c:set var="img_inputButton"><search:findResource 
url="/images/searchbar/search.gif"/></c:set>
+    <input type="text" id="inputBox" name="q" size="60" 
value="${DataModel.query.xmlEscaped}"/>
+    <input type="image" id="inputButton" src="${img_inputButton}"/>
+    <div class="clearEl"><jsp:text><![CDATA[&nbsp;]]></jsp:text></div>
+</form>
+</jsp:root>
\ No newline at end of file

Added: 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/searchbar-top.jsp
===================================================================
--- 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/searchbar-top.jsp
                           (rev 0)
+++ 
trunk/generic.sesam/sesam.com/war/src/main/templates/fragments/layout/sesam.com/searchbar-top.jsp
   2008-03-14 10:08:59 UTC (rev 6260)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jsp:root version="2.0"
+    xmlns:jsp="http://java.sun.com/JSP/Page";
+    xmlns:c="http://java.sun.com/jsp/jstl/core";
+    xmlns:search="urn:jsptld:/WEB-INF/SearchPortal.tld"><!-- XXX a little 
awkward since this never exists in the skin -->
+<!-- 
+ * Copyright (2008) 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/>.
+ *
+    Author     : mick
+    Version    : $Id$
+-->
+<c:set var="link_action"><search:boomerang url="/search/" 
param="category:search;subcategory:top"/></c:set>
+<form name="sf" id="sf" action="${link_action}">
+    <c:set var="link_logo"><search:boomerang url="/" 
param="category:static;subcategory:home"/></c:set>
+    <c:set var="img_logo"><search:findResource url="/images/logo.png"/></c:set>
+    <c:set var="img_inputButton"><search:findResource 
url="/images/searchbar/search.gif"/></c:set>
+    <c:set var="msg_logo_alt"><search:text key="logo_alt"/></c:set>
+    <a href="${link_logo}"><img src="${img_logo}" id="logo" width="138" 
height="38" alt="${msg_logo_alt}" /></a>
+    <input type="text" id="inputBox" name="q" size="60" 
value="${DataModel.query.xmlEscaped}" tabindex="1" />
+    <input type="image" id="inputButton" src="${img_inputButton}" tabindex="2" 
/>
+    <div class="clearEl"><jsp:text><![CDATA[&nbsp;]]></jsp:text></div>
+</form>
+</jsp:root>
\ No newline at end of file

Modified: 
trunk/generic.sesam/sesam.com/war/src/main/templates/pages/sesam.com/main.jsp
===================================================================
--- 
trunk/generic.sesam/sesam.com/war/src/main/templates/pages/sesam.com/main.jsp   
    2008-03-14 09:55:31 UTC (rev 6259)
+++ 
trunk/generic.sesam/sesam.com/war/src/main/templates/pages/sesam.com/main.jsp   
    2008-03-14 10:08:59 UTC (rev 6260)
@@ -1,8 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jsp:root version="2.0"
+<?xml version="1.0" encoding="UTF-8"?><jsp:root version="2.0"
         xmlns:jsp="http://java.sun.com/JSP/Page";
-        xmlns:search="urn:jsptld:/WEB-INF/SearchPortal.tld"><!-- XXX a little 
awkward since this never exists in the skin -->
-    <jsp:output 
+        xmlns:search="urn:jsptld:/WEB-INF/SearchPortal.tld"><!-- XXX a little 
awkward since SearchPortal.tld never exists in the skin --><jsp:output 
         doctype-root-element="html" 
         doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" 
         
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"; />

Added: 
trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/SearchPortal.tld
===================================================================
--- trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/SearchPortal.tld  
                        (rev 0)
+++ trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/SearchPortal.tld  
2008-03-14 10:08:59 UTC (rev 6260)
@@ -0,0 +1 @@
+link ../../../../../../../war/src/main/webapp/WEB-INF/SearchPortal.tld
\ No newline at end of file


Property changes on: 
trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/SearchPortal.tld
___________________________________________________________________
Name: svn:special
   + *

Added: trunk/war/src/main/java/no/sesat/search/view/taglib/FindResourceTag.java
===================================================================
--- trunk/war/src/main/java/no/sesat/search/view/taglib/FindResourceTag.java    
                        (rev 0)
+++ trunk/war/src/main/java/no/sesat/search/view/taglib/FindResourceTag.java    
2008-03-14 10:08:59 UTC (rev 6260)
@@ -0,0 +1,81 @@
+/* Copyright (2008) 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/>.
+ *
+ *
+ * FindResourceTag.java
+ */
+
+package no.sesat.search.view.taglib;
+
+import java.io.IOException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.tagext.JspFragment;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import no.sesat.search.datamodel.DataModel;
+import no.sesat.search.result.HitCount;
+import no.sesat.search.site.Site;
+import no.sesat.search.view.FindResource;
+
+/** SimpleTagSupport around the FindResource utility class.
+ *
+ * @author  <a href="mailto:[EMAIL PROTECTED]">Michael Semb Wever</a>
+ * @version $Id$
+ */
+public final class FindResourceTag extends SimpleTagSupport {
+    
+    private String url;
+    
+
+    /**
+    * Called by the container to invoke this tag. 
+    * The implementation of this method is provided by the tag library 
developer,
+    * and handles all tag processing, body iteration, etc.
+     * @throws javax.servlet.jsp.JspException 
+     */
+    @Override
+    public void doTag() throws JspException {
+        
+        final PageContext cxt = (PageContext) getJspContext();
+        final JspWriter out = cxt.getOut();
+
+        try {
+
+            final JspFragment f = getJspBody();
+            if (f != null){
+                f.invoke(out);
+            }
+
+            final DataModel datamodel = (DataModel) 
cxt.findAttribute(DataModel.KEY);
+            final Site site = datamodel.getSite().getSite();
+            
+            out.print(FindResource.find(site, url));
+
+        }catch(IOException e){
+            throw new JspException(e);
+        }
+
+    }
+
+    /**
+     * 
+     * @param url
+     */
+    public void setUrl(final String url) {
+        this.url = url;
+    }
+}
\ No newline at end of file


Property changes on: 
trunk/war/src/main/java/no/sesat/search/view/taglib/FindResourceTag.java
___________________________________________________________________
Name: svn:keywords
   + Id

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

Reply via email to