[MOBY-guts] biomoby commit

Gary Schiltz gss at pub.open-bio.org
Mon Mar 21 21:42:02 UTC 2005


gss
Mon Mar 21 16:42:02 EST 2005
Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets
In directory pub.open-bio.org:/tmp/cvs-serv9239/src/org/semanticmoby/ref/servlets

Modified Files:
	BaseServlet.java KeywordSearchServlet.java 
Log Message:
Misc

moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets BaseServlet.java,1.1,1.2 KeywordSearchServlet.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/BaseServlet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/BaseServlet.java	2004/11/22 22:58:40	1.1
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/BaseServlet.java	2005/03/21 21:42:02	1.2
@@ -43,7 +43,7 @@
 		{
 	    	if (! log4jInitialized)
 	    	{
-		    	String path = ctx.getRealPath("/") + "log4j.properties";
+		    	String path = ctx.getRealPath("/WEB-INF/log4j.properties");
 		    	PropertyConfigurator.configure(path);
 		    	log4jInitialized = true;
 	    	}
@@ -67,17 +67,9 @@
 		out.print(title);
 		out.println("</title>");
 		out.println("</head>");
-		out.println("<center>");
-		out.println("<h1>");
-		out.println("<font face=\"serif\">");
-		out.println("<span style=\"color: rgb(51, 204, 0);\"><i>Semantic</i>");
-		out.println("<span style=\"color: blue\">M<span style=\"color: red\">" +
-				    "O<span style=\"color: blue\">B<span style=\"color: red\">Y" +
-					"<span style=\"color: black\">");
-		out.println("</font>");
-		out.println("</h1>");
-		out.println("</center>");
-		out.println("<body>");
+        out.println("<body background=\"images/pinstripe.gif\">");
+        out.println("<img src=\"images/smoby-small.gif\">");
+        out.println("<br><br>");
 		out.println("<font face=\"sans-serif\">");
 	}
 	

===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java	2004/11/22 22:58:40	1.1
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java	2005/03/21 21:42:02	1.2
@@ -43,20 +43,48 @@
 		if ((provider.isEmpty()) && (accepts.isEmpty()) && (returns.isEmpty()))
 		{
 			showResultCount(-1, out);
+            out.println("<a href=\"keyword-search?provider=*\">");
+            out.println("Show All Providers</a>");
 		}
 		else
 		{
 			KeywordQuery q = new KeywordQuery(provider, accepts, returns);
 			
-			List matching = q.findMatchingProviders();
-			
-			showResultCount(matching.size(), out);
-			
-			for (Iterator it = matching.iterator(); it.hasNext();)
-			{
-				MOBYProvider p = (MOBYProvider) it.next();
-				showProvider(p, out);
-			}
+            try
+            {
+    			List matching = q.findMatchingProviders();
+    			
+    			showResultCount(matching.size(), out);
+    			
+                if (matching.size() > 0)
+                {
+        			for (Iterator it = matching.iterator(); it.hasNext();)
+        			{
+        				MOBYProvider p = (MOBYProvider) it.next();
+        				showProvider(p, out);
+        			}
+                }
+                else
+                {
+                    // Show a link that displays all providers. This is only
+                    // temporary, to keep searchers from getting discouraged.
+                    // When there are more providers defined, showing them all
+                    // won't make sense.
+                    //
+                    out.println("<a href=\"keyword-search?provider=*\">");
+                    out.println("Show All Providers</a>");
+                }
+            }
+            catch (Exception e)
+            {
+                // Something went wrong; let the user know
+                //
+                out.println("<font color=\"red\">");
+                out.println("A server error occurred - please contact");
+                out.println("<a href=\"mailto:gss at ncgr.org\">MOBY support</a>");
+                out.println("to report the error. Thank you!");
+                out.println("</font>");
+            }
 		}
 		finishHTML(out);
     }
@@ -116,22 +144,23 @@
 		{
 			// A negative count indicates that no keywords were given.
 			//
-			out.println("No keywords were entered, so no search was performed.");
+			out.println("No keywords were entered, so no search was performed.&nbsp;");
+            out.println("To see all registered providers,<br>click the link below:");
 		}
 		else if (count == 0)
 		{
 			// Indicate that no matching providers were found, and
 			// give the user feedback as to why this might be expected.
 			//
-			out.println("No matching providers were found. <i>Note that");
-			out.println("very few providers have yet been defined.</i>");
+			out.println("No matching providers were found. To see all");
+            out.println("registered providers, click the link below:");
 		}
 		else
 		{
 			// Show how many providers were found
 			//
 			out.println(count + " matching provider" +
-					    (count > 1 ? "s" : "") + " found");
+					    (count > 1 ? "s were" : " was") + " found:");
 		}
 		out.println("</td>");
 		out.println("</tr>");
@@ -147,7 +176,7 @@
 		String uri = provider.getResource().getURI();
 		String name = provider.getName();
 		String description = provider.getOneLineDescription();
-		String moreInfo = provider.getMoreInfoURI();
+		String moreInfo = provider.getAboutURI();
 		
 		// Display a link to the Semantic MOBY engage-provider service
 		//
@@ -175,7 +204,7 @@
 		out.print("<a href=\"");
 		out.print(uri);
 		out.print("\">");
-		out.print("<img border=\"0\" src=\"images/rdf-logo.png\" alt=\"View RDF Definition\">");
+		out.print("<img border=\"0\" src=\"images/rdf-logo.gif\" alt=\"View RDF Definition\">");
 		out.print("</a>");
 		out.println("<br>");
 		




More information about the MOBY-guts mailing list