From: <hs...@us...> - 2011-06-02 17:24:12
|
Revision: 895 http://treebase.svn.sourceforge.net/treebase/?rev=895&view=rev Author: hshyket Date: 2011-06-02 15:58:44 +0000 (Thu, 02 Jun 2011) Log Message: ----------- Adding in meta tags so that Google, Yahoo! and Bing can verify the site through their webmaster tools. Adding in functionality to generate a sitemap.xml so that the bots can index the submissions. Modified Paths: -------------- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml trunk/treebase-web/src/main/webapp/WEB-INF/web.xml trunk/treebase-web/src/main/webapp/common/meta.jsp Added Paths: ----------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java 2011-06-02 15:58:44 UTC (rev 895) @@ -0,0 +1,55 @@ + + + +package org.cipres.treebase.web.controllers; + + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.cipres.treebase.domain.study.Submission; +import org.cipres.treebase.domain.study.SubmissionService; + +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.mvc.Controller; + + + +/** + * @author mjd 20080701 + */ +public class SiteMapController implements Controller{ + /** + * Logger for this class + */ + //private static final Logger LOGGER = Logger.getLogger(SearchController.class); + private SubmissionService mSubmissionService; + + public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) + throws Exception { + + List<String> phyloURL = new ArrayList<String>(); + + Collection<Submission> submissions = mSubmissionService.findPublishedSubmissions(); + + for ( Submission submission : submissions ) { + phyloURL.add(submission.getStudy().getPhyloWSPath().getPurl().toString()); + } + + return new ModelAndView("sitemap", "phyloURL", phyloURL); + } + + public SubmissionService getSubmissionService() { + return mSubmissionService; + } + + public void setSubmissionService(SubmissionService pNewSubmissionService) { + mSubmissionService = pNewSubmissionService; + } +} + + Added: trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp (rev 0) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp 2011-06-02 15:58:44 UTC (rev 895) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<%@ include file="/common/taglibs.jsp"%> +<% response.setContentType("application/xml; charset=UTF-8"); %> +<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> + <c:forEach var="url" items="${phyloURL}" varStatus="status"> + <url> + <loc><c:out value="${url}"/>?format=html</loc> + </url> + </c:forEach> +</urlset> \ No newline at end of file Modified: trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-06-01 18:47:29 UTC (rev 894) +++ trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-06-02 15:58:44 UTC (rev 895) @@ -190,6 +190,11 @@ <property name="submissionService"><ref bean="submissionService"></ref></property> </bean> + <!-- View SiteMap --> + <bean id="siteMapController" class="org.cipres.treebase.web.controllers.SiteMapController"> + <property name="submissionService"><ref bean="submissionService"></ref></property> + </bean> + <!-- View Taxa --> <bean id="listTaxaController" class="org.cipres.treebase.web.controllers.ListTaxaController"> <property name="studyService"><ref bean="studyService"></ref></property> @@ -1040,8 +1045,10 @@ <prop key="/search/downloadAMatrix.html">downloadAMatrixController</prop> <prop key="/search/downloadAnAnalysisStep.html">downloadAnAnalysisStepController</prop> <prop key="/search/downloadANexusFile.html">downloadANexusFileController</prop> - <prop key="/search/downloadANexusRCTFile.html">downloadANexusRCTFileController</prop> + <prop key="/search/downloadANexusRCTFile.html">downloadANexusRCTFileController</prop> + <prop key="/sitemap.xml">siteMapController</prop> + <!-- SUBMISSION SECTION --> <prop key="/user/updateProfile.html">userFormController</prop> <prop key="/user/submissionList.html">listSubmissionController</prop> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2011-06-01 18:47:29 UTC (rev 894) +++ trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2011-06-02 15:58:44 UTC (rev 895) @@ -276,6 +276,10 @@ </servlet-mapping> <servlet-mapping> <servlet-name>treebase</servlet-name> + <url-pattern>*.xml</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>treebase</servlet-name> <url-pattern>*.rdf</url-pattern> </servlet-mapping> <servlet-mapping> Modified: trunk/treebase-web/src/main/webapp/common/meta.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/common/meta.jsp 2011-06-01 18:47:29 UTC (rev 894) +++ trunk/treebase-web/src/main/webapp/common/meta.jsp 2011-06-02 15:58:44 UTC (rev 895) @@ -6,6 +6,9 @@ <meta http-equiv="Expires" content="0"/> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <meta name="author" content="Rutger A. Vos (rut...@gm...)"/> +<meta name="google-site-verification" content="9Lr7BwyD6VMDIk5dENnSt_2YsUdpq_aEhnee0mMTxrw" /> +<META name="y_key" content="8c736195266b5ebb" /> +<meta name="msvalidate.01" content="D931446190993D0D2D719F2978AC44EB" /> <link rel="icon" href="<c:url value="/images/favicon.ico"/>"/> <% String ua = request.getHeader( "User-Agent" ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |