From gss at pub.open-bio.org Thu Oct 6 13:55:16 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Oct 6 14:45:54 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510061755.j96HtGQo009624@pub.open-bio.org> gss Thu Oct 6 13:55:16 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv9598/src/org/semanticmoby/graph Modified Files: MOBYMappingElement.java Log Message: Added getPropValStmt() methods moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph MOBYMappingElement.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.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/core/src/org/semanticmoby/graph/MOBYMappingElement.java 2005/09/14 22:06:10 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.java 2005/10/06 17:55:16 1.4 @@ -52,6 +52,30 @@ { return propValStmts; } + + /** + * Returns the MOBYPropValStmt that represents an RDF property + */ + public MOBYPropValStmt getPropValStmt(String propURI) { + MOBYPropValStmt pvStmt = null; + for (Iterator it = propValStmts.iterator(); + it.hasNext() && (pvStmt == null);) + { + MOBYPropValStmt stmt = (MOBYPropValStmt) it.next(); + String uri = stmt.getDefiningStmt().getPredicate().getURI(); + if (uri.equals(propURI)) { + pvStmt = stmt; + } + } + return pvStmt; + } + + /** + * Returns the MOBYPropValStmt that represents a given RDF property + */ + public MOBYPropValStmt getPropValStmt(Property prop) { + return getPropValStmt(prop.getURI()); + } /** * Returns the collection of mappings that are nested within this From gss at pub.open-bio.org Thu Oct 6 13:58:10 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Oct 6 14:48:24 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510061758.j96HwAaQ009673@pub.open-bio.org> gss Thu Oct 6 13:58:10 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv9648/src/org/semanticmoby/graph Modified Files: MOBYPropValStmt.java Log Message: Added another constructor moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph MOBYPropValStmt.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYPropValStmt.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/core/src/org/semanticmoby/graph/MOBYPropValStmt.java 2005/09/14 22:06:10 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYPropValStmt.java 2005/10/06 17:58:10 1.2 @@ -7,7 +7,7 @@ * of a property that is a subclass of moby:Property */ public class MOBYPropValStmt extends MOBYGraphNode -{ +{ /** * Constructs an instance from an existing model and statement; called * from parsing code @@ -18,18 +18,26 @@ } /** + * Creates an instance from scratch; the defining statement has + * the given resource as its subject, the given property as its + * predicate, and a blank node as its object. + */ + public MOBYPropValStmt(Model jenaModel, Resource subject, Property property) + { + super(jenaModel, + jenaModel.createStatement( + subject, property, jenaModel.createResource())); + } + + /** * Constructs an instance from scratch; the defining statement has * the given resource as its subject, a property with the given URI * as its predicate, and a blank node as its object. */ - public MOBYPropValStmt(Model jenaModel, Resource resource, - String propertyURI) + public MOBYPropValStmt(Model jenaModel, Resource subject, + String propertyURI) { - super(jenaModel, - jenaModel.createStatement( - resource, - jenaModel.createProperty(propertyURI), - jenaModel.createResource())); + this(jenaModel, subject, jenaModel.createProperty(propertyURI)); } /* From gss at pub.open-bio.org Thu Oct 6 13:59:43 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Oct 6 14:49:56 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510061759.j96HxhGk009720@pub.open-bio.org> gss Thu Oct 6 13:59:43 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/tools In directory pub.open-bio.org:/tmp/cvs-serv9695/src/org/semanticmoby/tools Modified Files: Util.java Log Message: Added reachableStatements() method moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/tools Util.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/tools/Util.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/core/src/org/semanticmoby/tools/Util.java 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/tools/Util.java 2005/10/06 17:59:43 1.2 @@ -43,6 +43,12 @@ return model; } + public static Model reachableStmts(Model source, Resource subject, String uri) { + Model newModel = newJenaModel(); + addReachableStmts(source, newModel, subject, uri); + return newModel; + } + public static void addReachableStmts( Model source, Model dest, Resource subject, String uri) { @@ -60,7 +66,7 @@ dest.add(dest.createStatement( stmt.getSubject(), stmt.getPredicate(), stmt.getObject())); - // If the object of the statement is a blank node or a + // If the object of the statement is a blank node, or a // resource whose URI starts with the provider URI, then // recursively add the statements that are reachable // from the object @@ -68,7 +74,10 @@ if (stmt.getObject().canAs(Resource.class)) { Resource object = (Resource) stmt.getObject().as(Resource.class); - if (object.isAnon() || (uri != null && object.getURI().startsWith(uri))) { + if ((object.isAnon()) || + (uri == null) || + (object.getURI().startsWith(uri))) + { addReachableStmts(source, dest, object, uri); } } From gss at pub.open-bio.org Thu Oct 6 14:15:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Oct 6 15:05:38 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510061815.j96IF5LP009784@pub.open-bio.org> gss Thu Oct 6 14:15:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv9759/src/org/semanticmoby/parser Modified Files: Parser.java Log Message: Fixe a few more bugs moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser Parser.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.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/core/src/org/semanticmoby/parser/Parser.java 2005/09/14 22:06:10 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/10/06 18:15:05 1.4 @@ -190,9 +190,9 @@ Resource headResource = typeStmt.getSubject(); Model model = headResource.getModel(); - - // First parse the scalar properties + // First parse the literal properties + // Statement nameStmt = model.getProperty(headResource, MOBY.name); @@ -204,9 +204,12 @@ // A service can have multiple operatesOn properties, each of // which leads to a subgraph. Parse each of these subgraphs. + // Map operatesOn = new HashMap(); - StmtIterator it = - model.listStatements(headResource, MOBY.operatesOn, (RDFNode) null); + + StmtIterator it = model.listStatements( + headResource, MOBY.operatesOn, (RDFNode) null); + while (it.hasNext()) { Statement operatesOnStmt = it.nextStatement(); @@ -237,6 +240,7 @@ if (isGraph(res)) { // Throw an exception if it is also a data structure + // if (isDataStructure(res)) { throw new NonCanonicalException( @@ -245,22 +249,24 @@ } // The defining statement for the MOBYGraph instance + // Statement typeStmt = model.listStatements( res, RDF.type, MOBY.Graph).nextStatement(); - - // The statement that asserts the hasMapping property + + // Since the resource is a MOBY Graph, it should have exactly one + // hasMapping property that leads to its mapping subgraph. + // Statement hasMappingStmt = model.listStatements( res, MOBY.hasMapping, (RDFNode) null).nextStatement(); - // Since the resource is a MOBY Graph, it should have exactly one - // hasMapping property that leads to its mapping subgraph. - Resource hasMapping = getResourcePropertyValue(res, MOBY.hasMapping); + Resource hasMappingObject = (Resource) hasMappingStmt.getObject(); return new MOBYGraph(model, typeStmt, hasMappingStmt, - parseHasMapping(hasMapping)); + parseHasMapping(hasMappingObject)); } else { // Throw an exception if it is also a graph + // if (isGraph(res)) { throw new NonCanonicalException( @@ -272,6 +278,7 @@ // data structure. Iterate through the data structure elements, // parsing a mapping subgraph from each by recursively calling // this method. + // Iterator it = iteratorFor(res); List subgraphs = new ArrayList(); while (it.hasNext()) @@ -282,6 +289,7 @@ // Create and return a collection of the subgraphs; the type // of the collection depends on the type of the passed resource + // return collectionFor(res, subgraphs); } } @@ -301,6 +309,7 @@ // It is *not* legal for the object of a hasMapping to be *neither* // a Subject nor a data structure, so throw an exception if this is // the case. + // if ((! isSubject(res)) && (! isDataStructure(res))) { throw new NonCanonicalException( @@ -310,18 +319,22 @@ // Collect the properties of this subject that are // meant to be filled in by the client + // List propValStmts = mobyPropertyStatementsOf(res); // List of direct mappings, i.e. those related through hasMapping // properties. + // Map directMappings = new HashMap(); // List of nested hasMapping subgraphs + // List nestedMappings = new ArrayList(); // The statement that asserts this to be of rdf:type moby:Subject. // Since it is legal for this to not be a Subject, then the statement // can be null + // Statement typeStmt = null; if (isSubject(res)) @@ -331,14 +344,17 @@ // The resource is a MOBY Subject, so should have one or more // mapsTo properties that lead to its mapped subgraphs. + // List mapsTo = new ArrayList(); + StmtIterator it = model.listStatements(res, MOBY.mapsTo, (RDFNode) null); + while (it.hasNext()) { Statement mapsToStmt = it.nextStatement(); - Resource mapsToSubject = mapsToStmt.getResource(); - MOBYGraphNode object = parseMapsTo(mapsToSubject); + Resource mapsToObject = (Resource) mapsToStmt.getObject(); + MOBYGraphNode object = parseMapsTo(mapsToObject); directMappings.put(object, mapsToStmt); } } @@ -349,6 +365,7 @@ // nested in each element. For each element in the data structure, // recursively call this method to create a mapping subgraph, an // save the parsed object in the nestedMappings list. + // Iterator it = iteratorFor(res); while (it.hasNext()) { @@ -360,13 +377,12 @@ return new MOBYSubject(model, typeStmt, propValStmts, directMappings, collectionFor(res, nestedMappings)); } - + /** - * Parse the object of an mapsTo statement, which should be a - * Subject, a data structure, or both. If the object is a Subject, - * then it should be connected to one or more mapped subgraphs through - * mapsTo properties. If the object is a data structure, then - * each element of the data structure should be a mapped subgraph. + * Parse the object of a mapsTo statement, which should be an + * Object, a data structure, or both. If the object is a data + * structure, then each element of the data structure should + * in turn be an Object, a data structure, or both. */ private MOBYObject parseMapsTo(Resource res) throws NonCanonicalException @@ -376,6 +392,7 @@ // It is *not* legal for the object of a mapsTo to be *neither* // an Object nor a data structure, so throw an exception if this is // the case. + // if ((! isObject(res)) && (! isDataStructure(res))) { throw new NonCanonicalException( @@ -385,14 +402,17 @@ // Collect the properties of this subject that are // meant to be filled in by the client + // List propValStmts = mobyPropertyStatementsOf(res); // List of nested Object subgraphs + // List nestedObjects = new ArrayList(); // The statement that asserts this to be of rdf:type moby:Object. // Since it is legal for this to not be an Object, then the statement // can be null + // Statement typeStmt = null; if (isObject(res)) @@ -407,6 +427,7 @@ // nested in each element. For each element in the data structure, // recursively call this method to create a mapping subgraph, an // save the parsed object in the nestedMappings list. + // Iterator it = iteratorFor(res); while (it.hasNext()) { @@ -418,66 +439,28 @@ return new MOBYObject(model, typeStmt, propValStmts, collectionFor(res, nestedObjects)); } - - - /** - * Parse the object of a mapsTo statement, which should be an - * Object, a data structure, or both. If the object is a data - * structure, then each element of the data structure should - * in turn be an Object, a data structure, or both. - */ - /* - private MOBYObject parseMapsTo(Resource res) - { - Model model = res.getModel(); - - // Collect the properties of this object that are - // meant to be filled in by the service - List statements = mobyPropertyStatementsOf(res); - - // List of nested mapsTo statements - // - List nested = new ArrayList(); - - if (isDataStructure(res)) - { - // The resource is a data structure, so has a mapping subgraph - // nested in each element. For each element in the data structure, - // recursively call this method to create a mapping subgraph, and - // save the parsed object in the nested list. - // - Iterator it = iteratorFor(res); - while (it.hasNext()) - { - Resource r = (Resource) it.next(); - nested.add(parseMapsTo(r)); - } - } - return new MOBYObject(res, - new MOBYFixedCollection(statements, res, model), - collectionFor(res, nested), model); - } - */ /** * Return a list of statements for whom the subject is a given resource, - * whose predicate is a subproperty of moby:Property, and whose object - * is a blank node. + * whose predicate is a subproperty of moby:Property. */ private List mobyPropertyStatementsOf(Resource res) { // The statements to return + // List stmts = new ArrayList(); // Iterate over the statements whose subjects are the resource + // StmtIterator it = res.listProperties(); while (it.hasNext()) { Statement stmt = it.nextStatement(); - if (stmt.getObject().isAnon() && - !propDetector.isMOBYProperty(stmt.getPredicate())) - { - stmts.add(stmt); + Property property = stmt.getPredicate(); + + if (propDetector.isMOBYProperty(property)) { + stmts.add(new MOBYPropValStmt(res.getModel(), stmt)); + System.out.println("MOBY Property: " + property); } } return stmts; From gss at pub.open-bio.org Thu Oct 6 14:15:36 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Oct 6 15:05:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510061815.j96IFasq009814@pub.open-bio.org> gss Thu Oct 6 14:15:36 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv9789/src/org/semanticmoby/parser Modified Files: NamespaceBasedPropertyDetector.java Log Message: Reject properties from other common namespaces besides MOBY moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser NamespaceBasedPropertyDetector.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/NamespaceBasedPropertyDetector.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/core/src/org/semanticmoby/parser/NamespaceBasedPropertyDetector.java 2005/09/14 22:06:10 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/NamespaceBasedPropertyDetector.java 2005/10/06 18:15:36 1.2 @@ -3,15 +3,24 @@ import org.semanticmoby.vocabulary.MOBY; import com.hp.hpl.jena.rdf.model.Property; +import com.hp.hpl.jena.vocabulary.OWL; +import com.hp.hpl.jena.vocabulary.RDF; +import com.hp.hpl.jena.vocabulary.RDFS; +import com.hp.hpl.jena.vocabulary.XSD; /** * A property value detector that does nothing more than make sure that - * the property's URI does not start with the MOBY prefix. + * the property's URI is not in any of the "standard" namespaces. */ public class NamespaceBasedPropertyDetector implements MOBYPropertyDetector { public boolean isMOBYProperty(Property prop) { - return ! prop.getURI().startsWith(MOBY.getURI()); + String uri = prop.getURI(); + return + (! uri.startsWith(MOBY.getURI())) && + (! uri.startsWith(RDF.getURI())) && + (! uri.startsWith(RDFS.getURI())) && + (! uri.startsWith(OWL.getURI())); } } \ No newline at end of file From gss at pub.open-bio.org Thu Oct 6 14:17:13 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Oct 6 15:07:29 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510061817.j96IHDIk009865@pub.open-bio.org> gss Thu Oct 6 14:17:13 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv9840/src/org/semanticmoby/parser Modified Files: Parser.java Log Message: Removed some forgotten debug statements moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser Parser.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/10/06 18:15:05 1.4 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/10/06 18:17:13 1.5 @@ -460,7 +460,6 @@ if (propDetector.isMOBYProperty(property)) { stmts.add(new MOBYPropValStmt(res.getModel(), stmt)); - System.out.println("MOBY Property: " + property); } } return stmts; From senger at pub.open-bio.org Mon Oct 10 17:48:44 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Oct 10 18:38:34 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510102148.j9ALmis9006629@pub.open-bio.org> senger Mon Oct 10 17:48:43 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv6611/src/main/org/biomoby/shared/event Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event added to the repository moby-live/Java/src/main/org/biomoby/shared/event - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Tue Oct 11 12:10:13 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 11 12:59:58 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510111610.j9BGADVC010218@pub.open-bio.org> senger Tue Oct 11 12:10:13 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv10199 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.7,1.8 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/24 17:41:16 1.7 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/10/11 16:10:12 1.8 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From kawas at pub.open-bio.org Tue Oct 11 16:31:27 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Oct 11 17:21:11 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510112031.j9BKVRtA011234@pub.open-bio.org> kawas Tue Oct 11 16:31:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/util In directory pub.open-bio.org:/tmp/cvs-serv11209/org/biomoby/client/ui/graphical/applets/util Modified Files: REGEXP.java Log Message: fixed a bug where a URI that contained a '-', ie www.my-uri.com, was rejected. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/util REGEXP.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/util/REGEXP.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/util/REGEXP.java 2005/04/07 16:42:27 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/util/REGEXP.java 2005/10/11 20:31:27 1.2 @@ -21,7 +21,8 @@ private final static String URI = //"(^(http:\\/\\/www\\.|HTTP:\\/\\/www\\.|www\\.|http:\\/\\/|HTTP:\\/\\/)?[\\w]+\\.[\\w].*\\w$)"; //"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"; // as per rfc 2396 appendix a. - "^([\\w]+\\.[\\w]+(\\.[\\w]+)*)$"; + //"^([\\w]+\\.[\\w]+(\\.[\\w]+)*)$"; + "^([\\w]{1}[\\d\\w\\-]+\\.[\\d\\w\\-]+(\\.[\\d\\w]{2,})*)$"; private final static String URL = "(^(http:\\/\\/www\\.|HTTP:\\/\\/www\\.|http:\\/\\/|HTTP:\\/\\/)[\\w]+\\.[\\w].*(\\/\\w+(\\.{1}\\w+)*)$)"; @@ -44,7 +45,11 @@ public static boolean isValidURI(String uri) { Pattern p = Pattern.compile(URI); Matcher m = p.matcher(uri); - return m.matches(); + boolean matches = m.matches(); + p = Pattern.compile("(\\-{2,})"); + m = p.matcher(uri); + matches = matches && !m.matches(); + return matches; } /** From senger at pub.open-bio.org Wed Oct 12 07:09:15 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 07:59:12 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121109.j9CB9FgJ013440@pub.open-bio.org> senger Wed Oct 12 07:09:15 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv13424 Added Files: log4j-1.2.12.jar Removed Files: log4j-1.2.8.jar Log Message: jars-archive/current log4j-1.2.12.jar,NONE,1.1 log4j-1.2.8.jar,1.1,NONE rcsdiff: /home/repository/moby/jars-archive/current/RCS/log4j-1.2.8.jar,v: No such file or directory From senger at pub.open-bio.org Wed Oct 12 07:17:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 08:09:17 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121117.j9CBHxYk013544@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv13525/src/Clients Modified Files: MobyDigestClient.java Log Message: moby-live/Java/src/Clients MobyDigestClient.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/22 16:07:08 1.4 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/10/12 11:17:59 1.5 @@ -7,6 +7,8 @@ // import org.biomoby.shared.*; +import org.biomoby.shared.event.SimpleListener; +import org.biomoby.shared.event.Notifier; import org.biomoby.client.*; import org.tulsoft.tools.BaseCmdLine; @@ -64,8 +66,9 @@ // how much to show boolean details = cmd.hasOption ("-details"); - if (cmd.hasOption ("-verbose")) - worker.setDebug (true); + boolean verbose = (cmd.hasOption ("-v") || cmd.hasOption ("-verbose")); + if (verbose) + ((Notifier)worker).addNotificationListener (new SimpleListener()); // read (sometimes all) data types and their relationships if (cmd.hasOption ("-d")) { From senger at pub.open-bio.org Wed Oct 12 07:17:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 08:09:27 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121117.j9CBHxJ9013632@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv13525/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java CommonTree.java NOTES PropertyChannel.java RegistryModel.java RegistryPanel.java Added Files: DataTypesTree.java JProgressBarWithCancel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard DataTypesTree.java,NONE,1.1 JProgressBarWithCancel.java,NONE,1.1 AbstractPanel.java,1.6,1.7 CommonTree.java,1.2,1.3 NOTES,1.7,1.8 PropertyChannel.java,1.1,1.2 RegistryModel.java,1.3,1.4 RegistryPanel.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/24 17:51:51 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/12 11:17:59 1.7 @@ -16,15 +16,19 @@ import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.JScrollPane; import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JTextField; +import javax.swing.JTextArea; import javax.swing.JComboBox; +import javax.swing.JOptionPane; import javax.swing.JFileChooser; import javax.swing.AbstractButton; import javax.swing.BorderFactory; import javax.swing.JComponent; +import javax.swing.SwingConstants; import javax.swing.border.Border; import javax.swing.border.TitledBorder; import javax.swing.border.CompoundBorder; @@ -34,6 +38,7 @@ import javax.swing.filechooser.FileFilter; import javax.swing.text.html.HTMLDocument; +import java.awt.Component; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Insets; @@ -84,9 +89,13 @@ protected Icon panelIcon; protected JComponent pComponent; protected static Icon confirmIcon; + protected static Icon warningIcon; // re-use "style" components protected static final Insets BREATH_TOP = new Insets (10,0,0,0); + protected static final Font MSG_AREA_FONT = new Font ("Courier", Font.PLAIN, 10); + protected static final Font TITLE_FONT = new Font ("Serif", Font.BOLD, 20); + protected static final Color TITLE_FGCOLOR = new Color (12, 55, 241); // protected PropertyChannel propertyChannel; @@ -117,8 +126,8 @@ **************************************************************************/ public JLabel getTitle() { JLabel title = new JLabel (getName(), getIcon(), JLabel.CENTER); - title.setFont (new Font ("Serif", Font.BOLD, 20)); - title.setForeground (new Color (12, 55, 241)); + title.setFont (TITLE_FONT); + title.setForeground (TITLE_FGCOLOR); return title; } @@ -269,12 +278,19 @@ } /********************************************************************* - * Create a text field (possibly with an 'initValue' with history - * taken from given 'preferenceNode'. If 'evenName' is not null - * (which means that the contens of this text filed may be of - * interest of someone outside), add an action event that will - * update the shared property storage (a global variable - * 'propertyChannel') when the text field changes its value. + * Create a text field (possibly with an 'initValue') with its + * history taken from given 'preferenceNode'.

+ * + * If 'initValue' is an empty string, the text field starts with + * an empty initial value. If the 'initValue' is null, the text + * field starts filled with the last time used value (stored in + * and taken from the 'preference node').

+ * + * If 'evenName' is not null (which means that the contens of this + * text filed may be of interest of someone outside), add an + * action event that will update the shared property storage + * (which is in a global variable 'propertyChannel') when the text + * field changes its value. ********************************************************************/ protected JTextFieldWithHistory createText (String initValue, String preferenceNode, @@ -335,4 +351,46 @@ return SwingUtils.confirm (null, msg, confirmIcon); } + /********************************************************************* + * Display an error message. + ********************************************************************/ + public static void error (Object msg) { + if (warningIcon == null) + warningIcon = SwingUtils.createIcon ("images/warningButton.gif", + Dashboard.class); + JOptionPane.showMessageDialog (null, msg, "Error message", + JOptionPane.PLAIN_MESSAGE, warningIcon); + } + + /********************************************************************* + * Display an error message. Construct the message from + * 'prologue', some intermediate title, and a text area filled + * from the exception 'e'. + ********************************************************************/ + public static void error (String prologue, Exception e) { + + // slightly format message prologue + // TBD: HTML escape + prologue = prologue + "The actual error is:\n\n"; + if (! prologue.startsWith (""; + prologue = prologue.replaceAll ("\n", "
\n"); + } + + // slightly format the error message + // TBD: make it (or part of it) red + String msg = e.getMessage(); + + JTextArea area = new JTextArea (15, 50); + area.setEditable (false); + area.setFont (MSG_AREA_FONT); + area.setText (msg); + area.setCaretPosition (0); + + JPanel p = new JPanel (new GridBagLayout()); + SwingUtils.addComponent (p, new JLabel (prologue), 0, 0, 1, 1, NONE, NWEST, 0.0, 0.0); + SwingUtils.addComponent (p, new JScrollPane (area), 0, 1, 1, 1, BOTH, NWEST, 1.0, 1.0); + error (p); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/09/24 17:51:51 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/12 11:17:59 1.3 @@ -45,9 +45,7 @@ /** * A common JTree re-used (and always slightly modified) by all - * Dashboard trees.

- * - * WORK IN PROGRESS.

+ * Biomoby registry trees.

* * @author Martin Senger * @version $Id$ @@ -55,6 +53,8 @@ public class CommonTree extends JTree { + final static String RELOAD = "Reload"; + // some shared constants final static protected int SORTED_BY_NAME = 0; final static protected int SORTED_BY_AUTHORITY = 1; @@ -186,13 +186,23 @@ expand(); } })); + popup.add - (new JMenuItem (new AbstractAction ("Collaps all nodes") { + (new JMenuItem (new AbstractAction ("Collapse all nodes") { public void actionPerformed (ActionEvent e) { collapse(); } })); + popup.addSeparator(); + + popup.add + (new JMenuItem (new AbstractAction (RELOAD) { + public void actionPerformed (ActionEvent e) { + reload(); + } + })); + // add listener to this tree to bring up popup menus MouseListener popupListener = new PopupListener(); addMouseListener (popupListener); @@ -208,7 +218,22 @@ private void maybeShowPopup (MouseEvent e) { if (e.isPopupTrigger() && popup.isEnabled()) { popup.show (e.getComponent(), - e.getX(), e.getY()); + e.getX(), e.getY()); + } + } + } + + /********************************************************************* + * Enable/disable the whole popup except the 'Reload' option (that + * one remains enabled always). + ********************************************************************/ + protected void setEnabledPopup (boolean enabled) { + synchronized (popup) { + Component[] components = popup.getComponents(); + for (int i = 0; i < components.length; i++) { + if ( components[i] instanceof JMenuItem && + ! ((JMenuItem)components[i]).getText().equals (RELOAD) ) + ((JMenuItem)components[i]).setEnabled (enabled); } } } @@ -242,6 +267,14 @@ } /********************************************************************* + * Does nothing here - it is supposed to be overwritten bya + * concrete tree. + ********************************************************************/ + protected void reload() { + System.out.println ("Invoking a reload."); + } + + /********************************************************************* * Search underlying objects and highligh nodes corresponding to * the found objects. But it does nothing here - it is supposed to * be overwritten by a concrete tree. @@ -292,4 +325,11 @@ } } + /********************************************************************* + * Display an error message. + ********************************************************************/ + protected static void error (String prologue, Exception e) { + AbstractPanel.error (prologue, e); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/25 09:07:22 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/12 11:17:59 1.8 @@ -98,7 +98,6 @@ ---- -* error messages (dialog window, or a text-area window/save button, something on sterrr?) ? logging (LogPanel and/or usual logging to a file?) * communication with StatusBar (incl. progress bar, cancel button) * disabling things during a long-time operation @@ -136,6 +135,14 @@ * BUG: not sure why so many (repeated) changes from the actionlistener in JFieldTextWithHistory +? select a part of an error message and highlight it in red? + +? HELP (in a Dashboard Menu) + - helps from panels + - About + - credits + - add dynamically a URL from dashboard.properties... + TODO with views: ---------------- * change onMethods() to be protected or even private... @@ -169,6 +176,12 @@ ? improve API javadoc of all these Central*Impl ? start to work on/think of the RDF-based cache +General options (available from the menu) +--------------- +* export/import user preferences +* set-up what panels are wanted +* language ( => use proper ResourceBundler...) + Registry panel -------------- @@ -204,3 +217,5 @@ - RDF resources - Log panel - Configure a new Dashboard + +- Debugging panel (with a Memory Panel embedded; replacing current two pannels) =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/09/24 17:51:51 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/12 11:17:59 1.2 @@ -29,9 +29,9 @@ *

* * Obviously, there are some properties that do not make sense to be - * stored here: the short-lived properties, such as log messages, or - * progress bar change events. Such messages can be delivered in an - * ordinary way via property change listeners.

+ * stored here: the short-lived properties, such as progress bar + * change events. Such messages can be delivered in an ordinary way + * via property change listeners.

* * The panels/models are sending here properties by calling method * put. If we find, in the future, that sending properties @@ -40,7 +40,7 @@ * see any advantage of it.

* * Property names are of no interest for this class, but it is good to - * remind that the they should be defined in the class {@link + * remind that they should be defined in the class {@link * DashboardProperties}.

* @author Martin Senger =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/25 09:07:22 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/12 11:17:59 1.4 @@ -52,14 +52,27 @@ super (support); } + /************************************************************************** + * Return an endpoint (a stringified URL) of a default Moby + * registry. + *************************************************************************/ + public String getDefaultRegistryEndpoint() { + return CentralDigestCachedImpl.DEFAULT_ENDPOINT; + } + + /************************************************************************** + * Return a namespace (a URI) used by a default Moby registry. + *************************************************************************/ + public String getDefaultRegistryNamespace() { + return CentralDigestCachedImpl.DEFAULT_NAMESPACE; + } + /********************************************************************* * ********************************************************************/ public MobyDataType[] getDataTypesByNames() throws MobyException { - - if (worker == null) - initWorker(); + initWorker(); MobyDataType[] dataTypes = worker.getDataTypes(); java.util.Arrays.sort (dataTypes); @@ -72,9 +85,7 @@ public MobyDataType[] getDataTypesByAuthority() throws MobyException { - if (worker == null) - initWorker(); - + initWorker(); MobyDataType[] dataTypes = worker.getDataTypes(); java.util.Arrays.sort (dataTypes, @@ -130,17 +141,40 @@ /********************************************************************* * ********************************************************************/ - protected void initWorker() + protected String getCacheDir() { + if (worker instanceof CentralDigestCachedImpl) + return ((CentralDigestCachedImpl)worker).getCacheDir(); + else + return null; + } + + /********************************************************************* + * + ********************************************************************/ + protected synchronized void initWorker() throws MobyException { - String registryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); - String registryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); -// String cacheDir = propertyChannel.getString (DP_CACHE_DIR); - String cacheDir = "/home/senger/jMoby/myCache"; -// cacheDir = null; - - worker = new CentralDigestCachedImpl (registryURL, - registryNS, - cacheDir); + if (worker == null) { + String registryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); + String registryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); + String cacheDir = propertyChannel.getString (DP_CACHE_DIR); + // String cacheDir = "/home/senger/jMoby/myCache"; + // cacheDir = null; + + worker = new CentralDigestCachedImpl (registryURL, + registryNS, + cacheDir); + } else { + String maybeNewRegistryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); + String maybeNewRegistryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); + String maybeNewCacheDir = propertyChannel.getString (DP_CACHE_DIR); + if ( maybeNewRegistryURL.equals (worker.getRegistryEndpoint()) && + maybeNewRegistryNS.equals (worker.getRegistryNamespace()) && + maybeNewCacheDir.equals (getCacheDir()) ) + return; + worker = new CentralDigestCachedImpl (maybeNewRegistryURL, + maybeNewRegistryNS, + maybeNewCacheDir); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/25 09:07:22 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/12 11:17:59 1.9 @@ -77,6 +77,8 @@ RegistryModel registryModel; // components that are used from more methods + JTextFieldWithHistory registryURL; + JTextFieldWithHistory registryNS; JFileChooserWithHistory cacheDir; JLabel labelCacheDir; CommonConsole console; @@ -115,9 +117,19 @@ pComponent = new JPanel (new GridBagLayout(), true); + // registry and cache locations (this must be created before + // creating various ontology trees because the trees will need + // to know registry and cache locations) + JPanel regLocation = getRegistryLocation(); + JPanel cacheLocation = getCacheLocation(); + + // console panel + console = new CommonConsole(); + console.setAppendMode (false); + // ontology trees ServicesTree servicesTree = new ServicesTree(); - DataTypesTree dataTypesTree = new DataTypesTree(); + DataTypesTree dataTypesTree = new DataTypesTree (registryModel, console); dataTypesTree.update (CommonTree.SORTED_BY_NAME); NamespacesTree namespacesTree = new NamespacesTree(); @@ -134,10 +146,6 @@ split2.setContinuousLayout (true); split2.setOneTouchExpandable (true); - // console panel - console = new CommonConsole(); - console.setAppendMode (false); - JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, split2, console); @@ -145,11 +153,6 @@ split3.setContinuousLayout (true); split3.setOneTouchExpandable (true); - - // registry and cache locations - JPanel regLocation = getRegistryLocation(); - JPanel cacheLocation = getCacheLocation(); - // put all together SwingUtils.addComponent (pComponent, split3, 0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0); SwingUtils.addComponent (pComponent, regLocation, 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0); @@ -168,6 +171,8 @@ * **************************************************************************/ public void onDefaults() { + registryURL.setText (registryModel.getDefaultRegistryEndpoint()); + registryNS.setText (registryModel.getDefaultRegistryNamespace()); } /************************************************************************** @@ -202,11 +207,9 @@ **************************************************************************/ protected JPanel getRegistryLocation() { JLabel labelRegistryURL = new JLabel("Endpoint"); - JTextFieldWithHistory registryURL = - createText ("", "registryEndpoint", DP_REGISTRY_ENDPOINT); + registryURL = createText (null, "registryEndpoint", DP_REGISTRY_ENDPOINT); JLabel labelRegistryNS = new JLabel("Namespace (URI)"); - JTextFieldWithHistory registryNS = - createText ("", "registryNamespace", DP_REGISTRY_NAMESPACE); + registryNS = createText (null, "registryNamespace", DP_REGISTRY_NAMESPACE); JButton reloadAllButton = createButton (" Reload all ", "Reload all ontology trees from the Biomoby registry", @@ -307,283 +310,6 @@ } } - /************************************************************************** - * - **************************************************************************/ - class DataTypesTree extends CommonTree { - MobyDataType[] dataTypes = null; - int lastSorted = SORTED_BY_NAME; - boolean hideBadGuys = false; - boolean showMembers = false; - JCheckBoxMenuItem hideBox; - - public DataTypesTree() { - super ("DataTypes"); - createPopups ("Data Types Menu"); - } - - protected void createPopups (String title) { - super.createPopups (title); - popup.addSeparator(); - popup.add - (new JMenuItem (new AbstractAction ("Sort by names") { - public void actionPerformed (ActionEvent e) { - update (lastSorted = SORTED_BY_NAME); - hideBox.setEnabled (true); - } - })); - popup.add - (new JMenuItem (new AbstractAction ("Sort by authorities") { - public void actionPerformed (ActionEvent e) { - update (lastSorted = SORTED_BY_AUTHORITY); - hideBox.setEnabled (false); - } - })); - popup.addSeparator(); - - JCheckBoxMenuItem showBox = new JCheckBoxMenuItem ("Show HAS/HASA members"); - showBox.addItemListener (new ItemListener() { - public void itemStateChanged (ItemEvent e) { - showMembers = (e.getStateChange() == ItemEvent.SELECTED); - update (lastSorted); - } - }); - popup.add (showBox); - - hideBox = new JCheckBoxMenuItem ("Hide deprecated objects"); - hideBox.addItemListener (new ItemListener() { - public void itemStateChanged (ItemEvent e) { - hideBadGuys = (e.getStateChange() == ItemEvent.SELECTED); - if (hideBadGuys) - removeBadGuys(); - else - update (lastSorted); - } - }); - popup.add (hideBox); - } - - void update (int howSorted) { - popup.setEnabled (false); - final int sorted = howSorted; - final SwingWorker worker = new SwingWorker() { - public Object construct() { - try { - if (sorted == SORTED_BY_AUTHORITY) - dataTypes = registryModel.getDataTypesByAuthority(); - else - dataTypes = registryModel.getDataTypesByNames(); - } catch (MobyException e) { - // TBD: what to do here? - System.err.println ("ERROR: " + e.getMessage()); - } - return dataTypes; // not used here - } - - // runs on the event-dispatching thread. - public void finished() { - if (dataTypes != null) { - if (sorted == SORTED_BY_AUTHORITY) - onUpdateDataTreeByAuth (dataTypes); - else - onUpdateDataTree (dataTypes); - popup.setEnabled (true); - } - } - }; - worker.start(); - } - - void onUpdateDataTree (MobyDataType[] dataTypes) { - DefaultTreeModel tModel = (DefaultTreeModel)getModel(); - DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); - root.removeAllChildren(); // does not harm if no children exist - HashMap nodes = new HashMap (dataTypes.length); - for (int i = 0; i < dataTypes.length; i++) { - String thisName = dataTypes[i].getName(); - DefaultMutableTreeNode thisNode = (DefaultMutableTreeNode)nodes.get (thisName); - if (thisNode == null) { - thisNode = new DefaultMutableTreeNode (new CommonNode (thisName)); - nodes.put (thisName, thisNode); - } - String[] parents = dataTypes[i].getParentNames(); - if (parents.length == 0) { // we have a top-level object - root.add (thisNode); - } else { - String parentName = parents[0]; - DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)nodes.get (parentName); - if (parentNode == null) { - parentNode = new DefaultMutableTreeNode (new CommonNode (parentName)); - nodes.put (parentName, parentNode); - } - if (showMembers) - addMembers (thisNode, dataTypes[i]); - parentNode.add (thisNode); - } - } - if (hideBadGuys) - removeBadGuys(); - else - tModel.reload(); - } - - - void onUpdateDataTreeByAuth (MobyDataType[] dataTypes) { - DefaultTreeModel tModel = (DefaultTreeModel)getModel(); - DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); - root.removeAllChildren(); // does not harm if no children exist - HashMap nodes = new HashMap (dataTypes.length); - for (int i = 0; i < dataTypes.length; i++) { - String thisName = dataTypes[i].getName(); - DefaultMutableTreeNode thisNode = (DefaultMutableTreeNode)nodes.get (thisName); - if (thisNode == null) { - thisNode = new DefaultMutableTreeNode (new CommonNode (thisName)); - nodes.put (thisName, thisNode); - } - String authority = dataTypes[i].getAuthority(); - if (UUtils.isEmpty (authority)) - authority = ""; - DefaultMutableTreeNode authNode = (DefaultMutableTreeNode)nodes.get (authority); - if (authNode == null) { - authNode = new DefaultMutableTreeNode (new CommonNode (authority)); - nodes.put (authority, authNode); - root.add (authNode); - } - if (showMembers) - addMembers (thisNode, dataTypes[i]); - authNode.add (thisNode); - } - tModel.reload(); - } - - void removeBadGuys() { - DefaultTreeModel tModel = (DefaultTreeModel)getModel(); - DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); - - Vector removeFromParent = new Vector(); // nodes that will be removed - Vector removeAllChildren = new Vector(); // nodes whose children will be removed - for (Enumeration en = root.children(); en.hasMoreElements(); ) { - DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); - String value = ((CommonNode)node.getUserObject()).getValue(); - if (value.equals ("Object")) { - // primitive type should not have children - for (Enumeration en2 = node.children(); en2.hasMoreElements(); ) { - DefaultMutableTreeNode node2 = (DefaultMutableTreeNode)en2.nextElement(); - String value2 = ((CommonNode)node2.getUserObject()).getValue(); - if (DataTypesGenerator.isPrimitiveType (value2)) - removeAllChildren.addElement (node2); - } - } else { - // only Object can be a root object - removeFromParent.addElement (node); - } - } - for (Enumeration en = removeFromParent.elements(); en.hasMoreElements(); ) { - DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); - node.removeFromParent(); - } - for (Enumeration en = removeAllChildren.elements(); en.hasMoreElements(); ) { - DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); - node.removeAllChildren(); - } - tModel.reload(); - } - - void addMembers (DefaultMutableTreeNode node, MobyDataType dataType) { - MobyRelationship[] rels = dataType.getChildren(); - for (int i = 0; i < rels.length; i++) { - String memberName = rels[i].getName(); - String memberType = rels[i].getDataTypeName(); - int memberRel = rels[i].getRelationshipType(); - node.add (new DefaultMutableTreeNode (new MemberNode (rels[i]))); - } - } - - /********************************************************************* - * Search underlying objects and highligh nodes corresponding to - * the found objects. - ********************************************************************/ - protected void search (String searchText) { - final String regex = searchText; - final SwingWorker worker = new SwingWorker() { - HashSet found = new HashSet(); - public Object construct() { - try { - if (UUtils.notEmpty (regex)) - found = registryModel.find (regex); - } catch (MobyException e) { - // TBD: what to do here? - System.err.println ("ERROR: " + e.getMessage()); - } - return found; // not used here - } - - // runs on the event-dispatching thread. - public void finished() { - if (found != null) - highlightAndJumpTo (found); - } - }; - worker.start(); - } - - /********************************************************************* - * - ********************************************************************/ - protected void selected (DefaultMutableTreeNode node) { - final CommonNode nodeObject = (CommonNode)node.getUserObject(); - final SwingWorker worker = new SwingWorker() { - MobyDataType dataType; - public Object construct() { - try { - dataType = registryModel.getDataType (nodeObject.getValue()); - } catch (MobyException e) { - // TBD: what to do here? - System.err.println ("ERROR: " + e.getMessage()); - } - return dataType; // not used here - } - - // runs on the event-dispatching thread. - public void finished() { - if (dataType != null) -// System.out.println (dataType); - console.setText (dataType.toString()); - } - }; - worker.start(); - } - - class MemberNode extends CommonNode { - MobyRelationship rel; - public MemberNode (MobyRelationship rel) { - this.rel = rel; - } - public String getValue() { - return rel.getDataTypeName(); - } - public String toString() { - String memberName = rel.getName(); - String memberType = rel.getDataTypeName(); - int memberRel = rel.getRelationshipType(); - StringBuffer buf = new StringBuffer (100); - buf.append (""); - buf.append (memberRel == Central.iHAS ? "HAS" : "HASA"); - buf.append (": "); - buf.append (memberType); - if (UUtils.notEmpty (memberName)) { - buf.append (" ("); - buf.append (memberName); - buf.append (")"); - } - return buf.toString(); - } - } - - - } - - /************************************************************************** * From senger at pub.open-bio.org Wed Oct 12 07:17:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 08:09:27 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121117.j9CBHx3V013664@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv13525/src/main/org/biomoby/shared/event Added Files: NotificationEvent.java NotificationListener.java Notifier.java SimpleListener.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,NONE,1.1 NotificationListener.java,NONE,1.1 Notifier.java,NONE,1.1 SimpleListener.java,NONE,1.1 From senger at pub.open-bio.org Wed Oct 12 07:17:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 08:09:29 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121117.j9CBHxlt013647@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv13525/src/main/org/biomoby/service/dashboard/images Added Files: smallCancel.gif warningButton.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images smallCancel.gif,NONE,1.1 warningButton.gif,NONE,1.1 From senger at pub.open-bio.org Wed Oct 12 07:18:00 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 08:09:31 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121118.j9CBI0kS013685@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/xmls In directory pub.open-bio.org:/tmp/cvs-serv13525/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/24 17:57:06 1.6 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/10/12 11:17:59 1.7 @@ -23,7 +23,7 @@ - + @@ -106,6 +106,7 @@ + From senger at pub.open-bio.org Wed Oct 12 07:17:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 08:11:19 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121117.j9CBHxkW013563@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv13525/src/Clients/help Modified Files: MobyDigest_usage.txt Log Message: moby-live/Java/src/Clients/help MobyDigest_usage.txt,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/22 16:07:08 1.4 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/10/12 11:17:59 1.5 @@ -31,5 +31,7 @@ -details ... print the above with all details (by default only names are printed) + -v[erbose] ... verbose + [Note: You can also use -argsfile to read arguments from a file. See details in src/Client/help/argsfile.example.] From senger at pub.open-bio.org Wed Oct 12 07:17:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 08:11:43 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121117.j9CBHx9C013586@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv13525/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralDigestImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.8,1.9 CentralDigestImpl.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/24 17:51:51 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/12 11:17:59 1.9 @@ -107,7 +107,6 @@ throws MobyException { if (cacheDir != null) { File cache = createCacheDir (cacheDir, getRegistryEndpoint()); - messageLn ("Using cache directory: " + cache); dataTypesCache = createSubCacheDir (cache, "dataTypes"); servicesCache = createSubCacheDir (cache, "services"); namespacesCache = createSubCacheDir (cache, "namespaces"); @@ -116,6 +115,16 @@ } /************************************************************************** + * Return a directory name representing the current cache. This is + * the same name as given in constructors.

+ * + * @return current cache directory name + **************************************************************************/ + public String getCacheDir() { + return cacheDir; + } + + /************************************************************************** * Removes object groups from the cache. If 'id' is null it * removes the whole cache (for the Moby registry this instance as * initiated for). Otherwise 'id' indicates what part of the cache @@ -318,12 +327,14 @@ String typesAsXML = getDataTypeNamesAsXML(); store (dataTypesCache, LIST_FILE, typesAsXML); Map types = createDataTypeNamesFromXML (typesAsXML); + fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); - messageLn ("(CDCI) Processing data type " + name + "..."); + fireEvent (DATA_TYPE_LOADING, name); String xml = getDataTypeAsXML (name); store (dataTypesCache, name, xml); + fireEvent (DATA_TYPE_LOADED, name); } } catch (Exception e) { throw new MobyException (formatException (e)); @@ -333,16 +344,17 @@ protected void fillServicesCache() throws MobyException { try { - messageLn ("(CDCI) Asking for all service names..."); String byAuthorityAsXML = getServiceNamesByAuthorityAsXML(); store (servicesCache, LIST_FILE, byAuthorityAsXML); Map authorities = createServiceNamesByAuthorityFromXML (byAuthorityAsXML); + fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); - messageLn ("(CDCI) Processing authority " + authority + "..."); + fireEvent (AUTHORITY_LOADING, authority); String xml = getServicesAsXML (new MobyService (MobyService.DUMMY_NAME, authority), null, true, true); store (servicesCache, authority, xml); + fireEvent (AUTHORITY_LOADED, authority); } } catch (Exception e) { throw new MobyException (formatException (e)); @@ -353,16 +365,17 @@ protected void fillServiceTypesCache() throws MobyException { try { - messageLn ("(CDCI) Asking for all service type names..."); String typesAsXML = getServiceTypesAsXML(); store (serviceTypesCache, LIST_FILE, typesAsXML); Map types = createServiceTypesFromXML (typesAsXML); + fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); - messageLn ("(CDCI) Processing service type " + name + "..."); + fireEvent (SERVICE_TYPE_LOADING, name); String xml = getServiceTypeRelationshipsAsXML (name, false); store (serviceTypesCache, name, xml); + fireEvent (SERVICE_TYPE_LOADED, name); } } catch (Exception e) { throw new MobyException (formatException (e)); @@ -373,8 +386,10 @@ protected void fillNamespacesCache() throws MobyException { try { + fireEvent (NAMESPACE_LOADING, "Loading started."); String xml = getNamespacesAsXML(); store (namespacesCache, LIST_FILE, xml); + fireEvent (NAMESPACE_LOADED, "Loaded."); } catch (Exception e) { throw new MobyException (formatException (e)); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/22 16:07:09 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/12 11:17:59 1.6 @@ -7,6 +7,9 @@ package org.biomoby.client; import org.biomoby.shared.CentralDigest; +import org.biomoby.shared.event.Notifier; +import org.biomoby.shared.event.NotificationEvent; +import org.biomoby.shared.event.NotificationListener; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; @@ -30,7 +33,7 @@ public class CentralDigestImpl extends CentralImpl - implements CentralDigest { + implements CentralDigest, Notifier { // cached (digested) Moby protected MobyDataType[] dataTypes = new MobyDataType[] {}; @@ -75,11 +78,13 @@ try { Vector v = new Vector(); Map types = getDataTypeNames(); + fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); - messageLn ("(CDI) Processing data type " + name + "..."); + fireEvent (DATA_TYPE_LOADING, name); v.addElement (getDataType (name)); + fireEvent (DATA_TYPE_LOADED, name, v.lastElement()); } MobyDataType[] result = new MobyDataType [v.size()]; v.copyInto (result); @@ -98,14 +103,16 @@ try { Vector v = new Vector(); Map types = getServiceTypes(); + fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String typeName = (String)entry.getKey(); - messageLn ("(CDI) Processing service type " + typeName + "..."); + fireEvent (SERVICE_TYPE_LOADING, typeName); MobyServiceType serviceType = new MobyServiceType (typeName); serviceType.setDescription ((String)entry.getValue()); serviceType.setParentNames (getServiceTypeRelationships (typeName, false)); v.addElement (serviceType); + fireEvent (SERVICE_TYPE_LOADED, typeName, v.lastElement()); } MobyServiceType[] result = new MobyServiceType [v.size()]; v.copyInto (result); @@ -130,6 +137,7 @@ throws MobyException { try { Map names = getNamespaces(); + fireEvent (NAMESPACE_COUNT, new Integer (names.size())); MobyNamespace[] result = new MobyNamespace [ names.size() ]; int i = 0; for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { @@ -138,6 +146,7 @@ MobyNamespace ns = new MobyNamespace (name); ns.setDescription ((String)entry.getValue()); result[i++] = ns; + fireEvent (NAMESPACE_LOADED, name, ns); } return result; @@ -153,18 +162,19 @@ throws MobyException { try { Vector v = new Vector(); - messageLn ("(CDI) Asking for all service names..."); Map authorities = getServiceNamesByAuthority(); + fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); + fireEvent (AUTHORITY_LOADING, authority); String[] names = (String[])entry.getValue(); for (int i = 0; i < names.length; i++) { - messageLn ("(CDI) Processing service " + names[i] + "..."); MobyService[] servs = findService (new MobyService (names[i], authority)); for (int j = 0; j < servs.length; j++) v.addElement (servs[j]); } + fireEvent (AUTHORITY_LOADED, authority); } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); @@ -186,6 +196,8 @@ buf.append (e.toString()); buf.append (DGUtils.stackTraceToString (e)); return new String (buf); + } else if (e instanceof MobyException) { + return e.getMessage(); } else { return e.toString(); } @@ -291,6 +303,74 @@ } } + /************************************************************************* + * + * Methods implementing Notifier interface. + * + *************************************************************************/ + + private Vector listeners; + + /********************************************************************* + * + ********************************************************************/ + public synchronized void addNotificationListener (NotificationListener l) { + if (listeners == null) + listeners = new Vector(); + listeners.addElement (l); + } + + /********************************************************************* + * + ********************************************************************/ + public void removeNotificationListener (NotificationListener l) { + if (listeners != null) + listeners.removeElement (l); + } + + /********************************************************************* + * + ********************************************************************/ + public NotificationListener[] getNotificationListeners() { + if (listeners == null) + return new NotificationListener[] {}; + synchronized (listeners) { + NotificationListener[] result = new NotificationListener [listeners.size()]; + listeners.copyInto (result); + return result; + } + } + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (String type, Object message) { + fireEvent (type, message, null); + } + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (String type, Object message, Object details) { + NotificationEvent event = null; + if (details == null) + event = new NotificationEvent (this, type, message.toString()); + else + event = new NotificationEvent (this, type, message.toString(), details); + if (listeners != null) { + synchronized (listeners) { + for (int i = 0; i < listeners.size(); i++) { + NotificationListener listener = (NotificationListener)listeners.elementAt(i); + listener.notified (event); + } + } + } + } + + + + + // Work in progress - implement the methods above by getting RDF // graphs in-one-go and parsing them. Actually ability to get such // graphs was the main motivation for this implementation, and for From senger at pub.open-bio.org Wed Oct 12 07:36:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 08:26:36 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121136.j9CBaxY3013784@pub.open-bio.org> senger Wed Oct 12 07:36:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv13765/src/Clients Modified Files: UnregisterByAuthority.java Log Message: moby-live/Java/src/Clients UnregisterByAuthority.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/10/12 11:36:59 1.3 @@ -6,7 +6,6 @@ // Copyright Martin Senger (martin.senger@gmail.com). // -import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; import org.biomoby.shared.Central; import org.biomoby.client.CentralImpl; @@ -14,7 +13,6 @@ import org.tulsoft.tools.BaseCmdLine; import java.util.Map; -import java.util.Map.Entry; import java.util.Iterator; /** From senger at pub.open-bio.org Wed Oct 12 07:36:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 08:26:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121136.j9CBaxB4013808@pub.open-bio.org> senger Wed Oct 12 07:36:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv13765/src/main/org/biomoby/client Modified Files: BaseCmdLineClient.java CentralImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseCmdLineClient.java,1.3,1.4 CentralImpl.java,1.28,1.29 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/22 16:07:08 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/10/12 11:36:59 1.4 @@ -27,7 +27,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.Map.Entry; import java.util.Arrays; import java.io.IOException; import java.io.File; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/24 17:51:51 1.28 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/10/12 11:36:59 1.29 @@ -20,10 +20,8 @@ import org.biomoby.shared.MobyServiceType; import org.biomoby.shared.NoSuccessException; import org.biomoby.shared.PendingCurationException; -import org.biomoby.shared.Utils; import org.biomoby.shared.MobyResourceRef; -import org.tulsoft.shared.UUtils; import org.tulsoft.tools.soap.axis.AxisUtils; import org.w3c.dom.Document; From senger at pub.open-bio.org Wed Oct 12 07:36:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 12 08:26:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121136.j9CBaxvW013827@pub.open-bio.org> senger Wed Oct 12 07:36:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv13765/src/main/org/biomoby/shared/event Modified Files: Notifier.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event Notifier.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/12 11:36:59 1.2 @@ -37,7 +37,7 @@ * notification events from the class that implements this * interface.

* - * @param the notification listener to be added + * @param l notification listener to be added ********************************************************************/ void addNotificationListener (NotificationListener l); @@ -46,7 +46,7 @@ * longer receives notification events from the class that * implements this interface.

* - * @param the notification listener to be removed + * @param l notification listener to be removed ********************************************************************/ void removeNotificationListener (NotificationListener l); From kawas at pub.open-bio.org Wed Oct 12 12:34:40 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Oct 12 13:24:14 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121634.j9CGYeI1014509@pub.open-bio.org> kawas Wed Oct 12 12:34:40 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv14484/org/biomoby/client/rdf/vocabulary Modified Files: Predicates.java Log Message: organized import statements moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary Predicates.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary/Predicates.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary/Predicates.java 2005/08/30 18:31:30 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary/Predicates.java 2005/10/12 16:34:40 1.8 @@ -1,8 +1,4 @@ package org.biomoby.client.rdf.vocabulary; -import java.util.Properties; - -import org.biomoby.registry.properties.MobyProperties; - import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.Property; From kawas at pub.open-bio.org Wed Oct 12 13:13:29 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Oct 12 14:03:04 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121713.j9CHDTxp014638@pub.open-bio.org> kawas Wed Oct 12 13:13:28 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv14601/org/biomoby/shared/schema Modified Files: MElementHashtable.java Frame.java GenericWindowListener.java PrimitiveVector.java Added Files: ServiceInstanceWSDL.java Log Message: organized import statements moby-live/Java/src/main/org/biomoby/shared/schema ServiceInstanceWSDL.java,NONE,1.1 MElementHashtable.java,1.1,1.2 Frame.java,1.2,1.3 GenericWindowListener.java,1.1,1.2 PrimitiveVector.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MElementHashtable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MElementHashtable.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MElementHashtable.java 2005/10/12 17:13:28 1.2 @@ -7,7 +7,8 @@ package org.biomoby.shared.schema; -import java.util.*; +import java.util.Hashtable; +import java.util.Vector; public class MElementHashtable { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/09/06 21:29:50 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/10/12 17:13:28 1.3 @@ -29,6 +29,11 @@ */ public class Frame extends JFrame{ + /** + * + */ + private static final long serialVersionUID = 1939367498077695253L; + public Frame() { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/GenericWindowListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/GenericWindowListener.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/GenericWindowListener.java 2005/10/12 17:13:28 1.2 @@ -12,7 +12,8 @@ * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ -import java.awt.event.*; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; public class GenericWindowListener extends WindowAdapter { public void windowClosing(WindowEvent event) =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/PrimitiveVector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/PrimitiveVector.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/PrimitiveVector.java 2005/10/12 17:13:28 1.2 @@ -6,7 +6,7 @@ package org.biomoby.shared.schema; -import java.util.*; +import java.util.Vector; public class PrimitiveVector { From kawas at pub.open-bio.org Wed Oct 12 13:57:54 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Oct 12 14:47:29 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121757.j9CHvskS014779@pub.open-bio.org> kawas Wed Oct 12 13:57:54 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool In directory pub.open-bio.org:/tmp/cvs-serv14742/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool Modified Files: ServiceFocusListener.java ServiceInstancePanelFactory.java DescriptionWindow.java ServiceActionListener.java Log Message: organized import statements, removed variables that werent read, etc. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool ServiceFocusListener.java,1.3,1.4 ServiceInstancePanelFactory.java,1.4,1.5 DescriptionWindow.java,1.2,1.3 ServiceActionListener.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceFocusListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceFocusListener.java 2005/08/31 23:56:39 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceFocusListener.java 2005/10/12 17:57:54 1.4 @@ -6,7 +6,6 @@ import java.awt.event.FocusEvent; import java.awt.event.FocusListener; -import javax.swing.JFrame; import javax.swing.JTextArea; import javax.swing.JTextField; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceInstancePanelFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceInstancePanelFactory.java 2005/08/31 23:56:39 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceInstancePanelFactory.java 2005/10/12 17:57:54 1.5 @@ -28,7 +28,6 @@ import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.ListSelectionModel; -import javax.swing.text.Style; import org.biomoby.client.ui.graphical.applets.shared.MobyTree; import org.biomoby.client.ui.graphical.applets.util.TreeLoaderThread; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java 2005/09/01 00:03:56 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java 2005/10/12 17:57:54 1.3 @@ -21,6 +21,10 @@ */ public class DescriptionWindow extends JDialog { + /** + * + */ + private static final long serialVersionUID = -7369426386153906403L; private javax.swing.JPanel panel = null; private JPanel buttonpanel = null; private JButton btnClose = null; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceActionListener.java 2005/08/31 23:56:39 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceActionListener.java 2005/10/12 17:57:54 1.3 @@ -16,7 +16,6 @@ import javax.swing.JPanel; import org.biomoby.client.rdf.builder.ServiceInstanceRDF; -import org.biomoby.client.ui.graphical.applets.util.REGEXP; /** * @author Edward Kawas Created on July 7, 2004 From kawas at pub.open-bio.org Wed Oct 12 13:57:54 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Oct 12 14:47:31 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121757.j9CHvsCM014798@pub.open-bio.org> kawas Wed Oct 12 13:57:54 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared In directory pub.open-bio.org:/tmp/cvs-serv14742/org/biomoby/client/ui/graphical/applets/shared Modified Files: MobyTree.java Log Message: organized import statements, removed variables that werent read, etc. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared MobyTree.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/09/30 14:44:58 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/10/12 17:57:54 1.4 @@ -1,5 +1,7 @@ package org.biomoby.client.ui.graphical.applets.shared; +import java.awt.BorderLayout; +import java.awt.Dimension; import java.awt.GridLayout; import java.awt.Toolkit; import java.util.ArrayList; @@ -7,6 +9,7 @@ import java.util.HashMap; import java.util.Iterator; +import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTree; @@ -350,4 +353,21 @@ tree.clearSelection(); tree.collapseRow(0); } + + public static void main(String[] args) { + JFrame frame = new JFrame(); + MobyTree tree = new MobyTree(false, "http://localhost:8080/RESOURCES/MOBY-S/Objects", "Object"); + tree.makeObjectTree("Object"); + tree.setPreferredSize(new Dimension(400, 400)); + // Add button to the frame + frame.getContentPane().add(tree, BorderLayout.CENTER); + + // Set initial size + int frameWidth = 300; + int frameHeight = 300; + frame.setSize(frameWidth, frameHeight); + + // Show the frame + frame.setVisible(true); + } } From gss at pub.open-bio.org Fri Oct 14 17:29:55 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri Oct 14 18:19:16 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510142129.j9ELTtr0025016@pub.open-bio.org> gss Fri Oct 14 17:29:54 EDT 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-serv24990/src/org/semanticmoby/ref/servlets Modified Files: KeywordSearchServlet.java Log Message: Explicitly import org.semanticmoby.ref.tools.db.DBConnection to disambiguate from Jena's DBConnection class moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets KeywordSearchServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/10/09 01:11:21 1.5 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/10/14 21:29:54 1.6 @@ -9,6 +9,7 @@ import org.semanticmoby.ref.tools.*; import org.semanticmoby.ref.tools.db.*; +import org.semanticmoby.ref.tools.db.DBConnection; import org.semanticmoby.tools.Util; From gss at pub.open-bio.org Fri Oct 14 17:56:18 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri Oct 14 18:45:38 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510142156.j9ELuI8i025115@pub.open-bio.org> gss Fri Oct 14 17:56:18 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv25090/S-MOBY/ref-impl/semanticmoby.org/build Modified Files: build.xml Log Message: Removed jalopy stuff moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/10/09 01:17:49 1.6 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/10/14 21:56:18 1.7 @@ -140,26 +140,4 @@ - - - - - - - - - - - - - - - - - - - - - From gss at pub.open-bio.org Fri Oct 14 17:56:43 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri Oct 14 18:46:03 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510142156.j9ELuh4p025148@pub.open-bio.org> gss Fri Oct 14 17:56:43 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv25123/S-MOBY/ref-impl/core/build Modified Files: build.xml Log Message: Removed jalopy stuff moby-live/S-MOBY/ref-impl/core/build build.xml,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/10/09 01:33:06 1.4 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/10/14 21:56:43 1.5 @@ -54,28 +54,9 @@ - - - - - - - - - - - - - - - - - - - - - + + + From senger at pub.open-bio.org Tue Oct 18 13:19:56 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 18 14:08:51 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181719.j9IHJuGC015973@pub.open-bio.org> senger Tue Oct 18 13:19:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv15954 Modified Files: TestingCentral.java Log Message: moby-live/Java/src/Clients TestingCentral.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/22 16:07:08 1.7 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/10/18 17:19:56 1.8 @@ -276,8 +276,8 @@ simpleData.addNamespace (namespace1); MobyPrimaryDataSet collection = new MobyPrimaryDataSet ("Collection_A"); collection.addElement (simpleData1); - collection.addElement (simpleData2); - collection.addElement (simpleData3); +// collection.addElement (simpleData2); +// collection.addElement (simpleData3); MobySecondaryData secData1 = helper.createSecondaryData ("Secondary_A", "Integer"); MobySecondaryData secData2 = helper.createSecondaryData ("Secondary_B", "String"); From kawas at pub.open-bio.org Tue Oct 18 14:06:26 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Oct 18 14:55:20 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181806.j9II6QDB016176@pub.open-bio.org> kawas Tue Oct 18 14:06:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/guide In directory pub.open-bio.org:/tmp/cvs-serv16152/guide Log Message: Directory /home/repository/moby/moby-live/Java/docs/guide added to the repository moby-live/Java/docs/guide - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 14:06:42 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Oct 18 14:55:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181806.j9II6g7I016208@pub.open-bio.org> kawas Tue Oct 18 14:06:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/workflows In directory pub.open-bio.org:/tmp/cvs-serv16184/workflows Log Message: Directory /home/repository/moby/moby-live/Java/docs/workflows added to the repository moby-live/Java/docs/workflows - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 14:26:03 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Oct 18 15:14:58 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181826.j9IIQ3AD016380@pub.open-bio.org> kawas Tue Oct 18 14:26:03 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/guide In directory pub.open-bio.org:/tmp/cvs-serv16359 Added Files: AddRegEndpoint.png addDNAtoModel.png addingMelting.png availableProcessorsContextC.png availableServices.png completeDnasequence.png connectString2DNA.png contextObjectDetails.png dnaConnectedMelting.png dnasequence&comps.png dnasequence.png index.html msdAddToWorkflow.png objectContextMenu.png objectTooltip.png processorsView.png results.png serviceContextClick.png serviceDescription.png serviceTooltip.png tutorialWorkflow.xml tutorialWorkflowInput.xml workflowComplete.png Log Message: adding the taverna guide files for version 1.3 moby-live/Java/docs/guide AddRegEndpoint.png,NONE,1.1 addDNAtoModel.png,NONE,1.1 addingMelting.png,NONE,1.1 availableProcessorsContextC.png,NONE,1.1 availableServices.png,NONE,1.1 completeDnasequence.png,NONE,1.1 connectString2DNA.png,NONE,1.1 contextObjectDetails.png,NONE,1.1 dnaConnectedMelting.png,NONE,1.1 dnasequence&comps.png,NONE,1.1 dnasequence.png,NONE,1.1 index.html,NONE,1.1 msdAddToWorkflow.png,NONE,1.1 objectContextMenu.png,NONE,1.1 objectTooltip.png,NONE,1.1 processorsView.png,NONE,1.1 results.png,NONE,1.1 serviceContextClick.png,NONE,1.1 serviceDescription.png,NONE,1.1 serviceTooltip.png,NONE,1.1 tutorialWorkflow.xml,NONE,1.1 tutorialWorkflowInput.xml,NONE,1.1 workflowComplete.png,NONE,1.1 From kawas at pub.open-bio.org Tue Oct 18 14:27:17 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Oct 18 15:16:12 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181827.j9IIRHnq016447@pub.open-bio.org> kawas Tue Oct 18 14:27:17 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/workflows In directory pub.open-bio.org:/tmp/cvs-serv16400 Added Files: 1 - workflow.xml 1 - workflowInput.xml 10 - GeneInfo workflow.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml 8 - hmm dragon workflow.xml 9 - DNASequenceHolder element.xml readme.txt Log Message: some example workflows moby-live/Java/docs/workflows 1 - workflow.xml,NONE,1.1 1 - workflowInput.xml,NONE,1.1 10 - GeneInfo workflow.xml,NONE,1.1 2 - blastDragonDbWorkflow.xml,NONE,1.1 3 - cos_fixedInput.xml,NONE,1.1 4 - characterizeGeneticElement.xml,NONE,1.1 5 - BlastQueryAgainstAraProteinsE13.xml,NONE,1.1 6 - compareKeywordAndSimilarity.xml,NONE,1.1 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,NONE,1.1 8 - hmm dragon workflow.xml,NONE,1.1 9 - DNASequenceHolder element.xml,NONE,1.1 readme.txt,NONE,1.1 rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/10,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/GeneInfo,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/8,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/hmm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/dragon,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/9,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/DNASequenceHolder,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 14:37:10 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Oct 18 15:26:04 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181837.j9IIbABX016533@pub.open-bio.org> kawas Tue Oct 18 14:37:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv16508/org/biomoby/shared/extended Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended added to the repository moby-live/Java/src/main/org/biomoby/shared/extended - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 14:37:13 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Oct 18 15:26:09 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181837.j9IIbDBE016567@pub.open-bio.org> kawas Tue Oct 18 14:37:13 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv16546/org/biomoby/shared/extended Added Files: NamespaceParser.java DataTypeParser.java ServiceTypeParser.java Log Message: preliminary versions of the files that parse rdf and return their respective objects. moby-live/Java/src/main/org/biomoby/shared/extended NamespaceParser.java,NONE,1.1 DataTypeParser.java,NONE,1.1 ServiceTypeParser.java,NONE,1.1 From senger at pub.open-bio.org Tue Oct 18 16:00:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 18 16:49:40 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182000.j9IK0kDL016904@pub.open-bio.org> senger Tue Oct 18 16:00:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna In directory pub.open-bio.org:/tmp/cvs-serv16886/taverna Log Message: Directory /home/repository/moby/moby-live/Java/docs/taverna added to the repository moby-live/Java/docs/taverna - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:00:56 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 18 16:49:51 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182000.j9IK0uiq016946@pub.open-bio.org> senger Tue Oct 18 16:00:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv16928/taverna/guide Log Message: Directory /home/repository/moby/moby-live/Java/docs/taverna/guide added to the repository moby-live/Java/docs/taverna/guide - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/guide/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/guide/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/guide/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:01:07 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 18 16:50:02 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182001.j9IK17P8016990@pub.open-bio.org> senger Tue Oct 18 16:01:07 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/workflows In directory pub.open-bio.org:/tmp/cvs-serv16972/taverna/workflows Log Message: Directory /home/repository/moby/moby-live/Java/docs/taverna/workflows added to the repository moby-live/Java/docs/taverna/workflows - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:12:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 18 17:01:33 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCagA017232@pub.open-bio.org> senger Tue Oct 18 16:12:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/guide In directory pub.open-bio.org:/tmp/cvs-serv17192/guide Removed Files: AddRegEndpoint.png addDNAtoModel.png addingMelting.png availableProcessorsContextC.png availableServices.png completeDnasequence.png connectString2DNA.png contextObjectDetails.png dnaConnectedMelting.png dnasequence&comps.png dnasequence.png index.html msdAddToWorkflow.png objectContextMenu.png objectTooltip.png processorsView.png results.png serviceContextClick.png serviceDescription.png serviceTooltip.png tutorialWorkflow.xml tutorialWorkflowInput.xml workflowComplete.png Log Message: moby-live/Java/docs/guide AddRegEndpoint.png,1.1,NONE addDNAtoModel.png,1.1,NONE addingMelting.png,1.1,NONE availableProcessorsContextC.png,1.1,NONE availableServices.png,1.1,NONE completeDnasequence.png,1.1,NONE connectString2DNA.png,1.1,NONE contextObjectDetails.png,1.1,NONE dnaConnectedMelting.png,1.1,NONE dnasequence&comps.png,1.1,NONE dnasequence.png,1.1,NONE index.html,1.1,NONE msdAddToWorkflow.png,1.1,NONE objectContextMenu.png,1.1,NONE objectTooltip.png,1.1,NONE processorsView.png,1.1,NONE results.png,1.1,NONE serviceContextClick.png,1.1,NONE serviceDescription.png,1.1,NONE serviceTooltip.png,1.1,NONE tutorialWorkflow.xml,1.1,NONE tutorialWorkflowInput.xml,1.1,NONE workflowComplete.png,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/AddRegEndpoint.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/addDNAtoModel.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/addingMelting.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/availableProcessorsContextC.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/availableServices.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/completeDnasequence.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/connectString2DNA.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/contextObjectDetails.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/dnaConnectedMelting.png,v: No such file or directory sh: line 1: comps.png: command not found rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/dnasequence.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/index.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/msdAddToWorkflow.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/objectContextMenu.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/objectTooltip.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/processorsView.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/results.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/serviceContextClick.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/serviceDescription.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/serviceTooltip.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/tutorialWorkflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/tutorialWorkflowInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/workflowComplete.png,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:12:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 18 17:01:34 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCasM017247@pub.open-bio.org> senger Tue Oct 18 16:12:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv17192/taverna/guide Added Files: AddRegEndpoint.png addDNAtoModel.png addingMelting.png availableProcessorsContextC.png availableServices.png completeDnasequence.png connectString2DNA.png contextObjectDetails.png dnaConnectedMelting.png dnasequence&comps.png dnasequence.png index.html msdAddToWorkflow.png objectContextMenu.png objectTooltip.png processorsView.png results.png serviceContextClick.png serviceDescription.png serviceTooltip.png tutorialWorkflow.xml tutorialWorkflowInput.xml workflowComplete.png Log Message: moby-live/Java/docs/taverna/guide AddRegEndpoint.png,NONE,1.1 addDNAtoModel.png,NONE,1.1 addingMelting.png,NONE,1.1 availableProcessorsContextC.png,NONE,1.1 availableServices.png,NONE,1.1 completeDnasequence.png,NONE,1.1 connectString2DNA.png,NONE,1.1 contextObjectDetails.png,NONE,1.1 dnaConnectedMelting.png,NONE,1.1 dnasequence&comps.png,NONE,1.1 dnasequence.png,NONE,1.1 index.html,NONE,1.1 msdAddToWorkflow.png,NONE,1.1 objectContextMenu.png,NONE,1.1 objectTooltip.png,NONE,1.1 processorsView.png,NONE,1.1 results.png,NONE,1.1 serviceContextClick.png,NONE,1.1 serviceDescription.png,NONE,1.1 serviceTooltip.png,NONE,1.1 tutorialWorkflow.xml,NONE,1.1 tutorialWorkflowInput.xml,NONE,1.1 workflowComplete.png,NONE,1.1 From senger at pub.open-bio.org Tue Oct 18 16:12:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 18 17:01:34 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCbCJ017279@pub.open-bio.org> senger Tue Oct 18 16:12:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/workflows In directory pub.open-bio.org:/tmp/cvs-serv17192/taverna/workflows Added Files: 1 - workflow.xml 1 - workflowInput.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml readme.txt Log Message: moby-live/Java/docs/taverna/workflows 1 - workflow.xml,NONE,1.1 1 - workflowInput.xml,NONE,1.1 2 - blastDragonDbWorkflow.xml,NONE,1.1 3 - cos_fixedInput.xml,NONE,1.1 4 - characterizeGeneticElement.xml,NONE,1.1 5 - BlastQueryAgainstAraProteinsE13.xml,NONE,1.1 6 - compareKeywordAndSimilarity.xml,NONE,1.1 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,NONE,1.1 readme.txt,NONE,1.1 rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:12:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 18 17:01:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCbZk017338@pub.open-bio.org> senger Tue Oct 18 16:12:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/workflows In directory pub.open-bio.org:/tmp/cvs-serv17192/workflows Removed Files: 1 - workflow.xml 1 - workflowInput.xml 10 - GeneInfo workflow.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml 8 - hmm dragon workflow.xml 9 - DNASequenceHolder element.xml readme.txt Log Message: moby-live/Java/docs/workflows 1 - workflow.xml,1.1,NONE 1 - workflowInput.xml,1.1,NONE 10 - GeneInfo workflow.xml,1.1,NONE 2 - blastDragonDbWorkflow.xml,1.1,NONE 3 - cos_fixedInput.xml,1.1,NONE 4 - characterizeGeneticElement.xml,1.1,NONE 5 - BlastQueryAgainstAraProteinsE13.xml,1.1,NONE 6 - compareKeywordAndSimilarity.xml,1.1,NONE 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,1.1,NONE 8 - hmm dragon workflow.xml,1.1,NONE 9 - DNASequenceHolder element.xml,1.1,NONE readme.txt,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflowInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/10,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/GeneInfo,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/blastDragonDbWorkflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/cos_fixedInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/characterizeGeneticElement.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/BlastQueryAgainstAraProteinsE13.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/compareKeywordAndSimilarity.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/compareKeywordAndSimilarityAndPhytoprot_count.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/8,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/hmm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/dragon,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/9,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/DNASequenceHolder,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/element.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/readme.txt,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:15:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 18 17:04:32 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182015.j9IKFbGv017439@pub.open-bio.org> senger Tue Oct 18 16:15:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv17420 Modified Files: index.html Log Message: moby-live/Java/docs index.html,1.15,1.16 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/index.html,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- /home/repository/moby/moby-live/Java/docs/index.html 2005/09/21 07:56:55 1.15 +++ /home/repository/moby/moby-live/Java/docs/index.html 2005/10/18 20:15:37 1.16 @@ -46,6 +46,7 @@

  • Command-line clients
  • Integration with Eclipse
  • Some issues with using jMoby on MS-Windows platform +
  • How to use the BioMoby plugin in Taverna
  • Integration with Taverna
  • RDF Agent @@ -91,7 +92,7 @@
    Martin Senger
    -Last modified: Wed Sep 21 15:27:30 2005 +Last modified: Tue Oct 18 22:04:57 2005
    From kawas at pub.open-bio.org Wed Oct 19 18:00:26 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Oct 19 18:49:24 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192200.j9JM0QvH021394@pub.open-bio.org> kawas Wed Oct 19 18:00:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv21367 Modified Files: index.html Added Files: InstallingLocalMOBYCentral.html Log Message: added an installing mobycentral link moby-live/Java/docs/taverna/guide InstallingLocalMOBYCentral.html,NONE,1.1 index.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/18 20:12:36 1.1 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:00:26 1.2 @@ -1,200 +1,400 @@ - - - - -The 'new' BioMoby plugin For Taverna - - - -

    How to use the BioMoby plugin in Taverna 1.3

    -
    -

    Introduction

    -
    -

    We updated the BioMoby plugin so that we could add functionality that we believed was missing.

    -

    In the past, users of the plugin were forced to start every Moby based workflow with the root Moby
    - datatype. In other words, you were able to utilize a local widget called 'create_moby_data', however,
    - the Moby data really was just the root datatype in disguise.

    -

    In addition, in Taverna releases prior to version 1.2, the BioMoby services were always limited to one
    - input and one output. This worked for many of the Moby services, but for those wishing to create a
    - workflow that initally utilized a service with more inputs, that option just wasn't available.

    -
    -

    New Features

    -
    -

    The updated BioMoby plugin contains many new features. Some of these features include the following:

    -
      -
    • The ability to work with any datatype in the MobyCentral Object ontology
    • -
    • The ability to utilize services with more than 1 input or output
    • -
    • The ability to obtain useful information regarding the datatypes or services
    • -
    • The addition of Moby collection support (currently handles only collections as inputs, not outputs)
    • -
    • The ability to completely add a Moby data type with all of its sub components to a workflow
    • -
    -

    To start using these new features, please follow the short tutorial below!

    -
    -

    Tutorial

    -
    -

    Creating a BioMoby Scavenger

    -
    -

    Creating a new BioMoby scavenger has never been easier! In fact, if you are familar with Taverna,
    - then adding a BioMoby scavenger is just like adding any other scavenger.

    -

    Starting from the 'Available Services' window, you will need to context click the folder labeled
    - 'Available Processors'. Below is a image illustrating the 'Available Services' window.

    -

    Available Services Window

    -

    Performing a context click on the selected folder reveals the following menu. Notice how
    - we chose to add new BioMoby scavenger.

    -

    Scavengers that we can choose from

    -

    Upon making our selection, we will be prompted to enter certain information that will allow Taverna
    - to create our scavenger. The information that we need to provide includes the URL of the BioMoby
    - central registry that we would like to use, as well as the URL of the RDF document describing the
    - BioMoby datatype ontology.

    -

    Enter your registry details

    -

    You may now be scratching your head, and are wondering why you have never heard of this RDF document.
    - Currently, this location is undocumented in the Moby API, and the API will be supplemented with this information
    - at a later time. At the time that this tutorial was written, there was only one location known for this RDF document
    - and it is the default one in Taverna (shown above) - .

    -

    Once the information has been inputted into the text boxes, the Moby services and datatypes will now be available
    - as processors in the 'Available Services' window.

    -

    The service and datatype ontologies are illustrated

    -

    If you would like to work with your own custom Mobycentral registry and not that of the default, http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl, then it is recommended that you edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    -
    -

    Creating a workflow

    -
    -

    Workflow used in this tutorial may be downloaded here.
    - Workflow input used in this tutorial may be downloaded here.

    -

    Creating a workflow with the new BioMoby plugin is as easy as it was using the previous plugin. There are, of course,
    - a few - differences. When creating workflows, it is no longer necessary to use the local widget 'create_moby_data'.
    - When you are ready to instantiate a Moby datatype, all that is necessary is for you to choose the datatype from the list
    - of 'Available Processors' under the 'Moby Objects' folder.

    -

    As an example, we will add the Moby datatype called DNASequence to our workflow. In order to do this, we must
    - navigate the datatype ontology to find DNASequence. We can find DNASequence by traversing the 'Moby Objects'
    - tree in the following order: - Object, VirtualSequence, GenericSequence, NucleotideSequence and finally DNASequence.
    - Now that we have found the processor that we were looking for, let's add it to the workflow.

    -

    Adding the datatype DNASequence to the workflow

    -

    'DNASequence' has now been added to the workflow diagram. To reveal what inputs and outputs this processor
    - utilizes, we need to ask Taverna to show us all of the ports in the workflow diagram.

    -

    DNASequence and all of its ports

    -

    Notice how 'DNASequence' takes as input a namespace, an id, an article name, and 2 Moby datatypes: String and
    - Integer. Since 'String' and 'Integer' are Moby datatypes contained within a 'DNASequence', they have been conveniently
    - added to the workflow and linked appropriately.

    -

    Our workflow diagram -looks something like the following:

    -

    A DNASequence with all of its sub components connected to it

    -

    A complex BioMoby datatype. 'DNASequence', and all of its subcomponents have now been added to our workflow.
    - Next we will add a BioMoby service processor that handles our complex datatype.

    -

    We will add the service 'runFasta' from the authority 'www.pcm.uam.es'. This service runs the fasta tool on the input
    - sequence - . From the list of processors, we will navigate to www.pcm.uam.es and then choose the service that we are
    - interested in, i.e. 'runFasta'.

    -

    Adding the runFasta processor

    -

    The next thing to do is to connect the input of the 'runFasta' processor to the output of 'DNASequence'. It should be noted
    - that there are 2 inputs to the processor 'runFasta': 'GenericSequence(_ANON_)' and 'input'. The port labelled 'input' serves to
    - support workflows created prior to Taverna 1.2 and should be used when you create workflows utilizing the Local Widgets
    - 'create_moby_data'. - For our workflow, we will connect the complex datatype 'DNASequence' to the input port labeled
    - 'DNASequence(sequence)' of the 'runFasta' processor.

    -

    DNASequence datatype connected to the Melting service

    -

    We are almost done! The only things that are missing now are the workflow inputs and the workflow outputs. We will create
    - the following inputs:

    -
      -
    • namespace - this input will connect to the 'namespace' input port of 'DNASequence'
    • -
    • id - this input will connect to the 'id' input port of 'DNASequence'
    • -
    • sequence - this input will connect to the 'value' input port of 'String'
    • -
    • length - this input will connect to the 'value' input port of 'Integer'
    • -
    -

    We will also create a workflow output called 'output'. This workflow output will be connected to the
    - output port, 'FASTA_Text(_ANON_)' of the processor 'runFasta'.

    -

    Once these connections have been made, you should have something similar to the image below. Note that the image is only showing
    - those ports that are bound to inputs or outputs.

    -

    A completed workflow Diagram

    -

    So there we have a completed workflow based on BioMoby Services and datatypes. If you wish to run this
    - workflow, some suitable values for the workflow inputs are as follows:

    -
      -
    • namespace - NCBI_gi
    • -
    • id - 646464
    • -
    • sequence - tatata
    • -
    • length - 6
    • -
    -

    The output from this data is shown below.

    -

    The results from running our workflow

    -
    -

    Obtaining information on a Moby datatype

    -
    -

    One of the neatest things added to the plugin was the ability to obtain information regarding BioMoby datatypes. For
    - instance, you can find out what services a particular datatype can be used as input or output. In addition, you can find
    - the descriptions of those services.

    -

    As an example, imagine that we wanted to discover what services the Moby datatype 'Integer' feeds into. To do this, we
    - can use our existing workflow. From the 'Advanced model explorer' window, context click on the processor called 'Integer'
    - and choose 'Moby Object Details'.

    -

    Finding out more about a particular Moby Datatype

    -

    As soon as you choose 'Moby Object Details', a pop up window appears and embedded in that window
    - is a tree like structure. Note that this window can take up to a minute to appear depending on your
    - internet connection and the data type chosen.
    At the root of the tree is the datatype that we chose to
    - know more about, in our case - 'Integer', and 2 sub trees labeled 'Feeds into' and 'Produced by'. In the
    - 'Feeds into' sub tree, you will find out - what BioMoby services consume the datatype in question, sorted by
    - authority.

    -

    When you navigate the sub tree - and mouse over the service name, a tool tip appears giving you the
    - description of the service.

    -

    Tool tip provided to describe the service that consumes our datatype

    -

    In addition, you can context click the service name, in this case - PupaSNP, - and a menu is shown:

    -

    Moby Object Details Context Menu

    -

    From this menu, you can choose to either add the selected service to the workflow or view more a more detailed
    - service description. Below, the window that appears upon choosing to 'Find out about PupaSNP':

    -

    Moby Service Description

    -

     

    -

    The sub tree - 'Produced by' offers similar information, except about services that produce the datatype in question.
    - The context menu is not available for children of the 'Produced by' node.

    -

     

    -
    -

    Obtaining information on a Moby service

    -
    -

    As with Moby datatypes, information about services is also available. For a particular service, we can determine
    - what are the inputs and outputs. And if you wish, you may add the input datatypes to the workflow.In addition,
    - we can also discover what namespaces a particular input or output - is valid in.

    -

    Using the workflow that we created above, we can discover what inputs and outputs 'runFasta' utilize. To determine this,
    - we need to context click on the 'runFasta' processor from the 'Advanced model explorer', just as we had done before
    - with the Moby datatype processors above, and choose 'Moby Service Details'.

    -

    Context clicking a Moby service to retrieve additional information

    -

    A pop window appears and embedded in it is a tree that has as its root the name of the Moby
    - service. The children of the root node are 2 sub trees, 'Inputs' and 'Outputs'. The items under
    - these sub trees simply illustrate what datatypes the service consumes and produces.

    -

    The window showing the service details and a tooltip describing the output of the service

    -

    Similarly to the 'Moby Object Details', you can either add the input datatype to the workflow or
    - obtain additional information on the datatype:

    -

    Moby Service Details Context Menu

    -

     

    -
    -
    -

    What's Next

    -
    -

    In the future, we hope to add even more functionality to the plugin. Below are some of the features that
    - we have thought about:

    -
      -
    • Adding collection support that behaves as stated in the BioMoby API
    • -
    • Adding the ability to parse Moby datatypes and pass this parsed data onto other non Moby services.
    • -
    • Adding the ability to add Moby services from the 'Moby Object Details' window.
    • -
    -

    If there are specific features that you would like us to consider, please contact the BioMoby development
    - team.

    -
    -

    Comments / Questions

    -
    -

    If you have any questions or comments, please feel free to contact Eddie Kawas @
    - edward[DoT]kawas[AT]gmail[DoT]com

    -

    If you have any suggestions regarding new features or you would like to report a bug,
    - please let me know.

    -

     

    -

     

    -
    -
    - - + + + + + + + + +The 'new' BioMoby plugin For Taverna + + + + + + + +

    How to use the BioMoby plugin in Taverna 1.3

    + +
    + +

    Introduction

    + +
    + +

    We updated the BioMoby plugin so that we could add functionality that we believed was missing.

    + +

    In the past, users of the plugin were forced to start every Moby based workflow with the root Moby
    + + datatype. In other words, you were able to utilize a local widget called 'create_moby_data', however,
    + + the Moby data really was just the root datatype in disguise.

    + +

    In addition, in Taverna releases prior to version 1.2, the BioMoby services were always limited to one
    + + input and one output. This worked for many of the Moby services, but for those wishing to create a
    + + workflow that initally utilized a service with more inputs, that option just wasn't available.

    + +
    + +

    New Features

    + +
    + +

    The updated BioMoby plugin contains many new features. Some of these features include the following:

    + +
      + +
    • The ability to work with any datatype in the MobyCentral Object ontology
    • + +
    • The ability to utilize services with more than 1 input or output
    • + +
    • The ability to obtain useful information regarding the datatypes or services
    • + +
    • The addition of Moby collection support (currently handles only collections as inputs, not outputs)
    • + +
    • The ability to completely add a Moby data type with all of its sub components to a workflow
    • + +
    + +

    To start using these new features, please follow the short tutorial below!

    + +
    + +

    Tutorial

    + +
    + +

    Creating a BioMoby Scavenger

    + +
    + +

    Creating a new BioMoby scavenger has never been easier! In fact, if you are familar with Taverna,
    + + then adding a BioMoby scavenger is just like adding any other scavenger.

    + +

    Starting from the 'Available Services' window, you will need to context click the folder labeled
    + + 'Available Processors'. Below is a image illustrating the 'Available Services' window.

    + +

    Available Services Window

    + +

    Performing a context click on the selected folder reveals the following menu. Notice how
    + + we chose to add new BioMoby scavenger.

    + +

    Scavengers that we can choose from

    + +

    Upon making our selection, we will be prompted to enter certain information that will allow Taverna
    + + to create our scavenger. The information that we need to provide includes the URL of the BioMoby
    + + central registry that we would like to use, as well as the URL of the RDF document describing the
    + + BioMoby datatype ontology.

    + +

    Enter your registry details

    + +

    You may now be scratching your head, and are wondering why you have never heard of this RDF document.
    + + Currently, this location is undocumented in the Moby API, and the API will be supplemented with this information
    + + at a later time. At the time that this tutorial was written, there was only one location known for this RDF document
    + + and it is the default one in Taverna (shown above) + + .

    + +

    Once the information has been inputted into the text boxes, the Moby services and datatypes will now be available
    + + as processors in the 'Available Services' window.

    + +

    The service and datatype ontologies are illustrated

    + +

    If you would like to work with your own custom Mobycentral registry and not that of the default, http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl, then it is recommended that you edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    +

    If you would like to host your own local custom registry, please click here.

    +
    + +

    Creating a workflow

    + +
    + +

    Workflow used in this tutorial may be downloaded here.
    + + Workflow input used in this tutorial may be downloaded here.

    + +

    Creating a workflow with the new BioMoby plugin is as easy as it was using the previous plugin. There are, of course,
    + + a few + + differences. When creating workflows, it is no longer necessary to use the local widget 'create_moby_data'.
    + + When you are ready to instantiate a Moby datatype, all that is necessary is for you to choose the datatype from the list
    + + of 'Available Processors' under the 'Moby Objects' folder.

    + +

    As an example, we will add the Moby datatype called DNASequence to our workflow. In order to do this, we must
    + + navigate the datatype ontology to find DNASequence. We can find DNASequence by traversing the 'Moby Objects'
    + + tree in the following order: + + Object, VirtualSequence, GenericSequence, NucleotideSequence and finally DNASequence.
    + + Now that we have found the processor that we were looking for, let's add it to the workflow.

    + +

    Adding the datatype DNASequence to the workflow

    + +

    'DNASequence' has now been added to the workflow diagram. To reveal what inputs and outputs this processor
    + + utilizes, we need to ask Taverna to show us all of the ports in the workflow diagram.

    + +

    DNASequence and all of its ports

    + +

    Notice how 'DNASequence' takes as input a namespace, an id, an article name, and 2 Moby datatypes: String and
    + + Integer. Since 'String' and 'Integer' are Moby datatypes contained within a 'DNASequence', they have been conveniently
    + + added to the workflow and linked appropriately.

    + +

    Our workflow diagram + +looks something like the following:

    + +

    A DNASequence with all of its sub components connected to it

    + +

    A complex BioMoby datatype. 'DNASequence', and all of its subcomponents have now been added to our workflow.
    + + Next we will add a BioMoby service processor that handles our complex datatype.

    + +

    We will add the service 'runFasta' from the authority 'www.pcm.uam.es'. This service runs the fasta tool on the input
    + + sequence + + . From the list of processors, we will navigate to www.pcm.uam.es and then choose the service that we are
    + + interested in, i.e. 'runFasta'.

    + +

    Adding the runFasta processor

    + +

    The next thing to do is to connect the input of the 'runFasta' processor to the output of 'DNASequence'. It should be noted
    + + that there are 2 inputs to the processor 'runFasta': 'GenericSequence(_ANON_)' and 'input'. The port labelled 'input' serves to
    + + support workflows created prior to Taverna 1.2 and should be used when you create workflows utilizing the Local Widgets
    + + 'create_moby_data'. + + For our workflow, we will connect the complex datatype 'DNASequence' to the input port labeled
    + + 'DNASequence(sequence)' of the 'runFasta' processor.

    + +

    DNASequence datatype connected to the Melting service

    + +

    We are almost done! The only things that are missing now are the workflow inputs and the workflow outputs. We will create
    + + the following inputs:

    + +
      + +
    • namespace - this input will connect to the 'namespace' input port of 'DNASequence'
    • + +
    • id - this input will connect to the 'id' input port of 'DNASequence'
    • + +
    • sequence - this input will connect to the 'value' input port of 'String'
    • + +
    • length - this input will connect to the 'value' input port of 'Integer'
    • + +
    + +

    We will also create a workflow output called 'output'. This workflow output will be connected to the
    + + output port, 'FASTA_Text(_ANON_)' of the processor 'runFasta'.

    + +

    Once these connections have been made, you should have something similar to the image below. Note that the image is only showing
    + + those ports that are bound to inputs or outputs.

    + +

    A completed workflow Diagram

    + +

    So there we have a completed workflow based on BioMoby Services and datatypes. If you wish to run this
    + + workflow, some suitable values for the workflow inputs are as follows:

    + +
      + +
    • namespace - NCBI_gi
    • + +
    • id - 646464
    • + +
    • sequence - tatata
    • + +
    • length - 6
    • + +
    + +

    The output from this data is shown below.

    + +

    The results from running our workflow

    + +
    + +

    Obtaining information on a Moby datatype

    + +
    + +

    One of the neatest things added to the plugin was the ability to obtain information regarding BioMoby datatypes. For
    + + instance, you can find out what services a particular datatype can be used as input or output. In addition, you can find
    + + the descriptions of those services.

    + +

    As an example, imagine that we wanted to discover what services the Moby datatype 'Integer' feeds into. To do this, we
    + + can use our existing workflow. From the 'Advanced model explorer' window, context click on the processor called 'Integer'
    + + and choose 'Moby Object Details'.

    + +

    Finding out more about a particular Moby Datatype

    + +

    As soon as you choose 'Moby Object Details', a pop up window appears and embedded in that window
    + + is a tree like structure. Note that this window can take up to a minute to appear depending on your
    + + internet connection and the data type chosen.
    At the root of the tree is the datatype that we chose to
    + + know more about, in our case + + 'Integer', and 2 sub trees labeled 'Feeds into' and 'Produced by'. In the
    + + 'Feeds into' sub tree, you will find out + + what BioMoby services consume the datatype in question, sorted by
    + + authority.

    + +

    When you navigate the sub tree + + and mouse over the service name, a tool tip appears giving you the
    + + description of the service.

    + +

    Tool tip provided to describe the service that consumes our datatype

    + +

    In addition, you can context click the service name, in this case + + PupaSNP, + + and a menu is shown:

    + +

    Moby Object Details Context Menu

    + +

    From this menu, you can choose to either add the selected service to the workflow or view more a more detailed
    + + service description. Below, the window that appears upon choosing to 'Find out about PupaSNP':

    + +

    Moby Service Description

    + +

     

    + +

    The sub tree + + 'Produced by' offers similar information, except about services that produce the datatype in question.
    + + The context menu is not available for children of the 'Produced by' node.

    + +

     

    + +
    + +

    Obtaining information on a Moby service

    + +
    + +

    As with Moby datatypes, information about services is also available. For a particular service, we can determine
    + + what are the inputs and outputs. And if you wish, you may add the input datatypes to the workflow.In addition,
    + + we can also discover what namespaces a particular input or output + + is valid in.

    + +

    Using the workflow that we created above, we can discover what inputs and outputs 'runFasta' utilize. To determine this,
    + + we need to context click on the 'runFasta' processor from the 'Advanced model explorer', just as we had done before
    + + with the Moby datatype processors above, and choose 'Moby Service Details'.

    + +

    Context clicking a Moby service to retrieve additional information

    + +

    A pop window appears and embedded in it is a tree that has as its root the name of the Moby
    + + service. The children of the root node are 2 sub trees, 'Inputs' and 'Outputs'. The items under
    + + these sub trees simply illustrate what datatypes the service consumes and produces.

    + +

    The window showing the service details and a tooltip describing the output of the service

    + +

    Similarly to the 'Moby Object Details', you can either add the input datatype to the workflow or
    + + obtain additional information on the datatype:

    + +

    Moby Service Details Context Menu

    + +

     

    + +
    + +
    + +

    What's Next

    + +
    + +

    In the future, we hope to add even more functionality to the plugin. Below are some of the features that
    + + we have thought about:

    + +
      + +
    • Adding collection support that behaves as stated in the BioMoby API
    • + +
    • Adding the ability to parse Moby datatypes and pass this parsed data onto other non Moby services.
    • + +
    • Adding the ability to add Moby services from the 'Moby Object Details' window.
    • + +
    + +

    If there are specific features that you would like us to consider, please contact the BioMoby development
    + + team.

    + +
    + +

    Comments / Questions

    + +
    + +

    If you have any questions or comments, please feel free to contact Eddie Kawas @
    + + edward[DoT]kawas[AT]gmail[DoT]com

    + +

    If you have any suggestions regarding new features or you would like to report a bug,
    + + please let me know.

    + +

     

    + +

     

    + +
    + +
    + + + + + From kawas at pub.open-bio.org Wed Oct 19 18:13:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Oct 19 19:02:01 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192213.j9JMDBR4021823@pub.open-bio.org> kawas Wed Oct 19 18:13:11 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv21796 Modified Files: index.html Added Files: workflows.html Log Message: added a way to view the preconstructed workflows moby-live/Java/docs/taverna/guide workflows.html,NONE,1.1 index.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:00:26 1.2 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:13:11 1.3 @@ -61,7 +61,7 @@

    To start using these new features, please follow the short tutorial below!

    - +

    Click here to download BioMoby workflows.

    Tutorial

    From kawas at pub.open-bio.org Wed Oct 19 18:27:22 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Oct 19 19:16:11 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192227.j9JMRMuw022280@pub.open-bio.org> kawas Wed Oct 19 18:27:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv22255 Modified Files: index.html Log Message: added a question/answer and modified the scavenger section. moby-live/Java/docs/taverna/guide index.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:13:11 1.3 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:27:22 1.4 @@ -10,6 +10,14 @@ The 'new' BioMoby plugin For Taverna + @@ -92,29 +100,21 @@ to create our scavenger. The information that we need to provide includes the URL of the BioMoby
    - central registry that we would like to use, as well as the URL of the RDF document describing the
    - - BioMoby datatype ontology.

    + central registry that we would like to use. Note that only registries that implement the newest BioMoby
    + API are supported.

    Enter your registry details

    -

    You may now be scratching your head, and are wondering why you have never heard of this RDF document.
    - - Currently, this location is undocumented in the Moby API, and the API will be supplemented with this information
    - - at a later time. At the time that this tutorial was written, there was only one location known for this RDF document
    - - and it is the default one in Taverna (shown above) - - .

    -

    Once the information has been inputted into the text boxes, the Moby services and datatypes will now be available
    as processors in the 'Available Services' window.

    The service and datatype ontologies are illustrated

    -

    If you would like to work with your own custom Mobycentral registry and not that of the default, http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl, then it is recommended that you edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    +

    If you would like to work with your own custom Mobycentral registry and not that of the default,
    + http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl
    , then it is recommended that you
    + edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the
    + property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    If you would like to host your own local custom registry, please click here.

    @@ -375,13 +375,19 @@

    Comments / Questions

    -
    - +

    Questions

    +
      +
    1. How does one go about installing a local registry? +
      +

      To install your own registry, please go here.

      +
      +
    2. +
    +

     

    If you have any questions or comments, please feel free to contact Eddie Kawas @
    edward[DoT]kawas[AT]gmail[DoT]com

    -

    If you have any suggestions regarding new features or you would like to report a bug,
    please let me know.

    From kawas at pub.open-bio.org Wed Oct 19 18:34:38 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Oct 19 19:23:26 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192234.j9JMYcfH022536@pub.open-bio.org> kawas Wed Oct 19 18:34:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv22511 Modified Files: workflows.html Log Message: fixed the links - noticed that the workflows have a timestamp appended to them moby-live/Java/docs/taverna/guide workflows.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:13:11 1.1 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:34:38 1.2 @@ -1,22 +1,24 @@ - - Taverna Workflows - - + +Taverna Workflows + +

    Taverna Workflows

    -
     Name                    Last modified      Size  Description
    [   ] 1 - workflow.xml 13-Oct-2005 15:26 11K -[   ] 1 - workflowInput.xml 13-Oct-2005 15:26 4.6K -[   ] 2 - blastDragonDbWor..> 13-Oct-2005 15:26 10K -[   ] 3 - cos_fixedInput.xml 13-Oct-2005 15:26 4.1K -[   ] 4 - characterizeGene..> 13-Oct-2005 15:26 7.7K +
     Name                    Last modified      Size  Description
    [   ] 1 - workflow.xml 13-Oct-2005 15:26 11K +[   ] 1 - workflowInput.xml 13-Oct-2005 15:26 4.6K +[   ] 2 - blastDragonDbWor..> 13-Oct-2005 15:26 10K +[   ] 3 - cos_fixedInput.xml 13-Oct-2005 15:26 4.1K +[   ] 4 - characterizeGene..> 13-Oct-2005 15:26 7.7K -[   ] 5 - BlastQueryAgains..> 13-Oct-2005 15:26 3.0K -[   ] 6 - compareKeywordAn..> 13-Oct-2005 15:26 6.2K -[   ] 7 - compareKeywordAn..> 13-Oct-2005 15:26 13K -[   ] 8 - hmm dragon workf..> 13-Oct-2005 15:26 7.1K +[   ] 5 - BlastQueryAgains..> 13-Oct-2005 15:26 3.0K +[   ] 6 - compareKeywordAn..> 13-Oct-2005 15:26 6.2K +[   ] 7 - compareKeywordAn..> 13-Oct-2005 15:26 13K +[   ] 8 - hmm dragon workf..> 13-Oct-2005 15:26 7.1K [   ] 9 - DNASequenceHolde..> 13-Oct-2005 15:26 10K [TXT] readme.txt 13-Oct-2005 15:26 127 -
    - +
    +
    + + From kawas at pub.open-bio.org Wed Oct 19 18:41:03 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Oct 19 19:29:50 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192241.j9JMf33O022797@pub.open-bio.org> kawas Wed Oct 19 18:41:03 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/workflows In directory pub.open-bio.org:/tmp/cvs-serv22743 Modified Files: 1 - workflow.xml 1 - workflowInput.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml Added Files: 8 - hmm dragon workflow.xml 9 - DNASequenceHolder element.xml Log Message: removed some appended text from the workflows moby-live/Java/docs/taverna/workflows 8 - hmm dragon workflow.xml,NONE,1.1 9 - DNASequenceHolder element.xml,NONE,1.1 1 - workflow.xml,1.1,1.2 1 - workflowInput.xml,1.1,1.2 2 - blastDragonDbWorkflow.xml,1.1,1.2 3 - cos_fixedInput.xml,1.1,1.2 4 - characterizeGeneticElement.xml,1.1,1.2 5 - BlastQueryAgainstAraProteinsE13.xml,1.1,1.2 6 - compareKeywordAndSimilarity.xml,1.1,1.2 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,1.1,1.2 rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/8,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/hmm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/dragon,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/9,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/DNASequenceHolder,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/workflowInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/blastDragonDbWorkflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/cos_fixedInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/characterizeGeneticElement.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/BlastQueryAgainstAraProteinsE13.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/compareKeywordAndSimilarity.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/compareKeywordAndSimilarityAndPhytoprot_count.xml,v: No such file or directory From kawas at pub.open-bio.org Wed Oct 19 18:41:30 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Oct 19 19:30:18 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192241.j9JMfUx8022844@pub.open-bio.org> kawas Wed Oct 19 18:41:30 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv22817 Modified Files: workflows.html Log Message: missed a link moby-live/Java/docs/taverna/guide workflows.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:34:38 1.2 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:41:30 1.3 @@ -15,9 +15,9 @@ [   ] 6 - compareKeywordAn..> 13-Oct-2005 15:26 6.2K [   ] 7 - compareKeywordAn..> 13-Oct-2005 15:26 13K [   ] 8 - hmm dragon workf..> 13-Oct-2005 15:26 7.1K -[   ] 9 - DNASequenceHolde..> 13-Oct-2005 15:26 10K +[   ] 9 - DNASequenceHolde..> 13-Oct-2005 15:26 10K -[TXT] readme.txt 13-Oct-2005 15:26 127 +[TXT] readme.txt 13-Oct-2005 15:26 127
    From kawas at pub.open-bio.org Thu Oct 20 15:07:06 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Thu Oct 20 15:55:50 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510201907.j9KJ765R029709@pub.open-bio.org> kawas Thu Oct 20 15:07:06 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv29684/org/biomoby/shared/extended Modified Files: NamespaceParser.java Log Message: finished the logic using what is currently available in the rdf document that describes the namespace ontology. moby-live/Java/src/main/org/biomoby/shared/extended NamespaceParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/NamespaceParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/NamespaceParser.java 2005/10/18 18:37:13 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/NamespaceParser.java 2005/10/20 19:07:06 1.2 @@ -14,10 +14,24 @@ import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.RDFReader; +import com.hp.hpl.jena.rdf.model.ResIterator; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.vocabulary.RDF; +import com.hp.hpl.jena.vocabulary.RDFS; /** * * @author Eddie created Oct 18, 2005 + * This class parses the RDF document that describes the namespace ontology.

    + * An example of how to use this class is below: + *

    
    +        NamespaceParser p = new NamespaceParser("http://biomoby.org/RESOURCES/MOBY-S/Namespaces");
    +		MobyNamespace[] namespaces = p.getMobyNamespacesFromRDF();
    +		for (int i = 0; i < namespaces.length; i++) {
    +			System.out.println(namespaces[i]);
    +		}
    +   

    + This would output the following the name and description for each namespace in the document */ public class NamespaceParser { @@ -139,7 +153,18 @@ Model model = ModelFactory.createDefaultModel(); RDFReader reader = model.getReader(); reader.read(model, new StringReader(getRdfAsString()), null); - // TODO start querying the model and creating namespace objects + // get all subjects in the document + ResIterator iterator = model.listSubjects(); + while (iterator.hasNext()) { + Resource resource = iterator.nextResource(); + // extract the name of the namespace + String name = resource.getLocalName(); + MobyNamespace namespace = new MobyNamespace(name); + // extract the comment (a literal in the document) + String description = resource.getProperty(RDFS.comment).getLiteral().getString(); + namespace.setDescription(description); + list.add(namespace); + } // return the array return (MobyNamespace[]) list.toArray(new MobyNamespace[list.size()]); @@ -152,7 +177,6 @@ private String getRdfAsString() { String s = null; StringBuffer sb = new StringBuffer(); - URL url = null; try { BufferedReader in = null; in = new BufferedReader(new InputStreamReader(url.openStream())); @@ -165,4 +189,14 @@ } return sb.toString(); } + + + public static void main(String[] args) throws MobyException { + // show how to use this class + NamespaceParser p = new NamespaceParser("http://biomoby.org/RESOURCES/MOBY-S/Namespaces"); + MobyNamespace[] namespaces = p.getMobyNamespacesFromRDF(); + for (int i = 0; i < namespaces.length; i++) { + System.out.println(namespaces[i]); + } + } } From carrere at pub.open-bio.org Fri Oct 21 09:22:19 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Fri Oct 21 10:12:55 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510211322.j9LDMJIq001132@pub.open-bio.org> carrere Fri Oct 21 09:22:18 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv1100 Modified Files: MOBYXSLT.pm Log Message: Bug in getObjectHasaElements fixed. This function is very usefull for new ontology. To retrieve content (i.e. ...) of an object: my @a_hasa_elements = &MOBYXSLT::getObjectHasaElements($article); if ($#a_hasa_elements >= 0) { foreach my $hasa_element (@a_hasa_elements) { if (&MOBYXSLT::getObjectName($hasa_element) eq 'content') { $input_data = &MOBYXSLT::getObjectContent($hasa_element); } } } moby-live/Perl/MOBY MOBYXSLT.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/09/08 13:51:06 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/10/21 13:22:18 1.2 @@ -1,10 +1,8 @@ package MOBYXSLT; -use strict; -use Carp; -my $TMP_DIR = '/tmp/'; #Where your temporary files will be written -my $XSLTPROC = '/usr/bin/xsltproc'; #Where your xsltproc binary is located -my $XSL_SHEET = './xsl/parseMobyMessage.xsl';#Where your xsltproc style-sheet is located +my $TMP_DIR = '/tmp/';#Where your temporary files will be written +my $XSLTPROC = '/usr/bin/xsltproc';#Where your xsltproc binary is located +my $XSL_SHEET = '/bioinfo/www/bioinfo/services/biomoby/cgi-bin/Services/LIPM/lib/parseMobyMessage.xsl';#Where your xsltproc style-sheet is located #$Id$ @@ -31,8 +29,6 @@ =head1 SYNOPSIS -use MOBYXSLT; - sub MonWebservice { @@ -47,8 +43,8 @@ foreach my $query (@{$ra_queries}) { - my $query_id = MOBYXSLT::getInputID($query);#Retrieve Query ID - my @a_input_articles = MOBYXSLT::getArticles($query);#Retrieve articles + my $query_id = MOBYXSLT::getInputID($query);#Retrieve Query ID + my @a_input_articles = MOBYXSLT::getArticles($query);#Retrieve articles my ($fasta_sequences, $fasta_namespace, $fasta_id) = ('','',''); @@ -58,9 +54,9 @@ if (MOBYXSLT::isSimpleArticle($article)) { - my $object_type = MOBYXSLT::getObjectType($article); + my $object_type = MOBYXSLT::getObjectType($article); - if (IsTheCorrectType($object_type)) + if (IsTheCorrectType($object_type)) { $fasta_sequences = MOBYXSLT::getObjectContent($article); $fasta_namespace = MOBYXSLT::getObjectNamespace($article); @@ -80,10 +76,15 @@ ###### #What you want to do with your data ###### - + + my $cmd ="..."; + system("$cmd"); + + + ######### #Send result ######### @@ -106,19 +107,16 @@ my $XSL_SHEET = './parseMobyMessage.xsl'; #Where your xsltproc style-sheet is located -=head1 NOTE - - Many functions have same names as those from MOBY::CommonSubs - -=head1 AUTHORS +=head1 DESCRIPTION - Sebastien.Carrere@toulouse.inra.fr - -=head1 METHODS + Note: many functions have same names as those from MOBY::CommonSubs =cut +use strict; +use Carp; + =head2 function getInputs Title : getInputs @@ -151,6 +149,11 @@ close TMP; my $parsed_message = `$XSLTPROC $XSL_SHEET $TMP_DIR$tmp_file`; + +# open (PARSED, ">$TMP_DIR$tmp_file" . ".xsl"); +# print PARSED "$XSLTPROC $XSL_SHEET $TMP_DIR$tmp_file\n\n\n"; +# print PARSED "$parsed_message"; +# close PARSED; my $servicenotes = ''; my @a_queries = (); @@ -337,7 +340,7 @@ Function : Takes a simple article structure (from getArticles or getCollectedSimples) and retrieve the list of "HASA" element HASHREF Returns : @a_hasa_elements: ARRAY of "HASA" element HASHREF - Args : $rh_simple_article: simple article HASHREF structure from getArticles or getCollectedSimples + Args : $rh_object: simple article HASHREF structure from getArticles or getCollectedSimples Globals : none =cut @@ -346,14 +349,37 @@ { my $rh_simple_article = shift(); - if ($rh_simple_article->{'object_hasa'} ne '') + if (defined $rh_simple_article->{'article_objects'}) { - return (@{$rh_simple_article->{'object_hasa'}}); + if ($rh_simple_article->{'article_objects'}->{'object_hasa'} ne '') + { + return (@{$rh_simple_article->{'article_objects'}->{'object_hasa'}}); + } + else + { + return (); + } } else { - return (); + if ($rh_simple_article->{'object_hasa'} ne '') + { + return @{$rh_simple_article->{'object_hasa'}}; + } + else + { + return (); + } } + +# if ($rh_object->{'object_hasa'} ne '') +# { +# return (@{$rh_object->{'object_hasa'}}); +# } +# else +# { +# return (); +# } } =head2 function getObjectType From gss at pub.open-bio.org Fri Oct 21 13:36:46 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri Oct 21 14:25:21 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510211736.j9LHakw2002265@pub.open-bio.org> gss Fri Oct 21 13:36:45 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/tools In directory pub.open-bio.org:/tmp/cvs-serv2244/src/org/semanticmoby/tools Added Files: FormatConverter.java Log Message: Initial version s-moby/ref-impl/core/src/org/semanticmoby/tools FormatConverter.java,NONE,1.1 From kawas at pub.open-bio.org Fri Oct 21 13:45:01 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri Oct 21 14:33:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510211745.j9LHj16T002317@pub.open-bio.org> kawas Fri Oct 21 13:45:01 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv2292/org/biomoby/shared/extended Modified Files: ServiceTypeParser.java Log Message: added the parsing logic for the rdf document describing the service type ontology. moby-live/Java/src/main/org/biomoby/shared/extended ServiceTypeParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceTypeParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceTypeParser.java 2005/10/18 18:37:13 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceTypeParser.java 2005/10/21 17:45:01 1.2 @@ -14,6 +14,9 @@ import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.RDFReader; +import com.hp.hpl.jena.rdf.model.ResIterator; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.vocabulary.RDFS; /** * @@ -139,7 +142,21 @@ Model model = ModelFactory.createDefaultModel(); RDFReader reader = model.getReader(); reader.read(model, new StringReader(getRdfAsString()), null); - // TODO start querying the model and creating Service Type objects + // start querying the model and creating Service Type objects + ResIterator iterator = model.listSubjects(); + while (iterator.hasNext()) { + Resource resource = iterator.nextResource(); + String name = resource.getLocalName(); + MobyServiceType servicetype = new MobyServiceType(name); + if (!resource.hasProperty(RDFS.subClassOf)) { + continue; + } + String parent = resource.getProperty(RDFS.subClassOf).getObject().toString(); + servicetype.setParentNames(new String[] {parent}); + String description = resource.getProperty(RDFS.comment).getLiteral().getString(); + servicetype.setDescription(description); + list.add(servicetype); + } // return the array return (MobyServiceType[]) list @@ -153,7 +170,6 @@ private String getRdfAsString() { String s = null; StringBuffer sb = new StringBuffer(); - URL url = null; try { BufferedReader in = null; in = new BufferedReader(new InputStreamReader(url.openStream())); @@ -166,4 +182,12 @@ } return sb.toString(); } + + public static void main(String[] args) throws MobyException { + ServiceTypeParser p = new ServiceTypeParser("http://biomoby.org/RESOURCES/MOBY-S/Services"); + MobyServiceType[] types = p.getMobyServiceTypesFromRDF(); + for (int i = 0; i < types.length; i++) { + System.out.println(types[i]); + } + } } From senger at pub.open-bio.org Fri Oct 21 21:38:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Oct 21 22:27:34 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c4fR003411@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/client Modified Files: BaseClient.java CentralDigestCachedImpl.java CentralDigestImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseClient.java,1.2,1.3 CentralDigestCachedImpl.java,1.9,1.10 CentralDigestImpl.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/10/22 01:38:04 1.3 @@ -169,9 +169,9 @@ } catch (MalformedURLException e) { throw new MobyException ("Service endpoint '" + serviceEndpoint + "' is not a valid URL."); - } catch (GException e) { - throw new MobyException (e.getMessage()); - } + } catch (GException e) { + throw new MobyException (e.getMessage()); + } } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/12 11:17:59 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/22 01:38:04 1.10 @@ -15,6 +15,7 @@ import java.io.PrintWriter; import java.util.Iterator; import java.util.Map; +import java.util.TreeMap; import java.util.Vector; import java.util.Arrays; import java.util.Comparator; @@ -126,9 +127,9 @@ /************************************************************************** * Removes object groups from the cache. If 'id' is null it - * removes the whole cache (for the Moby registry this instance as - * initiated for). Otherwise 'id' indicates what part of the cache - * that will be removed.

    + * removes the whole cache (for that Moby registry this instance + * was initiated for). Otherwise 'id' indicates which part of the + * cache that will be removed.

    * * @param id should be either null, or one of the fillowing: * {@link #CACHE_PART_DATATYPES}, {@link #CACHE_PART_SERVICES}, @@ -313,21 +314,38 @@ } } - // + /************************************************************************** + * Is the given cache empty (meaning: cache directory does not + * exist, is empty, or contains only files to be ignored)? + *************************************************************************/ protected boolean isCacheEmpty (File cache) throws MobyException { if (cache == null) return true; String[] list = cache.list(); - return ( list == null || list.length == 0 ); + if (list == null || list.length == 0) + return true; + for (int i = 0; i < list.length; i++) { + if ( ! ignored (new File (list[i])) ) + return false; + } + return true; } - protected void fillDataTypesCache() + /************************************************************************** + * Load data types from a moby registry into local cache. If it is + * interrupted (by a callback signal) it removes what was already + * put into this cache and returns false. Otherwise returns + * true. It raises an exception if it cannot fill the cache (from + * some other reasons). + *************************************************************************/ + protected boolean fillDataTypesCache() throws MobyException { try { + fireEvent (DATA_TYPES_START); String typesAsXML = getDataTypeNamesAsXML(); store (dataTypesCache, LIST_FILE, typesAsXML); Map types = createDataTypeNamesFromXML (typesAsXML); - fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); + fireEvent (DATA_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); @@ -335,19 +353,28 @@ String xml = getDataTypeAsXML (name); store (dataTypesCache, name, xml); fireEvent (DATA_TYPE_LOADED, name); + if (stopDT) { + removeFromCache (CACHE_PART_DATATYPES); + return false; + } } + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopDT ? DATA_TYPES_CANCELLED : DATA_TYPES_END); + stopDT = false; } } - protected void fillServicesCache() + protected boolean fillServicesCache() throws MobyException { try { + fireEvent (AUTHORITIES_START); String byAuthorityAsXML = getServiceNamesByAuthorityAsXML(); store (servicesCache, LIST_FILE, byAuthorityAsXML); Map authorities = createServiceNamesByAuthorityFromXML (byAuthorityAsXML); - fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); + fireEvent (AUTHORITIES_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); @@ -355,20 +382,29 @@ String xml = getServicesAsXML (new MobyService (MobyService.DUMMY_NAME, authority), null, true, true); store (servicesCache, authority, xml); fireEvent (AUTHORITY_LOADED, authority); + if (stopS) { + removeFromCache (CACHE_PART_SERVICES); + return false; + } } + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopS ? AUTHORITIES_CANCELLED : AUTHORITIES_END); + stopS = false; } } // - protected void fillServiceTypesCache() + protected boolean fillServiceTypesCache() throws MobyException { try { + fireEvent (SERVICE_TYPES_START); String typesAsXML = getServiceTypesAsXML(); store (serviceTypesCache, LIST_FILE, typesAsXML); Map types = createServiceTypesFromXML (typesAsXML); - fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); + fireEvent (SERVICE_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); @@ -376,22 +412,32 @@ String xml = getServiceTypeRelationshipsAsXML (name, false); store (serviceTypesCache, name, xml); fireEvent (SERVICE_TYPE_LOADED, name); + if (stopST) { + removeFromCache (CACHE_PART_SERVICETYPES); + return false; + } } + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopST ? SERVICE_TYPES_CANCELLED :SERVICE_TYPES_END); + stopST = false; } } // - protected void fillNamespacesCache() + protected boolean fillNamespacesCache() throws MobyException { try { - fireEvent (NAMESPACE_LOADING, "Loading started."); + fireEvent (NAMESPACES_START); String xml = getNamespacesAsXML(); store (namespacesCache, LIST_FILE, xml); - fireEvent (NAMESPACE_LOADED, "Loaded."); + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (NAMESPACES_END); } } @@ -405,7 +451,9 @@ synchronized (dataTypesCache) { if (isCacheEmpty (dataTypesCache)) { initCache(); - fillDataTypesCache(); + if (! fillDataTypesCache()) + // callback stopped filling + return new TreeMap(); } // get a list file (with all data type names) @@ -425,7 +473,9 @@ Vector v = new Vector(); if (isCacheEmpty (dataTypesCache)) { initCache(); - fillDataTypesCache(); + if (! fillDataTypesCache()) + // callback stopped filling + return new MobyDataType[] {}; } File[] list = dataTypesCache.listFiles(); if (list == null) @@ -456,7 +506,9 @@ synchronized (servicesCache) { if (isCacheEmpty (servicesCache)) { initCache(); - fillServicesCache(); + if (! fillServicesCache()) + // callback stopped filling + return new TreeMap(); } // get a list file (with all service names) @@ -476,7 +528,9 @@ Vector v = new Vector(); if (isCacheEmpty (servicesCache)) { initCache(); - fillServicesCache(); + if (! fillServicesCache()) + // callback stopped filling + return new MobyService[] {}; } File[] list = servicesCache.listFiles(); if (list == null) @@ -529,7 +583,9 @@ synchronized (serviceTypesCache) { if (isCacheEmpty (serviceTypesCache)) { initCache(); - fillServiceTypesCache(); + if (! fillServiceTypesCache()) + // callback stopped filling + return new MobyServiceType[] {}; } // get a list file (with all service type names) =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/12 11:17:59 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/22 01:38:04 1.7 @@ -41,6 +41,9 @@ protected MobyService[] services = new MobyService[] {}; protected MobyNamespace[] namespaces = new MobyNamespace[] {}; + protected boolean stopDT = false; + protected boolean stopST = false; + protected boolean stopS = false; /************************************************************************* * Default constructor. It connects to a default Moby registry @@ -77,14 +80,19 @@ throws MobyException { try { Vector v = new Vector(); + fireEvent (DATA_TYPES_START); Map types = getDataTypeNames(); - fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); + fireEvent (DATA_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); fireEvent (DATA_TYPE_LOADING, name); v.addElement (getDataType (name)); fireEvent (DATA_TYPE_LOADED, name, v.lastElement()); + if (stopDT) { + v = new Vector(); + break; + } } MobyDataType[] result = new MobyDataType [v.size()]; v.copyInto (result); @@ -92,6 +100,9 @@ } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopDT ? DATA_TYPES_CANCELLED : DATA_TYPES_END); + stopDT = false; } } @@ -102,8 +113,9 @@ throws MobyException { try { Vector v = new Vector(); + fireEvent (SERVICE_TYPES_START); Map types = getServiceTypes(); - fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); + fireEvent (SERVICE_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String typeName = (String)entry.getKey(); @@ -113,6 +125,10 @@ serviceType.setParentNames (getServiceTypeRelationships (typeName, false)); v.addElement (serviceType); fireEvent (SERVICE_TYPE_LOADED, typeName, v.lastElement()); + if (stopST) { + v = new Vector(); + break; + } } MobyServiceType[] result = new MobyServiceType [v.size()]; v.copyInto (result); @@ -120,6 +136,9 @@ } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopST ? SERVICE_TYPES_CANCELLED : SERVICE_TYPES_END); + stopST = false; } } @@ -136,8 +155,9 @@ protected MobyNamespace[] readNamespaces() throws MobyException { try { + fireEvent (NAMESPACES_START); Map names = getNamespaces(); - fireEvent (NAMESPACE_COUNT, new Integer (names.size())); + fireEvent (NAMESPACES_COUNT, new Integer (names.size())); MobyNamespace[] result = new MobyNamespace [ names.size() ]; int i = 0; for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { @@ -152,6 +172,8 @@ } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (NAMESPACES_END); } } @@ -162,8 +184,9 @@ throws MobyException { try { Vector v = new Vector(); + fireEvent (AUTHORITIES_START); Map authorities = getServiceNamesByAuthority(); - fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); + fireEvent (AUTHORITIES_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); @@ -175,15 +198,20 @@ v.addElement (servs[j]); } fireEvent (AUTHORITY_LOADED, authority); + if (stopS) { + v = new Vector(); + break; + } } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); return result; } catch (Exception e) { - System.err.println ("HERE:\n" + e.toString()); - e.printStackTrace(); throw new MobyException (formatException (e)); + } finally { + fireEvent (stopS ? AUTHORITIES_CANCELLED : AUTHORITIES_END); + stopS = false; } } @@ -323,6 +351,14 @@ /********************************************************************* * ********************************************************************/ + public void addNotificationListeners (NotificationListener[] l) { + for (int i = 0; i < l.length; i++) + addNotificationListener (l[i]); + } + + /********************************************************************* + * + ********************************************************************/ public void removeNotificationListener (NotificationListener l) { if (listeners != null) listeners.removeElement (l); @@ -331,6 +367,14 @@ /********************************************************************* * ********************************************************************/ + public void removeNotificationListeners (NotificationListener[] l) { + for (int i = 0; i < l.length; i++) + removeNotificationListener (l[i]); + } + + /********************************************************************* + * + ********************************************************************/ public NotificationListener[] getNotificationListeners() { if (listeners == null) return new NotificationListener[] {}; @@ -344,14 +388,21 @@ /********************************************************************* * ********************************************************************/ - protected void fireEvent (String type, Object message) { - fireEvent (type, message, null); + public void callback (int signal) { + switch (signal) { + case SIGNAL_CANCEL_DATA_TYPES: + stopDT = true; break; + case SIGNAL_CANCEL_SERVICE_TYPES: + stopST = true; break; + case SIGNAL_CANCEL_SERVICES: + stopS = true; break; + } } /********************************************************************* * ********************************************************************/ - protected void fireEvent (String type, Object message, Object details) { + public void fireEvent (int type, Object message, Object details) { NotificationEvent event = null; if (details == null) event = new NotificationEvent (this, type, message.toString()); @@ -367,6 +418,21 @@ } } + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (int type) { + fireEvent (type, "", null); + } + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (int type, Object message) { + fireEvent (type, message, null); + } + + From senger at pub.open-bio.org Fri Oct 21 21:38:05 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Oct 21 22:27:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c5B1003505@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/shared/event Modified Files: NotificationEvent.java Notifier.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,1.1,1.2 Notifier.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/22 01:38:04 1.2 @@ -13,15 +13,16 @@ /** * An event fired by various Moby components to inform that something * has happened. Typical usage is for monitoring access to a Biomoby - * registry (how many entities yet to read, and which one was just + * registry (how many entities to read, and which one was just * read).

    * * Each notification event points to its source (this is inherited - * from a usual Java's EventObject). Additionally, it has its type (a - * string value, usually taken from a list defined in this class), a - * message (whose format may be detremined by the notification type), - * and optionally an object with more details (again, its presence or - * absence may depend on the notification type).

    + * from a usual Java's EventObject). Additionally, it has its type (an + * integer value, preferably taken from a list defined in interface + * {@link org.biomoby.shared.event.Notifier}), a message (whose format + * may be determined by the notification type), and optionally an + * object with more details (again, its presence or absence may depend + * on the notification type).

    * * @author Martin Senger * @version $Id$ @@ -30,7 +31,7 @@ public class NotificationEvent extends EventObject { - private String type; + private int type; private String message; private Object details; @@ -45,10 +46,10 @@ * A usual constructor, setting notification type and a message. ********************************************************************/ public NotificationEvent (Object source, - String type, String message) { + int type, String message) { this (source); this.type = type; - this.message = message; + this.message = (message == null ? "" : message); } /********************************************************************* @@ -56,7 +57,7 @@ * details. ********************************************************************/ public NotificationEvent (Object source, - String type, String message, + int type, String message, Object details) { this (source, type, message); this.details = details; @@ -65,7 +66,7 @@ /********************************************************************* * Return a type of this notification event. ********************************************************************/ - public String getType() { + public int getType() { return type; } @@ -88,9 +89,15 @@ * ********************************************************************/ public String toString() { + String typeStr = null; + try { + typeStr = typeTexts [type]; + } catch (Exception e) { + typeStr = "" + type; + } StringBuffer buf = new StringBuffer (100); buf.append ("["); - buf.append ("Type=" + type); + buf.append (typeStr); buf.append (", Message=" + message); if (details != null) buf.append (", Details=" + details.getClass().getName()); @@ -98,4 +105,35 @@ return new String (buf); } + static final String[] typeTexts = new String[] { + "data-type-start", + "data-type-count", + "data-type-loading", + "data-type-loaded", + "data-type-end", + "service-type-start", + "service-type-count", + "service-type-loading", + "service-type-loaded", + "service-type-end", + "namespace-start", + "namespace-count", + "namespace-loading", + "namespace-loaded", + "namespace-end", + "authority-start", + "authority-count", + "authority-loading", + "authority-loaded", + "authority-end", + "data-type-reset", + "service-type-reset", + "namespace-reset", + "authority-reset", + "data-type-cancel", + "service-type-cancel", + "namespace-cancel", + "authority-cancel" + }; + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/12 11:36:59 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/22 01:38:04 1.3 @@ -16,21 +16,46 @@ public interface Notifier { - static final String DATA_TYPE_COUNT = "data-type-count"; - static final String DATA_TYPE_LOADING = "data-type-loading"; - static final String DATA_TYPE_LOADED = "data-type-loaded"; - - static final String SERVICE_TYPE_COUNT = "service-type-count"; - static final String SERVICE_TYPE_LOADING = "service-type-loading"; - static final String SERVICE_TYPE_LOADED = "service-type-loaded"; - - static final String NAMESPACE_COUNT = "namespace-count"; - static final String NAMESPACE_LOADING = "namespace-loading"; - static final String NAMESPACE_LOADED = "namespace-loaded"; - - static final String AUTHORITY_COUNT = "authority-count"; - static final String AUTHORITY_LOADING = "authority-loading"; - static final String AUTHORITY_LOADED = "authority-loaded"; + static final int DATA_TYPES_START = 0; + static final int DATA_TYPES_COUNT = 1; + static final int DATA_TYPE_LOADING = 2; + static final int DATA_TYPE_LOADED = 3; + static final int DATA_TYPES_END = 4; + + static final int SERVICE_TYPES_START = 5; + static final int SERVICE_TYPES_COUNT = 6; + static final int SERVICE_TYPE_LOADING = 7; + static final int SERVICE_TYPE_LOADED = 8; + static final int SERVICE_TYPES_END = 9; + + static final int NAMESPACES_START = 10; + static final int NAMESPACES_COUNT = 11; + static final int NAMESPACE_LOADING = 12; + static final int NAMESPACE_LOADED = 13; + static final int NAMESPACES_END = 14; + + static final int AUTHORITIES_START = 15; + static final int AUTHORITIES_COUNT = 16; + static final int AUTHORITY_LOADING = 17; + static final int AUTHORITY_LOADED = 18; + static final int AUTHORITIES_END = 19; + + static final int DATA_TYPES_RESET = 20; + static final int SERVICE_TYPES_RESET = 21; + static final int NAMESPACES_RESET = 22; + static final int AUTHORITIES_RESET = 23; + + static final int DATA_TYPES_CANCELLED = 24; + static final int SERVICE_TYPES_CANCELLED = 25; + static final int NAMESPACES_CANCELLED = 26; + static final int AUTHORITIES_CANCELLED = 27; + + + + static final int SIGNAL_CANCEL_DATA_TYPES = 1; + static final int SIGNAL_CANCEL_SERVICE_TYPES = 2; + static final int SIGNAL_CANCEL_SERVICES = 3; + static final int SIGNAL_CANCEL_NAMESPACES = 4; /********************************************************************* * Adds the specified notification listener to receive @@ -42,6 +67,15 @@ void addNotificationListener (NotificationListener l); /********************************************************************* + * Adds the specified notification listeners to receive + * notification events from the class that implements this + * interface.

    + * + * @param l notification listeners to be added + ********************************************************************/ + void addNotificationListeners (NotificationListener[] l); + + /********************************************************************* * Removes the specified notification listener so that it no * longer receives notification events from the class that * implements this interface.

    @@ -51,6 +85,15 @@ void removeNotificationListener (NotificationListener l); /********************************************************************* + * Removes the specified notification listeners so that they no + * longer receive notification events from the class that + * implements this interface.

    + * + * @param l notification listeners to be removed + ********************************************************************/ + void removeNotificationListeners (NotificationListener[] l); + + /********************************************************************* * Returns an array of all the NotificationListeners added to the * class that implements this interface.

    * @@ -59,4 +102,19 @@ ********************************************************************/ NotificationListener[] getNotificationListeners(); + /********************************************************************* + * Call the notifier and signal that it can stop loading data (or + * whatever it is doing).

    + * + * @param signal identify what to stop doing (some usual values of + * this signal are defined elsewhere in this interface with names + * starting by SIGNAL_) + ********************************************************************/ + void callback (int callbackSignal); + + /********************************************************************* + * + ********************************************************************/ + void fireEvent (int type, Object message, Object details); + } From senger at pub.open-bio.org Fri Oct 21 21:38:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Oct 21 22:28:36 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c4rl003480@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/shared Modified Files: CentralAll.java Log Message: moby-live/Java/src/main/org/biomoby/shared CentralAll.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralAll.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralAll.java 2004/10/18 14:35:06 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralAll.java 2005/10/22 01:38:04 1.2 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.biomoby.shared.event.Notifier; + /** * A common interface to the classical features of a MobyRegistry (as * expressed in {@link Central}) and to the cumulated (digested) From senger at pub.open-bio.org Fri Oct 21 21:38:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Oct 21 22:28:41 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c4cR003459@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/service/dashboard Modified Files: CommonTree.java Dashboard.java DashboardProperties.java DataTypesTree.java JProgressBarWithCancel.java PropertyChannel.java RegistryModel.java RegistryPanel.java Added Files: CommonBoard.java DataTypesBoard.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard CommonBoard.java,NONE,1.1 DataTypesBoard.java,NONE,1.1 CommonTree.java,1.3,1.4 Dashboard.java,1.4,1.5 DashboardProperties.java,1.3,1.4 DataTypesTree.java,1.1,1.2 JProgressBarWithCancel.java,1.1,1.2 PropertyChannel.java,1.2,1.3 RegistryModel.java,1.4,1.5 RegistryPanel.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/12 11:17:59 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/22 01:38:04 1.4 @@ -67,11 +67,14 @@ // protected PropertyChangeSupport support; // protected boolean expanded = true; // the status of the application list + protected String rootNode; + /********************************************************************* * Constructor ********************************************************************/ public CommonTree (String rootNode) { super (new DefaultTreeModel (new DefaultMutableTreeNode (new CommonNode (rootNode)))); + this.rootNode = rootNode; // create an almost empty tree, only with a root node that // contains just a String holding the name of the root node; @@ -135,6 +138,11 @@ setFont (new Font ("Dialog", Font.PLAIN, 10)); } + // root node + if (row == 0) { + setText (rootNode); + } + // TBD: whale icon? // if (leaf) // ((JLabel)c).setIcon (icons [COMPUTER]); @@ -159,6 +167,13 @@ /********************************************************************* + * Get data from a registry model and update the tree. Will be + * overwritten by subclass. + ********************************************************************/ + public void update (int howSorted) { + } + + /********************************************************************* * Called when a tree node is selected. Does nothing here ********************************************************************/ protected void selected (DefaultMutableTreeNode node) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/24 17:51:51 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/22 01:38:04 1.5 @@ -26,6 +26,7 @@ import java.awt.GridBagLayout; import java.awt.Font; +import java.awt.Dimension; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -125,7 +126,7 @@ public void show() { JFrame frame = SwingUtils.createMainFrame (getComponent (propertyChannel), getName()); - SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); + SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); } /************************************************************************** @@ -226,7 +227,7 @@ /************************************************************************** * **************************************************************************/ - DashboardHeader getHeader() { + protected DashboardHeader getHeader() { DashboardHeader h = new DashboardHeader (dashboardProperties); if (panels.length > 0) h.setPanelTitle (panels[0].getTitle()); @@ -259,7 +260,7 @@ * Return a component representing status bar (usually placed at * the bottom of a dashboard). **************************************************************************/ - StatusBar getStatusBar() { + protected StatusBar getStatusBar() { return new StatusBar ("Status: Work in progress"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/24 17:51:51 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/22 01:38:04 1.4 @@ -37,6 +37,7 @@ static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; static final String DP_CACHE_DIR = "dp-cache-dir"; + static final String DP_USE_CACHE = "dp-use-cache"; /** A filename containing Java properties that configure the dashboard. */ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/22 01:38:04 1.2 @@ -17,6 +17,7 @@ import org.tulsoft.shared.UUtils; import javax.swing.JMenuItem; import javax.swing.JCheckBoxMenuItem; +import javax.swing.JProgressBar; import javax.swing.AbstractAction; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; @@ -118,8 +119,9 @@ /********************************************************************* * Get data from a registry model and update the tree. ********************************************************************/ - void update (int howSorted) { + public void update (int howSorted) { setEnabledPopup (false); + updateException = null; final int sorted = howSorted; final SwingWorker worker = new SwingWorker() { @@ -144,11 +146,13 @@ onUpdateDataTreeByAuth (dataTypes); else onUpdateDataTree (dataTypes); - setEnabledPopup (true); - if (sorted == SORTED_BY_AUTHORITY) - deprecatedBox.setEnabled (false); - else - deprecatedBox.setEnabled (true); + if (dataTypes.length > 0) { + setEnabledPopup (true); + if (sorted == SORTED_BY_AUTHORITY) + deprecatedBox.setEnabled (false); + else + deprecatedBox.setEnabled (true); + } } } }; @@ -321,7 +325,6 @@ worker.start(); } - /********************************************************************* * * A tree node representing a child element of a Moby data type. @@ -353,4 +356,7 @@ } } + + + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/JProgressBarWithCancel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/JProgressBarWithCancel.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/JProgressBarWithCancel.java 2005/10/22 01:38:04 1.2 @@ -29,6 +29,7 @@ import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Dimension; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -72,14 +73,16 @@ progressBar.setValue (0); progressBar.setStringPainted (true); - cancelButton = new JButton(); + Icon cancelIcon = SwingUtils.createIcon ("images/smallCancel.gif", this); + cancelButton = new JButton (cancelIcon); cancelButton.setFocusPainted (false); + cancelButton.setMargin (new Insets (0,0,0,0)); + cancelButton.setContentAreaFilled (false); cancelButton.setToolTipText ("Cancel the process"); // put it together ( TBD: should depend on progressBar.getOrientation() ) - SwingUtils.addComponent (this, progressBar, 0, 0, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.WEST, 1.0, 0.0); + SwingUtils.addComponent (this, progressBar, 0, 0, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST, 1.0, 0.0); SwingUtils.addComponent (this, cancelButton, 1, 0, 1, 1, GridBagConstraints.NONE, GridBagConstraints.WEST, 0.0, 0.0); - } /********************************************************************* @@ -96,4 +99,11 @@ return cancelButton; } + /********************************************************************* + * + ********************************************************************/ + public void addActionListener (ActionListener l) { + getButton().addActionListener (l); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/12 11:17:59 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/22 01:38:04 1.3 @@ -8,6 +8,8 @@ package org.biomoby.service.dashboard; +import org.tulsoft.shared.UUtils; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -86,6 +88,17 @@ } /********************************************************************* + * + ********************************************************************/ + public boolean getBoolean (Object key, boolean defaultValue) { + Object value = get (key); + if (value == null) return defaultValue; + if (value instanceof Boolean) + return ((Boolean)value).booleanValue(); + return UUtils.is (value.toString()); + } + + /********************************************************************* * Property change stuff ********************************************************************/ protected PropertyChangeSupport support; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/12 11:17:59 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/22 01:38:04 1.5 @@ -13,6 +13,10 @@ import org.biomoby.shared.CentralAll; import org.biomoby.client.CentralDigestCachedImpl; +import org.biomoby.shared.event.Notifier; +import org.biomoby.shared.event.NotificationEvent; +import org.biomoby.shared.event.NotificationListener; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -32,9 +36,11 @@ */ public class RegistryModel - extends AbstractModel { + extends AbstractModel + implements Notifier { CentralAll worker; + boolean useCache = true; Hashtable dataTypesTable; /********************************************************************* @@ -73,7 +79,7 @@ public MobyDataType[] getDataTypesByNames() throws MobyException { initWorker(); - + fireEvent (DATA_TYPES_RESET, "", null); MobyDataType[] dataTypes = worker.getDataTypes(); java.util.Arrays.sort (dataTypes); return dataTypes; @@ -84,8 +90,8 @@ ********************************************************************/ public MobyDataType[] getDataTypesByAuthority() throws MobyException { - initWorker(); + fireEvent (DATA_TYPES_RESET, "", null); MobyDataType[] dataTypes = worker.getDataTypes(); java.util.Arrays.sort (dataTypes, @@ -157,9 +163,9 @@ String registryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); String registryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); String cacheDir = propertyChannel.getString (DP_CACHE_DIR); - // String cacheDir = "/home/senger/jMoby/myCache"; - // cacheDir = null; - + useCache = propertyChannel.getBoolean (DP_USE_CACHE, true); + if (! useCache) + cacheDir = null; worker = new CentralDigestCachedImpl (registryURL, registryNS, cacheDir); @@ -167,15 +173,110 @@ String maybeNewRegistryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); String maybeNewRegistryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); String maybeNewCacheDir = propertyChannel.getString (DP_CACHE_DIR); - if ( maybeNewRegistryURL.equals (worker.getRegistryEndpoint()) && + boolean maybeUseCache = propertyChannel.getBoolean (DP_USE_CACHE, true); + if ( (maybeUseCache == useCache) && + maybeNewRegistryURL.equals (worker.getRegistryEndpoint()) && maybeNewRegistryNS.equals (worker.getRegistryNamespace()) && maybeNewCacheDir.equals (getCacheDir()) ) return; + useCache = maybeUseCache; + if (! useCache) + maybeNewCacheDir = null; + NotificationListener[] nls = ((Notifier)worker).getNotificationListeners(); + ((Notifier)worker).removeNotificationListeners (nls); worker = new CentralDigestCachedImpl (maybeNewRegistryURL, maybeNewRegistryNS, maybeNewCacheDir); + ((Notifier)worker).addNotificationListeners (nls); + } + } + + /************************************************************************* + * + * Methods implementing Notifier interface. + * + *************************************************************************/ + + /********************************************************************* + * + ********************************************************************/ + public synchronized void addNotificationListener (NotificationListener l) { + try { + initWorker(); + ((Notifier)worker).addNotificationListener (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + } + } + + /********************************************************************* + * + ********************************************************************/ + public void addNotificationListeners (NotificationListener[] l) { + try { + initWorker(); + ((Notifier)worker).addNotificationListeners (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); } } + /********************************************************************* + * + ********************************************************************/ + public synchronized void removeNotificationListener (NotificationListener l) { + try { + initWorker(); + ((Notifier)worker).removeNotificationListener (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + } + } + + /********************************************************************* + * + ********************************************************************/ + public void removeNotificationListeners (NotificationListener[] l) { + try { + initWorker(); + ((Notifier)worker).removeNotificationListeners (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + } + } + + /********************************************************************* + * + ********************************************************************/ + public NotificationListener[] getNotificationListeners() { + try { + initWorker(); + return ((Notifier)worker).getNotificationListeners(); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + return new NotificationListener[] {}; + } + } + + /********************************************************************* + * + ********************************************************************/ + public void callback (int signal) { + if (worker != null) + ((Notifier)worker).callback (signal); + } + + /********************************************************************* + * + ********************************************************************/ + public void fireEvent (int type, Object message, Object details) { + if (worker != null) + ((Notifier)worker).fireEvent (type, message, details); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/12 11:17:59 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 01:38:04 1.10 @@ -129,13 +129,17 @@ // ontology trees ServicesTree servicesTree = new ServicesTree(); - DataTypesTree dataTypesTree = new DataTypesTree (registryModel, console); - dataTypesTree.update (CommonTree.SORTED_BY_NAME); + + DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, + console, + support); + dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); + NamespacesTree namespacesTree = new NamespacesTree(); JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, servicesTree.scrollable(), - dataTypesTree.scrollable()); + dataTypesBoard); split1.setResizeWeight (0.5); split1.setContinuousLayout (true); split1.setOneTouchExpandable (true); @@ -200,6 +204,7 @@ cacheDir.setEnabled (enabled); labelCacheDir.setEnabled (enabled); setPrefValue (USE_CACHE, enabled); + propertyChannel.put (DP_USE_CACHE, new Boolean (enabled).toString()); } /************************************************************************** @@ -252,6 +257,8 @@ onUseCache (e.getStateChange() == ItemEvent.SELECTED); } }); + propertyChannel.put (DP_USE_CACHE, new Boolean (usingCache).toString()); + labelCacheDir = new JLabel("Cache directory"); cacheDir = createFileSelector ("Select directory for/with local cache", "Select", From senger at pub.open-bio.org Sat Oct 22 10:33:19 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Oct 22 11:21:51 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221433.j9MEXJrv006357@pub.open-bio.org> senger Sat Oct 22 10:33:19 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv6338 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.8,1.9 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/10/11 16:10:12 1.8 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/10/22 14:33:19 1.9 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sat Oct 22 10:35:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Oct 22 11:24:19 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221435.j9MEZkJ0006425@pub.open-bio.org> senger Sat Oct 22 10:35:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv6406/src/config/dashboard/META-INF/services Modified Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/09/18 08:46:26 1.1 +++ /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/10/22 14:35:46 1.2 @@ -1,3 +1,4 @@ org.biomoby.service.dashboard.RegistryPanel +org.biomoby.service.dashboard.RegistrationPanel org.biomoby.service.dashboard.ConsolePanel org.biomoby.service.dashboard.EventGeneratorPanel From senger at pub.open-bio.org Sat Oct 22 10:35:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Oct 22 11:24:20 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221435.j9MEZkgf006478@pub.open-bio.org> senger Sat Oct 22 10:35:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv6406/src/main/org/biomoby/service/dashboard/images Added Files: console.gif registration.png smallClear.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images console.gif,NONE,1.1 registration.png,NONE,1.1 smallClear.gif,NONE,1.1 From senger at pub.open-bio.org Sat Oct 22 10:35:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Oct 22 11:24:22 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221435.j9MEZk8u006461@pub.open-bio.org> senger Sat Oct 22 10:35:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv6406/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java CommonConsole.java ConsolePanel.java DashboardProperties.java RegistryPanel.java Added Files: BuildDataTypeTree.java RegistrationPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard BuildDataTypeTree.java,NONE,1.1 RegistrationPanel.java,NONE,1.1 AbstractPanel.java,1.7,1.8 CommonConsole.java,1.1,1.2 ConsolePanel.java,1.4,1.5 DashboardProperties.java,1.4,1.5 RegistryPanel.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/12 11:17:59 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/22 14:35:46 1.8 @@ -48,6 +48,8 @@ import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.event.ItemListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -90,6 +92,7 @@ protected JComponent pComponent; protected static Icon confirmIcon; protected static Icon warningIcon; + protected static Icon clearIcon; // re-use "style" components protected static final Insets BREATH_TOP = new Insets (10,0,0,0); @@ -322,10 +325,84 @@ }; } + /********************************************************************* + * + ********************************************************************/ + protected JPanel createCustomTextArea (String title, + String initValue, + String preferenceKey, + String eventName) { + JPanel p = new JPanel (new GridBagLayout()); + + // main label + JLabel label = new JLabel (title); + + // text area + final JTextArea area = new JTextArea(); + area.setEditable (true); + if (initValue == null) + area.setText (preferenceKey == null ? "" : getPrefValue (preferenceKey, "")); + else + area.setText (initValue); + area.setCaretPosition (0); + + if (eventName != null) { + final String eName = eventName; + if (preferenceKey == null) { + area.addFocusListener (new FocusListener() { + public void focusGained (FocusEvent e) {} + public void focusLost (FocusEvent e) { + String contents = ((JTextArea)e.getSource()).getText(); + propertyChannel.put (eName, contents); + } + }); + } else { + final String pKey = preferenceKey; + area.addFocusListener (new FocusListener() { + public void focusGained (FocusEvent e) {} + public void focusLost (FocusEvent e) { + String contents = ((JTextArea)e.getSource()).getText(); + propertyChannel.put (eName, contents); + setPrefValue (pKey, contents); + } + }); + } + // propagate also the initial value (unless it is empty) + String text = area.getText(); + if (UUtils.notEmpty (text)) + propertyChannel.put (eventName, text); + } + + // reset/clear button + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + JButton clearButton = new JButton (clearIcon); + clearButton.setFocusPainted (false); + clearButton.setMargin (new Insets (0,0,0,0)); + clearButton.setContentAreaFilled (false); + clearButton.setToolTipText ("Clear text area"); + clearButton.addActionListener (new ActionListener() { + public void actionPerformed (ActionEvent e) { + area.setText (""); + } + }); + + // put it together + SwingUtils.addComponent (p, label, 0, 0, 1, 1, NONE, NWEST, 0.0, 0.0); + SwingUtils.addComponent (p, clearButton, 1, 0, 1, 1, NONE, NEAST, 0.0, 0.0); + SwingUtils.addComponent (p, new JScrollPane (area), 0, 1, 2, 1, BOTH, NWEST, 1.0, 1.0); + return p; + } /********************************************************************* * ********************************************************************/ + protected String getPrefValue (String key, + String defaultValue) { + Preferences node = PrefsUtils.getNode (this.getClass()); + return node.get (key, defaultValue); + } + protected boolean getPrefValue (String key, boolean defaultValue) { Preferences node = PrefsUtils.getNode (this.getClass()); @@ -336,6 +413,12 @@ * ********************************************************************/ protected void setPrefValue (String key, + String value) { + Preferences node = PrefsUtils.getNode (this.getClass()); + node.put (key, value); + } + + protected void setPrefValue (String key, boolean value) { Preferences node = PrefsUtils.getNode (this.getClass()); node.putBoolean (key, value); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/09/24 17:51:51 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/10/22 14:35:46 1.2 @@ -15,6 +15,7 @@ import javax.swing.JTextArea; import javax.swing.JCheckBox; import javax.swing.JPanel; +import javax.swing.Icon; import java.awt.Font; import java.awt.GridBagLayout; @@ -40,6 +41,7 @@ JTextArea textArea; JCheckBox appendModeBox; boolean appendMode = true; + static Icon clearIcon; /********************************************************************* * Constructor. @@ -64,6 +66,10 @@ } }); + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + cleanButton.setIcon (clearIcon); + appendModeBox = AbstractPanel.createCheckBox ("append mode", appendMode, KeyEvent.VK_A, new ItemListener() { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/24 17:51:51 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/10/22 14:35:46 1.5 @@ -115,4 +115,13 @@ return "Debugging Console"; } + /************************************************************************** + * + **************************************************************************/ + public Icon getIcon() { + if (panelIcon == null) + panelIcon = SwingUtils.createIcon ("images/console.gif", this); + return panelIcon; + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/22 01:38:04 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/22 14:35:46 1.5 @@ -34,11 +34,18 @@ static final String DP_DATATYPE_NAME = "dp-datatype-name"; // names of properties used in property channel storage + static final String DP_REGISTRY_MODEL = "dp-registry-model"; + static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; static final String DP_CACHE_DIR = "dp-cache-dir"; static final String DP_USE_CACHE = "dp-use-cache"; + static final String DP_REG_DT_NAME = "dp-reg-dt-name"; + static final String DP_REG_DT_AUTH = "dp-reg-dt-auth"; + static final String DP_REG_DT_EMAIL = "dp-reg-dt-email"; + static final String DP_REG_DT_DESC = "dp-reg-dt-desc"; + /** A filename containing Java properties that configure the dashboard. */ static final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 01:38:04 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 14:35:46 1.11 @@ -1,6 +1,6 @@ // RegistryPanel.java // -// Created: September 2005 +// Created: September 2005 // // This file is a component of the BioMoby project. // Copyright Martin Senger (martin.senger@gmail.com). @@ -61,8 +61,6 @@ * what Biomoby registry to work with, and what cache directory to * use.

    * - * WORK IN PROGRESS.

    - * * @author Martin Senger * @version $Id$ */ @@ -87,22 +85,17 @@ * propertyChange() ********************************************************************/ public void propertyChange (PropertyChangeEvent e) { - String prop = e.getPropertyName(); - String newVal = (String)e.getNewValue(); - if (newVal == null) return; // no interest in non-defined new values - if (prop == null) return; // no interest in non-specific changes -// else if (prop.equalsIgnoreCase (PROP_MODE)) setMode (checkAndGetOperMode (newVal)); -// else if (prop.equalsIgnoreCase (PROP_BEAN_VISIBLE)) setBeanVisible (BBConfig.getBoolFromString (newVal)); -// else if (prop.equalsIgnoreCase (PROP_LISTEN_TO)) setListenTo (newVal); -// else if (prop.equalsIgnoreCase (PROP_DATA_IDENTITY)) setDataIdentity (newVal); +// String prop = e.getPropertyName(); +// String newVal = (String)e.getNewValue(); +// if (newVal == null) return; // no interest in non-defined new values +// if (prop == null) return; // no interest in non-specific changes } /********************************************************************* - * Default constructor + * Default constructor. ********************************************************************/ public RegistryPanel() { super(); - registryModel = new RegistryModel (support); } /************************************************************************** @@ -110,7 +103,15 @@ **************************************************************************/ public JComponent getComponent (PropertyChannel propertyChannel) { setPropertyChannel (propertyChannel); - registryModel.setPropertyChannel (propertyChannel); + synchronized (propertyChannel) { + if (propertyChannel.containsKey (DP_REGISTRY_MODEL)) { + registryModel = (RegistryModel)propertyChannel.get (DP_REGISTRY_MODEL); + } else { + registryModel = new RegistryModel (support); + propertyChannel.put (DP_REGISTRY_MODEL, registryModel); + } + registryModel.setPropertyChannel (propertyChannel); + } if (pComponent != null) return pComponent; @@ -339,7 +340,7 @@ **************************************************************************/ public Icon getIcon() { if (panelIcon == null) - panelIcon = SwingUtils.createIcon ("images/registry.gif", this); + panelIcon = SwingUtils.createIcon ("images/registry.gif", this); return panelIcon; } From senger at pub.open-bio.org Sun Oct 23 15:00:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Oct 23 14:59:22 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510231900.j9NJ0OUR020952@pub.open-bio.org> senger Sun Oct 23 15:00:24 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv20917/src/main/org/biomoby/service/dashboard Modified Files: BuildDataTypeTree.java CommonTree.java DataTypesBoard.java DataTypesTree.java RegistrationPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard BuildDataTypeTree.java,1.1,1.2 CommonTree.java,1.4,1.5 DataTypesBoard.java,1.1,1.2 DataTypesTree.java,1.2,1.3 RegistrationPanel.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/22 14:35:46 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/23 19:00:24 1.2 @@ -78,6 +78,8 @@ // enable tool tips ToolTipManager.sharedInstance().registerComponent (this); + +// expand(); } // @@ -125,4 +127,20 @@ protected void selected (DefaultMutableTreeNode node) { } + /********************************************************************* + * Expand all nodes. + ********************************************************************/ + protected void expand() { + final SwingWorker worker = new SwingWorker() { + public Object construct() { + SwingUtils.expandTree (BuildDataTypeTree.this, (DefaultMutableTreeNode)getModel().getRoot()); + return null; // not used here + } + // runs on the event-dispatching thread. + public void finished() { + repaint(); + } + }; + worker.start(); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/22 01:38:04 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/23 19:00:24 1.5 @@ -18,6 +18,7 @@ import javax.swing.JPopupMenu; import javax.swing.JOptionPane; import javax.swing.JMenuItem; +import javax.swing.JSeparator; import javax.swing.ToolTipManager; import javax.swing.AbstractAction; import javax.swing.tree.DefaultMutableTreeNode; @@ -53,7 +54,11 @@ public class CommonTree extends JTree { - final static String RELOAD = "Reload"; + // action commands for popup menu items + protected final static String AC_SEARCH = "ac-search"; + protected final static String AC_EXPAND = "ac-expand"; + protected final static String AC_COLLAPSE = "ac-collapse"; + protected final static String AC_RELOAD = "ac-reload"; // some shared constants final static protected int SORTED_BY_NAME = 0; @@ -61,9 +66,15 @@ // tree components protected JPopupMenu popup; - protected Icon searchIcon; protected String lastSearchText = ""; + // shared icons + static protected Icon searchIcon; + static protected Icon menuSearchIcon, menuSearchIconDis; + static protected Icon menuExpandIcon, menuExpandIconDis; + static protected Icon menuCollapseIcon, menuCollapseIconDis; + static protected Icon menuReloadIcon, menuReloadIconDis; + // protected PropertyChangeSupport support; // protected boolean expanded = true; // the status of the application list @@ -104,6 +115,9 @@ // enable tool tips ToolTipManager.sharedInstance().registerComponent (this); + + // load menu icons + loadIcons(); } // @@ -180,6 +194,39 @@ } /********************************************************************* + * Load all menu icons. + ********************************************************************/ + protected void loadIcons() { + if (menuSearchIcon == null) + menuSearchIcon = + SwingUtils.createIcon ("images/smallSearch.gif", Dashboard.class); + if (menuSearchIconDis == null) + menuSearchIconDis = + SwingUtils.createIcon ("images/smallSearchDis.gif", Dashboard.class); + + if (menuExpandIcon == null) + menuExpandIcon = + SwingUtils.createIcon ("images/smallExpand.gif", Dashboard.class); + if (menuExpandIconDis == null) + menuExpandIconDis = + SwingUtils.createIcon ("images/smallExpandDis.gif", Dashboard.class); + + if (menuCollapseIcon == null) + menuCollapseIcon = + SwingUtils.createIcon ("images/smallCollapse.gif", Dashboard.class); + if (menuCollapseIconDis == null) + menuCollapseIconDis = + SwingUtils.createIcon ("images/smallCollapseDis.gif", Dashboard.class); + + if (menuReloadIcon == null) + menuReloadIcon = + SwingUtils.createIcon ("images/smallReload.gif", Dashboard.class); + if (menuReloadIconDis == null) + menuReloadIconDis = + SwingUtils.createIcon ("images/smallReloadDis.gif", Dashboard.class); + } + + /********************************************************************* * Create a popup object with common items. Subclasses can (and * usually do) add more items, or re-created the whole popup.

    * @@ -188,35 +235,35 @@ protected void createPopups (String title) { popup = new JPopupMenu (title); popup.add - (new JMenuItem (new AbstractAction ("Search") { + (createMenuItem (new AbstractAction ("Search") { public void actionPerformed (ActionEvent e) { String searchText = searchDialog(); if (searchText != null) search (searchText); } - })); + }, AC_SEARCH, menuSearchIcon, menuSearchIconDis)); popup.add - (new JMenuItem (new AbstractAction ("Expand all nodes") { + (createMenuItem (new AbstractAction ("Expand all nodes") { public void actionPerformed (ActionEvent e) { expand(); } - })); + }, AC_EXPAND, menuExpandIcon, menuExpandIconDis)); popup.add - (new JMenuItem (new AbstractAction ("Collapse all nodes") { + (createMenuItem (new AbstractAction ("Collapse all nodes") { public void actionPerformed (ActionEvent e) { collapse(); } - })); + }, AC_COLLAPSE, menuCollapseIcon, menuCollapseIconDis)); popup.addSeparator(); popup.add - (new JMenuItem (new AbstractAction (RELOAD) { + (createMenuItem (new AbstractAction ("Reload") { public void actionPerformed (ActionEvent e) { reload(); } - })); + }, AC_RELOAD, menuReloadIcon, menuReloadIconDis)); // add listener to this tree to bring up popup menus MouseListener popupListener = new PopupListener(); @@ -239,6 +286,29 @@ } /********************************************************************* + * Create a menu item. + ********************************************************************/ + protected JMenuItem createMenuItem (AbstractAction action, + String actionCommand) { + JMenuItem mi = new JMenuItem (action); + mi.setActionCommand (actionCommand); + return mi; + } + + /********************************************************************* + * Create a menu item. + ********************************************************************/ + protected JMenuItem createMenuItem (AbstractAction action, + String actionCommand, + Icon icon, + Icon disabledIcon) { + JMenuItem mi = createMenuItem (action, actionCommand); + mi.setIcon (icon); + mi.setDisabledIcon (disabledIcon); + return mi; + } + + /********************************************************************* * Enable/disable the whole popup except the 'Reload' option (that * one remains enabled always). ********************************************************************/ @@ -247,7 +317,7 @@ Component[] components = popup.getComponents(); for (int i = 0; i < components.length; i++) { if ( components[i] instanceof JMenuItem && - ! ((JMenuItem)components[i]).getText().equals (RELOAD) ) + ! AC_RELOAD.equals (((JMenuItem)components[i]).getActionCommand()) ) ((JMenuItem)components[i]).setEnabled (enabled); } } @@ -347,4 +417,37 @@ AbstractPanel.error (prologue, e); } + /********************************************************************* + * Remove a menu item (given by an action command string) from a + * popup menu. + ********************************************************************/ + protected void removeFromPopups (String actionCommand) { + if (popup == null) return; + Component[] components = popup.getComponents(); + for (int i = 0; i < components.length; i++) { + if ( components[i] instanceof JMenuItem && + actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ) { + popup.remove (components[i]); + return; + } + } + } + + /********************************************************************* + * Remove a menu separator (that is after menu item given by an + * action command string) from a popup menu. + ********************************************************************/ + protected void removeSeparatorAfter (String actionCommand) { + if (popup == null) return; + Component[] components = popup.getComponents(); + boolean found = false; + for (int i = 0; i < components.length; i++) { + if ( components[i] instanceof JSeparator && found) { + popup.remove (components[i]); + return; + } + found = ( components[i] instanceof JMenuItem && + actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ); + } + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/22 01:38:04 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/23 19:00:24 1.2 @@ -40,8 +40,16 @@ public DataTypesBoard (RegistryModel model, CommonConsole console, PropertyChangeSupport support) { + this (model, console, support, + new DataTypesTree (model, console)); + } + + public DataTypesBoard (RegistryModel model, + CommonConsole console, + PropertyChangeSupport support, + CommonTree customTree) { super (model, support); - tree = new DataTypesTree (model, console); + tree = customTree; createItself(); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/22 01:38:04 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/23 19:00:24 1.3 @@ -42,6 +42,12 @@ public class DataTypesTree extends CommonTree { + // action commands for popup menu items + protected final static String AC_NSORT = "ac-nsort"; + protected final static String AC_ASORT = "ac-asort"; + protected final static String AC_HASA = "ac-hasa"; + protected final static String AC_DEPR = "ac-depr"; + // remembered from constructor RegistryModel registryModel; CommonConsole console; @@ -79,22 +85,23 @@ super.createPopups (title); popup.addSeparator(); popup.add - (new JMenuItem (new AbstractAction ("Sort by names") { + (createMenuItem (new AbstractAction ("Sort by names") { public void actionPerformed (ActionEvent e) { update (lastSorted = SORTED_BY_NAME); deprecatedBox.setEnabled (true); } - })); + }, AC_NSORT)); popup.add - (new JMenuItem (new AbstractAction ("Sort by authorities") { + (createMenuItem (new AbstractAction ("Sort by authorities") { public void actionPerformed (ActionEvent e) { update (lastSorted = SORTED_BY_AUTHORITY); deprecatedBox.setEnabled (false); } - })); + }, AC_ASORT)); popup.addSeparator(); JCheckBoxMenuItem showBox = new JCheckBoxMenuItem ("Show HAS/HASA members"); + showBox.setActionCommand (AC_HASA); showBox.addItemListener (new ItemListener() { public void itemStateChanged (ItemEvent e) { showMembers = (e.getStateChange() == ItemEvent.SELECTED); @@ -104,6 +111,7 @@ popup.add (showBox); deprecatedBox = new JCheckBoxMenuItem ("Show deprecated objects"); + deprecatedBox.setActionCommand (AC_DEPR); deprecatedBox.addItemListener (new ItemListener() { public void itemStateChanged (ItemEvent e) { showBadGuys = (e.getStateChange() == ItemEvent.SELECTED); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/22 14:35:46 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/23 19:00:24 1.2 @@ -68,27 +68,16 @@ public class RegistrationPanel extends AbstractPanel { - // names of user preferences keys -// static final String USE_CACHE = "use-cache"; - // associated model working behind the scenes RegistryModel registryModel; // components that are used from more methods -// JTextFieldWithHistory dtName; -// JTextFieldWithHistory dtAuth; -// JTextFieldWithHistory dtEmail; - CommonConsole console; /********************************************************************* * propertyChange() ********************************************************************/ public void propertyChange (PropertyChangeEvent e) { -// String prop = e.getPropertyName(); -// String newVal = (String)e.getNewValue(); -// if (newVal == null) return; // no interest in non-defined new values -// if (prop == null) return; // no interest in non-specific changes } /********************************************************************* @@ -169,9 +158,11 @@ SwingUtils.addComponent (defs, dtDesc, 0, 6, 1, 1, BOTH, NWEST, 1.0, 1.0, BREATH_TOP); // a tree with all already existing data types - DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, - console, - support); + DataTypesBoard dataTypesBoard = + new DataTypesBoard (registryModel, + console, + support, + new CustomDataTypesTree (registryModel, console)); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); // a tree with a new data type && registration button @@ -261,4 +252,51 @@ return panelIcon; } + /************************************************************************** + * Customized tree of data types - has different popup menus... + **************************************************************************/ + protected class CustomDataTypesTree + extends DataTypesTree { + + // action commands for popup menu items + protected final static String AC_PARENT = "ac-parent"; + protected final static String AC_MHASA = "ac-m-hasa"; + protected final static String AC_MHAS = "ac-m-has"; + + public CustomDataTypesTree (RegistryModel model, + CommonConsole console) { + super (model, console); + } + + /********************************************************************* + * + ********************************************************************/ + protected void createPopups (String title) { + super.createPopups (title); + removeFromPopups (AC_RELOAD); + removeFromPopups (AC_HASA); + removeFromPopups (AC_DEPR); + removeSeparatorAfter (AC_COLLAPSE); + + popup.add + (createMenuItem (new AbstractAction ("Add selected as a parent type (ISA)") { + public void actionPerformed (ActionEvent e) { + } + }, AC_PARENT)); + + popup.add + (createMenuItem (new AbstractAction ("Add selected as a member (HASA)") { + public void actionPerformed (ActionEvent e) { + } + }, AC_MHASA)); + + popup.add + (createMenuItem (new AbstractAction ("Add selected as a list of members (HAS)") { + public void actionPerformed (ActionEvent e) { + } + }, AC_MHAS)); + + } + } + } From senger at pub.open-bio.org Sun Oct 23 15:00:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Oct 23 14:59:40 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510231900.j9NJ0OTM020967@pub.open-bio.org> senger Sun Oct 23 15:00:24 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv20917/src/main/org/biomoby/service/dashboard/images Added Files: smallClear_dis.gif smallCollapse.gif smallCollapse_dis.gif smallExpand.gif smallExpand_dis.gif smallReload.gif smallReload_dis.gif smallSearch.gif smallSearch_dis.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images smallClear_dis.gif,NONE,1.1 smallCollapse.gif,NONE,1.1 smallCollapse_dis.gif,NONE,1.1 smallExpand.gif,NONE,1.1 smallExpand_dis.gif,NONE,1.1 smallReload.gif,NONE,1.1 smallReload_dis.gif,NONE,1.1 smallSearch.gif,NONE,1.1 smallSearch_dis.gif,NONE,1.1 From senger at pub.open-bio.org Sun Oct 23 20:34:49 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Oct 23 20:33:42 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510240034.j9O0Ynb2021836@pub.open-bio.org> senger Sun Oct 23 20:34:49 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv21813/src/main/org/biomoby/service/dashboard Modified Files: Dashboard.java NOTES Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard Dashboard.java,1.5,1.6 NOTES,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/22 01:38:04 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/24 00:34:49 1.6 @@ -126,6 +126,7 @@ public void show() { JFrame frame = SwingUtils.createMainFrame (getComponent (propertyChannel), getName()); + addMenuBar (frame); SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); } @@ -280,6 +281,12 @@ } /************************************************************************** + * Create and add a menu bar to the given frame. + **************************************************************************/ + protected void addMenuBar (JFrame frame) { + } + + /************************************************************************** * Dashboard is listening to the changes of panels in order to * repaint the header with a label of a currently selected panel. **************************************************************************/ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/12 11:17:59 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/24 00:34:49 1.9 @@ -126,7 +126,7 @@ TODO generally: --------------- -* notice that the dasboard is used the first time and offer ti create +* notice that the dasboard is used the first time and offer to create a list of wanted panels (some of them are suggested as default) * notice that user does not use cache (and that he did not select "do From carrere at pub.open-bio.org Mon Oct 24 04:57:34 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Mon Oct 24 04:56:23 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510240857.j9O8vYJR023144@pub.open-bio.org> carrere Mon Oct 24 04:57:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23118 Modified Files: MOBYXSLT.pm Log Message: Bad parameters initializations. Lot of warnings removed. moby-live/Perl/MOBY MOBYXSLT.pm,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/10/21 13:22:18 1.2 +++ /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/10/24 08:57:34 1.3 @@ -735,19 +735,36 @@ my @a_crossref = (); my @a_hasa = (); + my ($object_type,$object_name,$object_id,$object_namespace) = ('','','',''); my $object_type_tag = '#XSL_LIPM_MOBYPARSER_OBJECTTYPE#'; - my ($object_type) = ($simple_bloc =~ /$object_type_tag(\S+)$object_type_tag/); - $object_type =~ s/^moby://i; + + if ($simple_bloc =~ /$object_type_tag(\S+)$object_type_tag/) + { + $object_type = $1; + $object_type =~ s/^moby://i; + } my $object_namespace_tag = '#XSL_LIPM_MOBYPARSER_OBJECTNAMESPACE#'; - my ($object_namespace) = ($simple_bloc =~ /$object_namespace_tag(\S+)$object_namespace_tag/); - + + if ($simple_bloc =~ /$object_namespace_tag(\S+)$object_namespace_tag/) + { + $object_namespace = $1; + } + my $object_id_tag = '#XSL_LIPM_MOBYPARSER_OBJECTID#'; - my ($object_id) = ($simple_bloc =~ /$object_id_tag(\S+)$object_id_tag/); - + + if ($simple_bloc =~ /$object_id_tag(\S+)$object_id_tag/) + { + $object_id = $1; + } + my $object_name_tag = '#XSL_LIPM_MOBYPARSER_OBJECTNAME#'; - my ($object_name) = ($simple_bloc =~ /$object_name_tag(\S+)$object_name_tag/); + if ($simple_bloc =~ /$object_name_tag(\S+)$object_name_tag/) + { + $object_name = $1 + } + my $crossref_start_tag = '#XSL_LIPM_MOBYPARSER_CROSSREF_START#'; my $crossref_end_tag = '#XSL_LIPM_MOBYPARSER_CROSSREF_END#'; my $crossref_sep_tag = '#XSL_LIPM_MOBYPARSER_CROSSREF_SEP#'; @@ -765,7 +782,8 @@ } my $object_content_tag = '#XSL_LIPM_MOBYPARSER_OBJECTCONTENT#'; - my ($before, $object_content, $after) = split($object_content_tag, $simple_bloc); + my ($before, $object_content, $after) = ('','',''); + ($before, $object_content, $after) = split($object_content_tag, $simple_bloc); my $object_hasa_start_tag = '#XSL_LIPM_MOBYPARSER_OBJECTHASA_START#'; From carrere at pub.open-bio.org Mon Oct 24 07:47:03 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Mon Oct 24 07:46:01 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510241147.j9OBl3Jv023529@pub.open-bio.org> carrere Mon Oct 24 07:47:03 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/xsl In directory pub.open-bio.org:/tmp/cvs-serv23503 Modified Files: parseMobyMessage.xsl Log Message: Template Parameter modification to allow articleName or moby:articleName as an attribute moby-live/Perl/MOBY/xsl parseMobyMessage.xsl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/xsl/parseMobyMessage.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/xsl/parseMobyMessage.xsl 2005/09/08 13:46:45 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/xsl/parseMobyMessage.xsl 2005/10/24 11:47:03 1.2 @@ -114,8 +114,18 @@ --> + + + + #XSL_LIPM_MOBYPARSER_SECONDARY_START# - + + + + + + + #XSL_LIPM_MOBYPARSER_SECONDARY_SEP# #XSL_LIPM_MOBYPARSER_SECONDARY_END# From fgibbons at pub.open-bio.org Mon Oct 24 13:31:57 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Mon Oct 24 13:30:50 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510241731.j9OHVvGc024289@pub.open-bio.org> fgibbons Mon Oct 24 13:31:57 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv24264 Modified Files: XMLPayloads.html Log Message: - Explain the situation regarding deregisterService. moby-live/Docs/MOBY-S_API XMLPayloads.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/09/28 22:05:58 1.3 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/10/24 17:31:57 1.4 @@ -651,5 +651,35 @@

    -deregisterService

    -This method has now been deprecated. \ No newline at end of file +deregisterService + +It is intended that this method will ultimately be deprecated. A +requirement for this to happen is the completed transition from a +function-call based registration process to an RDF-document-based +registration. For the time being, it remains in use. + +Under the current function-call based procedure, a +service is registered by modifying the contents of the MOBY Central +database, by means of a function call from the MOBY API (i.e., +registerService). The service remains registered until +the function deregisterService is called. This method has +some shortcomings, mostly to do with security. + +It is proposed (see email archives for details), that a better way of +doing things would be to continue to allow registration by means of a +function call. A key change is that the function would return an RDF +document describing the service. The document would be placed at a +pre-specified location on the web, and an RDF-reading agent would +periodically check on the service's continued existence (the agent +might visit hourly or weekly, depending on who you +ask). Deregistration of the service would be a simple matter of +removing the RDF document. On the agent's next visit, it would notice +that the document had disappeared, and remove it from MOBY Central's +registry. + +Currently, it is possible to register a service under both schemes (to +use the new scheme, simply provide a "signatureURL" +parameter). However, there is currently no agent, therefore +services registered under the new scheme will remain registered +indefinitely. It is explicitly not allowed to deregister +services which were registered using a signatureURL. From senger at pub.open-bio.org Tue Oct 25 05:02:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 25 05:01:01 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510250902.j9P928TF026810@pub.open-bio.org> senger Tue Oct 25 05:02:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv26713/src/main/org/biomoby/shared Modified Files: MobyDataType.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyDataType.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/24 17:51:52 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/10/25 09:02:08 1.10 @@ -26,6 +26,12 @@ public class MobyDataType implements Comparable { + /** + * A dummy name used for MobyDataType instances that do not have + * (yet) a real name. + */ + static public final String DUMMY_NAME = "_dummy_"; + public int compareTo (Object obj) { return name.compareToIgnoreCase ( ((MobyDataType)obj).getName() ); } @@ -46,7 +52,7 @@ * Default constructor. *************************************************************************/ public MobyDataType() { - this ("_dummy_"); + this (DUMMY_NAME); } /************************************************************************** From senger at pub.open-bio.org Tue Oct 25 05:02:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Oct 25 05:02:30 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510250902.j9P9287Q026791@pub.open-bio.org> senger Tue Oct 25 05:02:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26713/src/main/org/biomoby/service/dashboard/images Modified Files: smallReload.gif Added Files: emptyButton.gif renameButton.gif smallAddHAS.gif smallAddHASA.gif smallAddHASA_dis.gif smallAddHAS_dis.gif smallAddISA.gif smallAddISA_dis.gif smallRefresh.gif smallRefresh_dis.gif smallRemove.gif smallRemove_dis.gif smallRename.gif smallRename_dis.gif smallWarning.gif smallWarning_dis.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images emptyButton.gif,NONE,1.1 renameButton.gif,NONE,1.1 smallAddHAS.gif,NONE,1.1 smallAddHASA.gif,NONE,1.1 smallAddHASA_dis.gif,NONE,1.1 smallAddHAS_dis.gif,NONE,1.1 smallAddISA.gif,NONE,1.1 smallAddISA_dis.gif,NONE,1.1 smallRefresh.gif,NONE,1.1 smallRefresh_dis.gif,NONE,1.1 smallRemove.gif,NONE,1.1 smallRemove_dis.gif,NONE,1.1 smallRename.gif,NONE,1.1 smallRename_dis.gif,NONE,1.1 smallWarning.gif,NONE,1.1 smallWarning_dis.gif,NONE,1.1 smallReload.gif,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif 2005/10/23 19:00:24 1.1 and /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif 2005/10/25 09:02:08 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif: diff failed From senger at pub.open-bio.org Wed Oct 26 04:05:19 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 26 04:04:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510260805.j9Q85JgF030263@pub.open-bio.org> senger Wed Oct 26 04:05:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv30201/src/main/org/biomoby/service/dashboard/images Added Files: smallUnregister.gif smallUnregister_dis.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images smallUnregister.gif,NONE,1.1 smallUnregister_dis.gif,NONE,1.1 From senger at pub.open-bio.org Wed Oct 26 04:05:19 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Oct 26 04:05:32 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510260805.j9Q85J0j030248@pub.open-bio.org> senger Wed Oct 26 04:05:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv30201/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java BuildDataTypeTree.java CommonConsole.java CommonTree.java DashboardProperties.java NOTES RegistrationPanel.java RegistryModel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,1.9,1.10 BuildDataTypeTree.java,1.3,1.4 CommonConsole.java,1.2,1.3 CommonTree.java,1.6,1.7 DashboardProperties.java,1.6,1.7 NOTES,1.10,1.11 RegistrationPanel.java,1.3,1.4 RegistryModel.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/25 09:02:07 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/26 08:05:18 1.10 @@ -90,6 +90,8 @@ // something need to be done only once - keep it here protected Icon panelIcon; protected JComponent pComponent; + + // shared icons protected static Icon confirmIcon; protected static Icon warningIcon; protected static Icon clearIcon; @@ -108,6 +110,7 @@ ********************************************************************/ protected AbstractPanel() { support = new PropertyChangeSupport (this); + loadIcons(); } /************************************************************************** @@ -178,6 +181,22 @@ abstract public String getName(); // + // Few other methods + // + + /********************************************************************* + * Load all menu icons. + ********************************************************************/ + protected void loadIcons() { + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + if (warningIcon == null) + warningIcon = SwingUtils.createIcon ("images/warningButton.gif", this); + if (confirmIcon == null) + confirmIcon = SwingUtils.createIcon ("images/confirmButton.gif", this); + } + + // // Methods to be used by sub-classes // @@ -375,8 +394,6 @@ } // reset/clear button - if (clearIcon == null) - clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); JButton clearButton = new JButton (clearIcon); clearButton.setFocusPainted (false); clearButton.setMargin (new Insets (0,0,0,0)); @@ -401,7 +418,7 @@ protected String getPrefValue (String key, String defaultValue) { Preferences node = PrefsUtils.getNode (this.getClass()); - return node.get (key, defaultValue); + return showNewlines (node.get (key, defaultValue)); } protected boolean getPrefValue (String key, @@ -416,7 +433,7 @@ protected void setPrefValue (String key, String value) { Preferences node = PrefsUtils.getNode (this.getClass()); - node.put (key, value); + node.put (key, hideNewlines (value)); } protected void setPrefValue (String key, @@ -426,12 +443,26 @@ } /********************************************************************* + * Sorry for this hack, but I do not know better... + * + * Problem is that attribute values (preferences) ignore + * newlines. I wanted to replace them with something like ' ' + * but this did not work because the ampersand was escape (as it + * should) to '&'. So I have to "invent" my own escaping by + * introducing MRVAJS. + ********************************************************************/ + static final private String MRVAJS = "#MRVAJS#"; + private static String hideNewlines (String value) { + return value.replaceAll ("\n", MRVAJS); + } + private static String showNewlines (String value) { + return value.replaceAll (MRVAJS, "\n"); + } + + /********************************************************************* * Return true if confirmation dialog passed. ********************************************************************/ public static boolean confirm (Object msg) { - if (confirmIcon == null) - confirmIcon = - SwingUtils.createIcon ("images/confirmButton.gif", Dashboard.class); return SwingUtils.confirm (null, msg, confirmIcon); } @@ -439,9 +470,6 @@ * Display an error message. ********************************************************************/ public static void error (Object msg) { - if (warningIcon == null) - warningIcon = SwingUtils.createIcon ("images/warningButton.gif", - Dashboard.class); JOptionPane.showMessageDialog (null, msg, "Error message", JOptionPane.PLAIN_MESSAGE, warningIcon); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/25 09:02:07 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/26 08:05:18 1.4 @@ -117,25 +117,6 @@ getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); - - -// setEditable (true); -// DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) tree -// .getCellRenderer(); -// TreeCellEditor editor = new LeafCellEditor(tree, renderer); -// tree.setCellEditor(editor); - - -// // listen for when the selection changes -// addTreeSelectionListener ( new TreeSelectionListener() { -// public void valueChanged (TreeSelectionEvent e) { -// DefaultMutableTreeNode node = -// (DefaultMutableTreeNode)getLastSelectedPathComponent(); -// if (node == null) return; -// selected (node); -// } -// }); - // enable tool tips ToolTipManager.sharedInstance().registerComponent (this); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/10/22 14:35:46 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/10/26 08:05:18 1.3 @@ -40,14 +40,18 @@ // components JTextArea textArea; JCheckBox appendModeBox; + JButton cleanButton; boolean appendMode = true; - static Icon clearIcon; + + // shared icons + static Icon clearIcon, clearIconDis; /********************************************************************* * Constructor. ********************************************************************/ public CommonConsole() { super(); + loadIcons(); setLayout (new GridBagLayout()); textArea = new JTextArea(); @@ -55,20 +59,22 @@ textArea.setEditable (false); JScrollPane scroller = new JScrollPane (textArea); - JButton cleanButton = AbstractPanel.createButton + cleanButton = AbstractPanel.createButton (" Clean ", "Remove all messages from the console area", KeyEvent.VK_C, new ActionListener() { public void actionPerformed (ActionEvent e) { - if (! "".equals (textArea.getText()) && AbstractPanel.confirm ("Remove all messages?")) + if (! "".equals (textArea.getText()) && AbstractPanel.confirm ("Remove all messages?")) { textArea.setText (""); + cleanButton.setEnabled (false); + } } }); - if (clearIcon == null) - clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); cleanButton.setIcon (clearIcon); + cleanButton.setDisabledIcon (clearIconDis); + cleanButton.setEnabled (false); appendModeBox = AbstractPanel.createCheckBox ("append mode", appendMode, KeyEvent.VK_A, @@ -99,6 +105,7 @@ textArea.append (value); else textArea.setText (value); + cleanButton.setEnabled (true); } /********************************************************************* @@ -116,4 +123,14 @@ return appendMode; } + /********************************************************************* + * Load all menu icons. + ********************************************************************/ + protected void loadIcons() { + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + if (clearIconDis == null) + clearIconDis = SwingUtils.createIcon ("images/smallClear_dis.gif", this); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/25 09:02:07 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/26 08:05:18 1.7 @@ -28,6 +28,7 @@ import javax.swing.tree.TreePath; import javax.swing.event.TreeSelectionListener; import javax.swing.event.TreeSelectionEvent; +import javax.swing.SwingUtilities; import java.awt.Component; import java.awt.Font; @@ -39,11 +40,6 @@ import java.util.HashSet; import java.util.Enumeration; -// import java.beans.PropertyChangeListener; -// import java.beans.PropertyChangeEvent; -// import java.beans.PropertyChangeSupport; - - /** * A common JTree re-used (and always slightly modified) by all * Biomoby registry trees.

    @@ -75,9 +71,6 @@ static protected Icon menuCollapseIcon, menuCollapseIconDis; static protected Icon menuReloadIcon, menuReloadIconDis; -// protected PropertyChangeSupport support; -// protected boolean expanded = true; // the status of the application list - protected String rootNode; /********************************************************************* @@ -89,20 +82,11 @@ // create an almost empty tree, only with a root node that // contains just a String holding the name of the root node; -// setFont (new Font ("Dialog", Font.PLAIN, 10)); putClientProperty ("JTree.lineStyle", "Angled"); setCellRenderer (new CommonTreeCellRenderer()); getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); -// addMouseListener (new MouseAdapter() { -// public void mouseClicked (MouseEvent e) { -// TreePath selPath = getPathForLocation (e.getX(), e.getY()); -// if (e.getClickCount() == 1) -// onSelected (selPath); -// } -// }); - // listen for when the selection changes addTreeSelectionListener ( new TreeSelectionListener() { public void valueChanged (TreeSelectionEvent e) { @@ -178,7 +162,6 @@ return new JScrollPane (this); } - /********************************************************************* * Get data from a registry model and update the tree. Will be * overwritten by subclass. @@ -333,9 +316,6 @@ * Expand all nodes, starting from the root.

    ********************************************************************/ protected void expand() { -// SwingUtils.expandTree (this, (DefaultMutableTreeNode)getModel().getRoot()); - - final SwingWorker worker = new SwingWorker() { public Object construct() { SwingUtils.expandTree (CommonTree.this, (DefaultMutableTreeNode)getModel().getRoot()); @@ -347,7 +327,6 @@ } }; worker.start(); - } /********************************************************************* @@ -355,7 +334,6 @@ * concrete tree. ********************************************************************/ protected void reload() { - System.out.println ("Invoking a reload."); } /********************************************************************* @@ -364,7 +342,6 @@ * be overwritten by a concrete tree. ********************************************************************/ protected void search (String searchText) { - System.out.println ("Search text: " + searchText); } /********************************************************************* @@ -393,6 +370,9 @@ return result; } + /********************************************************************* + * + ********************************************************************/ protected void highlightAndJumpTo (HashSet toBeHighlighted) { CommonTreeCellRenderer r = (CommonTreeCellRenderer)getCellRenderer(); @@ -455,40 +435,16 @@ * popup menu. ********************************************************************/ protected void setEnabledPopupItem (String actionCommand, boolean enabled) { - synchronized (popup) { - Component[] components = popup.getComponents(); - for (int i = 0; i < components.length; i++) { - if ( components[i] instanceof JMenuItem && - actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ) { - ((JMenuItem)components[i]).setEnabled (enabled); - return; - } - } - } - -// final String ac = actionCommand; -// final boolean fEnabled = enabled; -// final SwingWorker worker = new SwingWorker() { -// public Object construct() { -// synchronized (popup) { -// Component[] components = popup.getComponents(); -// for (int i = 0; i < components.length; i++) { -// if ( components[i] instanceof JMenuItem && -// ac.equals (((JMenuItem)components[i]).getActionCommand()) ) { -// ((JMenuItem)components[i]).setEnabled (fEnabled); -// break; -// } -// } -// } -// return null; // not used here -// } -// // runs on the event-dispatching thread. -// public void finished() { -// repaint(); -// } -// }; -// worker.start(); + Component[] components = popup.getComponents(); + for (int i = 0; i < components.length; i++) { + if ( components[i] instanceof JMenuItem && + actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ) { + ((JMenuItem)components[i]).setEnabled (enabled); + return; + } + } } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/25 09:02:07 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/26 08:05:18 1.7 @@ -39,7 +39,7 @@ static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; static final String DP_CACHE_DIR = "dp-cache-dir"; - static final String DP_USE_CACHE = "dp-use-cache"; + static final String DP_USE_CACHE = "dp-use-cache"; // type: Boolean static final String DP_REG_DT_NAME = "dp-reg-dt-name"; static final String DP_REG_DT_AUTH = "dp-reg-dt-auth"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/25 09:02:07 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/26 08:05:18 1.11 @@ -1,109 +1,3 @@ -Setting colors: - -articleName.setForeground (new Color (0xffffdd)); - ------ - -invokeLater() -------------- -/** - * Create the GUI and show it. For thread safety, - * this method should be invoked from the - * event-dispatching thread. - */ -private static void createAndShowGUI() { - //Make sure we have nice window decorations. - JFrame.setDefaultLookAndFeelDecorated(true); - - //Create and set up the window. - frame = new JFrame("FocusConceptsDemo"); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - //Create and set up the content pane. - JComponent newContentPane = new FocusConceptsDemo(); - newContentPane.setOpaque(true); //content panes must be opaque - frame.setContentPane(newContentPane); - - //Display the window. - frame.pack(); - frame.setVisible(true); -} -public static void main(String[] args) { - //Schedule a job for the event-dispatching thread: - //creating and showing this application's GUI. - javax.swing.SwingUtilities.invokeLater(new Runnable() { - public void run() { - createAndShowGUI(); - } - }); - -invokeAndWait(): ----------------- -void printTextField() throws Exception { - final String[] myStrings = new String[2]; - - Runnable getTextFieldText = new Runnable() { - public void run() { - myStrings[0] = textField0.getText(); - myStrings[1] = textField1.getText(); - } - }; - SwingUtilities.invokeAndWait(getTextFieldText); - - System.out.println(myStrings[0] + " " + myStrings[1]); -} - -SwingWorker: ------------- - -//BETTER CODE: -public void actionPerformed(ActionEvent e) { - ... - final SwingWorker worker = new SwingWorker() { - public Object construct() { - //...code that might take a while to execute is here... - return someValue; - } - }; - worker.start(); //required for SwingWorker 3 - ... -} - -using finished: - -public void actionPerformed(ActionEvent e) { - ... - if (icon == null) { //haven't viewed this photo before - loadImage(imagedir + pic.filename, current); - } else { - updatePhotograph(current, pic); - } -} -... -//Load an image in a separate thread. -private void loadImage(final String imagePath, final int index) { - final SwingWorker worker = new SwingWorker() { - ImageIcon icon = null; - - public Object construct() { - icon = new ImageIcon(getURL(imagePath)); - return icon; //return value not used by this program - } - - //Runs on the event-dispatching thread. - public void finished() { - Photo pic = (Photo)pictures.elementAt(index); - pic.setIcon(icon); - if (index == current) - updatePhotograph(index, pic); - } - }; - worker.start(); -} - - ----- - ? logging (LogPanel and/or usual logging to a file?) * communication with StatusBar (incl. progress bar, cancel button) * disabling things during a long-time operation @@ -191,8 +85,7 @@ Registry panel -------------- -* model (worker: org.biomoby.shared.CentralAll, -CentralDigestCachedImpl.java ) +* finish all buttons Registration panel @@ -225,3 +118,32 @@ - Configure a new Dashboard - Debugging panel (with a Memory Panel embedded; replacing current two pannels) + +UNSOLVED (mysteries and not-yet-dones) +======== + +* RegistrationPanel -> Data type registration + + - at the beginning, the 'add...' menu item in the popup menu are not + disabled - but should be (I do not know why they are not) + + - the BuildDataTypeTree is sometimes damaged (after adding a member +node); not sure how to reproduce it + + ! loading... does not sync correctly with the browser panel + + ! more generally: simplify (or at least document) what kind of notifications + are used (now, it seems to be confusin what has PropertyChannel and what + is registered by 'support') + + ! finish all the caching stuff (separate scrap of paper) + +* After registration, update cache, update list +* The same, after de-registration +* Then make the reg/unreg real... + +* Icons: + - better icon for AddHAS (with a small star) + +* alltools2: + - JTextFieldWithHistory should remember also an empty value ("") =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/25 09:02:07 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/26 08:05:18 1.4 @@ -12,6 +12,7 @@ import org.biomoby.shared.Central; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyRelationship; +import org.biomoby.shared.parser.MobyTags; import org.biomoby.service.generator.DataTypesGenerator; import org.tulsoft.shared.UUtils; @@ -77,14 +78,25 @@ CommonConsole console; MobyException dtException; - - final static String DATA_TYPE_PROLOGUE = - "An error occured when trying to register a new data type.\n\n"; + MobyException dtUnregException; // shared icons protected static Icon menuAddISAIcon, menuAddISAIconDis; protected static Icon menuAddHASAIcon, menuAddHASAIconDis; protected static Icon menuAddHASIcon, menuAddHASIconDis; + protected static Icon menuUnregisterIcon, menuUnregisterIconDis; + + // some texts + final static String DATA_TYPE_PROLOGUE = + "An error occured when trying to register a new data type.\n\n"; + + final static String DATA_TYPE_UNREG_PROLOGUE = + "An error occured when trying to unregister a data type.\n\n"; + + final static String DATA_TYPE_INTRO = + "Create new data type by filling the form in the middle and adding" + + " parent and children types from the tree on the right. Adding is done" + + " by selecting first a data type, then right-click gives you menu."; /********************************************************************* * propertyChange() @@ -117,6 +129,10 @@ if (pComponent != null) return pComponent; + // console panel + console = new CommonConsole(); + console.setAppendMode (true); + pComponent = new JPanel (new GridBagLayout(), true); // sub-panels for registering various entities @@ -126,10 +142,6 @@ tabbedPane.addTab ("Service Type", getServiceTypeRegistration()); tabbedPane.addTab ("Service", getServiceRegistration()); - // console panel - console = new CommonConsole(); - console.setAppendMode (true); - // split the screen JSplitPane split = new JSplitPane (JSplitPane.VERTICAL_SPLIT, tabbedPane, @@ -340,6 +352,7 @@ protected final static String AC_PARENT = "ac-parent"; protected final static String AC_MHASA = "ac-m-hasa"; protected final static String AC_MHAS = "ac-m-has"; + protected final static String AC_UNREG = "ac-unreg"; /********************************************************************* * Construtor @@ -374,6 +387,13 @@ if (menuAddHASIconDis == null) menuAddHASIconDis = SwingUtils.createIcon ("images/smallAddHAS_dis.gif", Dashboard.class); + + if (menuUnregisterIcon == null) + menuUnregisterIcon = + SwingUtils.createIcon ("images/smallUnregister.gif", Dashboard.class); + if (menuUnregisterIconDis == null) + menuUnregisterIconDis = + SwingUtils.createIcon ("images/smallUnregister_dis.gif", Dashboard.class); } /********************************************************************* @@ -387,36 +407,49 @@ removeSeparatorAfter (AC_COLLAPSE); popup.add - (createMenuItem (new AbstractAction ("Add selected as a parent type - ISA") { + (createMenuItem (new AbstractAction ("Add selected as a parent type - ISA") { public void actionPerformed (ActionEvent e) { onParentSelected(); } }, AC_PARENT, menuAddISAIcon, menuAddISAIconDis)); popup.add - (createMenuItem (new AbstractAction ("Add selected as a member - HASA") { + (createMenuItem (new AbstractAction ("Add selected as a member - HASA") { public void actionPerformed (ActionEvent e) { onMemberSelected (Central.iHASA); } }, AC_MHASA, menuAddHASAIcon, menuAddHASAIconDis)); popup.add - (createMenuItem (new AbstractAction ("Add selected as a list of members - HAS") { + (createMenuItem (new AbstractAction ("Add selected as a list of members - HAS") { public void actionPerformed (ActionEvent e) { onMemberSelected (Central.iHAS); } }, AC_MHAS, menuAddHASIcon, menuAddHASIconDis)); - selected (null); + popup.addSeparator(); + + popup.add + (createMenuItem (new AbstractAction ("Unregister") { + public void actionPerformed (ActionEvent e) { + onUnregisterDataType(); + } + }, AC_UNREG, menuUnregisterIcon, menuUnregisterIconDis)); + + selected (null); // TBD: this has no effect; why? } /********************************************************************* * Called when a tree node is selected, or deselected (in - * which case 'node' is null). If anything is selected, enable - * few popup menu items, otherwise disable them. + * which case 'node' is null). If a data type name is + * selected, enable few popup menu items, otherwise disable them. ********************************************************************/ protected void selected (DefaultMutableTreeNode node) { - boolean enabled = (node != null); + boolean enabled = true; + if ( node == null || + node.isRoot() || + (lastSorted == SORTED_BY_AUTHORITY && ! node.isLeaf()) ) + enabled = false; setEnabledPopupItem (AC_PARENT, enabled); setEnabledPopupItem (AC_MHASA, enabled); setEnabledPopupItem (AC_MHAS, enabled); @@ -430,7 +463,9 @@ (DefaultMutableTreeNode)getLastSelectedPathComponent(); if (node != null) { // i.e. something is really selected CommonNode nodeObject = (CommonNode)node.getUserObject(); - buildTree.setParent (nodeObject.getValue()); + String value = nodeObject.getValue(); + if (! DataTypesGenerator.isPrimitiveType (value)) + buildTree.setParent (value); } } @@ -446,6 +481,50 @@ } } - } + /********************************************************************* + * + ********************************************************************/ + protected void onUnregisterDataType() { + DefaultMutableTreeNode node = + (DefaultMutableTreeNode)getLastSelectedPathComponent(); + if (node == null) return; // nothing selected + CommonNode nodeObject = (CommonNode)node.getUserObject(); + final String dataTypeName = nodeObject.getValue(); + + if (DataTypesGenerator.isPrimitiveType (dataTypeName) || + dataTypeName.equals (MobyTags.MOBYOBJECT)) { + AbstractPanel.error ("Sorry, but the top-level object and\n" + + "the objects representing primitive types\n" + + "cannot unregister. At least not so easily."); + return; + } + + if (! confirm ("Are you sure you wish to unregister\n" + + "data type: " + dataTypeName + " ?")) + return; + + dtUnregException = null; + final SwingWorker worker = new SwingWorker() { + public Object construct() { + try { + MobyDataType dataType = new MobyDataType (dataTypeName); + console.setText ("Data type to be unregistered: " + dataTypeName + "\n"); + registryModel.unRegisterDataType (dataType); + console.setText ("\nUnregistration successful!\n\n"); + } catch (MobyException e) { + dtUnregException = e; + } + return null; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (dtUnregException != null) + error (DATA_TYPE_UNREG_PROLOGUE, dtUnregException); + } + }; + worker.start(); + } + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/25 09:02:07 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/26 08:05:18 1.7 @@ -95,6 +95,23 @@ /********************************************************************* * ********************************************************************/ + public void unRegisterDataType (MobyDataType dataType) + throws MobyException { + initWorker(); +// try { +// worker.unregisterDataType (dataType); +// } catch (PendingCurationException e) { +// throw new MobyException ("Unregistration reports 'Pending curation'...\n" + +// "Well, nobody knows what it means. Call Mark!"); +// } catch (NoSuccessException e) { +// throw new MobyException ("Unregistration reports 'No Success'...\n" + +// e.getMessage()); +// } + } + + /********************************************************************* + * + ********************************************************************/ public MobyDataType[] getDataTypesByNames() throws MobyException { initWorker(); From senger at pub.open-bio.org Thu Oct 27 00:15:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Oct 27 00:13:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FOck002913@pub.open-bio.org> senger Thu Oct 27 00:15:24 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/shared/event Modified Files: NotificationEvent.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/22 01:38:04 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/27 04:15:23 1.3 @@ -8,6 +8,7 @@ package org.biomoby.shared.event; +import org.tulsoft.shared.UUtils; import java.util.EventObject; /** @@ -98,7 +99,8 @@ StringBuffer buf = new StringBuffer (100); buf.append ("["); buf.append (typeStr); - buf.append (", Message=" + message); + if (UUtils.notEmpty (message)) + buf.append (", Message=" + message); if (details != null) buf.append (", Details=" + details.getClass().getName()); buf.append ("]"); From senger at pub.open-bio.org Thu Oct 27 00:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Oct 27 00:14:39 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FN6t002798@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv2749/src/Clients Modified Files: CacheRegistryClient.java MobyCmdLineClient.java MobyDigestClient.java TestingCentral.java Log Message: moby-live/Java/src/Clients CacheRegistryClient.java,1.4,1.5 MobyCmdLineClient.java,1.12,1.13 MobyDigestClient.java,1.5,1.6 TestingCentral.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/22 16:07:08 1.4 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/10/27 04:15:23 1.5 @@ -122,7 +122,7 @@ if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-n")) { castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_NAMESPACES); decorationLn ("Retrieving namespaces..."); - worker.getNamespaces(); + worker.getFullNamespaces(); } // =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/19 08:08:32 1.12 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/10/27 04:15:23 1.13 @@ -157,12 +157,9 @@ if (cmd.hasOption ("-ln")) { decorationLn ("Namespaces:"); decorationLn ("-----------"); - Map types = worker.getNamespaces(); - - for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - System.out.println (entry.getKey()); - System.out.println ("\t" + entry.getValue()); + MobyNamespace[] nms = worker.getFullNamespaces(); + for (int i = 0; i < nms.length; i++) { + System.out.println (nms[i]); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/10/12 11:17:59 1.5 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/10/27 04:15:23 1.6 @@ -91,12 +91,10 @@ if (cmd.hasOption ("-t")) { MobyServiceType[] serviceTypes = worker.getFullServiceTypes(); for (int i = 0; i < serviceTypes.length; i++) { - if (details) { - System.out.println (serviceTypes[i].toString()); - System.out.println ("---"); - } else { + if (details) + System.out.println (serviceTypes[i]); + else System.out.println (serviceTypes[i].getName()); - } } } @@ -105,7 +103,7 @@ if (details) { MobyService[] services = worker.getServices(); for (int i = 0; i < services.length; i++) { - System.out.println (services[i].toString()); + System.out.println (services[i]); System.out.println ("---"); } } else { @@ -123,12 +121,12 @@ // read all namespaces if (cmd.hasOption ("-n")) { - Map namespaces = worker.getNamespaces(); - for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - System.out.println (entry.getKey()); + MobyNamespace[] namespaces = worker.getFullNamespaces(); + for (int i = 0; i < namespaces.length; i++) { if (details) - System.out.println ("\t" + entry.getValue()); + System.out.println (namespaces[i]); + else + System.out.println (namespaces[i].getName()); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/10/18 17:19:56 1.8 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/10/27 04:15:23 1.9 @@ -184,7 +184,7 @@ try { start ("retrieveNamespaces"); - worker.getNamespaces(); + worker.getFullNamespaces(); ok(); } catch (MobyException e) { error (e); } From senger at pub.open-bio.org Thu Oct 27 00:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Oct 27 00:15:04 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FNpx002830@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralDigestImpl.java CentralImpl.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.10,1.11 CentralDigestImpl.java,1.7,1.8 CentralImpl.java,1.29,1.30 GraphsServlet.java,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/22 01:38:04 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/27 04:15:23 1.11 @@ -6,6 +6,14 @@ package org.biomoby.client; +import org.biomoby.shared.CentralAll; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyNamespace; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.MobyService; +import org.biomoby.shared.MobyServiceType; +import org.biomoby.shared.NoSuccessException; + import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; @@ -20,13 +28,6 @@ import java.util.Arrays; import java.util.Comparator; -import org.biomoby.shared.CentralAll; -import org.biomoby.shared.MobyDataType; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyService; -import org.biomoby.shared.MobyServiceType; -import org.biomoby.shared.NoSuccessException; - /** * An implementation of {@link org.biomoby.shared.CentralAll}, * allowing to cache locally results of the cumulative methods so it @@ -325,7 +326,7 @@ if (list == null || list.length == 0) return true; for (int i = 0; i < list.length; i++) { - if ( ! ignored (new File (list[i])) ) + if ( ! ignoredForEmptiness (new File (list[i])) ) return false; } return true; @@ -403,11 +404,10 @@ fireEvent (SERVICE_TYPES_START); String typesAsXML = getServiceTypesAsXML(); store (serviceTypesCache, LIST_FILE, typesAsXML); - Map types = createServiceTypesFromXML (typesAsXML); - fireEvent (SERVICE_TYPES_COUNT, new Integer (types.size())); - for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); + MobyServiceType[] types = createServiceTypesFromXML (typesAsXML); + fireEvent (SERVICE_TYPES_COUNT, new Integer (types.length)); + for (int i = 0 ; i < types.length; i++) { + String name = types[i].getName(); fireEvent (SERVICE_TYPE_LOADING, name); String xml = getServiceTypeRelationshipsAsXML (name, false); store (serviceTypesCache, name, xml); @@ -556,11 +556,10 @@ /************************************************************************* * *************************************************************************/ -// public MobyNamespace[] getNamespaces() //TBD: later, when API allows it - public Map getNamespaces() + public MobyNamespace[] getFullNamespaces() throws MobyException { if (namespacesCache == null) - return super.getNamespaces(); + return super.getFullNamespaces(); synchronized (namespacesCache) { if (isCacheEmpty (namespacesCache)) { initCache(); @@ -590,26 +589,19 @@ // get a list file (with all service type names) String xmlList = getListFile (serviceTypesCache); - Map types = createServiceTypesFromXML (xmlList); + MobyServiceType[] types = createServiceTypesFromXML (xmlList); - // get individual (almost) full service types - Vector v = new Vector(); - for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); + // add details about relationship to get full service types + for (int i = 0; i < types.length; i++) { + String name = types[i].getName(); File file = new File (serviceTypesCache, name); try { - MobyServiceType serviceType = new MobyServiceType (name); - serviceType.setParentNames (createServiceTypeRelationshipsFromXML (load (file))); - serviceType.setDescription ((String)entry.getValue()); - v.addElement (serviceType); + types[i].setParentNames (createServiceTypeRelationshipsFromXML (load (file))); } catch (MobyException e) { System.err.println (MSG_CACHE_BAD_FILE (file, e)); } } - MobyServiceType[] result = new MobyServiceType [v.size()]; - v.copyInto (result); - return result; + return types; } } @@ -646,6 +638,15 @@ } /************************************************************************** + * Some file (when a cache is being tested fir emptyness) are ignored. + *************************************************************************/ + protected static boolean ignoredForEmptiness (File file) { + String path = file.getPath(); + return + path.endsWith ("~"); + } + + /************************************************************************** * *************************************************************************/ protected static String MSG_CACHE_NOT_DIR (File cache) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/22 01:38:04 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/27 04:15:23 1.8 @@ -145,33 +145,13 @@ /************************************************************************* * Physically gather together all namespaces. It is not that hard * (comparing to other Biomoby entities) because all namespaces - * are delivered by a single call to Biomoby. This method differs - * form the Central.getNamespaces() in the type of returned - * result, and - hopefully in the future - also in the amount of - * information stored in the returned value (but at the monent, - * because of a limitation of the Biomoby API, both result types - * contain the same information). + * are delivered by a single call to Biomoby. *************************************************************************/ protected MobyNamespace[] readNamespaces() throws MobyException { try { fireEvent (NAMESPACES_START); - Map names = getNamespaces(); - fireEvent (NAMESPACES_COUNT, new Integer (names.size())); - MobyNamespace[] result = new MobyNamespace [ names.size() ]; - int i = 0; - for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); - MobyNamespace ns = new MobyNamespace (name); - ns.setDescription ((String)entry.getValue()); - result[i++] = ns; - fireEvent (NAMESPACE_LOADED, name, ns); - } - return result; - - } catch (Exception e) { - throw new MobyException (formatException (e)); + return super.getFullNamespaces(); } finally { fireEvent (NAMESPACES_END); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/10/12 11:36:59 1.29 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/10/27 04:15:23 1.30 @@ -560,6 +560,14 @@ return value; } + protected String getFirstValue (NodeList children) { + if (children.item(0) != null && children.item(0).hasChildNodes()) { + children.item(0).normalize(); + return getFirstValue (children.item(0)); + } + return ""; + } + /************************************************************************** * * Implementing SimpleCache interface. @@ -784,8 +792,10 @@ * Parses and imports the following XML. *

          *  <serviceTypes>
    -     *     <serviceType name="serviceName">
    +     *     <serviceType name="serviceName" lsid="...">
          *            <Description><![CDATA[free text description here]]></Description>
    +     *            <contactEmail>...</contactEmail>
    +     *            <authURI>...</authURI>
          *     </serviceType>
          *          ...
          *          ...
    @@ -795,7 +805,13 @@
         public Map getServiceTypes()
     	throws MobyException {
     	String result = getServiceTypesAsXML();
    -	return createServiceTypesFromXML (result);
    + 	Map results = new TreeMap (getStringComparator());
    +	MobyServiceType[] types = createServiceTypesFromXML (result);
    +	for (int i = 0; i < types.length; i++) {
    +	    results.put (types[i].getName(),
    +			 types[i].getDescription());
    +	}
    +	return results;
         }
     
         //
    @@ -805,29 +821,33 @@
     			       new Object[] {});
         }
     
    -    //
    -    protected Map createServiceTypesFromXML (String result)
    +    // but be aware that the created MobyServiceTypes are not complete
    +    // - they do not have the relationship information; that's why
    +    // this method is not public; the full service types are available
    +    // from CentralDigest implementations
    +    protected MobyServiceType[] createServiceTypesFromXML (String result)
     	throws MobyException {
     
     	// parse returned XML
    -	Map results = new TreeMap (getStringComparator());
     	Document document = null;
     	try {
     	    document = docBuilder.parse(new ByteArrayInputStream(result.getBytes()));}
     	catch(Exception e){throw new MobyException(e.toString());}
     
     	NodeList list = document.getElementsByTagName ("serviceType");
    +	if (list == null || list.getLength() == 0)
    +	    return new MobyServiceType[] {};
    +	MobyServiceType[] results = new MobyServiceType [list.getLength()];
     	for (int i = 0; i < list.getLength(); i++) {
     	    Element elem = (Element)list.item (i);
    -	    NodeList children = elem.getChildNodes();
    -	    for (int j = 0; j < children.getLength(); j++) {
    -		if (children.item (j).getNodeName().equals ("Description")) {
    -		    results.put (elem.getAttribute ("name"),
    -				 getFirstValue (children.item (j)));
    -		    break;
    -		}
    -	    }
    +	    MobyServiceType st = new MobyServiceType (elem.getAttribute ("name"));
    +	    st.setLSID (elem.getAttribute ("lsid"));
    +	    st.setDescription (getFirstValue (elem.getElementsByTagName ("Description")));
    +	    st.setEmailContact (getFirstValue (elem.getElementsByTagName ("contactEmail")));
    +	    st.setAuthority (getFirstValue (elem.getElementsByTagName ("authURI")));
    +	    results[i] = st;
     	}
    + 	java.util.Arrays.sort (results);
     	return results;
         }
     
    @@ -835,15 +855,17 @@
          * Parses and imports the following XML.
          * 
          *  <Namespaces>
    -     *     <Namespace name="namespace">
    +     *     <Namespace name="namespace" lsid="...">
          *            <Description><![CDATA[free text description here]]></Description>
    +     *            <contactEmail>...</contactEmail>
    +     *            <authURI>...</authURI>
          *     </Namespace>
          *          ...
          *          ...
          *  </Namespaces>
          * 
    *************************************************************************/ - public Map getNamespaces() + public MobyNamespace[] getFullNamespaces() throws MobyException { String result = getNamespacesAsXML(); @@ -858,11 +880,10 @@ } // - protected Map createNamespacesFromXML (String result) + protected MobyNamespace[] createNamespacesFromXML (String result) throws MobyException { // parse returned XML - Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -872,25 +893,35 @@ NodeList list = document.getDocumentElement().getElementsByTagName ("Namespace"); if (list == null || list.getLength() == 0) { - throw new MobyException ("Could not find Namespace children of response root node " + - document.getDocumentElement()); + return new MobyNamespace[] {}; } - int length = list.getLength(); - for (int i = 0; i < length; i++) { + MobyNamespace[] results = new MobyNamespace [list.getLength()]; + for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); - NodeList children = elem.getElementsByTagName("Description"); - if (children.item(0).hasChildNodes()) { - children.item(0).normalize(); - results.put (elem.getAttribute ("name"), - getFirstValue (children.item(0))); + MobyNamespace nm = new MobyNamespace (elem.getAttribute ("name")); + nm.setLSID (elem.getAttribute ("lsid")); + nm.setDescription (getFirstValue (elem.getElementsByTagName ("Description"))); + nm.setEmailContact (getFirstValue (elem.getElementsByTagName ("contactEmail"))); + nm.setAuthority (getFirstValue (elem.getElementsByTagName ("authURI"))); + results[i] = nm; + } + java.util.Arrays.sort (results); + return results; + } - } else { - // No description provided - results.put (elem.getAttribute ("name"), ""); - } - } + /************************************************************************** + * + *************************************************************************/ + public Map getNamespaces() + throws MobyException { + Map results = new TreeMap (getStringComparator()); + MobyNamespace[] namespaces = getFullNamespaces(); + for (int i = 0; i < namespaces.length; i++) { + results.put (namespaces[i].getName(), + namespaces[i].getDescription()); + } return results; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/22 16:07:09 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/10/27 04:15:23 1.13 @@ -423,12 +423,13 @@ MobyService[] services = null; MobyDataType[] dataTypes = null; - Map namespaces = null; +// Map namespaces = null; + MobyNamespace[] namespaces = null; try { readRegistryIfNeeded(); services = registry.getServices(); dataTypes = registry.getDataTypes(); - namespaces = registry.getNamespaces(); + namespaces = registry.getFullNamespaces(); lastRead = getLastRead(); } catch (MobyException e) { error (res, HttpServletResponse.SC_SERVICE_UNAVAILABLE, e); @@ -570,10 +571,13 @@ String selectData2 = h.list (attrs, dataLabels, null, selected); Vector v = new Vector(); - for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - v.addElement (entry.getKey()); + for (int i = 0; i < namespaces.length; i++) { + v.addElement (namespaces[i].getName()); } +// for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { +// Map.Entry entry = (Map.Entry)it.next(); +// v.addElement (entry.getKey()); +// } new Sorter().sort (v); v.insertElementAt (WITHOUT_NAMESPACE, 0); String[] nsLabels = new String [v.size()]; From senger at pub.open-bio.org Thu Oct 27 00:15:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Oct 27 00:15:08 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FObv002892@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/shared Modified Files: Central.java CentralDigest.java MobyNamespace.java MobyServiceType.java Log Message: moby-live/Java/src/main/org/biomoby/shared Central.java,1.12,1.13 CentralDigest.java,1.2,1.3 MobyNamespace.java,1.2,1.3 MobyServiceType.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2005/08/07 06:40:39 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2005/10/27 04:15:23 1.13 @@ -162,8 +162,11 @@ throws MobyException; /************************************************************************** - * Get the list of all registered namespaces. - *

    + * Get the list of all registered namespaces.

    + * + * @deprecated Replaced by {@link #getFullNamespaces} that gives + * more information for the same price.

    + * * @return a hash table where keys are names of namespaces while * values are their descriptions * @throws MobyException if communication with the Moby Registry fails @@ -172,6 +175,16 @@ throws MobyException; /************************************************************************** + * Get the list of all registered namespaces, with all their + * attributes.

    + * + * @return array of namespaces + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + MobyNamespace[] getFullNamespaces() + throws MobyException; + + /************************************************************************** * Get the list of all registered data types. *

    * @return a hash table where keys are names of data types while =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2005/09/22 16:07:09 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2005/10/27 04:15:23 1.3 @@ -46,17 +46,6 @@ throws MobyException; /************************************************************************* - * Get definition of all known namespaces. It differs from the - * {@link Central#getNamespaces} because it returns an array of - * full definitions of namespaces, and not just their names and - * descriptions.

    - * - * @throws MobyException if communication with the Moby Registry fails - *************************************************************************/ - MobyNamespace[] getFullNamespaces() - throws MobyException; - - /************************************************************************* * Get definition of all registered service instances. It is a * cumulation of many individual calls to {@link * Central#findService(MobyService) findService by name} for all =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2005/09/22 16:07:09 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2005/10/27 04:15:23 1.3 @@ -20,14 +20,23 @@ * @version $Id$ */ -public class MobyNamespace { +public class MobyNamespace + implements Comparable { protected String name; protected String authority = ""; protected String emailContact = ""; protected String description = ""; + protected String lsid = null; protected String id = null; + public int compareTo (Object obj) { + return name.compareToIgnoreCase ( ((MobyNamespace)obj).getName() ); + } + public boolean equals (Object obj) { + return name.equals ( ((MobyNamespace)obj).getName() ); + } + /************************************************************************** * Default constructor. Other characteristics are empty - which is usually * wrong - therefore use 'set' method to fill them. @@ -47,6 +56,13 @@ id = value; } + public String getLSID() { + return lsid; + } + public void setLSID (String value) { + lsid = value; + } + public String getAuthority() { return authority; } @@ -70,10 +86,12 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name); + buf.append (name); if (UUtils.notEmpty (authority)) buf.append (", Auth: " + authority); - if (id != null) buf.append (", ID: " + id); + if (UUtils.notEmpty (emailContact)) + buf.append (", Contact: " + emailContact); + if (lsid != null) buf.append (", " + lsid); if (UUtils.notEmpty (description)) buf.append ("\n\t" + description); return new String (buf); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java 2004/10/18 14:35:06 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java 2005/10/27 04:15:23 1.3 @@ -6,6 +6,7 @@ // package org.biomoby.shared; +import org.tulsoft.shared.UUtils; /** * A container representing a service type used in the Moby registry. @@ -19,7 +20,8 @@ * @version $Id$ */ -public class MobyServiceType { +public class MobyServiceType + implements Comparable { protected String name; protected String description = ""; @@ -27,6 +29,14 @@ protected String authority = ""; protected String[] parentNames = new String[] { }; protected String id = null; + protected String lsid = null; + + public int compareTo (Object obj) { + return name.compareToIgnoreCase ( ((MobyServiceType)obj).getName() ); + } + public boolean equals (Object obj) { + return name.equals ( ((MobyServiceType)obj).getName() ); + } /************************************************************************** * Default constructor. @@ -57,6 +67,13 @@ id = value; } + public String getLSID() { + return lsid; + } + public void setLSID (String value) { + lsid = value; + } + public String getDescription() { return description; } @@ -109,14 +126,19 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("Desc: " + description + "\n"); - buf.append ("ID: " + id + "\n"); - buf.append ("Parents:\n"); - for (int i = 0 ; i < parentNames.length; i++) { - buf.append (Utils.format (null, 1)); - buf.append (parentNames [i]); - buf.append ("\n"); + buf.append (name); + if (UUtils.notEmpty (authority)) + buf.append (", Auth: " + authority); + if (UUtils.notEmpty (emailContact)) + buf.append (", Contact: " + emailContact); + if (lsid != null) buf.append (", " + lsid); + if (UUtils.notEmpty (description)) + buf.append ("\n\t" + description); + if (parentNames.length > 0) { + buf.append ("\n\tParents: "); + for (int i = 0 ; i < parentNames.length; i++) { + buf.append (parentNames [i] + " "); + } } return new String (buf); } From senger at pub.open-bio.org Thu Oct 27 00:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Oct 27 00:15:17 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FN88002855@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/service/dashboard Modified Files: PropertyChannel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard PropertyChannel.java,1.3,1.4 RegistryPanel.java,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/22 01:38:04 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/27 04:15:23 1.4 @@ -41,8 +41,8 @@ * listener) we may re-consider this desision. At the moment, I do not * see any advantage of it.

    * - * Property names are of no interest for this class, but it is good to - * remind that they should be defined in the class {@link + * Concrete property names are of no interest for this class, but it + * is good to remind that they should be collected in the class {@link * DashboardProperties}.

    * @author Martin Senger =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 14:35:46 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/27 04:15:23 1.12 @@ -130,38 +130,45 @@ // ontology trees ServicesTree servicesTree = new ServicesTree(); - + ServiceTypesTree serviceTypesTree = new ServiceTypesTree(); + NamespacesTree namespacesTree = new NamespacesTree(); DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, console, support); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); - NamespacesTree namespacesTree = new NamespacesTree(); - JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, servicesTree.scrollable(), dataTypesBoard); split1.setResizeWeight (0.5); split1.setContinuousLayout (true); split1.setOneTouchExpandable (true); + JSplitPane split2 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, - split1, + serviceTypesTree.scrollable(), namespacesTree.scrollable()); - split2.setResizeWeight (0.7); + split2.setResizeWeight (0.5); split2.setContinuousLayout (true); split2.setOneTouchExpandable (true); - JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, - split2, - console); - split3.setResizeWeight (0.75); + JSplitPane split3 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, + split1, + split2); + split3.setResizeWeight (0.5); split3.setContinuousLayout (true); split3.setOneTouchExpandable (true); + JSplitPane split4 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, + split3, + console); + split4.setResizeWeight (0.75); + split4.setContinuousLayout (true); + split4.setOneTouchExpandable (true); + // put all together - SwingUtils.addComponent (pComponent, split3, 0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0); - SwingUtils.addComponent (pComponent, regLocation, 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0); - SwingUtils.addComponent (pComponent, cacheLocation, 1, 1, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (pComponent, split4, 0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0); + SwingUtils.addComponent (pComponent, regLocation, 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (pComponent, cacheLocation, 1, 1, 1, 1, HORI, NWEST, 0.0, 0.0); return pComponent; } @@ -322,6 +329,16 @@ /************************************************************************** * **************************************************************************/ + class ServiceTypesTree extends CommonTree { + public ServiceTypesTree() { + super ("Service Types"); + } + } + + + /************************************************************************** + * + **************************************************************************/ class NamespacesTree extends CommonTree { public NamespacesTree() { super ("Namespaces"); From senger at pub.open-bio.org Thu Oct 27 00:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Oct 27 00:15:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FNLO002768@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv2749/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.44,1.45 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/24 17:51:51 1.44 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/10/27 04:15:23 1.45 @@ -1,3 +1,15 @@ +2005-10-26 Martin Senger + + * Add Comparator interface/implementtaion to MobyServiceType. + + * Changed slightly the output of namespaces and service types in + MobyCmdLineClient (because more data is now flowing from Biomoby + registers). + + * Add getFullNamespaces() to Central.java and its implementations. + + * Add Comparator interface/implementtaion to MobyNamespace. + 2005-09-24 Martin Senger * Added sorting to the most of the returned results from From senger at pub.open-bio.org Thu Oct 27 04:55:48 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Oct 27 04:54:20 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270855.j9R8tmuP003759@pub.open-bio.org> senger Thu Oct 27 04:55:48 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv3740/src/config/dashboard/META-INF/services Modified Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/10/22 14:35:46 1.2 +++ /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/10/27 08:55:48 1.3 @@ -1,4 +1,3 @@ org.biomoby.service.dashboard.RegistryPanel org.biomoby.service.dashboard.RegistrationPanel -org.biomoby.service.dashboard.ConsolePanel -org.biomoby.service.dashboard.EventGeneratorPanel +org.biomoby.service.dashboard.DebuggingPanel From senger at pub.open-bio.org Thu Oct 27 04:55:49 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Oct 27 04:54:46 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270855.j9R8tn0s003817@pub.open-bio.org> senger Thu Oct 27 04:55:48 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv3740/src/main/org/biomoby/service/dashboard Modified Files: AbstractModel.java AbstractPanel.java CommonBoard.java Dashboard.java DashboardPanel.java DataTypesBoard.java PropertyChannel.java RegistrationPanel.java RegistryModel.java RegistryPanel.java Added Files: DebuggingPanel.java Removed Files: ConsolePanel.java EventGeneratorPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard DebuggingPanel.java,NONE,1.1 AbstractModel.java,1.1,1.2 AbstractPanel.java,1.10,1.11 CommonBoard.java,1.1,1.2 Dashboard.java,1.7,1.8 DashboardPanel.java,1.4,1.5 DataTypesBoard.java,1.2,1.3 PropertyChannel.java,1.4,1.5 RegistrationPanel.java,1.4,1.5 RegistryModel.java,1.7,1.8 RegistryPanel.java,1.12,1.13 ConsolePanel.java,1.5,NONE EventGeneratorPanel.java,1.4,NONE =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/09/24 17:54:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/10/27 08:55:48 1.2 @@ -44,9 +44,8 @@ */ public class AbstractModel - implements PropertyChangeListener, DashboardProperties { + implements DashboardProperties { - protected PropertyChangeSupport support; protected PropertyChannel propertyChannel; /********************************************************************* @@ -55,26 +54,11 @@ protected AbstractModel() { } - /********************************************************************* - * Usual constructor that shares support for property changes with - * its creator. - ********************************************************************/ - protected AbstractModel (PropertyChangeSupport support) { - this.support = support; - } - - /************************************************************************** - * Here we get notified when a property change happen. - **************************************************************************/ - public void propertyChange (PropertyChangeEvent event) { - } - /************************************************************************** * Keep shared storage of properties updated in various panels. **************************************************************************/ public void setPropertyChannel (PropertyChannel propertyChannel) { this.propertyChannel = propertyChannel; - propertyChannel.addPropertyChangeListener (this); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/26 08:05:18 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/27 08:55:48 1.11 @@ -1,6 +1,6 @@ // AbstractPanel.java // -// Created: September 2005 +// Created: September 2005 // // This file is a component of the BioMoby project. // Copyright Martin Senger (martin.senger@gmail.com). @@ -51,10 +51,6 @@ import java.awt.event.FocusEvent; import java.awt.event.FocusListener; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeSupport; - import java.io.File; import java.util.prefs.Preferences; import java.util.Map; @@ -102,14 +98,13 @@ protected static final Font TITLE_FONT = new Font ("Serif", Font.BOLD, 20); protected static final Color TITLE_FGCOLOR = new Color (12, 55, 241); - // + // sharing events protected PropertyChannel propertyChannel; /********************************************************************* * Default constructor (just for the sub-classes). ********************************************************************/ protected AbstractPanel() { - support = new PropertyChangeSupport (this); loadIcons(); } @@ -137,33 +132,11 @@ return title; } - /********************************************************************* - * Property change stuff - ********************************************************************/ - protected PropertyChangeSupport support; - - public void addPropertyChangeListener (PropertyChangeListener l) { - if (support != null) - support.addPropertyChangeListener(l); - } - - public void removePropertyChangeListener (PropertyChangeListener l) { - if (support != null) - support.removePropertyChangeListener(l); - } - - /************************************************************************** - * Here we get notified when a property change happens. - **************************************************************************/ - public void propertyChange (PropertyChangeEvent event) { - } - /************************************************************************** - * Remember a property channel and register itself to it as a listener. + * Remember the property channel. **************************************************************************/ protected void setPropertyChannel (PropertyChannel propertyChannel) { this.propertyChannel = propertyChannel; - propertyChannel.addPropertyChangeListener (this); } // =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/22 01:38:04 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/27 08:55:48 1.2 @@ -20,7 +20,6 @@ import java.awt.event.ActionListener; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; -import java.beans.PropertyChangeSupport; /** * This is a simple graphical widget combining together a tree (a @@ -31,9 +30,9 @@ * * It is also a listener of events notifying about the loading * process. It reflects this events appropriately in the progress - * bar, and in some cases it propagates these events as - * property-change events further (usually they are caught and - * displayed in Dashboard's status bar).

    + * bar, and in some cases it propagates these events to the property + * channel (usually they are caught and displayed in Dashboard's + * status bar).

    * * @author Martin Senger * @version $Id$ @@ -44,7 +43,7 @@ implements NotificationListener { protected RegistryModel model; - protected PropertyChangeSupport support; + protected PropertyChannel channel; // components protected JLabel treeTitle; @@ -56,13 +55,13 @@ * Constructor.

    * * @param model gives access to a Biomoby registry - * @param support is used to fire property-change events + * @param channel is used to fire property-change events ********************************************************************/ protected CommonBoard (RegistryModel model, - PropertyChangeSupport support) { + PropertyChannel channel) { this.model = model; this.model.addNotificationListener (this); - this.support = support; + this.channel = channel; treeTitle = new JLabel (""); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/25 09:02:07 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/27 08:55:48 1.8 @@ -51,7 +51,6 @@ implements DashboardPanel, ChangeListener { private JComponent dashboard; - private StatusBar statusBar; private DashboardHeader header; public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; @@ -89,7 +88,6 @@ loadPanels(); propertyChannel = new PropertyChannel(); dashboard = getComponent (propertyChannel); - connectPanels(); } /************************************************************************** @@ -106,21 +104,6 @@ } /************************************************************************** - * Connect all available Dashboard panels: a) together, and b) - * with the status bar. TBD: It changed... It uses now a PropertyChannel... - **************************************************************************/ - public void connectPanels() { - for (int i = 0; i < panels.length; i++) { -// for (int j = 0; j < i; j++) -// panels[i].addPropertyChangeListener (panels[j]); -// for (int j = i+1; j < panels.length; j++) -// panels[i].addPropertyChangeListener (panels[j]); - if (statusBar != null) - panels[i].addPropertyChangeListener (statusBar); - } - } - - /************************************************************************** * Show the main frame. **************************************************************************/ public void show() { @@ -212,7 +195,8 @@ panels[i].getIcon(), panels[i].getComponent (propertyChannel)); } - statusBar = getStatusBar(); + StatusBar statusBar = getStatusBar(); + propertyChannel.addPropertyChangeListener (statusBar); if (useLoadMonitor) ProgressView.monitor.destroy(); @@ -302,24 +286,6 @@ /************************************************************************** * - **************************************************************************/ - public void addPropertyChangeListener (PropertyChangeListener listener) { - } - - /************************************************************************** - * - **************************************************************************/ - public void removePropertyChangeListener(PropertyChangeListener listener) { - } - - /************************************************************************** - * - **************************************************************************/ - public void propertyChange (PropertyChangeEvent event) { - } - - /************************************************************************** - * * An entry point... * **************************************************************************/ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/24 17:51:51 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/10/27 08:55:48 1.5 @@ -29,7 +29,7 @@ */ public interface DashboardPanel - extends PropertyChangeListener, DashboardProperties { + extends DashboardProperties { /************************************************************************** * Return a graphical representation of this panel.

    @@ -70,20 +70,20 @@ **************************************************************************/ Icon getIcon(); - /************************************************************************** - * Add a PropertyChangeListener to the listener list of a - * panel. All listeners will be notified if this panel changes - * some property.

    - * - * The panel should document what properties can fire - but at the - * moment it is not part of its interface.

    - * - **************************************************************************/ - void addPropertyChangeListener (PropertyChangeListener listener); - - /************************************************************************** - * Remove a PropertyChangeListener. - **************************************************************************/ - void removePropertyChangeListener(PropertyChangeListener listener); +// /************************************************************************** +// * Add a PropertyChangeListener to the listener list of a +// * panel. All listeners will be notified if this panel changes +// * some property.

    +// * +// * The panel should document what properties can fire - but at the +// * moment it is not part of its interface.

    +// * +// **************************************************************************/ +// void addPropertyChangeListener (PropertyChangeListener listener); + +// /************************************************************************** +// * Remove a PropertyChangeListener. +// **************************************************************************/ +// void removePropertyChangeListener(PropertyChangeListener listener); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/23 19:00:24 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/27 08:55:48 1.3 @@ -10,11 +10,8 @@ import org.biomoby.shared.event.NotificationEvent; import org.biomoby.shared.event.Notifier; - import org.tulsoft.shared.UUtils; -import java.beans.PropertyChangeSupport; - /** * This is a simple graphical widget combining together a tree (a * subclass of {@link org.biomoby.service.dashboard.CommonTree}) and a @@ -35,20 +32,28 @@ * * @param model gives access to a Biomoby registry * @param console displayed items selected in the tree - * @param support is used to fire property-change events + * @param channel is used to fire property-change events ********************************************************************/ public DataTypesBoard (RegistryModel model, CommonConsole console, - PropertyChangeSupport support) { - this (model, console, support, + PropertyChannel channel) { + this (model, console, channel, new DataTypesTree (model, console)); } + /********************************************************************* + * Constructor.

    + * + * @param model gives access to a Biomoby registry + * @param console displayed items selected in the tree + * @param channel is used to fire property-change events + * @param customTree allows to plug user-defined tree component + ********************************************************************/ public DataTypesBoard (RegistryModel model, CommonConsole console, - PropertyChangeSupport support, + PropertyChannel channel, CommonTree customTree) { - super (model, support); + super (model, channel); tree = customTree; createItself(); } @@ -68,7 +73,7 @@ calibrateProgressBar (UUtils.toInt (event.getMessage())); break; case Notifier.DATA_TYPE_LOADING: - support.firePropertyChange (DashboardProperties.DP_STATUS_MSG, null, event.getMessage()); + channel.fire (DashboardProperties.DP_STATUS_MSG, event.getMessage()); break; case Notifier.DATA_TYPE_LOADED: addToProgressBar(); @@ -76,7 +81,7 @@ case Notifier.DATA_TYPES_END: case Notifier.DATA_TYPES_CANCELLED: case Notifier.DATA_TYPES_RESET: - support.firePropertyChange (DashboardProperties.DP_STATUS_MSG, null, "Done"); + channel.fire (DashboardProperties.DP_STATUS_MSG, "Done"); removeProgressBar(); break; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/27 04:15:23 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/27 08:55:48 1.5 @@ -10,6 +10,9 @@ import org.tulsoft.shared.UUtils; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.logging.Log; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -30,10 +33,17 @@ * *

    * - * Obviously, there are some properties that do not make sense to be - * stored here: the short-lived properties, such as progress bar - * change events. Such messages can be delivered in an ordinary way - * via property change listeners.

    + * Additionally, it also serves as a PropertyChangeSupport object: it + * can register and deregister PropertyChangeListeners, and it can + * fire an event to them on behave of other objects. The other objects + * either identify themselves (see method {@link + * #fire(Object,String,Object}), or use this channel for firing + * anonymous messages (see method {@link #fire(String,Object)}) - in + * which case the message source will be this class.

    + * + * The fired events are also stored here - under their names. That's + * mean that you can always get the last event of a particular + * name.

    * * The panels/models are sending here properties by calling method * put. If we find, in the future, that sending properties @@ -52,6 +62,9 @@ public class PropertyChannel extends Hashtable { + private static Log log = LogFactory.getLog (PropertyChannel.class); + private PropertyChangeSupport support; + /********************************************************************* * Default constructor. ********************************************************************/ @@ -62,10 +75,13 @@ /********************************************************************* * Maps the specified key to the specified value in this - * hashtable. Neither the key nor the value can be null. Remember - * the given value (do the same as an ordinary Hashtable does), - * and propagate it by firing a property change event (this - * is called a channel push style).

    + * hashtable. Neither the key nor the value can be null.

    + * + * The given value, apart from being stored, is also propagated by + * firing a property change event (this is called a channel + * push style). The event is anonymous. If you need to send + * the source of the message to the listeners, use instead {@link + * #put(Object,Object,Object)}.

    * * @param key the hashtable key * @param value the value @@ -74,7 +90,29 @@ ********************************************************************/ public Object put (Object key, Object value) { Object previous = super.put (key, value); - support.firePropertyChange (key.toString(), null, value); + fire (key.toString(), value); + return previous; + } + + /********************************************************************* + * Maps the specified key to the specified value in this + * hashtable. Neither the key nor the value can be null.

    + * + * The given value, apart from being stored, is also propagated by + * firing a property change event (this is called a channel + * push style). The event contains also its 'source'. For + * anonymously sent events, use instead {@link + * #put(Object,Object)}.

    + * + * @param source that initiated this event + * @param key the hashtable key + * @param value the value + * @return the previous value of the specified key in this + * hashtable, or null if it did not have one + ********************************************************************/ + public Object put (Object source, Object key, Object value) { + Object previous = super.put (key, value); + fire (source, key.toString(), value); return previous; } @@ -99,18 +137,69 @@ } /********************************************************************* - * Property change stuff + * Fire an event to any registered listeners. The source of this + * event will be this class.

    + * + * @param key is a name of the fired event + * @param value is a value associated with this event ********************************************************************/ - protected PropertyChangeSupport support; + public void fire (String key, Object value) { + if (log.isDebugEnabled()) + logDebug (null, key, value); + support.firePropertyChange (key.toString(), null, value); + } + /********************************************************************* + * Fire an event to any registered listeners. The source of this + * event will be this class.

    + * + * @param source that initiated the event + * @param key is a name of the fired event + * @param value is a value associated with this event + ********************************************************************/ + public void fire (Object source, String key, Object value) { + if (log.isDebugEnabled()) + logDebug (source, key, value); + support.firePropertyChange + (new PropertyChangeEvent (source, key.toString(), null, value)); + } + + /********************************************************************* + * Register listeners. + ********************************************************************/ public void addPropertyChangeListener (PropertyChangeListener l) { if (support != null) support.addPropertyChangeListener(l); } + /********************************************************************* + * Unregister listeners. + ********************************************************************/ public void removePropertyChangeListener (PropertyChangeListener l) { if (support != null) support.removePropertyChangeListener(l); } + /********************************************************************* + * Log a debug message. + ********************************************************************/ + protected void logDebug (Object source, String key, Object value) { + + StringBuffer buf = new StringBuffer (100); + if (source != null) { + buf.append ("["); + if (source instanceof DashboardPanel) + buf.append ( ((DashboardPanel)source).getName() ); + else + buf.append (source.getClass().getName()); + buf.append ("] "); + } + buf.append (key); + buf.append (": "); + if (value != null) + buf.append (value.toString()); + + log.debug (buf); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/26 08:05:18 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/27 08:55:48 1.5 @@ -50,8 +50,6 @@ import java.awt.event.MouseListener; import java.awt.event.MouseAdapter; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; import java.util.Map; import java.util.HashMap; import java.util.HashSet; @@ -99,12 +97,6 @@ + " by selecting first a data type, then right-click gives you menu."; /********************************************************************* - * propertyChange() - ********************************************************************/ - public void propertyChange (PropertyChangeEvent e) { - } - - /********************************************************************* * Default constructor. ********************************************************************/ public RegistrationPanel() { @@ -120,7 +112,7 @@ if (propertyChannel.containsKey (DP_REGISTRY_MODEL)) { registryModel = (RegistryModel)propertyChannel.get (DP_REGISTRY_MODEL); } else { - registryModel = new RegistryModel (support); + registryModel = new RegistryModel(); propertyChannel.put (DP_REGISTRY_MODEL, registryModel); } registryModel.setPropertyChannel (propertyChannel); @@ -185,7 +177,7 @@ DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, console, - support, + propertyChannel, new CustomDataTypesTree (registryModel, console)); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); @@ -225,7 +217,7 @@ } /************************************************************************** - * Panel to register a data type. + * Panel to register a service. **************************************************************************/ protected JPanel getServiceRegistration() { @@ -235,7 +227,7 @@ } /************************************************************************** - * Panel to register a data type. + * Panel to register a namespace. **************************************************************************/ protected JPanel getNamespaceRegistration() { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/26 08:05:18 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/27 08:55:48 1.8 @@ -52,14 +52,6 @@ super(); } - /********************************************************************* - * Usual constructor that shares support for property changes with - * its creator. - ********************************************************************/ - public RegistryModel (PropertyChangeSupport support) { - super (support); - } - /************************************************************************** * Return an endpoint (a stringified URL) of a default Moby * registry. =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/27 04:15:23 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/27 08:55:48 1.13 @@ -48,8 +48,6 @@ import java.awt.event.MouseListener; import java.awt.event.MouseAdapter; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; import java.util.Map; import java.util.HashMap; import java.util.HashSet; @@ -82,16 +80,6 @@ CommonConsole console; /********************************************************************* - * propertyChange() - ********************************************************************/ - public void propertyChange (PropertyChangeEvent e) { -// String prop = e.getPropertyName(); -// String newVal = (String)e.getNewValue(); -// if (newVal == null) return; // no interest in non-defined new values -// if (prop == null) return; // no interest in non-specific changes - } - - /********************************************************************* * Default constructor. ********************************************************************/ public RegistryPanel() { @@ -107,7 +95,7 @@ if (propertyChannel.containsKey (DP_REGISTRY_MODEL)) { registryModel = (RegistryModel)propertyChannel.get (DP_REGISTRY_MODEL); } else { - registryModel = new RegistryModel (support); + registryModel = new RegistryModel(); propertyChannel.put (DP_REGISTRY_MODEL, registryModel); } registryModel.setPropertyChannel (propertyChannel); @@ -134,7 +122,7 @@ NamespacesTree namespacesTree = new NamespacesTree(); DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, console, - support); + propertyChannel); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/ConsolePanel.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/EventGeneratorPanel.java,v: No such file or directory From gss at pub.open-bio.org Thu Oct 27 18:20:41 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Oct 27 18:19:07 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272220.j9RMKfE5010220@pub.open-bio.org> gss Thu Oct 27 18:20:41 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv10193/src/org/semanticmoby/graph Added Files: MOBYResourceSet.java MOBYResource.java Removed Files: MOBYService.java MOBYServiceSet.java Log Message: Changed Service to Resource s-moby/ref-impl/core/src/org/semanticmoby/graph MOBYResourceSet.java,NONE,1.1 MOBYResource.java,1.2,1.3 MOBYService.java,1.2,NONE MOBYServiceSet.java,1.2,NONE =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/MOBYResource.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/MOBYResource.java 2005/09/14 22:06:10 1.2 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/MOBYResource.java 2005/10/27 22:20:41 1.3 @@ -1,30 +1,263 @@ package org.semanticmoby.graph; -import org.semanticmoby.graph.*; - import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; + +import org.semanticmoby.tools.Util; + +import org.semanticmoby.vocabulary.MOBY; + +import java.io.*; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + + +/** + * This class represents a resource that provides a + * resource in MOBY. + */ +public class MOBYResource extends MOBYGraphNode { + + /** + * The name of the provider; stored in MOBY.name property + */ + private Statement nameStmt; + + /** + * A one line description of the provider; stored in the + * MOBY.oneLineDescription property + */ + private Statement oneLineDescriptionStmt; + + /** + * A URI at which more information can be retrieved about the + * provider; stored in the MOBY.moreInfoURI property + */ + private Statement aboutURIStmt; + + /** + * The MOBYGraphNode objects that this Resource operates on (instances of + * either MOBYCollection or MOBYGraph), each keyed by the statement that + * links this resource's URI to it via a hasMapping property + */ + private Map operatesOnGraphStmts = new HashMap(); + + /** + * Constructor for creating a MOBYResource API object from scratch, given + * a model, URI, name, one line description, and about URI for the resource. + * Since the RDF statements that the resource represents don't yet exist, it + * creates and adds them to the model. + * @param model the underlying Jena model to add the statements to + * @param uri the URI of the resource + * @param name a name for the resource; stored in the moby:name property + * @param oneLineDescription a one line description for the resource; + * stored in the moby:oneLineDescription property + */ + public MOBYResource(Model jenaModel, String uri, String name, + String oneLineDescription, String aboutURI) { + super(jenaModel, + jenaModel.createStatement(jenaModel.createResource(uri), + RDF.type, MOBY.Resource)); + + // Save the literal properties by creating the corresponding + // statements and adding them to the model + // + jenaModel.add(nameStmt = + jenaModel.createStatement(getResource(), MOBY.name, name)); + + jenaModel.add(oneLineDescriptionStmt = + jenaModel.createStatement(getResource(), + MOBY.oneLineDescription, + oneLineDescription)); + + jenaModel.add(aboutURIStmt = + jenaModel.createStatement(getResource(), MOBY.aboutURI, + aboutURI)); + } + + + /** + * Constructor for creating a MOBYResource API object from scratch, given + * a URI, name, and one line description for the resource. The method + * first creates a default model using Util.newJenaModel(), and since + * the RDF statements that the resource represents don't yet exist, it + * then creates and adds them to the model. + * @param uri the URI of the resource + * @param name a name for the resource; stored in the moby:name property + * @param oneLineDescription a one line description for the resource; + * stored in the moby:oneLineDescription property + */ + public MOBYResource(String uri, String name, String oneLineDescription, + String aboutURI) { + this(Util.newJenaModel(), uri, name, oneLineDescription, aboutURI); + } + + + /** + * Constructor for creating an instance from existing RDF statements, as + * is the case when parsing an existing model. + */ + public MOBYResource(Model jenaModel, Statement definingStmt, + Statement nameStmt, Statement oneLineDescriptionStmt, + Statement aboutURIStmt, Map operatesOnGraphs) { + super(jenaModel, definingStmt); + this.nameStmt = nameStmt; + this.oneLineDescriptionStmt = oneLineDescriptionStmt; + this.aboutURIStmt = aboutURIStmt; + + for (Iterator it = operatesOnGraphs.keySet().iterator(); it.hasNext();) { + + Statement operatesOnStmt = (Statement) it.next(); + MOBYGraphNode node = + (MOBYGraphNode) operatesOnGraphs.get(operatesOnStmt); + addOperatesOnGraph(operatesOnStmt, node); + } + } + + /** + * Adds a new operatesOn subgraph and an operatesOn statement + */ + public void addOperatesOnGraph(MOBYGraphNode newGraph) { + + // Create and add a statement moby:operatesOn + Statement operatesOnStmt = + jenaModel.createStatement(getResource(), MOBY.operatesOn, + newGraph.getResource()); + addOperatesOnGraph(operatesOnStmt, newGraph); + } + + + /** + * Adds a new operatesOn Graph, linking it to the defining statement's + * resource with an operatesOn property + */ + public void addOperatesOnGraph(Statement operatesOnStmt, + MOBYGraphNode newGraph) { + + jenaModel.add(operatesOnStmt); + operatesOnGraphStmts.put(newGraph, operatesOnStmt); + } + + + /** + * Removes the graph node and its RDF statements from the underlying + * Jena model + */ + public void removeOperatesOnGraph(MOBYGraphNode node) { + + Statement stmt = (Statement) operatesOnGraphStmts.get(node); + + if (stmt != null) { + + jenaModel.remove(stmt); + } + + node.removeStatements(); + } + + + public Iterator getOperatesOn() { + + return operatesOnGraphStmts.keySet().iterator(); + } + + + /** + * Removes the statements representing this resource, and calls + * removeStatements on all Graph objects related to it through + * operatesOn properties + */ + public void removeStatements() { + + // Remove the defining statement + removeDefiningStatement(); + + // Remove the statements asserting the name and + // oneLineDescription properties + if (nameStmt != null) { + + jenaModel.remove(nameStmt); + nameStmt = null; + } + + if (oneLineDescriptionStmt != null) { + + jenaModel.remove(oneLineDescriptionStmt); + oneLineDescriptionStmt = null; + } + + if (aboutURIStmt != null) { + + jenaModel.remove(aboutURIStmt); + aboutURIStmt = null; + } + + // Remove each of the operatesOn statements, and have each + // MOBYGraphNode object remove its statements + if (operatesOnGraphStmts != null) { + + for (Iterator it = operatesOnGraphStmts.keySet().iterator(); + it.hasNext();) { + + MOBYGraphNode gnode = (MOBYGraphNode) it.next(); + Statement s = (Statement) operatesOnGraphStmts.get(gnode); + operatesOnGraphStmts.remove(s); + jenaModel.remove(s); + gnode.removeStatements(); + } + + operatesOnGraphStmts = null; + } + } + + + /** + * Return a descriptive name for the provider. + */ + public String getName() { + + return (nameStmt == null) ? "" : nameStmt.getObject().toString(); + } + + + /** + * Return a short (one line) description for the provider. + */ + public String getOneLineDescription() { + + return (oneLineDescriptionStmt == null) ? "" + : oneLineDescriptionStmt.getObject() + .toString(); + } + + + /** + * Return a URI that can be accessed to obtain more information + * about the provider. + */ + public String getAboutURI() { + + return (aboutURIStmt == null) ? "" : aboutURIStmt.getObject().toString(); + } + + + /** + * Serialize the underlying model as RDF/XML to the given output stream + */ + public void serialize(OutputStream out) { + + jenaModel.write(out); + } + + + /** + * Serialize the underlying model as N3 to the given output stream + */ + public void serializeAsN3(OutputStream out) { -public class MOBYResource extends MOBYPropertyValue -{ - private Resource resourceValue; - - public MOBYResource(Resource resourceValue) { - this.resourceValue = resourceValue; - } - - public String getResourceURI() { - return resourceValue.getURI(); - } - - public boolean isLiteral() { - return false; - } - - public boolean isResource() { - return true; - } - - public boolean isBlank() { - return resourceValue.isAnon(); + jenaModel.write(out, "N3"); } -} \ No newline at end of file +} rcsdiff: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYService.java,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYServiceSet.java,v: No such file or directory From gss at pub.open-bio.org Thu Oct 27 18:22:09 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Oct 27 18:20:35 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272222.j9RMM9Ne010284@pub.open-bio.org> gss Thu Oct 27 18:22:09 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv10259/src/org/semanticmoby/parser Modified Files: Parser.java Log Message: Refer to Resource rather than Service s-moby/ref-impl/core/src/org/semanticmoby/parser Parser.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/10/09 01:33:06 1.6 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/10/27 22:22:08 1.7 @@ -48,7 +48,7 @@ */ public Parser(Model model) { - StmtIterator it = model.listStatements(null, RDF.type, MOBY.Service); + StmtIterator it = model.listStatements(null, RDF.type, MOBY.Resource); while (it.hasNext()) { @@ -157,31 +157,31 @@ /** - * Parse a MOBYService from the model. If the model contains multiple - * services, only one will be returned (at random), so if the model is - * expected to contain multiple services, then call parseServices() instead to get all the providers in a + * Parse a MOBYResource from the model. If the model contains multiple + * resources, only one will be returned (at random), so if the model is + * expected to contain multiple resources, then call parseResources() instead to get all the providers in a * MOBYCollection. */ - public MOBYService parseService() throws NonCanonicalException { + public MOBYResource parseResource() throws NonCanonicalException { - List services = parseServices(); + List resources = parseResources(); - if (services.size() == 0) { + if (resources.size() == 0) { return null; } else { - return (MOBYService) services.iterator().next(); + return (MOBYResource) resources.iterator().next(); } } /** - * Parse and return an list of MOBYService objects + * Parse and return an list of MOBYResource objects */ - public List parseServices() throws NonCanonicalException { + public List parseResources() throws NonCanonicalException { - ArrayList services = new ArrayList(); + ArrayList resources = new ArrayList(); Iterator it = subModels.iterator(); @@ -189,24 +189,24 @@ Model model = (Model) it.next(); StmtIterator it2 = - model.listStatements(null, RDF.type, MOBY.Service); + model.listStatements(null, RDF.type, MOBY.Resource); if (it2 != null) { Statement stmt = it2.nextStatement(); - services.add(parseService(stmt)); + resources.add(parseResource(stmt)); } } - return services; + return resources; } /** - * Parse a service starting from the given resource (i.e. a resource that - * is the subject of an rdf:type statement with object of moby:Service) + * Parse a resource starting from the given resource (i.e. a resource that + * is the subject of an rdf:type statement with object of moby:Resource) */ - public MOBYService parseService(Statement typeStmt) + public MOBYResource parseResource(Statement typeStmt) throws NonCanonicalException { Resource headResource = typeStmt.getSubject(); @@ -222,7 +222,7 @@ Statement aboutURIStmt = model.getProperty(headResource, MOBY.aboutURI); - // A service can have multiple operatesOn properties, each of + // A resource can have multiple operatesOn properties, each of // which leads to a subgraph. Parse each of these subgraphs. // Map operatesOn = new HashMap(); @@ -237,10 +237,10 @@ operatesOn.put(operatesOnStmt, parseOperatesOn(r)); } - // Create and return a new Service object using the service URI, name, + // Create and return a new Resource object using the resource URI, name, // oneLineDescription, aboutURI, and collection of operatesOn subgraphs // - return new MOBYService(model, typeStmt, nameStmt, + return new MOBYResource(model, typeStmt, nameStmt, oneLineDescriptionStmt, aboutURIStmt, operatesOn); } From gss at pub.open-bio.org Thu Oct 27 18:22:09 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Oct 27 18:20:36 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272222.j9RMM9M9010307@pub.open-bio.org> gss Thu Oct 27 18:22:09 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv10259/src/org/semanticmoby/servlet Modified Files: AbstractMobyServlet.java package.html Log Message: Refer to Resource rather than Service s-moby/ref-impl/core/src/org/semanticmoby/servlet AbstractMobyServlet.java,1.3,1.4 package.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2005/10/09 01:33:06 1.3 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2005/10/27 22:22:09 1.4 @@ -67,7 +67,7 @@ * in, that serves as "input" to the provider. * @return a graph containing the work product of the provider. */ - protected abstract void handleRequest(MOBYService requestGraph); + protected abstract void handleRequest(MOBYResource requestGraph); /** @@ -110,7 +110,7 @@ /** - * By MOBY convention, an HTTP POST equates to a request for the service + * By MOBY convention, an HTTP POST equates to a request for the resource * provided by a provider. */ public void doPost(HttpServletRequest request, HttpServletResponse response) @@ -127,16 +127,16 @@ ParamReader.getParameter(MOBY.GRAPH_PARAMETER_NAME, request); Parser parser = Parser.forString(graphString, Parser.LANGUAGE_RDF_XML); - MOBYService service = parser.parseService(); + MOBYResource resource = parser.parseResource(); // Invoke the abstract handleRequest() method in order for the // provider servlet to do whatever it does to the graph. // - handleRequest(service); + handleRequest(resource); // Send the graph back in response // - service.serialize(out); + resource.serialize(out); } catch (Throwable t) { t.printStackTrace(); =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/package.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/package.html 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/package.html 2005/10/27 22:22:09 1.2 @@ -1,5 +1,5 @@ -Classes to facilitate building Semantic MOBY services using Java servlets. +Classes to facilitate building Semantic MOBY resources using Java servlets. - \ No newline at end of file + From gss at pub.open-bio.org Thu Oct 27 18:22:09 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Oct 27 18:20:39 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272222.j9RMM9kW010327@pub.open-bio.org> gss Thu Oct 27 18:22:09 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv10259/src/org/semanticmoby/vocabulary Modified Files: MOBY.java Log Message: Refer to Resource rather than Service s-moby/ref-impl/core/src/org/semanticmoby/vocabulary MOBY.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2005/10/09 01:33:07 1.3 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2005/10/27 22:22:09 1.4 @@ -3,7 +3,10 @@ import com.hp.hpl.jena.graph.*; import com.hp.hpl.jena.rdf.model.*; - +/** + * A utility class with static instance variables for helping with ontology + * related tasks. + */ public class MOBY extends VocabularyDescription { public final static String IF_MODIFIED_HEADER = "If-Modified-Since"; @@ -16,11 +19,11 @@ * value is a serialized RDF/XML graph. */ public final static String GRAPH_PARAMETER_NAME = "graph"; - public static final Resource Service = resource(getURI(), "Service"); - public static final Resource Graph = resource(getURI(), "Graph"); - public static final Resource Subject = resource(getURI(), "Subject"); - public static final Resource Object = resource(getURI(), "Object"); - public static final Property name = property(getURI(), "name"); + public static final Resource Resource = resource(getURI(), "Resource"); + public static final Resource Graph = resource(getURI(), "Graph"); + public static final Resource Subject = resource(getURI(), "Subject"); + public static final Resource Object = resource(getURI(), "Object"); + public static final Property name = property(getURI(), "name"); public static final Property oneLineDescription = property(getURI(), "oneLineDescription"); public static final Property aboutURI = From senger at pub.open-bio.org Fri Oct 28 03:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Oct 28 03:57:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8l6012478@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/client Modified Files: CentralDigestImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestImpl.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/27 04:15:23 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/28 07:58:08 1.9 @@ -385,9 +385,16 @@ public void fireEvent (int type, Object message, Object details) { NotificationEvent event = null; if (details == null) - event = new NotificationEvent (this, type, message.toString()); + event = new NotificationEvent (this, type, message); else - event = new NotificationEvent (this, type, message.toString(), details); + event = new NotificationEvent (this, type, message, details); + fireEvent (event); + } + + /********************************************************************* + * + ********************************************************************/ + public void fireEvent (NotificationEvent event) { if (listeners != null) { synchronized (listeners) { for (int i = 0; i < listeners.size(); i++) { From senger at pub.open-bio.org Fri Oct 28 03:58:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Oct 28 03:58:23 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w9fJ012585@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/shared/event Modified Files: NotificationEvent.java Notifier.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,1.3,1.4 Notifier.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/27 04:15:23 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/28 07:58:08 1.4 @@ -17,13 +17,18 @@ * registry (how many entities to read, and which one was just * read).

    * - * Each notification event points to its source (this is inherited - * from a usual Java's EventObject). Additionally, it has its type (an - * integer value, preferably taken from a list defined in interface - * {@link org.biomoby.shared.event.Notifier}), a message (whose format - * may be determined by the notification type), and optionally an - * object with more details (again, its presence or absence may depend - * on the notification type).

    + * Each notification event points to its source - this is inherited + * from a usual Java EventObject. Sometimes, however, the semantics of + * the source may change to indicate not the event producer but the + * event initiator (an instance that caused that something had + * happened that triggered later sending an event).

    + * + * Additionally, it has its type (an integer value, preferably taken + * from a list defined in interface {@link + * org.biomoby.shared.event.Notifier}), a message (whose format may be + * determined by the notification type), and optionally an object with + * more details (again, its presence or absence may depend on the + * notification type).

    * * @author Martin Senger * @version $Id$ @@ -33,7 +38,7 @@ extends EventObject { private int type; - private String message; + private Object message; private Object details; /********************************************************************* @@ -47,7 +52,7 @@ * A usual constructor, setting notification type and a message. ********************************************************************/ public NotificationEvent (Object source, - int type, String message) { + int type, Object message) { this (source); this.type = type; this.message = (message == null ? "" : message); @@ -58,8 +63,7 @@ * details. ********************************************************************/ public NotificationEvent (Object source, - int type, String message, - Object details) { + int type, Object message, Object details) { this (source, type, message); this.details = details; } @@ -74,7 +78,7 @@ /********************************************************************* * Return a message associated with this notification event. ********************************************************************/ - public String getMessage() { + public Object getMessage() { return message; } @@ -99,8 +103,9 @@ StringBuffer buf = new StringBuffer (100); buf.append ("["); buf.append (typeStr); - if (UUtils.notEmpty (message)) - buf.append (", Message=" + message); + if (message != null && + ( message instanceof String || message instanceof Integer || message instanceof Boolean )) + buf.append (" " + message); if (details != null) buf.append (", Details=" + details.getClass().getName()); buf.append ("]"); @@ -108,34 +113,35 @@ } static final String[] typeTexts = new String[] { - "data-type-start", - "data-type-count", - "data-type-loading", - "data-type-loaded", - "data-type-end", - "service-type-start", - "service-type-count", - "service-type-loading", - "service-type-loaded", - "service-type-end", - "namespace-start", - "namespace-count", - "namespace-loading", - "namespace-loaded", - "namespace-end", - "authority-start", - "authority-count", - "authority-loading", - "authority-loaded", - "authority-end", - "data-type-reset", - "service-type-reset", - "namespace-reset", - "authority-reset", - "data-type-cancel", - "service-type-cancel", - "namespace-cancel", - "authority-cancel" + "data-type-start", // [ 0] + "data-type-count", // [ 1] + "data-type-loading", // [ 2] + "data-type-loaded", // [ 3] + "data-type-end", // [ 4] + "service-type-start", // [ 5] + "service-type-count", // [ 6] + "service-type-loading", // [ 7] + "service-type-loaded", // [ 8] + "service-type-end", // [ 9] + "namespace-start", // [10] + "namespace-count", // [11] + "namespace-loading", // [12] + "namespace-loaded", // [13] + "namespace-end", // [14] + "authority-start", // [15] + "authority-count", // [16] + "authority-loading", // [17] + "authority-loaded", // [18] + "authority-end", // [19] + "data-type-reset", // [20] + "service-type-reset", // [21] + "namespace-reset", // [22] + "authority-reset", // [23] + "data-type-cancel", // [24] + "service-type-cancel", // [25] + "namespace-cancel", // [26] + "authority-cancel", // [27] + "data-type-updated" // [28] }; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/22 01:38:04 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/28 07:58:08 1.4 @@ -50,6 +50,7 @@ static final int NAMESPACES_CANCELLED = 26; static final int AUTHORITIES_CANCELLED = 27; + static final int DATA_TYPES_UPDATED = 28; static final int SIGNAL_CANCEL_DATA_TYPES = 1; @@ -117,4 +118,9 @@ ********************************************************************/ void fireEvent (int type, Object message, Object details); + /********************************************************************* + * + ********************************************************************/ + void fireEvent (NotificationEvent event); + } From senger at pub.open-bio.org Fri Oct 28 03:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Oct 28 03:58:25 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8GI012555@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/shared Modified Files: MobyDataType.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyDataType.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/10/25 09:02:08 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/10/28 07:58:08 1.11 @@ -8,7 +8,7 @@ package org.biomoby.shared; import org.tulsoft.shared.UUtils; - +import java.util.Comparator; /** * A container representing a data type used in the Moby registry (in @@ -307,4 +307,17 @@ comment = (value == null ? "" : value); } + /************************************************************************** + * Create a comparator for case-insensitive sorting of data types + * by their authorities. + *************************************************************************/ + public static Comparator getAuthorityComparator() { + return new Comparator() { + public int compare (Object o1, Object o2) { + String a1 = ((MobyDataType)o1).getAuthority(); + String a2 = ((MobyDataType)o2).getAuthority(); + return (a1).compareToIgnoreCase ((String)a2); + } + }; + } } From senger at pub.open-bio.org Fri Oct 28 03:58:54 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Oct 28 03:58:26 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7wsWd012629@pub.open-bio.org> senger Fri Oct 28 03:58:53 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv12614/src/config Added Files: log4j.properties Log Message: moby-live/Java/src/config log4j.properties,NONE,1.1 From senger at pub.open-bio.org Fri Oct 28 03:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Oct 28 03:58:30 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8Po012536@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/service/dashboard Modified Files: AbstractModel.java CommonBoard.java CommonTree.java Dashboard.java DashboardPanel.java DashboardProperties.java DataTypesBoard.java DataTypesTree.java NOTES RegistryModel.java Added Files: GraphColours.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard GraphColours.java,NONE,1.1 AbstractModel.java,1.2,1.3 CommonBoard.java,1.2,1.3 CommonTree.java,1.7,1.8 Dashboard.java,1.8,1.9 DashboardPanel.java,1.5,1.6 DashboardProperties.java,1.7,1.8 DataTypesBoard.java,1.3,1.4 DataTypesTree.java,1.4,1.5 NOTES,1.11,1.12 RegistryModel.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/10/27 08:55:48 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/10/28 07:58:08 1.3 @@ -8,36 +8,12 @@ package org.biomoby.service.dashboard; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeSupport; - /** * A common super-class for all Dashboard models. A model is a worker * for a panel: a panel displays what its model provides.

    * * This abstract parent helps to deal with listening and fireing - * property changes. Here is how it works generally:

    - * - *

      - * - *
    • Each model gets (from its panel) an instance of a - * PropertyChangeSupport class which gives it a list of - * registered listeners, so a model can fire messages to them. For - * example, a RegistryPanel may fire a message that a new list of data - * types is available. Or typically a model will send a hear-beat - * messages if it is working on a long-run job (this messages will be - * intercept by a StatusBar, for example).

      - * - * Note, however, that this shared PropertyChangeSupport - * object knows only about a panel (it was created for a panel, not - * for a model) so a model cannot use it to add its own listeners - * (they would become listeners of a panel, not a model). In the - * practise, this should not be a problem I guess.

      - * - *

    • Each model is also a listener of property changes.

      - * - *

    + * property changes via a property channel.

    * * @author Martin Senger * @version $Id$ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/27 08:55:48 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/28 07:58:08 1.3 @@ -42,6 +42,9 @@ extends JPanel implements NotificationListener { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + protected RegistryModel model; protected PropertyChannel channel; @@ -69,7 +72,7 @@ * Update the underlying tree. ********************************************************************/ public void updateTree (int howSorted) { - tree.update (howSorted); + tree.update (howSorted, null); } /********************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/26 08:05:18 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/28 07:58:08 1.8 @@ -166,7 +166,7 @@ * Get data from a registry model and update the tree. Will be * overwritten by subclass. ********************************************************************/ - public void update (int howSorted) { + public void update (int howSorted, Object data) { } /********************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/27 08:55:48 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/28 07:58:08 1.9 @@ -26,6 +26,7 @@ import java.awt.GridBagLayout; import java.awt.Font; +import java.awt.Color; import java.awt.Dimension; import java.beans.PropertyChangeListener; @@ -50,10 +51,14 @@ public class Dashboard implements DashboardPanel, ChangeListener { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + private JComponent dashboard; private DashboardHeader header; public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; + protected Color bgcolor; protected DashboardPanel[] panels; protected PropertyChannel propertyChannel; protected static Properties dashboardProperties; @@ -75,8 +80,8 @@ dashboardProperties.load (resourceURL.openStream()); } } catch (Exception e) { - System.err.println ("WARNING: Cannot find/open/read dasboard property file " + - DASHBOARD_PROPERTIES_FILE + ": " + e.toString()); + log.warn ("Cannot find/open/read dasboard property file " + + DASHBOARD_PROPERTIES_FILE + ": " + e.toString()); } } @@ -181,8 +186,12 @@ ProgressView.monitor.show ("Welcome to Biomoby Dashboard"); } + // create itself JPanel p = new JPanel (new GridBagLayout(), true); + bgcolor = GraphColours.getColour ((String)dashboardProperties.get (DP_BGCOLOR), + p.getBackground()); + p.setBackground (bgcolor); header = getHeader(); tabbedPane = new JTabbedPane(); @@ -222,6 +231,7 @@ class DashboardHeader extends JPanel { public DashboardHeader (Properties props) { super (new GridBagLayout()); + setBackground (bgcolor); JLabel mainTitle = getTitle(); JLabel mainIcon = new JLabel ("", =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/10/27 08:55:48 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/10/28 07:58:08 1.6 @@ -12,18 +12,11 @@ import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; -import java.beans.PropertyChangeListener; /** * An interface that must be implemented by each panel that wants to * sit on a dashboard.

    * - * WORK IN PROGRESS

    - * - * All classes that implements this interface (i.e. all dashboard - * panels) are also PropertyChangeListener. It allows them to listen - * to changes happening in other panels.

    - * * @author Martin Senger * @version $Id$ */ @@ -70,20 +63,4 @@ **************************************************************************/ Icon getIcon(); -// /************************************************************************** -// * Add a PropertyChangeListener to the listener list of a -// * panel. All listeners will be notified if this panel changes -// * some property.

    -// * -// * The panel should document what properties can fire - but at the -// * moment it is not part of its interface.

    -// * -// **************************************************************************/ -// void addPropertyChangeListener (PropertyChangeListener listener); - -// /************************************************************************** -// * Remove a PropertyChangeListener. -// **************************************************************************/ -// void removePropertyChangeListener(PropertyChangeListener listener); - } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/26 08:05:18 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/28 07:58:08 1.8 @@ -13,9 +13,6 @@ import javax.swing.Icon; import javax.swing.JComponent; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; - /** * A list of names of most/all recognized properties that can be fired * by dashboard panels, and a list of names of Java properties that @@ -71,6 +68,13 @@ * recommended) or a relative path whose beginning can be found * somewhere on the CLASSPATH. */ + static final String DP_ICON = "dashboard.icon"; + /** A property name. Its value contains a color name used to paint + * main dashboard background. The name can be a color name, or a + * number in various format (see GraphColours for + * details). + */ + static final String DP_BGCOLOR = "dashboard.bgcolor"; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/27 08:55:48 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/28 07:58:08 1.4 @@ -8,6 +8,7 @@ package org.biomoby.service.dashboard; +import org.biomoby.shared.MobyDataType; import org.biomoby.shared.event.NotificationEvent; import org.biomoby.shared.event.Notifier; import org.tulsoft.shared.UUtils; @@ -27,6 +28,9 @@ public class DataTypesBoard extends CommonBoard { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + /********************************************************************* * Constructor.

    * @@ -64,13 +68,15 @@ * ********************************************************************/ public void notified (NotificationEvent event) { + Object initiator; switch (event.getType()) { case Notifier.DATA_TYPES_START: createProgressBar (Notifier.SIGNAL_CANCEL_DATA_TYPES); insertProgressBar(); break; case Notifier.DATA_TYPES_COUNT: - calibrateProgressBar (UUtils.toInt (event.getMessage())); + if (event.getMessage() instanceof Integer) + calibrateProgressBar ( ((Integer)event.getMessage()).intValue() ); break; case Notifier.DATA_TYPE_LOADING: channel.fire (DashboardProperties.DP_STATUS_MSG, event.getMessage()); @@ -81,9 +87,21 @@ case Notifier.DATA_TYPES_END: case Notifier.DATA_TYPES_CANCELLED: case Notifier.DATA_TYPES_RESET: - channel.fire (DashboardProperties.DP_STATUS_MSG, "Done"); + initiator = event.getSource(); + if (tree == initiator) + channel.fire (DashboardProperties.DP_STATUS_MSG, "Done"); removeProgressBar(); break; + case Notifier.DATA_TYPES_UPDATED: + initiator = event.getSource(); + if (tree != initiator) { + // someone else (ot this instance) initiated request + // for updating data types - so we need to update our + // own tree - using for that data types included in + // this event + tree.update (-1, (MobyDataType[])event.getDetails()); + } + break; } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/25 09:02:07 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/28 07:58:08 1.5 @@ -42,6 +42,9 @@ public class DataTypesTree extends CommonTree { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + // action commands for popup menu items protected final static String AC_NSORT = "ac-nsort"; protected final static String AC_ASORT = "ac-asort"; @@ -87,14 +90,14 @@ popup.add (createMenuItem (new AbstractAction ("Sort by names") { public void actionPerformed (ActionEvent e) { - update (lastSorted = SORTED_BY_NAME); + update (lastSorted = SORTED_BY_NAME, null); deprecatedBox.setEnabled (true); } }, AC_NSORT)); popup.add (createMenuItem (new AbstractAction ("Sort by authorities") { public void actionPerformed (ActionEvent e) { - update (lastSorted = SORTED_BY_AUTHORITY); + update (lastSorted = SORTED_BY_AUTHORITY, null); deprecatedBox.setEnabled (false); } }, AC_ASORT)); @@ -105,7 +108,7 @@ showBox.addItemListener (new ItemListener() { public void itemStateChanged (ItemEvent e) { showMembers = (e.getStateChange() == ItemEvent.SELECTED); - update (lastSorted); + update (lastSorted, null); } }); popup.add (showBox); @@ -116,7 +119,7 @@ public void itemStateChanged (ItemEvent e) { showBadGuys = (e.getStateChange() == ItemEvent.SELECTED); if (showBadGuys) - update (lastSorted); + update (lastSorted, null); else removeBadGuys(); } @@ -125,20 +128,35 @@ } /********************************************************************* - * Get data from a registry model and update the tree. + * Get data (usually from a registry model, but if not null, take + * them from 'newData') and update the tree. ********************************************************************/ - public void update (int howSorted) { - setEnabledPopup (false); + public void update (int howSorted, Object newData) { + if (howSorted < 0) howSorted = lastSorted; + setEnabledPopup (false); updateException = null; + final Object source = this; final int sorted = howSorted; + final MobyDataType[] newDataTypes = + (newData == null ? null : (MobyDataType[])newData); + final SwingWorker worker = new SwingWorker() { public Object construct() { try { + // get data types (unless you already have them) + if (newDataTypes == null) + dataTypes = registryModel.getDataTypes (source); + else + dataTypes = newDataTypes; + + // ...and sort them accordingly if (sorted == SORTED_BY_AUTHORITY) - dataTypes = registryModel.getDataTypesByAuthority(); + java.util.Arrays.sort + (dataTypes, MobyDataType.getAuthorityComparator()); else - dataTypes = registryModel.getDataTypesByNames(); + java.util.Arrays.sort (dataTypes); + } catch (MobyException e) { updateException = e; } @@ -277,7 +295,7 @@ * updating) cache. ********************************************************************/ protected void reload() { - update (lastSorted); + update (lastSorted, null); } /********************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/26 08:05:18 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/28 07:58:08 1.12 @@ -1,40 +1,14 @@ -? logging (LogPanel and/or usual logging to a file?) -* communication with StatusBar (incl. progress bar, cancel button) -* disabling things during a long-time operation -* general Console panel (save button; various renderes?) -* graphics to trees - ---- -To put this somewhere (a small "Memory panel" that can be add -anywhere in time of debugging...): - -The heap is the area in memory in which objects are created. - - // Get current size of heap in bytes - long heapSize = Runtime.getRuntime().totalMemory(); - - // Get maximum size of heap in bytes. The heap cannot grow beyond this size. - // Any attempt will result in an OutOfMemoryException. - long heapMaxSize = Runtime.getRuntime().maxMemory(); - - // Get amount of free memory within the heap in bytes. This size will increase - // after garbage collection and decrease as new objects are created. - long heapFreeSize = Runtime.getRuntime().freeMemory(); - ---- - TODO generally: --------------- +? some of the notification stuff can inherir from propertychange stuff + * notice that the dasboard is used the first time and offer to create a list of wanted panels (some of them are suggested as default) * notice that user does not use cache (and that he did not select "do not check it at startup") and tell him "do you want a cache?" -* BUG: not sure why so many (repeated) changes from the actionlistener -in JFieldTextWithHistory - ? select a part of an error message and highlight it in red? ? HELP (in a Dashboard Menu) @@ -43,27 +17,13 @@ - credits - add dynamically a URL from dashboard.properties... -TODO with views: ----------------- * change onMethods() to be protected or even private... -* add a progress bar to the status bar (on the right) - - add also a cancel buton there - - do not allow more than one progressbar-aware action in the same time - file:///c/Development/java-tutorial/uiswing/components/progress.html - -? small icons to buttons -? use FileSystemView in file choosers -? alltools2: - - combo box history is not updated if exit happened while focus is still in the text field - -? configure dashboard from menu: - * configure dashbard (add/remove dynamically panels) - * configure user preferences +? improve API javadoc of all these Central*Impl +? start to work on/think of the RDF-based cache TODO for cache: --------------- -* emit log events; use them also in cmdline clients * poor-man update: keep what's there but add what is not there (and perhaps delete what should not be there) - but do not check any age of existing @@ -73,15 +33,13 @@ * remove memory-caching from CentralImpl * graphics by default: yes for datatyeps and no for services -? improve API javadoc of all these Central*Impl -? start to work on/think of the RDF-based cache - General options (available from the menu) --------------- * export/import user preferences * set-up what panels are wanted * language ( => use proper ResourceBundler...) + Registry panel -------------- @@ -114,10 +72,22 @@ - verify registry - browsing in graphs - RDF resources -- Log panel -- Configure a new Dashboard - - Debugging panel (with a Memory Panel embedded; replacing current two pannels) + To put this somewhere (a small "Memory panel" that can be add + anywhere in time of debugging...): + + The heap is the area in memory in which objects are created. + + // Get current size of heap in bytes + long heapSize = Runtime.getRuntime().totalMemory(); + + // Get maximum size of heap in bytes. The heap cannot grow beyond this size. + // Any attempt will result in an OutOfMemoryException. + long heapMaxSize = Runtime.getRuntime().maxMemory(); + + // Get amount of free memory within the heap in bytes. This size will increase + // after garbage collection and decrease as new objects are created. + long heapFreeSize = Runtime.getRuntime().freeMemory(); UNSOLVED (mysteries and not-yet-dones) ======== @@ -130,12 +100,6 @@ - the BuildDataTypeTree is sometimes damaged (after adding a member node); not sure how to reproduce it - ! loading... does not sync correctly with the browser panel - - ! more generally: simplify (or at least document) what kind of notifications - are used (now, it seems to be confusin what has PropertyChannel and what - is registered by 'support') - ! finish all the caching stuff (separate scrap of paper) * After registration, update cache, update list @@ -144,6 +108,14 @@ * Icons: - better icon for AddHAS (with a small star) + ? small icons to buttons + ? graphics to trees + - small icon to the status bar * alltools2: - JTextFieldWithHistory should remember also an empty value ("") + - combo box history is not updated if exit happened while focus is still in the text field + ? use FileSystemView in file choosers + * BUG: not sure why so many (repeated) changes from the actionlistener + in JFieldTextWithHistory + =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/27 08:55:48 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/28 07:58:08 1.9 @@ -19,13 +19,8 @@ import org.biomoby.shared.event.NotificationEvent; import org.biomoby.shared.event.NotificationListener; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeSupport; - import java.util.HashSet; import java.util.Hashtable; -import java.util.Comparator; import java.util.regex.Pattern; /** @@ -41,6 +36,9 @@ extends AbstractModel implements Notifier { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + CentralAll worker; boolean useCache = true; Hashtable dataTypesTable; @@ -102,35 +100,18 @@ } /********************************************************************* - * + * Fetch data types (from a cache or from a registry). When done, + * signal that data type are updated. If an initiator is known + * (not null), signal, who asked for data, as well. ********************************************************************/ - public MobyDataType[] getDataTypesByNames() + public synchronized MobyDataType[] getDataTypes (Object initiator) throws MobyException { initWorker(); - fireEvent (DATA_TYPES_RESET, "", null); + if (initiator != null) + fireEvent (initiator, DATA_TYPES_RESET, "", null); MobyDataType[] dataTypes = worker.getDataTypes(); - java.util.Arrays.sort (dataTypes); - return dataTypes; - } - - /********************************************************************* - * - ********************************************************************/ - public MobyDataType[] getDataTypesByAuthority() - throws MobyException { - initWorker(); - fireEvent (DATA_TYPES_RESET, "", null); - MobyDataType[] dataTypes = worker.getDataTypes(); - java.util.Arrays.sort - (dataTypes, - new Comparator() { - public int compare (Object o1, Object o2) { - String a1 = ((MobyDataType)o1).getAuthority(); - String a2 = ((MobyDataType)o2).getAuthority(); - return (a1).compareToIgnoreCase ((String)a2); - } - }); - + if (initiator != null) + fireEvent (initiator, DATA_TYPES_UPDATED, "", dataTypes); return dataTypes; } @@ -142,7 +123,7 @@ if (dataTypeName == null) return null; - MobyDataType[] dataTypes = getDataTypesByNames(); + MobyDataType[] dataTypes = getDataTypes (null); if (dataTypesTable == null) { dataTypesTable = new Hashtable(); @@ -161,7 +142,7 @@ public HashSet find (String searchText) throws MobyException { HashSet found = new HashSet(); - MobyDataType[] dataTypes = getDataTypesByNames(); + MobyDataType[] dataTypes = getDataTypes (null); if (! searchText.startsWith ("(?i)")) searchText = "(?i)" + searchText; Pattern pattern = Pattern.compile (searchText); @@ -233,8 +214,7 @@ initWorker(); ((Notifier)worker).addNotificationListener (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -246,8 +226,7 @@ initWorker(); ((Notifier)worker).addNotificationListeners (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -259,8 +238,7 @@ initWorker(); ((Notifier)worker).removeNotificationListener (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -272,8 +250,7 @@ initWorker(); ((Notifier)worker).removeNotificationListeners (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -285,8 +262,7 @@ initWorker(); return ((Notifier)worker).getNotificationListeners(); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); return new NotificationListener[] {}; } } @@ -307,4 +283,26 @@ ((Notifier)worker).fireEvent (type, message, details); } + /********************************************************************* + * + ********************************************************************/ + public void fireEvent (NotificationEvent event) { + if (worker != null) + ((Notifier)worker).fireEvent (event); + } + + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (Object source, + int type, Object message, Object details) { + NotificationEvent event = null; + if (details == null) + event = new NotificationEvent (source, type, message); + else + event = new NotificationEvent (source, type, message, details); + fireEvent (event); + } + } From senger at pub.open-bio.org Fri Oct 28 03:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Oct 28 03:58:33 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8bW012440@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv12421 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.38,1.39 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/25 09:07:22 1.38 +++ /home/repository/moby/moby-live/Java/build.xml 2005/10/28 07:58:08 1.39 @@ -88,6 +88,10 @@ + + + + @@ -537,8 +541,8 @@ + From senger at pub.open-bio.org Wed Oct 12 07:17:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 12 Oct 2005 07:17:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121117.j9CBHxkW013563@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv13525/src/Clients/help Modified Files: MobyDigest_usage.txt Log Message: moby-live/Java/src/Clients/help MobyDigest_usage.txt,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/22 16:07:08 1.4 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/10/12 11:17:59 1.5 @@ -31,5 +31,7 @@ -details ... print the above with all details (by default only names are printed) + -v[erbose] ... verbose + [Note: You can also use -argsfile to read arguments from a file. See details in src/Client/help/argsfile.example.] From senger at pub.open-bio.org Wed Oct 12 07:17:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 12 Oct 2005 07:17:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121117.j9CBHx9C013586@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv13525/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralDigestImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.8,1.9 CentralDigestImpl.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/24 17:51:51 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/12 11:17:59 1.9 @@ -107,7 +107,6 @@ throws MobyException { if (cacheDir != null) { File cache = createCacheDir (cacheDir, getRegistryEndpoint()); - messageLn ("Using cache directory: " + cache); dataTypesCache = createSubCacheDir (cache, "dataTypes"); servicesCache = createSubCacheDir (cache, "services"); namespacesCache = createSubCacheDir (cache, "namespaces"); @@ -116,6 +115,16 @@ } /************************************************************************** + * Return a directory name representing the current cache. This is + * the same name as given in constructors.

    + * + * @return current cache directory name + **************************************************************************/ + public String getCacheDir() { + return cacheDir; + } + + /************************************************************************** * Removes object groups from the cache. If 'id' is null it * removes the whole cache (for the Moby registry this instance as * initiated for). Otherwise 'id' indicates what part of the cache @@ -318,12 +327,14 @@ String typesAsXML = getDataTypeNamesAsXML(); store (dataTypesCache, LIST_FILE, typesAsXML); Map types = createDataTypeNamesFromXML (typesAsXML); + fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); - messageLn ("(CDCI) Processing data type " + name + "..."); + fireEvent (DATA_TYPE_LOADING, name); String xml = getDataTypeAsXML (name); store (dataTypesCache, name, xml); + fireEvent (DATA_TYPE_LOADED, name); } } catch (Exception e) { throw new MobyException (formatException (e)); @@ -333,16 +344,17 @@ protected void fillServicesCache() throws MobyException { try { - messageLn ("(CDCI) Asking for all service names..."); String byAuthorityAsXML = getServiceNamesByAuthorityAsXML(); store (servicesCache, LIST_FILE, byAuthorityAsXML); Map authorities = createServiceNamesByAuthorityFromXML (byAuthorityAsXML); + fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); - messageLn ("(CDCI) Processing authority " + authority + "..."); + fireEvent (AUTHORITY_LOADING, authority); String xml = getServicesAsXML (new MobyService (MobyService.DUMMY_NAME, authority), null, true, true); store (servicesCache, authority, xml); + fireEvent (AUTHORITY_LOADED, authority); } } catch (Exception e) { throw new MobyException (formatException (e)); @@ -353,16 +365,17 @@ protected void fillServiceTypesCache() throws MobyException { try { - messageLn ("(CDCI) Asking for all service type names..."); String typesAsXML = getServiceTypesAsXML(); store (serviceTypesCache, LIST_FILE, typesAsXML); Map types = createServiceTypesFromXML (typesAsXML); + fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); - messageLn ("(CDCI) Processing service type " + name + "..."); + fireEvent (SERVICE_TYPE_LOADING, name); String xml = getServiceTypeRelationshipsAsXML (name, false); store (serviceTypesCache, name, xml); + fireEvent (SERVICE_TYPE_LOADED, name); } } catch (Exception e) { throw new MobyException (formatException (e)); @@ -373,8 +386,10 @@ protected void fillNamespacesCache() throws MobyException { try { + fireEvent (NAMESPACE_LOADING, "Loading started."); String xml = getNamespacesAsXML(); store (namespacesCache, LIST_FILE, xml); + fireEvent (NAMESPACE_LOADED, "Loaded."); } catch (Exception e) { throw new MobyException (formatException (e)); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/22 16:07:09 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/12 11:17:59 1.6 @@ -7,6 +7,9 @@ package org.biomoby.client; import org.biomoby.shared.CentralDigest; +import org.biomoby.shared.event.Notifier; +import org.biomoby.shared.event.NotificationEvent; +import org.biomoby.shared.event.NotificationListener; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; @@ -30,7 +33,7 @@ public class CentralDigestImpl extends CentralImpl - implements CentralDigest { + implements CentralDigest, Notifier { // cached (digested) Moby protected MobyDataType[] dataTypes = new MobyDataType[] {}; @@ -75,11 +78,13 @@ try { Vector v = new Vector(); Map types = getDataTypeNames(); + fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); - messageLn ("(CDI) Processing data type " + name + "..."); + fireEvent (DATA_TYPE_LOADING, name); v.addElement (getDataType (name)); + fireEvent (DATA_TYPE_LOADED, name, v.lastElement()); } MobyDataType[] result = new MobyDataType [v.size()]; v.copyInto (result); @@ -98,14 +103,16 @@ try { Vector v = new Vector(); Map types = getServiceTypes(); + fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String typeName = (String)entry.getKey(); - messageLn ("(CDI) Processing service type " + typeName + "..."); + fireEvent (SERVICE_TYPE_LOADING, typeName); MobyServiceType serviceType = new MobyServiceType (typeName); serviceType.setDescription ((String)entry.getValue()); serviceType.setParentNames (getServiceTypeRelationships (typeName, false)); v.addElement (serviceType); + fireEvent (SERVICE_TYPE_LOADED, typeName, v.lastElement()); } MobyServiceType[] result = new MobyServiceType [v.size()]; v.copyInto (result); @@ -130,6 +137,7 @@ throws MobyException { try { Map names = getNamespaces(); + fireEvent (NAMESPACE_COUNT, new Integer (names.size())); MobyNamespace[] result = new MobyNamespace [ names.size() ]; int i = 0; for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { @@ -138,6 +146,7 @@ MobyNamespace ns = new MobyNamespace (name); ns.setDescription ((String)entry.getValue()); result[i++] = ns; + fireEvent (NAMESPACE_LOADED, name, ns); } return result; @@ -153,18 +162,19 @@ throws MobyException { try { Vector v = new Vector(); - messageLn ("(CDI) Asking for all service names..."); Map authorities = getServiceNamesByAuthority(); + fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); + fireEvent (AUTHORITY_LOADING, authority); String[] names = (String[])entry.getValue(); for (int i = 0; i < names.length; i++) { - messageLn ("(CDI) Processing service " + names[i] + "..."); MobyService[] servs = findService (new MobyService (names[i], authority)); for (int j = 0; j < servs.length; j++) v.addElement (servs[j]); } + fireEvent (AUTHORITY_LOADED, authority); } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); @@ -186,6 +196,8 @@ buf.append (e.toString()); buf.append (DGUtils.stackTraceToString (e)); return new String (buf); + } else if (e instanceof MobyException) { + return e.getMessage(); } else { return e.toString(); } @@ -291,6 +303,74 @@ } } + /************************************************************************* + * + * Methods implementing Notifier interface. + * + *************************************************************************/ + + private Vector listeners; + + /********************************************************************* + * + ********************************************************************/ + public synchronized void addNotificationListener (NotificationListener l) { + if (listeners == null) + listeners = new Vector(); + listeners.addElement (l); + } + + /********************************************************************* + * + ********************************************************************/ + public void removeNotificationListener (NotificationListener l) { + if (listeners != null) + listeners.removeElement (l); + } + + /********************************************************************* + * + ********************************************************************/ + public NotificationListener[] getNotificationListeners() { + if (listeners == null) + return new NotificationListener[] {}; + synchronized (listeners) { + NotificationListener[] result = new NotificationListener [listeners.size()]; + listeners.copyInto (result); + return result; + } + } + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (String type, Object message) { + fireEvent (type, message, null); + } + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (String type, Object message, Object details) { + NotificationEvent event = null; + if (details == null) + event = new NotificationEvent (this, type, message.toString()); + else + event = new NotificationEvent (this, type, message.toString(), details); + if (listeners != null) { + synchronized (listeners) { + for (int i = 0; i < listeners.size(); i++) { + NotificationListener listener = (NotificationListener)listeners.elementAt(i); + listener.notified (event); + } + } + } + } + + + + + // Work in progress - implement the methods above by getting RDF // graphs in-one-go and parsing them. Actually ability to get such // graphs was the main motivation for this implementation, and for From senger at pub.open-bio.org Wed Oct 12 07:36:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 12 Oct 2005 07:36:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121136.j9CBaxY3013784@pub.open-bio.org> senger Wed Oct 12 07:36:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv13765/src/Clients Modified Files: UnregisterByAuthority.java Log Message: moby-live/Java/src/Clients UnregisterByAuthority.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/10/12 11:36:59 1.3 @@ -6,7 +6,6 @@ // Copyright Martin Senger (martin.senger at gmail.com). // -import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; import org.biomoby.shared.Central; import org.biomoby.client.CentralImpl; @@ -14,7 +13,6 @@ import org.tulsoft.tools.BaseCmdLine; import java.util.Map; -import java.util.Map.Entry; import java.util.Iterator; /** From senger at pub.open-bio.org Wed Oct 12 07:36:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 12 Oct 2005 07:36:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121136.j9CBaxB4013808@pub.open-bio.org> senger Wed Oct 12 07:36:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv13765/src/main/org/biomoby/client Modified Files: BaseCmdLineClient.java CentralImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseCmdLineClient.java,1.3,1.4 CentralImpl.java,1.28,1.29 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/22 16:07:08 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/10/12 11:36:59 1.4 @@ -27,7 +27,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.Map.Entry; import java.util.Arrays; import java.io.IOException; import java.io.File; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/24 17:51:51 1.28 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/10/12 11:36:59 1.29 @@ -20,10 +20,8 @@ import org.biomoby.shared.MobyServiceType; import org.biomoby.shared.NoSuccessException; import org.biomoby.shared.PendingCurationException; -import org.biomoby.shared.Utils; import org.biomoby.shared.MobyResourceRef; -import org.tulsoft.shared.UUtils; import org.tulsoft.tools.soap.axis.AxisUtils; import org.w3c.dom.Document; From senger at pub.open-bio.org Wed Oct 12 07:36:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 12 Oct 2005 07:36:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121136.j9CBaxvW013827@pub.open-bio.org> senger Wed Oct 12 07:36:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv13765/src/main/org/biomoby/shared/event Modified Files: Notifier.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event Notifier.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/12 11:36:59 1.2 @@ -37,7 +37,7 @@ * notification events from the class that implements this * interface.

    * - * @param the notification listener to be added + * @param l notification listener to be added ********************************************************************/ void addNotificationListener (NotificationListener l); @@ -46,7 +46,7 @@ * longer receives notification events from the class that * implements this interface.

    * - * @param the notification listener to be removed + * @param l notification listener to be removed ********************************************************************/ void removeNotificationListener (NotificationListener l); From kawas at pub.open-bio.org Wed Oct 12 12:34:40 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 12 Oct 2005 12:34:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121634.j9CGYeI1014509@pub.open-bio.org> kawas Wed Oct 12 12:34:40 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv14484/org/biomoby/client/rdf/vocabulary Modified Files: Predicates.java Log Message: organized import statements moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary Predicates.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary/Predicates.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary/Predicates.java 2005/08/30 18:31:30 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary/Predicates.java 2005/10/12 16:34:40 1.8 @@ -1,8 +1,4 @@ package org.biomoby.client.rdf.vocabulary; -import java.util.Properties; - -import org.biomoby.registry.properties.MobyProperties; - import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.Property; From kawas at pub.open-bio.org Wed Oct 12 13:13:29 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 12 Oct 2005 13:13:29 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121713.j9CHDTxp014638@pub.open-bio.org> kawas Wed Oct 12 13:13:28 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv14601/org/biomoby/shared/schema Modified Files: MElementHashtable.java Frame.java GenericWindowListener.java PrimitiveVector.java Added Files: ServiceInstanceWSDL.java Log Message: organized import statements moby-live/Java/src/main/org/biomoby/shared/schema ServiceInstanceWSDL.java,NONE,1.1 MElementHashtable.java,1.1,1.2 Frame.java,1.2,1.3 GenericWindowListener.java,1.1,1.2 PrimitiveVector.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MElementHashtable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MElementHashtable.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MElementHashtable.java 2005/10/12 17:13:28 1.2 @@ -7,7 +7,8 @@ package org.biomoby.shared.schema; -import java.util.*; +import java.util.Hashtable; +import java.util.Vector; public class MElementHashtable { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/09/06 21:29:50 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/10/12 17:13:28 1.3 @@ -29,6 +29,11 @@ */ public class Frame extends JFrame{ + /** + * + */ + private static final long serialVersionUID = 1939367498077695253L; + public Frame() { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/GenericWindowListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/GenericWindowListener.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/GenericWindowListener.java 2005/10/12 17:13:28 1.2 @@ -12,7 +12,8 @@ * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ -import java.awt.event.*; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; public class GenericWindowListener extends WindowAdapter { public void windowClosing(WindowEvent event) =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/PrimitiveVector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/PrimitiveVector.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/PrimitiveVector.java 2005/10/12 17:13:28 1.2 @@ -6,7 +6,7 @@ package org.biomoby.shared.schema; -import java.util.*; +import java.util.Vector; public class PrimitiveVector { From kawas at pub.open-bio.org Wed Oct 12 13:57:54 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 12 Oct 2005 13:57:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121757.j9CHvskS014779@pub.open-bio.org> kawas Wed Oct 12 13:57:54 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool In directory pub.open-bio.org:/tmp/cvs-serv14742/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool Modified Files: ServiceFocusListener.java ServiceInstancePanelFactory.java DescriptionWindow.java ServiceActionListener.java Log Message: organized import statements, removed variables that werent read, etc. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool ServiceFocusListener.java,1.3,1.4 ServiceInstancePanelFactory.java,1.4,1.5 DescriptionWindow.java,1.2,1.3 ServiceActionListener.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceFocusListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceFocusListener.java 2005/08/31 23:56:39 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceFocusListener.java 2005/10/12 17:57:54 1.4 @@ -6,7 +6,6 @@ import java.awt.event.FocusEvent; import java.awt.event.FocusListener; -import javax.swing.JFrame; import javax.swing.JTextArea; import javax.swing.JTextField; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceInstancePanelFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceInstancePanelFactory.java 2005/08/31 23:56:39 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceInstancePanelFactory.java 2005/10/12 17:57:54 1.5 @@ -28,7 +28,6 @@ import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.ListSelectionModel; -import javax.swing.text.Style; import org.biomoby.client.ui.graphical.applets.shared.MobyTree; import org.biomoby.client.ui.graphical.applets.util.TreeLoaderThread; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java 2005/09/01 00:03:56 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java 2005/10/12 17:57:54 1.3 @@ -21,6 +21,10 @@ */ public class DescriptionWindow extends JDialog { + /** + * + */ + private static final long serialVersionUID = -7369426386153906403L; private javax.swing.JPanel panel = null; private JPanel buttonpanel = null; private JButton btnClose = null; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceActionListener.java 2005/08/31 23:56:39 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceActionListener.java 2005/10/12 17:57:54 1.3 @@ -16,7 +16,6 @@ import javax.swing.JPanel; import org.biomoby.client.rdf.builder.ServiceInstanceRDF; -import org.biomoby.client.ui.graphical.applets.util.REGEXP; /** * @author Edward Kawas Created on July 7, 2004 From kawas at pub.open-bio.org Wed Oct 12 13:57:54 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 12 Oct 2005 13:57:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121757.j9CHvsCM014798@pub.open-bio.org> kawas Wed Oct 12 13:57:54 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared In directory pub.open-bio.org:/tmp/cvs-serv14742/org/biomoby/client/ui/graphical/applets/shared Modified Files: MobyTree.java Log Message: organized import statements, removed variables that werent read, etc. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared MobyTree.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/09/30 14:44:58 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/10/12 17:57:54 1.4 @@ -1,5 +1,7 @@ package org.biomoby.client.ui.graphical.applets.shared; +import java.awt.BorderLayout; +import java.awt.Dimension; import java.awt.GridLayout; import java.awt.Toolkit; import java.util.ArrayList; @@ -7,6 +9,7 @@ import java.util.HashMap; import java.util.Iterator; +import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTree; @@ -350,4 +353,21 @@ tree.clearSelection(); tree.collapseRow(0); } + + public static void main(String[] args) { + JFrame frame = new JFrame(); + MobyTree tree = new MobyTree(false, "http://localhost:8080/RESOURCES/MOBY-S/Objects", "Object"); + tree.makeObjectTree("Object"); + tree.setPreferredSize(new Dimension(400, 400)); + // Add button to the frame + frame.getContentPane().add(tree, BorderLayout.CENTER); + + // Set initial size + int frameWidth = 300; + int frameHeight = 300; + frame.setSize(frameWidth, frameHeight); + + // Show the frame + frame.setVisible(true); + } } From gss at pub.open-bio.org Fri Oct 14 17:29:55 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri, 14 Oct 2005 17:29:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510142129.j9ELTtr0025016@pub.open-bio.org> gss Fri Oct 14 17:29:54 EDT 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-serv24990/src/org/semanticmoby/ref/servlets Modified Files: KeywordSearchServlet.java Log Message: Explicitly import org.semanticmoby.ref.tools.db.DBConnection to disambiguate from Jena's DBConnection class moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets KeywordSearchServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/10/09 01:11:21 1.5 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/10/14 21:29:54 1.6 @@ -9,6 +9,7 @@ import org.semanticmoby.ref.tools.*; import org.semanticmoby.ref.tools.db.*; +import org.semanticmoby.ref.tools.db.DBConnection; import org.semanticmoby.tools.Util; From gss at pub.open-bio.org Fri Oct 14 17:56:18 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri, 14 Oct 2005 17:56:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510142156.j9ELuI8i025115@pub.open-bio.org> gss Fri Oct 14 17:56:18 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv25090/S-MOBY/ref-impl/semanticmoby.org/build Modified Files: build.xml Log Message: Removed jalopy stuff moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/10/09 01:17:49 1.6 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/10/14 21:56:18 1.7 @@ -140,26 +140,4 @@ - - - - - - - - - - - - - - - - - - - - - From gss at pub.open-bio.org Fri Oct 14 17:56:43 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri, 14 Oct 2005 17:56:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510142156.j9ELuh4p025148@pub.open-bio.org> gss Fri Oct 14 17:56:43 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv25123/S-MOBY/ref-impl/core/build Modified Files: build.xml Log Message: Removed jalopy stuff moby-live/S-MOBY/ref-impl/core/build build.xml,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/10/09 01:33:06 1.4 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/10/14 21:56:43 1.5 @@ -54,28 +54,9 @@ - - - - - - - - - - - - - - - - - - - - - + + + From senger at pub.open-bio.org Tue Oct 18 13:19:56 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 13:19:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181719.j9IHJuGC015973@pub.open-bio.org> senger Tue Oct 18 13:19:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv15954 Modified Files: TestingCentral.java Log Message: moby-live/Java/src/Clients TestingCentral.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/22 16:07:08 1.7 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/10/18 17:19:56 1.8 @@ -276,8 +276,8 @@ simpleData.addNamespace (namespace1); MobyPrimaryDataSet collection = new MobyPrimaryDataSet ("Collection_A"); collection.addElement (simpleData1); - collection.addElement (simpleData2); - collection.addElement (simpleData3); +// collection.addElement (simpleData2); +// collection.addElement (simpleData3); MobySecondaryData secData1 = helper.createSecondaryData ("Secondary_A", "Integer"); MobySecondaryData secData2 = helper.createSecondaryData ("Secondary_B", "String"); From kawas at pub.open-bio.org Tue Oct 18 14:06:26 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:06:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181806.j9II6QDB016176@pub.open-bio.org> kawas Tue Oct 18 14:06:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/guide In directory pub.open-bio.org:/tmp/cvs-serv16152/guide Log Message: Directory /home/repository/moby/moby-live/Java/docs/guide added to the repository moby-live/Java/docs/guide - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 14:06:42 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:06:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181806.j9II6g7I016208@pub.open-bio.org> kawas Tue Oct 18 14:06:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/workflows In directory pub.open-bio.org:/tmp/cvs-serv16184/workflows Log Message: Directory /home/repository/moby/moby-live/Java/docs/workflows added to the repository moby-live/Java/docs/workflows - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 14:26:03 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:26:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181826.j9IIQ3AD016380@pub.open-bio.org> kawas Tue Oct 18 14:26:03 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/guide In directory pub.open-bio.org:/tmp/cvs-serv16359 Added Files: AddRegEndpoint.png addDNAtoModel.png addingMelting.png availableProcessorsContextC.png availableServices.png completeDnasequence.png connectString2DNA.png contextObjectDetails.png dnaConnectedMelting.png dnasequence&comps.png dnasequence.png index.html msdAddToWorkflow.png objectContextMenu.png objectTooltip.png processorsView.png results.png serviceContextClick.png serviceDescription.png serviceTooltip.png tutorialWorkflow.xml tutorialWorkflowInput.xml workflowComplete.png Log Message: adding the taverna guide files for version 1.3 moby-live/Java/docs/guide AddRegEndpoint.png,NONE,1.1 addDNAtoModel.png,NONE,1.1 addingMelting.png,NONE,1.1 availableProcessorsContextC.png,NONE,1.1 availableServices.png,NONE,1.1 completeDnasequence.png,NONE,1.1 connectString2DNA.png,NONE,1.1 contextObjectDetails.png,NONE,1.1 dnaConnectedMelting.png,NONE,1.1 dnasequence&comps.png,NONE,1.1 dnasequence.png,NONE,1.1 index.html,NONE,1.1 msdAddToWorkflow.png,NONE,1.1 objectContextMenu.png,NONE,1.1 objectTooltip.png,NONE,1.1 processorsView.png,NONE,1.1 results.png,NONE,1.1 serviceContextClick.png,NONE,1.1 serviceDescription.png,NONE,1.1 serviceTooltip.png,NONE,1.1 tutorialWorkflow.xml,NONE,1.1 tutorialWorkflowInput.xml,NONE,1.1 workflowComplete.png,NONE,1.1 From kawas at pub.open-bio.org Tue Oct 18 14:27:17 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:27:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181827.j9IIRHnq016447@pub.open-bio.org> kawas Tue Oct 18 14:27:17 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/workflows In directory pub.open-bio.org:/tmp/cvs-serv16400 Added Files: 1 - workflow.xml 1 - workflowInput.xml 10 - GeneInfo workflow.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml 8 - hmm dragon workflow.xml 9 - DNASequenceHolder element.xml readme.txt Log Message: some example workflows moby-live/Java/docs/workflows 1 - workflow.xml,NONE,1.1 1 - workflowInput.xml,NONE,1.1 10 - GeneInfo workflow.xml,NONE,1.1 2 - blastDragonDbWorkflow.xml,NONE,1.1 3 - cos_fixedInput.xml,NONE,1.1 4 - characterizeGeneticElement.xml,NONE,1.1 5 - BlastQueryAgainstAraProteinsE13.xml,NONE,1.1 6 - compareKeywordAndSimilarity.xml,NONE,1.1 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,NONE,1.1 8 - hmm dragon workflow.xml,NONE,1.1 9 - DNASequenceHolder element.xml,NONE,1.1 readme.txt,NONE,1.1 rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/10,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/GeneInfo,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/8,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/hmm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/dragon,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/9,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/DNASequenceHolder,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 14:37:10 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:37:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181837.j9IIbABX016533@pub.open-bio.org> kawas Tue Oct 18 14:37:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv16508/org/biomoby/shared/extended Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended added to the repository moby-live/Java/src/main/org/biomoby/shared/extended - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 14:37:13 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:37:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181837.j9IIbDBE016567@pub.open-bio.org> kawas Tue Oct 18 14:37:13 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv16546/org/biomoby/shared/extended Added Files: NamespaceParser.java DataTypeParser.java ServiceTypeParser.java Log Message: preliminary versions of the files that parse rdf and return their respective objects. moby-live/Java/src/main/org/biomoby/shared/extended NamespaceParser.java,NONE,1.1 DataTypeParser.java,NONE,1.1 ServiceTypeParser.java,NONE,1.1 From senger at pub.open-bio.org Tue Oct 18 16:00:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:00:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182000.j9IK0kDL016904@pub.open-bio.org> senger Tue Oct 18 16:00:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna In directory pub.open-bio.org:/tmp/cvs-serv16886/taverna Log Message: Directory /home/repository/moby/moby-live/Java/docs/taverna added to the repository moby-live/Java/docs/taverna - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:00:56 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:00:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182000.j9IK0uiq016946@pub.open-bio.org> senger Tue Oct 18 16:00:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv16928/taverna/guide Log Message: Directory /home/repository/moby/moby-live/Java/docs/taverna/guide added to the repository moby-live/Java/docs/taverna/guide - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/guide/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/guide/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/guide/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:01:07 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:01:07 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182001.j9IK17P8016990@pub.open-bio.org> senger Tue Oct 18 16:01:07 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/workflows In directory pub.open-bio.org:/tmp/cvs-serv16972/taverna/workflows Log Message: Directory /home/repository/moby/moby-live/Java/docs/taverna/workflows added to the repository moby-live/Java/docs/taverna/workflows - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:12:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:12:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCagA017232@pub.open-bio.org> senger Tue Oct 18 16:12:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/guide In directory pub.open-bio.org:/tmp/cvs-serv17192/guide Removed Files: AddRegEndpoint.png addDNAtoModel.png addingMelting.png availableProcessorsContextC.png availableServices.png completeDnasequence.png connectString2DNA.png contextObjectDetails.png dnaConnectedMelting.png dnasequence&comps.png dnasequence.png index.html msdAddToWorkflow.png objectContextMenu.png objectTooltip.png processorsView.png results.png serviceContextClick.png serviceDescription.png serviceTooltip.png tutorialWorkflow.xml tutorialWorkflowInput.xml workflowComplete.png Log Message: moby-live/Java/docs/guide AddRegEndpoint.png,1.1,NONE addDNAtoModel.png,1.1,NONE addingMelting.png,1.1,NONE availableProcessorsContextC.png,1.1,NONE availableServices.png,1.1,NONE completeDnasequence.png,1.1,NONE connectString2DNA.png,1.1,NONE contextObjectDetails.png,1.1,NONE dnaConnectedMelting.png,1.1,NONE dnasequence&comps.png,1.1,NONE dnasequence.png,1.1,NONE index.html,1.1,NONE msdAddToWorkflow.png,1.1,NONE objectContextMenu.png,1.1,NONE objectTooltip.png,1.1,NONE processorsView.png,1.1,NONE results.png,1.1,NONE serviceContextClick.png,1.1,NONE serviceDescription.png,1.1,NONE serviceTooltip.png,1.1,NONE tutorialWorkflow.xml,1.1,NONE tutorialWorkflowInput.xml,1.1,NONE workflowComplete.png,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/AddRegEndpoint.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/addDNAtoModel.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/addingMelting.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/availableProcessorsContextC.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/availableServices.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/completeDnasequence.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/connectString2DNA.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/contextObjectDetails.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/dnaConnectedMelting.png,v: No such file or directory sh: line 1: comps.png: command not found rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/dnasequence.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/index.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/msdAddToWorkflow.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/objectContextMenu.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/objectTooltip.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/processorsView.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/results.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/serviceContextClick.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/serviceDescription.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/serviceTooltip.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/tutorialWorkflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/tutorialWorkflowInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/workflowComplete.png,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:12:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:12:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCasM017247@pub.open-bio.org> senger Tue Oct 18 16:12:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv17192/taverna/guide Added Files: AddRegEndpoint.png addDNAtoModel.png addingMelting.png availableProcessorsContextC.png availableServices.png completeDnasequence.png connectString2DNA.png contextObjectDetails.png dnaConnectedMelting.png dnasequence&comps.png dnasequence.png index.html msdAddToWorkflow.png objectContextMenu.png objectTooltip.png processorsView.png results.png serviceContextClick.png serviceDescription.png serviceTooltip.png tutorialWorkflow.xml tutorialWorkflowInput.xml workflowComplete.png Log Message: moby-live/Java/docs/taverna/guide AddRegEndpoint.png,NONE,1.1 addDNAtoModel.png,NONE,1.1 addingMelting.png,NONE,1.1 availableProcessorsContextC.png,NONE,1.1 availableServices.png,NONE,1.1 completeDnasequence.png,NONE,1.1 connectString2DNA.png,NONE,1.1 contextObjectDetails.png,NONE,1.1 dnaConnectedMelting.png,NONE,1.1 dnasequence&comps.png,NONE,1.1 dnasequence.png,NONE,1.1 index.html,NONE,1.1 msdAddToWorkflow.png,NONE,1.1 objectContextMenu.png,NONE,1.1 objectTooltip.png,NONE,1.1 processorsView.png,NONE,1.1 results.png,NONE,1.1 serviceContextClick.png,NONE,1.1 serviceDescription.png,NONE,1.1 serviceTooltip.png,NONE,1.1 tutorialWorkflow.xml,NONE,1.1 tutorialWorkflowInput.xml,NONE,1.1 workflowComplete.png,NONE,1.1 From senger at pub.open-bio.org Tue Oct 18 16:12:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:12:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCbCJ017279@pub.open-bio.org> senger Tue Oct 18 16:12:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/workflows In directory pub.open-bio.org:/tmp/cvs-serv17192/taverna/workflows Added Files: 1 - workflow.xml 1 - workflowInput.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml readme.txt Log Message: moby-live/Java/docs/taverna/workflows 1 - workflow.xml,NONE,1.1 1 - workflowInput.xml,NONE,1.1 2 - blastDragonDbWorkflow.xml,NONE,1.1 3 - cos_fixedInput.xml,NONE,1.1 4 - characterizeGeneticElement.xml,NONE,1.1 5 - BlastQueryAgainstAraProteinsE13.xml,NONE,1.1 6 - compareKeywordAndSimilarity.xml,NONE,1.1 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,NONE,1.1 readme.txt,NONE,1.1 rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:12:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:12:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCbZk017338@pub.open-bio.org> senger Tue Oct 18 16:12:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/workflows In directory pub.open-bio.org:/tmp/cvs-serv17192/workflows Removed Files: 1 - workflow.xml 1 - workflowInput.xml 10 - GeneInfo workflow.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml 8 - hmm dragon workflow.xml 9 - DNASequenceHolder element.xml readme.txt Log Message: moby-live/Java/docs/workflows 1 - workflow.xml,1.1,NONE 1 - workflowInput.xml,1.1,NONE 10 - GeneInfo workflow.xml,1.1,NONE 2 - blastDragonDbWorkflow.xml,1.1,NONE 3 - cos_fixedInput.xml,1.1,NONE 4 - characterizeGeneticElement.xml,1.1,NONE 5 - BlastQueryAgainstAraProteinsE13.xml,1.1,NONE 6 - compareKeywordAndSimilarity.xml,1.1,NONE 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,1.1,NONE 8 - hmm dragon workflow.xml,1.1,NONE 9 - DNASequenceHolder element.xml,1.1,NONE readme.txt,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflowInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/10,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/GeneInfo,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/blastDragonDbWorkflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/cos_fixedInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/characterizeGeneticElement.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/BlastQueryAgainstAraProteinsE13.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/compareKeywordAndSimilarity.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/compareKeywordAndSimilarityAndPhytoprot_count.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/8,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/hmm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/dragon,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/9,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/DNASequenceHolder,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/element.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/readme.txt,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 16:15:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:15:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182015.j9IKFbGv017439@pub.open-bio.org> senger Tue Oct 18 16:15:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv17420 Modified Files: index.html Log Message: moby-live/Java/docs index.html,1.15,1.16 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/index.html,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- /home/repository/moby/moby-live/Java/docs/index.html 2005/09/21 07:56:55 1.15 +++ /home/repository/moby/moby-live/Java/docs/index.html 2005/10/18 20:15:37 1.16 @@ -46,6 +46,7 @@

  • Command-line clients
  • Integration with Eclipse
  • Some issues with using jMoby on MS-Windows platform +
  • How to use the BioMoby plugin in Taverna
  • Integration with Taverna
  • RDF Agent @@ -91,7 +92,7 @@
    Martin Senger
    -Last modified: Wed Sep 21 15:27:30 2005 +Last modified: Tue Oct 18 22:04:57 2005
    From kawas at pub.open-bio.org Wed Oct 19 18:00:26 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:00:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192200.j9JM0QvH021394@pub.open-bio.org> kawas Wed Oct 19 18:00:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv21367 Modified Files: index.html Added Files: InstallingLocalMOBYCentral.html Log Message: added an installing mobycentral link moby-live/Java/docs/taverna/guide InstallingLocalMOBYCentral.html,NONE,1.1 index.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/18 20:12:36 1.1 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:00:26 1.2 @@ -1,200 +1,400 @@ - - - - -The 'new' BioMoby plugin For Taverna - - - -

    How to use the BioMoby plugin in Taverna 1.3

    -
    -

    Introduction

    -
    -

    We updated the BioMoby plugin so that we could add functionality that we believed was missing.

    -

    In the past, users of the plugin were forced to start every Moby based workflow with the root Moby
    - datatype. In other words, you were able to utilize a local widget called 'create_moby_data', however,
    - the Moby data really was just the root datatype in disguise.

    -

    In addition, in Taverna releases prior to version 1.2, the BioMoby services were always limited to one
    - input and one output. This worked for many of the Moby services, but for those wishing to create a
    - workflow that initally utilized a service with more inputs, that option just wasn't available.

    -
    -

    New Features

    -
    -

    The updated BioMoby plugin contains many new features. Some of these features include the following:

    -
      -
    • The ability to work with any datatype in the MobyCentral Object ontology
    • -
    • The ability to utilize services with more than 1 input or output
    • -
    • The ability to obtain useful information regarding the datatypes or services
    • -
    • The addition of Moby collection support (currently handles only collections as inputs, not outputs)
    • -
    • The ability to completely add a Moby data type with all of its sub components to a workflow
    • -
    -

    To start using these new features, please follow the short tutorial below!

    -
    -

    Tutorial

    -
    -

    Creating a BioMoby Scavenger

    -
    -

    Creating a new BioMoby scavenger has never been easier! In fact, if you are familar with Taverna,
    - then adding a BioMoby scavenger is just like adding any other scavenger.

    -

    Starting from the 'Available Services' window, you will need to context click the folder labeled
    - 'Available Processors'. Below is a image illustrating the 'Available Services' window.

    -

    Available Services Window

    -

    Performing a context click on the selected folder reveals the following menu. Notice how
    - we chose to add new BioMoby scavenger.

    -

    Scavengers that we can choose from

    -

    Upon making our selection, we will be prompted to enter certain information that will allow Taverna
    - to create our scavenger. The information that we need to provide includes the URL of the BioMoby
    - central registry that we would like to use, as well as the URL of the RDF document describing the
    - BioMoby datatype ontology.

    -

    Enter your registry details

    -

    You may now be scratching your head, and are wondering why you have never heard of this RDF document.
    - Currently, this location is undocumented in the Moby API, and the API will be supplemented with this information
    - at a later time. At the time that this tutorial was written, there was only one location known for this RDF document
    - and it is the default one in Taverna (shown above) - .

    -

    Once the information has been inputted into the text boxes, the Moby services and datatypes will now be available
    - as processors in the 'Available Services' window.

    -

    The service and datatype ontologies are illustrated

    -

    If you would like to work with your own custom Mobycentral registry and not that of the default, http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl, then it is recommended that you edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    -
    -

    Creating a workflow

    -
    -

    Workflow used in this tutorial may be downloaded here.
    - Workflow input used in this tutorial may be downloaded here.

    -

    Creating a workflow with the new BioMoby plugin is as easy as it was using the previous plugin. There are, of course,
    - a few - differences. When creating workflows, it is no longer necessary to use the local widget 'create_moby_data'.
    - When you are ready to instantiate a Moby datatype, all that is necessary is for you to choose the datatype from the list
    - of 'Available Processors' under the 'Moby Objects' folder.

    -

    As an example, we will add the Moby datatype called DNASequence to our workflow. In order to do this, we must
    - navigate the datatype ontology to find DNASequence. We can find DNASequence by traversing the 'Moby Objects'
    - tree in the following order: - Object, VirtualSequence, GenericSequence, NucleotideSequence and finally DNASequence.
    - Now that we have found the processor that we were looking for, let's add it to the workflow.

    -

    Adding the datatype DNASequence to the workflow

    -

    'DNASequence' has now been added to the workflow diagram. To reveal what inputs and outputs this processor
    - utilizes, we need to ask Taverna to show us all of the ports in the workflow diagram.

    -

    DNASequence and all of its ports

    -

    Notice how 'DNASequence' takes as input a namespace, an id, an article name, and 2 Moby datatypes: String and
    - Integer. Since 'String' and 'Integer' are Moby datatypes contained within a 'DNASequence', they have been conveniently
    - added to the workflow and linked appropriately.

    -

    Our workflow diagram -looks something like the following:

    -

    A DNASequence with all of its sub components connected to it

    -

    A complex BioMoby datatype. 'DNASequence', and all of its subcomponents have now been added to our workflow.
    - Next we will add a BioMoby service processor that handles our complex datatype.

    -

    We will add the service 'runFasta' from the authority 'www.pcm.uam.es'. This service runs the fasta tool on the input
    - sequence - . From the list of processors, we will navigate to www.pcm.uam.es and then choose the service that we are
    - interested in, i.e. 'runFasta'.

    -

    Adding the runFasta processor

    -

    The next thing to do is to connect the input of the 'runFasta' processor to the output of 'DNASequence'. It should be noted
    - that there are 2 inputs to the processor 'runFasta': 'GenericSequence(_ANON_)' and 'input'. The port labelled 'input' serves to
    - support workflows created prior to Taverna 1.2 and should be used when you create workflows utilizing the Local Widgets
    - 'create_moby_data'. - For our workflow, we will connect the complex datatype 'DNASequence' to the input port labeled
    - 'DNASequence(sequence)' of the 'runFasta' processor.

    -

    DNASequence datatype connected to the Melting service

    -

    We are almost done! The only things that are missing now are the workflow inputs and the workflow outputs. We will create
    - the following inputs:

    -
      -
    • namespace - this input will connect to the 'namespace' input port of 'DNASequence'
    • -
    • id - this input will connect to the 'id' input port of 'DNASequence'
    • -
    • sequence - this input will connect to the 'value' input port of 'String'
    • -
    • length - this input will connect to the 'value' input port of 'Integer'
    • -
    -

    We will also create a workflow output called 'output'. This workflow output will be connected to the
    - output port, 'FASTA_Text(_ANON_)' of the processor 'runFasta'.

    -

    Once these connections have been made, you should have something similar to the image below. Note that the image is only showing
    - those ports that are bound to inputs or outputs.

    -

    A completed workflow Diagram

    -

    So there we have a completed workflow based on BioMoby Services and datatypes. If you wish to run this
    - workflow, some suitable values for the workflow inputs are as follows:

    -
      -
    • namespace - NCBI_gi
    • -
    • id - 646464
    • -
    • sequence - tatata
    • -
    • length - 6
    • -
    -

    The output from this data is shown below.

    -

    The results from running our workflow

    -
    -

    Obtaining information on a Moby datatype

    -
    -

    One of the neatest things added to the plugin was the ability to obtain information regarding BioMoby datatypes. For
    - instance, you can find out what services a particular datatype can be used as input or output. In addition, you can find
    - the descriptions of those services.

    -

    As an example, imagine that we wanted to discover what services the Moby datatype 'Integer' feeds into. To do this, we
    - can use our existing workflow. From the 'Advanced model explorer' window, context click on the processor called 'Integer'
    - and choose 'Moby Object Details'.

    -

    Finding out more about a particular Moby Datatype

    -

    As soon as you choose 'Moby Object Details', a pop up window appears and embedded in that window
    - is a tree like structure. Note that this window can take up to a minute to appear depending on your
    - internet connection and the data type chosen.
    At the root of the tree is the datatype that we chose to
    - know more about, in our case - 'Integer', and 2 sub trees labeled 'Feeds into' and 'Produced by'. In the
    - 'Feeds into' sub tree, you will find out - what BioMoby services consume the datatype in question, sorted by
    - authority.

    -

    When you navigate the sub tree - and mouse over the service name, a tool tip appears giving you the
    - description of the service.

    -

    Tool tip provided to describe the service that consumes our datatype

    -

    In addition, you can context click the service name, in this case - PupaSNP, - and a menu is shown:

    -

    Moby Object Details Context Menu

    -

    From this menu, you can choose to either add the selected service to the workflow or view more a more detailed
    - service description. Below, the window that appears upon choosing to 'Find out about PupaSNP':

    -

    Moby Service Description

    -

     

    -

    The sub tree - 'Produced by' offers similar information, except about services that produce the datatype in question.
    - The context menu is not available for children of the 'Produced by' node.

    -

     

    -
    -

    Obtaining information on a Moby service

    -
    -

    As with Moby datatypes, information about services is also available. For a particular service, we can determine
    - what are the inputs and outputs. And if you wish, you may add the input datatypes to the workflow.In addition,
    - we can also discover what namespaces a particular input or output - is valid in.

    -

    Using the workflow that we created above, we can discover what inputs and outputs 'runFasta' utilize. To determine this,
    - we need to context click on the 'runFasta' processor from the 'Advanced model explorer', just as we had done before
    - with the Moby datatype processors above, and choose 'Moby Service Details'.

    -

    Context clicking a Moby service to retrieve additional information

    -

    A pop window appears and embedded in it is a tree that has as its root the name of the Moby
    - service. The children of the root node are 2 sub trees, 'Inputs' and 'Outputs'. The items under
    - these sub trees simply illustrate what datatypes the service consumes and produces.

    -

    The window showing the service details and a tooltip describing the output of the service

    -

    Similarly to the 'Moby Object Details', you can either add the input datatype to the workflow or
    - obtain additional information on the datatype:

    -

    Moby Service Details Context Menu

    -

     

    -
    -
    -

    What's Next

    -
    -

    In the future, we hope to add even more functionality to the plugin. Below are some of the features that
    - we have thought about:

    -
      -
    • Adding collection support that behaves as stated in the BioMoby API
    • -
    • Adding the ability to parse Moby datatypes and pass this parsed data onto other non Moby services.
    • -
    • Adding the ability to add Moby services from the 'Moby Object Details' window.
    • -
    -

    If there are specific features that you would like us to consider, please contact the BioMoby development
    - team.

    -
    -

    Comments / Questions

    -
    -

    If you have any questions or comments, please feel free to contact Eddie Kawas @
    - edward[DoT]kawas[AT]gmail[DoT]com

    -

    If you have any suggestions regarding new features or you would like to report a bug,
    - please let me know.

    -

     

    -

     

    -
    -
    - - + + + + + + + + +The 'new' BioMoby plugin For Taverna + + + + + + + +

    How to use the BioMoby plugin in Taverna 1.3

    + +
    + +

    Introduction

    + +
    + +

    We updated the BioMoby plugin so that we could add functionality that we believed was missing.

    + +

    In the past, users of the plugin were forced to start every Moby based workflow with the root Moby
    + + datatype. In other words, you were able to utilize a local widget called 'create_moby_data', however,
    + + the Moby data really was just the root datatype in disguise.

    + +

    In addition, in Taverna releases prior to version 1.2, the BioMoby services were always limited to one
    + + input and one output. This worked for many of the Moby services, but for those wishing to create a
    + + workflow that initally utilized a service with more inputs, that option just wasn't available.

    + +
    + +

    New Features

    + +
    + +

    The updated BioMoby plugin contains many new features. Some of these features include the following:

    + +
      + +
    • The ability to work with any datatype in the MobyCentral Object ontology
    • + +
    • The ability to utilize services with more than 1 input or output
    • + +
    • The ability to obtain useful information regarding the datatypes or services
    • + +
    • The addition of Moby collection support (currently handles only collections as inputs, not outputs)
    • + +
    • The ability to completely add a Moby data type with all of its sub components to a workflow
    • + +
    + +

    To start using these new features, please follow the short tutorial below!

    + +
    + +

    Tutorial

    + +
    + +

    Creating a BioMoby Scavenger

    + +
    + +

    Creating a new BioMoby scavenger has never been easier! In fact, if you are familar with Taverna,
    + + then adding a BioMoby scavenger is just like adding any other scavenger.

    + +

    Starting from the 'Available Services' window, you will need to context click the folder labeled
    + + 'Available Processors'. Below is a image illustrating the 'Available Services' window.

    + +

    Available Services Window

    + +

    Performing a context click on the selected folder reveals the following menu. Notice how
    + + we chose to add new BioMoby scavenger.

    + +

    Scavengers that we can choose from

    + +

    Upon making our selection, we will be prompted to enter certain information that will allow Taverna
    + + to create our scavenger. The information that we need to provide includes the URL of the BioMoby
    + + central registry that we would like to use, as well as the URL of the RDF document describing the
    + + BioMoby datatype ontology.

    + +

    Enter your registry details

    + +

    You may now be scratching your head, and are wondering why you have never heard of this RDF document.
    + + Currently, this location is undocumented in the Moby API, and the API will be supplemented with this information
    + + at a later time. At the time that this tutorial was written, there was only one location known for this RDF document
    + + and it is the default one in Taverna (shown above) + + .

    + +

    Once the information has been inputted into the text boxes, the Moby services and datatypes will now be available
    + + as processors in the 'Available Services' window.

    + +

    The service and datatype ontologies are illustrated

    + +

    If you would like to work with your own custom Mobycentral registry and not that of the default, http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl, then it is recommended that you edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    +

    If you would like to host your own local custom registry, please click here.

    +
    + +

    Creating a workflow

    + +
    + +

    Workflow used in this tutorial may be downloaded here.
    + + Workflow input used in this tutorial may be downloaded here.

    + +

    Creating a workflow with the new BioMoby plugin is as easy as it was using the previous plugin. There are, of course,
    + + a few + + differences. When creating workflows, it is no longer necessary to use the local widget 'create_moby_data'.
    + + When you are ready to instantiate a Moby datatype, all that is necessary is for you to choose the datatype from the list
    + + of 'Available Processors' under the 'Moby Objects' folder.

    + +

    As an example, we will add the Moby datatype called DNASequence to our workflow. In order to do this, we must
    + + navigate the datatype ontology to find DNASequence. We can find DNASequence by traversing the 'Moby Objects'
    + + tree in the following order: + + Object, VirtualSequence, GenericSequence, NucleotideSequence and finally DNASequence.
    + + Now that we have found the processor that we were looking for, let's add it to the workflow.

    + +

    Adding the datatype DNASequence to the workflow

    + +

    'DNASequence' has now been added to the workflow diagram. To reveal what inputs and outputs this processor
    + + utilizes, we need to ask Taverna to show us all of the ports in the workflow diagram.

    + +

    DNASequence and all of its ports

    + +

    Notice how 'DNASequence' takes as input a namespace, an id, an article name, and 2 Moby datatypes: String and
    + + Integer. Since 'String' and 'Integer' are Moby datatypes contained within a 'DNASequence', they have been conveniently
    + + added to the workflow and linked appropriately.

    + +

    Our workflow diagram + +looks something like the following:

    + +

    A DNASequence with all of its sub components connected to it

    + +

    A complex BioMoby datatype. 'DNASequence', and all of its subcomponents have now been added to our workflow.
    + + Next we will add a BioMoby service processor that handles our complex datatype.

    + +

    We will add the service 'runFasta' from the authority 'www.pcm.uam.es'. This service runs the fasta tool on the input
    + + sequence + + . From the list of processors, we will navigate to www.pcm.uam.es and then choose the service that we are
    + + interested in, i.e. 'runFasta'.

    + +

    Adding the runFasta processor

    + +

    The next thing to do is to connect the input of the 'runFasta' processor to the output of 'DNASequence'. It should be noted
    + + that there are 2 inputs to the processor 'runFasta': 'GenericSequence(_ANON_)' and 'input'. The port labelled 'input' serves to
    + + support workflows created prior to Taverna 1.2 and should be used when you create workflows utilizing the Local Widgets
    + + 'create_moby_data'. + + For our workflow, we will connect the complex datatype 'DNASequence' to the input port labeled
    + + 'DNASequence(sequence)' of the 'runFasta' processor.

    + +

    DNASequence datatype connected to the Melting service

    + +

    We are almost done! The only things that are missing now are the workflow inputs and the workflow outputs. We will create
    + + the following inputs:

    + +
      + +
    • namespace - this input will connect to the 'namespace' input port of 'DNASequence'
    • + +
    • id - this input will connect to the 'id' input port of 'DNASequence'
    • + +
    • sequence - this input will connect to the 'value' input port of 'String'
    • + +
    • length - this input will connect to the 'value' input port of 'Integer'
    • + +
    + +

    We will also create a workflow output called 'output'. This workflow output will be connected to the
    + + output port, 'FASTA_Text(_ANON_)' of the processor 'runFasta'.

    + +

    Once these connections have been made, you should have something similar to the image below. Note that the image is only showing
    + + those ports that are bound to inputs or outputs.

    + +

    A completed workflow Diagram

    + +

    So there we have a completed workflow based on BioMoby Services and datatypes. If you wish to run this
    + + workflow, some suitable values for the workflow inputs are as follows:

    + +
      + +
    • namespace - NCBI_gi
    • + +
    • id - 646464
    • + +
    • sequence - tatata
    • + +
    • length - 6
    • + +
    + +

    The output from this data is shown below.

    + +

    The results from running our workflow

    + +
    + +

    Obtaining information on a Moby datatype

    + +
    + +

    One of the neatest things added to the plugin was the ability to obtain information regarding BioMoby datatypes. For
    + + instance, you can find out what services a particular datatype can be used as input or output. In addition, you can find
    + + the descriptions of those services.

    + +

    As an example, imagine that we wanted to discover what services the Moby datatype 'Integer' feeds into. To do this, we
    + + can use our existing workflow. From the 'Advanced model explorer' window, context click on the processor called 'Integer'
    + + and choose 'Moby Object Details'.

    + +

    Finding out more about a particular Moby Datatype

    + +

    As soon as you choose 'Moby Object Details', a pop up window appears and embedded in that window
    + + is a tree like structure. Note that this window can take up to a minute to appear depending on your
    + + internet connection and the data type chosen.
    At the root of the tree is the datatype that we chose to
    + + know more about, in our case + + 'Integer', and 2 sub trees labeled 'Feeds into' and 'Produced by'. In the
    + + 'Feeds into' sub tree, you will find out + + what BioMoby services consume the datatype in question, sorted by
    + + authority.

    + +

    When you navigate the sub tree + + and mouse over the service name, a tool tip appears giving you the
    + + description of the service.

    + +

    Tool tip provided to describe the service that consumes our datatype

    + +

    In addition, you can context click the service name, in this case + + PupaSNP, + + and a menu is shown:

    + +

    Moby Object Details Context Menu

    + +

    From this menu, you can choose to either add the selected service to the workflow or view more a more detailed
    + + service description. Below, the window that appears upon choosing to 'Find out about PupaSNP':

    + +

    Moby Service Description

    + +

     

    + +

    The sub tree + + 'Produced by' offers similar information, except about services that produce the datatype in question.
    + + The context menu is not available for children of the 'Produced by' node.

    + +

     

    + +
    + +

    Obtaining information on a Moby service

    + +
    + +

    As with Moby datatypes, information about services is also available. For a particular service, we can determine
    + + what are the inputs and outputs. And if you wish, you may add the input datatypes to the workflow.In addition,
    + + we can also discover what namespaces a particular input or output + + is valid in.

    + +

    Using the workflow that we created above, we can discover what inputs and outputs 'runFasta' utilize. To determine this,
    + + we need to context click on the 'runFasta' processor from the 'Advanced model explorer', just as we had done before
    + + with the Moby datatype processors above, and choose 'Moby Service Details'.

    + +

    Context clicking a Moby service to retrieve additional information

    + +

    A pop window appears and embedded in it is a tree that has as its root the name of the Moby
    + + service. The children of the root node are 2 sub trees, 'Inputs' and 'Outputs'. The items under
    + + these sub trees simply illustrate what datatypes the service consumes and produces.

    + +

    The window showing the service details and a tooltip describing the output of the service

    + +

    Similarly to the 'Moby Object Details', you can either add the input datatype to the workflow or
    + + obtain additional information on the datatype:

    + +

    Moby Service Details Context Menu

    + +

     

    + +
    + +
    + +

    What's Next

    + +
    + +

    In the future, we hope to add even more functionality to the plugin. Below are some of the features that
    + + we have thought about:

    + +
      + +
    • Adding collection support that behaves as stated in the BioMoby API
    • + +
    • Adding the ability to parse Moby datatypes and pass this parsed data onto other non Moby services.
    • + +
    • Adding the ability to add Moby services from the 'Moby Object Details' window.
    • + +
    + +

    If there are specific features that you would like us to consider, please contact the BioMoby development
    + + team.

    + +
    + +

    Comments / Questions

    + +
    + +

    If you have any questions or comments, please feel free to contact Eddie Kawas @
    + + edward[DoT]kawas[AT]gmail[DoT]com

    + +

    If you have any suggestions regarding new features or you would like to report a bug,
    + + please let me know.

    + +

     

    + +

     

    + +
    + +
    + + + + + From kawas at pub.open-bio.org Wed Oct 19 18:13:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:13:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192213.j9JMDBR4021823@pub.open-bio.org> kawas Wed Oct 19 18:13:11 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv21796 Modified Files: index.html Added Files: workflows.html Log Message: added a way to view the preconstructed workflows moby-live/Java/docs/taverna/guide workflows.html,NONE,1.1 index.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:00:26 1.2 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:13:11 1.3 @@ -61,7 +61,7 @@

    To start using these new features, please follow the short tutorial below!

    - +

    Click here to download BioMoby workflows.

  • Tutorial

    From kawas at pub.open-bio.org Wed Oct 19 18:27:22 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:27:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192227.j9JMRMuw022280@pub.open-bio.org> kawas Wed Oct 19 18:27:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv22255 Modified Files: index.html Log Message: added a question/answer and modified the scavenger section. moby-live/Java/docs/taverna/guide index.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:13:11 1.3 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:27:22 1.4 @@ -10,6 +10,14 @@ The 'new' BioMoby plugin For Taverna + @@ -92,29 +100,21 @@ to create our scavenger. The information that we need to provide includes the URL of the BioMoby
    - central registry that we would like to use, as well as the URL of the RDF document describing the
    - - BioMoby datatype ontology.

    + central registry that we would like to use. Note that only registries that implement the newest BioMoby
    + API are supported.

    Enter your registry details

    -

    You may now be scratching your head, and are wondering why you have never heard of this RDF document.
    - - Currently, this location is undocumented in the Moby API, and the API will be supplemented with this information
    - - at a later time. At the time that this tutorial was written, there was only one location known for this RDF document
    - - and it is the default one in Taverna (shown above) - - .

    -

    Once the information has been inputted into the text boxes, the Moby services and datatypes will now be available
    as processors in the 'Available Services' window.

    The service and datatype ontologies are illustrated

    -

    If you would like to work with your own custom Mobycentral registry and not that of the default, http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl, then it is recommended that you edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    +

    If you would like to work with your own custom Mobycentral registry and not that of the default,
    + http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl
    , then it is recommended that you
    + edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the
    + property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    If you would like to host your own local custom registry, please click here.

    @@ -375,13 +375,19 @@

    Comments / Questions

    -
    - +

    Questions

    +
      +
    1. How does one go about installing a local registry? +
      +

      To install your own registry, please go here.

      +
      +
    2. +
    +

     

    If you have any questions or comments, please feel free to contact Eddie Kawas @
    edward[DoT]kawas[AT]gmail[DoT]com

    -

    If you have any suggestions regarding new features or you would like to report a bug,
    please let me know.

    From kawas at pub.open-bio.org Wed Oct 19 18:34:38 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:34:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192234.j9JMYcfH022536@pub.open-bio.org> kawas Wed Oct 19 18:34:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv22511 Modified Files: workflows.html Log Message: fixed the links - noticed that the workflows have a timestamp appended to them moby-live/Java/docs/taverna/guide workflows.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:13:11 1.1 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:34:38 1.2 @@ -1,22 +1,24 @@ - - Taverna Workflows - - + +Taverna Workflows + +

    Taverna Workflows

    -
     Name                    Last modified      Size  Description
    [   ] 1 - workflow.xml 13-Oct-2005 15:26 11K -[   ] 1 - workflowInput.xml 13-Oct-2005 15:26 4.6K -[   ] 2 - blastDragonDbWor..> 13-Oct-2005 15:26 10K -[   ] 3 - cos_fixedInput.xml 13-Oct-2005 15:26 4.1K -[   ] 4 - characterizeGene..> 13-Oct-2005 15:26 7.7K +
     Name                    Last modified      Size  Description
    [   ] 1 - workflow.xml 13-Oct-2005 15:26 11K +[   ] 1 - workflowInput.xml 13-Oct-2005 15:26 4.6K +[   ] 2 - blastDragonDbWor..> 13-Oct-2005 15:26 10K +[   ] 3 - cos_fixedInput.xml 13-Oct-2005 15:26 4.1K +[   ] 4 - characterizeGene..> 13-Oct-2005 15:26 7.7K -[   ] 5 - BlastQueryAgains..> 13-Oct-2005 15:26 3.0K -[   ] 6 - compareKeywordAn..> 13-Oct-2005 15:26 6.2K -[   ] 7 - compareKeywordAn..> 13-Oct-2005 15:26 13K -[   ] 8 - hmm dragon workf..> 13-Oct-2005 15:26 7.1K +[   ] 5 - BlastQueryAgains..> 13-Oct-2005 15:26 3.0K +[   ] 6 - compareKeywordAn..> 13-Oct-2005 15:26 6.2K +[   ] 7 - compareKeywordAn..> 13-Oct-2005 15:26 13K +[   ] 8 - hmm dragon workf..> 13-Oct-2005 15:26 7.1K [   ] 9 - DNASequenceHolde..> 13-Oct-2005 15:26 10K [TXT] readme.txt 13-Oct-2005 15:26 127 -
    - +
    +
    + + From kawas at pub.open-bio.org Wed Oct 19 18:41:03 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:41:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192241.j9JMf33O022797@pub.open-bio.org> kawas Wed Oct 19 18:41:03 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/workflows In directory pub.open-bio.org:/tmp/cvs-serv22743 Modified Files: 1 - workflow.xml 1 - workflowInput.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml Added Files: 8 - hmm dragon workflow.xml 9 - DNASequenceHolder element.xml Log Message: removed some appended text from the workflows moby-live/Java/docs/taverna/workflows 8 - hmm dragon workflow.xml,NONE,1.1 9 - DNASequenceHolder element.xml,NONE,1.1 1 - workflow.xml,1.1,1.2 1 - workflowInput.xml,1.1,1.2 2 - blastDragonDbWorkflow.xml,1.1,1.2 3 - cos_fixedInput.xml,1.1,1.2 4 - characterizeGeneticElement.xml,1.1,1.2 5 - BlastQueryAgainstAraProteinsE13.xml,1.1,1.2 6 - compareKeywordAndSimilarity.xml,1.1,1.2 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,1.1,1.2 rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/8,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/hmm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/dragon,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/9,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/DNASequenceHolder,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/workflowInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/blastDragonDbWorkflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/cos_fixedInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/characterizeGeneticElement.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/BlastQueryAgainstAraProteinsE13.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/compareKeywordAndSimilarity.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/compareKeywordAndSimilarityAndPhytoprot_count.xml,v: No such file or directory From kawas at pub.open-bio.org Wed Oct 19 18:41:30 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:41:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192241.j9JMfUx8022844@pub.open-bio.org> kawas Wed Oct 19 18:41:30 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv22817 Modified Files: workflows.html Log Message: missed a link moby-live/Java/docs/taverna/guide workflows.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:34:38 1.2 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:41:30 1.3 @@ -15,9 +15,9 @@ [   ] 6 - compareKeywordAn..> 13-Oct-2005 15:26 6.2K [   ] 7 - compareKeywordAn..> 13-Oct-2005 15:26 13K [   ] 8 - hmm dragon workf..> 13-Oct-2005 15:26 7.1K -[   ] 9 - DNASequenceHolde..> 13-Oct-2005 15:26 10K +[   ] 9 - DNASequenceHolde..> 13-Oct-2005 15:26 10K -[TXT] readme.txt 13-Oct-2005 15:26 127 +[TXT] readme.txt 13-Oct-2005 15:26 127
    From kawas at pub.open-bio.org Thu Oct 20 15:07:06 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Thu, 20 Oct 2005 15:07:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510201907.j9KJ765R029709@pub.open-bio.org> kawas Thu Oct 20 15:07:06 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv29684/org/biomoby/shared/extended Modified Files: NamespaceParser.java Log Message: finished the logic using what is currently available in the rdf document that describes the namespace ontology. moby-live/Java/src/main/org/biomoby/shared/extended NamespaceParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/NamespaceParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/NamespaceParser.java 2005/10/18 18:37:13 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/NamespaceParser.java 2005/10/20 19:07:06 1.2 @@ -14,10 +14,24 @@ import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.RDFReader; +import com.hp.hpl.jena.rdf.model.ResIterator; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.vocabulary.RDF; +import com.hp.hpl.jena.vocabulary.RDFS; /** * * @author Eddie created Oct 18, 2005 + * This class parses the RDF document that describes the namespace ontology.

    + * An example of how to use this class is below: + *

    
    +        NamespaceParser p = new NamespaceParser("http://biomoby.org/RESOURCES/MOBY-S/Namespaces");
    +		MobyNamespace[] namespaces = p.getMobyNamespacesFromRDF();
    +		for (int i = 0; i < namespaces.length; i++) {
    +			System.out.println(namespaces[i]);
    +		}
    +   

    + This would output the following the name and description for each namespace in the document */ public class NamespaceParser { @@ -139,7 +153,18 @@ Model model = ModelFactory.createDefaultModel(); RDFReader reader = model.getReader(); reader.read(model, new StringReader(getRdfAsString()), null); - // TODO start querying the model and creating namespace objects + // get all subjects in the document + ResIterator iterator = model.listSubjects(); + while (iterator.hasNext()) { + Resource resource = iterator.nextResource(); + // extract the name of the namespace + String name = resource.getLocalName(); + MobyNamespace namespace = new MobyNamespace(name); + // extract the comment (a literal in the document) + String description = resource.getProperty(RDFS.comment).getLiteral().getString(); + namespace.setDescription(description); + list.add(namespace); + } // return the array return (MobyNamespace[]) list.toArray(new MobyNamespace[list.size()]); @@ -152,7 +177,6 @@ private String getRdfAsString() { String s = null; StringBuffer sb = new StringBuffer(); - URL url = null; try { BufferedReader in = null; in = new BufferedReader(new InputStreamReader(url.openStream())); @@ -165,4 +189,14 @@ } return sb.toString(); } + + + public static void main(String[] args) throws MobyException { + // show how to use this class + NamespaceParser p = new NamespaceParser("http://biomoby.org/RESOURCES/MOBY-S/Namespaces"); + MobyNamespace[] namespaces = p.getMobyNamespacesFromRDF(); + for (int i = 0; i < namespaces.length; i++) { + System.out.println(namespaces[i]); + } + } } From carrere at pub.open-bio.org Fri Oct 21 09:22:19 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Fri, 21 Oct 2005 09:22:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510211322.j9LDMJIq001132@pub.open-bio.org> carrere Fri Oct 21 09:22:18 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv1100 Modified Files: MOBYXSLT.pm Log Message: Bug in getObjectHasaElements fixed. This function is very usefull for new ontology. To retrieve content (i.e. ...) of an object: my @a_hasa_elements = &MOBYXSLT::getObjectHasaElements($article); if ($#a_hasa_elements >= 0) { foreach my $hasa_element (@a_hasa_elements) { if (&MOBYXSLT::getObjectName($hasa_element) eq 'content') { $input_data = &MOBYXSLT::getObjectContent($hasa_element); } } } moby-live/Perl/MOBY MOBYXSLT.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/09/08 13:51:06 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/10/21 13:22:18 1.2 @@ -1,10 +1,8 @@ package MOBYXSLT; -use strict; -use Carp; -my $TMP_DIR = '/tmp/'; #Where your temporary files will be written -my $XSLTPROC = '/usr/bin/xsltproc'; #Where your xsltproc binary is located -my $XSL_SHEET = './xsl/parseMobyMessage.xsl';#Where your xsltproc style-sheet is located +my $TMP_DIR = '/tmp/';#Where your temporary files will be written +my $XSLTPROC = '/usr/bin/xsltproc';#Where your xsltproc binary is located +my $XSL_SHEET = '/bioinfo/www/bioinfo/services/biomoby/cgi-bin/Services/LIPM/lib/parseMobyMessage.xsl';#Where your xsltproc style-sheet is located #$Id$ @@ -31,8 +29,6 @@ =head1 SYNOPSIS -use MOBYXSLT; - sub MonWebservice { @@ -47,8 +43,8 @@ foreach my $query (@{$ra_queries}) { - my $query_id = MOBYXSLT::getInputID($query);#Retrieve Query ID - my @a_input_articles = MOBYXSLT::getArticles($query);#Retrieve articles + my $query_id = MOBYXSLT::getInputID($query);#Retrieve Query ID + my @a_input_articles = MOBYXSLT::getArticles($query);#Retrieve articles my ($fasta_sequences, $fasta_namespace, $fasta_id) = ('','',''); @@ -58,9 +54,9 @@ if (MOBYXSLT::isSimpleArticle($article)) { - my $object_type = MOBYXSLT::getObjectType($article); + my $object_type = MOBYXSLT::getObjectType($article); - if (IsTheCorrectType($object_type)) + if (IsTheCorrectType($object_type)) { $fasta_sequences = MOBYXSLT::getObjectContent($article); $fasta_namespace = MOBYXSLT::getObjectNamespace($article); @@ -80,10 +76,15 @@ ###### #What you want to do with your data ###### - + + my $cmd ="..."; + system("$cmd"); + + + ######### #Send result ######### @@ -106,19 +107,16 @@ my $XSL_SHEET = './parseMobyMessage.xsl'; #Where your xsltproc style-sheet is located -=head1 NOTE - - Many functions have same names as those from MOBY::CommonSubs - -=head1 AUTHORS +=head1 DESCRIPTION - Sebastien.Carrere at toulouse.inra.fr - -=head1 METHODS + Note: many functions have same names as those from MOBY::CommonSubs =cut +use strict; +use Carp; + =head2 function getInputs Title : getInputs @@ -151,6 +149,11 @@ close TMP; my $parsed_message = `$XSLTPROC $XSL_SHEET $TMP_DIR$tmp_file`; + +# open (PARSED, ">$TMP_DIR$tmp_file" . ".xsl"); +# print PARSED "$XSLTPROC $XSL_SHEET $TMP_DIR$tmp_file\n\n\n"; +# print PARSED "$parsed_message"; +# close PARSED; my $servicenotes = ''; my @a_queries = (); @@ -337,7 +340,7 @@ Function : Takes a simple article structure (from getArticles or getCollectedSimples) and retrieve the list of "HASA" element HASHREF Returns : @a_hasa_elements: ARRAY of "HASA" element HASHREF - Args : $rh_simple_article: simple article HASHREF structure from getArticles or getCollectedSimples + Args : $rh_object: simple article HASHREF structure from getArticles or getCollectedSimples Globals : none =cut @@ -346,14 +349,37 @@ { my $rh_simple_article = shift(); - if ($rh_simple_article->{'object_hasa'} ne '') + if (defined $rh_simple_article->{'article_objects'}) { - return (@{$rh_simple_article->{'object_hasa'}}); + if ($rh_simple_article->{'article_objects'}->{'object_hasa'} ne '') + { + return (@{$rh_simple_article->{'article_objects'}->{'object_hasa'}}); + } + else + { + return (); + } } else { - return (); + if ($rh_simple_article->{'object_hasa'} ne '') + { + return @{$rh_simple_article->{'object_hasa'}}; + } + else + { + return (); + } } + +# if ($rh_object->{'object_hasa'} ne '') +# { +# return (@{$rh_object->{'object_hasa'}}); +# } +# else +# { +# return (); +# } } =head2 function getObjectType From gss at pub.open-bio.org Fri Oct 21 13:36:46 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri, 21 Oct 2005 13:36:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510211736.j9LHakw2002265@pub.open-bio.org> gss Fri Oct 21 13:36:45 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/tools In directory pub.open-bio.org:/tmp/cvs-serv2244/src/org/semanticmoby/tools Added Files: FormatConverter.java Log Message: Initial version s-moby/ref-impl/core/src/org/semanticmoby/tools FormatConverter.java,NONE,1.1 From kawas at pub.open-bio.org Fri Oct 21 13:45:01 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 21 Oct 2005 13:45:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510211745.j9LHj16T002317@pub.open-bio.org> kawas Fri Oct 21 13:45:01 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv2292/org/biomoby/shared/extended Modified Files: ServiceTypeParser.java Log Message: added the parsing logic for the rdf document describing the service type ontology. moby-live/Java/src/main/org/biomoby/shared/extended ServiceTypeParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceTypeParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceTypeParser.java 2005/10/18 18:37:13 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceTypeParser.java 2005/10/21 17:45:01 1.2 @@ -14,6 +14,9 @@ import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.RDFReader; +import com.hp.hpl.jena.rdf.model.ResIterator; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.vocabulary.RDFS; /** * @@ -139,7 +142,21 @@ Model model = ModelFactory.createDefaultModel(); RDFReader reader = model.getReader(); reader.read(model, new StringReader(getRdfAsString()), null); - // TODO start querying the model and creating Service Type objects + // start querying the model and creating Service Type objects + ResIterator iterator = model.listSubjects(); + while (iterator.hasNext()) { + Resource resource = iterator.nextResource(); + String name = resource.getLocalName(); + MobyServiceType servicetype = new MobyServiceType(name); + if (!resource.hasProperty(RDFS.subClassOf)) { + continue; + } + String parent = resource.getProperty(RDFS.subClassOf).getObject().toString(); + servicetype.setParentNames(new String[] {parent}); + String description = resource.getProperty(RDFS.comment).getLiteral().getString(); + servicetype.setDescription(description); + list.add(servicetype); + } // return the array return (MobyServiceType[]) list @@ -153,7 +170,6 @@ private String getRdfAsString() { String s = null; StringBuffer sb = new StringBuffer(); - URL url = null; try { BufferedReader in = null; in = new BufferedReader(new InputStreamReader(url.openStream())); @@ -166,4 +182,12 @@ } return sb.toString(); } + + public static void main(String[] args) throws MobyException { + ServiceTypeParser p = new ServiceTypeParser("http://biomoby.org/RESOURCES/MOBY-S/Services"); + MobyServiceType[] types = p.getMobyServiceTypesFromRDF(); + for (int i = 0; i < types.length; i++) { + System.out.println(types[i]); + } + } } From senger at pub.open-bio.org Fri Oct 21 21:38:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 21 Oct 2005 21:38:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c4fR003411@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/client Modified Files: BaseClient.java CentralDigestCachedImpl.java CentralDigestImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseClient.java,1.2,1.3 CentralDigestCachedImpl.java,1.9,1.10 CentralDigestImpl.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/10/22 01:38:04 1.3 @@ -169,9 +169,9 @@ } catch (MalformedURLException e) { throw new MobyException ("Service endpoint '" + serviceEndpoint + "' is not a valid URL."); - } catch (GException e) { - throw new MobyException (e.getMessage()); - } + } catch (GException e) { + throw new MobyException (e.getMessage()); + } } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/12 11:17:59 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/22 01:38:04 1.10 @@ -15,6 +15,7 @@ import java.io.PrintWriter; import java.util.Iterator; import java.util.Map; +import java.util.TreeMap; import java.util.Vector; import java.util.Arrays; import java.util.Comparator; @@ -126,9 +127,9 @@ /************************************************************************** * Removes object groups from the cache. If 'id' is null it - * removes the whole cache (for the Moby registry this instance as - * initiated for). Otherwise 'id' indicates what part of the cache - * that will be removed.

    + * removes the whole cache (for that Moby registry this instance + * was initiated for). Otherwise 'id' indicates which part of the + * cache that will be removed.

    * * @param id should be either null, or one of the fillowing: * {@link #CACHE_PART_DATATYPES}, {@link #CACHE_PART_SERVICES}, @@ -313,21 +314,38 @@ } } - // + /************************************************************************** + * Is the given cache empty (meaning: cache directory does not + * exist, is empty, or contains only files to be ignored)? + *************************************************************************/ protected boolean isCacheEmpty (File cache) throws MobyException { if (cache == null) return true; String[] list = cache.list(); - return ( list == null || list.length == 0 ); + if (list == null || list.length == 0) + return true; + for (int i = 0; i < list.length; i++) { + if ( ! ignored (new File (list[i])) ) + return false; + } + return true; } - protected void fillDataTypesCache() + /************************************************************************** + * Load data types from a moby registry into local cache. If it is + * interrupted (by a callback signal) it removes what was already + * put into this cache and returns false. Otherwise returns + * true. It raises an exception if it cannot fill the cache (from + * some other reasons). + *************************************************************************/ + protected boolean fillDataTypesCache() throws MobyException { try { + fireEvent (DATA_TYPES_START); String typesAsXML = getDataTypeNamesAsXML(); store (dataTypesCache, LIST_FILE, typesAsXML); Map types = createDataTypeNamesFromXML (typesAsXML); - fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); + fireEvent (DATA_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); @@ -335,19 +353,28 @@ String xml = getDataTypeAsXML (name); store (dataTypesCache, name, xml); fireEvent (DATA_TYPE_LOADED, name); + if (stopDT) { + removeFromCache (CACHE_PART_DATATYPES); + return false; + } } + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopDT ? DATA_TYPES_CANCELLED : DATA_TYPES_END); + stopDT = false; } } - protected void fillServicesCache() + protected boolean fillServicesCache() throws MobyException { try { + fireEvent (AUTHORITIES_START); String byAuthorityAsXML = getServiceNamesByAuthorityAsXML(); store (servicesCache, LIST_FILE, byAuthorityAsXML); Map authorities = createServiceNamesByAuthorityFromXML (byAuthorityAsXML); - fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); + fireEvent (AUTHORITIES_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); @@ -355,20 +382,29 @@ String xml = getServicesAsXML (new MobyService (MobyService.DUMMY_NAME, authority), null, true, true); store (servicesCache, authority, xml); fireEvent (AUTHORITY_LOADED, authority); + if (stopS) { + removeFromCache (CACHE_PART_SERVICES); + return false; + } } + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopS ? AUTHORITIES_CANCELLED : AUTHORITIES_END); + stopS = false; } } // - protected void fillServiceTypesCache() + protected boolean fillServiceTypesCache() throws MobyException { try { + fireEvent (SERVICE_TYPES_START); String typesAsXML = getServiceTypesAsXML(); store (serviceTypesCache, LIST_FILE, typesAsXML); Map types = createServiceTypesFromXML (typesAsXML); - fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); + fireEvent (SERVICE_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); @@ -376,22 +412,32 @@ String xml = getServiceTypeRelationshipsAsXML (name, false); store (serviceTypesCache, name, xml); fireEvent (SERVICE_TYPE_LOADED, name); + if (stopST) { + removeFromCache (CACHE_PART_SERVICETYPES); + return false; + } } + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopST ? SERVICE_TYPES_CANCELLED :SERVICE_TYPES_END); + stopST = false; } } // - protected void fillNamespacesCache() + protected boolean fillNamespacesCache() throws MobyException { try { - fireEvent (NAMESPACE_LOADING, "Loading started."); + fireEvent (NAMESPACES_START); String xml = getNamespacesAsXML(); store (namespacesCache, LIST_FILE, xml); - fireEvent (NAMESPACE_LOADED, "Loaded."); + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (NAMESPACES_END); } } @@ -405,7 +451,9 @@ synchronized (dataTypesCache) { if (isCacheEmpty (dataTypesCache)) { initCache(); - fillDataTypesCache(); + if (! fillDataTypesCache()) + // callback stopped filling + return new TreeMap(); } // get a list file (with all data type names) @@ -425,7 +473,9 @@ Vector v = new Vector(); if (isCacheEmpty (dataTypesCache)) { initCache(); - fillDataTypesCache(); + if (! fillDataTypesCache()) + // callback stopped filling + return new MobyDataType[] {}; } File[] list = dataTypesCache.listFiles(); if (list == null) @@ -456,7 +506,9 @@ synchronized (servicesCache) { if (isCacheEmpty (servicesCache)) { initCache(); - fillServicesCache(); + if (! fillServicesCache()) + // callback stopped filling + return new TreeMap(); } // get a list file (with all service names) @@ -476,7 +528,9 @@ Vector v = new Vector(); if (isCacheEmpty (servicesCache)) { initCache(); - fillServicesCache(); + if (! fillServicesCache()) + // callback stopped filling + return new MobyService[] {}; } File[] list = servicesCache.listFiles(); if (list == null) @@ -529,7 +583,9 @@ synchronized (serviceTypesCache) { if (isCacheEmpty (serviceTypesCache)) { initCache(); - fillServiceTypesCache(); + if (! fillServiceTypesCache()) + // callback stopped filling + return new MobyServiceType[] {}; } // get a list file (with all service type names) =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/12 11:17:59 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/22 01:38:04 1.7 @@ -41,6 +41,9 @@ protected MobyService[] services = new MobyService[] {}; protected MobyNamespace[] namespaces = new MobyNamespace[] {}; + protected boolean stopDT = false; + protected boolean stopST = false; + protected boolean stopS = false; /************************************************************************* * Default constructor. It connects to a default Moby registry @@ -77,14 +80,19 @@ throws MobyException { try { Vector v = new Vector(); + fireEvent (DATA_TYPES_START); Map types = getDataTypeNames(); - fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); + fireEvent (DATA_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); fireEvent (DATA_TYPE_LOADING, name); v.addElement (getDataType (name)); fireEvent (DATA_TYPE_LOADED, name, v.lastElement()); + if (stopDT) { + v = new Vector(); + break; + } } MobyDataType[] result = new MobyDataType [v.size()]; v.copyInto (result); @@ -92,6 +100,9 @@ } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopDT ? DATA_TYPES_CANCELLED : DATA_TYPES_END); + stopDT = false; } } @@ -102,8 +113,9 @@ throws MobyException { try { Vector v = new Vector(); + fireEvent (SERVICE_TYPES_START); Map types = getServiceTypes(); - fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); + fireEvent (SERVICE_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String typeName = (String)entry.getKey(); @@ -113,6 +125,10 @@ serviceType.setParentNames (getServiceTypeRelationships (typeName, false)); v.addElement (serviceType); fireEvent (SERVICE_TYPE_LOADED, typeName, v.lastElement()); + if (stopST) { + v = new Vector(); + break; + } } MobyServiceType[] result = new MobyServiceType [v.size()]; v.copyInto (result); @@ -120,6 +136,9 @@ } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopST ? SERVICE_TYPES_CANCELLED : SERVICE_TYPES_END); + stopST = false; } } @@ -136,8 +155,9 @@ protected MobyNamespace[] readNamespaces() throws MobyException { try { + fireEvent (NAMESPACES_START); Map names = getNamespaces(); - fireEvent (NAMESPACE_COUNT, new Integer (names.size())); + fireEvent (NAMESPACES_COUNT, new Integer (names.size())); MobyNamespace[] result = new MobyNamespace [ names.size() ]; int i = 0; for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { @@ -152,6 +172,8 @@ } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (NAMESPACES_END); } } @@ -162,8 +184,9 @@ throws MobyException { try { Vector v = new Vector(); + fireEvent (AUTHORITIES_START); Map authorities = getServiceNamesByAuthority(); - fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); + fireEvent (AUTHORITIES_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); @@ -175,15 +198,20 @@ v.addElement (servs[j]); } fireEvent (AUTHORITY_LOADED, authority); + if (stopS) { + v = new Vector(); + break; + } } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); return result; } catch (Exception e) { - System.err.println ("HERE:\n" + e.toString()); - e.printStackTrace(); throw new MobyException (formatException (e)); + } finally { + fireEvent (stopS ? AUTHORITIES_CANCELLED : AUTHORITIES_END); + stopS = false; } } @@ -323,6 +351,14 @@ /********************************************************************* * ********************************************************************/ + public void addNotificationListeners (NotificationListener[] l) { + for (int i = 0; i < l.length; i++) + addNotificationListener (l[i]); + } + + /********************************************************************* + * + ********************************************************************/ public void removeNotificationListener (NotificationListener l) { if (listeners != null) listeners.removeElement (l); @@ -331,6 +367,14 @@ /********************************************************************* * ********************************************************************/ + public void removeNotificationListeners (NotificationListener[] l) { + for (int i = 0; i < l.length; i++) + removeNotificationListener (l[i]); + } + + /********************************************************************* + * + ********************************************************************/ public NotificationListener[] getNotificationListeners() { if (listeners == null) return new NotificationListener[] {}; @@ -344,14 +388,21 @@ /********************************************************************* * ********************************************************************/ - protected void fireEvent (String type, Object message) { - fireEvent (type, message, null); + public void callback (int signal) { + switch (signal) { + case SIGNAL_CANCEL_DATA_TYPES: + stopDT = true; break; + case SIGNAL_CANCEL_SERVICE_TYPES: + stopST = true; break; + case SIGNAL_CANCEL_SERVICES: + stopS = true; break; + } } /********************************************************************* * ********************************************************************/ - protected void fireEvent (String type, Object message, Object details) { + public void fireEvent (int type, Object message, Object details) { NotificationEvent event = null; if (details == null) event = new NotificationEvent (this, type, message.toString()); @@ -367,6 +418,21 @@ } } + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (int type) { + fireEvent (type, "", null); + } + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (int type, Object message) { + fireEvent (type, message, null); + } + + From senger at pub.open-bio.org Fri Oct 21 21:38:05 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 21 Oct 2005 21:38:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c5B1003505@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/shared/event Modified Files: NotificationEvent.java Notifier.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,1.1,1.2 Notifier.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/22 01:38:04 1.2 @@ -13,15 +13,16 @@ /** * An event fired by various Moby components to inform that something * has happened. Typical usage is for monitoring access to a Biomoby - * registry (how many entities yet to read, and which one was just + * registry (how many entities to read, and which one was just * read).

    * * Each notification event points to its source (this is inherited - * from a usual Java's EventObject). Additionally, it has its type (a - * string value, usually taken from a list defined in this class), a - * message (whose format may be detremined by the notification type), - * and optionally an object with more details (again, its presence or - * absence may depend on the notification type).

    + * from a usual Java's EventObject). Additionally, it has its type (an + * integer value, preferably taken from a list defined in interface + * {@link org.biomoby.shared.event.Notifier}), a message (whose format + * may be determined by the notification type), and optionally an + * object with more details (again, its presence or absence may depend + * on the notification type).

    * * @author Martin Senger * @version $Id$ @@ -30,7 +31,7 @@ public class NotificationEvent extends EventObject { - private String type; + private int type; private String message; private Object details; @@ -45,10 +46,10 @@ * A usual constructor, setting notification type and a message. ********************************************************************/ public NotificationEvent (Object source, - String type, String message) { + int type, String message) { this (source); this.type = type; - this.message = message; + this.message = (message == null ? "" : message); } /********************************************************************* @@ -56,7 +57,7 @@ * details. ********************************************************************/ public NotificationEvent (Object source, - String type, String message, + int type, String message, Object details) { this (source, type, message); this.details = details; @@ -65,7 +66,7 @@ /********************************************************************* * Return a type of this notification event. ********************************************************************/ - public String getType() { + public int getType() { return type; } @@ -88,9 +89,15 @@ * ********************************************************************/ public String toString() { + String typeStr = null; + try { + typeStr = typeTexts [type]; + } catch (Exception e) { + typeStr = "" + type; + } StringBuffer buf = new StringBuffer (100); buf.append ("["); - buf.append ("Type=" + type); + buf.append (typeStr); buf.append (", Message=" + message); if (details != null) buf.append (", Details=" + details.getClass().getName()); @@ -98,4 +105,35 @@ return new String (buf); } + static final String[] typeTexts = new String[] { + "data-type-start", + "data-type-count", + "data-type-loading", + "data-type-loaded", + "data-type-end", + "service-type-start", + "service-type-count", + "service-type-loading", + "service-type-loaded", + "service-type-end", + "namespace-start", + "namespace-count", + "namespace-loading", + "namespace-loaded", + "namespace-end", + "authority-start", + "authority-count", + "authority-loading", + "authority-loaded", + "authority-end", + "data-type-reset", + "service-type-reset", + "namespace-reset", + "authority-reset", + "data-type-cancel", + "service-type-cancel", + "namespace-cancel", + "authority-cancel" + }; + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/12 11:36:59 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/22 01:38:04 1.3 @@ -16,21 +16,46 @@ public interface Notifier { - static final String DATA_TYPE_COUNT = "data-type-count"; - static final String DATA_TYPE_LOADING = "data-type-loading"; - static final String DATA_TYPE_LOADED = "data-type-loaded"; - - static final String SERVICE_TYPE_COUNT = "service-type-count"; - static final String SERVICE_TYPE_LOADING = "service-type-loading"; - static final String SERVICE_TYPE_LOADED = "service-type-loaded"; - - static final String NAMESPACE_COUNT = "namespace-count"; - static final String NAMESPACE_LOADING = "namespace-loading"; - static final String NAMESPACE_LOADED = "namespace-loaded"; - - static final String AUTHORITY_COUNT = "authority-count"; - static final String AUTHORITY_LOADING = "authority-loading"; - static final String AUTHORITY_LOADED = "authority-loaded"; + static final int DATA_TYPES_START = 0; + static final int DATA_TYPES_COUNT = 1; + static final int DATA_TYPE_LOADING = 2; + static final int DATA_TYPE_LOADED = 3; + static final int DATA_TYPES_END = 4; + + static final int SERVICE_TYPES_START = 5; + static final int SERVICE_TYPES_COUNT = 6; + static final int SERVICE_TYPE_LOADING = 7; + static final int SERVICE_TYPE_LOADED = 8; + static final int SERVICE_TYPES_END = 9; + + static final int NAMESPACES_START = 10; + static final int NAMESPACES_COUNT = 11; + static final int NAMESPACE_LOADING = 12; + static final int NAMESPACE_LOADED = 13; + static final int NAMESPACES_END = 14; + + static final int AUTHORITIES_START = 15; + static final int AUTHORITIES_COUNT = 16; + static final int AUTHORITY_LOADING = 17; + static final int AUTHORITY_LOADED = 18; + static final int AUTHORITIES_END = 19; + + static final int DATA_TYPES_RESET = 20; + static final int SERVICE_TYPES_RESET = 21; + static final int NAMESPACES_RESET = 22; + static final int AUTHORITIES_RESET = 23; + + static final int DATA_TYPES_CANCELLED = 24; + static final int SERVICE_TYPES_CANCELLED = 25; + static final int NAMESPACES_CANCELLED = 26; + static final int AUTHORITIES_CANCELLED = 27; + + + + static final int SIGNAL_CANCEL_DATA_TYPES = 1; + static final int SIGNAL_CANCEL_SERVICE_TYPES = 2; + static final int SIGNAL_CANCEL_SERVICES = 3; + static final int SIGNAL_CANCEL_NAMESPACES = 4; /********************************************************************* * Adds the specified notification listener to receive @@ -42,6 +67,15 @@ void addNotificationListener (NotificationListener l); /********************************************************************* + * Adds the specified notification listeners to receive + * notification events from the class that implements this + * interface.

    + * + * @param l notification listeners to be added + ********************************************************************/ + void addNotificationListeners (NotificationListener[] l); + + /********************************************************************* * Removes the specified notification listener so that it no * longer receives notification events from the class that * implements this interface.

    @@ -51,6 +85,15 @@ void removeNotificationListener (NotificationListener l); /********************************************************************* + * Removes the specified notification listeners so that they no + * longer receive notification events from the class that + * implements this interface.

    + * + * @param l notification listeners to be removed + ********************************************************************/ + void removeNotificationListeners (NotificationListener[] l); + + /********************************************************************* * Returns an array of all the NotificationListeners added to the * class that implements this interface.

    * @@ -59,4 +102,19 @@ ********************************************************************/ NotificationListener[] getNotificationListeners(); + /********************************************************************* + * Call the notifier and signal that it can stop loading data (or + * whatever it is doing).

    + * + * @param signal identify what to stop doing (some usual values of + * this signal are defined elsewhere in this interface with names + * starting by SIGNAL_) + ********************************************************************/ + void callback (int callbackSignal); + + /********************************************************************* + * + ********************************************************************/ + void fireEvent (int type, Object message, Object details); + } From senger at pub.open-bio.org Fri Oct 21 21:38:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 21 Oct 2005 21:38:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c4rl003480@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/shared Modified Files: CentralAll.java Log Message: moby-live/Java/src/main/org/biomoby/shared CentralAll.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralAll.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralAll.java 2004/10/18 14:35:06 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralAll.java 2005/10/22 01:38:04 1.2 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.biomoby.shared.event.Notifier; + /** * A common interface to the classical features of a MobyRegistry (as * expressed in {@link Central}) and to the cumulated (digested) From senger at pub.open-bio.org Fri Oct 21 21:38:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 21 Oct 2005 21:38:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c4cR003459@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/service/dashboard Modified Files: CommonTree.java Dashboard.java DashboardProperties.java DataTypesTree.java JProgressBarWithCancel.java PropertyChannel.java RegistryModel.java RegistryPanel.java Added Files: CommonBoard.java DataTypesBoard.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard CommonBoard.java,NONE,1.1 DataTypesBoard.java,NONE,1.1 CommonTree.java,1.3,1.4 Dashboard.java,1.4,1.5 DashboardProperties.java,1.3,1.4 DataTypesTree.java,1.1,1.2 JProgressBarWithCancel.java,1.1,1.2 PropertyChannel.java,1.2,1.3 RegistryModel.java,1.4,1.5 RegistryPanel.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/12 11:17:59 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/22 01:38:04 1.4 @@ -67,11 +67,14 @@ // protected PropertyChangeSupport support; // protected boolean expanded = true; // the status of the application list + protected String rootNode; + /********************************************************************* * Constructor ********************************************************************/ public CommonTree (String rootNode) { super (new DefaultTreeModel (new DefaultMutableTreeNode (new CommonNode (rootNode)))); + this.rootNode = rootNode; // create an almost empty tree, only with a root node that // contains just a String holding the name of the root node; @@ -135,6 +138,11 @@ setFont (new Font ("Dialog", Font.PLAIN, 10)); } + // root node + if (row == 0) { + setText (rootNode); + } + // TBD: whale icon? // if (leaf) // ((JLabel)c).setIcon (icons [COMPUTER]); @@ -159,6 +167,13 @@ /********************************************************************* + * Get data from a registry model and update the tree. Will be + * overwritten by subclass. + ********************************************************************/ + public void update (int howSorted) { + } + + /********************************************************************* * Called when a tree node is selected. Does nothing here ********************************************************************/ protected void selected (DefaultMutableTreeNode node) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/24 17:51:51 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/22 01:38:04 1.5 @@ -26,6 +26,7 @@ import java.awt.GridBagLayout; import java.awt.Font; +import java.awt.Dimension; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -125,7 +126,7 @@ public void show() { JFrame frame = SwingUtils.createMainFrame (getComponent (propertyChannel), getName()); - SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); + SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); } /************************************************************************** @@ -226,7 +227,7 @@ /************************************************************************** * **************************************************************************/ - DashboardHeader getHeader() { + protected DashboardHeader getHeader() { DashboardHeader h = new DashboardHeader (dashboardProperties); if (panels.length > 0) h.setPanelTitle (panels[0].getTitle()); @@ -259,7 +260,7 @@ * Return a component representing status bar (usually placed at * the bottom of a dashboard). **************************************************************************/ - StatusBar getStatusBar() { + protected StatusBar getStatusBar() { return new StatusBar ("Status: Work in progress"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/24 17:51:51 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/22 01:38:04 1.4 @@ -37,6 +37,7 @@ static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; static final String DP_CACHE_DIR = "dp-cache-dir"; + static final String DP_USE_CACHE = "dp-use-cache"; /** A filename containing Java properties that configure the dashboard. */ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/22 01:38:04 1.2 @@ -17,6 +17,7 @@ import org.tulsoft.shared.UUtils; import javax.swing.JMenuItem; import javax.swing.JCheckBoxMenuItem; +import javax.swing.JProgressBar; import javax.swing.AbstractAction; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; @@ -118,8 +119,9 @@ /********************************************************************* * Get data from a registry model and update the tree. ********************************************************************/ - void update (int howSorted) { + public void update (int howSorted) { setEnabledPopup (false); + updateException = null; final int sorted = howSorted; final SwingWorker worker = new SwingWorker() { @@ -144,11 +146,13 @@ onUpdateDataTreeByAuth (dataTypes); else onUpdateDataTree (dataTypes); - setEnabledPopup (true); - if (sorted == SORTED_BY_AUTHORITY) - deprecatedBox.setEnabled (false); - else - deprecatedBox.setEnabled (true); + if (dataTypes.length > 0) { + setEnabledPopup (true); + if (sorted == SORTED_BY_AUTHORITY) + deprecatedBox.setEnabled (false); + else + deprecatedBox.setEnabled (true); + } } } }; @@ -321,7 +325,6 @@ worker.start(); } - /********************************************************************* * * A tree node representing a child element of a Moby data type. @@ -353,4 +356,7 @@ } } + + + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/JProgressBarWithCancel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/JProgressBarWithCancel.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/JProgressBarWithCancel.java 2005/10/22 01:38:04 1.2 @@ -29,6 +29,7 @@ import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Dimension; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -72,14 +73,16 @@ progressBar.setValue (0); progressBar.setStringPainted (true); - cancelButton = new JButton(); + Icon cancelIcon = SwingUtils.createIcon ("images/smallCancel.gif", this); + cancelButton = new JButton (cancelIcon); cancelButton.setFocusPainted (false); + cancelButton.setMargin (new Insets (0,0,0,0)); + cancelButton.setContentAreaFilled (false); cancelButton.setToolTipText ("Cancel the process"); // put it together ( TBD: should depend on progressBar.getOrientation() ) - SwingUtils.addComponent (this, progressBar, 0, 0, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.WEST, 1.0, 0.0); + SwingUtils.addComponent (this, progressBar, 0, 0, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST, 1.0, 0.0); SwingUtils.addComponent (this, cancelButton, 1, 0, 1, 1, GridBagConstraints.NONE, GridBagConstraints.WEST, 0.0, 0.0); - } /********************************************************************* @@ -96,4 +99,11 @@ return cancelButton; } + /********************************************************************* + * + ********************************************************************/ + public void addActionListener (ActionListener l) { + getButton().addActionListener (l); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/12 11:17:59 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/22 01:38:04 1.3 @@ -8,6 +8,8 @@ package org.biomoby.service.dashboard; +import org.tulsoft.shared.UUtils; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -86,6 +88,17 @@ } /********************************************************************* + * + ********************************************************************/ + public boolean getBoolean (Object key, boolean defaultValue) { + Object value = get (key); + if (value == null) return defaultValue; + if (value instanceof Boolean) + return ((Boolean)value).booleanValue(); + return UUtils.is (value.toString()); + } + + /********************************************************************* * Property change stuff ********************************************************************/ protected PropertyChangeSupport support; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/12 11:17:59 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/22 01:38:04 1.5 @@ -13,6 +13,10 @@ import org.biomoby.shared.CentralAll; import org.biomoby.client.CentralDigestCachedImpl; +import org.biomoby.shared.event.Notifier; +import org.biomoby.shared.event.NotificationEvent; +import org.biomoby.shared.event.NotificationListener; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -32,9 +36,11 @@ */ public class RegistryModel - extends AbstractModel { + extends AbstractModel + implements Notifier { CentralAll worker; + boolean useCache = true; Hashtable dataTypesTable; /********************************************************************* @@ -73,7 +79,7 @@ public MobyDataType[] getDataTypesByNames() throws MobyException { initWorker(); - + fireEvent (DATA_TYPES_RESET, "", null); MobyDataType[] dataTypes = worker.getDataTypes(); java.util.Arrays.sort (dataTypes); return dataTypes; @@ -84,8 +90,8 @@ ********************************************************************/ public MobyDataType[] getDataTypesByAuthority() throws MobyException { - initWorker(); + fireEvent (DATA_TYPES_RESET, "", null); MobyDataType[] dataTypes = worker.getDataTypes(); java.util.Arrays.sort (dataTypes, @@ -157,9 +163,9 @@ String registryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); String registryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); String cacheDir = propertyChannel.getString (DP_CACHE_DIR); - // String cacheDir = "/home/senger/jMoby/myCache"; - // cacheDir = null; - + useCache = propertyChannel.getBoolean (DP_USE_CACHE, true); + if (! useCache) + cacheDir = null; worker = new CentralDigestCachedImpl (registryURL, registryNS, cacheDir); @@ -167,15 +173,110 @@ String maybeNewRegistryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); String maybeNewRegistryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); String maybeNewCacheDir = propertyChannel.getString (DP_CACHE_DIR); - if ( maybeNewRegistryURL.equals (worker.getRegistryEndpoint()) && + boolean maybeUseCache = propertyChannel.getBoolean (DP_USE_CACHE, true); + if ( (maybeUseCache == useCache) && + maybeNewRegistryURL.equals (worker.getRegistryEndpoint()) && maybeNewRegistryNS.equals (worker.getRegistryNamespace()) && maybeNewCacheDir.equals (getCacheDir()) ) return; + useCache = maybeUseCache; + if (! useCache) + maybeNewCacheDir = null; + NotificationListener[] nls = ((Notifier)worker).getNotificationListeners(); + ((Notifier)worker).removeNotificationListeners (nls); worker = new CentralDigestCachedImpl (maybeNewRegistryURL, maybeNewRegistryNS, maybeNewCacheDir); + ((Notifier)worker).addNotificationListeners (nls); + } + } + + /************************************************************************* + * + * Methods implementing Notifier interface. + * + *************************************************************************/ + + /********************************************************************* + * + ********************************************************************/ + public synchronized void addNotificationListener (NotificationListener l) { + try { + initWorker(); + ((Notifier)worker).addNotificationListener (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + } + } + + /********************************************************************* + * + ********************************************************************/ + public void addNotificationListeners (NotificationListener[] l) { + try { + initWorker(); + ((Notifier)worker).addNotificationListeners (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); } } + /********************************************************************* + * + ********************************************************************/ + public synchronized void removeNotificationListener (NotificationListener l) { + try { + initWorker(); + ((Notifier)worker).removeNotificationListener (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + } + } + + /********************************************************************* + * + ********************************************************************/ + public void removeNotificationListeners (NotificationListener[] l) { + try { + initWorker(); + ((Notifier)worker).removeNotificationListeners (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + } + } + + /********************************************************************* + * + ********************************************************************/ + public NotificationListener[] getNotificationListeners() { + try { + initWorker(); + return ((Notifier)worker).getNotificationListeners(); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + return new NotificationListener[] {}; + } + } + + /********************************************************************* + * + ********************************************************************/ + public void callback (int signal) { + if (worker != null) + ((Notifier)worker).callback (signal); + } + + /********************************************************************* + * + ********************************************************************/ + public void fireEvent (int type, Object message, Object details) { + if (worker != null) + ((Notifier)worker).fireEvent (type, message, details); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/12 11:17:59 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 01:38:04 1.10 @@ -129,13 +129,17 @@ // ontology trees ServicesTree servicesTree = new ServicesTree(); - DataTypesTree dataTypesTree = new DataTypesTree (registryModel, console); - dataTypesTree.update (CommonTree.SORTED_BY_NAME); + + DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, + console, + support); + dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); + NamespacesTree namespacesTree = new NamespacesTree(); JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, servicesTree.scrollable(), - dataTypesTree.scrollable()); + dataTypesBoard); split1.setResizeWeight (0.5); split1.setContinuousLayout (true); split1.setOneTouchExpandable (true); @@ -200,6 +204,7 @@ cacheDir.setEnabled (enabled); labelCacheDir.setEnabled (enabled); setPrefValue (USE_CACHE, enabled); + propertyChannel.put (DP_USE_CACHE, new Boolean (enabled).toString()); } /************************************************************************** @@ -252,6 +257,8 @@ onUseCache (e.getStateChange() == ItemEvent.SELECTED); } }); + propertyChannel.put (DP_USE_CACHE, new Boolean (usingCache).toString()); + labelCacheDir = new JLabel("Cache directory"); cacheDir = createFileSelector ("Select directory for/with local cache", "Select", From senger at pub.open-bio.org Sat Oct 22 10:33:19 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 22 Oct 2005 10:33:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221433.j9MEXJrv006357@pub.open-bio.org> senger Sat Oct 22 10:33:19 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv6338 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.8,1.9 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/10/11 16:10:12 1.8 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/10/22 14:33:19 1.9 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sat Oct 22 10:35:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 22 Oct 2005 10:35:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221435.j9MEZkJ0006425@pub.open-bio.org> senger Sat Oct 22 10:35:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv6406/src/config/dashboard/META-INF/services Modified Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/09/18 08:46:26 1.1 +++ /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/10/22 14:35:46 1.2 @@ -1,3 +1,4 @@ org.biomoby.service.dashboard.RegistryPanel +org.biomoby.service.dashboard.RegistrationPanel org.biomoby.service.dashboard.ConsolePanel org.biomoby.service.dashboard.EventGeneratorPanel From senger at pub.open-bio.org Sat Oct 22 10:35:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 22 Oct 2005 10:35:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221435.j9MEZkgf006478@pub.open-bio.org> senger Sat Oct 22 10:35:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv6406/src/main/org/biomoby/service/dashboard/images Added Files: console.gif registration.png smallClear.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images console.gif,NONE,1.1 registration.png,NONE,1.1 smallClear.gif,NONE,1.1 From senger at pub.open-bio.org Sat Oct 22 10:35:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 22 Oct 2005 10:35:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221435.j9MEZk8u006461@pub.open-bio.org> senger Sat Oct 22 10:35:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv6406/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java CommonConsole.java ConsolePanel.java DashboardProperties.java RegistryPanel.java Added Files: BuildDataTypeTree.java RegistrationPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard BuildDataTypeTree.java,NONE,1.1 RegistrationPanel.java,NONE,1.1 AbstractPanel.java,1.7,1.8 CommonConsole.java,1.1,1.2 ConsolePanel.java,1.4,1.5 DashboardProperties.java,1.4,1.5 RegistryPanel.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/12 11:17:59 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/22 14:35:46 1.8 @@ -48,6 +48,8 @@ import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.event.ItemListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -90,6 +92,7 @@ protected JComponent pComponent; protected static Icon confirmIcon; protected static Icon warningIcon; + protected static Icon clearIcon; // re-use "style" components protected static final Insets BREATH_TOP = new Insets (10,0,0,0); @@ -322,10 +325,84 @@ }; } + /********************************************************************* + * + ********************************************************************/ + protected JPanel createCustomTextArea (String title, + String initValue, + String preferenceKey, + String eventName) { + JPanel p = new JPanel (new GridBagLayout()); + + // main label + JLabel label = new JLabel (title); + + // text area + final JTextArea area = new JTextArea(); + area.setEditable (true); + if (initValue == null) + area.setText (preferenceKey == null ? "" : getPrefValue (preferenceKey, "")); + else + area.setText (initValue); + area.setCaretPosition (0); + + if (eventName != null) { + final String eName = eventName; + if (preferenceKey == null) { + area.addFocusListener (new FocusListener() { + public void focusGained (FocusEvent e) {} + public void focusLost (FocusEvent e) { + String contents = ((JTextArea)e.getSource()).getText(); + propertyChannel.put (eName, contents); + } + }); + } else { + final String pKey = preferenceKey; + area.addFocusListener (new FocusListener() { + public void focusGained (FocusEvent e) {} + public void focusLost (FocusEvent e) { + String contents = ((JTextArea)e.getSource()).getText(); + propertyChannel.put (eName, contents); + setPrefValue (pKey, contents); + } + }); + } + // propagate also the initial value (unless it is empty) + String text = area.getText(); + if (UUtils.notEmpty (text)) + propertyChannel.put (eventName, text); + } + + // reset/clear button + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + JButton clearButton = new JButton (clearIcon); + clearButton.setFocusPainted (false); + clearButton.setMargin (new Insets (0,0,0,0)); + clearButton.setContentAreaFilled (false); + clearButton.setToolTipText ("Clear text area"); + clearButton.addActionListener (new ActionListener() { + public void actionPerformed (ActionEvent e) { + area.setText (""); + } + }); + + // put it together + SwingUtils.addComponent (p, label, 0, 0, 1, 1, NONE, NWEST, 0.0, 0.0); + SwingUtils.addComponent (p, clearButton, 1, 0, 1, 1, NONE, NEAST, 0.0, 0.0); + SwingUtils.addComponent (p, new JScrollPane (area), 0, 1, 2, 1, BOTH, NWEST, 1.0, 1.0); + return p; + } /********************************************************************* * ********************************************************************/ + protected String getPrefValue (String key, + String defaultValue) { + Preferences node = PrefsUtils.getNode (this.getClass()); + return node.get (key, defaultValue); + } + protected boolean getPrefValue (String key, boolean defaultValue) { Preferences node = PrefsUtils.getNode (this.getClass()); @@ -336,6 +413,12 @@ * ********************************************************************/ protected void setPrefValue (String key, + String value) { + Preferences node = PrefsUtils.getNode (this.getClass()); + node.put (key, value); + } + + protected void setPrefValue (String key, boolean value) { Preferences node = PrefsUtils.getNode (this.getClass()); node.putBoolean (key, value); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/09/24 17:51:51 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/10/22 14:35:46 1.2 @@ -15,6 +15,7 @@ import javax.swing.JTextArea; import javax.swing.JCheckBox; import javax.swing.JPanel; +import javax.swing.Icon; import java.awt.Font; import java.awt.GridBagLayout; @@ -40,6 +41,7 @@ JTextArea textArea; JCheckBox appendModeBox; boolean appendMode = true; + static Icon clearIcon; /********************************************************************* * Constructor. @@ -64,6 +66,10 @@ } }); + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + cleanButton.setIcon (clearIcon); + appendModeBox = AbstractPanel.createCheckBox ("append mode", appendMode, KeyEvent.VK_A, new ItemListener() { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/24 17:51:51 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/10/22 14:35:46 1.5 @@ -115,4 +115,13 @@ return "Debugging Console"; } + /************************************************************************** + * + **************************************************************************/ + public Icon getIcon() { + if (panelIcon == null) + panelIcon = SwingUtils.createIcon ("images/console.gif", this); + return panelIcon; + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/22 01:38:04 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/22 14:35:46 1.5 @@ -34,11 +34,18 @@ static final String DP_DATATYPE_NAME = "dp-datatype-name"; // names of properties used in property channel storage + static final String DP_REGISTRY_MODEL = "dp-registry-model"; + static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; static final String DP_CACHE_DIR = "dp-cache-dir"; static final String DP_USE_CACHE = "dp-use-cache"; + static final String DP_REG_DT_NAME = "dp-reg-dt-name"; + static final String DP_REG_DT_AUTH = "dp-reg-dt-auth"; + static final String DP_REG_DT_EMAIL = "dp-reg-dt-email"; + static final String DP_REG_DT_DESC = "dp-reg-dt-desc"; + /** A filename containing Java properties that configure the dashboard. */ static final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 01:38:04 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 14:35:46 1.11 @@ -1,6 +1,6 @@ // RegistryPanel.java // -// Created: September 2005 +// Created: September 2005 // // This file is a component of the BioMoby project. // Copyright Martin Senger (martin.senger at gmail.com). @@ -61,8 +61,6 @@ * what Biomoby registry to work with, and what cache directory to * use.

    * - * WORK IN PROGRESS.

    - * * @author Martin Senger * @version $Id$ */ @@ -87,22 +85,17 @@ * propertyChange() ********************************************************************/ public void propertyChange (PropertyChangeEvent e) { - String prop = e.getPropertyName(); - String newVal = (String)e.getNewValue(); - if (newVal == null) return; // no interest in non-defined new values - if (prop == null) return; // no interest in non-specific changes -// else if (prop.equalsIgnoreCase (PROP_MODE)) setMode (checkAndGetOperMode (newVal)); -// else if (prop.equalsIgnoreCase (PROP_BEAN_VISIBLE)) setBeanVisible (BBConfig.getBoolFromString (newVal)); -// else if (prop.equalsIgnoreCase (PROP_LISTEN_TO)) setListenTo (newVal); -// else if (prop.equalsIgnoreCase (PROP_DATA_IDENTITY)) setDataIdentity (newVal); +// String prop = e.getPropertyName(); +// String newVal = (String)e.getNewValue(); +// if (newVal == null) return; // no interest in non-defined new values +// if (prop == null) return; // no interest in non-specific changes } /********************************************************************* - * Default constructor + * Default constructor. ********************************************************************/ public RegistryPanel() { super(); - registryModel = new RegistryModel (support); } /************************************************************************** @@ -110,7 +103,15 @@ **************************************************************************/ public JComponent getComponent (PropertyChannel propertyChannel) { setPropertyChannel (propertyChannel); - registryModel.setPropertyChannel (propertyChannel); + synchronized (propertyChannel) { + if (propertyChannel.containsKey (DP_REGISTRY_MODEL)) { + registryModel = (RegistryModel)propertyChannel.get (DP_REGISTRY_MODEL); + } else { + registryModel = new RegistryModel (support); + propertyChannel.put (DP_REGISTRY_MODEL, registryModel); + } + registryModel.setPropertyChannel (propertyChannel); + } if (pComponent != null) return pComponent; @@ -339,7 +340,7 @@ **************************************************************************/ public Icon getIcon() { if (panelIcon == null) - panelIcon = SwingUtils.createIcon ("images/registry.gif", this); + panelIcon = SwingUtils.createIcon ("images/registry.gif", this); return panelIcon; } From senger at pub.open-bio.org Sun Oct 23 15:00:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 23 Oct 2005 15:00:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510231900.j9NJ0OUR020952@pub.open-bio.org> senger Sun Oct 23 15:00:24 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv20917/src/main/org/biomoby/service/dashboard Modified Files: BuildDataTypeTree.java CommonTree.java DataTypesBoard.java DataTypesTree.java RegistrationPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard BuildDataTypeTree.java,1.1,1.2 CommonTree.java,1.4,1.5 DataTypesBoard.java,1.1,1.2 DataTypesTree.java,1.2,1.3 RegistrationPanel.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/22 14:35:46 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/23 19:00:24 1.2 @@ -78,6 +78,8 @@ // enable tool tips ToolTipManager.sharedInstance().registerComponent (this); + +// expand(); } // @@ -125,4 +127,20 @@ protected void selected (DefaultMutableTreeNode node) { } + /********************************************************************* + * Expand all nodes. + ********************************************************************/ + protected void expand() { + final SwingWorker worker = new SwingWorker() { + public Object construct() { + SwingUtils.expandTree (BuildDataTypeTree.this, (DefaultMutableTreeNode)getModel().getRoot()); + return null; // not used here + } + // runs on the event-dispatching thread. + public void finished() { + repaint(); + } + }; + worker.start(); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/22 01:38:04 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/23 19:00:24 1.5 @@ -18,6 +18,7 @@ import javax.swing.JPopupMenu; import javax.swing.JOptionPane; import javax.swing.JMenuItem; +import javax.swing.JSeparator; import javax.swing.ToolTipManager; import javax.swing.AbstractAction; import javax.swing.tree.DefaultMutableTreeNode; @@ -53,7 +54,11 @@ public class CommonTree extends JTree { - final static String RELOAD = "Reload"; + // action commands for popup menu items + protected final static String AC_SEARCH = "ac-search"; + protected final static String AC_EXPAND = "ac-expand"; + protected final static String AC_COLLAPSE = "ac-collapse"; + protected final static String AC_RELOAD = "ac-reload"; // some shared constants final static protected int SORTED_BY_NAME = 0; @@ -61,9 +66,15 @@ // tree components protected JPopupMenu popup; - protected Icon searchIcon; protected String lastSearchText = ""; + // shared icons + static protected Icon searchIcon; + static protected Icon menuSearchIcon, menuSearchIconDis; + static protected Icon menuExpandIcon, menuExpandIconDis; + static protected Icon menuCollapseIcon, menuCollapseIconDis; + static protected Icon menuReloadIcon, menuReloadIconDis; + // protected PropertyChangeSupport support; // protected boolean expanded = true; // the status of the application list @@ -104,6 +115,9 @@ // enable tool tips ToolTipManager.sharedInstance().registerComponent (this); + + // load menu icons + loadIcons(); } // @@ -180,6 +194,39 @@ } /********************************************************************* + * Load all menu icons. + ********************************************************************/ + protected void loadIcons() { + if (menuSearchIcon == null) + menuSearchIcon = + SwingUtils.createIcon ("images/smallSearch.gif", Dashboard.class); + if (menuSearchIconDis == null) + menuSearchIconDis = + SwingUtils.createIcon ("images/smallSearchDis.gif", Dashboard.class); + + if (menuExpandIcon == null) + menuExpandIcon = + SwingUtils.createIcon ("images/smallExpand.gif", Dashboard.class); + if (menuExpandIconDis == null) + menuExpandIconDis = + SwingUtils.createIcon ("images/smallExpandDis.gif", Dashboard.class); + + if (menuCollapseIcon == null) + menuCollapseIcon = + SwingUtils.createIcon ("images/smallCollapse.gif", Dashboard.class); + if (menuCollapseIconDis == null) + menuCollapseIconDis = + SwingUtils.createIcon ("images/smallCollapseDis.gif", Dashboard.class); + + if (menuReloadIcon == null) + menuReloadIcon = + SwingUtils.createIcon ("images/smallReload.gif", Dashboard.class); + if (menuReloadIconDis == null) + menuReloadIconDis = + SwingUtils.createIcon ("images/smallReloadDis.gif", Dashboard.class); + } + + /********************************************************************* * Create a popup object with common items. Subclasses can (and * usually do) add more items, or re-created the whole popup.

    * @@ -188,35 +235,35 @@ protected void createPopups (String title) { popup = new JPopupMenu (title); popup.add - (new JMenuItem (new AbstractAction ("Search") { + (createMenuItem (new AbstractAction ("Search") { public void actionPerformed (ActionEvent e) { String searchText = searchDialog(); if (searchText != null) search (searchText); } - })); + }, AC_SEARCH, menuSearchIcon, menuSearchIconDis)); popup.add - (new JMenuItem (new AbstractAction ("Expand all nodes") { + (createMenuItem (new AbstractAction ("Expand all nodes") { public void actionPerformed (ActionEvent e) { expand(); } - })); + }, AC_EXPAND, menuExpandIcon, menuExpandIconDis)); popup.add - (new JMenuItem (new AbstractAction ("Collapse all nodes") { + (createMenuItem (new AbstractAction ("Collapse all nodes") { public void actionPerformed (ActionEvent e) { collapse(); } - })); + }, AC_COLLAPSE, menuCollapseIcon, menuCollapseIconDis)); popup.addSeparator(); popup.add - (new JMenuItem (new AbstractAction (RELOAD) { + (createMenuItem (new AbstractAction ("Reload") { public void actionPerformed (ActionEvent e) { reload(); } - })); + }, AC_RELOAD, menuReloadIcon, menuReloadIconDis)); // add listener to this tree to bring up popup menus MouseListener popupListener = new PopupListener(); @@ -239,6 +286,29 @@ } /********************************************************************* + * Create a menu item. + ********************************************************************/ + protected JMenuItem createMenuItem (AbstractAction action, + String actionCommand) { + JMenuItem mi = new JMenuItem (action); + mi.setActionCommand (actionCommand); + return mi; + } + + /********************************************************************* + * Create a menu item. + ********************************************************************/ + protected JMenuItem createMenuItem (AbstractAction action, + String actionCommand, + Icon icon, + Icon disabledIcon) { + JMenuItem mi = createMenuItem (action, actionCommand); + mi.setIcon (icon); + mi.setDisabledIcon (disabledIcon); + return mi; + } + + /********************************************************************* * Enable/disable the whole popup except the 'Reload' option (that * one remains enabled always). ********************************************************************/ @@ -247,7 +317,7 @@ Component[] components = popup.getComponents(); for (int i = 0; i < components.length; i++) { if ( components[i] instanceof JMenuItem && - ! ((JMenuItem)components[i]).getText().equals (RELOAD) ) + ! AC_RELOAD.equals (((JMenuItem)components[i]).getActionCommand()) ) ((JMenuItem)components[i]).setEnabled (enabled); } } @@ -347,4 +417,37 @@ AbstractPanel.error (prologue, e); } + /********************************************************************* + * Remove a menu item (given by an action command string) from a + * popup menu. + ********************************************************************/ + protected void removeFromPopups (String actionCommand) { + if (popup == null) return; + Component[] components = popup.getComponents(); + for (int i = 0; i < components.length; i++) { + if ( components[i] instanceof JMenuItem && + actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ) { + popup.remove (components[i]); + return; + } + } + } + + /********************************************************************* + * Remove a menu separator (that is after menu item given by an + * action command string) from a popup menu. + ********************************************************************/ + protected void removeSeparatorAfter (String actionCommand) { + if (popup == null) return; + Component[] components = popup.getComponents(); + boolean found = false; + for (int i = 0; i < components.length; i++) { + if ( components[i] instanceof JSeparator && found) { + popup.remove (components[i]); + return; + } + found = ( components[i] instanceof JMenuItem && + actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ); + } + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/22 01:38:04 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/23 19:00:24 1.2 @@ -40,8 +40,16 @@ public DataTypesBoard (RegistryModel model, CommonConsole console, PropertyChangeSupport support) { + this (model, console, support, + new DataTypesTree (model, console)); + } + + public DataTypesBoard (RegistryModel model, + CommonConsole console, + PropertyChangeSupport support, + CommonTree customTree) { super (model, support); - tree = new DataTypesTree (model, console); + tree = customTree; createItself(); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/22 01:38:04 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/23 19:00:24 1.3 @@ -42,6 +42,12 @@ public class DataTypesTree extends CommonTree { + // action commands for popup menu items + protected final static String AC_NSORT = "ac-nsort"; + protected final static String AC_ASORT = "ac-asort"; + protected final static String AC_HASA = "ac-hasa"; + protected final static String AC_DEPR = "ac-depr"; + // remembered from constructor RegistryModel registryModel; CommonConsole console; @@ -79,22 +85,23 @@ super.createPopups (title); popup.addSeparator(); popup.add - (new JMenuItem (new AbstractAction ("Sort by names") { + (createMenuItem (new AbstractAction ("Sort by names") { public void actionPerformed (ActionEvent e) { update (lastSorted = SORTED_BY_NAME); deprecatedBox.setEnabled (true); } - })); + }, AC_NSORT)); popup.add - (new JMenuItem (new AbstractAction ("Sort by authorities") { + (createMenuItem (new AbstractAction ("Sort by authorities") { public void actionPerformed (ActionEvent e) { update (lastSorted = SORTED_BY_AUTHORITY); deprecatedBox.setEnabled (false); } - })); + }, AC_ASORT)); popup.addSeparator(); JCheckBoxMenuItem showBox = new JCheckBoxMenuItem ("Show HAS/HASA members"); + showBox.setActionCommand (AC_HASA); showBox.addItemListener (new ItemListener() { public void itemStateChanged (ItemEvent e) { showMembers = (e.getStateChange() == ItemEvent.SELECTED); @@ -104,6 +111,7 @@ popup.add (showBox); deprecatedBox = new JCheckBoxMenuItem ("Show deprecated objects"); + deprecatedBox.setActionCommand (AC_DEPR); deprecatedBox.addItemListener (new ItemListener() { public void itemStateChanged (ItemEvent e) { showBadGuys = (e.getStateChange() == ItemEvent.SELECTED); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/22 14:35:46 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/23 19:00:24 1.2 @@ -68,27 +68,16 @@ public class RegistrationPanel extends AbstractPanel { - // names of user preferences keys -// static final String USE_CACHE = "use-cache"; - // associated model working behind the scenes RegistryModel registryModel; // components that are used from more methods -// JTextFieldWithHistory dtName; -// JTextFieldWithHistory dtAuth; -// JTextFieldWithHistory dtEmail; - CommonConsole console; /********************************************************************* * propertyChange() ********************************************************************/ public void propertyChange (PropertyChangeEvent e) { -// String prop = e.getPropertyName(); -// String newVal = (String)e.getNewValue(); -// if (newVal == null) return; // no interest in non-defined new values -// if (prop == null) return; // no interest in non-specific changes } /********************************************************************* @@ -169,9 +158,11 @@ SwingUtils.addComponent (defs, dtDesc, 0, 6, 1, 1, BOTH, NWEST, 1.0, 1.0, BREATH_TOP); // a tree with all already existing data types - DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, - console, - support); + DataTypesBoard dataTypesBoard = + new DataTypesBoard (registryModel, + console, + support, + new CustomDataTypesTree (registryModel, console)); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); // a tree with a new data type && registration button @@ -261,4 +252,51 @@ return panelIcon; } + /************************************************************************** + * Customized tree of data types - has different popup menus... + **************************************************************************/ + protected class CustomDataTypesTree + extends DataTypesTree { + + // action commands for popup menu items + protected final static String AC_PARENT = "ac-parent"; + protected final static String AC_MHASA = "ac-m-hasa"; + protected final static String AC_MHAS = "ac-m-has"; + + public CustomDataTypesTree (RegistryModel model, + CommonConsole console) { + super (model, console); + } + + /********************************************************************* + * + ********************************************************************/ + protected void createPopups (String title) { + super.createPopups (title); + removeFromPopups (AC_RELOAD); + removeFromPopups (AC_HASA); + removeFromPopups (AC_DEPR); + removeSeparatorAfter (AC_COLLAPSE); + + popup.add + (createMenuItem (new AbstractAction ("Add selected as a parent type (ISA)") { + public void actionPerformed (ActionEvent e) { + } + }, AC_PARENT)); + + popup.add + (createMenuItem (new AbstractAction ("Add selected as a member (HASA)") { + public void actionPerformed (ActionEvent e) { + } + }, AC_MHASA)); + + popup.add + (createMenuItem (new AbstractAction ("Add selected as a list of members (HAS)") { + public void actionPerformed (ActionEvent e) { + } + }, AC_MHAS)); + + } + } + } From senger at pub.open-bio.org Sun Oct 23 15:00:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 23 Oct 2005 15:00:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510231900.j9NJ0OTM020967@pub.open-bio.org> senger Sun Oct 23 15:00:24 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv20917/src/main/org/biomoby/service/dashboard/images Added Files: smallClear_dis.gif smallCollapse.gif smallCollapse_dis.gif smallExpand.gif smallExpand_dis.gif smallReload.gif smallReload_dis.gif smallSearch.gif smallSearch_dis.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images smallClear_dis.gif,NONE,1.1 smallCollapse.gif,NONE,1.1 smallCollapse_dis.gif,NONE,1.1 smallExpand.gif,NONE,1.1 smallExpand_dis.gif,NONE,1.1 smallReload.gif,NONE,1.1 smallReload_dis.gif,NONE,1.1 smallSearch.gif,NONE,1.1 smallSearch_dis.gif,NONE,1.1 From senger at pub.open-bio.org Sun Oct 23 20:34:49 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 23 Oct 2005 20:34:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510240034.j9O0Ynb2021836@pub.open-bio.org> senger Sun Oct 23 20:34:49 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv21813/src/main/org/biomoby/service/dashboard Modified Files: Dashboard.java NOTES Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard Dashboard.java,1.5,1.6 NOTES,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/22 01:38:04 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/24 00:34:49 1.6 @@ -126,6 +126,7 @@ public void show() { JFrame frame = SwingUtils.createMainFrame (getComponent (propertyChannel), getName()); + addMenuBar (frame); SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); } @@ -280,6 +281,12 @@ } /************************************************************************** + * Create and add a menu bar to the given frame. + **************************************************************************/ + protected void addMenuBar (JFrame frame) { + } + + /************************************************************************** * Dashboard is listening to the changes of panels in order to * repaint the header with a label of a currently selected panel. **************************************************************************/ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/12 11:17:59 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/24 00:34:49 1.9 @@ -126,7 +126,7 @@ TODO generally: --------------- -* notice that the dasboard is used the first time and offer ti create +* notice that the dasboard is used the first time and offer to create a list of wanted panels (some of them are suggested as default) * notice that user does not use cache (and that he did not select "do From carrere at pub.open-bio.org Mon Oct 24 04:57:34 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Mon, 24 Oct 2005 04:57:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510240857.j9O8vYJR023144@pub.open-bio.org> carrere Mon Oct 24 04:57:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23118 Modified Files: MOBYXSLT.pm Log Message: Bad parameters initializations. Lot of warnings removed. moby-live/Perl/MOBY MOBYXSLT.pm,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/10/21 13:22:18 1.2 +++ /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/10/24 08:57:34 1.3 @@ -735,19 +735,36 @@ my @a_crossref = (); my @a_hasa = (); + my ($object_type,$object_name,$object_id,$object_namespace) = ('','','',''); my $object_type_tag = '#XSL_LIPM_MOBYPARSER_OBJECTTYPE#'; - my ($object_type) = ($simple_bloc =~ /$object_type_tag(\S+)$object_type_tag/); - $object_type =~ s/^moby://i; + + if ($simple_bloc =~ /$object_type_tag(\S+)$object_type_tag/) + { + $object_type = $1; + $object_type =~ s/^moby://i; + } my $object_namespace_tag = '#XSL_LIPM_MOBYPARSER_OBJECTNAMESPACE#'; - my ($object_namespace) = ($simple_bloc =~ /$object_namespace_tag(\S+)$object_namespace_tag/); - + + if ($simple_bloc =~ /$object_namespace_tag(\S+)$object_namespace_tag/) + { + $object_namespace = $1; + } + my $object_id_tag = '#XSL_LIPM_MOBYPARSER_OBJECTID#'; - my ($object_id) = ($simple_bloc =~ /$object_id_tag(\S+)$object_id_tag/); - + + if ($simple_bloc =~ /$object_id_tag(\S+)$object_id_tag/) + { + $object_id = $1; + } + my $object_name_tag = '#XSL_LIPM_MOBYPARSER_OBJECTNAME#'; - my ($object_name) = ($simple_bloc =~ /$object_name_tag(\S+)$object_name_tag/); + if ($simple_bloc =~ /$object_name_tag(\S+)$object_name_tag/) + { + $object_name = $1 + } + my $crossref_start_tag = '#XSL_LIPM_MOBYPARSER_CROSSREF_START#'; my $crossref_end_tag = '#XSL_LIPM_MOBYPARSER_CROSSREF_END#'; my $crossref_sep_tag = '#XSL_LIPM_MOBYPARSER_CROSSREF_SEP#'; @@ -765,7 +782,8 @@ } my $object_content_tag = '#XSL_LIPM_MOBYPARSER_OBJECTCONTENT#'; - my ($before, $object_content, $after) = split($object_content_tag, $simple_bloc); + my ($before, $object_content, $after) = ('','',''); + ($before, $object_content, $after) = split($object_content_tag, $simple_bloc); my $object_hasa_start_tag = '#XSL_LIPM_MOBYPARSER_OBJECTHASA_START#'; From carrere at pub.open-bio.org Mon Oct 24 07:47:03 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Mon, 24 Oct 2005 07:47:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510241147.j9OBl3Jv023529@pub.open-bio.org> carrere Mon Oct 24 07:47:03 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/xsl In directory pub.open-bio.org:/tmp/cvs-serv23503 Modified Files: parseMobyMessage.xsl Log Message: Template Parameter modification to allow articleName or moby:articleName as an attribute moby-live/Perl/MOBY/xsl parseMobyMessage.xsl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/xsl/parseMobyMessage.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/xsl/parseMobyMessage.xsl 2005/09/08 13:46:45 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/xsl/parseMobyMessage.xsl 2005/10/24 11:47:03 1.2 @@ -114,8 +114,18 @@ --> + + + + #XSL_LIPM_MOBYPARSER_SECONDARY_START# - + + + + + + + #XSL_LIPM_MOBYPARSER_SECONDARY_SEP# #XSL_LIPM_MOBYPARSER_SECONDARY_END# From fgibbons at pub.open-bio.org Mon Oct 24 13:31:57 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Mon, 24 Oct 2005 13:31:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510241731.j9OHVvGc024289@pub.open-bio.org> fgibbons Mon Oct 24 13:31:57 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv24264 Modified Files: XMLPayloads.html Log Message: - Explain the situation regarding deregisterService. moby-live/Docs/MOBY-S_API XMLPayloads.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/09/28 22:05:58 1.3 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/10/24 17:31:57 1.4 @@ -651,5 +651,35 @@

    -deregisterService

    -This method has now been deprecated. \ No newline at end of file +deregisterService + +It is intended that this method will ultimately be deprecated. A +requirement for this to happen is the completed transition from a +function-call based registration process to an RDF-document-based +registration. For the time being, it remains in use. + +Under the current function-call based procedure, a +service is registered by modifying the contents of the MOBY Central +database, by means of a function call from the MOBY API (i.e., +registerService). The service remains registered until +the function deregisterService is called. This method has +some shortcomings, mostly to do with security. + +It is proposed (see email archives for details), that a better way of +doing things would be to continue to allow registration by means of a +function call. A key change is that the function would return an RDF +document describing the service. The document would be placed at a +pre-specified location on the web, and an RDF-reading agent would +periodically check on the service's continued existence (the agent +might visit hourly or weekly, depending on who you +ask). Deregistration of the service would be a simple matter of +removing the RDF document. On the agent's next visit, it would notice +that the document had disappeared, and remove it from MOBY Central's +registry. + +Currently, it is possible to register a service under both schemes (to +use the new scheme, simply provide a "signatureURL" +parameter). However, there is currently no agent, therefore +services registered under the new scheme will remain registered +indefinitely. It is explicitly not allowed to deregister +services which were registered using a signatureURL. From senger at pub.open-bio.org Tue Oct 25 05:02:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 25 Oct 2005 05:02:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510250902.j9P928TF026810@pub.open-bio.org> senger Tue Oct 25 05:02:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv26713/src/main/org/biomoby/shared Modified Files: MobyDataType.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyDataType.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/24 17:51:52 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/10/25 09:02:08 1.10 @@ -26,6 +26,12 @@ public class MobyDataType implements Comparable { + /** + * A dummy name used for MobyDataType instances that do not have + * (yet) a real name. + */ + static public final String DUMMY_NAME = "_dummy_"; + public int compareTo (Object obj) { return name.compareToIgnoreCase ( ((MobyDataType)obj).getName() ); } @@ -46,7 +52,7 @@ * Default constructor. *************************************************************************/ public MobyDataType() { - this ("_dummy_"); + this (DUMMY_NAME); } /************************************************************************** From senger at pub.open-bio.org Tue Oct 25 05:02:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 25 Oct 2005 05:02:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510250902.j9P9287Q026791@pub.open-bio.org> senger Tue Oct 25 05:02:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26713/src/main/org/biomoby/service/dashboard/images Modified Files: smallReload.gif Added Files: emptyButton.gif renameButton.gif smallAddHAS.gif smallAddHASA.gif smallAddHASA_dis.gif smallAddHAS_dis.gif smallAddISA.gif smallAddISA_dis.gif smallRefresh.gif smallRefresh_dis.gif smallRemove.gif smallRemove_dis.gif smallRename.gif smallRename_dis.gif smallWarning.gif smallWarning_dis.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images emptyButton.gif,NONE,1.1 renameButton.gif,NONE,1.1 smallAddHAS.gif,NONE,1.1 smallAddHASA.gif,NONE,1.1 smallAddHASA_dis.gif,NONE,1.1 smallAddHAS_dis.gif,NONE,1.1 smallAddISA.gif,NONE,1.1 smallAddISA_dis.gif,NONE,1.1 smallRefresh.gif,NONE,1.1 smallRefresh_dis.gif,NONE,1.1 smallRemove.gif,NONE,1.1 smallRemove_dis.gif,NONE,1.1 smallRename.gif,NONE,1.1 smallRename_dis.gif,NONE,1.1 smallWarning.gif,NONE,1.1 smallWarning_dis.gif,NONE,1.1 smallReload.gif,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif 2005/10/23 19:00:24 1.1 and /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif 2005/10/25 09:02:08 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif: diff failed From senger at pub.open-bio.org Wed Oct 26 04:05:19 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 26 Oct 2005 04:05:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510260805.j9Q85JgF030263@pub.open-bio.org> senger Wed Oct 26 04:05:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv30201/src/main/org/biomoby/service/dashboard/images Added Files: smallUnregister.gif smallUnregister_dis.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images smallUnregister.gif,NONE,1.1 smallUnregister_dis.gif,NONE,1.1 From senger at pub.open-bio.org Wed Oct 26 04:05:19 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 26 Oct 2005 04:05:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510260805.j9Q85J0j030248@pub.open-bio.org> senger Wed Oct 26 04:05:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv30201/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java BuildDataTypeTree.java CommonConsole.java CommonTree.java DashboardProperties.java NOTES RegistrationPanel.java RegistryModel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,1.9,1.10 BuildDataTypeTree.java,1.3,1.4 CommonConsole.java,1.2,1.3 CommonTree.java,1.6,1.7 DashboardProperties.java,1.6,1.7 NOTES,1.10,1.11 RegistrationPanel.java,1.3,1.4 RegistryModel.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/25 09:02:07 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/26 08:05:18 1.10 @@ -90,6 +90,8 @@ // something need to be done only once - keep it here protected Icon panelIcon; protected JComponent pComponent; + + // shared icons protected static Icon confirmIcon; protected static Icon warningIcon; protected static Icon clearIcon; @@ -108,6 +110,7 @@ ********************************************************************/ protected AbstractPanel() { support = new PropertyChangeSupport (this); + loadIcons(); } /************************************************************************** @@ -178,6 +181,22 @@ abstract public String getName(); // + // Few other methods + // + + /********************************************************************* + * Load all menu icons. + ********************************************************************/ + protected void loadIcons() { + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + if (warningIcon == null) + warningIcon = SwingUtils.createIcon ("images/warningButton.gif", this); + if (confirmIcon == null) + confirmIcon = SwingUtils.createIcon ("images/confirmButton.gif", this); + } + + // // Methods to be used by sub-classes // @@ -375,8 +394,6 @@ } // reset/clear button - if (clearIcon == null) - clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); JButton clearButton = new JButton (clearIcon); clearButton.setFocusPainted (false); clearButton.setMargin (new Insets (0,0,0,0)); @@ -401,7 +418,7 @@ protected String getPrefValue (String key, String defaultValue) { Preferences node = PrefsUtils.getNode (this.getClass()); - return node.get (key, defaultValue); + return showNewlines (node.get (key, defaultValue)); } protected boolean getPrefValue (String key, @@ -416,7 +433,7 @@ protected void setPrefValue (String key, String value) { Preferences node = PrefsUtils.getNode (this.getClass()); - node.put (key, value); + node.put (key, hideNewlines (value)); } protected void setPrefValue (String key, @@ -426,12 +443,26 @@ } /********************************************************************* + * Sorry for this hack, but I do not know better... + * + * Problem is that attribute values (preferences) ignore + * newlines. I wanted to replace them with something like ' ' + * but this did not work because the ampersand was escape (as it + * should) to '&'. So I have to "invent" my own escaping by + * introducing MRVAJS. + ********************************************************************/ + static final private String MRVAJS = "#MRVAJS#"; + private static String hideNewlines (String value) { + return value.replaceAll ("\n", MRVAJS); + } + private static String showNewlines (String value) { + return value.replaceAll (MRVAJS, "\n"); + } + + /********************************************************************* * Return true if confirmation dialog passed. ********************************************************************/ public static boolean confirm (Object msg) { - if (confirmIcon == null) - confirmIcon = - SwingUtils.createIcon ("images/confirmButton.gif", Dashboard.class); return SwingUtils.confirm (null, msg, confirmIcon); } @@ -439,9 +470,6 @@ * Display an error message. ********************************************************************/ public static void error (Object msg) { - if (warningIcon == null) - warningIcon = SwingUtils.createIcon ("images/warningButton.gif", - Dashboard.class); JOptionPane.showMessageDialog (null, msg, "Error message", JOptionPane.PLAIN_MESSAGE, warningIcon); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/25 09:02:07 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/26 08:05:18 1.4 @@ -117,25 +117,6 @@ getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); - - -// setEditable (true); -// DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) tree -// .getCellRenderer(); -// TreeCellEditor editor = new LeafCellEditor(tree, renderer); -// tree.setCellEditor(editor); - - -// // listen for when the selection changes -// addTreeSelectionListener ( new TreeSelectionListener() { -// public void valueChanged (TreeSelectionEvent e) { -// DefaultMutableTreeNode node = -// (DefaultMutableTreeNode)getLastSelectedPathComponent(); -// if (node == null) return; -// selected (node); -// } -// }); - // enable tool tips ToolTipManager.sharedInstance().registerComponent (this); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/10/22 14:35:46 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/10/26 08:05:18 1.3 @@ -40,14 +40,18 @@ // components JTextArea textArea; JCheckBox appendModeBox; + JButton cleanButton; boolean appendMode = true; - static Icon clearIcon; + + // shared icons + static Icon clearIcon, clearIconDis; /********************************************************************* * Constructor. ********************************************************************/ public CommonConsole() { super(); + loadIcons(); setLayout (new GridBagLayout()); textArea = new JTextArea(); @@ -55,20 +59,22 @@ textArea.setEditable (false); JScrollPane scroller = new JScrollPane (textArea); - JButton cleanButton = AbstractPanel.createButton + cleanButton = AbstractPanel.createButton (" Clean ", "Remove all messages from the console area", KeyEvent.VK_C, new ActionListener() { public void actionPerformed (ActionEvent e) { - if (! "".equals (textArea.getText()) && AbstractPanel.confirm ("Remove all messages?")) + if (! "".equals (textArea.getText()) && AbstractPanel.confirm ("Remove all messages?")) { textArea.setText (""); + cleanButton.setEnabled (false); + } } }); - if (clearIcon == null) - clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); cleanButton.setIcon (clearIcon); + cleanButton.setDisabledIcon (clearIconDis); + cleanButton.setEnabled (false); appendModeBox = AbstractPanel.createCheckBox ("append mode", appendMode, KeyEvent.VK_A, @@ -99,6 +105,7 @@ textArea.append (value); else textArea.setText (value); + cleanButton.setEnabled (true); } /********************************************************************* @@ -116,4 +123,14 @@ return appendMode; } + /********************************************************************* + * Load all menu icons. + ********************************************************************/ + protected void loadIcons() { + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + if (clearIconDis == null) + clearIconDis = SwingUtils.createIcon ("images/smallClear_dis.gif", this); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/25 09:02:07 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/26 08:05:18 1.7 @@ -28,6 +28,7 @@ import javax.swing.tree.TreePath; import javax.swing.event.TreeSelectionListener; import javax.swing.event.TreeSelectionEvent; +import javax.swing.SwingUtilities; import java.awt.Component; import java.awt.Font; @@ -39,11 +40,6 @@ import java.util.HashSet; import java.util.Enumeration; -// import java.beans.PropertyChangeListener; -// import java.beans.PropertyChangeEvent; -// import java.beans.PropertyChangeSupport; - - /** * A common JTree re-used (and always slightly modified) by all * Biomoby registry trees.

    @@ -75,9 +71,6 @@ static protected Icon menuCollapseIcon, menuCollapseIconDis; static protected Icon menuReloadIcon, menuReloadIconDis; -// protected PropertyChangeSupport support; -// protected boolean expanded = true; // the status of the application list - protected String rootNode; /********************************************************************* @@ -89,20 +82,11 @@ // create an almost empty tree, only with a root node that // contains just a String holding the name of the root node; -// setFont (new Font ("Dialog", Font.PLAIN, 10)); putClientProperty ("JTree.lineStyle", "Angled"); setCellRenderer (new CommonTreeCellRenderer()); getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); -// addMouseListener (new MouseAdapter() { -// public void mouseClicked (MouseEvent e) { -// TreePath selPath = getPathForLocation (e.getX(), e.getY()); -// if (e.getClickCount() == 1) -// onSelected (selPath); -// } -// }); - // listen for when the selection changes addTreeSelectionListener ( new TreeSelectionListener() { public void valueChanged (TreeSelectionEvent e) { @@ -178,7 +162,6 @@ return new JScrollPane (this); } - /********************************************************************* * Get data from a registry model and update the tree. Will be * overwritten by subclass. @@ -333,9 +316,6 @@ * Expand all nodes, starting from the root.

    ********************************************************************/ protected void expand() { -// SwingUtils.expandTree (this, (DefaultMutableTreeNode)getModel().getRoot()); - - final SwingWorker worker = new SwingWorker() { public Object construct() { SwingUtils.expandTree (CommonTree.this, (DefaultMutableTreeNode)getModel().getRoot()); @@ -347,7 +327,6 @@ } }; worker.start(); - } /********************************************************************* @@ -355,7 +334,6 @@ * concrete tree. ********************************************************************/ protected void reload() { - System.out.println ("Invoking a reload."); } /********************************************************************* @@ -364,7 +342,6 @@ * be overwritten by a concrete tree. ********************************************************************/ protected void search (String searchText) { - System.out.println ("Search text: " + searchText); } /********************************************************************* @@ -393,6 +370,9 @@ return result; } + /********************************************************************* + * + ********************************************************************/ protected void highlightAndJumpTo (HashSet toBeHighlighted) { CommonTreeCellRenderer r = (CommonTreeCellRenderer)getCellRenderer(); @@ -455,40 +435,16 @@ * popup menu. ********************************************************************/ protected void setEnabledPopupItem (String actionCommand, boolean enabled) { - synchronized (popup) { - Component[] components = popup.getComponents(); - for (int i = 0; i < components.length; i++) { - if ( components[i] instanceof JMenuItem && - actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ) { - ((JMenuItem)components[i]).setEnabled (enabled); - return; - } - } - } - -// final String ac = actionCommand; -// final boolean fEnabled = enabled; -// final SwingWorker worker = new SwingWorker() { -// public Object construct() { -// synchronized (popup) { -// Component[] components = popup.getComponents(); -// for (int i = 0; i < components.length; i++) { -// if ( components[i] instanceof JMenuItem && -// ac.equals (((JMenuItem)components[i]).getActionCommand()) ) { -// ((JMenuItem)components[i]).setEnabled (fEnabled); -// break; -// } -// } -// } -// return null; // not used here -// } -// // runs on the event-dispatching thread. -// public void finished() { -// repaint(); -// } -// }; -// worker.start(); + Component[] components = popup.getComponents(); + for (int i = 0; i < components.length; i++) { + if ( components[i] instanceof JMenuItem && + actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ) { + ((JMenuItem)components[i]).setEnabled (enabled); + return; + } + } } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/25 09:02:07 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/26 08:05:18 1.7 @@ -39,7 +39,7 @@ static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; static final String DP_CACHE_DIR = "dp-cache-dir"; - static final String DP_USE_CACHE = "dp-use-cache"; + static final String DP_USE_CACHE = "dp-use-cache"; // type: Boolean static final String DP_REG_DT_NAME = "dp-reg-dt-name"; static final String DP_REG_DT_AUTH = "dp-reg-dt-auth"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/25 09:02:07 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/26 08:05:18 1.11 @@ -1,109 +1,3 @@ -Setting colors: - -articleName.setForeground (new Color (0xffffdd)); - ------ - -invokeLater() -------------- -/** - * Create the GUI and show it. For thread safety, - * this method should be invoked from the - * event-dispatching thread. - */ -private static void createAndShowGUI() { - //Make sure we have nice window decorations. - JFrame.setDefaultLookAndFeelDecorated(true); - - //Create and set up the window. - frame = new JFrame("FocusConceptsDemo"); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - //Create and set up the content pane. - JComponent newContentPane = new FocusConceptsDemo(); - newContentPane.setOpaque(true); //content panes must be opaque - frame.setContentPane(newContentPane); - - //Display the window. - frame.pack(); - frame.setVisible(true); -} -public static void main(String[] args) { - //Schedule a job for the event-dispatching thread: - //creating and showing this application's GUI. - javax.swing.SwingUtilities.invokeLater(new Runnable() { - public void run() { - createAndShowGUI(); - } - }); - -invokeAndWait(): ----------------- -void printTextField() throws Exception { - final String[] myStrings = new String[2]; - - Runnable getTextFieldText = new Runnable() { - public void run() { - myStrings[0] = textField0.getText(); - myStrings[1] = textField1.getText(); - } - }; - SwingUtilities.invokeAndWait(getTextFieldText); - - System.out.println(myStrings[0] + " " + myStrings[1]); -} - -SwingWorker: ------------- - -//BETTER CODE: -public void actionPerformed(ActionEvent e) { - ... - final SwingWorker worker = new SwingWorker() { - public Object construct() { - //...code that might take a while to execute is here... - return someValue; - } - }; - worker.start(); //required for SwingWorker 3 - ... -} - -using finished: - -public void actionPerformed(ActionEvent e) { - ... - if (icon == null) { //haven't viewed this photo before - loadImage(imagedir + pic.filename, current); - } else { - updatePhotograph(current, pic); - } -} -... -//Load an image in a separate thread. -private void loadImage(final String imagePath, final int index) { - final SwingWorker worker = new SwingWorker() { - ImageIcon icon = null; - - public Object construct() { - icon = new ImageIcon(getURL(imagePath)); - return icon; //return value not used by this program - } - - //Runs on the event-dispatching thread. - public void finished() { - Photo pic = (Photo)pictures.elementAt(index); - pic.setIcon(icon); - if (index == current) - updatePhotograph(index, pic); - } - }; - worker.start(); -} - - ----- - ? logging (LogPanel and/or usual logging to a file?) * communication with StatusBar (incl. progress bar, cancel button) * disabling things during a long-time operation @@ -191,8 +85,7 @@ Registry panel -------------- -* model (worker: org.biomoby.shared.CentralAll, -CentralDigestCachedImpl.java ) +* finish all buttons Registration panel @@ -225,3 +118,32 @@ - Configure a new Dashboard - Debugging panel (with a Memory Panel embedded; replacing current two pannels) + +UNSOLVED (mysteries and not-yet-dones) +======== + +* RegistrationPanel -> Data type registration + + - at the beginning, the 'add...' menu item in the popup menu are not + disabled - but should be (I do not know why they are not) + + - the BuildDataTypeTree is sometimes damaged (after adding a member +node); not sure how to reproduce it + + ! loading... does not sync correctly with the browser panel + + ! more generally: simplify (or at least document) what kind of notifications + are used (now, it seems to be confusin what has PropertyChannel and what + is registered by 'support') + + ! finish all the caching stuff (separate scrap of paper) + +* After registration, update cache, update list +* The same, after de-registration +* Then make the reg/unreg real... + +* Icons: + - better icon for AddHAS (with a small star) + +* alltools2: + - JTextFieldWithHistory should remember also an empty value ("") =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/25 09:02:07 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/26 08:05:18 1.4 @@ -12,6 +12,7 @@ import org.biomoby.shared.Central; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyRelationship; +import org.biomoby.shared.parser.MobyTags; import org.biomoby.service.generator.DataTypesGenerator; import org.tulsoft.shared.UUtils; @@ -77,14 +78,25 @@ CommonConsole console; MobyException dtException; - - final static String DATA_TYPE_PROLOGUE = - "An error occured when trying to register a new data type.\n\n"; + MobyException dtUnregException; // shared icons protected static Icon menuAddISAIcon, menuAddISAIconDis; protected static Icon menuAddHASAIcon, menuAddHASAIconDis; protected static Icon menuAddHASIcon, menuAddHASIconDis; + protected static Icon menuUnregisterIcon, menuUnregisterIconDis; + + // some texts + final static String DATA_TYPE_PROLOGUE = + "An error occured when trying to register a new data type.\n\n"; + + final static String DATA_TYPE_UNREG_PROLOGUE = + "An error occured when trying to unregister a data type.\n\n"; + + final static String DATA_TYPE_INTRO = + "Create new data type by filling the form in the middle and adding" + + " parent and children types from the tree on the right. Adding is done" + + " by selecting first a data type, then right-click gives you menu."; /********************************************************************* * propertyChange() @@ -117,6 +129,10 @@ if (pComponent != null) return pComponent; + // console panel + console = new CommonConsole(); + console.setAppendMode (true); + pComponent = new JPanel (new GridBagLayout(), true); // sub-panels for registering various entities @@ -126,10 +142,6 @@ tabbedPane.addTab ("Service Type", getServiceTypeRegistration()); tabbedPane.addTab ("Service", getServiceRegistration()); - // console panel - console = new CommonConsole(); - console.setAppendMode (true); - // split the screen JSplitPane split = new JSplitPane (JSplitPane.VERTICAL_SPLIT, tabbedPane, @@ -340,6 +352,7 @@ protected final static String AC_PARENT = "ac-parent"; protected final static String AC_MHASA = "ac-m-hasa"; protected final static String AC_MHAS = "ac-m-has"; + protected final static String AC_UNREG = "ac-unreg"; /********************************************************************* * Construtor @@ -374,6 +387,13 @@ if (menuAddHASIconDis == null) menuAddHASIconDis = SwingUtils.createIcon ("images/smallAddHAS_dis.gif", Dashboard.class); + + if (menuUnregisterIcon == null) + menuUnregisterIcon = + SwingUtils.createIcon ("images/smallUnregister.gif", Dashboard.class); + if (menuUnregisterIconDis == null) + menuUnregisterIconDis = + SwingUtils.createIcon ("images/smallUnregister_dis.gif", Dashboard.class); } /********************************************************************* @@ -387,36 +407,49 @@ removeSeparatorAfter (AC_COLLAPSE); popup.add - (createMenuItem (new AbstractAction ("Add selected as a parent type - ISA") { + (createMenuItem (new AbstractAction ("Add selected as a parent type - ISA") { public void actionPerformed (ActionEvent e) { onParentSelected(); } }, AC_PARENT, menuAddISAIcon, menuAddISAIconDis)); popup.add - (createMenuItem (new AbstractAction ("Add selected as a member - HASA") { + (createMenuItem (new AbstractAction ("Add selected as a member - HASA") { public void actionPerformed (ActionEvent e) { onMemberSelected (Central.iHASA); } }, AC_MHASA, menuAddHASAIcon, menuAddHASAIconDis)); popup.add - (createMenuItem (new AbstractAction ("Add selected as a list of members - HAS") { + (createMenuItem (new AbstractAction ("Add selected as a list of members - HAS") { public void actionPerformed (ActionEvent e) { onMemberSelected (Central.iHAS); } }, AC_MHAS, menuAddHASIcon, menuAddHASIconDis)); - selected (null); + popup.addSeparator(); + + popup.add + (createMenuItem (new AbstractAction ("Unregister") { + public void actionPerformed (ActionEvent e) { + onUnregisterDataType(); + } + }, AC_UNREG, menuUnregisterIcon, menuUnregisterIconDis)); + + selected (null); // TBD: this has no effect; why? } /********************************************************************* * Called when a tree node is selected, or deselected (in - * which case 'node' is null). If anything is selected, enable - * few popup menu items, otherwise disable them. + * which case 'node' is null). If a data type name is + * selected, enable few popup menu items, otherwise disable them. ********************************************************************/ protected void selected (DefaultMutableTreeNode node) { - boolean enabled = (node != null); + boolean enabled = true; + if ( node == null || + node.isRoot() || + (lastSorted == SORTED_BY_AUTHORITY && ! node.isLeaf()) ) + enabled = false; setEnabledPopupItem (AC_PARENT, enabled); setEnabledPopupItem (AC_MHASA, enabled); setEnabledPopupItem (AC_MHAS, enabled); @@ -430,7 +463,9 @@ (DefaultMutableTreeNode)getLastSelectedPathComponent(); if (node != null) { // i.e. something is really selected CommonNode nodeObject = (CommonNode)node.getUserObject(); - buildTree.setParent (nodeObject.getValue()); + String value = nodeObject.getValue(); + if (! DataTypesGenerator.isPrimitiveType (value)) + buildTree.setParent (value); } } @@ -446,6 +481,50 @@ } } - } + /********************************************************************* + * + ********************************************************************/ + protected void onUnregisterDataType() { + DefaultMutableTreeNode node = + (DefaultMutableTreeNode)getLastSelectedPathComponent(); + if (node == null) return; // nothing selected + CommonNode nodeObject = (CommonNode)node.getUserObject(); + final String dataTypeName = nodeObject.getValue(); + + if (DataTypesGenerator.isPrimitiveType (dataTypeName) || + dataTypeName.equals (MobyTags.MOBYOBJECT)) { + AbstractPanel.error ("Sorry, but the top-level object and\n" + + "the objects representing primitive types\n" + + "cannot unregister. At least not so easily."); + return; + } + + if (! confirm ("Are you sure you wish to unregister\n" + + "data type: " + dataTypeName + " ?")) + return; + + dtUnregException = null; + final SwingWorker worker = new SwingWorker() { + public Object construct() { + try { + MobyDataType dataType = new MobyDataType (dataTypeName); + console.setText ("Data type to be unregistered: " + dataTypeName + "\n"); + registryModel.unRegisterDataType (dataType); + console.setText ("\nUnregistration successful!\n\n"); + } catch (MobyException e) { + dtUnregException = e; + } + return null; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (dtUnregException != null) + error (DATA_TYPE_UNREG_PROLOGUE, dtUnregException); + } + }; + worker.start(); + } + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/25 09:02:07 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/26 08:05:18 1.7 @@ -95,6 +95,23 @@ /********************************************************************* * ********************************************************************/ + public void unRegisterDataType (MobyDataType dataType) + throws MobyException { + initWorker(); +// try { +// worker.unregisterDataType (dataType); +// } catch (PendingCurationException e) { +// throw new MobyException ("Unregistration reports 'Pending curation'...\n" + +// "Well, nobody knows what it means. Call Mark!"); +// } catch (NoSuccessException e) { +// throw new MobyException ("Unregistration reports 'No Success'...\n" + +// e.getMessage()); +// } + } + + /********************************************************************* + * + ********************************************************************/ public MobyDataType[] getDataTypesByNames() throws MobyException { initWorker(); From senger at pub.open-bio.org Thu Oct 27 00:15:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FOck002913@pub.open-bio.org> senger Thu Oct 27 00:15:24 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/shared/event Modified Files: NotificationEvent.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/22 01:38:04 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/27 04:15:23 1.3 @@ -8,6 +8,7 @@ package org.biomoby.shared.event; +import org.tulsoft.shared.UUtils; import java.util.EventObject; /** @@ -98,7 +99,8 @@ StringBuffer buf = new StringBuffer (100); buf.append ("["); buf.append (typeStr); - buf.append (", Message=" + message); + if (UUtils.notEmpty (message)) + buf.append (", Message=" + message); if (details != null) buf.append (", Details=" + details.getClass().getName()); buf.append ("]"); From senger at pub.open-bio.org Thu Oct 27 00:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FN6t002798@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv2749/src/Clients Modified Files: CacheRegistryClient.java MobyCmdLineClient.java MobyDigestClient.java TestingCentral.java Log Message: moby-live/Java/src/Clients CacheRegistryClient.java,1.4,1.5 MobyCmdLineClient.java,1.12,1.13 MobyDigestClient.java,1.5,1.6 TestingCentral.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/22 16:07:08 1.4 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/10/27 04:15:23 1.5 @@ -122,7 +122,7 @@ if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-n")) { castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_NAMESPACES); decorationLn ("Retrieving namespaces..."); - worker.getNamespaces(); + worker.getFullNamespaces(); } // =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/19 08:08:32 1.12 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/10/27 04:15:23 1.13 @@ -157,12 +157,9 @@ if (cmd.hasOption ("-ln")) { decorationLn ("Namespaces:"); decorationLn ("-----------"); - Map types = worker.getNamespaces(); - - for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - System.out.println (entry.getKey()); - System.out.println ("\t" + entry.getValue()); + MobyNamespace[] nms = worker.getFullNamespaces(); + for (int i = 0; i < nms.length; i++) { + System.out.println (nms[i]); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/10/12 11:17:59 1.5 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/10/27 04:15:23 1.6 @@ -91,12 +91,10 @@ if (cmd.hasOption ("-t")) { MobyServiceType[] serviceTypes = worker.getFullServiceTypes(); for (int i = 0; i < serviceTypes.length; i++) { - if (details) { - System.out.println (serviceTypes[i].toString()); - System.out.println ("---"); - } else { + if (details) + System.out.println (serviceTypes[i]); + else System.out.println (serviceTypes[i].getName()); - } } } @@ -105,7 +103,7 @@ if (details) { MobyService[] services = worker.getServices(); for (int i = 0; i < services.length; i++) { - System.out.println (services[i].toString()); + System.out.println (services[i]); System.out.println ("---"); } } else { @@ -123,12 +121,12 @@ // read all namespaces if (cmd.hasOption ("-n")) { - Map namespaces = worker.getNamespaces(); - for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - System.out.println (entry.getKey()); + MobyNamespace[] namespaces = worker.getFullNamespaces(); + for (int i = 0; i < namespaces.length; i++) { if (details) - System.out.println ("\t" + entry.getValue()); + System.out.println (namespaces[i]); + else + System.out.println (namespaces[i].getName()); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/10/18 17:19:56 1.8 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/10/27 04:15:23 1.9 @@ -184,7 +184,7 @@ try { start ("retrieveNamespaces"); - worker.getNamespaces(); + worker.getFullNamespaces(); ok(); } catch (MobyException e) { error (e); } From senger at pub.open-bio.org Thu Oct 27 00:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FNpx002830@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralDigestImpl.java CentralImpl.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.10,1.11 CentralDigestImpl.java,1.7,1.8 CentralImpl.java,1.29,1.30 GraphsServlet.java,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/22 01:38:04 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/27 04:15:23 1.11 @@ -6,6 +6,14 @@ package org.biomoby.client; +import org.biomoby.shared.CentralAll; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyNamespace; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.MobyService; +import org.biomoby.shared.MobyServiceType; +import org.biomoby.shared.NoSuccessException; + import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; @@ -20,13 +28,6 @@ import java.util.Arrays; import java.util.Comparator; -import org.biomoby.shared.CentralAll; -import org.biomoby.shared.MobyDataType; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyService; -import org.biomoby.shared.MobyServiceType; -import org.biomoby.shared.NoSuccessException; - /** * An implementation of {@link org.biomoby.shared.CentralAll}, * allowing to cache locally results of the cumulative methods so it @@ -325,7 +326,7 @@ if (list == null || list.length == 0) return true; for (int i = 0; i < list.length; i++) { - if ( ! ignored (new File (list[i])) ) + if ( ! ignoredForEmptiness (new File (list[i])) ) return false; } return true; @@ -403,11 +404,10 @@ fireEvent (SERVICE_TYPES_START); String typesAsXML = getServiceTypesAsXML(); store (serviceTypesCache, LIST_FILE, typesAsXML); - Map types = createServiceTypesFromXML (typesAsXML); - fireEvent (SERVICE_TYPES_COUNT, new Integer (types.size())); - for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); + MobyServiceType[] types = createServiceTypesFromXML (typesAsXML); + fireEvent (SERVICE_TYPES_COUNT, new Integer (types.length)); + for (int i = 0 ; i < types.length; i++) { + String name = types[i].getName(); fireEvent (SERVICE_TYPE_LOADING, name); String xml = getServiceTypeRelationshipsAsXML (name, false); store (serviceTypesCache, name, xml); @@ -556,11 +556,10 @@ /************************************************************************* * *************************************************************************/ -// public MobyNamespace[] getNamespaces() //TBD: later, when API allows it - public Map getNamespaces() + public MobyNamespace[] getFullNamespaces() throws MobyException { if (namespacesCache == null) - return super.getNamespaces(); + return super.getFullNamespaces(); synchronized (namespacesCache) { if (isCacheEmpty (namespacesCache)) { initCache(); @@ -590,26 +589,19 @@ // get a list file (with all service type names) String xmlList = getListFile (serviceTypesCache); - Map types = createServiceTypesFromXML (xmlList); + MobyServiceType[] types = createServiceTypesFromXML (xmlList); - // get individual (almost) full service types - Vector v = new Vector(); - for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); + // add details about relationship to get full service types + for (int i = 0; i < types.length; i++) { + String name = types[i].getName(); File file = new File (serviceTypesCache, name); try { - MobyServiceType serviceType = new MobyServiceType (name); - serviceType.setParentNames (createServiceTypeRelationshipsFromXML (load (file))); - serviceType.setDescription ((String)entry.getValue()); - v.addElement (serviceType); + types[i].setParentNames (createServiceTypeRelationshipsFromXML (load (file))); } catch (MobyException e) { System.err.println (MSG_CACHE_BAD_FILE (file, e)); } } - MobyServiceType[] result = new MobyServiceType [v.size()]; - v.copyInto (result); - return result; + return types; } } @@ -646,6 +638,15 @@ } /************************************************************************** + * Some file (when a cache is being tested fir emptyness) are ignored. + *************************************************************************/ + protected static boolean ignoredForEmptiness (File file) { + String path = file.getPath(); + return + path.endsWith ("~"); + } + + /************************************************************************** * *************************************************************************/ protected static String MSG_CACHE_NOT_DIR (File cache) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/22 01:38:04 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/27 04:15:23 1.8 @@ -145,33 +145,13 @@ /************************************************************************* * Physically gather together all namespaces. It is not that hard * (comparing to other Biomoby entities) because all namespaces - * are delivered by a single call to Biomoby. This method differs - * form the Central.getNamespaces() in the type of returned - * result, and - hopefully in the future - also in the amount of - * information stored in the returned value (but at the monent, - * because of a limitation of the Biomoby API, both result types - * contain the same information). + * are delivered by a single call to Biomoby. *************************************************************************/ protected MobyNamespace[] readNamespaces() throws MobyException { try { fireEvent (NAMESPACES_START); - Map names = getNamespaces(); - fireEvent (NAMESPACES_COUNT, new Integer (names.size())); - MobyNamespace[] result = new MobyNamespace [ names.size() ]; - int i = 0; - for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); - MobyNamespace ns = new MobyNamespace (name); - ns.setDescription ((String)entry.getValue()); - result[i++] = ns; - fireEvent (NAMESPACE_LOADED, name, ns); - } - return result; - - } catch (Exception e) { - throw new MobyException (formatException (e)); + return super.getFullNamespaces(); } finally { fireEvent (NAMESPACES_END); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/10/12 11:36:59 1.29 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/10/27 04:15:23 1.30 @@ -560,6 +560,14 @@ return value; } + protected String getFirstValue (NodeList children) { + if (children.item(0) != null && children.item(0).hasChildNodes()) { + children.item(0).normalize(); + return getFirstValue (children.item(0)); + } + return ""; + } + /************************************************************************** * * Implementing SimpleCache interface. @@ -784,8 +792,10 @@ * Parses and imports the following XML. *

          *  <serviceTypes>
    -     *     <serviceType name="serviceName">
    +     *     <serviceType name="serviceName" lsid="...">
          *            <Description><![CDATA[free text description here]]></Description>
    +     *            <contactEmail>...</contactEmail>
    +     *            <authURI>...</authURI>
          *     </serviceType>
          *          ...
          *          ...
    @@ -795,7 +805,13 @@
         public Map getServiceTypes()
     	throws MobyException {
     	String result = getServiceTypesAsXML();
    -	return createServiceTypesFromXML (result);
    + 	Map results = new TreeMap (getStringComparator());
    +	MobyServiceType[] types = createServiceTypesFromXML (result);
    +	for (int i = 0; i < types.length; i++) {
    +	    results.put (types[i].getName(),
    +			 types[i].getDescription());
    +	}
    +	return results;
         }
     
         //
    @@ -805,29 +821,33 @@
     			       new Object[] {});
         }
     
    -    //
    -    protected Map createServiceTypesFromXML (String result)
    +    // but be aware that the created MobyServiceTypes are not complete
    +    // - they do not have the relationship information; that's why
    +    // this method is not public; the full service types are available
    +    // from CentralDigest implementations
    +    protected MobyServiceType[] createServiceTypesFromXML (String result)
     	throws MobyException {
     
     	// parse returned XML
    -	Map results = new TreeMap (getStringComparator());
     	Document document = null;
     	try {
     	    document = docBuilder.parse(new ByteArrayInputStream(result.getBytes()));}
     	catch(Exception e){throw new MobyException(e.toString());}
     
     	NodeList list = document.getElementsByTagName ("serviceType");
    +	if (list == null || list.getLength() == 0)
    +	    return new MobyServiceType[] {};
    +	MobyServiceType[] results = new MobyServiceType [list.getLength()];
     	for (int i = 0; i < list.getLength(); i++) {
     	    Element elem = (Element)list.item (i);
    -	    NodeList children = elem.getChildNodes();
    -	    for (int j = 0; j < children.getLength(); j++) {
    -		if (children.item (j).getNodeName().equals ("Description")) {
    -		    results.put (elem.getAttribute ("name"),
    -				 getFirstValue (children.item (j)));
    -		    break;
    -		}
    -	    }
    +	    MobyServiceType st = new MobyServiceType (elem.getAttribute ("name"));
    +	    st.setLSID (elem.getAttribute ("lsid"));
    +	    st.setDescription (getFirstValue (elem.getElementsByTagName ("Description")));
    +	    st.setEmailContact (getFirstValue (elem.getElementsByTagName ("contactEmail")));
    +	    st.setAuthority (getFirstValue (elem.getElementsByTagName ("authURI")));
    +	    results[i] = st;
     	}
    + 	java.util.Arrays.sort (results);
     	return results;
         }
     
    @@ -835,15 +855,17 @@
          * Parses and imports the following XML.
          * 
          *  <Namespaces>
    -     *     <Namespace name="namespace">
    +     *     <Namespace name="namespace" lsid="...">
          *            <Description><![CDATA[free text description here]]></Description>
    +     *            <contactEmail>...</contactEmail>
    +     *            <authURI>...</authURI>
          *     </Namespace>
          *          ...
          *          ...
          *  </Namespaces>
          * 
    *************************************************************************/ - public Map getNamespaces() + public MobyNamespace[] getFullNamespaces() throws MobyException { String result = getNamespacesAsXML(); @@ -858,11 +880,10 @@ } // - protected Map createNamespacesFromXML (String result) + protected MobyNamespace[] createNamespacesFromXML (String result) throws MobyException { // parse returned XML - Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -872,25 +893,35 @@ NodeList list = document.getDocumentElement().getElementsByTagName ("Namespace"); if (list == null || list.getLength() == 0) { - throw new MobyException ("Could not find Namespace children of response root node " + - document.getDocumentElement()); + return new MobyNamespace[] {}; } - int length = list.getLength(); - for (int i = 0; i < length; i++) { + MobyNamespace[] results = new MobyNamespace [list.getLength()]; + for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); - NodeList children = elem.getElementsByTagName("Description"); - if (children.item(0).hasChildNodes()) { - children.item(0).normalize(); - results.put (elem.getAttribute ("name"), - getFirstValue (children.item(0))); + MobyNamespace nm = new MobyNamespace (elem.getAttribute ("name")); + nm.setLSID (elem.getAttribute ("lsid")); + nm.setDescription (getFirstValue (elem.getElementsByTagName ("Description"))); + nm.setEmailContact (getFirstValue (elem.getElementsByTagName ("contactEmail"))); + nm.setAuthority (getFirstValue (elem.getElementsByTagName ("authURI"))); + results[i] = nm; + } + java.util.Arrays.sort (results); + return results; + } - } else { - // No description provided - results.put (elem.getAttribute ("name"), ""); - } - } + /************************************************************************** + * + *************************************************************************/ + public Map getNamespaces() + throws MobyException { + Map results = new TreeMap (getStringComparator()); + MobyNamespace[] namespaces = getFullNamespaces(); + for (int i = 0; i < namespaces.length; i++) { + results.put (namespaces[i].getName(), + namespaces[i].getDescription()); + } return results; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/22 16:07:09 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/10/27 04:15:23 1.13 @@ -423,12 +423,13 @@ MobyService[] services = null; MobyDataType[] dataTypes = null; - Map namespaces = null; +// Map namespaces = null; + MobyNamespace[] namespaces = null; try { readRegistryIfNeeded(); services = registry.getServices(); dataTypes = registry.getDataTypes(); - namespaces = registry.getNamespaces(); + namespaces = registry.getFullNamespaces(); lastRead = getLastRead(); } catch (MobyException e) { error (res, HttpServletResponse.SC_SERVICE_UNAVAILABLE, e); @@ -570,10 +571,13 @@ String selectData2 = h.list (attrs, dataLabels, null, selected); Vector v = new Vector(); - for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - v.addElement (entry.getKey()); + for (int i = 0; i < namespaces.length; i++) { + v.addElement (namespaces[i].getName()); } +// for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { +// Map.Entry entry = (Map.Entry)it.next(); +// v.addElement (entry.getKey()); +// } new Sorter().sort (v); v.insertElementAt (WITHOUT_NAMESPACE, 0); String[] nsLabels = new String [v.size()]; From senger at pub.open-bio.org Thu Oct 27 00:15:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FObv002892@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/shared Modified Files: Central.java CentralDigest.java MobyNamespace.java MobyServiceType.java Log Message: moby-live/Java/src/main/org/biomoby/shared Central.java,1.12,1.13 CentralDigest.java,1.2,1.3 MobyNamespace.java,1.2,1.3 MobyServiceType.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2005/08/07 06:40:39 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2005/10/27 04:15:23 1.13 @@ -162,8 +162,11 @@ throws MobyException; /************************************************************************** - * Get the list of all registered namespaces. - *

    + * Get the list of all registered namespaces.

    + * + * @deprecated Replaced by {@link #getFullNamespaces} that gives + * more information for the same price.

    + * * @return a hash table where keys are names of namespaces while * values are their descriptions * @throws MobyException if communication with the Moby Registry fails @@ -172,6 +175,16 @@ throws MobyException; /************************************************************************** + * Get the list of all registered namespaces, with all their + * attributes.

    + * + * @return array of namespaces + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + MobyNamespace[] getFullNamespaces() + throws MobyException; + + /************************************************************************** * Get the list of all registered data types. *

    * @return a hash table where keys are names of data types while =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2005/09/22 16:07:09 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2005/10/27 04:15:23 1.3 @@ -46,17 +46,6 @@ throws MobyException; /************************************************************************* - * Get definition of all known namespaces. It differs from the - * {@link Central#getNamespaces} because it returns an array of - * full definitions of namespaces, and not just their names and - * descriptions.

    - * - * @throws MobyException if communication with the Moby Registry fails - *************************************************************************/ - MobyNamespace[] getFullNamespaces() - throws MobyException; - - /************************************************************************* * Get definition of all registered service instances. It is a * cumulation of many individual calls to {@link * Central#findService(MobyService) findService by name} for all =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2005/09/22 16:07:09 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2005/10/27 04:15:23 1.3 @@ -20,14 +20,23 @@ * @version $Id$ */ -public class MobyNamespace { +public class MobyNamespace + implements Comparable { protected String name; protected String authority = ""; protected String emailContact = ""; protected String description = ""; + protected String lsid = null; protected String id = null; + public int compareTo (Object obj) { + return name.compareToIgnoreCase ( ((MobyNamespace)obj).getName() ); + } + public boolean equals (Object obj) { + return name.equals ( ((MobyNamespace)obj).getName() ); + } + /************************************************************************** * Default constructor. Other characteristics are empty - which is usually * wrong - therefore use 'set' method to fill them. @@ -47,6 +56,13 @@ id = value; } + public String getLSID() { + return lsid; + } + public void setLSID (String value) { + lsid = value; + } + public String getAuthority() { return authority; } @@ -70,10 +86,12 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name); + buf.append (name); if (UUtils.notEmpty (authority)) buf.append (", Auth: " + authority); - if (id != null) buf.append (", ID: " + id); + if (UUtils.notEmpty (emailContact)) + buf.append (", Contact: " + emailContact); + if (lsid != null) buf.append (", " + lsid); if (UUtils.notEmpty (description)) buf.append ("\n\t" + description); return new String (buf); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java 2004/10/18 14:35:06 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java 2005/10/27 04:15:23 1.3 @@ -6,6 +6,7 @@ // package org.biomoby.shared; +import org.tulsoft.shared.UUtils; /** * A container representing a service type used in the Moby registry. @@ -19,7 +20,8 @@ * @version $Id$ */ -public class MobyServiceType { +public class MobyServiceType + implements Comparable { protected String name; protected String description = ""; @@ -27,6 +29,14 @@ protected String authority = ""; protected String[] parentNames = new String[] { }; protected String id = null; + protected String lsid = null; + + public int compareTo (Object obj) { + return name.compareToIgnoreCase ( ((MobyServiceType)obj).getName() ); + } + public boolean equals (Object obj) { + return name.equals ( ((MobyServiceType)obj).getName() ); + } /************************************************************************** * Default constructor. @@ -57,6 +67,13 @@ id = value; } + public String getLSID() { + return lsid; + } + public void setLSID (String value) { + lsid = value; + } + public String getDescription() { return description; } @@ -109,14 +126,19 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("Desc: " + description + "\n"); - buf.append ("ID: " + id + "\n"); - buf.append ("Parents:\n"); - for (int i = 0 ; i < parentNames.length; i++) { - buf.append (Utils.format (null, 1)); - buf.append (parentNames [i]); - buf.append ("\n"); + buf.append (name); + if (UUtils.notEmpty (authority)) + buf.append (", Auth: " + authority); + if (UUtils.notEmpty (emailContact)) + buf.append (", Contact: " + emailContact); + if (lsid != null) buf.append (", " + lsid); + if (UUtils.notEmpty (description)) + buf.append ("\n\t" + description); + if (parentNames.length > 0) { + buf.append ("\n\tParents: "); + for (int i = 0 ; i < parentNames.length; i++) { + buf.append (parentNames [i] + " "); + } } return new String (buf); } From senger at pub.open-bio.org Thu Oct 27 00:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FN88002855@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/service/dashboard Modified Files: PropertyChannel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard PropertyChannel.java,1.3,1.4 RegistryPanel.java,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/22 01:38:04 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/27 04:15:23 1.4 @@ -41,8 +41,8 @@ * listener) we may re-consider this desision. At the moment, I do not * see any advantage of it.

    * - * Property names are of no interest for this class, but it is good to - * remind that they should be defined in the class {@link + * Concrete property names are of no interest for this class, but it + * is good to remind that they should be collected in the class {@link * DashboardProperties}.

    * @author Martin Senger =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 14:35:46 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/27 04:15:23 1.12 @@ -130,38 +130,45 @@ // ontology trees ServicesTree servicesTree = new ServicesTree(); - + ServiceTypesTree serviceTypesTree = new ServiceTypesTree(); + NamespacesTree namespacesTree = new NamespacesTree(); DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, console, support); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); - NamespacesTree namespacesTree = new NamespacesTree(); - JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, servicesTree.scrollable(), dataTypesBoard); split1.setResizeWeight (0.5); split1.setContinuousLayout (true); split1.setOneTouchExpandable (true); + JSplitPane split2 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, - split1, + serviceTypesTree.scrollable(), namespacesTree.scrollable()); - split2.setResizeWeight (0.7); + split2.setResizeWeight (0.5); split2.setContinuousLayout (true); split2.setOneTouchExpandable (true); - JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, - split2, - console); - split3.setResizeWeight (0.75); + JSplitPane split3 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, + split1, + split2); + split3.setResizeWeight (0.5); split3.setContinuousLayout (true); split3.setOneTouchExpandable (true); + JSplitPane split4 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, + split3, + console); + split4.setResizeWeight (0.75); + split4.setContinuousLayout (true); + split4.setOneTouchExpandable (true); + // put all together - SwingUtils.addComponent (pComponent, split3, 0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0); - SwingUtils.addComponent (pComponent, regLocation, 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0); - SwingUtils.addComponent (pComponent, cacheLocation, 1, 1, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (pComponent, split4, 0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0); + SwingUtils.addComponent (pComponent, regLocation, 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (pComponent, cacheLocation, 1, 1, 1, 1, HORI, NWEST, 0.0, 0.0); return pComponent; } @@ -322,6 +329,16 @@ /************************************************************************** * **************************************************************************/ + class ServiceTypesTree extends CommonTree { + public ServiceTypesTree() { + super ("Service Types"); + } + } + + + /************************************************************************** + * + **************************************************************************/ class NamespacesTree extends CommonTree { public NamespacesTree() { super ("Namespaces"); From senger at pub.open-bio.org Thu Oct 27 00:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FNLO002768@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv2749/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.44,1.45 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/24 17:51:51 1.44 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/10/27 04:15:23 1.45 @@ -1,3 +1,15 @@ +2005-10-26 Martin Senger + + * Add Comparator interface/implementtaion to MobyServiceType. + + * Changed slightly the output of namespaces and service types in + MobyCmdLineClient (because more data is now flowing from Biomoby + registers). + + * Add getFullNamespaces() to Central.java and its implementations. + + * Add Comparator interface/implementtaion to MobyNamespace. + 2005-09-24 Martin Senger * Added sorting to the most of the returned results from From senger at pub.open-bio.org Thu Oct 27 04:55:48 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 04:55:48 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270855.j9R8tmuP003759@pub.open-bio.org> senger Thu Oct 27 04:55:48 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv3740/src/config/dashboard/META-INF/services Modified Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/10/22 14:35:46 1.2 +++ /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/10/27 08:55:48 1.3 @@ -1,4 +1,3 @@ org.biomoby.service.dashboard.RegistryPanel org.biomoby.service.dashboard.RegistrationPanel -org.biomoby.service.dashboard.ConsolePanel -org.biomoby.service.dashboard.EventGeneratorPanel +org.biomoby.service.dashboard.DebuggingPanel From senger at pub.open-bio.org Thu Oct 27 04:55:49 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 04:55:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270855.j9R8tn0s003817@pub.open-bio.org> senger Thu Oct 27 04:55:48 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv3740/src/main/org/biomoby/service/dashboard Modified Files: AbstractModel.java AbstractPanel.java CommonBoard.java Dashboard.java DashboardPanel.java DataTypesBoard.java PropertyChannel.java RegistrationPanel.java RegistryModel.java RegistryPanel.java Added Files: DebuggingPanel.java Removed Files: ConsolePanel.java EventGeneratorPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard DebuggingPanel.java,NONE,1.1 AbstractModel.java,1.1,1.2 AbstractPanel.java,1.10,1.11 CommonBoard.java,1.1,1.2 Dashboard.java,1.7,1.8 DashboardPanel.java,1.4,1.5 DataTypesBoard.java,1.2,1.3 PropertyChannel.java,1.4,1.5 RegistrationPanel.java,1.4,1.5 RegistryModel.java,1.7,1.8 RegistryPanel.java,1.12,1.13 ConsolePanel.java,1.5,NONE EventGeneratorPanel.java,1.4,NONE =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/09/24 17:54:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/10/27 08:55:48 1.2 @@ -44,9 +44,8 @@ */ public class AbstractModel - implements PropertyChangeListener, DashboardProperties { + implements DashboardProperties { - protected PropertyChangeSupport support; protected PropertyChannel propertyChannel; /********************************************************************* @@ -55,26 +54,11 @@ protected AbstractModel() { } - /********************************************************************* - * Usual constructor that shares support for property changes with - * its creator. - ********************************************************************/ - protected AbstractModel (PropertyChangeSupport support) { - this.support = support; - } - - /************************************************************************** - * Here we get notified when a property change happen. - **************************************************************************/ - public void propertyChange (PropertyChangeEvent event) { - } - /************************************************************************** * Keep shared storage of properties updated in various panels. **************************************************************************/ public void setPropertyChannel (PropertyChannel propertyChannel) { this.propertyChannel = propertyChannel; - propertyChannel.addPropertyChangeListener (this); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/26 08:05:18 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/27 08:55:48 1.11 @@ -1,6 +1,6 @@ // AbstractPanel.java // -// Created: September 2005 +// Created: September 2005 // // This file is a component of the BioMoby project. // Copyright Martin Senger (martin.senger at gmail.com). @@ -51,10 +51,6 @@ import java.awt.event.FocusEvent; import java.awt.event.FocusListener; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeSupport; - import java.io.File; import java.util.prefs.Preferences; import java.util.Map; @@ -102,14 +98,13 @@ protected static final Font TITLE_FONT = new Font ("Serif", Font.BOLD, 20); protected static final Color TITLE_FGCOLOR = new Color (12, 55, 241); - // + // sharing events protected PropertyChannel propertyChannel; /********************************************************************* * Default constructor (just for the sub-classes). ********************************************************************/ protected AbstractPanel() { - support = new PropertyChangeSupport (this); loadIcons(); } @@ -137,33 +132,11 @@ return title; } - /********************************************************************* - * Property change stuff - ********************************************************************/ - protected PropertyChangeSupport support; - - public void addPropertyChangeListener (PropertyChangeListener l) { - if (support != null) - support.addPropertyChangeListener(l); - } - - public void removePropertyChangeListener (PropertyChangeListener l) { - if (support != null) - support.removePropertyChangeListener(l); - } - - /************************************************************************** - * Here we get notified when a property change happens. - **************************************************************************/ - public void propertyChange (PropertyChangeEvent event) { - } - /************************************************************************** - * Remember a property channel and register itself to it as a listener. + * Remember the property channel. **************************************************************************/ protected void setPropertyChannel (PropertyChannel propertyChannel) { this.propertyChannel = propertyChannel; - propertyChannel.addPropertyChangeListener (this); } // =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/22 01:38:04 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/27 08:55:48 1.2 @@ -20,7 +20,6 @@ import java.awt.event.ActionListener; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; -import java.beans.PropertyChangeSupport; /** * This is a simple graphical widget combining together a tree (a @@ -31,9 +30,9 @@ * * It is also a listener of events notifying about the loading * process. It reflects this events appropriately in the progress - * bar, and in some cases it propagates these events as - * property-change events further (usually they are caught and - * displayed in Dashboard's status bar).

    + * bar, and in some cases it propagates these events to the property + * channel (usually they are caught and displayed in Dashboard's + * status bar).

    * * @author Martin Senger * @version $Id$ @@ -44,7 +43,7 @@ implements NotificationListener { protected RegistryModel model; - protected PropertyChangeSupport support; + protected PropertyChannel channel; // components protected JLabel treeTitle; @@ -56,13 +55,13 @@ * Constructor.

    * * @param model gives access to a Biomoby registry - * @param support is used to fire property-change events + * @param channel is used to fire property-change events ********************************************************************/ protected CommonBoard (RegistryModel model, - PropertyChangeSupport support) { + PropertyChannel channel) { this.model = model; this.model.addNotificationListener (this); - this.support = support; + this.channel = channel; treeTitle = new JLabel (""); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/25 09:02:07 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/27 08:55:48 1.8 @@ -51,7 +51,6 @@ implements DashboardPanel, ChangeListener { private JComponent dashboard; - private StatusBar statusBar; private DashboardHeader header; public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; @@ -89,7 +88,6 @@ loadPanels(); propertyChannel = new PropertyChannel(); dashboard = getComponent (propertyChannel); - connectPanels(); } /************************************************************************** @@ -106,21 +104,6 @@ } /************************************************************************** - * Connect all available Dashboard panels: a) together, and b) - * with the status bar. TBD: It changed... It uses now a PropertyChannel... - **************************************************************************/ - public void connectPanels() { - for (int i = 0; i < panels.length; i++) { -// for (int j = 0; j < i; j++) -// panels[i].addPropertyChangeListener (panels[j]); -// for (int j = i+1; j < panels.length; j++) -// panels[i].addPropertyChangeListener (panels[j]); - if (statusBar != null) - panels[i].addPropertyChangeListener (statusBar); - } - } - - /************************************************************************** * Show the main frame. **************************************************************************/ public void show() { @@ -212,7 +195,8 @@ panels[i].getIcon(), panels[i].getComponent (propertyChannel)); } - statusBar = getStatusBar(); + StatusBar statusBar = getStatusBar(); + propertyChannel.addPropertyChangeListener (statusBar); if (useLoadMonitor) ProgressView.monitor.destroy(); @@ -302,24 +286,6 @@ /************************************************************************** * - **************************************************************************/ - public void addPropertyChangeListener (PropertyChangeListener listener) { - } - - /************************************************************************** - * - **************************************************************************/ - public void removePropertyChangeListener(PropertyChangeListener listener) { - } - - /************************************************************************** - * - **************************************************************************/ - public void propertyChange (PropertyChangeEvent event) { - } - - /************************************************************************** - * * An entry point... * **************************************************************************/ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/24 17:51:51 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/10/27 08:55:48 1.5 @@ -29,7 +29,7 @@ */ public interface DashboardPanel - extends PropertyChangeListener, DashboardProperties { + extends DashboardProperties { /************************************************************************** * Return a graphical representation of this panel.

    @@ -70,20 +70,20 @@ **************************************************************************/ Icon getIcon(); - /************************************************************************** - * Add a PropertyChangeListener to the listener list of a - * panel. All listeners will be notified if this panel changes - * some property.

    - * - * The panel should document what properties can fire - but at the - * moment it is not part of its interface.

    - * - **************************************************************************/ - void addPropertyChangeListener (PropertyChangeListener listener); - - /************************************************************************** - * Remove a PropertyChangeListener. - **************************************************************************/ - void removePropertyChangeListener(PropertyChangeListener listener); +// /************************************************************************** +// * Add a PropertyChangeListener to the listener list of a +// * panel. All listeners will be notified if this panel changes +// * some property.

    +// * +// * The panel should document what properties can fire - but at the +// * moment it is not part of its interface.

    +// * +// **************************************************************************/ +// void addPropertyChangeListener (PropertyChangeListener listener); + +// /************************************************************************** +// * Remove a PropertyChangeListener. +// **************************************************************************/ +// void removePropertyChangeListener(PropertyChangeListener listener); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/23 19:00:24 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/27 08:55:48 1.3 @@ -10,11 +10,8 @@ import org.biomoby.shared.event.NotificationEvent; import org.biomoby.shared.event.Notifier; - import org.tulsoft.shared.UUtils; -import java.beans.PropertyChangeSupport; - /** * This is a simple graphical widget combining together a tree (a * subclass of {@link org.biomoby.service.dashboard.CommonTree}) and a @@ -35,20 +32,28 @@ * * @param model gives access to a Biomoby registry * @param console displayed items selected in the tree - * @param support is used to fire property-change events + * @param channel is used to fire property-change events ********************************************************************/ public DataTypesBoard (RegistryModel model, CommonConsole console, - PropertyChangeSupport support) { - this (model, console, support, + PropertyChannel channel) { + this (model, console, channel, new DataTypesTree (model, console)); } + /********************************************************************* + * Constructor.

    + * + * @param model gives access to a Biomoby registry + * @param console displayed items selected in the tree + * @param channel is used to fire property-change events + * @param customTree allows to plug user-defined tree component + ********************************************************************/ public DataTypesBoard (RegistryModel model, CommonConsole console, - PropertyChangeSupport support, + PropertyChannel channel, CommonTree customTree) { - super (model, support); + super (model, channel); tree = customTree; createItself(); } @@ -68,7 +73,7 @@ calibrateProgressBar (UUtils.toInt (event.getMessage())); break; case Notifier.DATA_TYPE_LOADING: - support.firePropertyChange (DashboardProperties.DP_STATUS_MSG, null, event.getMessage()); + channel.fire (DashboardProperties.DP_STATUS_MSG, event.getMessage()); break; case Notifier.DATA_TYPE_LOADED: addToProgressBar(); @@ -76,7 +81,7 @@ case Notifier.DATA_TYPES_END: case Notifier.DATA_TYPES_CANCELLED: case Notifier.DATA_TYPES_RESET: - support.firePropertyChange (DashboardProperties.DP_STATUS_MSG, null, "Done"); + channel.fire (DashboardProperties.DP_STATUS_MSG, "Done"); removeProgressBar(); break; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/27 04:15:23 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/27 08:55:48 1.5 @@ -10,6 +10,9 @@ import org.tulsoft.shared.UUtils; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.logging.Log; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -30,10 +33,17 @@ * *

    * - * Obviously, there are some properties that do not make sense to be - * stored here: the short-lived properties, such as progress bar - * change events. Such messages can be delivered in an ordinary way - * via property change listeners.

    + * Additionally, it also serves as a PropertyChangeSupport object: it + * can register and deregister PropertyChangeListeners, and it can + * fire an event to them on behave of other objects. The other objects + * either identify themselves (see method {@link + * #fire(Object,String,Object}), or use this channel for firing + * anonymous messages (see method {@link #fire(String,Object)}) - in + * which case the message source will be this class.

    + * + * The fired events are also stored here - under their names. That's + * mean that you can always get the last event of a particular + * name.

    * * The panels/models are sending here properties by calling method * put. If we find, in the future, that sending properties @@ -52,6 +62,9 @@ public class PropertyChannel extends Hashtable { + private static Log log = LogFactory.getLog (PropertyChannel.class); + private PropertyChangeSupport support; + /********************************************************************* * Default constructor. ********************************************************************/ @@ -62,10 +75,13 @@ /********************************************************************* * Maps the specified key to the specified value in this - * hashtable. Neither the key nor the value can be null. Remember - * the given value (do the same as an ordinary Hashtable does), - * and propagate it by firing a property change event (this - * is called a channel push style).

    + * hashtable. Neither the key nor the value can be null.

    + * + * The given value, apart from being stored, is also propagated by + * firing a property change event (this is called a channel + * push style). The event is anonymous. If you need to send + * the source of the message to the listeners, use instead {@link + * #put(Object,Object,Object)}.

    * * @param key the hashtable key * @param value the value @@ -74,7 +90,29 @@ ********************************************************************/ public Object put (Object key, Object value) { Object previous = super.put (key, value); - support.firePropertyChange (key.toString(), null, value); + fire (key.toString(), value); + return previous; + } + + /********************************************************************* + * Maps the specified key to the specified value in this + * hashtable. Neither the key nor the value can be null.

    + * + * The given value, apart from being stored, is also propagated by + * firing a property change event (this is called a channel + * push style). The event contains also its 'source'. For + * anonymously sent events, use instead {@link + * #put(Object,Object)}.

    + * + * @param source that initiated this event + * @param key the hashtable key + * @param value the value + * @return the previous value of the specified key in this + * hashtable, or null if it did not have one + ********************************************************************/ + public Object put (Object source, Object key, Object value) { + Object previous = super.put (key, value); + fire (source, key.toString(), value); return previous; } @@ -99,18 +137,69 @@ } /********************************************************************* - * Property change stuff + * Fire an event to any registered listeners. The source of this + * event will be this class.

    + * + * @param key is a name of the fired event + * @param value is a value associated with this event ********************************************************************/ - protected PropertyChangeSupport support; + public void fire (String key, Object value) { + if (log.isDebugEnabled()) + logDebug (null, key, value); + support.firePropertyChange (key.toString(), null, value); + } + /********************************************************************* + * Fire an event to any registered listeners. The source of this + * event will be this class.

    + * + * @param source that initiated the event + * @param key is a name of the fired event + * @param value is a value associated with this event + ********************************************************************/ + public void fire (Object source, String key, Object value) { + if (log.isDebugEnabled()) + logDebug (source, key, value); + support.firePropertyChange + (new PropertyChangeEvent (source, key.toString(), null, value)); + } + + /********************************************************************* + * Register listeners. + ********************************************************************/ public void addPropertyChangeListener (PropertyChangeListener l) { if (support != null) support.addPropertyChangeListener(l); } + /********************************************************************* + * Unregister listeners. + ********************************************************************/ public void removePropertyChangeListener (PropertyChangeListener l) { if (support != null) support.removePropertyChangeListener(l); } + /********************************************************************* + * Log a debug message. + ********************************************************************/ + protected void logDebug (Object source, String key, Object value) { + + StringBuffer buf = new StringBuffer (100); + if (source != null) { + buf.append ("["); + if (source instanceof DashboardPanel) + buf.append ( ((DashboardPanel)source).getName() ); + else + buf.append (source.getClass().getName()); + buf.append ("] "); + } + buf.append (key); + buf.append (": "); + if (value != null) + buf.append (value.toString()); + + log.debug (buf); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/26 08:05:18 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/27 08:55:48 1.5 @@ -50,8 +50,6 @@ import java.awt.event.MouseListener; import java.awt.event.MouseAdapter; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; import java.util.Map; import java.util.HashMap; import java.util.HashSet; @@ -99,12 +97,6 @@ + " by selecting first a data type, then right-click gives you menu."; /********************************************************************* - * propertyChange() - ********************************************************************/ - public void propertyChange (PropertyChangeEvent e) { - } - - /********************************************************************* * Default constructor. ********************************************************************/ public RegistrationPanel() { @@ -120,7 +112,7 @@ if (propertyChannel.containsKey (DP_REGISTRY_MODEL)) { registryModel = (RegistryModel)propertyChannel.get (DP_REGISTRY_MODEL); } else { - registryModel = new RegistryModel (support); + registryModel = new RegistryModel(); propertyChannel.put (DP_REGISTRY_MODEL, registryModel); } registryModel.setPropertyChannel (propertyChannel); @@ -185,7 +177,7 @@ DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, console, - support, + propertyChannel, new CustomDataTypesTree (registryModel, console)); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); @@ -225,7 +217,7 @@ } /************************************************************************** - * Panel to register a data type. + * Panel to register a service. **************************************************************************/ protected JPanel getServiceRegistration() { @@ -235,7 +227,7 @@ } /************************************************************************** - * Panel to register a data type. + * Panel to register a namespace. **************************************************************************/ protected JPanel getNamespaceRegistration() { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/26 08:05:18 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/27 08:55:48 1.8 @@ -52,14 +52,6 @@ super(); } - /********************************************************************* - * Usual constructor that shares support for property changes with - * its creator. - ********************************************************************/ - public RegistryModel (PropertyChangeSupport support) { - super (support); - } - /************************************************************************** * Return an endpoint (a stringified URL) of a default Moby * registry. =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/27 04:15:23 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/27 08:55:48 1.13 @@ -48,8 +48,6 @@ import java.awt.event.MouseListener; import java.awt.event.MouseAdapter; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; import java.util.Map; import java.util.HashMap; import java.util.HashSet; @@ -82,16 +80,6 @@ CommonConsole console; /********************************************************************* - * propertyChange() - ********************************************************************/ - public void propertyChange (PropertyChangeEvent e) { -// String prop = e.getPropertyName(); -// String newVal = (String)e.getNewValue(); -// if (newVal == null) return; // no interest in non-defined new values -// if (prop == null) return; // no interest in non-specific changes - } - - /********************************************************************* * Default constructor. ********************************************************************/ public RegistryPanel() { @@ -107,7 +95,7 @@ if (propertyChannel.containsKey (DP_REGISTRY_MODEL)) { registryModel = (RegistryModel)propertyChannel.get (DP_REGISTRY_MODEL); } else { - registryModel = new RegistryModel (support); + registryModel = new RegistryModel(); propertyChannel.put (DP_REGISTRY_MODEL, registryModel); } registryModel.setPropertyChannel (propertyChannel); @@ -134,7 +122,7 @@ NamespacesTree namespacesTree = new NamespacesTree(); DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, console, - support); + propertyChannel); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/ConsolePanel.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/EventGeneratorPanel.java,v: No such file or directory From gss at pub.open-bio.org Thu Oct 27 18:20:41 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 27 Oct 2005 18:20:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272220.j9RMKfE5010220@pub.open-bio.org> gss Thu Oct 27 18:20:41 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv10193/src/org/semanticmoby/graph Added Files: MOBYResourceSet.java MOBYResource.java Removed Files: MOBYService.java MOBYServiceSet.java Log Message: Changed Service to Resource s-moby/ref-impl/core/src/org/semanticmoby/graph MOBYResourceSet.java,NONE,1.1 MOBYResource.java,1.2,1.3 MOBYService.java,1.2,NONE MOBYServiceSet.java,1.2,NONE =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/MOBYResource.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/MOBYResource.java 2005/09/14 22:06:10 1.2 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/MOBYResource.java 2005/10/27 22:20:41 1.3 @@ -1,30 +1,263 @@ package org.semanticmoby.graph; -import org.semanticmoby.graph.*; - import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; + +import org.semanticmoby.tools.Util; + +import org.semanticmoby.vocabulary.MOBY; + +import java.io.*; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + + +/** + * This class represents a resource that provides a + * resource in MOBY. + */ +public class MOBYResource extends MOBYGraphNode { + + /** + * The name of the provider; stored in MOBY.name property + */ + private Statement nameStmt; + + /** + * A one line description of the provider; stored in the + * MOBY.oneLineDescription property + */ + private Statement oneLineDescriptionStmt; + + /** + * A URI at which more information can be retrieved about the + * provider; stored in the MOBY.moreInfoURI property + */ + private Statement aboutURIStmt; + + /** + * The MOBYGraphNode objects that this Resource operates on (instances of + * either MOBYCollection or MOBYGraph), each keyed by the statement that + * links this resource's URI to it via a hasMapping property + */ + private Map operatesOnGraphStmts = new HashMap(); + + /** + * Constructor for creating a MOBYResource API object from scratch, given + * a model, URI, name, one line description, and about URI for the resource. + * Since the RDF statements that the resource represents don't yet exist, it + * creates and adds them to the model. + * @param model the underlying Jena model to add the statements to + * @param uri the URI of the resource + * @param name a name for the resource; stored in the moby:name property + * @param oneLineDescription a one line description for the resource; + * stored in the moby:oneLineDescription property + */ + public MOBYResource(Model jenaModel, String uri, String name, + String oneLineDescription, String aboutURI) { + super(jenaModel, + jenaModel.createStatement(jenaModel.createResource(uri), + RDF.type, MOBY.Resource)); + + // Save the literal properties by creating the corresponding + // statements and adding them to the model + // + jenaModel.add(nameStmt = + jenaModel.createStatement(getResource(), MOBY.name, name)); + + jenaModel.add(oneLineDescriptionStmt = + jenaModel.createStatement(getResource(), + MOBY.oneLineDescription, + oneLineDescription)); + + jenaModel.add(aboutURIStmt = + jenaModel.createStatement(getResource(), MOBY.aboutURI, + aboutURI)); + } + + + /** + * Constructor for creating a MOBYResource API object from scratch, given + * a URI, name, and one line description for the resource. The method + * first creates a default model using Util.newJenaModel(), and since + * the RDF statements that the resource represents don't yet exist, it + * then creates and adds them to the model. + * @param uri the URI of the resource + * @param name a name for the resource; stored in the moby:name property + * @param oneLineDescription a one line description for the resource; + * stored in the moby:oneLineDescription property + */ + public MOBYResource(String uri, String name, String oneLineDescription, + String aboutURI) { + this(Util.newJenaModel(), uri, name, oneLineDescription, aboutURI); + } + + + /** + * Constructor for creating an instance from existing RDF statements, as + * is the case when parsing an existing model. + */ + public MOBYResource(Model jenaModel, Statement definingStmt, + Statement nameStmt, Statement oneLineDescriptionStmt, + Statement aboutURIStmt, Map operatesOnGraphs) { + super(jenaModel, definingStmt); + this.nameStmt = nameStmt; + this.oneLineDescriptionStmt = oneLineDescriptionStmt; + this.aboutURIStmt = aboutURIStmt; + + for (Iterator it = operatesOnGraphs.keySet().iterator(); it.hasNext();) { + + Statement operatesOnStmt = (Statement) it.next(); + MOBYGraphNode node = + (MOBYGraphNode) operatesOnGraphs.get(operatesOnStmt); + addOperatesOnGraph(operatesOnStmt, node); + } + } + + /** + * Adds a new operatesOn subgraph and an operatesOn statement + */ + public void addOperatesOnGraph(MOBYGraphNode newGraph) { + + // Create and add a statement moby:operatesOn + Statement operatesOnStmt = + jenaModel.createStatement(getResource(), MOBY.operatesOn, + newGraph.getResource()); + addOperatesOnGraph(operatesOnStmt, newGraph); + } + + + /** + * Adds a new operatesOn Graph, linking it to the defining statement's + * resource with an operatesOn property + */ + public void addOperatesOnGraph(Statement operatesOnStmt, + MOBYGraphNode newGraph) { + + jenaModel.add(operatesOnStmt); + operatesOnGraphStmts.put(newGraph, operatesOnStmt); + } + + + /** + * Removes the graph node and its RDF statements from the underlying + * Jena model + */ + public void removeOperatesOnGraph(MOBYGraphNode node) { + + Statement stmt = (Statement) operatesOnGraphStmts.get(node); + + if (stmt != null) { + + jenaModel.remove(stmt); + } + + node.removeStatements(); + } + + + public Iterator getOperatesOn() { + + return operatesOnGraphStmts.keySet().iterator(); + } + + + /** + * Removes the statements representing this resource, and calls + * removeStatements on all Graph objects related to it through + * operatesOn properties + */ + public void removeStatements() { + + // Remove the defining statement + removeDefiningStatement(); + + // Remove the statements asserting the name and + // oneLineDescription properties + if (nameStmt != null) { + + jenaModel.remove(nameStmt); + nameStmt = null; + } + + if (oneLineDescriptionStmt != null) { + + jenaModel.remove(oneLineDescriptionStmt); + oneLineDescriptionStmt = null; + } + + if (aboutURIStmt != null) { + + jenaModel.remove(aboutURIStmt); + aboutURIStmt = null; + } + + // Remove each of the operatesOn statements, and have each + // MOBYGraphNode object remove its statements + if (operatesOnGraphStmts != null) { + + for (Iterator it = operatesOnGraphStmts.keySet().iterator(); + it.hasNext();) { + + MOBYGraphNode gnode = (MOBYGraphNode) it.next(); + Statement s = (Statement) operatesOnGraphStmts.get(gnode); + operatesOnGraphStmts.remove(s); + jenaModel.remove(s); + gnode.removeStatements(); + } + + operatesOnGraphStmts = null; + } + } + + + /** + * Return a descriptive name for the provider. + */ + public String getName() { + + return (nameStmt == null) ? "" : nameStmt.getObject().toString(); + } + + + /** + * Return a short (one line) description for the provider. + */ + public String getOneLineDescription() { + + return (oneLineDescriptionStmt == null) ? "" + : oneLineDescriptionStmt.getObject() + .toString(); + } + + + /** + * Return a URI that can be accessed to obtain more information + * about the provider. + */ + public String getAboutURI() { + + return (aboutURIStmt == null) ? "" : aboutURIStmt.getObject().toString(); + } + + + /** + * Serialize the underlying model as RDF/XML to the given output stream + */ + public void serialize(OutputStream out) { + + jenaModel.write(out); + } + + + /** + * Serialize the underlying model as N3 to the given output stream + */ + public void serializeAsN3(OutputStream out) { -public class MOBYResource extends MOBYPropertyValue -{ - private Resource resourceValue; - - public MOBYResource(Resource resourceValue) { - this.resourceValue = resourceValue; - } - - public String getResourceURI() { - return resourceValue.getURI(); - } - - public boolean isLiteral() { - return false; - } - - public boolean isResource() { - return true; - } - - public boolean isBlank() { - return resourceValue.isAnon(); + jenaModel.write(out, "N3"); } -} \ No newline at end of file +} rcsdiff: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYService.java,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYServiceSet.java,v: No such file or directory From gss at pub.open-bio.org Thu Oct 27 18:22:09 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 27 Oct 2005 18:22:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272222.j9RMM9Ne010284@pub.open-bio.org> gss Thu Oct 27 18:22:09 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv10259/src/org/semanticmoby/parser Modified Files: Parser.java Log Message: Refer to Resource rather than Service s-moby/ref-impl/core/src/org/semanticmoby/parser Parser.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/10/09 01:33:06 1.6 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/10/27 22:22:08 1.7 @@ -48,7 +48,7 @@ */ public Parser(Model model) { - StmtIterator it = model.listStatements(null, RDF.type, MOBY.Service); + StmtIterator it = model.listStatements(null, RDF.type, MOBY.Resource); while (it.hasNext()) { @@ -157,31 +157,31 @@ /** - * Parse a MOBYService from the model. If the model contains multiple - * services, only one will be returned (at random), so if the model is - * expected to contain multiple services, then call parseServices() instead to get all the providers in a + * Parse a MOBYResource from the model. If the model contains multiple + * resources, only one will be returned (at random), so if the model is + * expected to contain multiple resources, then call parseResources() instead to get all the providers in a * MOBYCollection. */ - public MOBYService parseService() throws NonCanonicalException { + public MOBYResource parseResource() throws NonCanonicalException { - List services = parseServices(); + List resources = parseResources(); - if (services.size() == 0) { + if (resources.size() == 0) { return null; } else { - return (MOBYService) services.iterator().next(); + return (MOBYResource) resources.iterator().next(); } } /** - * Parse and return an list of MOBYService objects + * Parse and return an list of MOBYResource objects */ - public List parseServices() throws NonCanonicalException { + public List parseResources() throws NonCanonicalException { - ArrayList services = new ArrayList(); + ArrayList resources = new ArrayList(); Iterator it = subModels.iterator(); @@ -189,24 +189,24 @@ Model model = (Model) it.next(); StmtIterator it2 = - model.listStatements(null, RDF.type, MOBY.Service); + model.listStatements(null, RDF.type, MOBY.Resource); if (it2 != null) { Statement stmt = it2.nextStatement(); - services.add(parseService(stmt)); + resources.add(parseResource(stmt)); } } - return services; + return resources; } /** - * Parse a service starting from the given resource (i.e. a resource that - * is the subject of an rdf:type statement with object of moby:Service) + * Parse a resource starting from the given resource (i.e. a resource that + * is the subject of an rdf:type statement with object of moby:Resource) */ - public MOBYService parseService(Statement typeStmt) + public MOBYResource parseResource(Statement typeStmt) throws NonCanonicalException { Resource headResource = typeStmt.getSubject(); @@ -222,7 +222,7 @@ Statement aboutURIStmt = model.getProperty(headResource, MOBY.aboutURI); - // A service can have multiple operatesOn properties, each of + // A resource can have multiple operatesOn properties, each of // which leads to a subgraph. Parse each of these subgraphs. // Map operatesOn = new HashMap(); @@ -237,10 +237,10 @@ operatesOn.put(operatesOnStmt, parseOperatesOn(r)); } - // Create and return a new Service object using the service URI, name, + // Create and return a new Resource object using the resource URI, name, // oneLineDescription, aboutURI, and collection of operatesOn subgraphs // - return new MOBYService(model, typeStmt, nameStmt, + return new MOBYResource(model, typeStmt, nameStmt, oneLineDescriptionStmt, aboutURIStmt, operatesOn); } From gss at pub.open-bio.org Thu Oct 27 18:22:09 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 27 Oct 2005 18:22:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272222.j9RMM9M9010307@pub.open-bio.org> gss Thu Oct 27 18:22:09 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv10259/src/org/semanticmoby/servlet Modified Files: AbstractMobyServlet.java package.html Log Message: Refer to Resource rather than Service s-moby/ref-impl/core/src/org/semanticmoby/servlet AbstractMobyServlet.java,1.3,1.4 package.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2005/10/09 01:33:06 1.3 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2005/10/27 22:22:09 1.4 @@ -67,7 +67,7 @@ * in, that serves as "input" to the provider. * @return a graph containing the work product of the provider. */ - protected abstract void handleRequest(MOBYService requestGraph); + protected abstract void handleRequest(MOBYResource requestGraph); /** @@ -110,7 +110,7 @@ /** - * By MOBY convention, an HTTP POST equates to a request for the service + * By MOBY convention, an HTTP POST equates to a request for the resource * provided by a provider. */ public void doPost(HttpServletRequest request, HttpServletResponse response) @@ -127,16 +127,16 @@ ParamReader.getParameter(MOBY.GRAPH_PARAMETER_NAME, request); Parser parser = Parser.forString(graphString, Parser.LANGUAGE_RDF_XML); - MOBYService service = parser.parseService(); + MOBYResource resource = parser.parseResource(); // Invoke the abstract handleRequest() method in order for the // provider servlet to do whatever it does to the graph. // - handleRequest(service); + handleRequest(resource); // Send the graph back in response // - service.serialize(out); + resource.serialize(out); } catch (Throwable t) { t.printStackTrace(); =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/package.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/package.html 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/package.html 2005/10/27 22:22:09 1.2 @@ -1,5 +1,5 @@ -Classes to facilitate building Semantic MOBY services using Java servlets. +Classes to facilitate building Semantic MOBY resources using Java servlets. - \ No newline at end of file + From gss at pub.open-bio.org Thu Oct 27 18:22:09 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 27 Oct 2005 18:22:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272222.j9RMM9kW010327@pub.open-bio.org> gss Thu Oct 27 18:22:09 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv10259/src/org/semanticmoby/vocabulary Modified Files: MOBY.java Log Message: Refer to Resource rather than Service s-moby/ref-impl/core/src/org/semanticmoby/vocabulary MOBY.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2005/10/09 01:33:07 1.3 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2005/10/27 22:22:09 1.4 @@ -3,7 +3,10 @@ import com.hp.hpl.jena.graph.*; import com.hp.hpl.jena.rdf.model.*; - +/** + * A utility class with static instance variables for helping with ontology + * related tasks. + */ public class MOBY extends VocabularyDescription { public final static String IF_MODIFIED_HEADER = "If-Modified-Since"; @@ -16,11 +19,11 @@ * value is a serialized RDF/XML graph. */ public final static String GRAPH_PARAMETER_NAME = "graph"; - public static final Resource Service = resource(getURI(), "Service"); - public static final Resource Graph = resource(getURI(), "Graph"); - public static final Resource Subject = resource(getURI(), "Subject"); - public static final Resource Object = resource(getURI(), "Object"); - public static final Property name = property(getURI(), "name"); + public static final Resource Resource = resource(getURI(), "Resource"); + public static final Resource Graph = resource(getURI(), "Graph"); + public static final Resource Subject = resource(getURI(), "Subject"); + public static final Resource Object = resource(getURI(), "Object"); + public static final Property name = property(getURI(), "name"); public static final Property oneLineDescription = property(getURI(), "oneLineDescription"); public static final Property aboutURI = From senger at pub.open-bio.org Fri Oct 28 03:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8l6012478@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/client Modified Files: CentralDigestImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestImpl.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/27 04:15:23 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/28 07:58:08 1.9 @@ -385,9 +385,16 @@ public void fireEvent (int type, Object message, Object details) { NotificationEvent event = null; if (details == null) - event = new NotificationEvent (this, type, message.toString()); + event = new NotificationEvent (this, type, message); else - event = new NotificationEvent (this, type, message.toString(), details); + event = new NotificationEvent (this, type, message, details); + fireEvent (event); + } + + /********************************************************************* + * + ********************************************************************/ + public void fireEvent (NotificationEvent event) { if (listeners != null) { synchronized (listeners) { for (int i = 0; i < listeners.size(); i++) { From senger at pub.open-bio.org Fri Oct 28 03:58:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w9fJ012585@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/shared/event Modified Files: NotificationEvent.java Notifier.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,1.3,1.4 Notifier.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/27 04:15:23 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/28 07:58:08 1.4 @@ -17,13 +17,18 @@ * registry (how many entities to read, and which one was just * read).

    * - * Each notification event points to its source (this is inherited - * from a usual Java's EventObject). Additionally, it has its type (an - * integer value, preferably taken from a list defined in interface - * {@link org.biomoby.shared.event.Notifier}), a message (whose format - * may be determined by the notification type), and optionally an - * object with more details (again, its presence or absence may depend - * on the notification type).

    + * Each notification event points to its source - this is inherited + * from a usual Java EventObject. Sometimes, however, the semantics of + * the source may change to indicate not the event producer but the + * event initiator (an instance that caused that something had + * happened that triggered later sending an event).

    + * + * Additionally, it has its type (an integer value, preferably taken + * from a list defined in interface {@link + * org.biomoby.shared.event.Notifier}), a message (whose format may be + * determined by the notification type), and optionally an object with + * more details (again, its presence or absence may depend on the + * notification type).

    * * @author Martin Senger * @version $Id$ @@ -33,7 +38,7 @@ extends EventObject { private int type; - private String message; + private Object message; private Object details; /********************************************************************* @@ -47,7 +52,7 @@ * A usual constructor, setting notification type and a message. ********************************************************************/ public NotificationEvent (Object source, - int type, String message) { + int type, Object message) { this (source); this.type = type; this.message = (message == null ? "" : message); @@ -58,8 +63,7 @@ * details. ********************************************************************/ public NotificationEvent (Object source, - int type, String message, - Object details) { + int type, Object message, Object details) { this (source, type, message); this.details = details; } @@ -74,7 +78,7 @@ /********************************************************************* * Return a message associated with this notification event. ********************************************************************/ - public String getMessage() { + public Object getMessage() { return message; } @@ -99,8 +103,9 @@ StringBuffer buf = new StringBuffer (100); buf.append ("["); buf.append (typeStr); - if (UUtils.notEmpty (message)) - buf.append (", Message=" + message); + if (message != null && + ( message instanceof String || message instanceof Integer || message instanceof Boolean )) + buf.append (" " + message); if (details != null) buf.append (", Details=" + details.getClass().getName()); buf.append ("]"); @@ -108,34 +113,35 @@ } static final String[] typeTexts = new String[] { - "data-type-start", - "data-type-count", - "data-type-loading", - "data-type-loaded", - "data-type-end", - "service-type-start", - "service-type-count", - "service-type-loading", - "service-type-loaded", - "service-type-end", - "namespace-start", - "namespace-count", - "namespace-loading", - "namespace-loaded", - "namespace-end", - "authority-start", - "authority-count", - "authority-loading", - "authority-loaded", - "authority-end", - "data-type-reset", - "service-type-reset", - "namespace-reset", - "authority-reset", - "data-type-cancel", - "service-type-cancel", - "namespace-cancel", - "authority-cancel" + "data-type-start", // [ 0] + "data-type-count", // [ 1] + "data-type-loading", // [ 2] + "data-type-loaded", // [ 3] + "data-type-end", // [ 4] + "service-type-start", // [ 5] + "service-type-count", // [ 6] + "service-type-loading", // [ 7] + "service-type-loaded", // [ 8] + "service-type-end", // [ 9] + "namespace-start", // [10] + "namespace-count", // [11] + "namespace-loading", // [12] + "namespace-loaded", // [13] + "namespace-end", // [14] + "authority-start", // [15] + "authority-count", // [16] + "authority-loading", // [17] + "authority-loaded", // [18] + "authority-end", // [19] + "data-type-reset", // [20] + "service-type-reset", // [21] + "namespace-reset", // [22] + "authority-reset", // [23] + "data-type-cancel", // [24] + "service-type-cancel", // [25] + "namespace-cancel", // [26] + "authority-cancel", // [27] + "data-type-updated" // [28] }; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/22 01:38:04 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/28 07:58:08 1.4 @@ -50,6 +50,7 @@ static final int NAMESPACES_CANCELLED = 26; static final int AUTHORITIES_CANCELLED = 27; + static final int DATA_TYPES_UPDATED = 28; static final int SIGNAL_CANCEL_DATA_TYPES = 1; @@ -117,4 +118,9 @@ ********************************************************************/ void fireEvent (int type, Object message, Object details); + /********************************************************************* + * + ********************************************************************/ + void fireEvent (NotificationEvent event); + } From senger at pub.open-bio.org Fri Oct 28 03:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8GI012555@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/shared Modified Files: MobyDataType.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyDataType.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/10/25 09:02:08 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/10/28 07:58:08 1.11 @@ -8,7 +8,7 @@ package org.biomoby.shared; import org.tulsoft.shared.UUtils; - +import java.util.Comparator; /** * A container representing a data type used in the Moby registry (in @@ -307,4 +307,17 @@ comment = (value == null ? "" : value); } + /************************************************************************** + * Create a comparator for case-insensitive sorting of data types + * by their authorities. + *************************************************************************/ + public static Comparator getAuthorityComparator() { + return new Comparator() { + public int compare (Object o1, Object o2) { + String a1 = ((MobyDataType)o1).getAuthority(); + String a2 = ((MobyDataType)o2).getAuthority(); + return (a1).compareToIgnoreCase ((String)a2); + } + }; + } } From senger at pub.open-bio.org Fri Oct 28 03:58:54 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7wsWd012629@pub.open-bio.org> senger Fri Oct 28 03:58:53 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv12614/src/config Added Files: log4j.properties Log Message: moby-live/Java/src/config log4j.properties,NONE,1.1 From senger at pub.open-bio.org Fri Oct 28 03:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8Po012536@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/service/dashboard Modified Files: AbstractModel.java CommonBoard.java CommonTree.java Dashboard.java DashboardPanel.java DashboardProperties.java DataTypesBoard.java DataTypesTree.java NOTES RegistryModel.java Added Files: GraphColours.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard GraphColours.java,NONE,1.1 AbstractModel.java,1.2,1.3 CommonBoard.java,1.2,1.3 CommonTree.java,1.7,1.8 Dashboard.java,1.8,1.9 DashboardPanel.java,1.5,1.6 DashboardProperties.java,1.7,1.8 DataTypesBoard.java,1.3,1.4 DataTypesTree.java,1.4,1.5 NOTES,1.11,1.12 RegistryModel.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/10/27 08:55:48 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/10/28 07:58:08 1.3 @@ -8,36 +8,12 @@ package org.biomoby.service.dashboard; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeSupport; - /** * A common super-class for all Dashboard models. A model is a worker * for a panel: a panel displays what its model provides.

    * * This abstract parent helps to deal with listening and fireing - * property changes. Here is how it works generally:

    - * - *

      - * - *
    • Each model gets (from its panel) an instance of a - * PropertyChangeSupport class which gives it a list of - * registered listeners, so a model can fire messages to them. For - * example, a RegistryPanel may fire a message that a new list of data - * types is available. Or typically a model will send a hear-beat - * messages if it is working on a long-run job (this messages will be - * intercept by a StatusBar, for example).

      - * - * Note, however, that this shared PropertyChangeSupport - * object knows only about a panel (it was created for a panel, not - * for a model) so a model cannot use it to add its own listeners - * (they would become listeners of a panel, not a model). In the - * practise, this should not be a problem I guess.

      - * - *

    • Each model is also a listener of property changes.

      - * - *

    + * property changes via a property channel.

    * * @author Martin Senger * @version $Id$ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/27 08:55:48 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/28 07:58:08 1.3 @@ -42,6 +42,9 @@ extends JPanel implements NotificationListener { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + protected RegistryModel model; protected PropertyChannel channel; @@ -69,7 +72,7 @@ * Update the underlying tree. ********************************************************************/ public void updateTree (int howSorted) { - tree.update (howSorted); + tree.update (howSorted, null); } /********************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/26 08:05:18 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/28 07:58:08 1.8 @@ -166,7 +166,7 @@ * Get data from a registry model and update the tree. Will be * overwritten by subclass. ********************************************************************/ - public void update (int howSorted) { + public void update (int howSorted, Object data) { } /********************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/27 08:55:48 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/28 07:58:08 1.9 @@ -26,6 +26,7 @@ import java.awt.GridBagLayout; import java.awt.Font; +import java.awt.Color; import java.awt.Dimension; import java.beans.PropertyChangeListener; @@ -50,10 +51,14 @@ public class Dashboard implements DashboardPanel, ChangeListener { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + private JComponent dashboard; private DashboardHeader header; public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; + protected Color bgcolor; protected DashboardPanel[] panels; protected PropertyChannel propertyChannel; protected static Properties dashboardProperties; @@ -75,8 +80,8 @@ dashboardProperties.load (resourceURL.openStream()); } } catch (Exception e) { - System.err.println ("WARNING: Cannot find/open/read dasboard property file " + - DASHBOARD_PROPERTIES_FILE + ": " + e.toString()); + log.warn ("Cannot find/open/read dasboard property file " + + DASHBOARD_PROPERTIES_FILE + ": " + e.toString()); } } @@ -181,8 +186,12 @@ ProgressView.monitor.show ("Welcome to Biomoby Dashboard"); } + // create itself JPanel p = new JPanel (new GridBagLayout(), true); + bgcolor = GraphColours.getColour ((String)dashboardProperties.get (DP_BGCOLOR), + p.getBackground()); + p.setBackground (bgcolor); header = getHeader(); tabbedPane = new JTabbedPane(); @@ -222,6 +231,7 @@ class DashboardHeader extends JPanel { public DashboardHeader (Properties props) { super (new GridBagLayout()); + setBackground (bgcolor); JLabel mainTitle = getTitle(); JLabel mainIcon = new JLabel ("", =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/10/27 08:55:48 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/10/28 07:58:08 1.6 @@ -12,18 +12,11 @@ import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; -import java.beans.PropertyChangeListener; /** * An interface that must be implemented by each panel that wants to * sit on a dashboard.

    * - * WORK IN PROGRESS

    - * - * All classes that implements this interface (i.e. all dashboard - * panels) are also PropertyChangeListener. It allows them to listen - * to changes happening in other panels.

    - * * @author Martin Senger * @version $Id$ */ @@ -70,20 +63,4 @@ **************************************************************************/ Icon getIcon(); -// /************************************************************************** -// * Add a PropertyChangeListener to the listener list of a -// * panel. All listeners will be notified if this panel changes -// * some property.

    -// * -// * The panel should document what properties can fire - but at the -// * moment it is not part of its interface.

    -// * -// **************************************************************************/ -// void addPropertyChangeListener (PropertyChangeListener listener); - -// /************************************************************************** -// * Remove a PropertyChangeListener. -// **************************************************************************/ -// void removePropertyChangeListener(PropertyChangeListener listener); - } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/26 08:05:18 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/28 07:58:08 1.8 @@ -13,9 +13,6 @@ import javax.swing.Icon; import javax.swing.JComponent; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; - /** * A list of names of most/all recognized properties that can be fired * by dashboard panels, and a list of names of Java properties that @@ -71,6 +68,13 @@ * recommended) or a relative path whose beginning can be found * somewhere on the CLASSPATH. */ + static final String DP_ICON = "dashboard.icon"; + /** A property name. Its value contains a color name used to paint + * main dashboard background. The name can be a color name, or a + * number in various format (see GraphColours for + * details). + */ + static final String DP_BGCOLOR = "dashboard.bgcolor"; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/27 08:55:48 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/28 07:58:08 1.4 @@ -8,6 +8,7 @@ package org.biomoby.service.dashboard; +import org.biomoby.shared.MobyDataType; import org.biomoby.shared.event.NotificationEvent; import org.biomoby.shared.event.Notifier; import org.tulsoft.shared.UUtils; @@ -27,6 +28,9 @@ public class DataTypesBoard extends CommonBoard { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + /********************************************************************* * Constructor.

    * @@ -64,13 +68,15 @@ * ********************************************************************/ public void notified (NotificationEvent event) { + Object initiator; switch (event.getType()) { case Notifier.DATA_TYPES_START: createProgressBar (Notifier.SIGNAL_CANCEL_DATA_TYPES); insertProgressBar(); break; case Notifier.DATA_TYPES_COUNT: - calibrateProgressBar (UUtils.toInt (event.getMessage())); + if (event.getMessage() instanceof Integer) + calibrateProgressBar ( ((Integer)event.getMessage()).intValue() ); break; case Notifier.DATA_TYPE_LOADING: channel.fire (DashboardProperties.DP_STATUS_MSG, event.getMessage()); @@ -81,9 +87,21 @@ case Notifier.DATA_TYPES_END: case Notifier.DATA_TYPES_CANCELLED: case Notifier.DATA_TYPES_RESET: - channel.fire (DashboardProperties.DP_STATUS_MSG, "Done"); + initiator = event.getSource(); + if (tree == initiator) + channel.fire (DashboardProperties.DP_STATUS_MSG, "Done"); removeProgressBar(); break; + case Notifier.DATA_TYPES_UPDATED: + initiator = event.getSource(); + if (tree != initiator) { + // someone else (ot this instance) initiated request + // for updating data types - so we need to update our + // own tree - using for that data types included in + // this event + tree.update (-1, (MobyDataType[])event.getDetails()); + } + break; } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/25 09:02:07 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/28 07:58:08 1.5 @@ -42,6 +42,9 @@ public class DataTypesTree extends CommonTree { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + // action commands for popup menu items protected final static String AC_NSORT = "ac-nsort"; protected final static String AC_ASORT = "ac-asort"; @@ -87,14 +90,14 @@ popup.add (createMenuItem (new AbstractAction ("Sort by names") { public void actionPerformed (ActionEvent e) { - update (lastSorted = SORTED_BY_NAME); + update (lastSorted = SORTED_BY_NAME, null); deprecatedBox.setEnabled (true); } }, AC_NSORT)); popup.add (createMenuItem (new AbstractAction ("Sort by authorities") { public void actionPerformed (ActionEvent e) { - update (lastSorted = SORTED_BY_AUTHORITY); + update (lastSorted = SORTED_BY_AUTHORITY, null); deprecatedBox.setEnabled (false); } }, AC_ASORT)); @@ -105,7 +108,7 @@ showBox.addItemListener (new ItemListener() { public void itemStateChanged (ItemEvent e) { showMembers = (e.getStateChange() == ItemEvent.SELECTED); - update (lastSorted); + update (lastSorted, null); } }); popup.add (showBox); @@ -116,7 +119,7 @@ public void itemStateChanged (ItemEvent e) { showBadGuys = (e.getStateChange() == ItemEvent.SELECTED); if (showBadGuys) - update (lastSorted); + update (lastSorted, null); else removeBadGuys(); } @@ -125,20 +128,35 @@ } /********************************************************************* - * Get data from a registry model and update the tree. + * Get data (usually from a registry model, but if not null, take + * them from 'newData') and update the tree. ********************************************************************/ - public void update (int howSorted) { - setEnabledPopup (false); + public void update (int howSorted, Object newData) { + if (howSorted < 0) howSorted = lastSorted; + setEnabledPopup (false); updateException = null; + final Object source = this; final int sorted = howSorted; + final MobyDataType[] newDataTypes = + (newData == null ? null : (MobyDataType[])newData); + final SwingWorker worker = new SwingWorker() { public Object construct() { try { + // get data types (unless you already have them) + if (newDataTypes == null) + dataTypes = registryModel.getDataTypes (source); + else + dataTypes = newDataTypes; + + // ...and sort them accordingly if (sorted == SORTED_BY_AUTHORITY) - dataTypes = registryModel.getDataTypesByAuthority(); + java.util.Arrays.sort + (dataTypes, MobyDataType.getAuthorityComparator()); else - dataTypes = registryModel.getDataTypesByNames(); + java.util.Arrays.sort (dataTypes); + } catch (MobyException e) { updateException = e; } @@ -277,7 +295,7 @@ * updating) cache. ********************************************************************/ protected void reload() { - update (lastSorted); + update (lastSorted, null); } /********************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/26 08:05:18 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/28 07:58:08 1.12 @@ -1,40 +1,14 @@ -? logging (LogPanel and/or usual logging to a file?) -* communication with StatusBar (incl. progress bar, cancel button) -* disabling things during a long-time operation -* general Console panel (save button; various renderes?) -* graphics to trees - ---- -To put this somewhere (a small "Memory panel" that can be add -anywhere in time of debugging...): - -The heap is the area in memory in which objects are created. - - // Get current size of heap in bytes - long heapSize = Runtime.getRuntime().totalMemory(); - - // Get maximum size of heap in bytes. The heap cannot grow beyond this size. - // Any attempt will result in an OutOfMemoryException. - long heapMaxSize = Runtime.getRuntime().maxMemory(); - - // Get amount of free memory within the heap in bytes. This size will increase - // after garbage collection and decrease as new objects are created. - long heapFreeSize = Runtime.getRuntime().freeMemory(); - ---- - TODO generally: --------------- +? some of the notification stuff can inherir from propertychange stuff + * notice that the dasboard is used the first time and offer to create a list of wanted panels (some of them are suggested as default) * notice that user does not use cache (and that he did not select "do not check it at startup") and tell him "do you want a cache?" -* BUG: not sure why so many (repeated) changes from the actionlistener -in JFieldTextWithHistory - ? select a part of an error message and highlight it in red? ? HELP (in a Dashboard Menu) @@ -43,27 +17,13 @@ - credits - add dynamically a URL from dashboard.properties... -TODO with views: ----------------- * change onMethods() to be protected or even private... -* add a progress bar to the status bar (on the right) - - add also a cancel buton there - - do not allow more than one progressbar-aware action in the same time - file:///c/Development/java-tutorial/uiswing/components/progress.html - -? small icons to buttons -? use FileSystemView in file choosers -? alltools2: - - combo box history is not updated if exit happened while focus is still in the text field - -? configure dashboard from menu: - * configure dashbard (add/remove dynamically panels) - * configure user preferences +? improve API javadoc of all these Central*Impl +? start to work on/think of the RDF-based cache TODO for cache: --------------- -* emit log events; use them also in cmdline clients * poor-man update: keep what's there but add what is not there (and perhaps delete what should not be there) - but do not check any age of existing @@ -73,15 +33,13 @@ * remove memory-caching from CentralImpl * graphics by default: yes for datatyeps and no for services -? improve API javadoc of all these Central*Impl -? start to work on/think of the RDF-based cache - General options (available from the menu) --------------- * export/import user preferences * set-up what panels are wanted * language ( => use proper ResourceBundler...) + Registry panel -------------- @@ -114,10 +72,22 @@ - verify registry - browsing in graphs - RDF resources -- Log panel -- Configure a new Dashboard - - Debugging panel (with a Memory Panel embedded; replacing current two pannels) + To put this somewhere (a small "Memory panel" that can be add + anywhere in time of debugging...): + + The heap is the area in memory in which objects are created. + + // Get current size of heap in bytes + long heapSize = Runtime.getRuntime().totalMemory(); + + // Get maximum size of heap in bytes. The heap cannot grow beyond this size. + // Any attempt will result in an OutOfMemoryException. + long heapMaxSize = Runtime.getRuntime().maxMemory(); + + // Get amount of free memory within the heap in bytes. This size will increase + // after garbage collection and decrease as new objects are created. + long heapFreeSize = Runtime.getRuntime().freeMemory(); UNSOLVED (mysteries and not-yet-dones) ======== @@ -130,12 +100,6 @@ - the BuildDataTypeTree is sometimes damaged (after adding a member node); not sure how to reproduce it - ! loading... does not sync correctly with the browser panel - - ! more generally: simplify (or at least document) what kind of notifications - are used (now, it seems to be confusin what has PropertyChannel and what - is registered by 'support') - ! finish all the caching stuff (separate scrap of paper) * After registration, update cache, update list @@ -144,6 +108,14 @@ * Icons: - better icon for AddHAS (with a small star) + ? small icons to buttons + ? graphics to trees + - small icon to the status bar * alltools2: - JTextFieldWithHistory should remember also an empty value ("") + - combo box history is not updated if exit happened while focus is still in the text field + ? use FileSystemView in file choosers + * BUG: not sure why so many (repeated) changes from the actionlistener + in JFieldTextWithHistory + =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/27 08:55:48 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/28 07:58:08 1.9 @@ -19,13 +19,8 @@ import org.biomoby.shared.event.NotificationEvent; import org.biomoby.shared.event.NotificationListener; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeSupport; - import java.util.HashSet; import java.util.Hashtable; -import java.util.Comparator; import java.util.regex.Pattern; /** @@ -41,6 +36,9 @@ extends AbstractModel implements Notifier { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + CentralAll worker; boolean useCache = true; Hashtable dataTypesTable; @@ -102,35 +100,18 @@ } /********************************************************************* - * + * Fetch data types (from a cache or from a registry). When done, + * signal that data type are updated. If an initiator is known + * (not null), signal, who asked for data, as well. ********************************************************************/ - public MobyDataType[] getDataTypesByNames() + public synchronized MobyDataType[] getDataTypes (Object initiator) throws MobyException { initWorker(); - fireEvent (DATA_TYPES_RESET, "", null); + if (initiator != null) + fireEvent (initiator, DATA_TYPES_RESET, "", null); MobyDataType[] dataTypes = worker.getDataTypes(); - java.util.Arrays.sort (dataTypes); - return dataTypes; - } - - /********************************************************************* - * - ********************************************************************/ - public MobyDataType[] getDataTypesByAuthority() - throws MobyException { - initWorker(); - fireEvent (DATA_TYPES_RESET, "", null); - MobyDataType[] dataTypes = worker.getDataTypes(); - java.util.Arrays.sort - (dataTypes, - new Comparator() { - public int compare (Object o1, Object o2) { - String a1 = ((MobyDataType)o1).getAuthority(); - String a2 = ((MobyDataType)o2).getAuthority(); - return (a1).compareToIgnoreCase ((String)a2); - } - }); - + if (initiator != null) + fireEvent (initiator, DATA_TYPES_UPDATED, "", dataTypes); return dataTypes; } @@ -142,7 +123,7 @@ if (dataTypeName == null) return null; - MobyDataType[] dataTypes = getDataTypesByNames(); + MobyDataType[] dataTypes = getDataTypes (null); if (dataTypesTable == null) { dataTypesTable = new Hashtable(); @@ -161,7 +142,7 @@ public HashSet find (String searchText) throws MobyException { HashSet found = new HashSet(); - MobyDataType[] dataTypes = getDataTypesByNames(); + MobyDataType[] dataTypes = getDataTypes (null); if (! searchText.startsWith ("(?i)")) searchText = "(?i)" + searchText; Pattern pattern = Pattern.compile (searchText); @@ -233,8 +214,7 @@ initWorker(); ((Notifier)worker).addNotificationListener (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -246,8 +226,7 @@ initWorker(); ((Notifier)worker).addNotificationListeners (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -259,8 +238,7 @@ initWorker(); ((Notifier)worker).removeNotificationListener (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -272,8 +250,7 @@ initWorker(); ((Notifier)worker).removeNotificationListeners (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -285,8 +262,7 @@ initWorker(); return ((Notifier)worker).getNotificationListeners(); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); return new NotificationListener[] {}; } } @@ -307,4 +283,26 @@ ((Notifier)worker).fireEvent (type, message, details); } + /********************************************************************* + * + ********************************************************************/ + public void fireEvent (NotificationEvent event) { + if (worker != null) + ((Notifier)worker).fireEvent (event); + } + + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (Object source, + int type, Object message, Object details) { + NotificationEvent event = null; + if (details == null) + event = new NotificationEvent (source, type, message); + else + event = new NotificationEvent (source, type, message, details); + fireEvent (event); + } + } From senger at pub.open-bio.org Fri Oct 28 03:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8bW012440@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv12421 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.38,1.39 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/25 09:07:22 1.38 +++ /home/repository/moby/moby-live/Java/build.xml 2005/10/28 07:58:08 1.39 @@ -88,6 +88,10 @@ + + + + @@ -537,8 +541,8 @@ + From senger at pub.open-bio.org Wed Oct 12 11:17:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 12 Oct 2005 07:17:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121117.j9CBHxkW013563@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv13525/src/Clients/help Modified Files: MobyDigest_usage.txt Log Message: moby-live/Java/src/Clients/help MobyDigest_usage.txt,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/22 16:07:08 1.4 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/10/12 11:17:59 1.5 @@ -31,5 +31,7 @@ -details ... print the above with all details (by default only names are printed) + -v[erbose] ... verbose + [Note: You can also use -argsfile to read arguments from a file. See details in src/Client/help/argsfile.example.] From senger at pub.open-bio.org Wed Oct 12 11:17:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 12 Oct 2005 07:17:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121117.j9CBHx9C013586@pub.open-bio.org> senger Wed Oct 12 07:17:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv13525/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralDigestImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.8,1.9 CentralDigestImpl.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/24 17:51:51 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/12 11:17:59 1.9 @@ -107,7 +107,6 @@ throws MobyException { if (cacheDir != null) { File cache = createCacheDir (cacheDir, getRegistryEndpoint()); - messageLn ("Using cache directory: " + cache); dataTypesCache = createSubCacheDir (cache, "dataTypes"); servicesCache = createSubCacheDir (cache, "services"); namespacesCache = createSubCacheDir (cache, "namespaces"); @@ -116,6 +115,16 @@ } /************************************************************************** + * Return a directory name representing the current cache. This is + * the same name as given in constructors.

    + * + * @return current cache directory name + **************************************************************************/ + public String getCacheDir() { + return cacheDir; + } + + /************************************************************************** * Removes object groups from the cache. If 'id' is null it * removes the whole cache (for the Moby registry this instance as * initiated for). Otherwise 'id' indicates what part of the cache @@ -318,12 +327,14 @@ String typesAsXML = getDataTypeNamesAsXML(); store (dataTypesCache, LIST_FILE, typesAsXML); Map types = createDataTypeNamesFromXML (typesAsXML); + fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); - messageLn ("(CDCI) Processing data type " + name + "..."); + fireEvent (DATA_TYPE_LOADING, name); String xml = getDataTypeAsXML (name); store (dataTypesCache, name, xml); + fireEvent (DATA_TYPE_LOADED, name); } } catch (Exception e) { throw new MobyException (formatException (e)); @@ -333,16 +344,17 @@ protected void fillServicesCache() throws MobyException { try { - messageLn ("(CDCI) Asking for all service names..."); String byAuthorityAsXML = getServiceNamesByAuthorityAsXML(); store (servicesCache, LIST_FILE, byAuthorityAsXML); Map authorities = createServiceNamesByAuthorityFromXML (byAuthorityAsXML); + fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); - messageLn ("(CDCI) Processing authority " + authority + "..."); + fireEvent (AUTHORITY_LOADING, authority); String xml = getServicesAsXML (new MobyService (MobyService.DUMMY_NAME, authority), null, true, true); store (servicesCache, authority, xml); + fireEvent (AUTHORITY_LOADED, authority); } } catch (Exception e) { throw new MobyException (formatException (e)); @@ -353,16 +365,17 @@ protected void fillServiceTypesCache() throws MobyException { try { - messageLn ("(CDCI) Asking for all service type names..."); String typesAsXML = getServiceTypesAsXML(); store (serviceTypesCache, LIST_FILE, typesAsXML); Map types = createServiceTypesFromXML (typesAsXML); + fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); - messageLn ("(CDCI) Processing service type " + name + "..."); + fireEvent (SERVICE_TYPE_LOADING, name); String xml = getServiceTypeRelationshipsAsXML (name, false); store (serviceTypesCache, name, xml); + fireEvent (SERVICE_TYPE_LOADED, name); } } catch (Exception e) { throw new MobyException (formatException (e)); @@ -373,8 +386,10 @@ protected void fillNamespacesCache() throws MobyException { try { + fireEvent (NAMESPACE_LOADING, "Loading started."); String xml = getNamespacesAsXML(); store (namespacesCache, LIST_FILE, xml); + fireEvent (NAMESPACE_LOADED, "Loaded."); } catch (Exception e) { throw new MobyException (formatException (e)); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/22 16:07:09 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/12 11:17:59 1.6 @@ -7,6 +7,9 @@ package org.biomoby.client; import org.biomoby.shared.CentralDigest; +import org.biomoby.shared.event.Notifier; +import org.biomoby.shared.event.NotificationEvent; +import org.biomoby.shared.event.NotificationListener; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; @@ -30,7 +33,7 @@ public class CentralDigestImpl extends CentralImpl - implements CentralDigest { + implements CentralDigest, Notifier { // cached (digested) Moby protected MobyDataType[] dataTypes = new MobyDataType[] {}; @@ -75,11 +78,13 @@ try { Vector v = new Vector(); Map types = getDataTypeNames(); + fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); - messageLn ("(CDI) Processing data type " + name + "..."); + fireEvent (DATA_TYPE_LOADING, name); v.addElement (getDataType (name)); + fireEvent (DATA_TYPE_LOADED, name, v.lastElement()); } MobyDataType[] result = new MobyDataType [v.size()]; v.copyInto (result); @@ -98,14 +103,16 @@ try { Vector v = new Vector(); Map types = getServiceTypes(); + fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String typeName = (String)entry.getKey(); - messageLn ("(CDI) Processing service type " + typeName + "..."); + fireEvent (SERVICE_TYPE_LOADING, typeName); MobyServiceType serviceType = new MobyServiceType (typeName); serviceType.setDescription ((String)entry.getValue()); serviceType.setParentNames (getServiceTypeRelationships (typeName, false)); v.addElement (serviceType); + fireEvent (SERVICE_TYPE_LOADED, typeName, v.lastElement()); } MobyServiceType[] result = new MobyServiceType [v.size()]; v.copyInto (result); @@ -130,6 +137,7 @@ throws MobyException { try { Map names = getNamespaces(); + fireEvent (NAMESPACE_COUNT, new Integer (names.size())); MobyNamespace[] result = new MobyNamespace [ names.size() ]; int i = 0; for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { @@ -138,6 +146,7 @@ MobyNamespace ns = new MobyNamespace (name); ns.setDescription ((String)entry.getValue()); result[i++] = ns; + fireEvent (NAMESPACE_LOADED, name, ns); } return result; @@ -153,18 +162,19 @@ throws MobyException { try { Vector v = new Vector(); - messageLn ("(CDI) Asking for all service names..."); Map authorities = getServiceNamesByAuthority(); + fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); + fireEvent (AUTHORITY_LOADING, authority); String[] names = (String[])entry.getValue(); for (int i = 0; i < names.length; i++) { - messageLn ("(CDI) Processing service " + names[i] + "..."); MobyService[] servs = findService (new MobyService (names[i], authority)); for (int j = 0; j < servs.length; j++) v.addElement (servs[j]); } + fireEvent (AUTHORITY_LOADED, authority); } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); @@ -186,6 +196,8 @@ buf.append (e.toString()); buf.append (DGUtils.stackTraceToString (e)); return new String (buf); + } else if (e instanceof MobyException) { + return e.getMessage(); } else { return e.toString(); } @@ -291,6 +303,74 @@ } } + /************************************************************************* + * + * Methods implementing Notifier interface. + * + *************************************************************************/ + + private Vector listeners; + + /********************************************************************* + * + ********************************************************************/ + public synchronized void addNotificationListener (NotificationListener l) { + if (listeners == null) + listeners = new Vector(); + listeners.addElement (l); + } + + /********************************************************************* + * + ********************************************************************/ + public void removeNotificationListener (NotificationListener l) { + if (listeners != null) + listeners.removeElement (l); + } + + /********************************************************************* + * + ********************************************************************/ + public NotificationListener[] getNotificationListeners() { + if (listeners == null) + return new NotificationListener[] {}; + synchronized (listeners) { + NotificationListener[] result = new NotificationListener [listeners.size()]; + listeners.copyInto (result); + return result; + } + } + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (String type, Object message) { + fireEvent (type, message, null); + } + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (String type, Object message, Object details) { + NotificationEvent event = null; + if (details == null) + event = new NotificationEvent (this, type, message.toString()); + else + event = new NotificationEvent (this, type, message.toString(), details); + if (listeners != null) { + synchronized (listeners) { + for (int i = 0; i < listeners.size(); i++) { + NotificationListener listener = (NotificationListener)listeners.elementAt(i); + listener.notified (event); + } + } + } + } + + + + + // Work in progress - implement the methods above by getting RDF // graphs in-one-go and parsing them. Actually ability to get such // graphs was the main motivation for this implementation, and for From senger at pub.open-bio.org Wed Oct 12 11:36:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 12 Oct 2005 07:36:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121136.j9CBaxY3013784@pub.open-bio.org> senger Wed Oct 12 07:36:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv13765/src/Clients Modified Files: UnregisterByAuthority.java Log Message: moby-live/Java/src/Clients UnregisterByAuthority.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/10/12 11:36:59 1.3 @@ -6,7 +6,6 @@ // Copyright Martin Senger (martin.senger at gmail.com). // -import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; import org.biomoby.shared.Central; import org.biomoby.client.CentralImpl; @@ -14,7 +13,6 @@ import org.tulsoft.tools.BaseCmdLine; import java.util.Map; -import java.util.Map.Entry; import java.util.Iterator; /** From senger at pub.open-bio.org Wed Oct 12 11:36:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 12 Oct 2005 07:36:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121136.j9CBaxB4013808@pub.open-bio.org> senger Wed Oct 12 07:36:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv13765/src/main/org/biomoby/client Modified Files: BaseCmdLineClient.java CentralImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseCmdLineClient.java,1.3,1.4 CentralImpl.java,1.28,1.29 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/22 16:07:08 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/10/12 11:36:59 1.4 @@ -27,7 +27,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.Map.Entry; import java.util.Arrays; import java.io.IOException; import java.io.File; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/24 17:51:51 1.28 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/10/12 11:36:59 1.29 @@ -20,10 +20,8 @@ import org.biomoby.shared.MobyServiceType; import org.biomoby.shared.NoSuccessException; import org.biomoby.shared.PendingCurationException; -import org.biomoby.shared.Utils; import org.biomoby.shared.MobyResourceRef; -import org.tulsoft.shared.UUtils; import org.tulsoft.tools.soap.axis.AxisUtils; import org.w3c.dom.Document; From senger at pub.open-bio.org Wed Oct 12 11:36:59 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 12 Oct 2005 07:36:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121136.j9CBaxvW013827@pub.open-bio.org> senger Wed Oct 12 07:36:59 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv13765/src/main/org/biomoby/shared/event Modified Files: Notifier.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event Notifier.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/12 11:36:59 1.2 @@ -37,7 +37,7 @@ * notification events from the class that implements this * interface.

    * - * @param the notification listener to be added + * @param l notification listener to be added ********************************************************************/ void addNotificationListener (NotificationListener l); @@ -46,7 +46,7 @@ * longer receives notification events from the class that * implements this interface.

    * - * @param the notification listener to be removed + * @param l notification listener to be removed ********************************************************************/ void removeNotificationListener (NotificationListener l); From kawas at pub.open-bio.org Wed Oct 12 16:34:40 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 12 Oct 2005 12:34:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121634.j9CGYeI1014509@pub.open-bio.org> kawas Wed Oct 12 12:34:40 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv14484/org/biomoby/client/rdf/vocabulary Modified Files: Predicates.java Log Message: organized import statements moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary Predicates.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary/Predicates.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary/Predicates.java 2005/08/30 18:31:30 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/vocabulary/Predicates.java 2005/10/12 16:34:40 1.8 @@ -1,8 +1,4 @@ package org.biomoby.client.rdf.vocabulary; -import java.util.Properties; - -import org.biomoby.registry.properties.MobyProperties; - import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.Property; From kawas at pub.open-bio.org Wed Oct 12 17:13:29 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 12 Oct 2005 13:13:29 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121713.j9CHDTxp014638@pub.open-bio.org> kawas Wed Oct 12 13:13:28 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv14601/org/biomoby/shared/schema Modified Files: MElementHashtable.java Frame.java GenericWindowListener.java PrimitiveVector.java Added Files: ServiceInstanceWSDL.java Log Message: organized import statements moby-live/Java/src/main/org/biomoby/shared/schema ServiceInstanceWSDL.java,NONE,1.1 MElementHashtable.java,1.1,1.2 Frame.java,1.2,1.3 GenericWindowListener.java,1.1,1.2 PrimitiveVector.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MElementHashtable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MElementHashtable.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MElementHashtable.java 2005/10/12 17:13:28 1.2 @@ -7,7 +7,8 @@ package org.biomoby.shared.schema; -import java.util.*; +import java.util.Hashtable; +import java.util.Vector; public class MElementHashtable { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/09/06 21:29:50 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/10/12 17:13:28 1.3 @@ -29,6 +29,11 @@ */ public class Frame extends JFrame{ + /** + * + */ + private static final long serialVersionUID = 1939367498077695253L; + public Frame() { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/GenericWindowListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/GenericWindowListener.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/GenericWindowListener.java 2005/10/12 17:13:28 1.2 @@ -12,7 +12,8 @@ * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ -import java.awt.event.*; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; public class GenericWindowListener extends WindowAdapter { public void windowClosing(WindowEvent event) =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/PrimitiveVector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/PrimitiveVector.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/PrimitiveVector.java 2005/10/12 17:13:28 1.2 @@ -6,7 +6,7 @@ package org.biomoby.shared.schema; -import java.util.*; +import java.util.Vector; public class PrimitiveVector { From kawas at pub.open-bio.org Wed Oct 12 17:57:54 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 12 Oct 2005 13:57:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121757.j9CHvskS014779@pub.open-bio.org> kawas Wed Oct 12 13:57:54 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool In directory pub.open-bio.org:/tmp/cvs-serv14742/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool Modified Files: ServiceFocusListener.java ServiceInstancePanelFactory.java DescriptionWindow.java ServiceActionListener.java Log Message: organized import statements, removed variables that werent read, etc. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool ServiceFocusListener.java,1.3,1.4 ServiceInstancePanelFactory.java,1.4,1.5 DescriptionWindow.java,1.2,1.3 ServiceActionListener.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceFocusListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceFocusListener.java 2005/08/31 23:56:39 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceFocusListener.java 2005/10/12 17:57:54 1.4 @@ -6,7 +6,6 @@ import java.awt.event.FocusEvent; import java.awt.event.FocusListener; -import javax.swing.JFrame; import javax.swing.JTextArea; import javax.swing.JTextField; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceInstancePanelFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceInstancePanelFactory.java 2005/08/31 23:56:39 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceInstancePanelFactory.java 2005/10/12 17:57:54 1.5 @@ -28,7 +28,6 @@ import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.ListSelectionModel; -import javax.swing.text.Style; import org.biomoby.client.ui.graphical.applets.shared.MobyTree; import org.biomoby.client.ui.graphical.applets.util.TreeLoaderThread; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java 2005/09/01 00:03:56 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java 2005/10/12 17:57:54 1.3 @@ -21,6 +21,10 @@ */ public class DescriptionWindow extends JDialog { + /** + * + */ + private static final long serialVersionUID = -7369426386153906403L; private javax.swing.JPanel panel = null; private JPanel buttonpanel = null; private JButton btnClose = null; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceActionListener.java 2005/08/31 23:56:39 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/ServiceActionListener.java 2005/10/12 17:57:54 1.3 @@ -16,7 +16,6 @@ import javax.swing.JPanel; import org.biomoby.client.rdf.builder.ServiceInstanceRDF; -import org.biomoby.client.ui.graphical.applets.util.REGEXP; /** * @author Edward Kawas Created on July 7, 2004 From kawas at pub.open-bio.org Wed Oct 12 17:57:54 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 12 Oct 2005 13:57:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510121757.j9CHvsCM014798@pub.open-bio.org> kawas Wed Oct 12 13:57:54 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared In directory pub.open-bio.org:/tmp/cvs-serv14742/org/biomoby/client/ui/graphical/applets/shared Modified Files: MobyTree.java Log Message: organized import statements, removed variables that werent read, etc. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared MobyTree.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/09/30 14:44:58 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/10/12 17:57:54 1.4 @@ -1,5 +1,7 @@ package org.biomoby.client.ui.graphical.applets.shared; +import java.awt.BorderLayout; +import java.awt.Dimension; import java.awt.GridLayout; import java.awt.Toolkit; import java.util.ArrayList; @@ -7,6 +9,7 @@ import java.util.HashMap; import java.util.Iterator; +import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTree; @@ -350,4 +353,21 @@ tree.clearSelection(); tree.collapseRow(0); } + + public static void main(String[] args) { + JFrame frame = new JFrame(); + MobyTree tree = new MobyTree(false, "http://localhost:8080/RESOURCES/MOBY-S/Objects", "Object"); + tree.makeObjectTree("Object"); + tree.setPreferredSize(new Dimension(400, 400)); + // Add button to the frame + frame.getContentPane().add(tree, BorderLayout.CENTER); + + // Set initial size + int frameWidth = 300; + int frameHeight = 300; + frame.setSize(frameWidth, frameHeight); + + // Show the frame + frame.setVisible(true); + } } From gss at pub.open-bio.org Fri Oct 14 21:29:55 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri, 14 Oct 2005 17:29:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510142129.j9ELTtr0025016@pub.open-bio.org> gss Fri Oct 14 17:29:54 EDT 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-serv24990/src/org/semanticmoby/ref/servlets Modified Files: KeywordSearchServlet.java Log Message: Explicitly import org.semanticmoby.ref.tools.db.DBConnection to disambiguate from Jena's DBConnection class moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets KeywordSearchServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/10/09 01:11:21 1.5 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/10/14 21:29:54 1.6 @@ -9,6 +9,7 @@ import org.semanticmoby.ref.tools.*; import org.semanticmoby.ref.tools.db.*; +import org.semanticmoby.ref.tools.db.DBConnection; import org.semanticmoby.tools.Util; From gss at pub.open-bio.org Fri Oct 14 21:56:18 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri, 14 Oct 2005 17:56:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510142156.j9ELuI8i025115@pub.open-bio.org> gss Fri Oct 14 17:56:18 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv25090/S-MOBY/ref-impl/semanticmoby.org/build Modified Files: build.xml Log Message: Removed jalopy stuff moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/10/09 01:17:49 1.6 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/10/14 21:56:18 1.7 @@ -140,26 +140,4 @@ - - - - - - - - - - - - - - - - - - - - - From gss at pub.open-bio.org Fri Oct 14 21:56:43 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri, 14 Oct 2005 17:56:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510142156.j9ELuh4p025148@pub.open-bio.org> gss Fri Oct 14 17:56:43 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv25123/S-MOBY/ref-impl/core/build Modified Files: build.xml Log Message: Removed jalopy stuff moby-live/S-MOBY/ref-impl/core/build build.xml,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/10/09 01:33:06 1.4 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/10/14 21:56:43 1.5 @@ -54,28 +54,9 @@ - - - - - - - - - - - - - - - - - - - - - + + + From senger at pub.open-bio.org Tue Oct 18 17:19:56 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 13:19:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181719.j9IHJuGC015973@pub.open-bio.org> senger Tue Oct 18 13:19:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv15954 Modified Files: TestingCentral.java Log Message: moby-live/Java/src/Clients TestingCentral.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/22 16:07:08 1.7 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/10/18 17:19:56 1.8 @@ -276,8 +276,8 @@ simpleData.addNamespace (namespace1); MobyPrimaryDataSet collection = new MobyPrimaryDataSet ("Collection_A"); collection.addElement (simpleData1); - collection.addElement (simpleData2); - collection.addElement (simpleData3); +// collection.addElement (simpleData2); +// collection.addElement (simpleData3); MobySecondaryData secData1 = helper.createSecondaryData ("Secondary_A", "Integer"); MobySecondaryData secData2 = helper.createSecondaryData ("Secondary_B", "String"); From kawas at pub.open-bio.org Tue Oct 18 18:06:26 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:06:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181806.j9II6QDB016176@pub.open-bio.org> kawas Tue Oct 18 14:06:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/guide In directory pub.open-bio.org:/tmp/cvs-serv16152/guide Log Message: Directory /home/repository/moby/moby-live/Java/docs/guide added to the repository moby-live/Java/docs/guide - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 18:06:42 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:06:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181806.j9II6g7I016208@pub.open-bio.org> kawas Tue Oct 18 14:06:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/workflows In directory pub.open-bio.org:/tmp/cvs-serv16184/workflows Log Message: Directory /home/repository/moby/moby-live/Java/docs/workflows added to the repository moby-live/Java/docs/workflows - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 18:26:03 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:26:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181826.j9IIQ3AD016380@pub.open-bio.org> kawas Tue Oct 18 14:26:03 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/guide In directory pub.open-bio.org:/tmp/cvs-serv16359 Added Files: AddRegEndpoint.png addDNAtoModel.png addingMelting.png availableProcessorsContextC.png availableServices.png completeDnasequence.png connectString2DNA.png contextObjectDetails.png dnaConnectedMelting.png dnasequence&comps.png dnasequence.png index.html msdAddToWorkflow.png objectContextMenu.png objectTooltip.png processorsView.png results.png serviceContextClick.png serviceDescription.png serviceTooltip.png tutorialWorkflow.xml tutorialWorkflowInput.xml workflowComplete.png Log Message: adding the taverna guide files for version 1.3 moby-live/Java/docs/guide AddRegEndpoint.png,NONE,1.1 addDNAtoModel.png,NONE,1.1 addingMelting.png,NONE,1.1 availableProcessorsContextC.png,NONE,1.1 availableServices.png,NONE,1.1 completeDnasequence.png,NONE,1.1 connectString2DNA.png,NONE,1.1 contextObjectDetails.png,NONE,1.1 dnaConnectedMelting.png,NONE,1.1 dnasequence&comps.png,NONE,1.1 dnasequence.png,NONE,1.1 index.html,NONE,1.1 msdAddToWorkflow.png,NONE,1.1 objectContextMenu.png,NONE,1.1 objectTooltip.png,NONE,1.1 processorsView.png,NONE,1.1 results.png,NONE,1.1 serviceContextClick.png,NONE,1.1 serviceDescription.png,NONE,1.1 serviceTooltip.png,NONE,1.1 tutorialWorkflow.xml,NONE,1.1 tutorialWorkflowInput.xml,NONE,1.1 workflowComplete.png,NONE,1.1 From kawas at pub.open-bio.org Tue Oct 18 18:27:17 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:27:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181827.j9IIRHnq016447@pub.open-bio.org> kawas Tue Oct 18 14:27:17 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/workflows In directory pub.open-bio.org:/tmp/cvs-serv16400 Added Files: 1 - workflow.xml 1 - workflowInput.xml 10 - GeneInfo workflow.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml 8 - hmm dragon workflow.xml 9 - DNASequenceHolder element.xml readme.txt Log Message: some example workflows moby-live/Java/docs/workflows 1 - workflow.xml,NONE,1.1 1 - workflowInput.xml,NONE,1.1 10 - GeneInfo workflow.xml,NONE,1.1 2 - blastDragonDbWorkflow.xml,NONE,1.1 3 - cos_fixedInput.xml,NONE,1.1 4 - characterizeGeneticElement.xml,NONE,1.1 5 - BlastQueryAgainstAraProteinsE13.xml,NONE,1.1 6 - compareKeywordAndSimilarity.xml,NONE,1.1 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,NONE,1.1 8 - hmm dragon workflow.xml,NONE,1.1 9 - DNASequenceHolder element.xml,NONE,1.1 readme.txt,NONE,1.1 rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/10,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/GeneInfo,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/8,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/hmm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/dragon,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/9,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/DNASequenceHolder,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 18:37:10 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:37:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181837.j9IIbABX016533@pub.open-bio.org> kawas Tue Oct 18 14:37:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv16508/org/biomoby/shared/extended Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended added to the repository moby-live/Java/src/main/org/biomoby/shared/extended - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Tue Oct 18 18:37:13 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 18 Oct 2005 14:37:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510181837.j9IIbDBE016567@pub.open-bio.org> kawas Tue Oct 18 14:37:13 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv16546/org/biomoby/shared/extended Added Files: NamespaceParser.java DataTypeParser.java ServiceTypeParser.java Log Message: preliminary versions of the files that parse rdf and return their respective objects. moby-live/Java/src/main/org/biomoby/shared/extended NamespaceParser.java,NONE,1.1 DataTypeParser.java,NONE,1.1 ServiceTypeParser.java,NONE,1.1 From senger at pub.open-bio.org Tue Oct 18 20:00:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:00:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182000.j9IK0kDL016904@pub.open-bio.org> senger Tue Oct 18 16:00:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna In directory pub.open-bio.org:/tmp/cvs-serv16886/taverna Log Message: Directory /home/repository/moby/moby-live/Java/docs/taverna added to the repository moby-live/Java/docs/taverna - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 20:00:56 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:00:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182000.j9IK0uiq016946@pub.open-bio.org> senger Tue Oct 18 16:00:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv16928/taverna/guide Log Message: Directory /home/repository/moby/moby-live/Java/docs/taverna/guide added to the repository moby-live/Java/docs/taverna/guide - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/guide/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/guide/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/guide/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 20:01:07 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:01:07 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182001.j9IK17P8016990@pub.open-bio.org> senger Tue Oct 18 16:01:07 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/workflows In directory pub.open-bio.org:/tmp/cvs-serv16972/taverna/workflows Log Message: Directory /home/repository/moby/moby-live/Java/docs/taverna/workflows added to the repository moby-live/Java/docs/taverna/workflows - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 20:12:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:12:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCagA017232@pub.open-bio.org> senger Tue Oct 18 16:12:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/guide In directory pub.open-bio.org:/tmp/cvs-serv17192/guide Removed Files: AddRegEndpoint.png addDNAtoModel.png addingMelting.png availableProcessorsContextC.png availableServices.png completeDnasequence.png connectString2DNA.png contextObjectDetails.png dnaConnectedMelting.png dnasequence&comps.png dnasequence.png index.html msdAddToWorkflow.png objectContextMenu.png objectTooltip.png processorsView.png results.png serviceContextClick.png serviceDescription.png serviceTooltip.png tutorialWorkflow.xml tutorialWorkflowInput.xml workflowComplete.png Log Message: moby-live/Java/docs/guide AddRegEndpoint.png,1.1,NONE addDNAtoModel.png,1.1,NONE addingMelting.png,1.1,NONE availableProcessorsContextC.png,1.1,NONE availableServices.png,1.1,NONE completeDnasequence.png,1.1,NONE connectString2DNA.png,1.1,NONE contextObjectDetails.png,1.1,NONE dnaConnectedMelting.png,1.1,NONE dnasequence&comps.png,1.1,NONE dnasequence.png,1.1,NONE index.html,1.1,NONE msdAddToWorkflow.png,1.1,NONE objectContextMenu.png,1.1,NONE objectTooltip.png,1.1,NONE processorsView.png,1.1,NONE results.png,1.1,NONE serviceContextClick.png,1.1,NONE serviceDescription.png,1.1,NONE serviceTooltip.png,1.1,NONE tutorialWorkflow.xml,1.1,NONE tutorialWorkflowInput.xml,1.1,NONE workflowComplete.png,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/AddRegEndpoint.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/addDNAtoModel.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/addingMelting.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/availableProcessorsContextC.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/availableServices.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/completeDnasequence.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/connectString2DNA.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/contextObjectDetails.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/dnaConnectedMelting.png,v: No such file or directory sh: line 1: comps.png: command not found rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/dnasequence.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/index.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/msdAddToWorkflow.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/objectContextMenu.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/objectTooltip.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/processorsView.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/results.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/serviceContextClick.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/serviceDescription.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/serviceTooltip.png,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/tutorialWorkflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/tutorialWorkflowInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/guide/RCS/workflowComplete.png,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 20:12:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:12:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCasM017247@pub.open-bio.org> senger Tue Oct 18 16:12:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv17192/taverna/guide Added Files: AddRegEndpoint.png addDNAtoModel.png addingMelting.png availableProcessorsContextC.png availableServices.png completeDnasequence.png connectString2DNA.png contextObjectDetails.png dnaConnectedMelting.png dnasequence&comps.png dnasequence.png index.html msdAddToWorkflow.png objectContextMenu.png objectTooltip.png processorsView.png results.png serviceContextClick.png serviceDescription.png serviceTooltip.png tutorialWorkflow.xml tutorialWorkflowInput.xml workflowComplete.png Log Message: moby-live/Java/docs/taverna/guide AddRegEndpoint.png,NONE,1.1 addDNAtoModel.png,NONE,1.1 addingMelting.png,NONE,1.1 availableProcessorsContextC.png,NONE,1.1 availableServices.png,NONE,1.1 completeDnasequence.png,NONE,1.1 connectString2DNA.png,NONE,1.1 contextObjectDetails.png,NONE,1.1 dnaConnectedMelting.png,NONE,1.1 dnasequence&comps.png,NONE,1.1 dnasequence.png,NONE,1.1 index.html,NONE,1.1 msdAddToWorkflow.png,NONE,1.1 objectContextMenu.png,NONE,1.1 objectTooltip.png,NONE,1.1 processorsView.png,NONE,1.1 results.png,NONE,1.1 serviceContextClick.png,NONE,1.1 serviceDescription.png,NONE,1.1 serviceTooltip.png,NONE,1.1 tutorialWorkflow.xml,NONE,1.1 tutorialWorkflowInput.xml,NONE,1.1 workflowComplete.png,NONE,1.1 From senger at pub.open-bio.org Tue Oct 18 20:12:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:12:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCbCJ017279@pub.open-bio.org> senger Tue Oct 18 16:12:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/workflows In directory pub.open-bio.org:/tmp/cvs-serv17192/taverna/workflows Added Files: 1 - workflow.xml 1 - workflowInput.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml readme.txt Log Message: moby-live/Java/docs/taverna/workflows 1 - workflow.xml,NONE,1.1 1 - workflowInput.xml,NONE,1.1 2 - blastDragonDbWorkflow.xml,NONE,1.1 3 - cos_fixedInput.xml,NONE,1.1 4 - characterizeGeneticElement.xml,NONE,1.1 5 - BlastQueryAgainstAraProteinsE13.xml,NONE,1.1 6 - compareKeywordAndSimilarity.xml,NONE,1.1 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,NONE,1.1 readme.txt,NONE,1.1 rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 20:12:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:12:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182012.j9IKCbZk017338@pub.open-bio.org> senger Tue Oct 18 16:12:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/workflows In directory pub.open-bio.org:/tmp/cvs-serv17192/workflows Removed Files: 1 - workflow.xml 1 - workflowInput.xml 10 - GeneInfo workflow.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml 8 - hmm dragon workflow.xml 9 - DNASequenceHolder element.xml readme.txt Log Message: moby-live/Java/docs/workflows 1 - workflow.xml,1.1,NONE 1 - workflowInput.xml,1.1,NONE 10 - GeneInfo workflow.xml,1.1,NONE 2 - blastDragonDbWorkflow.xml,1.1,NONE 3 - cos_fixedInput.xml,1.1,NONE 4 - characterizeGeneticElement.xml,1.1,NONE 5 - BlastQueryAgainstAraProteinsE13.xml,1.1,NONE 6 - compareKeywordAndSimilarity.xml,1.1,NONE 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,1.1,NONE 8 - hmm dragon workflow.xml,1.1,NONE 9 - DNASequenceHolder element.xml,1.1,NONE readme.txt,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflowInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/10,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/GeneInfo,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/blastDragonDbWorkflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/cos_fixedInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/characterizeGeneticElement.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/BlastQueryAgainstAraProteinsE13.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/compareKeywordAndSimilarity.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/compareKeywordAndSimilarityAndPhytoprot_count.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/8,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/hmm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/dragon,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/9,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/DNASequenceHolder,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/element.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/workflows/RCS/readme.txt,v: No such file or directory From senger at pub.open-bio.org Tue Oct 18 20:15:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 18 Oct 2005 16:15:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510182015.j9IKFbGv017439@pub.open-bio.org> senger Tue Oct 18 16:15:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv17420 Modified Files: index.html Log Message: moby-live/Java/docs index.html,1.15,1.16 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/index.html,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- /home/repository/moby/moby-live/Java/docs/index.html 2005/09/21 07:56:55 1.15 +++ /home/repository/moby/moby-live/Java/docs/index.html 2005/10/18 20:15:37 1.16 @@ -46,6 +46,7 @@

  • Command-line clients
  • Integration with Eclipse
  • Some issues with using jMoby on MS-Windows platform +
  • How to use the BioMoby plugin in Taverna
  • Integration with Taverna
  • RDF Agent @@ -91,7 +92,7 @@
    Martin Senger
    -Last modified: Wed Sep 21 15:27:30 2005 +Last modified: Tue Oct 18 22:04:57 2005
    From kawas at pub.open-bio.org Wed Oct 19 22:00:26 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:00:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192200.j9JM0QvH021394@pub.open-bio.org> kawas Wed Oct 19 18:00:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv21367 Modified Files: index.html Added Files: InstallingLocalMOBYCentral.html Log Message: added an installing mobycentral link moby-live/Java/docs/taverna/guide InstallingLocalMOBYCentral.html,NONE,1.1 index.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/18 20:12:36 1.1 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:00:26 1.2 @@ -1,200 +1,400 @@ - - - - -The 'new' BioMoby plugin For Taverna - - - -

    How to use the BioMoby plugin in Taverna 1.3

    -
    -

    Introduction

    -
    -

    We updated the BioMoby plugin so that we could add functionality that we believed was missing.

    -

    In the past, users of the plugin were forced to start every Moby based workflow with the root Moby
    - datatype. In other words, you were able to utilize a local widget called 'create_moby_data', however,
    - the Moby data really was just the root datatype in disguise.

    -

    In addition, in Taverna releases prior to version 1.2, the BioMoby services were always limited to one
    - input and one output. This worked for many of the Moby services, but for those wishing to create a
    - workflow that initally utilized a service with more inputs, that option just wasn't available.

    -
    -

    New Features

    -
    -

    The updated BioMoby plugin contains many new features. Some of these features include the following:

    -
      -
    • The ability to work with any datatype in the MobyCentral Object ontology
    • -
    • The ability to utilize services with more than 1 input or output
    • -
    • The ability to obtain useful information regarding the datatypes or services
    • -
    • The addition of Moby collection support (currently handles only collections as inputs, not outputs)
    • -
    • The ability to completely add a Moby data type with all of its sub components to a workflow
    • -
    -

    To start using these new features, please follow the short tutorial below!

    -
    -

    Tutorial

    -
    -

    Creating a BioMoby Scavenger

    -
    -

    Creating a new BioMoby scavenger has never been easier! In fact, if you are familar with Taverna,
    - then adding a BioMoby scavenger is just like adding any other scavenger.

    -

    Starting from the 'Available Services' window, you will need to context click the folder labeled
    - 'Available Processors'. Below is a image illustrating the 'Available Services' window.

    -

    Available Services Window

    -

    Performing a context click on the selected folder reveals the following menu. Notice how
    - we chose to add new BioMoby scavenger.

    -

    Scavengers that we can choose from

    -

    Upon making our selection, we will be prompted to enter certain information that will allow Taverna
    - to create our scavenger. The information that we need to provide includes the URL of the BioMoby
    - central registry that we would like to use, as well as the URL of the RDF document describing the
    - BioMoby datatype ontology.

    -

    Enter your registry details

    -

    You may now be scratching your head, and are wondering why you have never heard of this RDF document.
    - Currently, this location is undocumented in the Moby API, and the API will be supplemented with this information
    - at a later time. At the time that this tutorial was written, there was only one location known for this RDF document
    - and it is the default one in Taverna (shown above) - .

    -

    Once the information has been inputted into the text boxes, the Moby services and datatypes will now be available
    - as processors in the 'Available Services' window.

    -

    The service and datatype ontologies are illustrated

    -

    If you would like to work with your own custom Mobycentral registry and not that of the default, http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl, then it is recommended that you edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    -
    -

    Creating a workflow

    -
    -

    Workflow used in this tutorial may be downloaded here.
    - Workflow input used in this tutorial may be downloaded here.

    -

    Creating a workflow with the new BioMoby plugin is as easy as it was using the previous plugin. There are, of course,
    - a few - differences. When creating workflows, it is no longer necessary to use the local widget 'create_moby_data'.
    - When you are ready to instantiate a Moby datatype, all that is necessary is for you to choose the datatype from the list
    - of 'Available Processors' under the 'Moby Objects' folder.

    -

    As an example, we will add the Moby datatype called DNASequence to our workflow. In order to do this, we must
    - navigate the datatype ontology to find DNASequence. We can find DNASequence by traversing the 'Moby Objects'
    - tree in the following order: - Object, VirtualSequence, GenericSequence, NucleotideSequence and finally DNASequence.
    - Now that we have found the processor that we were looking for, let's add it to the workflow.

    -

    Adding the datatype DNASequence to the workflow

    -

    'DNASequence' has now been added to the workflow diagram. To reveal what inputs and outputs this processor
    - utilizes, we need to ask Taverna to show us all of the ports in the workflow diagram.

    -

    DNASequence and all of its ports

    -

    Notice how 'DNASequence' takes as input a namespace, an id, an article name, and 2 Moby datatypes: String and
    - Integer. Since 'String' and 'Integer' are Moby datatypes contained within a 'DNASequence', they have been conveniently
    - added to the workflow and linked appropriately.

    -

    Our workflow diagram -looks something like the following:

    -

    A DNASequence with all of its sub components connected to it

    -

    A complex BioMoby datatype. 'DNASequence', and all of its subcomponents have now been added to our workflow.
    - Next we will add a BioMoby service processor that handles our complex datatype.

    -

    We will add the service 'runFasta' from the authority 'www.pcm.uam.es'. This service runs the fasta tool on the input
    - sequence - . From the list of processors, we will navigate to www.pcm.uam.es and then choose the service that we are
    - interested in, i.e. 'runFasta'.

    -

    Adding the runFasta processor

    -

    The next thing to do is to connect the input of the 'runFasta' processor to the output of 'DNASequence'. It should be noted
    - that there are 2 inputs to the processor 'runFasta': 'GenericSequence(_ANON_)' and 'input'. The port labelled 'input' serves to
    - support workflows created prior to Taverna 1.2 and should be used when you create workflows utilizing the Local Widgets
    - 'create_moby_data'. - For our workflow, we will connect the complex datatype 'DNASequence' to the input port labeled
    - 'DNASequence(sequence)' of the 'runFasta' processor.

    -

    DNASequence datatype connected to the Melting service

    -

    We are almost done! The only things that are missing now are the workflow inputs and the workflow outputs. We will create
    - the following inputs:

    -
      -
    • namespace - this input will connect to the 'namespace' input port of 'DNASequence'
    • -
    • id - this input will connect to the 'id' input port of 'DNASequence'
    • -
    • sequence - this input will connect to the 'value' input port of 'String'
    • -
    • length - this input will connect to the 'value' input port of 'Integer'
    • -
    -

    We will also create a workflow output called 'output'. This workflow output will be connected to the
    - output port, 'FASTA_Text(_ANON_)' of the processor 'runFasta'.

    -

    Once these connections have been made, you should have something similar to the image below. Note that the image is only showing
    - those ports that are bound to inputs or outputs.

    -

    A completed workflow Diagram

    -

    So there we have a completed workflow based on BioMoby Services and datatypes. If you wish to run this
    - workflow, some suitable values for the workflow inputs are as follows:

    -
      -
    • namespace - NCBI_gi
    • -
    • id - 646464
    • -
    • sequence - tatata
    • -
    • length - 6
    • -
    -

    The output from this data is shown below.

    -

    The results from running our workflow

    -
    -

    Obtaining information on a Moby datatype

    -
    -

    One of the neatest things added to the plugin was the ability to obtain information regarding BioMoby datatypes. For
    - instance, you can find out what services a particular datatype can be used as input or output. In addition, you can find
    - the descriptions of those services.

    -

    As an example, imagine that we wanted to discover what services the Moby datatype 'Integer' feeds into. To do this, we
    - can use our existing workflow. From the 'Advanced model explorer' window, context click on the processor called 'Integer'
    - and choose 'Moby Object Details'.

    -

    Finding out more about a particular Moby Datatype

    -

    As soon as you choose 'Moby Object Details', a pop up window appears and embedded in that window
    - is a tree like structure. Note that this window can take up to a minute to appear depending on your
    - internet connection and the data type chosen.
    At the root of the tree is the datatype that we chose to
    - know more about, in our case - 'Integer', and 2 sub trees labeled 'Feeds into' and 'Produced by'. In the
    - 'Feeds into' sub tree, you will find out - what BioMoby services consume the datatype in question, sorted by
    - authority.

    -

    When you navigate the sub tree - and mouse over the service name, a tool tip appears giving you the
    - description of the service.

    -

    Tool tip provided to describe the service that consumes our datatype

    -

    In addition, you can context click the service name, in this case - PupaSNP, - and a menu is shown:

    -

    Moby Object Details Context Menu

    -

    From this menu, you can choose to either add the selected service to the workflow or view more a more detailed
    - service description. Below, the window that appears upon choosing to 'Find out about PupaSNP':

    -

    Moby Service Description

    -

     

    -

    The sub tree - 'Produced by' offers similar information, except about services that produce the datatype in question.
    - The context menu is not available for children of the 'Produced by' node.

    -

     

    -
    -

    Obtaining information on a Moby service

    -
    -

    As with Moby datatypes, information about services is also available. For a particular service, we can determine
    - what are the inputs and outputs. And if you wish, you may add the input datatypes to the workflow.In addition,
    - we can also discover what namespaces a particular input or output - is valid in.

    -

    Using the workflow that we created above, we can discover what inputs and outputs 'runFasta' utilize. To determine this,
    - we need to context click on the 'runFasta' processor from the 'Advanced model explorer', just as we had done before
    - with the Moby datatype processors above, and choose 'Moby Service Details'.

    -

    Context clicking a Moby service to retrieve additional information

    -

    A pop window appears and embedded in it is a tree that has as its root the name of the Moby
    - service. The children of the root node are 2 sub trees, 'Inputs' and 'Outputs'. The items under
    - these sub trees simply illustrate what datatypes the service consumes and produces.

    -

    The window showing the service details and a tooltip describing the output of the service

    -

    Similarly to the 'Moby Object Details', you can either add the input datatype to the workflow or
    - obtain additional information on the datatype:

    -

    Moby Service Details Context Menu

    -

     

    -
    -
    -

    What's Next

    -
    -

    In the future, we hope to add even more functionality to the plugin. Below are some of the features that
    - we have thought about:

    -
      -
    • Adding collection support that behaves as stated in the BioMoby API
    • -
    • Adding the ability to parse Moby datatypes and pass this parsed data onto other non Moby services.
    • -
    • Adding the ability to add Moby services from the 'Moby Object Details' window.
    • -
    -

    If there are specific features that you would like us to consider, please contact the BioMoby development
    - team.

    -
    -

    Comments / Questions

    -
    -

    If you have any questions or comments, please feel free to contact Eddie Kawas @
    - edward[DoT]kawas[AT]gmail[DoT]com

    -

    If you have any suggestions regarding new features or you would like to report a bug,
    - please let me know.

    -

     

    -

     

    -
    -
    - - + + + + + + + + +The 'new' BioMoby plugin For Taverna + + + + + + + +

    How to use the BioMoby plugin in Taverna 1.3

    + +
    + +

    Introduction

    + +
    + +

    We updated the BioMoby plugin so that we could add functionality that we believed was missing.

    + +

    In the past, users of the plugin were forced to start every Moby based workflow with the root Moby
    + + datatype. In other words, you were able to utilize a local widget called 'create_moby_data', however,
    + + the Moby data really was just the root datatype in disguise.

    + +

    In addition, in Taverna releases prior to version 1.2, the BioMoby services were always limited to one
    + + input and one output. This worked for many of the Moby services, but for those wishing to create a
    + + workflow that initally utilized a service with more inputs, that option just wasn't available.

    + +
    + +

    New Features

    + +
    + +

    The updated BioMoby plugin contains many new features. Some of these features include the following:

    + +
      + +
    • The ability to work with any datatype in the MobyCentral Object ontology
    • + +
    • The ability to utilize services with more than 1 input or output
    • + +
    • The ability to obtain useful information regarding the datatypes or services
    • + +
    • The addition of Moby collection support (currently handles only collections as inputs, not outputs)
    • + +
    • The ability to completely add a Moby data type with all of its sub components to a workflow
    • + +
    + +

    To start using these new features, please follow the short tutorial below!

    + +
    + +

    Tutorial

    + +
    + +

    Creating a BioMoby Scavenger

    + +
    + +

    Creating a new BioMoby scavenger has never been easier! In fact, if you are familar with Taverna,
    + + then adding a BioMoby scavenger is just like adding any other scavenger.

    + +

    Starting from the 'Available Services' window, you will need to context click the folder labeled
    + + 'Available Processors'. Below is a image illustrating the 'Available Services' window.

    + +

    Available Services Window

    + +

    Performing a context click on the selected folder reveals the following menu. Notice how
    + + we chose to add new BioMoby scavenger.

    + +

    Scavengers that we can choose from

    + +

    Upon making our selection, we will be prompted to enter certain information that will allow Taverna
    + + to create our scavenger. The information that we need to provide includes the URL of the BioMoby
    + + central registry that we would like to use, as well as the URL of the RDF document describing the
    + + BioMoby datatype ontology.

    + +

    Enter your registry details

    + +

    You may now be scratching your head, and are wondering why you have never heard of this RDF document.
    + + Currently, this location is undocumented in the Moby API, and the API will be supplemented with this information
    + + at a later time. At the time that this tutorial was written, there was only one location known for this RDF document
    + + and it is the default one in Taverna (shown above) + + .

    + +

    Once the information has been inputted into the text boxes, the Moby services and datatypes will now be available
    + + as processors in the 'Available Services' window.

    + +

    The service and datatype ontologies are illustrated

    + +

    If you would like to work with your own custom Mobycentral registry and not that of the default, http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl, then it is recommended that you edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    +

    If you would like to host your own local custom registry, please click here.

    +
    + +

    Creating a workflow

    + +
    + +

    Workflow used in this tutorial may be downloaded here.
    + + Workflow input used in this tutorial may be downloaded here.

    + +

    Creating a workflow with the new BioMoby plugin is as easy as it was using the previous plugin. There are, of course,
    + + a few + + differences. When creating workflows, it is no longer necessary to use the local widget 'create_moby_data'.
    + + When you are ready to instantiate a Moby datatype, all that is necessary is for you to choose the datatype from the list
    + + of 'Available Processors' under the 'Moby Objects' folder.

    + +

    As an example, we will add the Moby datatype called DNASequence to our workflow. In order to do this, we must
    + + navigate the datatype ontology to find DNASequence. We can find DNASequence by traversing the 'Moby Objects'
    + + tree in the following order: + + Object, VirtualSequence, GenericSequence, NucleotideSequence and finally DNASequence.
    + + Now that we have found the processor that we were looking for, let's add it to the workflow.

    + +

    Adding the datatype DNASequence to the workflow

    + +

    'DNASequence' has now been added to the workflow diagram. To reveal what inputs and outputs this processor
    + + utilizes, we need to ask Taverna to show us all of the ports in the workflow diagram.

    + +

    DNASequence and all of its ports

    + +

    Notice how 'DNASequence' takes as input a namespace, an id, an article name, and 2 Moby datatypes: String and
    + + Integer. Since 'String' and 'Integer' are Moby datatypes contained within a 'DNASequence', they have been conveniently
    + + added to the workflow and linked appropriately.

    + +

    Our workflow diagram + +looks something like the following:

    + +

    A DNASequence with all of its sub components connected to it

    + +

    A complex BioMoby datatype. 'DNASequence', and all of its subcomponents have now been added to our workflow.
    + + Next we will add a BioMoby service processor that handles our complex datatype.

    + +

    We will add the service 'runFasta' from the authority 'www.pcm.uam.es'. This service runs the fasta tool on the input
    + + sequence + + . From the list of processors, we will navigate to www.pcm.uam.es and then choose the service that we are
    + + interested in, i.e. 'runFasta'.

    + +

    Adding the runFasta processor

    + +

    The next thing to do is to connect the input of the 'runFasta' processor to the output of 'DNASequence'. It should be noted
    + + that there are 2 inputs to the processor 'runFasta': 'GenericSequence(_ANON_)' and 'input'. The port labelled 'input' serves to
    + + support workflows created prior to Taverna 1.2 and should be used when you create workflows utilizing the Local Widgets
    + + 'create_moby_data'. + + For our workflow, we will connect the complex datatype 'DNASequence' to the input port labeled
    + + 'DNASequence(sequence)' of the 'runFasta' processor.

    + +

    DNASequence datatype connected to the Melting service

    + +

    We are almost done! The only things that are missing now are the workflow inputs and the workflow outputs. We will create
    + + the following inputs:

    + +
      + +
    • namespace - this input will connect to the 'namespace' input port of 'DNASequence'
    • + +
    • id - this input will connect to the 'id' input port of 'DNASequence'
    • + +
    • sequence - this input will connect to the 'value' input port of 'String'
    • + +
    • length - this input will connect to the 'value' input port of 'Integer'
    • + +
    + +

    We will also create a workflow output called 'output'. This workflow output will be connected to the
    + + output port, 'FASTA_Text(_ANON_)' of the processor 'runFasta'.

    + +

    Once these connections have been made, you should have something similar to the image below. Note that the image is only showing
    + + those ports that are bound to inputs or outputs.

    + +

    A completed workflow Diagram

    + +

    So there we have a completed workflow based on BioMoby Services and datatypes. If you wish to run this
    + + workflow, some suitable values for the workflow inputs are as follows:

    + +
      + +
    • namespace - NCBI_gi
    • + +
    • id - 646464
    • + +
    • sequence - tatata
    • + +
    • length - 6
    • + +
    + +

    The output from this data is shown below.

    + +

    The results from running our workflow

    + +
    + +

    Obtaining information on a Moby datatype

    + +
    + +

    One of the neatest things added to the plugin was the ability to obtain information regarding BioMoby datatypes. For
    + + instance, you can find out what services a particular datatype can be used as input or output. In addition, you can find
    + + the descriptions of those services.

    + +

    As an example, imagine that we wanted to discover what services the Moby datatype 'Integer' feeds into. To do this, we
    + + can use our existing workflow. From the 'Advanced model explorer' window, context click on the processor called 'Integer'
    + + and choose 'Moby Object Details'.

    + +

    Finding out more about a particular Moby Datatype

    + +

    As soon as you choose 'Moby Object Details', a pop up window appears and embedded in that window
    + + is a tree like structure. Note that this window can take up to a minute to appear depending on your
    + + internet connection and the data type chosen.
    At the root of the tree is the datatype that we chose to
    + + know more about, in our case + + 'Integer', and 2 sub trees labeled 'Feeds into' and 'Produced by'. In the
    + + 'Feeds into' sub tree, you will find out + + what BioMoby services consume the datatype in question, sorted by
    + + authority.

    + +

    When you navigate the sub tree + + and mouse over the service name, a tool tip appears giving you the
    + + description of the service.

    + +

    Tool tip provided to describe the service that consumes our datatype

    + +

    In addition, you can context click the service name, in this case + + PupaSNP, + + and a menu is shown:

    + +

    Moby Object Details Context Menu

    + +

    From this menu, you can choose to either add the selected service to the workflow or view more a more detailed
    + + service description. Below, the window that appears upon choosing to 'Find out about PupaSNP':

    + +

    Moby Service Description

    + +

     

    + +

    The sub tree + + 'Produced by' offers similar information, except about services that produce the datatype in question.
    + + The context menu is not available for children of the 'Produced by' node.

    + +

     

    + +
    + +

    Obtaining information on a Moby service

    + +
    + +

    As with Moby datatypes, information about services is also available. For a particular service, we can determine
    + + what are the inputs and outputs. And if you wish, you may add the input datatypes to the workflow.In addition,
    + + we can also discover what namespaces a particular input or output + + is valid in.

    + +

    Using the workflow that we created above, we can discover what inputs and outputs 'runFasta' utilize. To determine this,
    + + we need to context click on the 'runFasta' processor from the 'Advanced model explorer', just as we had done before
    + + with the Moby datatype processors above, and choose 'Moby Service Details'.

    + +

    Context clicking a Moby service to retrieve additional information

    + +

    A pop window appears and embedded in it is a tree that has as its root the name of the Moby
    + + service. The children of the root node are 2 sub trees, 'Inputs' and 'Outputs'. The items under
    + + these sub trees simply illustrate what datatypes the service consumes and produces.

    + +

    The window showing the service details and a tooltip describing the output of the service

    + +

    Similarly to the 'Moby Object Details', you can either add the input datatype to the workflow or
    + + obtain additional information on the datatype:

    + +

    Moby Service Details Context Menu

    + +

     

    + +
    + +
    + +

    What's Next

    + +
    + +

    In the future, we hope to add even more functionality to the plugin. Below are some of the features that
    + + we have thought about:

    + +
      + +
    • Adding collection support that behaves as stated in the BioMoby API
    • + +
    • Adding the ability to parse Moby datatypes and pass this parsed data onto other non Moby services.
    • + +
    • Adding the ability to add Moby services from the 'Moby Object Details' window.
    • + +
    + +

    If there are specific features that you would like us to consider, please contact the BioMoby development
    + + team.

    + +
    + +

    Comments / Questions

    + +
    + +

    If you have any questions or comments, please feel free to contact Eddie Kawas @
    + + edward[DoT]kawas[AT]gmail[DoT]com

    + +

    If you have any suggestions regarding new features or you would like to report a bug,
    + + please let me know.

    + +

     

    + +

     

    + +
    + +
    + + + + + From kawas at pub.open-bio.org Wed Oct 19 22:13:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:13:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192213.j9JMDBR4021823@pub.open-bio.org> kawas Wed Oct 19 18:13:11 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv21796 Modified Files: index.html Added Files: workflows.html Log Message: added a way to view the preconstructed workflows moby-live/Java/docs/taverna/guide workflows.html,NONE,1.1 index.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:00:26 1.2 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:13:11 1.3 @@ -61,7 +61,7 @@

    To start using these new features, please follow the short tutorial below!

    - +

    Click here to download BioMoby workflows.

  • Tutorial

    From kawas at pub.open-bio.org Wed Oct 19 22:27:22 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:27:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192227.j9JMRMuw022280@pub.open-bio.org> kawas Wed Oct 19 18:27:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv22255 Modified Files: index.html Log Message: added a question/answer and modified the scavenger section. moby-live/Java/docs/taverna/guide index.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:13:11 1.3 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2005/10/19 22:27:22 1.4 @@ -10,6 +10,14 @@ The 'new' BioMoby plugin For Taverna + @@ -92,29 +100,21 @@ to create our scavenger. The information that we need to provide includes the URL of the BioMoby
    - central registry that we would like to use, as well as the URL of the RDF document describing the
    - - BioMoby datatype ontology.

    + central registry that we would like to use. Note that only registries that implement the newest BioMoby
    + API are supported.

    Enter your registry details

    -

    You may now be scratching your head, and are wondering why you have never heard of this RDF document.
    - - Currently, this location is undocumented in the Moby API, and the API will be supplemented with this information
    - - at a later time. At the time that this tutorial was written, there was only one location known for this RDF document
    - - and it is the default one in Taverna (shown above) - - .

    -

    Once the information has been inputted into the text boxes, the Moby services and datatypes will now be available
    as processors in the 'Available Services' window.

    The service and datatype ontologies are illustrated

    -

    If you would like to work with your own custom Mobycentral registry and not that of the default, http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl, then it is recommended that you edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    +

    If you would like to work with your own custom Mobycentral registry and not that of the default,
    + http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl
    , then it is recommended that you
    + edit the /taverna-workbench-1.3/conf/mygrid.properties file. In this file, modify the value for the
    + property taverna.defaultbiomoby replacing the URL with that of your custom registry.

    If you would like to host your own local custom registry, please click here.

    @@ -375,13 +375,19 @@

    Comments / Questions

    -
    - +

    Questions

    +
      +
    1. How does one go about installing a local registry? +
      +

      To install your own registry, please go here.

      +
      +
    2. +
    +

     

    If you have any questions or comments, please feel free to contact Eddie Kawas @
    edward[DoT]kawas[AT]gmail[DoT]com

    -

    If you have any suggestions regarding new features or you would like to report a bug,
    please let me know.

    From kawas at pub.open-bio.org Wed Oct 19 22:34:38 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:34:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192234.j9JMYcfH022536@pub.open-bio.org> kawas Wed Oct 19 18:34:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv22511 Modified Files: workflows.html Log Message: fixed the links - noticed that the workflows have a timestamp appended to them moby-live/Java/docs/taverna/guide workflows.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:13:11 1.1 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:34:38 1.2 @@ -1,22 +1,24 @@ - - Taverna Workflows - - + +Taverna Workflows + +

    Taverna Workflows

    -
     Name                    Last modified      Size  Description
    [   ] 1 - workflow.xml 13-Oct-2005 15:26 11K -[   ] 1 - workflowInput.xml 13-Oct-2005 15:26 4.6K -[   ] 2 - blastDragonDbWor..> 13-Oct-2005 15:26 10K -[   ] 3 - cos_fixedInput.xml 13-Oct-2005 15:26 4.1K -[   ] 4 - characterizeGene..> 13-Oct-2005 15:26 7.7K +
     Name                    Last modified      Size  Description
    [   ] 1 - workflow.xml 13-Oct-2005 15:26 11K +[   ] 1 - workflowInput.xml 13-Oct-2005 15:26 4.6K +[   ] 2 - blastDragonDbWor..> 13-Oct-2005 15:26 10K +[   ] 3 - cos_fixedInput.xml 13-Oct-2005 15:26 4.1K +[   ] 4 - characterizeGene..> 13-Oct-2005 15:26 7.7K -[   ] 5 - BlastQueryAgains..> 13-Oct-2005 15:26 3.0K -[   ] 6 - compareKeywordAn..> 13-Oct-2005 15:26 6.2K -[   ] 7 - compareKeywordAn..> 13-Oct-2005 15:26 13K -[   ] 8 - hmm dragon workf..> 13-Oct-2005 15:26 7.1K +[   ] 5 - BlastQueryAgains..> 13-Oct-2005 15:26 3.0K +[   ] 6 - compareKeywordAn..> 13-Oct-2005 15:26 6.2K +[   ] 7 - compareKeywordAn..> 13-Oct-2005 15:26 13K +[   ] 8 - hmm dragon workf..> 13-Oct-2005 15:26 7.1K [   ] 9 - DNASequenceHolde..> 13-Oct-2005 15:26 10K [TXT] readme.txt 13-Oct-2005 15:26 127 -
    - +
    +
    + + From kawas at pub.open-bio.org Wed Oct 19 22:41:03 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:41:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192241.j9JMf33O022797@pub.open-bio.org> kawas Wed Oct 19 18:41:03 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/workflows In directory pub.open-bio.org:/tmp/cvs-serv22743 Modified Files: 1 - workflow.xml 1 - workflowInput.xml 2 - blastDragonDbWorkflow.xml 3 - cos_fixedInput.xml 4 - characterizeGeneticElement.xml 5 - BlastQueryAgainstAraProteinsE13.xml 6 - compareKeywordAndSimilarity.xml 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml Added Files: 8 - hmm dragon workflow.xml 9 - DNASequenceHolder element.xml Log Message: removed some appended text from the workflows moby-live/Java/docs/taverna/workflows 8 - hmm dragon workflow.xml,NONE,1.1 9 - DNASequenceHolder element.xml,NONE,1.1 1 - workflow.xml,1.1,1.2 1 - workflowInput.xml,1.1,1.2 2 - blastDragonDbWorkflow.xml,1.1,1.2 3 - cos_fixedInput.xml,1.1,1.2 4 - characterizeGeneticElement.xml,1.1,1.2 5 - BlastQueryAgainstAraProteinsE13.xml,1.1,1.2 6 - compareKeywordAndSimilarity.xml,1.1,1.2 7 - compareKeywordAndSimilarityAndPhytoprot_count.xml,1.1,1.2 rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/8,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/hmm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/dragon,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/9,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/DNASequenceHolder,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/workflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/1,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/workflowInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/2,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/blastDragonDbWorkflow.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/3,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/cos_fixedInput.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/4,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/characterizeGeneticElement.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/5,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/BlastQueryAgainstAraProteinsE13.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/6,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/compareKeywordAndSimilarity.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/7,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/taverna/workflows/RCS/compareKeywordAndSimilarityAndPhytoprot_count.xml,v: No such file or directory From kawas at pub.open-bio.org Wed Oct 19 22:41:30 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 19 Oct 2005 18:41:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510192241.j9JMfUx8022844@pub.open-bio.org> kawas Wed Oct 19 18:41:30 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory pub.open-bio.org:/tmp/cvs-serv22817 Modified Files: workflows.html Log Message: missed a link moby-live/Java/docs/taverna/guide workflows.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:34:38 1.2 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/workflows.html 2005/10/19 22:41:30 1.3 @@ -15,9 +15,9 @@ [   ] 6 - compareKeywordAn..> 13-Oct-2005 15:26 6.2K [   ] 7 - compareKeywordAn..> 13-Oct-2005 15:26 13K [   ] 8 - hmm dragon workf..> 13-Oct-2005 15:26 7.1K -[   ] 9 - DNASequenceHolde..> 13-Oct-2005 15:26 10K +[   ] 9 - DNASequenceHolde..> 13-Oct-2005 15:26 10K -[TXT] readme.txt 13-Oct-2005 15:26 127 +[TXT] readme.txt 13-Oct-2005 15:26 127
    From kawas at pub.open-bio.org Thu Oct 20 19:07:06 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Thu, 20 Oct 2005 15:07:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510201907.j9KJ765R029709@pub.open-bio.org> kawas Thu Oct 20 15:07:06 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv29684/org/biomoby/shared/extended Modified Files: NamespaceParser.java Log Message: finished the logic using what is currently available in the rdf document that describes the namespace ontology. moby-live/Java/src/main/org/biomoby/shared/extended NamespaceParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/NamespaceParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/NamespaceParser.java 2005/10/18 18:37:13 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/NamespaceParser.java 2005/10/20 19:07:06 1.2 @@ -14,10 +14,24 @@ import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.RDFReader; +import com.hp.hpl.jena.rdf.model.ResIterator; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.vocabulary.RDF; +import com.hp.hpl.jena.vocabulary.RDFS; /** * * @author Eddie created Oct 18, 2005 + * This class parses the RDF document that describes the namespace ontology.

    + * An example of how to use this class is below: + *

    
    +        NamespaceParser p = new NamespaceParser("http://biomoby.org/RESOURCES/MOBY-S/Namespaces");
    +		MobyNamespace[] namespaces = p.getMobyNamespacesFromRDF();
    +		for (int i = 0; i < namespaces.length; i++) {
    +			System.out.println(namespaces[i]);
    +		}
    +   

    + This would output the following the name and description for each namespace in the document */ public class NamespaceParser { @@ -139,7 +153,18 @@ Model model = ModelFactory.createDefaultModel(); RDFReader reader = model.getReader(); reader.read(model, new StringReader(getRdfAsString()), null); - // TODO start querying the model and creating namespace objects + // get all subjects in the document + ResIterator iterator = model.listSubjects(); + while (iterator.hasNext()) { + Resource resource = iterator.nextResource(); + // extract the name of the namespace + String name = resource.getLocalName(); + MobyNamespace namespace = new MobyNamespace(name); + // extract the comment (a literal in the document) + String description = resource.getProperty(RDFS.comment).getLiteral().getString(); + namespace.setDescription(description); + list.add(namespace); + } // return the array return (MobyNamespace[]) list.toArray(new MobyNamespace[list.size()]); @@ -152,7 +177,6 @@ private String getRdfAsString() { String s = null; StringBuffer sb = new StringBuffer(); - URL url = null; try { BufferedReader in = null; in = new BufferedReader(new InputStreamReader(url.openStream())); @@ -165,4 +189,14 @@ } return sb.toString(); } + + + public static void main(String[] args) throws MobyException { + // show how to use this class + NamespaceParser p = new NamespaceParser("http://biomoby.org/RESOURCES/MOBY-S/Namespaces"); + MobyNamespace[] namespaces = p.getMobyNamespacesFromRDF(); + for (int i = 0; i < namespaces.length; i++) { + System.out.println(namespaces[i]); + } + } } From carrere at pub.open-bio.org Fri Oct 21 13:22:19 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Fri, 21 Oct 2005 09:22:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510211322.j9LDMJIq001132@pub.open-bio.org> carrere Fri Oct 21 09:22:18 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv1100 Modified Files: MOBYXSLT.pm Log Message: Bug in getObjectHasaElements fixed. This function is very usefull for new ontology. To retrieve content (i.e. ...) of an object: my @a_hasa_elements = &MOBYXSLT::getObjectHasaElements($article); if ($#a_hasa_elements >= 0) { foreach my $hasa_element (@a_hasa_elements) { if (&MOBYXSLT::getObjectName($hasa_element) eq 'content') { $input_data = &MOBYXSLT::getObjectContent($hasa_element); } } } moby-live/Perl/MOBY MOBYXSLT.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/09/08 13:51:06 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/10/21 13:22:18 1.2 @@ -1,10 +1,8 @@ package MOBYXSLT; -use strict; -use Carp; -my $TMP_DIR = '/tmp/'; #Where your temporary files will be written -my $XSLTPROC = '/usr/bin/xsltproc'; #Where your xsltproc binary is located -my $XSL_SHEET = './xsl/parseMobyMessage.xsl';#Where your xsltproc style-sheet is located +my $TMP_DIR = '/tmp/';#Where your temporary files will be written +my $XSLTPROC = '/usr/bin/xsltproc';#Where your xsltproc binary is located +my $XSL_SHEET = '/bioinfo/www/bioinfo/services/biomoby/cgi-bin/Services/LIPM/lib/parseMobyMessage.xsl';#Where your xsltproc style-sheet is located #$Id$ @@ -31,8 +29,6 @@ =head1 SYNOPSIS -use MOBYXSLT; - sub MonWebservice { @@ -47,8 +43,8 @@ foreach my $query (@{$ra_queries}) { - my $query_id = MOBYXSLT::getInputID($query);#Retrieve Query ID - my @a_input_articles = MOBYXSLT::getArticles($query);#Retrieve articles + my $query_id = MOBYXSLT::getInputID($query);#Retrieve Query ID + my @a_input_articles = MOBYXSLT::getArticles($query);#Retrieve articles my ($fasta_sequences, $fasta_namespace, $fasta_id) = ('','',''); @@ -58,9 +54,9 @@ if (MOBYXSLT::isSimpleArticle($article)) { - my $object_type = MOBYXSLT::getObjectType($article); + my $object_type = MOBYXSLT::getObjectType($article); - if (IsTheCorrectType($object_type)) + if (IsTheCorrectType($object_type)) { $fasta_sequences = MOBYXSLT::getObjectContent($article); $fasta_namespace = MOBYXSLT::getObjectNamespace($article); @@ -80,10 +76,15 @@ ###### #What you want to do with your data ###### - + + my $cmd ="..."; + system("$cmd"); + + + ######### #Send result ######### @@ -106,19 +107,16 @@ my $XSL_SHEET = './parseMobyMessage.xsl'; #Where your xsltproc style-sheet is located -=head1 NOTE - - Many functions have same names as those from MOBY::CommonSubs - -=head1 AUTHORS +=head1 DESCRIPTION - Sebastien.Carrere at toulouse.inra.fr - -=head1 METHODS + Note: many functions have same names as those from MOBY::CommonSubs =cut +use strict; +use Carp; + =head2 function getInputs Title : getInputs @@ -151,6 +149,11 @@ close TMP; my $parsed_message = `$XSLTPROC $XSL_SHEET $TMP_DIR$tmp_file`; + +# open (PARSED, ">$TMP_DIR$tmp_file" . ".xsl"); +# print PARSED "$XSLTPROC $XSL_SHEET $TMP_DIR$tmp_file\n\n\n"; +# print PARSED "$parsed_message"; +# close PARSED; my $servicenotes = ''; my @a_queries = (); @@ -337,7 +340,7 @@ Function : Takes a simple article structure (from getArticles or getCollectedSimples) and retrieve the list of "HASA" element HASHREF Returns : @a_hasa_elements: ARRAY of "HASA" element HASHREF - Args : $rh_simple_article: simple article HASHREF structure from getArticles or getCollectedSimples + Args : $rh_object: simple article HASHREF structure from getArticles or getCollectedSimples Globals : none =cut @@ -346,14 +349,37 @@ { my $rh_simple_article = shift(); - if ($rh_simple_article->{'object_hasa'} ne '') + if (defined $rh_simple_article->{'article_objects'}) { - return (@{$rh_simple_article->{'object_hasa'}}); + if ($rh_simple_article->{'article_objects'}->{'object_hasa'} ne '') + { + return (@{$rh_simple_article->{'article_objects'}->{'object_hasa'}}); + } + else + { + return (); + } } else { - return (); + if ($rh_simple_article->{'object_hasa'} ne '') + { + return @{$rh_simple_article->{'object_hasa'}}; + } + else + { + return (); + } } + +# if ($rh_object->{'object_hasa'} ne '') +# { +# return (@{$rh_object->{'object_hasa'}}); +# } +# else +# { +# return (); +# } } =head2 function getObjectType From gss at pub.open-bio.org Fri Oct 21 17:36:46 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Fri, 21 Oct 2005 13:36:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510211736.j9LHakw2002265@pub.open-bio.org> gss Fri Oct 21 13:36:45 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/tools In directory pub.open-bio.org:/tmp/cvs-serv2244/src/org/semanticmoby/tools Added Files: FormatConverter.java Log Message: Initial version s-moby/ref-impl/core/src/org/semanticmoby/tools FormatConverter.java,NONE,1.1 From kawas at pub.open-bio.org Fri Oct 21 17:45:01 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 21 Oct 2005 13:45:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510211745.j9LHj16T002317@pub.open-bio.org> kawas Fri Oct 21 13:45:01 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory pub.open-bio.org:/tmp/cvs-serv2292/org/biomoby/shared/extended Modified Files: ServiceTypeParser.java Log Message: added the parsing logic for the rdf document describing the service type ontology. moby-live/Java/src/main/org/biomoby/shared/extended ServiceTypeParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceTypeParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceTypeParser.java 2005/10/18 18:37:13 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceTypeParser.java 2005/10/21 17:45:01 1.2 @@ -14,6 +14,9 @@ import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.RDFReader; +import com.hp.hpl.jena.rdf.model.ResIterator; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.vocabulary.RDFS; /** * @@ -139,7 +142,21 @@ Model model = ModelFactory.createDefaultModel(); RDFReader reader = model.getReader(); reader.read(model, new StringReader(getRdfAsString()), null); - // TODO start querying the model and creating Service Type objects + // start querying the model and creating Service Type objects + ResIterator iterator = model.listSubjects(); + while (iterator.hasNext()) { + Resource resource = iterator.nextResource(); + String name = resource.getLocalName(); + MobyServiceType servicetype = new MobyServiceType(name); + if (!resource.hasProperty(RDFS.subClassOf)) { + continue; + } + String parent = resource.getProperty(RDFS.subClassOf).getObject().toString(); + servicetype.setParentNames(new String[] {parent}); + String description = resource.getProperty(RDFS.comment).getLiteral().getString(); + servicetype.setDescription(description); + list.add(servicetype); + } // return the array return (MobyServiceType[]) list @@ -153,7 +170,6 @@ private String getRdfAsString() { String s = null; StringBuffer sb = new StringBuffer(); - URL url = null; try { BufferedReader in = null; in = new BufferedReader(new InputStreamReader(url.openStream())); @@ -166,4 +182,12 @@ } return sb.toString(); } + + public static void main(String[] args) throws MobyException { + ServiceTypeParser p = new ServiceTypeParser("http://biomoby.org/RESOURCES/MOBY-S/Services"); + MobyServiceType[] types = p.getMobyServiceTypesFromRDF(); + for (int i = 0; i < types.length; i++) { + System.out.println(types[i]); + } + } } From senger at pub.open-bio.org Sat Oct 22 01:38:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 21 Oct 2005 21:38:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c4fR003411@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/client Modified Files: BaseClient.java CentralDigestCachedImpl.java CentralDigestImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseClient.java,1.2,1.3 CentralDigestCachedImpl.java,1.9,1.10 CentralDigestImpl.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/10/22 01:38:04 1.3 @@ -169,9 +169,9 @@ } catch (MalformedURLException e) { throw new MobyException ("Service endpoint '" + serviceEndpoint + "' is not a valid URL."); - } catch (GException e) { - throw new MobyException (e.getMessage()); - } + } catch (GException e) { + throw new MobyException (e.getMessage()); + } } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/12 11:17:59 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/22 01:38:04 1.10 @@ -15,6 +15,7 @@ import java.io.PrintWriter; import java.util.Iterator; import java.util.Map; +import java.util.TreeMap; import java.util.Vector; import java.util.Arrays; import java.util.Comparator; @@ -126,9 +127,9 @@ /************************************************************************** * Removes object groups from the cache. If 'id' is null it - * removes the whole cache (for the Moby registry this instance as - * initiated for). Otherwise 'id' indicates what part of the cache - * that will be removed.

    + * removes the whole cache (for that Moby registry this instance + * was initiated for). Otherwise 'id' indicates which part of the + * cache that will be removed.

    * * @param id should be either null, or one of the fillowing: * {@link #CACHE_PART_DATATYPES}, {@link #CACHE_PART_SERVICES}, @@ -313,21 +314,38 @@ } } - // + /************************************************************************** + * Is the given cache empty (meaning: cache directory does not + * exist, is empty, or contains only files to be ignored)? + *************************************************************************/ protected boolean isCacheEmpty (File cache) throws MobyException { if (cache == null) return true; String[] list = cache.list(); - return ( list == null || list.length == 0 ); + if (list == null || list.length == 0) + return true; + for (int i = 0; i < list.length; i++) { + if ( ! ignored (new File (list[i])) ) + return false; + } + return true; } - protected void fillDataTypesCache() + /************************************************************************** + * Load data types from a moby registry into local cache. If it is + * interrupted (by a callback signal) it removes what was already + * put into this cache and returns false. Otherwise returns + * true. It raises an exception if it cannot fill the cache (from + * some other reasons). + *************************************************************************/ + protected boolean fillDataTypesCache() throws MobyException { try { + fireEvent (DATA_TYPES_START); String typesAsXML = getDataTypeNamesAsXML(); store (dataTypesCache, LIST_FILE, typesAsXML); Map types = createDataTypeNamesFromXML (typesAsXML); - fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); + fireEvent (DATA_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); @@ -335,19 +353,28 @@ String xml = getDataTypeAsXML (name); store (dataTypesCache, name, xml); fireEvent (DATA_TYPE_LOADED, name); + if (stopDT) { + removeFromCache (CACHE_PART_DATATYPES); + return false; + } } + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopDT ? DATA_TYPES_CANCELLED : DATA_TYPES_END); + stopDT = false; } } - protected void fillServicesCache() + protected boolean fillServicesCache() throws MobyException { try { + fireEvent (AUTHORITIES_START); String byAuthorityAsXML = getServiceNamesByAuthorityAsXML(); store (servicesCache, LIST_FILE, byAuthorityAsXML); Map authorities = createServiceNamesByAuthorityFromXML (byAuthorityAsXML); - fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); + fireEvent (AUTHORITIES_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); @@ -355,20 +382,29 @@ String xml = getServicesAsXML (new MobyService (MobyService.DUMMY_NAME, authority), null, true, true); store (servicesCache, authority, xml); fireEvent (AUTHORITY_LOADED, authority); + if (stopS) { + removeFromCache (CACHE_PART_SERVICES); + return false; + } } + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopS ? AUTHORITIES_CANCELLED : AUTHORITIES_END); + stopS = false; } } // - protected void fillServiceTypesCache() + protected boolean fillServiceTypesCache() throws MobyException { try { + fireEvent (SERVICE_TYPES_START); String typesAsXML = getServiceTypesAsXML(); store (serviceTypesCache, LIST_FILE, typesAsXML); Map types = createServiceTypesFromXML (typesAsXML); - fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); + fireEvent (SERVICE_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); @@ -376,22 +412,32 @@ String xml = getServiceTypeRelationshipsAsXML (name, false); store (serviceTypesCache, name, xml); fireEvent (SERVICE_TYPE_LOADED, name); + if (stopST) { + removeFromCache (CACHE_PART_SERVICETYPES); + return false; + } } + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopST ? SERVICE_TYPES_CANCELLED :SERVICE_TYPES_END); + stopST = false; } } // - protected void fillNamespacesCache() + protected boolean fillNamespacesCache() throws MobyException { try { - fireEvent (NAMESPACE_LOADING, "Loading started."); + fireEvent (NAMESPACES_START); String xml = getNamespacesAsXML(); store (namespacesCache, LIST_FILE, xml); - fireEvent (NAMESPACE_LOADED, "Loaded."); + return true; } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (NAMESPACES_END); } } @@ -405,7 +451,9 @@ synchronized (dataTypesCache) { if (isCacheEmpty (dataTypesCache)) { initCache(); - fillDataTypesCache(); + if (! fillDataTypesCache()) + // callback stopped filling + return new TreeMap(); } // get a list file (with all data type names) @@ -425,7 +473,9 @@ Vector v = new Vector(); if (isCacheEmpty (dataTypesCache)) { initCache(); - fillDataTypesCache(); + if (! fillDataTypesCache()) + // callback stopped filling + return new MobyDataType[] {}; } File[] list = dataTypesCache.listFiles(); if (list == null) @@ -456,7 +506,9 @@ synchronized (servicesCache) { if (isCacheEmpty (servicesCache)) { initCache(); - fillServicesCache(); + if (! fillServicesCache()) + // callback stopped filling + return new TreeMap(); } // get a list file (with all service names) @@ -476,7 +528,9 @@ Vector v = new Vector(); if (isCacheEmpty (servicesCache)) { initCache(); - fillServicesCache(); + if (! fillServicesCache()) + // callback stopped filling + return new MobyService[] {}; } File[] list = servicesCache.listFiles(); if (list == null) @@ -529,7 +583,9 @@ synchronized (serviceTypesCache) { if (isCacheEmpty (serviceTypesCache)) { initCache(); - fillServiceTypesCache(); + if (! fillServiceTypesCache()) + // callback stopped filling + return new MobyServiceType[] {}; } // get a list file (with all service type names) =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/12 11:17:59 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/22 01:38:04 1.7 @@ -41,6 +41,9 @@ protected MobyService[] services = new MobyService[] {}; protected MobyNamespace[] namespaces = new MobyNamespace[] {}; + protected boolean stopDT = false; + protected boolean stopST = false; + protected boolean stopS = false; /************************************************************************* * Default constructor. It connects to a default Moby registry @@ -77,14 +80,19 @@ throws MobyException { try { Vector v = new Vector(); + fireEvent (DATA_TYPES_START); Map types = getDataTypeNames(); - fireEvent (DATA_TYPE_COUNT, new Integer (types.size())); + fireEvent (DATA_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); fireEvent (DATA_TYPE_LOADING, name); v.addElement (getDataType (name)); fireEvent (DATA_TYPE_LOADED, name, v.lastElement()); + if (stopDT) { + v = new Vector(); + break; + } } MobyDataType[] result = new MobyDataType [v.size()]; v.copyInto (result); @@ -92,6 +100,9 @@ } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopDT ? DATA_TYPES_CANCELLED : DATA_TYPES_END); + stopDT = false; } } @@ -102,8 +113,9 @@ throws MobyException { try { Vector v = new Vector(); + fireEvent (SERVICE_TYPES_START); Map types = getServiceTypes(); - fireEvent (SERVICE_TYPE_COUNT, new Integer (types.size())); + fireEvent (SERVICE_TYPES_COUNT, new Integer (types.size())); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String typeName = (String)entry.getKey(); @@ -113,6 +125,10 @@ serviceType.setParentNames (getServiceTypeRelationships (typeName, false)); v.addElement (serviceType); fireEvent (SERVICE_TYPE_LOADED, typeName, v.lastElement()); + if (stopST) { + v = new Vector(); + break; + } } MobyServiceType[] result = new MobyServiceType [v.size()]; v.copyInto (result); @@ -120,6 +136,9 @@ } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (stopST ? SERVICE_TYPES_CANCELLED : SERVICE_TYPES_END); + stopST = false; } } @@ -136,8 +155,9 @@ protected MobyNamespace[] readNamespaces() throws MobyException { try { + fireEvent (NAMESPACES_START); Map names = getNamespaces(); - fireEvent (NAMESPACE_COUNT, new Integer (names.size())); + fireEvent (NAMESPACES_COUNT, new Integer (names.size())); MobyNamespace[] result = new MobyNamespace [ names.size() ]; int i = 0; for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { @@ -152,6 +172,8 @@ } catch (Exception e) { throw new MobyException (formatException (e)); + } finally { + fireEvent (NAMESPACES_END); } } @@ -162,8 +184,9 @@ throws MobyException { try { Vector v = new Vector(); + fireEvent (AUTHORITIES_START); Map authorities = getServiceNamesByAuthority(); - fireEvent (AUTHORITY_COUNT, new Integer (authorities.size())); + fireEvent (AUTHORITIES_COUNT, new Integer (authorities.size())); for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String authority = (String)entry.getKey(); @@ -175,15 +198,20 @@ v.addElement (servs[j]); } fireEvent (AUTHORITY_LOADED, authority); + if (stopS) { + v = new Vector(); + break; + } } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); return result; } catch (Exception e) { - System.err.println ("HERE:\n" + e.toString()); - e.printStackTrace(); throw new MobyException (formatException (e)); + } finally { + fireEvent (stopS ? AUTHORITIES_CANCELLED : AUTHORITIES_END); + stopS = false; } } @@ -323,6 +351,14 @@ /********************************************************************* * ********************************************************************/ + public void addNotificationListeners (NotificationListener[] l) { + for (int i = 0; i < l.length; i++) + addNotificationListener (l[i]); + } + + /********************************************************************* + * + ********************************************************************/ public void removeNotificationListener (NotificationListener l) { if (listeners != null) listeners.removeElement (l); @@ -331,6 +367,14 @@ /********************************************************************* * ********************************************************************/ + public void removeNotificationListeners (NotificationListener[] l) { + for (int i = 0; i < l.length; i++) + removeNotificationListener (l[i]); + } + + /********************************************************************* + * + ********************************************************************/ public NotificationListener[] getNotificationListeners() { if (listeners == null) return new NotificationListener[] {}; @@ -344,14 +388,21 @@ /********************************************************************* * ********************************************************************/ - protected void fireEvent (String type, Object message) { - fireEvent (type, message, null); + public void callback (int signal) { + switch (signal) { + case SIGNAL_CANCEL_DATA_TYPES: + stopDT = true; break; + case SIGNAL_CANCEL_SERVICE_TYPES: + stopST = true; break; + case SIGNAL_CANCEL_SERVICES: + stopS = true; break; + } } /********************************************************************* * ********************************************************************/ - protected void fireEvent (String type, Object message, Object details) { + public void fireEvent (int type, Object message, Object details) { NotificationEvent event = null; if (details == null) event = new NotificationEvent (this, type, message.toString()); @@ -367,6 +418,21 @@ } } + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (int type) { + fireEvent (type, "", null); + } + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (int type, Object message) { + fireEvent (type, message, null); + } + + From senger at pub.open-bio.org Sat Oct 22 01:38:05 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 21 Oct 2005 21:38:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c5B1003505@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/shared/event Modified Files: NotificationEvent.java Notifier.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,1.1,1.2 Notifier.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/22 01:38:04 1.2 @@ -13,15 +13,16 @@ /** * An event fired by various Moby components to inform that something * has happened. Typical usage is for monitoring access to a Biomoby - * registry (how many entities yet to read, and which one was just + * registry (how many entities to read, and which one was just * read).

    * * Each notification event points to its source (this is inherited - * from a usual Java's EventObject). Additionally, it has its type (a - * string value, usually taken from a list defined in this class), a - * message (whose format may be detremined by the notification type), - * and optionally an object with more details (again, its presence or - * absence may depend on the notification type).

    + * from a usual Java's EventObject). Additionally, it has its type (an + * integer value, preferably taken from a list defined in interface + * {@link org.biomoby.shared.event.Notifier}), a message (whose format + * may be determined by the notification type), and optionally an + * object with more details (again, its presence or absence may depend + * on the notification type).

    * * @author Martin Senger * @version $Id$ @@ -30,7 +31,7 @@ public class NotificationEvent extends EventObject { - private String type; + private int type; private String message; private Object details; @@ -45,10 +46,10 @@ * A usual constructor, setting notification type and a message. ********************************************************************/ public NotificationEvent (Object source, - String type, String message) { + int type, String message) { this (source); this.type = type; - this.message = message; + this.message = (message == null ? "" : message); } /********************************************************************* @@ -56,7 +57,7 @@ * details. ********************************************************************/ public NotificationEvent (Object source, - String type, String message, + int type, String message, Object details) { this (source, type, message); this.details = details; @@ -65,7 +66,7 @@ /********************************************************************* * Return a type of this notification event. ********************************************************************/ - public String getType() { + public int getType() { return type; } @@ -88,9 +89,15 @@ * ********************************************************************/ public String toString() { + String typeStr = null; + try { + typeStr = typeTexts [type]; + } catch (Exception e) { + typeStr = "" + type; + } StringBuffer buf = new StringBuffer (100); buf.append ("["); - buf.append ("Type=" + type); + buf.append (typeStr); buf.append (", Message=" + message); if (details != null) buf.append (", Details=" + details.getClass().getName()); @@ -98,4 +105,35 @@ return new String (buf); } + static final String[] typeTexts = new String[] { + "data-type-start", + "data-type-count", + "data-type-loading", + "data-type-loaded", + "data-type-end", + "service-type-start", + "service-type-count", + "service-type-loading", + "service-type-loaded", + "service-type-end", + "namespace-start", + "namespace-count", + "namespace-loading", + "namespace-loaded", + "namespace-end", + "authority-start", + "authority-count", + "authority-loading", + "authority-loaded", + "authority-end", + "data-type-reset", + "service-type-reset", + "namespace-reset", + "authority-reset", + "data-type-cancel", + "service-type-cancel", + "namespace-cancel", + "authority-cancel" + }; + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/12 11:36:59 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/22 01:38:04 1.3 @@ -16,21 +16,46 @@ public interface Notifier { - static final String DATA_TYPE_COUNT = "data-type-count"; - static final String DATA_TYPE_LOADING = "data-type-loading"; - static final String DATA_TYPE_LOADED = "data-type-loaded"; - - static final String SERVICE_TYPE_COUNT = "service-type-count"; - static final String SERVICE_TYPE_LOADING = "service-type-loading"; - static final String SERVICE_TYPE_LOADED = "service-type-loaded"; - - static final String NAMESPACE_COUNT = "namespace-count"; - static final String NAMESPACE_LOADING = "namespace-loading"; - static final String NAMESPACE_LOADED = "namespace-loaded"; - - static final String AUTHORITY_COUNT = "authority-count"; - static final String AUTHORITY_LOADING = "authority-loading"; - static final String AUTHORITY_LOADED = "authority-loaded"; + static final int DATA_TYPES_START = 0; + static final int DATA_TYPES_COUNT = 1; + static final int DATA_TYPE_LOADING = 2; + static final int DATA_TYPE_LOADED = 3; + static final int DATA_TYPES_END = 4; + + static final int SERVICE_TYPES_START = 5; + static final int SERVICE_TYPES_COUNT = 6; + static final int SERVICE_TYPE_LOADING = 7; + static final int SERVICE_TYPE_LOADED = 8; + static final int SERVICE_TYPES_END = 9; + + static final int NAMESPACES_START = 10; + static final int NAMESPACES_COUNT = 11; + static final int NAMESPACE_LOADING = 12; + static final int NAMESPACE_LOADED = 13; + static final int NAMESPACES_END = 14; + + static final int AUTHORITIES_START = 15; + static final int AUTHORITIES_COUNT = 16; + static final int AUTHORITY_LOADING = 17; + static final int AUTHORITY_LOADED = 18; + static final int AUTHORITIES_END = 19; + + static final int DATA_TYPES_RESET = 20; + static final int SERVICE_TYPES_RESET = 21; + static final int NAMESPACES_RESET = 22; + static final int AUTHORITIES_RESET = 23; + + static final int DATA_TYPES_CANCELLED = 24; + static final int SERVICE_TYPES_CANCELLED = 25; + static final int NAMESPACES_CANCELLED = 26; + static final int AUTHORITIES_CANCELLED = 27; + + + + static final int SIGNAL_CANCEL_DATA_TYPES = 1; + static final int SIGNAL_CANCEL_SERVICE_TYPES = 2; + static final int SIGNAL_CANCEL_SERVICES = 3; + static final int SIGNAL_CANCEL_NAMESPACES = 4; /********************************************************************* * Adds the specified notification listener to receive @@ -42,6 +67,15 @@ void addNotificationListener (NotificationListener l); /********************************************************************* + * Adds the specified notification listeners to receive + * notification events from the class that implements this + * interface.

    + * + * @param l notification listeners to be added + ********************************************************************/ + void addNotificationListeners (NotificationListener[] l); + + /********************************************************************* * Removes the specified notification listener so that it no * longer receives notification events from the class that * implements this interface.

    @@ -51,6 +85,15 @@ void removeNotificationListener (NotificationListener l); /********************************************************************* + * Removes the specified notification listeners so that they no + * longer receive notification events from the class that + * implements this interface.

    + * + * @param l notification listeners to be removed + ********************************************************************/ + void removeNotificationListeners (NotificationListener[] l); + + /********************************************************************* * Returns an array of all the NotificationListeners added to the * class that implements this interface.

    * @@ -59,4 +102,19 @@ ********************************************************************/ NotificationListener[] getNotificationListeners(); + /********************************************************************* + * Call the notifier and signal that it can stop loading data (or + * whatever it is doing).

    + * + * @param signal identify what to stop doing (some usual values of + * this signal are defined elsewhere in this interface with names + * starting by SIGNAL_) + ********************************************************************/ + void callback (int callbackSignal); + + /********************************************************************* + * + ********************************************************************/ + void fireEvent (int type, Object message, Object details); + } From senger at pub.open-bio.org Sat Oct 22 01:38:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 21 Oct 2005 21:38:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c4rl003480@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/shared Modified Files: CentralAll.java Log Message: moby-live/Java/src/main/org/biomoby/shared CentralAll.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralAll.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralAll.java 2004/10/18 14:35:06 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralAll.java 2005/10/22 01:38:04 1.2 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.biomoby.shared.event.Notifier; + /** * A common interface to the classical features of a MobyRegistry (as * expressed in {@link Central}) and to the cumulated (digested) From senger at pub.open-bio.org Sat Oct 22 01:38:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 21 Oct 2005 21:38:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510220138.j9M1c4cR003459@pub.open-bio.org> senger Fri Oct 21 21:38:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv3384/src/main/org/biomoby/service/dashboard Modified Files: CommonTree.java Dashboard.java DashboardProperties.java DataTypesTree.java JProgressBarWithCancel.java PropertyChannel.java RegistryModel.java RegistryPanel.java Added Files: CommonBoard.java DataTypesBoard.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard CommonBoard.java,NONE,1.1 DataTypesBoard.java,NONE,1.1 CommonTree.java,1.3,1.4 Dashboard.java,1.4,1.5 DashboardProperties.java,1.3,1.4 DataTypesTree.java,1.1,1.2 JProgressBarWithCancel.java,1.1,1.2 PropertyChannel.java,1.2,1.3 RegistryModel.java,1.4,1.5 RegistryPanel.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/12 11:17:59 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/22 01:38:04 1.4 @@ -67,11 +67,14 @@ // protected PropertyChangeSupport support; // protected boolean expanded = true; // the status of the application list + protected String rootNode; + /********************************************************************* * Constructor ********************************************************************/ public CommonTree (String rootNode) { super (new DefaultTreeModel (new DefaultMutableTreeNode (new CommonNode (rootNode)))); + this.rootNode = rootNode; // create an almost empty tree, only with a root node that // contains just a String holding the name of the root node; @@ -135,6 +138,11 @@ setFont (new Font ("Dialog", Font.PLAIN, 10)); } + // root node + if (row == 0) { + setText (rootNode); + } + // TBD: whale icon? // if (leaf) // ((JLabel)c).setIcon (icons [COMPUTER]); @@ -159,6 +167,13 @@ /********************************************************************* + * Get data from a registry model and update the tree. Will be + * overwritten by subclass. + ********************************************************************/ + public void update (int howSorted) { + } + + /********************************************************************* * Called when a tree node is selected. Does nothing here ********************************************************************/ protected void selected (DefaultMutableTreeNode node) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/24 17:51:51 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/22 01:38:04 1.5 @@ -26,6 +26,7 @@ import java.awt.GridBagLayout; import java.awt.Font; +import java.awt.Dimension; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -125,7 +126,7 @@ public void show() { JFrame frame = SwingUtils.createMainFrame (getComponent (propertyChannel), getName()); - SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); + SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); } /************************************************************************** @@ -226,7 +227,7 @@ /************************************************************************** * **************************************************************************/ - DashboardHeader getHeader() { + protected DashboardHeader getHeader() { DashboardHeader h = new DashboardHeader (dashboardProperties); if (panels.length > 0) h.setPanelTitle (panels[0].getTitle()); @@ -259,7 +260,7 @@ * Return a component representing status bar (usually placed at * the bottom of a dashboard). **************************************************************************/ - StatusBar getStatusBar() { + protected StatusBar getStatusBar() { return new StatusBar ("Status: Work in progress"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/24 17:51:51 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/22 01:38:04 1.4 @@ -37,6 +37,7 @@ static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; static final String DP_CACHE_DIR = "dp-cache-dir"; + static final String DP_USE_CACHE = "dp-use-cache"; /** A filename containing Java properties that configure the dashboard. */ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/22 01:38:04 1.2 @@ -17,6 +17,7 @@ import org.tulsoft.shared.UUtils; import javax.swing.JMenuItem; import javax.swing.JCheckBoxMenuItem; +import javax.swing.JProgressBar; import javax.swing.AbstractAction; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; @@ -118,8 +119,9 @@ /********************************************************************* * Get data from a registry model and update the tree. ********************************************************************/ - void update (int howSorted) { + public void update (int howSorted) { setEnabledPopup (false); + updateException = null; final int sorted = howSorted; final SwingWorker worker = new SwingWorker() { @@ -144,11 +146,13 @@ onUpdateDataTreeByAuth (dataTypes); else onUpdateDataTree (dataTypes); - setEnabledPopup (true); - if (sorted == SORTED_BY_AUTHORITY) - deprecatedBox.setEnabled (false); - else - deprecatedBox.setEnabled (true); + if (dataTypes.length > 0) { + setEnabledPopup (true); + if (sorted == SORTED_BY_AUTHORITY) + deprecatedBox.setEnabled (false); + else + deprecatedBox.setEnabled (true); + } } } }; @@ -321,7 +325,6 @@ worker.start(); } - /********************************************************************* * * A tree node representing a child element of a Moby data type. @@ -353,4 +356,7 @@ } } + + + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/JProgressBarWithCancel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/JProgressBarWithCancel.java 2005/10/12 11:17:59 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/JProgressBarWithCancel.java 2005/10/22 01:38:04 1.2 @@ -29,6 +29,7 @@ import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Dimension; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -72,14 +73,16 @@ progressBar.setValue (0); progressBar.setStringPainted (true); - cancelButton = new JButton(); + Icon cancelIcon = SwingUtils.createIcon ("images/smallCancel.gif", this); + cancelButton = new JButton (cancelIcon); cancelButton.setFocusPainted (false); + cancelButton.setMargin (new Insets (0,0,0,0)); + cancelButton.setContentAreaFilled (false); cancelButton.setToolTipText ("Cancel the process"); // put it together ( TBD: should depend on progressBar.getOrientation() ) - SwingUtils.addComponent (this, progressBar, 0, 0, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.WEST, 1.0, 0.0); + SwingUtils.addComponent (this, progressBar, 0, 0, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST, 1.0, 0.0); SwingUtils.addComponent (this, cancelButton, 1, 0, 1, 1, GridBagConstraints.NONE, GridBagConstraints.WEST, 0.0, 0.0); - } /********************************************************************* @@ -96,4 +99,11 @@ return cancelButton; } + /********************************************************************* + * + ********************************************************************/ + public void addActionListener (ActionListener l) { + getButton().addActionListener (l); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/12 11:17:59 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/22 01:38:04 1.3 @@ -8,6 +8,8 @@ package org.biomoby.service.dashboard; +import org.tulsoft.shared.UUtils; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -86,6 +88,17 @@ } /********************************************************************* + * + ********************************************************************/ + public boolean getBoolean (Object key, boolean defaultValue) { + Object value = get (key); + if (value == null) return defaultValue; + if (value instanceof Boolean) + return ((Boolean)value).booleanValue(); + return UUtils.is (value.toString()); + } + + /********************************************************************* * Property change stuff ********************************************************************/ protected PropertyChangeSupport support; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/12 11:17:59 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/22 01:38:04 1.5 @@ -13,6 +13,10 @@ import org.biomoby.shared.CentralAll; import org.biomoby.client.CentralDigestCachedImpl; +import org.biomoby.shared.event.Notifier; +import org.biomoby.shared.event.NotificationEvent; +import org.biomoby.shared.event.NotificationListener; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -32,9 +36,11 @@ */ public class RegistryModel - extends AbstractModel { + extends AbstractModel + implements Notifier { CentralAll worker; + boolean useCache = true; Hashtable dataTypesTable; /********************************************************************* @@ -73,7 +79,7 @@ public MobyDataType[] getDataTypesByNames() throws MobyException { initWorker(); - + fireEvent (DATA_TYPES_RESET, "", null); MobyDataType[] dataTypes = worker.getDataTypes(); java.util.Arrays.sort (dataTypes); return dataTypes; @@ -84,8 +90,8 @@ ********************************************************************/ public MobyDataType[] getDataTypesByAuthority() throws MobyException { - initWorker(); + fireEvent (DATA_TYPES_RESET, "", null); MobyDataType[] dataTypes = worker.getDataTypes(); java.util.Arrays.sort (dataTypes, @@ -157,9 +163,9 @@ String registryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); String registryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); String cacheDir = propertyChannel.getString (DP_CACHE_DIR); - // String cacheDir = "/home/senger/jMoby/myCache"; - // cacheDir = null; - + useCache = propertyChannel.getBoolean (DP_USE_CACHE, true); + if (! useCache) + cacheDir = null; worker = new CentralDigestCachedImpl (registryURL, registryNS, cacheDir); @@ -167,15 +173,110 @@ String maybeNewRegistryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); String maybeNewRegistryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); String maybeNewCacheDir = propertyChannel.getString (DP_CACHE_DIR); - if ( maybeNewRegistryURL.equals (worker.getRegistryEndpoint()) && + boolean maybeUseCache = propertyChannel.getBoolean (DP_USE_CACHE, true); + if ( (maybeUseCache == useCache) && + maybeNewRegistryURL.equals (worker.getRegistryEndpoint()) && maybeNewRegistryNS.equals (worker.getRegistryNamespace()) && maybeNewCacheDir.equals (getCacheDir()) ) return; + useCache = maybeUseCache; + if (! useCache) + maybeNewCacheDir = null; + NotificationListener[] nls = ((Notifier)worker).getNotificationListeners(); + ((Notifier)worker).removeNotificationListeners (nls); worker = new CentralDigestCachedImpl (maybeNewRegistryURL, maybeNewRegistryNS, maybeNewCacheDir); + ((Notifier)worker).addNotificationListeners (nls); + } + } + + /************************************************************************* + * + * Methods implementing Notifier interface. + * + *************************************************************************/ + + /********************************************************************* + * + ********************************************************************/ + public synchronized void addNotificationListener (NotificationListener l) { + try { + initWorker(); + ((Notifier)worker).addNotificationListener (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + } + } + + /********************************************************************* + * + ********************************************************************/ + public void addNotificationListeners (NotificationListener[] l) { + try { + initWorker(); + ((Notifier)worker).addNotificationListeners (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); } } + /********************************************************************* + * + ********************************************************************/ + public synchronized void removeNotificationListener (NotificationListener l) { + try { + initWorker(); + ((Notifier)worker).removeNotificationListener (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + } + } + + /********************************************************************* + * + ********************************************************************/ + public void removeNotificationListeners (NotificationListener[] l) { + try { + initWorker(); + ((Notifier)worker).removeNotificationListeners (l); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + } + } + + /********************************************************************* + * + ********************************************************************/ + public NotificationListener[] getNotificationListeners() { + try { + initWorker(); + return ((Notifier)worker).getNotificationListeners(); + } catch (MobyException e) { + // TBD with proper logging + System.err.println ("ERROR: " + e); + return new NotificationListener[] {}; + } + } + + /********************************************************************* + * + ********************************************************************/ + public void callback (int signal) { + if (worker != null) + ((Notifier)worker).callback (signal); + } + + /********************************************************************* + * + ********************************************************************/ + public void fireEvent (int type, Object message, Object details) { + if (worker != null) + ((Notifier)worker).fireEvent (type, message, details); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/12 11:17:59 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 01:38:04 1.10 @@ -129,13 +129,17 @@ // ontology trees ServicesTree servicesTree = new ServicesTree(); - DataTypesTree dataTypesTree = new DataTypesTree (registryModel, console); - dataTypesTree.update (CommonTree.SORTED_BY_NAME); + + DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, + console, + support); + dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); + NamespacesTree namespacesTree = new NamespacesTree(); JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, servicesTree.scrollable(), - dataTypesTree.scrollable()); + dataTypesBoard); split1.setResizeWeight (0.5); split1.setContinuousLayout (true); split1.setOneTouchExpandable (true); @@ -200,6 +204,7 @@ cacheDir.setEnabled (enabled); labelCacheDir.setEnabled (enabled); setPrefValue (USE_CACHE, enabled); + propertyChannel.put (DP_USE_CACHE, new Boolean (enabled).toString()); } /************************************************************************** @@ -252,6 +257,8 @@ onUseCache (e.getStateChange() == ItemEvent.SELECTED); } }); + propertyChannel.put (DP_USE_CACHE, new Boolean (usingCache).toString()); + labelCacheDir = new JLabel("Cache directory"); cacheDir = createFileSelector ("Select directory for/with local cache", "Select", From senger at pub.open-bio.org Sat Oct 22 14:33:19 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 22 Oct 2005 10:33:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221433.j9MEXJrv006357@pub.open-bio.org> senger Sat Oct 22 10:33:19 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv6338 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.8,1.9 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/10/11 16:10:12 1.8 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/10/22 14:33:19 1.9 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sat Oct 22 14:35:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 22 Oct 2005 10:35:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221435.j9MEZkJ0006425@pub.open-bio.org> senger Sat Oct 22 10:35:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv6406/src/config/dashboard/META-INF/services Modified Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/09/18 08:46:26 1.1 +++ /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/10/22 14:35:46 1.2 @@ -1,3 +1,4 @@ org.biomoby.service.dashboard.RegistryPanel +org.biomoby.service.dashboard.RegistrationPanel org.biomoby.service.dashboard.ConsolePanel org.biomoby.service.dashboard.EventGeneratorPanel From senger at pub.open-bio.org Sat Oct 22 14:35:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 22 Oct 2005 10:35:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221435.j9MEZkgf006478@pub.open-bio.org> senger Sat Oct 22 10:35:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv6406/src/main/org/biomoby/service/dashboard/images Added Files: console.gif registration.png smallClear.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images console.gif,NONE,1.1 registration.png,NONE,1.1 smallClear.gif,NONE,1.1 From senger at pub.open-bio.org Sat Oct 22 14:35:46 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 22 Oct 2005 10:35:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510221435.j9MEZk8u006461@pub.open-bio.org> senger Sat Oct 22 10:35:46 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv6406/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java CommonConsole.java ConsolePanel.java DashboardProperties.java RegistryPanel.java Added Files: BuildDataTypeTree.java RegistrationPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard BuildDataTypeTree.java,NONE,1.1 RegistrationPanel.java,NONE,1.1 AbstractPanel.java,1.7,1.8 CommonConsole.java,1.1,1.2 ConsolePanel.java,1.4,1.5 DashboardProperties.java,1.4,1.5 RegistryPanel.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/12 11:17:59 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/22 14:35:46 1.8 @@ -48,6 +48,8 @@ import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.event.ItemListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -90,6 +92,7 @@ protected JComponent pComponent; protected static Icon confirmIcon; protected static Icon warningIcon; + protected static Icon clearIcon; // re-use "style" components protected static final Insets BREATH_TOP = new Insets (10,0,0,0); @@ -322,10 +325,84 @@ }; } + /********************************************************************* + * + ********************************************************************/ + protected JPanel createCustomTextArea (String title, + String initValue, + String preferenceKey, + String eventName) { + JPanel p = new JPanel (new GridBagLayout()); + + // main label + JLabel label = new JLabel (title); + + // text area + final JTextArea area = new JTextArea(); + area.setEditable (true); + if (initValue == null) + area.setText (preferenceKey == null ? "" : getPrefValue (preferenceKey, "")); + else + area.setText (initValue); + area.setCaretPosition (0); + + if (eventName != null) { + final String eName = eventName; + if (preferenceKey == null) { + area.addFocusListener (new FocusListener() { + public void focusGained (FocusEvent e) {} + public void focusLost (FocusEvent e) { + String contents = ((JTextArea)e.getSource()).getText(); + propertyChannel.put (eName, contents); + } + }); + } else { + final String pKey = preferenceKey; + area.addFocusListener (new FocusListener() { + public void focusGained (FocusEvent e) {} + public void focusLost (FocusEvent e) { + String contents = ((JTextArea)e.getSource()).getText(); + propertyChannel.put (eName, contents); + setPrefValue (pKey, contents); + } + }); + } + // propagate also the initial value (unless it is empty) + String text = area.getText(); + if (UUtils.notEmpty (text)) + propertyChannel.put (eventName, text); + } + + // reset/clear button + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + JButton clearButton = new JButton (clearIcon); + clearButton.setFocusPainted (false); + clearButton.setMargin (new Insets (0,0,0,0)); + clearButton.setContentAreaFilled (false); + clearButton.setToolTipText ("Clear text area"); + clearButton.addActionListener (new ActionListener() { + public void actionPerformed (ActionEvent e) { + area.setText (""); + } + }); + + // put it together + SwingUtils.addComponent (p, label, 0, 0, 1, 1, NONE, NWEST, 0.0, 0.0); + SwingUtils.addComponent (p, clearButton, 1, 0, 1, 1, NONE, NEAST, 0.0, 0.0); + SwingUtils.addComponent (p, new JScrollPane (area), 0, 1, 2, 1, BOTH, NWEST, 1.0, 1.0); + return p; + } /********************************************************************* * ********************************************************************/ + protected String getPrefValue (String key, + String defaultValue) { + Preferences node = PrefsUtils.getNode (this.getClass()); + return node.get (key, defaultValue); + } + protected boolean getPrefValue (String key, boolean defaultValue) { Preferences node = PrefsUtils.getNode (this.getClass()); @@ -336,6 +413,12 @@ * ********************************************************************/ protected void setPrefValue (String key, + String value) { + Preferences node = PrefsUtils.getNode (this.getClass()); + node.put (key, value); + } + + protected void setPrefValue (String key, boolean value) { Preferences node = PrefsUtils.getNode (this.getClass()); node.putBoolean (key, value); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/09/24 17:51:51 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/10/22 14:35:46 1.2 @@ -15,6 +15,7 @@ import javax.swing.JTextArea; import javax.swing.JCheckBox; import javax.swing.JPanel; +import javax.swing.Icon; import java.awt.Font; import java.awt.GridBagLayout; @@ -40,6 +41,7 @@ JTextArea textArea; JCheckBox appendModeBox; boolean appendMode = true; + static Icon clearIcon; /********************************************************************* * Constructor. @@ -64,6 +66,10 @@ } }); + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + cleanButton.setIcon (clearIcon); + appendModeBox = AbstractPanel.createCheckBox ("append mode", appendMode, KeyEvent.VK_A, new ItemListener() { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/24 17:51:51 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/10/22 14:35:46 1.5 @@ -115,4 +115,13 @@ return "Debugging Console"; } + /************************************************************************** + * + **************************************************************************/ + public Icon getIcon() { + if (panelIcon == null) + panelIcon = SwingUtils.createIcon ("images/console.gif", this); + return panelIcon; + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/22 01:38:04 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/22 14:35:46 1.5 @@ -34,11 +34,18 @@ static final String DP_DATATYPE_NAME = "dp-datatype-name"; // names of properties used in property channel storage + static final String DP_REGISTRY_MODEL = "dp-registry-model"; + static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; static final String DP_CACHE_DIR = "dp-cache-dir"; static final String DP_USE_CACHE = "dp-use-cache"; + static final String DP_REG_DT_NAME = "dp-reg-dt-name"; + static final String DP_REG_DT_AUTH = "dp-reg-dt-auth"; + static final String DP_REG_DT_EMAIL = "dp-reg-dt-email"; + static final String DP_REG_DT_DESC = "dp-reg-dt-desc"; + /** A filename containing Java properties that configure the dashboard. */ static final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 01:38:04 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 14:35:46 1.11 @@ -1,6 +1,6 @@ // RegistryPanel.java // -// Created: September 2005 +// Created: September 2005 // // This file is a component of the BioMoby project. // Copyright Martin Senger (martin.senger at gmail.com). @@ -61,8 +61,6 @@ * what Biomoby registry to work with, and what cache directory to * use.

    * - * WORK IN PROGRESS.

    - * * @author Martin Senger * @version $Id$ */ @@ -87,22 +85,17 @@ * propertyChange() ********************************************************************/ public void propertyChange (PropertyChangeEvent e) { - String prop = e.getPropertyName(); - String newVal = (String)e.getNewValue(); - if (newVal == null) return; // no interest in non-defined new values - if (prop == null) return; // no interest in non-specific changes -// else if (prop.equalsIgnoreCase (PROP_MODE)) setMode (checkAndGetOperMode (newVal)); -// else if (prop.equalsIgnoreCase (PROP_BEAN_VISIBLE)) setBeanVisible (BBConfig.getBoolFromString (newVal)); -// else if (prop.equalsIgnoreCase (PROP_LISTEN_TO)) setListenTo (newVal); -// else if (prop.equalsIgnoreCase (PROP_DATA_IDENTITY)) setDataIdentity (newVal); +// String prop = e.getPropertyName(); +// String newVal = (String)e.getNewValue(); +// if (newVal == null) return; // no interest in non-defined new values +// if (prop == null) return; // no interest in non-specific changes } /********************************************************************* - * Default constructor + * Default constructor. ********************************************************************/ public RegistryPanel() { super(); - registryModel = new RegistryModel (support); } /************************************************************************** @@ -110,7 +103,15 @@ **************************************************************************/ public JComponent getComponent (PropertyChannel propertyChannel) { setPropertyChannel (propertyChannel); - registryModel.setPropertyChannel (propertyChannel); + synchronized (propertyChannel) { + if (propertyChannel.containsKey (DP_REGISTRY_MODEL)) { + registryModel = (RegistryModel)propertyChannel.get (DP_REGISTRY_MODEL); + } else { + registryModel = new RegistryModel (support); + propertyChannel.put (DP_REGISTRY_MODEL, registryModel); + } + registryModel.setPropertyChannel (propertyChannel); + } if (pComponent != null) return pComponent; @@ -339,7 +340,7 @@ **************************************************************************/ public Icon getIcon() { if (panelIcon == null) - panelIcon = SwingUtils.createIcon ("images/registry.gif", this); + panelIcon = SwingUtils.createIcon ("images/registry.gif", this); return panelIcon; } From senger at pub.open-bio.org Sun Oct 23 19:00:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 23 Oct 2005 15:00:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510231900.j9NJ0OUR020952@pub.open-bio.org> senger Sun Oct 23 15:00:24 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv20917/src/main/org/biomoby/service/dashboard Modified Files: BuildDataTypeTree.java CommonTree.java DataTypesBoard.java DataTypesTree.java RegistrationPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard BuildDataTypeTree.java,1.1,1.2 CommonTree.java,1.4,1.5 DataTypesBoard.java,1.1,1.2 DataTypesTree.java,1.2,1.3 RegistrationPanel.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/22 14:35:46 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/23 19:00:24 1.2 @@ -78,6 +78,8 @@ // enable tool tips ToolTipManager.sharedInstance().registerComponent (this); + +// expand(); } // @@ -125,4 +127,20 @@ protected void selected (DefaultMutableTreeNode node) { } + /********************************************************************* + * Expand all nodes. + ********************************************************************/ + protected void expand() { + final SwingWorker worker = new SwingWorker() { + public Object construct() { + SwingUtils.expandTree (BuildDataTypeTree.this, (DefaultMutableTreeNode)getModel().getRoot()); + return null; // not used here + } + // runs on the event-dispatching thread. + public void finished() { + repaint(); + } + }; + worker.start(); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/22 01:38:04 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/23 19:00:24 1.5 @@ -18,6 +18,7 @@ import javax.swing.JPopupMenu; import javax.swing.JOptionPane; import javax.swing.JMenuItem; +import javax.swing.JSeparator; import javax.swing.ToolTipManager; import javax.swing.AbstractAction; import javax.swing.tree.DefaultMutableTreeNode; @@ -53,7 +54,11 @@ public class CommonTree extends JTree { - final static String RELOAD = "Reload"; + // action commands for popup menu items + protected final static String AC_SEARCH = "ac-search"; + protected final static String AC_EXPAND = "ac-expand"; + protected final static String AC_COLLAPSE = "ac-collapse"; + protected final static String AC_RELOAD = "ac-reload"; // some shared constants final static protected int SORTED_BY_NAME = 0; @@ -61,9 +66,15 @@ // tree components protected JPopupMenu popup; - protected Icon searchIcon; protected String lastSearchText = ""; + // shared icons + static protected Icon searchIcon; + static protected Icon menuSearchIcon, menuSearchIconDis; + static protected Icon menuExpandIcon, menuExpandIconDis; + static protected Icon menuCollapseIcon, menuCollapseIconDis; + static protected Icon menuReloadIcon, menuReloadIconDis; + // protected PropertyChangeSupport support; // protected boolean expanded = true; // the status of the application list @@ -104,6 +115,9 @@ // enable tool tips ToolTipManager.sharedInstance().registerComponent (this); + + // load menu icons + loadIcons(); } // @@ -180,6 +194,39 @@ } /********************************************************************* + * Load all menu icons. + ********************************************************************/ + protected void loadIcons() { + if (menuSearchIcon == null) + menuSearchIcon = + SwingUtils.createIcon ("images/smallSearch.gif", Dashboard.class); + if (menuSearchIconDis == null) + menuSearchIconDis = + SwingUtils.createIcon ("images/smallSearchDis.gif", Dashboard.class); + + if (menuExpandIcon == null) + menuExpandIcon = + SwingUtils.createIcon ("images/smallExpand.gif", Dashboard.class); + if (menuExpandIconDis == null) + menuExpandIconDis = + SwingUtils.createIcon ("images/smallExpandDis.gif", Dashboard.class); + + if (menuCollapseIcon == null) + menuCollapseIcon = + SwingUtils.createIcon ("images/smallCollapse.gif", Dashboard.class); + if (menuCollapseIconDis == null) + menuCollapseIconDis = + SwingUtils.createIcon ("images/smallCollapseDis.gif", Dashboard.class); + + if (menuReloadIcon == null) + menuReloadIcon = + SwingUtils.createIcon ("images/smallReload.gif", Dashboard.class); + if (menuReloadIconDis == null) + menuReloadIconDis = + SwingUtils.createIcon ("images/smallReloadDis.gif", Dashboard.class); + } + + /********************************************************************* * Create a popup object with common items. Subclasses can (and * usually do) add more items, or re-created the whole popup.

    * @@ -188,35 +235,35 @@ protected void createPopups (String title) { popup = new JPopupMenu (title); popup.add - (new JMenuItem (new AbstractAction ("Search") { + (createMenuItem (new AbstractAction ("Search") { public void actionPerformed (ActionEvent e) { String searchText = searchDialog(); if (searchText != null) search (searchText); } - })); + }, AC_SEARCH, menuSearchIcon, menuSearchIconDis)); popup.add - (new JMenuItem (new AbstractAction ("Expand all nodes") { + (createMenuItem (new AbstractAction ("Expand all nodes") { public void actionPerformed (ActionEvent e) { expand(); } - })); + }, AC_EXPAND, menuExpandIcon, menuExpandIconDis)); popup.add - (new JMenuItem (new AbstractAction ("Collapse all nodes") { + (createMenuItem (new AbstractAction ("Collapse all nodes") { public void actionPerformed (ActionEvent e) { collapse(); } - })); + }, AC_COLLAPSE, menuCollapseIcon, menuCollapseIconDis)); popup.addSeparator(); popup.add - (new JMenuItem (new AbstractAction (RELOAD) { + (createMenuItem (new AbstractAction ("Reload") { public void actionPerformed (ActionEvent e) { reload(); } - })); + }, AC_RELOAD, menuReloadIcon, menuReloadIconDis)); // add listener to this tree to bring up popup menus MouseListener popupListener = new PopupListener(); @@ -239,6 +286,29 @@ } /********************************************************************* + * Create a menu item. + ********************************************************************/ + protected JMenuItem createMenuItem (AbstractAction action, + String actionCommand) { + JMenuItem mi = new JMenuItem (action); + mi.setActionCommand (actionCommand); + return mi; + } + + /********************************************************************* + * Create a menu item. + ********************************************************************/ + protected JMenuItem createMenuItem (AbstractAction action, + String actionCommand, + Icon icon, + Icon disabledIcon) { + JMenuItem mi = createMenuItem (action, actionCommand); + mi.setIcon (icon); + mi.setDisabledIcon (disabledIcon); + return mi; + } + + /********************************************************************* * Enable/disable the whole popup except the 'Reload' option (that * one remains enabled always). ********************************************************************/ @@ -247,7 +317,7 @@ Component[] components = popup.getComponents(); for (int i = 0; i < components.length; i++) { if ( components[i] instanceof JMenuItem && - ! ((JMenuItem)components[i]).getText().equals (RELOAD) ) + ! AC_RELOAD.equals (((JMenuItem)components[i]).getActionCommand()) ) ((JMenuItem)components[i]).setEnabled (enabled); } } @@ -347,4 +417,37 @@ AbstractPanel.error (prologue, e); } + /********************************************************************* + * Remove a menu item (given by an action command string) from a + * popup menu. + ********************************************************************/ + protected void removeFromPopups (String actionCommand) { + if (popup == null) return; + Component[] components = popup.getComponents(); + for (int i = 0; i < components.length; i++) { + if ( components[i] instanceof JMenuItem && + actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ) { + popup.remove (components[i]); + return; + } + } + } + + /********************************************************************* + * Remove a menu separator (that is after menu item given by an + * action command string) from a popup menu. + ********************************************************************/ + protected void removeSeparatorAfter (String actionCommand) { + if (popup == null) return; + Component[] components = popup.getComponents(); + boolean found = false; + for (int i = 0; i < components.length; i++) { + if ( components[i] instanceof JSeparator && found) { + popup.remove (components[i]); + return; + } + found = ( components[i] instanceof JMenuItem && + actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ); + } + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/22 01:38:04 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/23 19:00:24 1.2 @@ -40,8 +40,16 @@ public DataTypesBoard (RegistryModel model, CommonConsole console, PropertyChangeSupport support) { + this (model, console, support, + new DataTypesTree (model, console)); + } + + public DataTypesBoard (RegistryModel model, + CommonConsole console, + PropertyChangeSupport support, + CommonTree customTree) { super (model, support); - tree = new DataTypesTree (model, console); + tree = customTree; createItself(); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/22 01:38:04 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/23 19:00:24 1.3 @@ -42,6 +42,12 @@ public class DataTypesTree extends CommonTree { + // action commands for popup menu items + protected final static String AC_NSORT = "ac-nsort"; + protected final static String AC_ASORT = "ac-asort"; + protected final static String AC_HASA = "ac-hasa"; + protected final static String AC_DEPR = "ac-depr"; + // remembered from constructor RegistryModel registryModel; CommonConsole console; @@ -79,22 +85,23 @@ super.createPopups (title); popup.addSeparator(); popup.add - (new JMenuItem (new AbstractAction ("Sort by names") { + (createMenuItem (new AbstractAction ("Sort by names") { public void actionPerformed (ActionEvent e) { update (lastSorted = SORTED_BY_NAME); deprecatedBox.setEnabled (true); } - })); + }, AC_NSORT)); popup.add - (new JMenuItem (new AbstractAction ("Sort by authorities") { + (createMenuItem (new AbstractAction ("Sort by authorities") { public void actionPerformed (ActionEvent e) { update (lastSorted = SORTED_BY_AUTHORITY); deprecatedBox.setEnabled (false); } - })); + }, AC_ASORT)); popup.addSeparator(); JCheckBoxMenuItem showBox = new JCheckBoxMenuItem ("Show HAS/HASA members"); + showBox.setActionCommand (AC_HASA); showBox.addItemListener (new ItemListener() { public void itemStateChanged (ItemEvent e) { showMembers = (e.getStateChange() == ItemEvent.SELECTED); @@ -104,6 +111,7 @@ popup.add (showBox); deprecatedBox = new JCheckBoxMenuItem ("Show deprecated objects"); + deprecatedBox.setActionCommand (AC_DEPR); deprecatedBox.addItemListener (new ItemListener() { public void itemStateChanged (ItemEvent e) { showBadGuys = (e.getStateChange() == ItemEvent.SELECTED); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/22 14:35:46 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/23 19:00:24 1.2 @@ -68,27 +68,16 @@ public class RegistrationPanel extends AbstractPanel { - // names of user preferences keys -// static final String USE_CACHE = "use-cache"; - // associated model working behind the scenes RegistryModel registryModel; // components that are used from more methods -// JTextFieldWithHistory dtName; -// JTextFieldWithHistory dtAuth; -// JTextFieldWithHistory dtEmail; - CommonConsole console; /********************************************************************* * propertyChange() ********************************************************************/ public void propertyChange (PropertyChangeEvent e) { -// String prop = e.getPropertyName(); -// String newVal = (String)e.getNewValue(); -// if (newVal == null) return; // no interest in non-defined new values -// if (prop == null) return; // no interest in non-specific changes } /********************************************************************* @@ -169,9 +158,11 @@ SwingUtils.addComponent (defs, dtDesc, 0, 6, 1, 1, BOTH, NWEST, 1.0, 1.0, BREATH_TOP); // a tree with all already existing data types - DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, - console, - support); + DataTypesBoard dataTypesBoard = + new DataTypesBoard (registryModel, + console, + support, + new CustomDataTypesTree (registryModel, console)); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); // a tree with a new data type && registration button @@ -261,4 +252,51 @@ return panelIcon; } + /************************************************************************** + * Customized tree of data types - has different popup menus... + **************************************************************************/ + protected class CustomDataTypesTree + extends DataTypesTree { + + // action commands for popup menu items + protected final static String AC_PARENT = "ac-parent"; + protected final static String AC_MHASA = "ac-m-hasa"; + protected final static String AC_MHAS = "ac-m-has"; + + public CustomDataTypesTree (RegistryModel model, + CommonConsole console) { + super (model, console); + } + + /********************************************************************* + * + ********************************************************************/ + protected void createPopups (String title) { + super.createPopups (title); + removeFromPopups (AC_RELOAD); + removeFromPopups (AC_HASA); + removeFromPopups (AC_DEPR); + removeSeparatorAfter (AC_COLLAPSE); + + popup.add + (createMenuItem (new AbstractAction ("Add selected as a parent type (ISA)") { + public void actionPerformed (ActionEvent e) { + } + }, AC_PARENT)); + + popup.add + (createMenuItem (new AbstractAction ("Add selected as a member (HASA)") { + public void actionPerformed (ActionEvent e) { + } + }, AC_MHASA)); + + popup.add + (createMenuItem (new AbstractAction ("Add selected as a list of members (HAS)") { + public void actionPerformed (ActionEvent e) { + } + }, AC_MHAS)); + + } + } + } From senger at pub.open-bio.org Sun Oct 23 19:00:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 23 Oct 2005 15:00:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510231900.j9NJ0OTM020967@pub.open-bio.org> senger Sun Oct 23 15:00:24 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv20917/src/main/org/biomoby/service/dashboard/images Added Files: smallClear_dis.gif smallCollapse.gif smallCollapse_dis.gif smallExpand.gif smallExpand_dis.gif smallReload.gif smallReload_dis.gif smallSearch.gif smallSearch_dis.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images smallClear_dis.gif,NONE,1.1 smallCollapse.gif,NONE,1.1 smallCollapse_dis.gif,NONE,1.1 smallExpand.gif,NONE,1.1 smallExpand_dis.gif,NONE,1.1 smallReload.gif,NONE,1.1 smallReload_dis.gif,NONE,1.1 smallSearch.gif,NONE,1.1 smallSearch_dis.gif,NONE,1.1 From senger at pub.open-bio.org Mon Oct 24 00:34:49 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 23 Oct 2005 20:34:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510240034.j9O0Ynb2021836@pub.open-bio.org> senger Sun Oct 23 20:34:49 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv21813/src/main/org/biomoby/service/dashboard Modified Files: Dashboard.java NOTES Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard Dashboard.java,1.5,1.6 NOTES,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/22 01:38:04 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/24 00:34:49 1.6 @@ -126,6 +126,7 @@ public void show() { JFrame frame = SwingUtils.createMainFrame (getComponent (propertyChannel), getName()); + addMenuBar (frame); SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); } @@ -280,6 +281,12 @@ } /************************************************************************** + * Create and add a menu bar to the given frame. + **************************************************************************/ + protected void addMenuBar (JFrame frame) { + } + + /************************************************************************** * Dashboard is listening to the changes of panels in order to * repaint the header with a label of a currently selected panel. **************************************************************************/ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/12 11:17:59 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/24 00:34:49 1.9 @@ -126,7 +126,7 @@ TODO generally: --------------- -* notice that the dasboard is used the first time and offer ti create +* notice that the dasboard is used the first time and offer to create a list of wanted panels (some of them are suggested as default) * notice that user does not use cache (and that he did not select "do From carrere at pub.open-bio.org Mon Oct 24 08:57:34 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Mon, 24 Oct 2005 04:57:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510240857.j9O8vYJR023144@pub.open-bio.org> carrere Mon Oct 24 04:57:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23118 Modified Files: MOBYXSLT.pm Log Message: Bad parameters initializations. Lot of warnings removed. moby-live/Perl/MOBY MOBYXSLT.pm,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/10/21 13:22:18 1.2 +++ /home/repository/moby/moby-live/Perl/MOBY/MOBYXSLT.pm 2005/10/24 08:57:34 1.3 @@ -735,19 +735,36 @@ my @a_crossref = (); my @a_hasa = (); + my ($object_type,$object_name,$object_id,$object_namespace) = ('','','',''); my $object_type_tag = '#XSL_LIPM_MOBYPARSER_OBJECTTYPE#'; - my ($object_type) = ($simple_bloc =~ /$object_type_tag(\S+)$object_type_tag/); - $object_type =~ s/^moby://i; + + if ($simple_bloc =~ /$object_type_tag(\S+)$object_type_tag/) + { + $object_type = $1; + $object_type =~ s/^moby://i; + } my $object_namespace_tag = '#XSL_LIPM_MOBYPARSER_OBJECTNAMESPACE#'; - my ($object_namespace) = ($simple_bloc =~ /$object_namespace_tag(\S+)$object_namespace_tag/); - + + if ($simple_bloc =~ /$object_namespace_tag(\S+)$object_namespace_tag/) + { + $object_namespace = $1; + } + my $object_id_tag = '#XSL_LIPM_MOBYPARSER_OBJECTID#'; - my ($object_id) = ($simple_bloc =~ /$object_id_tag(\S+)$object_id_tag/); - + + if ($simple_bloc =~ /$object_id_tag(\S+)$object_id_tag/) + { + $object_id = $1; + } + my $object_name_tag = '#XSL_LIPM_MOBYPARSER_OBJECTNAME#'; - my ($object_name) = ($simple_bloc =~ /$object_name_tag(\S+)$object_name_tag/); + if ($simple_bloc =~ /$object_name_tag(\S+)$object_name_tag/) + { + $object_name = $1 + } + my $crossref_start_tag = '#XSL_LIPM_MOBYPARSER_CROSSREF_START#'; my $crossref_end_tag = '#XSL_LIPM_MOBYPARSER_CROSSREF_END#'; my $crossref_sep_tag = '#XSL_LIPM_MOBYPARSER_CROSSREF_SEP#'; @@ -765,7 +782,8 @@ } my $object_content_tag = '#XSL_LIPM_MOBYPARSER_OBJECTCONTENT#'; - my ($before, $object_content, $after) = split($object_content_tag, $simple_bloc); + my ($before, $object_content, $after) = ('','',''); + ($before, $object_content, $after) = split($object_content_tag, $simple_bloc); my $object_hasa_start_tag = '#XSL_LIPM_MOBYPARSER_OBJECTHASA_START#'; From carrere at pub.open-bio.org Mon Oct 24 11:47:03 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Mon, 24 Oct 2005 07:47:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510241147.j9OBl3Jv023529@pub.open-bio.org> carrere Mon Oct 24 07:47:03 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/xsl In directory pub.open-bio.org:/tmp/cvs-serv23503 Modified Files: parseMobyMessage.xsl Log Message: Template Parameter modification to allow articleName or moby:articleName as an attribute moby-live/Perl/MOBY/xsl parseMobyMessage.xsl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/xsl/parseMobyMessage.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/xsl/parseMobyMessage.xsl 2005/09/08 13:46:45 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/xsl/parseMobyMessage.xsl 2005/10/24 11:47:03 1.2 @@ -114,8 +114,18 @@ --> + + + + #XSL_LIPM_MOBYPARSER_SECONDARY_START# - + + + + + + + #XSL_LIPM_MOBYPARSER_SECONDARY_SEP# #XSL_LIPM_MOBYPARSER_SECONDARY_END# From fgibbons at pub.open-bio.org Mon Oct 24 17:31:57 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Mon, 24 Oct 2005 13:31:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510241731.j9OHVvGc024289@pub.open-bio.org> fgibbons Mon Oct 24 13:31:57 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv24264 Modified Files: XMLPayloads.html Log Message: - Explain the situation regarding deregisterService. moby-live/Docs/MOBY-S_API XMLPayloads.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/09/28 22:05:58 1.3 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/10/24 17:31:57 1.4 @@ -651,5 +651,35 @@

    -deregisterService

    -This method has now been deprecated. \ No newline at end of file +deregisterService + +It is intended that this method will ultimately be deprecated. A +requirement for this to happen is the completed transition from a +function-call based registration process to an RDF-document-based +registration. For the time being, it remains in use. + +Under the current function-call based procedure, a +service is registered by modifying the contents of the MOBY Central +database, by means of a function call from the MOBY API (i.e., +registerService). The service remains registered until +the function deregisterService is called. This method has +some shortcomings, mostly to do with security. + +It is proposed (see email archives for details), that a better way of +doing things would be to continue to allow registration by means of a +function call. A key change is that the function would return an RDF +document describing the service. The document would be placed at a +pre-specified location on the web, and an RDF-reading agent would +periodically check on the service's continued existence (the agent +might visit hourly or weekly, depending on who you +ask). Deregistration of the service would be a simple matter of +removing the RDF document. On the agent's next visit, it would notice +that the document had disappeared, and remove it from MOBY Central's +registry. + +Currently, it is possible to register a service under both schemes (to +use the new scheme, simply provide a "signatureURL" +parameter). However, there is currently no agent, therefore +services registered under the new scheme will remain registered +indefinitely. It is explicitly not allowed to deregister +services which were registered using a signatureURL. From senger at pub.open-bio.org Tue Oct 25 09:02:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 25 Oct 2005 05:02:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510250902.j9P928TF026810@pub.open-bio.org> senger Tue Oct 25 05:02:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv26713/src/main/org/biomoby/shared Modified Files: MobyDataType.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyDataType.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/24 17:51:52 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/10/25 09:02:08 1.10 @@ -26,6 +26,12 @@ public class MobyDataType implements Comparable { + /** + * A dummy name used for MobyDataType instances that do not have + * (yet) a real name. + */ + static public final String DUMMY_NAME = "_dummy_"; + public int compareTo (Object obj) { return name.compareToIgnoreCase ( ((MobyDataType)obj).getName() ); } @@ -46,7 +52,7 @@ * Default constructor. *************************************************************************/ public MobyDataType() { - this ("_dummy_"); + this (DUMMY_NAME); } /************************************************************************** From senger at pub.open-bio.org Tue Oct 25 09:02:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 25 Oct 2005 05:02:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510250902.j9P9287Q026791@pub.open-bio.org> senger Tue Oct 25 05:02:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26713/src/main/org/biomoby/service/dashboard/images Modified Files: smallReload.gif Added Files: emptyButton.gif renameButton.gif smallAddHAS.gif smallAddHASA.gif smallAddHASA_dis.gif smallAddHAS_dis.gif smallAddISA.gif smallAddISA_dis.gif smallRefresh.gif smallRefresh_dis.gif smallRemove.gif smallRemove_dis.gif smallRename.gif smallRename_dis.gif smallWarning.gif smallWarning_dis.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images emptyButton.gif,NONE,1.1 renameButton.gif,NONE,1.1 smallAddHAS.gif,NONE,1.1 smallAddHASA.gif,NONE,1.1 smallAddHASA_dis.gif,NONE,1.1 smallAddHAS_dis.gif,NONE,1.1 smallAddISA.gif,NONE,1.1 smallAddISA_dis.gif,NONE,1.1 smallRefresh.gif,NONE,1.1 smallRefresh_dis.gif,NONE,1.1 smallRemove.gif,NONE,1.1 smallRemove_dis.gif,NONE,1.1 smallRename.gif,NONE,1.1 smallRename_dis.gif,NONE,1.1 smallWarning.gif,NONE,1.1 smallWarning_dis.gif,NONE,1.1 smallReload.gif,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif 2005/10/23 19:00:24 1.1 and /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif 2005/10/25 09:02:08 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/smallReload.gif: diff failed From senger at pub.open-bio.org Wed Oct 26 08:05:19 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 26 Oct 2005 04:05:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510260805.j9Q85JgF030263@pub.open-bio.org> senger Wed Oct 26 04:05:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv30201/src/main/org/biomoby/service/dashboard/images Added Files: smallUnregister.gif smallUnregister_dis.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images smallUnregister.gif,NONE,1.1 smallUnregister_dis.gif,NONE,1.1 From senger at pub.open-bio.org Wed Oct 26 08:05:19 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 26 Oct 2005 04:05:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510260805.j9Q85J0j030248@pub.open-bio.org> senger Wed Oct 26 04:05:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv30201/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java BuildDataTypeTree.java CommonConsole.java CommonTree.java DashboardProperties.java NOTES RegistrationPanel.java RegistryModel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,1.9,1.10 BuildDataTypeTree.java,1.3,1.4 CommonConsole.java,1.2,1.3 CommonTree.java,1.6,1.7 DashboardProperties.java,1.6,1.7 NOTES,1.10,1.11 RegistrationPanel.java,1.3,1.4 RegistryModel.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/25 09:02:07 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/26 08:05:18 1.10 @@ -90,6 +90,8 @@ // something need to be done only once - keep it here protected Icon panelIcon; protected JComponent pComponent; + + // shared icons protected static Icon confirmIcon; protected static Icon warningIcon; protected static Icon clearIcon; @@ -108,6 +110,7 @@ ********************************************************************/ protected AbstractPanel() { support = new PropertyChangeSupport (this); + loadIcons(); } /************************************************************************** @@ -178,6 +181,22 @@ abstract public String getName(); // + // Few other methods + // + + /********************************************************************* + * Load all menu icons. + ********************************************************************/ + protected void loadIcons() { + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + if (warningIcon == null) + warningIcon = SwingUtils.createIcon ("images/warningButton.gif", this); + if (confirmIcon == null) + confirmIcon = SwingUtils.createIcon ("images/confirmButton.gif", this); + } + + // // Methods to be used by sub-classes // @@ -375,8 +394,6 @@ } // reset/clear button - if (clearIcon == null) - clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); JButton clearButton = new JButton (clearIcon); clearButton.setFocusPainted (false); clearButton.setMargin (new Insets (0,0,0,0)); @@ -401,7 +418,7 @@ protected String getPrefValue (String key, String defaultValue) { Preferences node = PrefsUtils.getNode (this.getClass()); - return node.get (key, defaultValue); + return showNewlines (node.get (key, defaultValue)); } protected boolean getPrefValue (String key, @@ -416,7 +433,7 @@ protected void setPrefValue (String key, String value) { Preferences node = PrefsUtils.getNode (this.getClass()); - node.put (key, value); + node.put (key, hideNewlines (value)); } protected void setPrefValue (String key, @@ -426,12 +443,26 @@ } /********************************************************************* + * Sorry for this hack, but I do not know better... + * + * Problem is that attribute values (preferences) ignore + * newlines. I wanted to replace them with something like ' ' + * but this did not work because the ampersand was escape (as it + * should) to '&'. So I have to "invent" my own escaping by + * introducing MRVAJS. + ********************************************************************/ + static final private String MRVAJS = "#MRVAJS#"; + private static String hideNewlines (String value) { + return value.replaceAll ("\n", MRVAJS); + } + private static String showNewlines (String value) { + return value.replaceAll (MRVAJS, "\n"); + } + + /********************************************************************* * Return true if confirmation dialog passed. ********************************************************************/ public static boolean confirm (Object msg) { - if (confirmIcon == null) - confirmIcon = - SwingUtils.createIcon ("images/confirmButton.gif", Dashboard.class); return SwingUtils.confirm (null, msg, confirmIcon); } @@ -439,9 +470,6 @@ * Display an error message. ********************************************************************/ public static void error (Object msg) { - if (warningIcon == null) - warningIcon = SwingUtils.createIcon ("images/warningButton.gif", - Dashboard.class); JOptionPane.showMessageDialog (null, msg, "Error message", JOptionPane.PLAIN_MESSAGE, warningIcon); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/25 09:02:07 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/BuildDataTypeTree.java 2005/10/26 08:05:18 1.4 @@ -117,25 +117,6 @@ getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); - - -// setEditable (true); -// DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) tree -// .getCellRenderer(); -// TreeCellEditor editor = new LeafCellEditor(tree, renderer); -// tree.setCellEditor(editor); - - -// // listen for when the selection changes -// addTreeSelectionListener ( new TreeSelectionListener() { -// public void valueChanged (TreeSelectionEvent e) { -// DefaultMutableTreeNode node = -// (DefaultMutableTreeNode)getLastSelectedPathComponent(); -// if (node == null) return; -// selected (node); -// } -// }); - // enable tool tips ToolTipManager.sharedInstance().registerComponent (this); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/10/22 14:35:46 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonConsole.java 2005/10/26 08:05:18 1.3 @@ -40,14 +40,18 @@ // components JTextArea textArea; JCheckBox appendModeBox; + JButton cleanButton; boolean appendMode = true; - static Icon clearIcon; + + // shared icons + static Icon clearIcon, clearIconDis; /********************************************************************* * Constructor. ********************************************************************/ public CommonConsole() { super(); + loadIcons(); setLayout (new GridBagLayout()); textArea = new JTextArea(); @@ -55,20 +59,22 @@ textArea.setEditable (false); JScrollPane scroller = new JScrollPane (textArea); - JButton cleanButton = AbstractPanel.createButton + cleanButton = AbstractPanel.createButton (" Clean ", "Remove all messages from the console area", KeyEvent.VK_C, new ActionListener() { public void actionPerformed (ActionEvent e) { - if (! "".equals (textArea.getText()) && AbstractPanel.confirm ("Remove all messages?")) + if (! "".equals (textArea.getText()) && AbstractPanel.confirm ("Remove all messages?")) { textArea.setText (""); + cleanButton.setEnabled (false); + } } }); - if (clearIcon == null) - clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); cleanButton.setIcon (clearIcon); + cleanButton.setDisabledIcon (clearIconDis); + cleanButton.setEnabled (false); appendModeBox = AbstractPanel.createCheckBox ("append mode", appendMode, KeyEvent.VK_A, @@ -99,6 +105,7 @@ textArea.append (value); else textArea.setText (value); + cleanButton.setEnabled (true); } /********************************************************************* @@ -116,4 +123,14 @@ return appendMode; } + /********************************************************************* + * Load all menu icons. + ********************************************************************/ + protected void loadIcons() { + if (clearIcon == null) + clearIcon = SwingUtils.createIcon ("images/smallClear.gif", this); + if (clearIconDis == null) + clearIconDis = SwingUtils.createIcon ("images/smallClear_dis.gif", this); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/25 09:02:07 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/26 08:05:18 1.7 @@ -28,6 +28,7 @@ import javax.swing.tree.TreePath; import javax.swing.event.TreeSelectionListener; import javax.swing.event.TreeSelectionEvent; +import javax.swing.SwingUtilities; import java.awt.Component; import java.awt.Font; @@ -39,11 +40,6 @@ import java.util.HashSet; import java.util.Enumeration; -// import java.beans.PropertyChangeListener; -// import java.beans.PropertyChangeEvent; -// import java.beans.PropertyChangeSupport; - - /** * A common JTree re-used (and always slightly modified) by all * Biomoby registry trees.

    @@ -75,9 +71,6 @@ static protected Icon menuCollapseIcon, menuCollapseIconDis; static protected Icon menuReloadIcon, menuReloadIconDis; -// protected PropertyChangeSupport support; -// protected boolean expanded = true; // the status of the application list - protected String rootNode; /********************************************************************* @@ -89,20 +82,11 @@ // create an almost empty tree, only with a root node that // contains just a String holding the name of the root node; -// setFont (new Font ("Dialog", Font.PLAIN, 10)); putClientProperty ("JTree.lineStyle", "Angled"); setCellRenderer (new CommonTreeCellRenderer()); getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); -// addMouseListener (new MouseAdapter() { -// public void mouseClicked (MouseEvent e) { -// TreePath selPath = getPathForLocation (e.getX(), e.getY()); -// if (e.getClickCount() == 1) -// onSelected (selPath); -// } -// }); - // listen for when the selection changes addTreeSelectionListener ( new TreeSelectionListener() { public void valueChanged (TreeSelectionEvent e) { @@ -178,7 +162,6 @@ return new JScrollPane (this); } - /********************************************************************* * Get data from a registry model and update the tree. Will be * overwritten by subclass. @@ -333,9 +316,6 @@ * Expand all nodes, starting from the root.

    ********************************************************************/ protected void expand() { -// SwingUtils.expandTree (this, (DefaultMutableTreeNode)getModel().getRoot()); - - final SwingWorker worker = new SwingWorker() { public Object construct() { SwingUtils.expandTree (CommonTree.this, (DefaultMutableTreeNode)getModel().getRoot()); @@ -347,7 +327,6 @@ } }; worker.start(); - } /********************************************************************* @@ -355,7 +334,6 @@ * concrete tree. ********************************************************************/ protected void reload() { - System.out.println ("Invoking a reload."); } /********************************************************************* @@ -364,7 +342,6 @@ * be overwritten by a concrete tree. ********************************************************************/ protected void search (String searchText) { - System.out.println ("Search text: " + searchText); } /********************************************************************* @@ -393,6 +370,9 @@ return result; } + /********************************************************************* + * + ********************************************************************/ protected void highlightAndJumpTo (HashSet toBeHighlighted) { CommonTreeCellRenderer r = (CommonTreeCellRenderer)getCellRenderer(); @@ -455,40 +435,16 @@ * popup menu. ********************************************************************/ protected void setEnabledPopupItem (String actionCommand, boolean enabled) { - synchronized (popup) { - Component[] components = popup.getComponents(); - for (int i = 0; i < components.length; i++) { - if ( components[i] instanceof JMenuItem && - actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ) { - ((JMenuItem)components[i]).setEnabled (enabled); - return; - } - } - } - -// final String ac = actionCommand; -// final boolean fEnabled = enabled; -// final SwingWorker worker = new SwingWorker() { -// public Object construct() { -// synchronized (popup) { -// Component[] components = popup.getComponents(); -// for (int i = 0; i < components.length; i++) { -// if ( components[i] instanceof JMenuItem && -// ac.equals (((JMenuItem)components[i]).getActionCommand()) ) { -// ((JMenuItem)components[i]).setEnabled (fEnabled); -// break; -// } -// } -// } -// return null; // not used here -// } -// // runs on the event-dispatching thread. -// public void finished() { -// repaint(); -// } -// }; -// worker.start(); + Component[] components = popup.getComponents(); + for (int i = 0; i < components.length; i++) { + if ( components[i] instanceof JMenuItem && + actionCommand.equals (((JMenuItem)components[i]).getActionCommand()) ) { + ((JMenuItem)components[i]).setEnabled (enabled); + return; + } + } } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/25 09:02:07 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/26 08:05:18 1.7 @@ -39,7 +39,7 @@ static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; static final String DP_CACHE_DIR = "dp-cache-dir"; - static final String DP_USE_CACHE = "dp-use-cache"; + static final String DP_USE_CACHE = "dp-use-cache"; // type: Boolean static final String DP_REG_DT_NAME = "dp-reg-dt-name"; static final String DP_REG_DT_AUTH = "dp-reg-dt-auth"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/25 09:02:07 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/26 08:05:18 1.11 @@ -1,109 +1,3 @@ -Setting colors: - -articleName.setForeground (new Color (0xffffdd)); - ------ - -invokeLater() -------------- -/** - * Create the GUI and show it. For thread safety, - * this method should be invoked from the - * event-dispatching thread. - */ -private static void createAndShowGUI() { - //Make sure we have nice window decorations. - JFrame.setDefaultLookAndFeelDecorated(true); - - //Create and set up the window. - frame = new JFrame("FocusConceptsDemo"); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - //Create and set up the content pane. - JComponent newContentPane = new FocusConceptsDemo(); - newContentPane.setOpaque(true); //content panes must be opaque - frame.setContentPane(newContentPane); - - //Display the window. - frame.pack(); - frame.setVisible(true); -} -public static void main(String[] args) { - //Schedule a job for the event-dispatching thread: - //creating and showing this application's GUI. - javax.swing.SwingUtilities.invokeLater(new Runnable() { - public void run() { - createAndShowGUI(); - } - }); - -invokeAndWait(): ----------------- -void printTextField() throws Exception { - final String[] myStrings = new String[2]; - - Runnable getTextFieldText = new Runnable() { - public void run() { - myStrings[0] = textField0.getText(); - myStrings[1] = textField1.getText(); - } - }; - SwingUtilities.invokeAndWait(getTextFieldText); - - System.out.println(myStrings[0] + " " + myStrings[1]); -} - -SwingWorker: ------------- - -//BETTER CODE: -public void actionPerformed(ActionEvent e) { - ... - final SwingWorker worker = new SwingWorker() { - public Object construct() { - //...code that might take a while to execute is here... - return someValue; - } - }; - worker.start(); //required for SwingWorker 3 - ... -} - -using finished: - -public void actionPerformed(ActionEvent e) { - ... - if (icon == null) { //haven't viewed this photo before - loadImage(imagedir + pic.filename, current); - } else { - updatePhotograph(current, pic); - } -} -... -//Load an image in a separate thread. -private void loadImage(final String imagePath, final int index) { - final SwingWorker worker = new SwingWorker() { - ImageIcon icon = null; - - public Object construct() { - icon = new ImageIcon(getURL(imagePath)); - return icon; //return value not used by this program - } - - //Runs on the event-dispatching thread. - public void finished() { - Photo pic = (Photo)pictures.elementAt(index); - pic.setIcon(icon); - if (index == current) - updatePhotograph(index, pic); - } - }; - worker.start(); -} - - ----- - ? logging (LogPanel and/or usual logging to a file?) * communication with StatusBar (incl. progress bar, cancel button) * disabling things during a long-time operation @@ -191,8 +85,7 @@ Registry panel -------------- -* model (worker: org.biomoby.shared.CentralAll, -CentralDigestCachedImpl.java ) +* finish all buttons Registration panel @@ -225,3 +118,32 @@ - Configure a new Dashboard - Debugging panel (with a Memory Panel embedded; replacing current two pannels) + +UNSOLVED (mysteries and not-yet-dones) +======== + +* RegistrationPanel -> Data type registration + + - at the beginning, the 'add...' menu item in the popup menu are not + disabled - but should be (I do not know why they are not) + + - the BuildDataTypeTree is sometimes damaged (after adding a member +node); not sure how to reproduce it + + ! loading... does not sync correctly with the browser panel + + ! more generally: simplify (or at least document) what kind of notifications + are used (now, it seems to be confusin what has PropertyChannel and what + is registered by 'support') + + ! finish all the caching stuff (separate scrap of paper) + +* After registration, update cache, update list +* The same, after de-registration +* Then make the reg/unreg real... + +* Icons: + - better icon for AddHAS (with a small star) + +* alltools2: + - JTextFieldWithHistory should remember also an empty value ("") =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/25 09:02:07 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/26 08:05:18 1.4 @@ -12,6 +12,7 @@ import org.biomoby.shared.Central; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyRelationship; +import org.biomoby.shared.parser.MobyTags; import org.biomoby.service.generator.DataTypesGenerator; import org.tulsoft.shared.UUtils; @@ -77,14 +78,25 @@ CommonConsole console; MobyException dtException; - - final static String DATA_TYPE_PROLOGUE = - "An error occured when trying to register a new data type.\n\n"; + MobyException dtUnregException; // shared icons protected static Icon menuAddISAIcon, menuAddISAIconDis; protected static Icon menuAddHASAIcon, menuAddHASAIconDis; protected static Icon menuAddHASIcon, menuAddHASIconDis; + protected static Icon menuUnregisterIcon, menuUnregisterIconDis; + + // some texts + final static String DATA_TYPE_PROLOGUE = + "An error occured when trying to register a new data type.\n\n"; + + final static String DATA_TYPE_UNREG_PROLOGUE = + "An error occured when trying to unregister a data type.\n\n"; + + final static String DATA_TYPE_INTRO = + "Create new data type by filling the form in the middle and adding" + + " parent and children types from the tree on the right. Adding is done" + + " by selecting first a data type, then right-click gives you menu."; /********************************************************************* * propertyChange() @@ -117,6 +129,10 @@ if (pComponent != null) return pComponent; + // console panel + console = new CommonConsole(); + console.setAppendMode (true); + pComponent = new JPanel (new GridBagLayout(), true); // sub-panels for registering various entities @@ -126,10 +142,6 @@ tabbedPane.addTab ("Service Type", getServiceTypeRegistration()); tabbedPane.addTab ("Service", getServiceRegistration()); - // console panel - console = new CommonConsole(); - console.setAppendMode (true); - // split the screen JSplitPane split = new JSplitPane (JSplitPane.VERTICAL_SPLIT, tabbedPane, @@ -340,6 +352,7 @@ protected final static String AC_PARENT = "ac-parent"; protected final static String AC_MHASA = "ac-m-hasa"; protected final static String AC_MHAS = "ac-m-has"; + protected final static String AC_UNREG = "ac-unreg"; /********************************************************************* * Construtor @@ -374,6 +387,13 @@ if (menuAddHASIconDis == null) menuAddHASIconDis = SwingUtils.createIcon ("images/smallAddHAS_dis.gif", Dashboard.class); + + if (menuUnregisterIcon == null) + menuUnregisterIcon = + SwingUtils.createIcon ("images/smallUnregister.gif", Dashboard.class); + if (menuUnregisterIconDis == null) + menuUnregisterIconDis = + SwingUtils.createIcon ("images/smallUnregister_dis.gif", Dashboard.class); } /********************************************************************* @@ -387,36 +407,49 @@ removeSeparatorAfter (AC_COLLAPSE); popup.add - (createMenuItem (new AbstractAction ("Add selected as a parent type - ISA") { + (createMenuItem (new AbstractAction ("Add selected as a parent type - ISA") { public void actionPerformed (ActionEvent e) { onParentSelected(); } }, AC_PARENT, menuAddISAIcon, menuAddISAIconDis)); popup.add - (createMenuItem (new AbstractAction ("Add selected as a member - HASA") { + (createMenuItem (new AbstractAction ("Add selected as a member - HASA") { public void actionPerformed (ActionEvent e) { onMemberSelected (Central.iHASA); } }, AC_MHASA, menuAddHASAIcon, menuAddHASAIconDis)); popup.add - (createMenuItem (new AbstractAction ("Add selected as a list of members - HAS") { + (createMenuItem (new AbstractAction ("Add selected as a list of members - HAS") { public void actionPerformed (ActionEvent e) { onMemberSelected (Central.iHAS); } }, AC_MHAS, menuAddHASIcon, menuAddHASIconDis)); - selected (null); + popup.addSeparator(); + + popup.add + (createMenuItem (new AbstractAction ("Unregister") { + public void actionPerformed (ActionEvent e) { + onUnregisterDataType(); + } + }, AC_UNREG, menuUnregisterIcon, menuUnregisterIconDis)); + + selected (null); // TBD: this has no effect; why? } /********************************************************************* * Called when a tree node is selected, or deselected (in - * which case 'node' is null). If anything is selected, enable - * few popup menu items, otherwise disable them. + * which case 'node' is null). If a data type name is + * selected, enable few popup menu items, otherwise disable them. ********************************************************************/ protected void selected (DefaultMutableTreeNode node) { - boolean enabled = (node != null); + boolean enabled = true; + if ( node == null || + node.isRoot() || + (lastSorted == SORTED_BY_AUTHORITY && ! node.isLeaf()) ) + enabled = false; setEnabledPopupItem (AC_PARENT, enabled); setEnabledPopupItem (AC_MHASA, enabled); setEnabledPopupItem (AC_MHAS, enabled); @@ -430,7 +463,9 @@ (DefaultMutableTreeNode)getLastSelectedPathComponent(); if (node != null) { // i.e. something is really selected CommonNode nodeObject = (CommonNode)node.getUserObject(); - buildTree.setParent (nodeObject.getValue()); + String value = nodeObject.getValue(); + if (! DataTypesGenerator.isPrimitiveType (value)) + buildTree.setParent (value); } } @@ -446,6 +481,50 @@ } } - } + /********************************************************************* + * + ********************************************************************/ + protected void onUnregisterDataType() { + DefaultMutableTreeNode node = + (DefaultMutableTreeNode)getLastSelectedPathComponent(); + if (node == null) return; // nothing selected + CommonNode nodeObject = (CommonNode)node.getUserObject(); + final String dataTypeName = nodeObject.getValue(); + + if (DataTypesGenerator.isPrimitiveType (dataTypeName) || + dataTypeName.equals (MobyTags.MOBYOBJECT)) { + AbstractPanel.error ("Sorry, but the top-level object and\n" + + "the objects representing primitive types\n" + + "cannot unregister. At least not so easily."); + return; + } + + if (! confirm ("Are you sure you wish to unregister\n" + + "data type: " + dataTypeName + " ?")) + return; + + dtUnregException = null; + final SwingWorker worker = new SwingWorker() { + public Object construct() { + try { + MobyDataType dataType = new MobyDataType (dataTypeName); + console.setText ("Data type to be unregistered: " + dataTypeName + "\n"); + registryModel.unRegisterDataType (dataType); + console.setText ("\nUnregistration successful!\n\n"); + } catch (MobyException e) { + dtUnregException = e; + } + return null; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (dtUnregException != null) + error (DATA_TYPE_UNREG_PROLOGUE, dtUnregException); + } + }; + worker.start(); + } + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/25 09:02:07 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/26 08:05:18 1.7 @@ -95,6 +95,23 @@ /********************************************************************* * ********************************************************************/ + public void unRegisterDataType (MobyDataType dataType) + throws MobyException { + initWorker(); +// try { +// worker.unregisterDataType (dataType); +// } catch (PendingCurationException e) { +// throw new MobyException ("Unregistration reports 'Pending curation'...\n" + +// "Well, nobody knows what it means. Call Mark!"); +// } catch (NoSuccessException e) { +// throw new MobyException ("Unregistration reports 'No Success'...\n" + +// e.getMessage()); +// } + } + + /********************************************************************* + * + ********************************************************************/ public MobyDataType[] getDataTypesByNames() throws MobyException { initWorker(); From senger at pub.open-bio.org Thu Oct 27 04:15:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FOck002913@pub.open-bio.org> senger Thu Oct 27 00:15:24 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/shared/event Modified Files: NotificationEvent.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/22 01:38:04 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/27 04:15:23 1.3 @@ -8,6 +8,7 @@ package org.biomoby.shared.event; +import org.tulsoft.shared.UUtils; import java.util.EventObject; /** @@ -98,7 +99,8 @@ StringBuffer buf = new StringBuffer (100); buf.append ("["); buf.append (typeStr); - buf.append (", Message=" + message); + if (UUtils.notEmpty (message)) + buf.append (", Message=" + message); if (details != null) buf.append (", Details=" + details.getClass().getName()); buf.append ("]"); From senger at pub.open-bio.org Thu Oct 27 04:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FN6t002798@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv2749/src/Clients Modified Files: CacheRegistryClient.java MobyCmdLineClient.java MobyDigestClient.java TestingCentral.java Log Message: moby-live/Java/src/Clients CacheRegistryClient.java,1.4,1.5 MobyCmdLineClient.java,1.12,1.13 MobyDigestClient.java,1.5,1.6 TestingCentral.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/22 16:07:08 1.4 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/10/27 04:15:23 1.5 @@ -122,7 +122,7 @@ if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-n")) { castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_NAMESPACES); decorationLn ("Retrieving namespaces..."); - worker.getNamespaces(); + worker.getFullNamespaces(); } // =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/19 08:08:32 1.12 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/10/27 04:15:23 1.13 @@ -157,12 +157,9 @@ if (cmd.hasOption ("-ln")) { decorationLn ("Namespaces:"); decorationLn ("-----------"); - Map types = worker.getNamespaces(); - - for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - System.out.println (entry.getKey()); - System.out.println ("\t" + entry.getValue()); + MobyNamespace[] nms = worker.getFullNamespaces(); + for (int i = 0; i < nms.length; i++) { + System.out.println (nms[i]); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/10/12 11:17:59 1.5 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/10/27 04:15:23 1.6 @@ -91,12 +91,10 @@ if (cmd.hasOption ("-t")) { MobyServiceType[] serviceTypes = worker.getFullServiceTypes(); for (int i = 0; i < serviceTypes.length; i++) { - if (details) { - System.out.println (serviceTypes[i].toString()); - System.out.println ("---"); - } else { + if (details) + System.out.println (serviceTypes[i]); + else System.out.println (serviceTypes[i].getName()); - } } } @@ -105,7 +103,7 @@ if (details) { MobyService[] services = worker.getServices(); for (int i = 0; i < services.length; i++) { - System.out.println (services[i].toString()); + System.out.println (services[i]); System.out.println ("---"); } } else { @@ -123,12 +121,12 @@ // read all namespaces if (cmd.hasOption ("-n")) { - Map namespaces = worker.getNamespaces(); - for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - System.out.println (entry.getKey()); + MobyNamespace[] namespaces = worker.getFullNamespaces(); + for (int i = 0; i < namespaces.length; i++) { if (details) - System.out.println ("\t" + entry.getValue()); + System.out.println (namespaces[i]); + else + System.out.println (namespaces[i].getName()); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/10/18 17:19:56 1.8 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/10/27 04:15:23 1.9 @@ -184,7 +184,7 @@ try { start ("retrieveNamespaces"); - worker.getNamespaces(); + worker.getFullNamespaces(); ok(); } catch (MobyException e) { error (e); } From senger at pub.open-bio.org Thu Oct 27 04:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FNpx002830@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralDigestImpl.java CentralImpl.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.10,1.11 CentralDigestImpl.java,1.7,1.8 CentralImpl.java,1.29,1.30 GraphsServlet.java,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/22 01:38:04 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/10/27 04:15:23 1.11 @@ -6,6 +6,14 @@ package org.biomoby.client; +import org.biomoby.shared.CentralAll; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyNamespace; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.MobyService; +import org.biomoby.shared.MobyServiceType; +import org.biomoby.shared.NoSuccessException; + import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; @@ -20,13 +28,6 @@ import java.util.Arrays; import java.util.Comparator; -import org.biomoby.shared.CentralAll; -import org.biomoby.shared.MobyDataType; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyService; -import org.biomoby.shared.MobyServiceType; -import org.biomoby.shared.NoSuccessException; - /** * An implementation of {@link org.biomoby.shared.CentralAll}, * allowing to cache locally results of the cumulative methods so it @@ -325,7 +326,7 @@ if (list == null || list.length == 0) return true; for (int i = 0; i < list.length; i++) { - if ( ! ignored (new File (list[i])) ) + if ( ! ignoredForEmptiness (new File (list[i])) ) return false; } return true; @@ -403,11 +404,10 @@ fireEvent (SERVICE_TYPES_START); String typesAsXML = getServiceTypesAsXML(); store (serviceTypesCache, LIST_FILE, typesAsXML); - Map types = createServiceTypesFromXML (typesAsXML); - fireEvent (SERVICE_TYPES_COUNT, new Integer (types.size())); - for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); + MobyServiceType[] types = createServiceTypesFromXML (typesAsXML); + fireEvent (SERVICE_TYPES_COUNT, new Integer (types.length)); + for (int i = 0 ; i < types.length; i++) { + String name = types[i].getName(); fireEvent (SERVICE_TYPE_LOADING, name); String xml = getServiceTypeRelationshipsAsXML (name, false); store (serviceTypesCache, name, xml); @@ -556,11 +556,10 @@ /************************************************************************* * *************************************************************************/ -// public MobyNamespace[] getNamespaces() //TBD: later, when API allows it - public Map getNamespaces() + public MobyNamespace[] getFullNamespaces() throws MobyException { if (namespacesCache == null) - return super.getNamespaces(); + return super.getFullNamespaces(); synchronized (namespacesCache) { if (isCacheEmpty (namespacesCache)) { initCache(); @@ -590,26 +589,19 @@ // get a list file (with all service type names) String xmlList = getListFile (serviceTypesCache); - Map types = createServiceTypesFromXML (xmlList); + MobyServiceType[] types = createServiceTypesFromXML (xmlList); - // get individual (almost) full service types - Vector v = new Vector(); - for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); + // add details about relationship to get full service types + for (int i = 0; i < types.length; i++) { + String name = types[i].getName(); File file = new File (serviceTypesCache, name); try { - MobyServiceType serviceType = new MobyServiceType (name); - serviceType.setParentNames (createServiceTypeRelationshipsFromXML (load (file))); - serviceType.setDescription ((String)entry.getValue()); - v.addElement (serviceType); + types[i].setParentNames (createServiceTypeRelationshipsFromXML (load (file))); } catch (MobyException e) { System.err.println (MSG_CACHE_BAD_FILE (file, e)); } } - MobyServiceType[] result = new MobyServiceType [v.size()]; - v.copyInto (result); - return result; + return types; } } @@ -646,6 +638,15 @@ } /************************************************************************** + * Some file (when a cache is being tested fir emptyness) are ignored. + *************************************************************************/ + protected static boolean ignoredForEmptiness (File file) { + String path = file.getPath(); + return + path.endsWith ("~"); + } + + /************************************************************************** * *************************************************************************/ protected static String MSG_CACHE_NOT_DIR (File cache) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/22 01:38:04 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/27 04:15:23 1.8 @@ -145,33 +145,13 @@ /************************************************************************* * Physically gather together all namespaces. It is not that hard * (comparing to other Biomoby entities) because all namespaces - * are delivered by a single call to Biomoby. This method differs - * form the Central.getNamespaces() in the type of returned - * result, and - hopefully in the future - also in the amount of - * information stored in the returned value (but at the monent, - * because of a limitation of the Biomoby API, both result types - * contain the same information). + * are delivered by a single call to Biomoby. *************************************************************************/ protected MobyNamespace[] readNamespaces() throws MobyException { try { fireEvent (NAMESPACES_START); - Map names = getNamespaces(); - fireEvent (NAMESPACES_COUNT, new Integer (names.size())); - MobyNamespace[] result = new MobyNamespace [ names.size() ]; - int i = 0; - for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); - MobyNamespace ns = new MobyNamespace (name); - ns.setDescription ((String)entry.getValue()); - result[i++] = ns; - fireEvent (NAMESPACE_LOADED, name, ns); - } - return result; - - } catch (Exception e) { - throw new MobyException (formatException (e)); + return super.getFullNamespaces(); } finally { fireEvent (NAMESPACES_END); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/10/12 11:36:59 1.29 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/10/27 04:15:23 1.30 @@ -560,6 +560,14 @@ return value; } + protected String getFirstValue (NodeList children) { + if (children.item(0) != null && children.item(0).hasChildNodes()) { + children.item(0).normalize(); + return getFirstValue (children.item(0)); + } + return ""; + } + /************************************************************************** * * Implementing SimpleCache interface. @@ -784,8 +792,10 @@ * Parses and imports the following XML. *

          *  <serviceTypes>
    -     *     <serviceType name="serviceName">
    +     *     <serviceType name="serviceName" lsid="...">
          *            <Description><![CDATA[free text description here]]></Description>
    +     *            <contactEmail>...</contactEmail>
    +     *            <authURI>...</authURI>
          *     </serviceType>
          *          ...
          *          ...
    @@ -795,7 +805,13 @@
         public Map getServiceTypes()
     	throws MobyException {
     	String result = getServiceTypesAsXML();
    -	return createServiceTypesFromXML (result);
    + 	Map results = new TreeMap (getStringComparator());
    +	MobyServiceType[] types = createServiceTypesFromXML (result);
    +	for (int i = 0; i < types.length; i++) {
    +	    results.put (types[i].getName(),
    +			 types[i].getDescription());
    +	}
    +	return results;
         }
     
         //
    @@ -805,29 +821,33 @@
     			       new Object[] {});
         }
     
    -    //
    -    protected Map createServiceTypesFromXML (String result)
    +    // but be aware that the created MobyServiceTypes are not complete
    +    // - they do not have the relationship information; that's why
    +    // this method is not public; the full service types are available
    +    // from CentralDigest implementations
    +    protected MobyServiceType[] createServiceTypesFromXML (String result)
     	throws MobyException {
     
     	// parse returned XML
    -	Map results = new TreeMap (getStringComparator());
     	Document document = null;
     	try {
     	    document = docBuilder.parse(new ByteArrayInputStream(result.getBytes()));}
     	catch(Exception e){throw new MobyException(e.toString());}
     
     	NodeList list = document.getElementsByTagName ("serviceType");
    +	if (list == null || list.getLength() == 0)
    +	    return new MobyServiceType[] {};
    +	MobyServiceType[] results = new MobyServiceType [list.getLength()];
     	for (int i = 0; i < list.getLength(); i++) {
     	    Element elem = (Element)list.item (i);
    -	    NodeList children = elem.getChildNodes();
    -	    for (int j = 0; j < children.getLength(); j++) {
    -		if (children.item (j).getNodeName().equals ("Description")) {
    -		    results.put (elem.getAttribute ("name"),
    -				 getFirstValue (children.item (j)));
    -		    break;
    -		}
    -	    }
    +	    MobyServiceType st = new MobyServiceType (elem.getAttribute ("name"));
    +	    st.setLSID (elem.getAttribute ("lsid"));
    +	    st.setDescription (getFirstValue (elem.getElementsByTagName ("Description")));
    +	    st.setEmailContact (getFirstValue (elem.getElementsByTagName ("contactEmail")));
    +	    st.setAuthority (getFirstValue (elem.getElementsByTagName ("authURI")));
    +	    results[i] = st;
     	}
    + 	java.util.Arrays.sort (results);
     	return results;
         }
     
    @@ -835,15 +855,17 @@
          * Parses and imports the following XML.
          * 
          *  <Namespaces>
    -     *     <Namespace name="namespace">
    +     *     <Namespace name="namespace" lsid="...">
          *            <Description><![CDATA[free text description here]]></Description>
    +     *            <contactEmail>...</contactEmail>
    +     *            <authURI>...</authURI>
          *     </Namespace>
          *          ...
          *          ...
          *  </Namespaces>
          * 
    *************************************************************************/ - public Map getNamespaces() + public MobyNamespace[] getFullNamespaces() throws MobyException { String result = getNamespacesAsXML(); @@ -858,11 +880,10 @@ } // - protected Map createNamespacesFromXML (String result) + protected MobyNamespace[] createNamespacesFromXML (String result) throws MobyException { // parse returned XML - Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -872,25 +893,35 @@ NodeList list = document.getDocumentElement().getElementsByTagName ("Namespace"); if (list == null || list.getLength() == 0) { - throw new MobyException ("Could not find Namespace children of response root node " + - document.getDocumentElement()); + return new MobyNamespace[] {}; } - int length = list.getLength(); - for (int i = 0; i < length; i++) { + MobyNamespace[] results = new MobyNamespace [list.getLength()]; + for (int i = 0; i < list.getLength(); i++) { Element elem = (Element)list.item (i); - NodeList children = elem.getElementsByTagName("Description"); - if (children.item(0).hasChildNodes()) { - children.item(0).normalize(); - results.put (elem.getAttribute ("name"), - getFirstValue (children.item(0))); + MobyNamespace nm = new MobyNamespace (elem.getAttribute ("name")); + nm.setLSID (elem.getAttribute ("lsid")); + nm.setDescription (getFirstValue (elem.getElementsByTagName ("Description"))); + nm.setEmailContact (getFirstValue (elem.getElementsByTagName ("contactEmail"))); + nm.setAuthority (getFirstValue (elem.getElementsByTagName ("authURI"))); + results[i] = nm; + } + java.util.Arrays.sort (results); + return results; + } - } else { - // No description provided - results.put (elem.getAttribute ("name"), ""); - } - } + /************************************************************************** + * + *************************************************************************/ + public Map getNamespaces() + throws MobyException { + Map results = new TreeMap (getStringComparator()); + MobyNamespace[] namespaces = getFullNamespaces(); + for (int i = 0; i < namespaces.length; i++) { + results.put (namespaces[i].getName(), + namespaces[i].getDescription()); + } return results; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/22 16:07:09 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/10/27 04:15:23 1.13 @@ -423,12 +423,13 @@ MobyService[] services = null; MobyDataType[] dataTypes = null; - Map namespaces = null; +// Map namespaces = null; + MobyNamespace[] namespaces = null; try { readRegistryIfNeeded(); services = registry.getServices(); dataTypes = registry.getDataTypes(); - namespaces = registry.getNamespaces(); + namespaces = registry.getFullNamespaces(); lastRead = getLastRead(); } catch (MobyException e) { error (res, HttpServletResponse.SC_SERVICE_UNAVAILABLE, e); @@ -570,10 +571,13 @@ String selectData2 = h.list (attrs, dataLabels, null, selected); Vector v = new Vector(); - for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = (Map.Entry)it.next(); - v.addElement (entry.getKey()); + for (int i = 0; i < namespaces.length; i++) { + v.addElement (namespaces[i].getName()); } +// for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { +// Map.Entry entry = (Map.Entry)it.next(); +// v.addElement (entry.getKey()); +// } new Sorter().sort (v); v.insertElementAt (WITHOUT_NAMESPACE, 0); String[] nsLabels = new String [v.size()]; From senger at pub.open-bio.org Thu Oct 27 04:15:24 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FObv002892@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/shared Modified Files: Central.java CentralDigest.java MobyNamespace.java MobyServiceType.java Log Message: moby-live/Java/src/main/org/biomoby/shared Central.java,1.12,1.13 CentralDigest.java,1.2,1.3 MobyNamespace.java,1.2,1.3 MobyServiceType.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2005/08/07 06:40:39 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2005/10/27 04:15:23 1.13 @@ -162,8 +162,11 @@ throws MobyException; /************************************************************************** - * Get the list of all registered namespaces. - *

    + * Get the list of all registered namespaces.

    + * + * @deprecated Replaced by {@link #getFullNamespaces} that gives + * more information for the same price.

    + * * @return a hash table where keys are names of namespaces while * values are their descriptions * @throws MobyException if communication with the Moby Registry fails @@ -172,6 +175,16 @@ throws MobyException; /************************************************************************** + * Get the list of all registered namespaces, with all their + * attributes.

    + * + * @return array of namespaces + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + MobyNamespace[] getFullNamespaces() + throws MobyException; + + /************************************************************************** * Get the list of all registered data types. *

    * @return a hash table where keys are names of data types while =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2005/09/22 16:07:09 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2005/10/27 04:15:23 1.3 @@ -46,17 +46,6 @@ throws MobyException; /************************************************************************* - * Get definition of all known namespaces. It differs from the - * {@link Central#getNamespaces} because it returns an array of - * full definitions of namespaces, and not just their names and - * descriptions.

    - * - * @throws MobyException if communication with the Moby Registry fails - *************************************************************************/ - MobyNamespace[] getFullNamespaces() - throws MobyException; - - /************************************************************************* * Get definition of all registered service instances. It is a * cumulation of many individual calls to {@link * Central#findService(MobyService) findService by name} for all =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2005/09/22 16:07:09 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2005/10/27 04:15:23 1.3 @@ -20,14 +20,23 @@ * @version $Id$ */ -public class MobyNamespace { +public class MobyNamespace + implements Comparable { protected String name; protected String authority = ""; protected String emailContact = ""; protected String description = ""; + protected String lsid = null; protected String id = null; + public int compareTo (Object obj) { + return name.compareToIgnoreCase ( ((MobyNamespace)obj).getName() ); + } + public boolean equals (Object obj) { + return name.equals ( ((MobyNamespace)obj).getName() ); + } + /************************************************************************** * Default constructor. Other characteristics are empty - which is usually * wrong - therefore use 'set' method to fill them. @@ -47,6 +56,13 @@ id = value; } + public String getLSID() { + return lsid; + } + public void setLSID (String value) { + lsid = value; + } + public String getAuthority() { return authority; } @@ -70,10 +86,12 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name); + buf.append (name); if (UUtils.notEmpty (authority)) buf.append (", Auth: " + authority); - if (id != null) buf.append (", ID: " + id); + if (UUtils.notEmpty (emailContact)) + buf.append (", Contact: " + emailContact); + if (lsid != null) buf.append (", " + lsid); if (UUtils.notEmpty (description)) buf.append ("\n\t" + description); return new String (buf); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java 2004/10/18 14:35:06 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java 2005/10/27 04:15:23 1.3 @@ -6,6 +6,7 @@ // package org.biomoby.shared; +import org.tulsoft.shared.UUtils; /** * A container representing a service type used in the Moby registry. @@ -19,7 +20,8 @@ * @version $Id$ */ -public class MobyServiceType { +public class MobyServiceType + implements Comparable { protected String name; protected String description = ""; @@ -27,6 +29,14 @@ protected String authority = ""; protected String[] parentNames = new String[] { }; protected String id = null; + protected String lsid = null; + + public int compareTo (Object obj) { + return name.compareToIgnoreCase ( ((MobyServiceType)obj).getName() ); + } + public boolean equals (Object obj) { + return name.equals ( ((MobyServiceType)obj).getName() ); + } /************************************************************************** * Default constructor. @@ -57,6 +67,13 @@ id = value; } + public String getLSID() { + return lsid; + } + public void setLSID (String value) { + lsid = value; + } + public String getDescription() { return description; } @@ -109,14 +126,19 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("Desc: " + description + "\n"); - buf.append ("ID: " + id + "\n"); - buf.append ("Parents:\n"); - for (int i = 0 ; i < parentNames.length; i++) { - buf.append (Utils.format (null, 1)); - buf.append (parentNames [i]); - buf.append ("\n"); + buf.append (name); + if (UUtils.notEmpty (authority)) + buf.append (", Auth: " + authority); + if (UUtils.notEmpty (emailContact)) + buf.append (", Contact: " + emailContact); + if (lsid != null) buf.append (", " + lsid); + if (UUtils.notEmpty (description)) + buf.append ("\n\t" + description); + if (parentNames.length > 0) { + buf.append ("\n\tParents: "); + for (int i = 0 ; i < parentNames.length; i++) { + buf.append (parentNames [i] + " "); + } } return new String (buf); } From senger at pub.open-bio.org Thu Oct 27 04:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FN88002855@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/service/dashboard Modified Files: PropertyChannel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard PropertyChannel.java,1.3,1.4 RegistryPanel.java,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/22 01:38:04 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/27 04:15:23 1.4 @@ -41,8 +41,8 @@ * listener) we may re-consider this desision. At the moment, I do not * see any advantage of it.

    * - * Property names are of no interest for this class, but it is good to - * remind that they should be defined in the class {@link + * Concrete property names are of no interest for this class, but it + * is good to remind that they should be collected in the class {@link * DashboardProperties}.

    * @author Martin Senger =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/22 14:35:46 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/27 04:15:23 1.12 @@ -130,38 +130,45 @@ // ontology trees ServicesTree servicesTree = new ServicesTree(); - + ServiceTypesTree serviceTypesTree = new ServiceTypesTree(); + NamespacesTree namespacesTree = new NamespacesTree(); DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, console, support); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); - NamespacesTree namespacesTree = new NamespacesTree(); - JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, servicesTree.scrollable(), dataTypesBoard); split1.setResizeWeight (0.5); split1.setContinuousLayout (true); split1.setOneTouchExpandable (true); + JSplitPane split2 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, - split1, + serviceTypesTree.scrollable(), namespacesTree.scrollable()); - split2.setResizeWeight (0.7); + split2.setResizeWeight (0.5); split2.setContinuousLayout (true); split2.setOneTouchExpandable (true); - JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, - split2, - console); - split3.setResizeWeight (0.75); + JSplitPane split3 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, + split1, + split2); + split3.setResizeWeight (0.5); split3.setContinuousLayout (true); split3.setOneTouchExpandable (true); + JSplitPane split4 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, + split3, + console); + split4.setResizeWeight (0.75); + split4.setContinuousLayout (true); + split4.setOneTouchExpandable (true); + // put all together - SwingUtils.addComponent (pComponent, split3, 0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0); - SwingUtils.addComponent (pComponent, regLocation, 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0); - SwingUtils.addComponent (pComponent, cacheLocation, 1, 1, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (pComponent, split4, 0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0); + SwingUtils.addComponent (pComponent, regLocation, 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (pComponent, cacheLocation, 1, 1, 1, 1, HORI, NWEST, 0.0, 0.0); return pComponent; } @@ -322,6 +329,16 @@ /************************************************************************** * **************************************************************************/ + class ServiceTypesTree extends CommonTree { + public ServiceTypesTree() { + super ("Service Types"); + } + } + + + /************************************************************************** + * + **************************************************************************/ class NamespacesTree extends CommonTree { public NamespacesTree() { super ("Namespaces"); From senger at pub.open-bio.org Thu Oct 27 04:15:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 00:15:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270415.j9R4FNLO002768@pub.open-bio.org> senger Thu Oct 27 00:15:23 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv2749/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.44,1.45 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/24 17:51:51 1.44 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/10/27 04:15:23 1.45 @@ -1,3 +1,15 @@ +2005-10-26 Martin Senger + + * Add Comparator interface/implementtaion to MobyServiceType. + + * Changed slightly the output of namespaces and service types in + MobyCmdLineClient (because more data is now flowing from Biomoby + registers). + + * Add getFullNamespaces() to Central.java and its implementations. + + * Add Comparator interface/implementtaion to MobyNamespace. + 2005-09-24 Martin Senger * Added sorting to the most of the returned results from From senger at pub.open-bio.org Thu Oct 27 08:55:48 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 04:55:48 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270855.j9R8tmuP003759@pub.open-bio.org> senger Thu Oct 27 04:55:48 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv3740/src/config/dashboard/META-INF/services Modified Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/10/22 14:35:46 1.2 +++ /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/org.biomoby.service.dashboard.DashboardPanel 2005/10/27 08:55:48 1.3 @@ -1,4 +1,3 @@ org.biomoby.service.dashboard.RegistryPanel org.biomoby.service.dashboard.RegistrationPanel -org.biomoby.service.dashboard.ConsolePanel -org.biomoby.service.dashboard.EventGeneratorPanel +org.biomoby.service.dashboard.DebuggingPanel From senger at pub.open-bio.org Thu Oct 27 08:55:49 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 27 Oct 2005 04:55:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510270855.j9R8tn0s003817@pub.open-bio.org> senger Thu Oct 27 04:55:48 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv3740/src/main/org/biomoby/service/dashboard Modified Files: AbstractModel.java AbstractPanel.java CommonBoard.java Dashboard.java DashboardPanel.java DataTypesBoard.java PropertyChannel.java RegistrationPanel.java RegistryModel.java RegistryPanel.java Added Files: DebuggingPanel.java Removed Files: ConsolePanel.java EventGeneratorPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard DebuggingPanel.java,NONE,1.1 AbstractModel.java,1.1,1.2 AbstractPanel.java,1.10,1.11 CommonBoard.java,1.1,1.2 Dashboard.java,1.7,1.8 DashboardPanel.java,1.4,1.5 DataTypesBoard.java,1.2,1.3 PropertyChannel.java,1.4,1.5 RegistrationPanel.java,1.4,1.5 RegistryModel.java,1.7,1.8 RegistryPanel.java,1.12,1.13 ConsolePanel.java,1.5,NONE EventGeneratorPanel.java,1.4,NONE =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/09/24 17:54:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/10/27 08:55:48 1.2 @@ -44,9 +44,8 @@ */ public class AbstractModel - implements PropertyChangeListener, DashboardProperties { + implements DashboardProperties { - protected PropertyChangeSupport support; protected PropertyChannel propertyChannel; /********************************************************************* @@ -55,26 +54,11 @@ protected AbstractModel() { } - /********************************************************************* - * Usual constructor that shares support for property changes with - * its creator. - ********************************************************************/ - protected AbstractModel (PropertyChangeSupport support) { - this.support = support; - } - - /************************************************************************** - * Here we get notified when a property change happen. - **************************************************************************/ - public void propertyChange (PropertyChangeEvent event) { - } - /************************************************************************** * Keep shared storage of properties updated in various panels. **************************************************************************/ public void setPropertyChannel (PropertyChannel propertyChannel) { this.propertyChannel = propertyChannel; - propertyChannel.addPropertyChangeListener (this); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/26 08:05:18 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/10/27 08:55:48 1.11 @@ -1,6 +1,6 @@ // AbstractPanel.java // -// Created: September 2005 +// Created: September 2005 // // This file is a component of the BioMoby project. // Copyright Martin Senger (martin.senger at gmail.com). @@ -51,10 +51,6 @@ import java.awt.event.FocusEvent; import java.awt.event.FocusListener; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeSupport; - import java.io.File; import java.util.prefs.Preferences; import java.util.Map; @@ -102,14 +98,13 @@ protected static final Font TITLE_FONT = new Font ("Serif", Font.BOLD, 20); protected static final Color TITLE_FGCOLOR = new Color (12, 55, 241); - // + // sharing events protected PropertyChannel propertyChannel; /********************************************************************* * Default constructor (just for the sub-classes). ********************************************************************/ protected AbstractPanel() { - support = new PropertyChangeSupport (this); loadIcons(); } @@ -137,33 +132,11 @@ return title; } - /********************************************************************* - * Property change stuff - ********************************************************************/ - protected PropertyChangeSupport support; - - public void addPropertyChangeListener (PropertyChangeListener l) { - if (support != null) - support.addPropertyChangeListener(l); - } - - public void removePropertyChangeListener (PropertyChangeListener l) { - if (support != null) - support.removePropertyChangeListener(l); - } - - /************************************************************************** - * Here we get notified when a property change happens. - **************************************************************************/ - public void propertyChange (PropertyChangeEvent event) { - } - /************************************************************************** - * Remember a property channel and register itself to it as a listener. + * Remember the property channel. **************************************************************************/ protected void setPropertyChannel (PropertyChannel propertyChannel) { this.propertyChannel = propertyChannel; - propertyChannel.addPropertyChangeListener (this); } // =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/22 01:38:04 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/27 08:55:48 1.2 @@ -20,7 +20,6 @@ import java.awt.event.ActionListener; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; -import java.beans.PropertyChangeSupport; /** * This is a simple graphical widget combining together a tree (a @@ -31,9 +30,9 @@ * * It is also a listener of events notifying about the loading * process. It reflects this events appropriately in the progress - * bar, and in some cases it propagates these events as - * property-change events further (usually they are caught and - * displayed in Dashboard's status bar).

    + * bar, and in some cases it propagates these events to the property + * channel (usually they are caught and displayed in Dashboard's + * status bar).

    * * @author Martin Senger * @version $Id$ @@ -44,7 +43,7 @@ implements NotificationListener { protected RegistryModel model; - protected PropertyChangeSupport support; + protected PropertyChannel channel; // components protected JLabel treeTitle; @@ -56,13 +55,13 @@ * Constructor.

    * * @param model gives access to a Biomoby registry - * @param support is used to fire property-change events + * @param channel is used to fire property-change events ********************************************************************/ protected CommonBoard (RegistryModel model, - PropertyChangeSupport support) { + PropertyChannel channel) { this.model = model; this.model.addNotificationListener (this); - this.support = support; + this.channel = channel; treeTitle = new JLabel (""); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/25 09:02:07 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/27 08:55:48 1.8 @@ -51,7 +51,6 @@ implements DashboardPanel, ChangeListener { private JComponent dashboard; - private StatusBar statusBar; private DashboardHeader header; public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; @@ -89,7 +88,6 @@ loadPanels(); propertyChannel = new PropertyChannel(); dashboard = getComponent (propertyChannel); - connectPanels(); } /************************************************************************** @@ -106,21 +104,6 @@ } /************************************************************************** - * Connect all available Dashboard panels: a) together, and b) - * with the status bar. TBD: It changed... It uses now a PropertyChannel... - **************************************************************************/ - public void connectPanels() { - for (int i = 0; i < panels.length; i++) { -// for (int j = 0; j < i; j++) -// panels[i].addPropertyChangeListener (panels[j]); -// for (int j = i+1; j < panels.length; j++) -// panels[i].addPropertyChangeListener (panels[j]); - if (statusBar != null) - panels[i].addPropertyChangeListener (statusBar); - } - } - - /************************************************************************** * Show the main frame. **************************************************************************/ public void show() { @@ -212,7 +195,8 @@ panels[i].getIcon(), panels[i].getComponent (propertyChannel)); } - statusBar = getStatusBar(); + StatusBar statusBar = getStatusBar(); + propertyChannel.addPropertyChangeListener (statusBar); if (useLoadMonitor) ProgressView.monitor.destroy(); @@ -302,24 +286,6 @@ /************************************************************************** * - **************************************************************************/ - public void addPropertyChangeListener (PropertyChangeListener listener) { - } - - /************************************************************************** - * - **************************************************************************/ - public void removePropertyChangeListener(PropertyChangeListener listener) { - } - - /************************************************************************** - * - **************************************************************************/ - public void propertyChange (PropertyChangeEvent event) { - } - - /************************************************************************** - * * An entry point... * **************************************************************************/ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/24 17:51:51 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/10/27 08:55:48 1.5 @@ -29,7 +29,7 @@ */ public interface DashboardPanel - extends PropertyChangeListener, DashboardProperties { + extends DashboardProperties { /************************************************************************** * Return a graphical representation of this panel.

    @@ -70,20 +70,20 @@ **************************************************************************/ Icon getIcon(); - /************************************************************************** - * Add a PropertyChangeListener to the listener list of a - * panel. All listeners will be notified if this panel changes - * some property.

    - * - * The panel should document what properties can fire - but at the - * moment it is not part of its interface.

    - * - **************************************************************************/ - void addPropertyChangeListener (PropertyChangeListener listener); - - /************************************************************************** - * Remove a PropertyChangeListener. - **************************************************************************/ - void removePropertyChangeListener(PropertyChangeListener listener); +// /************************************************************************** +// * Add a PropertyChangeListener to the listener list of a +// * panel. All listeners will be notified if this panel changes +// * some property.

    +// * +// * The panel should document what properties can fire - but at the +// * moment it is not part of its interface.

    +// * +// **************************************************************************/ +// void addPropertyChangeListener (PropertyChangeListener listener); + +// /************************************************************************** +// * Remove a PropertyChangeListener. +// **************************************************************************/ +// void removePropertyChangeListener(PropertyChangeListener listener); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/23 19:00:24 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/27 08:55:48 1.3 @@ -10,11 +10,8 @@ import org.biomoby.shared.event.NotificationEvent; import org.biomoby.shared.event.Notifier; - import org.tulsoft.shared.UUtils; -import java.beans.PropertyChangeSupport; - /** * This is a simple graphical widget combining together a tree (a * subclass of {@link org.biomoby.service.dashboard.CommonTree}) and a @@ -35,20 +32,28 @@ * * @param model gives access to a Biomoby registry * @param console displayed items selected in the tree - * @param support is used to fire property-change events + * @param channel is used to fire property-change events ********************************************************************/ public DataTypesBoard (RegistryModel model, CommonConsole console, - PropertyChangeSupport support) { - this (model, console, support, + PropertyChannel channel) { + this (model, console, channel, new DataTypesTree (model, console)); } + /********************************************************************* + * Constructor.

    + * + * @param model gives access to a Biomoby registry + * @param console displayed items selected in the tree + * @param channel is used to fire property-change events + * @param customTree allows to plug user-defined tree component + ********************************************************************/ public DataTypesBoard (RegistryModel model, CommonConsole console, - PropertyChangeSupport support, + PropertyChannel channel, CommonTree customTree) { - super (model, support); + super (model, channel); tree = customTree; createItself(); } @@ -68,7 +73,7 @@ calibrateProgressBar (UUtils.toInt (event.getMessage())); break; case Notifier.DATA_TYPE_LOADING: - support.firePropertyChange (DashboardProperties.DP_STATUS_MSG, null, event.getMessage()); + channel.fire (DashboardProperties.DP_STATUS_MSG, event.getMessage()); break; case Notifier.DATA_TYPE_LOADED: addToProgressBar(); @@ -76,7 +81,7 @@ case Notifier.DATA_TYPES_END: case Notifier.DATA_TYPES_CANCELLED: case Notifier.DATA_TYPES_RESET: - support.firePropertyChange (DashboardProperties.DP_STATUS_MSG, null, "Done"); + channel.fire (DashboardProperties.DP_STATUS_MSG, "Done"); removeProgressBar(); break; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/27 04:15:23 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/PropertyChannel.java 2005/10/27 08:55:48 1.5 @@ -10,6 +10,9 @@ import org.tulsoft.shared.UUtils; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.logging.Log; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -30,10 +33,17 @@ * *

    * - * Obviously, there are some properties that do not make sense to be - * stored here: the short-lived properties, such as progress bar - * change events. Such messages can be delivered in an ordinary way - * via property change listeners.

    + * Additionally, it also serves as a PropertyChangeSupport object: it + * can register and deregister PropertyChangeListeners, and it can + * fire an event to them on behave of other objects. The other objects + * either identify themselves (see method {@link + * #fire(Object,String,Object}), or use this channel for firing + * anonymous messages (see method {@link #fire(String,Object)}) - in + * which case the message source will be this class.

    + * + * The fired events are also stored here - under their names. That's + * mean that you can always get the last event of a particular + * name.

    * * The panels/models are sending here properties by calling method * put. If we find, in the future, that sending properties @@ -52,6 +62,9 @@ public class PropertyChannel extends Hashtable { + private static Log log = LogFactory.getLog (PropertyChannel.class); + private PropertyChangeSupport support; + /********************************************************************* * Default constructor. ********************************************************************/ @@ -62,10 +75,13 @@ /********************************************************************* * Maps the specified key to the specified value in this - * hashtable. Neither the key nor the value can be null. Remember - * the given value (do the same as an ordinary Hashtable does), - * and propagate it by firing a property change event (this - * is called a channel push style).

    + * hashtable. Neither the key nor the value can be null.

    + * + * The given value, apart from being stored, is also propagated by + * firing a property change event (this is called a channel + * push style). The event is anonymous. If you need to send + * the source of the message to the listeners, use instead {@link + * #put(Object,Object,Object)}.

    * * @param key the hashtable key * @param value the value @@ -74,7 +90,29 @@ ********************************************************************/ public Object put (Object key, Object value) { Object previous = super.put (key, value); - support.firePropertyChange (key.toString(), null, value); + fire (key.toString(), value); + return previous; + } + + /********************************************************************* + * Maps the specified key to the specified value in this + * hashtable. Neither the key nor the value can be null.

    + * + * The given value, apart from being stored, is also propagated by + * firing a property change event (this is called a channel + * push style). The event contains also its 'source'. For + * anonymously sent events, use instead {@link + * #put(Object,Object)}.

    + * + * @param source that initiated this event + * @param key the hashtable key + * @param value the value + * @return the previous value of the specified key in this + * hashtable, or null if it did not have one + ********************************************************************/ + public Object put (Object source, Object key, Object value) { + Object previous = super.put (key, value); + fire (source, key.toString(), value); return previous; } @@ -99,18 +137,69 @@ } /********************************************************************* - * Property change stuff + * Fire an event to any registered listeners. The source of this + * event will be this class.

    + * + * @param key is a name of the fired event + * @param value is a value associated with this event ********************************************************************/ - protected PropertyChangeSupport support; + public void fire (String key, Object value) { + if (log.isDebugEnabled()) + logDebug (null, key, value); + support.firePropertyChange (key.toString(), null, value); + } + /********************************************************************* + * Fire an event to any registered listeners. The source of this + * event will be this class.

    + * + * @param source that initiated the event + * @param key is a name of the fired event + * @param value is a value associated with this event + ********************************************************************/ + public void fire (Object source, String key, Object value) { + if (log.isDebugEnabled()) + logDebug (source, key, value); + support.firePropertyChange + (new PropertyChangeEvent (source, key.toString(), null, value)); + } + + /********************************************************************* + * Register listeners. + ********************************************************************/ public void addPropertyChangeListener (PropertyChangeListener l) { if (support != null) support.addPropertyChangeListener(l); } + /********************************************************************* + * Unregister listeners. + ********************************************************************/ public void removePropertyChangeListener (PropertyChangeListener l) { if (support != null) support.removePropertyChangeListener(l); } + /********************************************************************* + * Log a debug message. + ********************************************************************/ + protected void logDebug (Object source, String key, Object value) { + + StringBuffer buf = new StringBuffer (100); + if (source != null) { + buf.append ("["); + if (source instanceof DashboardPanel) + buf.append ( ((DashboardPanel)source).getName() ); + else + buf.append (source.getClass().getName()); + buf.append ("] "); + } + buf.append (key); + buf.append (": "); + if (value != null) + buf.append (value.toString()); + + log.debug (buf); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/26 08:05:18 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java 2005/10/27 08:55:48 1.5 @@ -50,8 +50,6 @@ import java.awt.event.MouseListener; import java.awt.event.MouseAdapter; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; import java.util.Map; import java.util.HashMap; import java.util.HashSet; @@ -99,12 +97,6 @@ + " by selecting first a data type, then right-click gives you menu."; /********************************************************************* - * propertyChange() - ********************************************************************/ - public void propertyChange (PropertyChangeEvent e) { - } - - /********************************************************************* * Default constructor. ********************************************************************/ public RegistrationPanel() { @@ -120,7 +112,7 @@ if (propertyChannel.containsKey (DP_REGISTRY_MODEL)) { registryModel = (RegistryModel)propertyChannel.get (DP_REGISTRY_MODEL); } else { - registryModel = new RegistryModel (support); + registryModel = new RegistryModel(); propertyChannel.put (DP_REGISTRY_MODEL, registryModel); } registryModel.setPropertyChannel (propertyChannel); @@ -185,7 +177,7 @@ DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, console, - support, + propertyChannel, new CustomDataTypesTree (registryModel, console)); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); @@ -225,7 +217,7 @@ } /************************************************************************** - * Panel to register a data type. + * Panel to register a service. **************************************************************************/ protected JPanel getServiceRegistration() { @@ -235,7 +227,7 @@ } /************************************************************************** - * Panel to register a data type. + * Panel to register a namespace. **************************************************************************/ protected JPanel getNamespaceRegistration() { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/26 08:05:18 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/27 08:55:48 1.8 @@ -52,14 +52,6 @@ super(); } - /********************************************************************* - * Usual constructor that shares support for property changes with - * its creator. - ********************************************************************/ - public RegistryModel (PropertyChangeSupport support) { - super (support); - } - /************************************************************************** * Return an endpoint (a stringified URL) of a default Moby * registry. =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/27 04:15:23 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/10/27 08:55:48 1.13 @@ -48,8 +48,6 @@ import java.awt.event.MouseListener; import java.awt.event.MouseAdapter; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; import java.util.Map; import java.util.HashMap; import java.util.HashSet; @@ -82,16 +80,6 @@ CommonConsole console; /********************************************************************* - * propertyChange() - ********************************************************************/ - public void propertyChange (PropertyChangeEvent e) { -// String prop = e.getPropertyName(); -// String newVal = (String)e.getNewValue(); -// if (newVal == null) return; // no interest in non-defined new values -// if (prop == null) return; // no interest in non-specific changes - } - - /********************************************************************* * Default constructor. ********************************************************************/ public RegistryPanel() { @@ -107,7 +95,7 @@ if (propertyChannel.containsKey (DP_REGISTRY_MODEL)) { registryModel = (RegistryModel)propertyChannel.get (DP_REGISTRY_MODEL); } else { - registryModel = new RegistryModel (support); + registryModel = new RegistryModel(); propertyChannel.put (DP_REGISTRY_MODEL, registryModel); } registryModel.setPropertyChannel (propertyChannel); @@ -134,7 +122,7 @@ NamespacesTree namespacesTree = new NamespacesTree(); DataTypesBoard dataTypesBoard = new DataTypesBoard (registryModel, console, - support); + propertyChannel); dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME); JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/ConsolePanel.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/EventGeneratorPanel.java,v: No such file or directory From gss at pub.open-bio.org Thu Oct 27 22:20:41 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 27 Oct 2005 18:20:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272220.j9RMKfE5010220@pub.open-bio.org> gss Thu Oct 27 18:20:41 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv10193/src/org/semanticmoby/graph Added Files: MOBYResourceSet.java MOBYResource.java Removed Files: MOBYService.java MOBYServiceSet.java Log Message: Changed Service to Resource s-moby/ref-impl/core/src/org/semanticmoby/graph MOBYResourceSet.java,NONE,1.1 MOBYResource.java,1.2,1.3 MOBYService.java,1.2,NONE MOBYServiceSet.java,1.2,NONE =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/MOBYResource.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/MOBYResource.java 2005/09/14 22:06:10 1.2 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/MOBYResource.java 2005/10/27 22:20:41 1.3 @@ -1,30 +1,263 @@ package org.semanticmoby.graph; -import org.semanticmoby.graph.*; - import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; + +import org.semanticmoby.tools.Util; + +import org.semanticmoby.vocabulary.MOBY; + +import java.io.*; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + + +/** + * This class represents a resource that provides a + * resource in MOBY. + */ +public class MOBYResource extends MOBYGraphNode { + + /** + * The name of the provider; stored in MOBY.name property + */ + private Statement nameStmt; + + /** + * A one line description of the provider; stored in the + * MOBY.oneLineDescription property + */ + private Statement oneLineDescriptionStmt; + + /** + * A URI at which more information can be retrieved about the + * provider; stored in the MOBY.moreInfoURI property + */ + private Statement aboutURIStmt; + + /** + * The MOBYGraphNode objects that this Resource operates on (instances of + * either MOBYCollection or MOBYGraph), each keyed by the statement that + * links this resource's URI to it via a hasMapping property + */ + private Map operatesOnGraphStmts = new HashMap(); + + /** + * Constructor for creating a MOBYResource API object from scratch, given + * a model, URI, name, one line description, and about URI for the resource. + * Since the RDF statements that the resource represents don't yet exist, it + * creates and adds them to the model. + * @param model the underlying Jena model to add the statements to + * @param uri the URI of the resource + * @param name a name for the resource; stored in the moby:name property + * @param oneLineDescription a one line description for the resource; + * stored in the moby:oneLineDescription property + */ + public MOBYResource(Model jenaModel, String uri, String name, + String oneLineDescription, String aboutURI) { + super(jenaModel, + jenaModel.createStatement(jenaModel.createResource(uri), + RDF.type, MOBY.Resource)); + + // Save the literal properties by creating the corresponding + // statements and adding them to the model + // + jenaModel.add(nameStmt = + jenaModel.createStatement(getResource(), MOBY.name, name)); + + jenaModel.add(oneLineDescriptionStmt = + jenaModel.createStatement(getResource(), + MOBY.oneLineDescription, + oneLineDescription)); + + jenaModel.add(aboutURIStmt = + jenaModel.createStatement(getResource(), MOBY.aboutURI, + aboutURI)); + } + + + /** + * Constructor for creating a MOBYResource API object from scratch, given + * a URI, name, and one line description for the resource. The method + * first creates a default model using Util.newJenaModel(), and since + * the RDF statements that the resource represents don't yet exist, it + * then creates and adds them to the model. + * @param uri the URI of the resource + * @param name a name for the resource; stored in the moby:name property + * @param oneLineDescription a one line description for the resource; + * stored in the moby:oneLineDescription property + */ + public MOBYResource(String uri, String name, String oneLineDescription, + String aboutURI) { + this(Util.newJenaModel(), uri, name, oneLineDescription, aboutURI); + } + + + /** + * Constructor for creating an instance from existing RDF statements, as + * is the case when parsing an existing model. + */ + public MOBYResource(Model jenaModel, Statement definingStmt, + Statement nameStmt, Statement oneLineDescriptionStmt, + Statement aboutURIStmt, Map operatesOnGraphs) { + super(jenaModel, definingStmt); + this.nameStmt = nameStmt; + this.oneLineDescriptionStmt = oneLineDescriptionStmt; + this.aboutURIStmt = aboutURIStmt; + + for (Iterator it = operatesOnGraphs.keySet().iterator(); it.hasNext();) { + + Statement operatesOnStmt = (Statement) it.next(); + MOBYGraphNode node = + (MOBYGraphNode) operatesOnGraphs.get(operatesOnStmt); + addOperatesOnGraph(operatesOnStmt, node); + } + } + + /** + * Adds a new operatesOn subgraph and an operatesOn statement + */ + public void addOperatesOnGraph(MOBYGraphNode newGraph) { + + // Create and add a statement moby:operatesOn + Statement operatesOnStmt = + jenaModel.createStatement(getResource(), MOBY.operatesOn, + newGraph.getResource()); + addOperatesOnGraph(operatesOnStmt, newGraph); + } + + + /** + * Adds a new operatesOn Graph, linking it to the defining statement's + * resource with an operatesOn property + */ + public void addOperatesOnGraph(Statement operatesOnStmt, + MOBYGraphNode newGraph) { + + jenaModel.add(operatesOnStmt); + operatesOnGraphStmts.put(newGraph, operatesOnStmt); + } + + + /** + * Removes the graph node and its RDF statements from the underlying + * Jena model + */ + public void removeOperatesOnGraph(MOBYGraphNode node) { + + Statement stmt = (Statement) operatesOnGraphStmts.get(node); + + if (stmt != null) { + + jenaModel.remove(stmt); + } + + node.removeStatements(); + } + + + public Iterator getOperatesOn() { + + return operatesOnGraphStmts.keySet().iterator(); + } + + + /** + * Removes the statements representing this resource, and calls + * removeStatements on all Graph objects related to it through + * operatesOn properties + */ + public void removeStatements() { + + // Remove the defining statement + removeDefiningStatement(); + + // Remove the statements asserting the name and + // oneLineDescription properties + if (nameStmt != null) { + + jenaModel.remove(nameStmt); + nameStmt = null; + } + + if (oneLineDescriptionStmt != null) { + + jenaModel.remove(oneLineDescriptionStmt); + oneLineDescriptionStmt = null; + } + + if (aboutURIStmt != null) { + + jenaModel.remove(aboutURIStmt); + aboutURIStmt = null; + } + + // Remove each of the operatesOn statements, and have each + // MOBYGraphNode object remove its statements + if (operatesOnGraphStmts != null) { + + for (Iterator it = operatesOnGraphStmts.keySet().iterator(); + it.hasNext();) { + + MOBYGraphNode gnode = (MOBYGraphNode) it.next(); + Statement s = (Statement) operatesOnGraphStmts.get(gnode); + operatesOnGraphStmts.remove(s); + jenaModel.remove(s); + gnode.removeStatements(); + } + + operatesOnGraphStmts = null; + } + } + + + /** + * Return a descriptive name for the provider. + */ + public String getName() { + + return (nameStmt == null) ? "" : nameStmt.getObject().toString(); + } + + + /** + * Return a short (one line) description for the provider. + */ + public String getOneLineDescription() { + + return (oneLineDescriptionStmt == null) ? "" + : oneLineDescriptionStmt.getObject() + .toString(); + } + + + /** + * Return a URI that can be accessed to obtain more information + * about the provider. + */ + public String getAboutURI() { + + return (aboutURIStmt == null) ? "" : aboutURIStmt.getObject().toString(); + } + + + /** + * Serialize the underlying model as RDF/XML to the given output stream + */ + public void serialize(OutputStream out) { + + jenaModel.write(out); + } + + + /** + * Serialize the underlying model as N3 to the given output stream + */ + public void serializeAsN3(OutputStream out) { -public class MOBYResource extends MOBYPropertyValue -{ - private Resource resourceValue; - - public MOBYResource(Resource resourceValue) { - this.resourceValue = resourceValue; - } - - public String getResourceURI() { - return resourceValue.getURI(); - } - - public boolean isLiteral() { - return false; - } - - public boolean isResource() { - return true; - } - - public boolean isBlank() { - return resourceValue.isAnon(); + jenaModel.write(out, "N3"); } -} \ No newline at end of file +} rcsdiff: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYService.java,v: No such file or directory rcsdiff: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYServiceSet.java,v: No such file or directory From gss at pub.open-bio.org Thu Oct 27 22:22:09 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 27 Oct 2005 18:22:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272222.j9RMM9Ne010284@pub.open-bio.org> gss Thu Oct 27 18:22:09 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv10259/src/org/semanticmoby/parser Modified Files: Parser.java Log Message: Refer to Resource rather than Service s-moby/ref-impl/core/src/org/semanticmoby/parser Parser.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/10/09 01:33:06 1.6 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/10/27 22:22:08 1.7 @@ -48,7 +48,7 @@ */ public Parser(Model model) { - StmtIterator it = model.listStatements(null, RDF.type, MOBY.Service); + StmtIterator it = model.listStatements(null, RDF.type, MOBY.Resource); while (it.hasNext()) { @@ -157,31 +157,31 @@ /** - * Parse a MOBYService from the model. If the model contains multiple - * services, only one will be returned (at random), so if the model is - * expected to contain multiple services, then call parseServices() instead to get all the providers in a + * Parse a MOBYResource from the model. If the model contains multiple + * resources, only one will be returned (at random), so if the model is + * expected to contain multiple resources, then call parseResources() instead to get all the providers in a * MOBYCollection. */ - public MOBYService parseService() throws NonCanonicalException { + public MOBYResource parseResource() throws NonCanonicalException { - List services = parseServices(); + List resources = parseResources(); - if (services.size() == 0) { + if (resources.size() == 0) { return null; } else { - return (MOBYService) services.iterator().next(); + return (MOBYResource) resources.iterator().next(); } } /** - * Parse and return an list of MOBYService objects + * Parse and return an list of MOBYResource objects */ - public List parseServices() throws NonCanonicalException { + public List parseResources() throws NonCanonicalException { - ArrayList services = new ArrayList(); + ArrayList resources = new ArrayList(); Iterator it = subModels.iterator(); @@ -189,24 +189,24 @@ Model model = (Model) it.next(); StmtIterator it2 = - model.listStatements(null, RDF.type, MOBY.Service); + model.listStatements(null, RDF.type, MOBY.Resource); if (it2 != null) { Statement stmt = it2.nextStatement(); - services.add(parseService(stmt)); + resources.add(parseResource(stmt)); } } - return services; + return resources; } /** - * Parse a service starting from the given resource (i.e. a resource that - * is the subject of an rdf:type statement with object of moby:Service) + * Parse a resource starting from the given resource (i.e. a resource that + * is the subject of an rdf:type statement with object of moby:Resource) */ - public MOBYService parseService(Statement typeStmt) + public MOBYResource parseResource(Statement typeStmt) throws NonCanonicalException { Resource headResource = typeStmt.getSubject(); @@ -222,7 +222,7 @@ Statement aboutURIStmt = model.getProperty(headResource, MOBY.aboutURI); - // A service can have multiple operatesOn properties, each of + // A resource can have multiple operatesOn properties, each of // which leads to a subgraph. Parse each of these subgraphs. // Map operatesOn = new HashMap(); @@ -237,10 +237,10 @@ operatesOn.put(operatesOnStmt, parseOperatesOn(r)); } - // Create and return a new Service object using the service URI, name, + // Create and return a new Resource object using the resource URI, name, // oneLineDescription, aboutURI, and collection of operatesOn subgraphs // - return new MOBYService(model, typeStmt, nameStmt, + return new MOBYResource(model, typeStmt, nameStmt, oneLineDescriptionStmt, aboutURIStmt, operatesOn); } From gss at pub.open-bio.org Thu Oct 27 22:22:09 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 27 Oct 2005 18:22:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272222.j9RMM9M9010307@pub.open-bio.org> gss Thu Oct 27 18:22:09 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv10259/src/org/semanticmoby/servlet Modified Files: AbstractMobyServlet.java package.html Log Message: Refer to Resource rather than Service s-moby/ref-impl/core/src/org/semanticmoby/servlet AbstractMobyServlet.java,1.3,1.4 package.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2005/10/09 01:33:06 1.3 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2005/10/27 22:22:09 1.4 @@ -67,7 +67,7 @@ * in, that serves as "input" to the provider. * @return a graph containing the work product of the provider. */ - protected abstract void handleRequest(MOBYService requestGraph); + protected abstract void handleRequest(MOBYResource requestGraph); /** @@ -110,7 +110,7 @@ /** - * By MOBY convention, an HTTP POST equates to a request for the service + * By MOBY convention, an HTTP POST equates to a request for the resource * provided by a provider. */ public void doPost(HttpServletRequest request, HttpServletResponse response) @@ -127,16 +127,16 @@ ParamReader.getParameter(MOBY.GRAPH_PARAMETER_NAME, request); Parser parser = Parser.forString(graphString, Parser.LANGUAGE_RDF_XML); - MOBYService service = parser.parseService(); + MOBYResource resource = parser.parseResource(); // Invoke the abstract handleRequest() method in order for the // provider servlet to do whatever it does to the graph. // - handleRequest(service); + handleRequest(resource); // Send the graph back in response // - service.serialize(out); + resource.serialize(out); } catch (Throwable t) { t.printStackTrace(); =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/package.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/package.html 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/servlet/package.html 2005/10/27 22:22:09 1.2 @@ -1,5 +1,5 @@ -Classes to facilitate building Semantic MOBY services using Java servlets. +Classes to facilitate building Semantic MOBY resources using Java servlets. - \ No newline at end of file + From gss at pub.open-bio.org Thu Oct 27 22:22:09 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 27 Oct 2005 18:22:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510272222.j9RMM9kW010327@pub.open-bio.org> gss Thu Oct 27 18:22:09 EDT 2005 Update of /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv10259/src/org/semanticmoby/vocabulary Modified Files: MOBY.java Log Message: Refer to Resource rather than Service s-moby/ref-impl/core/src/org/semanticmoby/vocabulary MOBY.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2005/10/09 01:33:07 1.3 +++ /home/repository/moby/s-moby/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2005/10/27 22:22:09 1.4 @@ -3,7 +3,10 @@ import com.hp.hpl.jena.graph.*; import com.hp.hpl.jena.rdf.model.*; - +/** + * A utility class with static instance variables for helping with ontology + * related tasks. + */ public class MOBY extends VocabularyDescription { public final static String IF_MODIFIED_HEADER = "If-Modified-Since"; @@ -16,11 +19,11 @@ * value is a serialized RDF/XML graph. */ public final static String GRAPH_PARAMETER_NAME = "graph"; - public static final Resource Service = resource(getURI(), "Service"); - public static final Resource Graph = resource(getURI(), "Graph"); - public static final Resource Subject = resource(getURI(), "Subject"); - public static final Resource Object = resource(getURI(), "Object"); - public static final Property name = property(getURI(), "name"); + public static final Resource Resource = resource(getURI(), "Resource"); + public static final Resource Graph = resource(getURI(), "Graph"); + public static final Resource Subject = resource(getURI(), "Subject"); + public static final Resource Object = resource(getURI(), "Object"); + public static final Property name = property(getURI(), "name"); public static final Property oneLineDescription = property(getURI(), "oneLineDescription"); public static final Property aboutURI = From senger at pub.open-bio.org Fri Oct 28 07:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8l6012478@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/client Modified Files: CentralDigestImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestImpl.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/27 04:15:23 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/10/28 07:58:08 1.9 @@ -385,9 +385,16 @@ public void fireEvent (int type, Object message, Object details) { NotificationEvent event = null; if (details == null) - event = new NotificationEvent (this, type, message.toString()); + event = new NotificationEvent (this, type, message); else - event = new NotificationEvent (this, type, message.toString(), details); + event = new NotificationEvent (this, type, message, details); + fireEvent (event); + } + + /********************************************************************* + * + ********************************************************************/ + public void fireEvent (NotificationEvent event) { if (listeners != null) { synchronized (listeners) { for (int i = 0; i < listeners.size(); i++) { From senger at pub.open-bio.org Fri Oct 28 07:58:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w9fJ012585@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/shared/event Modified Files: NotificationEvent.java Notifier.java Log Message: moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,1.3,1.4 Notifier.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/27 04:15:23 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/28 07:58:08 1.4 @@ -17,13 +17,18 @@ * registry (how many entities to read, and which one was just * read).

    * - * Each notification event points to its source (this is inherited - * from a usual Java's EventObject). Additionally, it has its type (an - * integer value, preferably taken from a list defined in interface - * {@link org.biomoby.shared.event.Notifier}), a message (whose format - * may be determined by the notification type), and optionally an - * object with more details (again, its presence or absence may depend - * on the notification type).

    + * Each notification event points to its source - this is inherited + * from a usual Java EventObject. Sometimes, however, the semantics of + * the source may change to indicate not the event producer but the + * event initiator (an instance that caused that something had + * happened that triggered later sending an event).

    + * + * Additionally, it has its type (an integer value, preferably taken + * from a list defined in interface {@link + * org.biomoby.shared.event.Notifier}), a message (whose format may be + * determined by the notification type), and optionally an object with + * more details (again, its presence or absence may depend on the + * notification type).

    * * @author Martin Senger * @version $Id$ @@ -33,7 +38,7 @@ extends EventObject { private int type; - private String message; + private Object message; private Object details; /********************************************************************* @@ -47,7 +52,7 @@ * A usual constructor, setting notification type and a message. ********************************************************************/ public NotificationEvent (Object source, - int type, String message) { + int type, Object message) { this (source); this.type = type; this.message = (message == null ? "" : message); @@ -58,8 +63,7 @@ * details. ********************************************************************/ public NotificationEvent (Object source, - int type, String message, - Object details) { + int type, Object message, Object details) { this (source, type, message); this.details = details; } @@ -74,7 +78,7 @@ /********************************************************************* * Return a message associated with this notification event. ********************************************************************/ - public String getMessage() { + public Object getMessage() { return message; } @@ -99,8 +103,9 @@ StringBuffer buf = new StringBuffer (100); buf.append ("["); buf.append (typeStr); - if (UUtils.notEmpty (message)) - buf.append (", Message=" + message); + if (message != null && + ( message instanceof String || message instanceof Integer || message instanceof Boolean )) + buf.append (" " + message); if (details != null) buf.append (", Details=" + details.getClass().getName()); buf.append ("]"); @@ -108,34 +113,35 @@ } static final String[] typeTexts = new String[] { - "data-type-start", - "data-type-count", - "data-type-loading", - "data-type-loaded", - "data-type-end", - "service-type-start", - "service-type-count", - "service-type-loading", - "service-type-loaded", - "service-type-end", - "namespace-start", - "namespace-count", - "namespace-loading", - "namespace-loaded", - "namespace-end", - "authority-start", - "authority-count", - "authority-loading", - "authority-loaded", - "authority-end", - "data-type-reset", - "service-type-reset", - "namespace-reset", - "authority-reset", - "data-type-cancel", - "service-type-cancel", - "namespace-cancel", - "authority-cancel" + "data-type-start", // [ 0] + "data-type-count", // [ 1] + "data-type-loading", // [ 2] + "data-type-loaded", // [ 3] + "data-type-end", // [ 4] + "service-type-start", // [ 5] + "service-type-count", // [ 6] + "service-type-loading", // [ 7] + "service-type-loaded", // [ 8] + "service-type-end", // [ 9] + "namespace-start", // [10] + "namespace-count", // [11] + "namespace-loading", // [12] + "namespace-loaded", // [13] + "namespace-end", // [14] + "authority-start", // [15] + "authority-count", // [16] + "authority-loading", // [17] + "authority-loaded", // [18] + "authority-end", // [19] + "data-type-reset", // [20] + "service-type-reset", // [21] + "namespace-reset", // [22] + "authority-reset", // [23] + "data-type-cancel", // [24] + "service-type-cancel", // [25] + "namespace-cancel", // [26] + "authority-cancel", // [27] + "data-type-updated" // [28] }; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/22 01:38:04 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/28 07:58:08 1.4 @@ -50,6 +50,7 @@ static final int NAMESPACES_CANCELLED = 26; static final int AUTHORITIES_CANCELLED = 27; + static final int DATA_TYPES_UPDATED = 28; static final int SIGNAL_CANCEL_DATA_TYPES = 1; @@ -117,4 +118,9 @@ ********************************************************************/ void fireEvent (int type, Object message, Object details); + /********************************************************************* + * + ********************************************************************/ + void fireEvent (NotificationEvent event); + } From senger at pub.open-bio.org Fri Oct 28 07:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8GI012555@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/shared Modified Files: MobyDataType.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyDataType.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/10/25 09:02:08 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/10/28 07:58:08 1.11 @@ -8,7 +8,7 @@ package org.biomoby.shared; import org.tulsoft.shared.UUtils; - +import java.util.Comparator; /** * A container representing a data type used in the Moby registry (in @@ -307,4 +307,17 @@ comment = (value == null ? "" : value); } + /************************************************************************** + * Create a comparator for case-insensitive sorting of data types + * by their authorities. + *************************************************************************/ + public static Comparator getAuthorityComparator() { + return new Comparator() { + public int compare (Object o1, Object o2) { + String a1 = ((MobyDataType)o1).getAuthority(); + String a2 = ((MobyDataType)o2).getAuthority(); + return (a1).compareToIgnoreCase ((String)a2); + } + }; + } } From senger at pub.open-bio.org Fri Oct 28 07:58:54 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7wsWd012629@pub.open-bio.org> senger Fri Oct 28 03:58:53 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv12614/src/config Added Files: log4j.properties Log Message: moby-live/Java/src/config log4j.properties,NONE,1.1 From senger at pub.open-bio.org Fri Oct 28 07:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8Po012536@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/service/dashboard Modified Files: AbstractModel.java CommonBoard.java CommonTree.java Dashboard.java DashboardPanel.java DashboardProperties.java DataTypesBoard.java DataTypesTree.java NOTES RegistryModel.java Added Files: GraphColours.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard GraphColours.java,NONE,1.1 AbstractModel.java,1.2,1.3 CommonBoard.java,1.2,1.3 CommonTree.java,1.7,1.8 Dashboard.java,1.8,1.9 DashboardPanel.java,1.5,1.6 DashboardProperties.java,1.7,1.8 DataTypesBoard.java,1.3,1.4 DataTypesTree.java,1.4,1.5 NOTES,1.11,1.12 RegistryModel.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/10/27 08:55:48 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractModel.java 2005/10/28 07:58:08 1.3 @@ -8,36 +8,12 @@ package org.biomoby.service.dashboard; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeSupport; - /** * A common super-class for all Dashboard models. A model is a worker * for a panel: a panel displays what its model provides.

    * * This abstract parent helps to deal with listening and fireing - * property changes. Here is how it works generally:

    - * - *

      - * - *
    • Each model gets (from its panel) an instance of a - * PropertyChangeSupport class which gives it a list of - * registered listeners, so a model can fire messages to them. For - * example, a RegistryPanel may fire a message that a new list of data - * types is available. Or typically a model will send a hear-beat - * messages if it is working on a long-run job (this messages will be - * intercept by a StatusBar, for example).

      - * - * Note, however, that this shared PropertyChangeSupport - * object knows only about a panel (it was created for a panel, not - * for a model) so a model cannot use it to add its own listeners - * (they would become listeners of a panel, not a model). In the - * practise, this should not be a problem I guess.

      - * - *

    • Each model is also a listener of property changes.

      - * - *

    + * property changes via a property channel.

    * * @author Martin Senger * @version $Id$ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/27 08:55:48 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonBoard.java 2005/10/28 07:58:08 1.3 @@ -42,6 +42,9 @@ extends JPanel implements NotificationListener { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + protected RegistryModel model; protected PropertyChannel channel; @@ -69,7 +72,7 @@ * Update the underlying tree. ********************************************************************/ public void updateTree (int howSorted) { - tree.update (howSorted); + tree.update (howSorted, null); } /********************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/26 08:05:18 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/10/28 07:58:08 1.8 @@ -166,7 +166,7 @@ * Get data from a registry model and update the tree. Will be * overwritten by subclass. ********************************************************************/ - public void update (int howSorted) { + public void update (int howSorted, Object data) { } /********************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/27 08:55:48 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/10/28 07:58:08 1.9 @@ -26,6 +26,7 @@ import java.awt.GridBagLayout; import java.awt.Font; +import java.awt.Color; import java.awt.Dimension; import java.beans.PropertyChangeListener; @@ -50,10 +51,14 @@ public class Dashboard implements DashboardPanel, ChangeListener { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + private JComponent dashboard; private DashboardHeader header; public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; + protected Color bgcolor; protected DashboardPanel[] panels; protected PropertyChannel propertyChannel; protected static Properties dashboardProperties; @@ -75,8 +80,8 @@ dashboardProperties.load (resourceURL.openStream()); } } catch (Exception e) { - System.err.println ("WARNING: Cannot find/open/read dasboard property file " + - DASHBOARD_PROPERTIES_FILE + ": " + e.toString()); + log.warn ("Cannot find/open/read dasboard property file " + + DASHBOARD_PROPERTIES_FILE + ": " + e.toString()); } } @@ -181,8 +186,12 @@ ProgressView.monitor.show ("Welcome to Biomoby Dashboard"); } + // create itself JPanel p = new JPanel (new GridBagLayout(), true); + bgcolor = GraphColours.getColour ((String)dashboardProperties.get (DP_BGCOLOR), + p.getBackground()); + p.setBackground (bgcolor); header = getHeader(); tabbedPane = new JTabbedPane(); @@ -222,6 +231,7 @@ class DashboardHeader extends JPanel { public DashboardHeader (Properties props) { super (new GridBagLayout()); + setBackground (bgcolor); JLabel mainTitle = getTitle(); JLabel mainIcon = new JLabel ("", =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/10/27 08:55:48 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/10/28 07:58:08 1.6 @@ -12,18 +12,11 @@ import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; -import java.beans.PropertyChangeListener; /** * An interface that must be implemented by each panel that wants to * sit on a dashboard.

    * - * WORK IN PROGRESS

    - * - * All classes that implements this interface (i.e. all dashboard - * panels) are also PropertyChangeListener. It allows them to listen - * to changes happening in other panels.

    - * * @author Martin Senger * @version $Id$ */ @@ -70,20 +63,4 @@ **************************************************************************/ Icon getIcon(); -// /************************************************************************** -// * Add a PropertyChangeListener to the listener list of a -// * panel. All listeners will be notified if this panel changes -// * some property.

    -// * -// * The panel should document what properties can fire - but at the -// * moment it is not part of its interface.

    -// * -// **************************************************************************/ -// void addPropertyChangeListener (PropertyChangeListener listener); - -// /************************************************************************** -// * Remove a PropertyChangeListener. -// **************************************************************************/ -// void removePropertyChangeListener(PropertyChangeListener listener); - } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/26 08:05:18 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/10/28 07:58:08 1.8 @@ -13,9 +13,6 @@ import javax.swing.Icon; import javax.swing.JComponent; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; - /** * A list of names of most/all recognized properties that can be fired * by dashboard panels, and a list of names of Java properties that @@ -71,6 +68,13 @@ * recommended) or a relative path whose beginning can be found * somewhere on the CLASSPATH. */ + static final String DP_ICON = "dashboard.icon"; + /** A property name. Its value contains a color name used to paint + * main dashboard background. The name can be a color name, or a + * number in various format (see GraphColours for + * details). + */ + static final String DP_BGCOLOR = "dashboard.bgcolor"; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/27 08:55:48 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesBoard.java 2005/10/28 07:58:08 1.4 @@ -8,6 +8,7 @@ package org.biomoby.service.dashboard; +import org.biomoby.shared.MobyDataType; import org.biomoby.shared.event.NotificationEvent; import org.biomoby.shared.event.Notifier; import org.tulsoft.shared.UUtils; @@ -27,6 +28,9 @@ public class DataTypesBoard extends CommonBoard { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + /********************************************************************* * Constructor.

    * @@ -64,13 +68,15 @@ * ********************************************************************/ public void notified (NotificationEvent event) { + Object initiator; switch (event.getType()) { case Notifier.DATA_TYPES_START: createProgressBar (Notifier.SIGNAL_CANCEL_DATA_TYPES); insertProgressBar(); break; case Notifier.DATA_TYPES_COUNT: - calibrateProgressBar (UUtils.toInt (event.getMessage())); + if (event.getMessage() instanceof Integer) + calibrateProgressBar ( ((Integer)event.getMessage()).intValue() ); break; case Notifier.DATA_TYPE_LOADING: channel.fire (DashboardProperties.DP_STATUS_MSG, event.getMessage()); @@ -81,9 +87,21 @@ case Notifier.DATA_TYPES_END: case Notifier.DATA_TYPES_CANCELLED: case Notifier.DATA_TYPES_RESET: - channel.fire (DashboardProperties.DP_STATUS_MSG, "Done"); + initiator = event.getSource(); + if (tree == initiator) + channel.fire (DashboardProperties.DP_STATUS_MSG, "Done"); removeProgressBar(); break; + case Notifier.DATA_TYPES_UPDATED: + initiator = event.getSource(); + if (tree != initiator) { + // someone else (ot this instance) initiated request + // for updating data types - so we need to update our + // own tree - using for that data types included in + // this event + tree.update (-1, (MobyDataType[])event.getDetails()); + } + break; } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/25 09:02:07 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DataTypesTree.java 2005/10/28 07:58:08 1.5 @@ -42,6 +42,9 @@ public class DataTypesTree extends CommonTree { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + // action commands for popup menu items protected final static String AC_NSORT = "ac-nsort"; protected final static String AC_ASORT = "ac-asort"; @@ -87,14 +90,14 @@ popup.add (createMenuItem (new AbstractAction ("Sort by names") { public void actionPerformed (ActionEvent e) { - update (lastSorted = SORTED_BY_NAME); + update (lastSorted = SORTED_BY_NAME, null); deprecatedBox.setEnabled (true); } }, AC_NSORT)); popup.add (createMenuItem (new AbstractAction ("Sort by authorities") { public void actionPerformed (ActionEvent e) { - update (lastSorted = SORTED_BY_AUTHORITY); + update (lastSorted = SORTED_BY_AUTHORITY, null); deprecatedBox.setEnabled (false); } }, AC_ASORT)); @@ -105,7 +108,7 @@ showBox.addItemListener (new ItemListener() { public void itemStateChanged (ItemEvent e) { showMembers = (e.getStateChange() == ItemEvent.SELECTED); - update (lastSorted); + update (lastSorted, null); } }); popup.add (showBox); @@ -116,7 +119,7 @@ public void itemStateChanged (ItemEvent e) { showBadGuys = (e.getStateChange() == ItemEvent.SELECTED); if (showBadGuys) - update (lastSorted); + update (lastSorted, null); else removeBadGuys(); } @@ -125,20 +128,35 @@ } /********************************************************************* - * Get data from a registry model and update the tree. + * Get data (usually from a registry model, but if not null, take + * them from 'newData') and update the tree. ********************************************************************/ - public void update (int howSorted) { - setEnabledPopup (false); + public void update (int howSorted, Object newData) { + if (howSorted < 0) howSorted = lastSorted; + setEnabledPopup (false); updateException = null; + final Object source = this; final int sorted = howSorted; + final MobyDataType[] newDataTypes = + (newData == null ? null : (MobyDataType[])newData); + final SwingWorker worker = new SwingWorker() { public Object construct() { try { + // get data types (unless you already have them) + if (newDataTypes == null) + dataTypes = registryModel.getDataTypes (source); + else + dataTypes = newDataTypes; + + // ...and sort them accordingly if (sorted == SORTED_BY_AUTHORITY) - dataTypes = registryModel.getDataTypesByAuthority(); + java.util.Arrays.sort + (dataTypes, MobyDataType.getAuthorityComparator()); else - dataTypes = registryModel.getDataTypesByNames(); + java.util.Arrays.sort (dataTypes); + } catch (MobyException e) { updateException = e; } @@ -277,7 +295,7 @@ * updating) cache. ********************************************************************/ protected void reload() { - update (lastSorted); + update (lastSorted, null); } /********************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/26 08:05:18 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/10/28 07:58:08 1.12 @@ -1,40 +1,14 @@ -? logging (LogPanel and/or usual logging to a file?) -* communication with StatusBar (incl. progress bar, cancel button) -* disabling things during a long-time operation -* general Console panel (save button; various renderes?) -* graphics to trees - ---- -To put this somewhere (a small "Memory panel" that can be add -anywhere in time of debugging...): - -The heap is the area in memory in which objects are created. - - // Get current size of heap in bytes - long heapSize = Runtime.getRuntime().totalMemory(); - - // Get maximum size of heap in bytes. The heap cannot grow beyond this size. - // Any attempt will result in an OutOfMemoryException. - long heapMaxSize = Runtime.getRuntime().maxMemory(); - - // Get amount of free memory within the heap in bytes. This size will increase - // after garbage collection and decrease as new objects are created. - long heapFreeSize = Runtime.getRuntime().freeMemory(); - ---- - TODO generally: --------------- +? some of the notification stuff can inherir from propertychange stuff + * notice that the dasboard is used the first time and offer to create a list of wanted panels (some of them are suggested as default) * notice that user does not use cache (and that he did not select "do not check it at startup") and tell him "do you want a cache?" -* BUG: not sure why so many (repeated) changes from the actionlistener -in JFieldTextWithHistory - ? select a part of an error message and highlight it in red? ? HELP (in a Dashboard Menu) @@ -43,27 +17,13 @@ - credits - add dynamically a URL from dashboard.properties... -TODO with views: ----------------- * change onMethods() to be protected or even private... -* add a progress bar to the status bar (on the right) - - add also a cancel buton there - - do not allow more than one progressbar-aware action in the same time - file:///c/Development/java-tutorial/uiswing/components/progress.html - -? small icons to buttons -? use FileSystemView in file choosers -? alltools2: - - combo box history is not updated if exit happened while focus is still in the text field - -? configure dashboard from menu: - * configure dashbard (add/remove dynamically panels) - * configure user preferences +? improve API javadoc of all these Central*Impl +? start to work on/think of the RDF-based cache TODO for cache: --------------- -* emit log events; use them also in cmdline clients * poor-man update: keep what's there but add what is not there (and perhaps delete what should not be there) - but do not check any age of existing @@ -73,15 +33,13 @@ * remove memory-caching from CentralImpl * graphics by default: yes for datatyeps and no for services -? improve API javadoc of all these Central*Impl -? start to work on/think of the RDF-based cache - General options (available from the menu) --------------- * export/import user preferences * set-up what panels are wanted * language ( => use proper ResourceBundler...) + Registry panel -------------- @@ -114,10 +72,22 @@ - verify registry - browsing in graphs - RDF resources -- Log panel -- Configure a new Dashboard - - Debugging panel (with a Memory Panel embedded; replacing current two pannels) + To put this somewhere (a small "Memory panel" that can be add + anywhere in time of debugging...): + + The heap is the area in memory in which objects are created. + + // Get current size of heap in bytes + long heapSize = Runtime.getRuntime().totalMemory(); + + // Get maximum size of heap in bytes. The heap cannot grow beyond this size. + // Any attempt will result in an OutOfMemoryException. + long heapMaxSize = Runtime.getRuntime().maxMemory(); + + // Get amount of free memory within the heap in bytes. This size will increase + // after garbage collection and decrease as new objects are created. + long heapFreeSize = Runtime.getRuntime().freeMemory(); UNSOLVED (mysteries and not-yet-dones) ======== @@ -130,12 +100,6 @@ - the BuildDataTypeTree is sometimes damaged (after adding a member node); not sure how to reproduce it - ! loading... does not sync correctly with the browser panel - - ! more generally: simplify (or at least document) what kind of notifications - are used (now, it seems to be confusin what has PropertyChannel and what - is registered by 'support') - ! finish all the caching stuff (separate scrap of paper) * After registration, update cache, update list @@ -144,6 +108,14 @@ * Icons: - better icon for AddHAS (with a small star) + ? small icons to buttons + ? graphics to trees + - small icon to the status bar * alltools2: - JTextFieldWithHistory should remember also an empty value ("") + - combo box history is not updated if exit happened while focus is still in the text field + ? use FileSystemView in file choosers + * BUG: not sure why so many (repeated) changes from the actionlistener + in JFieldTextWithHistory + =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/27 08:55:48 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/10/28 07:58:08 1.9 @@ -19,13 +19,8 @@ import org.biomoby.shared.event.NotificationEvent; import org.biomoby.shared.event.NotificationListener; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeSupport; - import java.util.HashSet; import java.util.Hashtable; -import java.util.Comparator; import java.util.regex.Pattern; /** @@ -41,6 +36,9 @@ extends AbstractModel implements Notifier { + private static org.apache.commons.logging.Log log = + org.apache.commons.logging.LogFactory.getLog (RegistryModel.class); + CentralAll worker; boolean useCache = true; Hashtable dataTypesTable; @@ -102,35 +100,18 @@ } /********************************************************************* - * + * Fetch data types (from a cache or from a registry). When done, + * signal that data type are updated. If an initiator is known + * (not null), signal, who asked for data, as well. ********************************************************************/ - public MobyDataType[] getDataTypesByNames() + public synchronized MobyDataType[] getDataTypes (Object initiator) throws MobyException { initWorker(); - fireEvent (DATA_TYPES_RESET, "", null); + if (initiator != null) + fireEvent (initiator, DATA_TYPES_RESET, "", null); MobyDataType[] dataTypes = worker.getDataTypes(); - java.util.Arrays.sort (dataTypes); - return dataTypes; - } - - /********************************************************************* - * - ********************************************************************/ - public MobyDataType[] getDataTypesByAuthority() - throws MobyException { - initWorker(); - fireEvent (DATA_TYPES_RESET, "", null); - MobyDataType[] dataTypes = worker.getDataTypes(); - java.util.Arrays.sort - (dataTypes, - new Comparator() { - public int compare (Object o1, Object o2) { - String a1 = ((MobyDataType)o1).getAuthority(); - String a2 = ((MobyDataType)o2).getAuthority(); - return (a1).compareToIgnoreCase ((String)a2); - } - }); - + if (initiator != null) + fireEvent (initiator, DATA_TYPES_UPDATED, "", dataTypes); return dataTypes; } @@ -142,7 +123,7 @@ if (dataTypeName == null) return null; - MobyDataType[] dataTypes = getDataTypesByNames(); + MobyDataType[] dataTypes = getDataTypes (null); if (dataTypesTable == null) { dataTypesTable = new Hashtable(); @@ -161,7 +142,7 @@ public HashSet find (String searchText) throws MobyException { HashSet found = new HashSet(); - MobyDataType[] dataTypes = getDataTypesByNames(); + MobyDataType[] dataTypes = getDataTypes (null); if (! searchText.startsWith ("(?i)")) searchText = "(?i)" + searchText; Pattern pattern = Pattern.compile (searchText); @@ -233,8 +214,7 @@ initWorker(); ((Notifier)worker).addNotificationListener (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -246,8 +226,7 @@ initWorker(); ((Notifier)worker).addNotificationListeners (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -259,8 +238,7 @@ initWorker(); ((Notifier)worker).removeNotificationListener (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -272,8 +250,7 @@ initWorker(); ((Notifier)worker).removeNotificationListeners (l); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); } } @@ -285,8 +262,7 @@ initWorker(); return ((Notifier)worker).getNotificationListeners(); } catch (MobyException e) { - // TBD with proper logging - System.err.println ("ERROR: " + e); + log.error (e.getMessage()); return new NotificationListener[] {}; } } @@ -307,4 +283,26 @@ ((Notifier)worker).fireEvent (type, message, details); } + /********************************************************************* + * + ********************************************************************/ + public void fireEvent (NotificationEvent event) { + if (worker != null) + ((Notifier)worker).fireEvent (event); + } + + + /********************************************************************* + * + ********************************************************************/ + protected void fireEvent (Object source, + int type, Object message, Object details) { + NotificationEvent event = null; + if (details == null) + event = new NotificationEvent (source, type, message); + else + event = new NotificationEvent (source, type, message, details); + fireEvent (event); + } + } From senger at pub.open-bio.org Fri Oct 28 07:58:08 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 28 Oct 2005 03:58:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200510280758.j9S7w8bW012440@pub.open-bio.org> senger Fri Oct 28 03:58:08 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv12421 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.38,1.39 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/25 09:07:22 1.38 +++ /home/repository/moby/moby-live/Java/build.xml 2005/10/28 07:58:08 1.39 @@ -88,6 +88,10 @@ + + + + @@ -537,8 +541,8 @@ +