[MOBY-guts] biomoby commit
Gary Schlitz
gss at pub.open-bio.org
Thu Jun 17 17:37:58 UTC 2004
gss
Thu Jun 17 13:37:58 EDT 2004
Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/servlets/dev
In directory pub.open-bio.org:/tmp/cvs-serv25539/S-MOBY/ref-impl/server/src/org/smoby/ref/servlets/dev
Modified Files:
ProviderListServlet.java
Log Message:
Since only global model saved, iterate over its rdf:type moby:Provider statements
moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/servlets/dev ProviderListServlet.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/servlets/dev/ProviderListServlet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/servlets/dev/ProviderListServlet.java 2004/06/14 20:59:36 1.3
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/servlets/dev/ProviderListServlet.java 2004/06/17 17:37:57 1.4
@@ -1,12 +1,10 @@
package org.smoby.ref.servlets.dev;
-import org.smoby.servlet.*;
-import org.smoby.tools.*;
-import org.smoby.ref.servlets.BaseServlet;
+import org.smoby.vocabulary.*;
+import org.smoby.ref.servlets.*;
import org.smoby.ref.tools.db.*;
-import org.smoby.ref.tools.*;
-
import com.hp.hpl.jena.rdf.model.*;
+import com.hp.hpl.jena.vocabulary.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
@@ -22,23 +20,19 @@
try
{
- boolean showContents = (request.getParameter("show-contents") != null);
- String globalModelName = MOBYProperties.getProperty("DB_REPOSITORY_NAME", true);
- ModelMaker maker = manager.getModelMaker();
+ Model dbModel = manager.openDBModel();
int count = 0;
- for (Iterator it = maker.listModels(); it.hasNext();) {
- String modelName = it.next().toString();
- if (! modelName.equals(globalModelName)) {
- count++;
- if (showContents) {
- Model model = maker.openModel(modelName);
- model.write(out, "RDF/XML-ABBREV");
- model.close();
- } else {
- out.println(modelName);
- }
- }
+ StmtIterator it = dbModel.listStatements(
+ null, RDF.type, MOBY.Provider);
+
+ while (it.hasNext()) {
+ Statement stmt = it.nextStatement();
+ out.println(stmt.getSubject().getURI());
+ count++;
}
+
+ dbModel.close();
+
if (count < 1) {
out.println("No providers are defined");
}
@@ -46,8 +40,5 @@
catch (StorageException e) {
throw new ServletException(e);
}
- catch (MissingPropertyException e) {
- throw new ServletException(e);
- }
}
}
\ No newline at end of file
More information about the MOBY-guts
mailing list