From kawas at dev.open-bio.org Thu Feb 1 09:14:12 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 1 Feb 2007 09:14:12 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702011414.l11EECCI010588@dev.open-bio.org> kawas Thu Feb 1 09:14:12 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv10553/Client Modified Files: Central.pm Log Message: typed the soap data to string in the _call sub routine moby-live/Perl/MOBY/Client Central.pm,1.143,1.144 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.143 retrieving revision 1.144 diff -u -r1.143 -r1.144 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/01/30 14:37:44 1.143 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/01 14:14:11 1.144 @@ -238,7 +238,7 @@ else { #print STDERR "executing SOAP call\n"; - my @payload = $connect->call( $method => $param )->paramsall; + my @payload = $connect->call( $method => SOAP::Data->type('string' => $param ) )->paramsall; return @payload; } } @@ -1904,6 +1904,8 @@ sub _parseServices { my ( $self, $Registry, $XML ) = @_; my $Parser = XML::LibXML->new(); + # fix empty string problem + return [] unless $XML; my $doc = $Parser->parse_string($XML); my $Object = $doc->getDocumentElement(); my $Services = $Object->getElementsByTagName("Service"); From kawas at dev.open-bio.org Thu Feb 1 09:14:23 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 1 Feb 2007 09:14:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702011414.l11EENc2010627@dev.open-bio.org> kawas Thu Feb 1 09:14:23 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/SOAP In directory dev.open-bio.org:/tmp/cvs-serv10593/SOAP Log Message: Directory /home/repository/moby/moby-live/Perl/MOBY/SOAP added to the repository moby-live/Perl/MOBY/SOAP - New directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/SOAP/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/SOAP/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/SOAP/RCS/directory,v: No such file or directory From kawas at dev.open-bio.org Thu Feb 1 09:15:12 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 1 Feb 2007 09:15:12 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702011415.l11EFCF5010681@dev.open-bio.org> kawas Thu Feb 1 09:15:11 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/SOAP In directory dev.open-bio.org:/tmp/cvs-serv10650/SOAP Added Files: Serializer.pm Log Message: A serializer that fixes soap lite v0.6+ incompatibilities moby-live/Perl/MOBY/SOAP Serializer.pm,NONE,1.1 From kawas at dev.open-bio.org Thu Feb 1 09:17:23 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 1 Feb 2007 09:17:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702011417.l11EHNCE010724@dev.open-bio.org> kawas Thu Feb 1 09:17:22 EST 2007 Update of /home/repository/moby/moby-live/Perl/scripts In directory dev.open-bio.org:/tmp/cvs-serv10689 Modified Files: MOBY-Central.pl Log Message: added the serializer call. Uncomment to use it moby-live/Perl/scripts MOBY-Central.pl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/MOBY-Central.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/scripts/MOBY-Central.pl 2003/02/19 21:22:08 1.1 +++ /home/repository/moby/moby-live/Perl/scripts/MOBY-Central.pl 2007/02/01 14:17:22 1.2 @@ -1,10 +1,13 @@ -#!/usr/bin/perl -w -# _________________________________________________________________ - - -use SOAP::Transport::HTTP; -use MOBY::Central; -my $x = new SOAP::Transport::HTTP::CGI; -$x->dispatch_to('/var/www/cgi-bin', 'MOBY::Central'); -$x->handle; - +#!/usr/bin/perl -w +# _________________________________________________________________ + + +use SOAP::Transport::HTTP; +use MOBY::Central; +use MOBY::SOAP::Serializer; + +my $x = new SOAP::Transport::HTTP::CGI; +#$x->serializer(MOBY::SOAP::Serializer->new); +$x->dispatch_to('/var/www/cgi-bin', 'MOBY::Central'); +$x->handle; + From kawas at dev.open-bio.org Thu Feb 1 09:48:54 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 1 Feb 2007 09:48:54 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702011448.l11EmstF010787@dev.open-bio.org> kawas Thu Feb 1 09:48:54 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util In directory dev.open-bio.org:/tmp/cvs-serv10752/Java/src/main/org/biomoby/registry/rdfagent/util Modified Files: CentralAdmin.java Log Message: added a user agent header moby-live/Java/src/main/org/biomoby/registry/rdfagent/util CentralAdmin.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/CentralAdmin.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/registry/rdfagent/util/CentralAdmin.java 2006/02/22 16:41:38 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/CentralAdmin.java 2007/02/01 14:48:54 1.4 @@ -2,6 +2,7 @@ import java.net.MalformedURLException; import java.net.URL; +import java.util.Hashtable; import javax.xml.rpc.ParameterMode; import javax.xml.rpc.ServiceException; @@ -9,6 +10,7 @@ import org.apache.axis.AxisFault; import org.apache.axis.client.Call; import org.apache.axis.client.Service; +import org.apache.axis.transport.http.HTTPConstants; /** * @@ -85,6 +87,9 @@ String.class, ParameterMode.IN); call.setPassword(password); call.setUsername(username); + Hashtable t = new Hashtable(); + t.put(HTTPConstants.HEADER_USER_AGENT, "RDFAgent/1.0"); + call.setProperty(HTTPConstants.REQUEST_HEADERS, t); String xml = "" + "\t" + servicename + "" + "\t" + phrase + "" + "\t" + authority + "" From kawas at dev.open-bio.org Fri Feb 2 10:11:23 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 2 Feb 2007 10:11:23 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702021511.l12FBNk8016185@dev.open-bio.org> kawas Fri Feb 2 10:11:23 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv16150 Modified Files: Central.pm Log Message: the wsdl returned for async was following the post template. this resulted in incorrect service locations, etc. Thanks romina moby-live/Perl/MOBY Central.pm,1.276,1.277 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.276 retrieving revision 1.277 diff -u -r1.276 -r1.277 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/01/30 14:34:17 1.276 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/02 15:11:23 1.277 @@ -3254,9 +3254,6 @@ $desc =~ s"\<"<"g; # XMl encode now that it is not CDATAd $desc =~ s"\>">"g; # XML encode now that it is not CDATAd my $URL = $SI->url; - $URL =~ "(http://[^/]+)(/.*)"; - my $baseURL = $1; - my $relativeURL = $2; my $IN = "NOT_YET_DEFINED_INPUTS"; my $OUT = "NOT_YET_DEFINED_OUTPUTS"; my $INxsd = &_getInputXSD( $InputXML, $SecondaryXML ); @@ -3265,9 +3262,9 @@ $OUTxsd ||= ""; $wsdl =~ s/MOBY__SERVICE__NAME__/$serviceName/g; # replace all of the goofy portbindingpottype crap $wsdl =~s/\<\!\-\-\s*MOBY__SERVICE__DESCRIPTION\s*\-\-\>/Authority: $AuthURI - $desc/g; # add a sensible description - $wsdl =~ s/MOBY__SERVICE__URL/$baseURL/g; # the URL to the service - $wsdl =~ s/MOBY__SERVICE__POST/$relativeURL/g; # the URL to the service + $wsdl =~ s/MOBY__SERVICE__URL/$URL/g; # the URL to the service $wsdl =~ s/MOBY__SERVICE__NAME/$serviceName/g; # finally replace the actual subroutine call + return $wsdl return $wsdl; } From d.haase at dev.open-bio.org Mon Feb 5 09:30:47 2007 From: d.haase at dev.open-bio.org (Dirk Haase) Date: Mon, 5 Feb 2007 09:30:47 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702051430.l15EUlEx014942@dev.open-bio.org> d.haase Mon Feb 5 09:30:46 EST 2007 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory dev.open-bio.org:/tmp/cvs-serv14907 Modified Files: XMLPayloads.html Log Message: Updated documentation of Relationships function in order to describe new 'direction' parameter moby-live/Docs/MOBY-S_API XMLPayloads.html,1.17,1.18 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2006/11/21 23:04:27 1.17 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2007/02/05 14:30:46 1.18 @@ -650,6 +650,7 @@ <relationshipType>RelationshipOntologyTerm1</relationshipType> <relationshipType>RelationshipOntologyTerm2</relationshipType> ... + <direction>root|leaves</direction> <expandRelationship>1|0</expandRelationship> <Relationships> @@ -668,26 +669,62 @@

Notes

    -
  • Retrieves the Object or Service Classnames that stand in 'X' -relationship to the given object type based on the Object Class -ontology, where X is the relationship(s) specified in the input message
  • - +
  • Retrieves the Entity (Object or Service) Classnames that stand in 'X' +relationship to the given entity type based on the regarding Class +ontology, where X is the relationship(s) specified in the input message
  • + +
  • The result list is composed of all entities which are related + to the query entity by any relevant relationship instance. The + given direction dictates which relationship instances are + considered: +
      +
    • ISA: suppose a relationship instance R:= A ISA + B. If direction is 'root' R is considered if + B is the query entity. If direction is 'leaves' + R is considered if A is the query + entity.
    • + +
    • HAS: suppose a relationship instance R:= A HAS + B. If direction is 'root' R is considered if + A is the query entity. If direction is 'leaves' + R is considered if B is the query + entity.
    • + +
    • HASA: suppose a relationship instance R:= A HASA + B. If direction is 'root' R is considered if + A is the query entity. If direction is 'leaves' + R is considered if B is the query + entity.
    • +
    +
  • +
  • If the expandRelationships flag is NOT set, the response will contain only -the classnames that lie immediately in that relationship to the given object.
  • +the classnames that lie immediately in that relationship to the given entity.
  • If the expandRelationships flag is set, the ontology will be traversed in the following way:
      -
    • ISA: the ontology will be traversed along the ISA path back to root - ("Object" or "Service")
    • -
    • HAS(not applicable to Service ontology): Object ontology will be traversed along - the ISA path back to root, and every HAS relationship of every Object along that path - will be added to the output as a flattened list. The HAS, HASA, or ISA - realtionships of these will NOT be followed.
    • -
    • HASA (not applicable to Service ontology): Object ontology will be traversed along - the ISA path back to root, and every HASA relationship of every Object along that path - will be added to the output as a flattened list. The HAS, HASA, or ISA - realtionships of these will NOT be followed.
    • +
    • ISA: the ontology will be traversed along the ISA path in + the given direction; up to the root entity ("Object" or + "Service") for 'root' direction, down to the ontology leaves + for 'leaves' direction
    • + +
    • HAS(not applicable to Service ontology): Object ontology + will be traversed along the ISA path as described above. For + each node in the resulting ISA hierarchy all objects related by + HAS will be added to the output as a flattened + list (direction dependent rules for considering + relationships apply). The HAS, HASA, or ISA realtionships of + these will NOT be followed.
    • + +
    • HASA(not applicable to Service ontology): Object ontology + will be traversed along the ISA path as described above. For + each node in the resulting ISA hierarchy all objects related by + HAS will be added to the output as a flattened + list (direction dependent rules for considering + relationships apply). The HAS, HASA, or ISA realtionships of + these will NOT be followed.
    • +
From mwilkinson at dev.open-bio.org Mon Feb 5 16:17:18 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 5 Feb 2007 16:17:18 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702052117.l15LHIEv015490@dev.open-bio.org> mwilkinson Mon Feb 5 16:17:18 EST 2007 Update of /home/repository/moby/moby-live/Perl/scripts In directory dev.open-bio.org:/tmp/cvs-serv15471/scripts Modified Files: MOBY-Central.pl Log Message: new Daemon code for MOBY Central moby-live/Perl/scripts MOBY-Central.pl,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/MOBY-Central.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/scripts/MOBY-Central.pl 2007/02/01 14:17:22 1.2 +++ /home/repository/moby/moby-live/Perl/scripts/MOBY-Central.pl 2007/02/05 21:17:18 1.3 @@ -1,13 +1,13 @@ -#!/usr/bin/perl -w -# _________________________________________________________________ - - -use SOAP::Transport::HTTP; -use MOBY::Central; -use MOBY::SOAP::Serializer; - -my $x = new SOAP::Transport::HTTP::CGI; -#$x->serializer(MOBY::SOAP::Serializer->new); -$x->dispatch_to('/var/www/cgi-bin', 'MOBY::Central'); -$x->handle; - +#!/usr/bin/perl -w +# _________________________________________________________________ + + +use SOAP::Transport::HTTP; +use MOBY::Central; +use MOBY::SOAP::Serializer; + +my $x = new SOAP::Transport::HTTP::CGI; +$x->serializer(MOBY::SOAP::Serializer->new); +$x->dispatch_to('/var/www/cgi-bin', 'MOBY::Central'); +$x->handle; + From mwilkinson at dev.open-bio.org Mon Feb 5 16:17:47 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 5 Feb 2007 16:17:47 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702052117.l15LHlF1015530@dev.open-bio.org> mwilkinson Mon Feb 5 16:17:47 EST 2007 Update of /home/repository/moby/moby-live/Perl/t In directory dev.open-bio.org:/tmp/cvs-serv15511/t Modified Files: Client-Central.t Log Message: test suite didn't always clean up after itself moby-live/Perl/t Client-Central.t,1.55,1.56 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2006/11/06 22:47:45 1.55 +++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2007/02/05 21:17:47 1.56 @@ -54,8 +54,7 @@ # Also can't use %Obj, my $C = MOBY::Client::Central->new(); - my $r = $C->deregisterObjectClass( objectType => "Rubbish" ); - $r = $C->deregisterService( serviceName => 'myfirstservice', + my $r = $C->deregisterService( serviceName => 'myfirstservice', authURI => 'test.suite.com' ); $r = $C->deregisterService( serviceName => '1myfirstservice', authURI => 'test.suite.com' ); @@ -65,6 +64,11 @@ authURI => 'test.suite.com' ); $r = $C->deregisterService( serviceName => 'mysecondservice', authURI => 'test.suite.com' ); + $r = $C->deregisterService( serviceName => 'mySecondaryTestservice', + authURI => 'test.suite.com' ); + $r = $C->deregisterService( serviceName => 'myfirstservicemultiplesimples', + authURI => 'test.suite.com' ); + $r = $C->deregisterObjectClass( objectType => "Rubbish" ); $r = $C->deregisterNamespace( namespaceType => 'RubbishNamespace' ); $r = $C->deregisterServiceType( serviceType => 'RubbishyService' ); }; From mwilkinson at dev.open-bio.org Mon Feb 5 21:53:11 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 5 Feb 2007 21:53:11 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702060253.l162rBOF015996@dev.open-bio.org> mwilkinson Mon Feb 5 21:53:11 EST 2007 Update of /home/repository/moby/moby-live/Perl In directory dev.open-bio.org:/tmp/cvs-serv15977 Modified Files: MANIFEST Log Message: MOBY Central compatible with SOAP::Lite v .69 and ready for Async moby-live/Perl MANIFEST,1.17,1.18 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MANIFEST,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- /home/repository/moby/moby-live/Perl/MANIFEST 2006/05/02 15:12:07 1.17 +++ /home/repository/moby/moby-live/Perl/MANIFEST 2007/02/06 02:53:11 1.18 @@ -23,6 +23,7 @@ MOBY/Client/Service.pm MOBY/Adaptor/moby/queryapi.pm MOBY/Adaptor/moby/queryapi/mysql.pm +MOBY/SOAP/Serializer.pm t/Client-Central.t scripts/CloneCentralDatabases.pl scripts/DebugYourService.pl From mwilkinson at dev.open-bio.org Mon Feb 5 21:53:11 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 5 Feb 2007 21:53:11 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702060253.l162rB1J016016@dev.open-bio.org> mwilkinson Mon Feb 5 21:53:11 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv15977/MOBY Modified Files: Central.pm Log Message: MOBY Central compatible with SOAP::Lite v .69 and ready for Async moby-live/Perl/MOBY Central.pm,1.277,1.278 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.277 retrieving revision 1.278 diff -u -r1.277 -r1.278 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/02 15:11:23 1.277 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/06 02:53:11 1.278 @@ -36,6 +36,8 @@ #use RDF::Core::Constants qw(:xml :rdf :rdfs); use MOBY::MobyXMLConstants; my $debug = 0; +my $listener = 1; + my %user_agent_args = (agent => "MOBY-Central-Perl"); if ($debug) { @@ -44,6 +46,26 @@ close OUT; } + +if ($listener) { + eval {open(OUT, ">>/tmp/CentralRegistryListener.txt")}; + $listener = 0 if @!; # abort listening if the logging attempt failed +} + +sub listener { + return unless $listener; + my (%args) = @_; + my $authority = $args{authority}; + my $servicename = $args{servicename}; + my $ip = $ENV{REMOTE_ADDR}; # ="137.82.67.190" + open(OUT, ">>/tmp/CentralRegistryListener.txt"); + use Time::localtime; + my $time = ctime; + print OUT "$time\t$ip\t$authority\t$servicename\n"; + close OUT; +} + + =head1 SYNOPSIS REQUIRES MYSQL 3.23 or later!!!! @@ -2500,16 +2522,17 @@ my $servlsid = $SI->lsid; my $wsdls; return "" unless ($SI); - my $wsdl = &_getServiceWSDL( $SI, $InputXML, $OutputXML, $SecondaryXML ); - if ($wsdl) { - if ( $wsdl =~ /[^\]]+))\]\]>/ ) { - $wsdl = $1; - } - $wsdls .= "\n"; + &listener(authority => $AuthURI, servicename => $serviceName); # log the requst for research purposes + my $wsdl = &_getServiceWSDL( $SI, $InputXML, $OutputXML, $SecondaryXML ); + if ($wsdl) { + if ( $wsdl =~ /[^\]]+))\]\]>/ ) { + $wsdl = $1; } + $wsdls .= "\n"; + } - #$debug && &_LOG("WSDL_________________$wsdls\n____________________"); - return $wsdls; + #$debug && &_LOG("WSDL_________________$wsdls\n____________________"); + return $wsdls; } #Eddie - converted @@ -3974,42 +3997,43 @@ # Standard MOBY WSDL Template + $WSDL_TEMPLATE = < + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"> - + - + - + - + - + - + - + - + @@ -4017,7 +4041,7 @@ - + From mwilkinson at dev.open-bio.org Mon Feb 5 21:53:12 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 5 Feb 2007 21:53:12 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702060253.l162rCVG016036@dev.open-bio.org> mwilkinson Mon Feb 5 21:53:11 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv15977/MOBY/Client Modified Files: Service.pm Log Message: MOBY Central compatible with SOAP::Lite v .69 and ready for Async moby-live/Perl/MOBY/Client Service.pm,1.30,1.31 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/01/24 22:56:55 1.30 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/06 02:53:11 1.31 @@ -128,6 +128,7 @@ $wsdl = URI::Escape::uri_escape( $self->service ); # this seems to fix the bug my $soap = SOAP::Lite->service( "data:,$wsdl" ); + $soap->soapversion('1.1'); if ( $self->uri ) { $soap->uri( $self->uri ) } $self->serviceName( &_getServiceName( $soap ) ); $self->_soapService( $soap ); @@ -273,9 +274,9 @@ $data "; - $data =~ s"&"&"g; # encode content in case it has CDATA - $data =~ s"\<"<"g; - $data =~ s"\]\]\>"\]\]>"g; +# $data =~ s"&"&"g; # encode content in case it has CDATA +# $data =~ s"\<"<"g; +# $data =~ s"\]\]\>"\]\]>"g; #################### #################### From d.haase at dev.open-bio.org Tue Feb 6 04:52:04 2007 From: d.haase at dev.open-bio.org (Dirk Haase) Date: Tue, 6 Feb 2007 04:52:04 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702060952.l169q4lv017295@dev.open-bio.org> d.haase Tue Feb 6 04:52:04 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby In directory dev.open-bio.org:/tmp/cvs-serv17260 Modified Files: queryapi.pm Log Message: fixed typo in method name 'get_details_for_id_list' moby-live/Perl/MOBY/Adaptor/moby queryapi.pm,1.32,1.33 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi.pm,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi.pm 2007/01/30 14:57:47 1.32 +++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi.pm 2007/02/06 09:52:04 1.33 @@ -1345,7 +1345,7 @@ die "get_all_relationships not implemented in adaptor\n"; } -=head2 get_deails_for_id_list +=head2 get_details_for_id_list Title : get_deails_for_id_list Usage : my $un = $API->get_all_relationships($ontology, $field_list, $id_list) From kawas at dev.open-bio.org Tue Feb 6 13:04:48 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 6 Feb 2007 13:04:48 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702061804.l16I4mjE018858@dev.open-bio.org> kawas Tue Feb 6 13:04:48 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv18823 Modified Files: Central.pm Log Message: there were 2 return statements in doAsyncWSDL... with one of them missing a semi-colon! moby-live/Perl/MOBY Central.pm,1.278,1.279 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.278 retrieving revision 1.279 diff -u -r1.278 -r1.279 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/06 02:53:11 1.278 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/06 18:04:48 1.279 @@ -3287,7 +3287,6 @@ $wsdl =~s/\<\!\-\-\s*MOBY__SERVICE__DESCRIPTION\s*\-\-\>/Authority: $AuthURI - $desc/g; # add a sensible description $wsdl =~ s/MOBY__SERVICE__URL/$URL/g; # the URL to the service $wsdl =~ s/MOBY__SERVICE__NAME/$serviceName/g; # finally replace the actual subroutine call - return $wsdl return $wsdl; } From mwilkinson at dev.open-bio.org Tue Feb 6 14:24:03 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 14:24:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702061924.l16JO3bh019003@dev.open-bio.org> mwilkinson Tue Feb 6 14:24:03 EST 2007 Update of /home/repository/moby/moby-live/Perl In directory dev.open-bio.org:/tmp/cvs-serv18984 Modified Files: MANIFEST Log Message: adding async modules to the MANIFEST moby-live/Perl MANIFEST,1.18,1.19 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MANIFEST,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- /home/repository/moby/moby-live/Perl/MANIFEST 2007/02/06 02:53:11 1.18 +++ /home/repository/moby/moby-live/Perl/MANIFEST 2007/02/06 19:24:03 1.19 @@ -24,7 +24,10 @@ MOBY/Adaptor/moby/queryapi.pm MOBY/Adaptor/moby/queryapi/mysql.pm MOBY/SOAP/Serializer.pm -t/Client-Central.t +MOBY/Async/LSAE.pm +MOBY/Async/Service.pm +MOBY/Async/SimpleServer.pm +MOBY/Async/WSRF.pm scripts/CloneCentralDatabases.pl scripts/DebugYourService.pl scripts/FindServices.pl From mwilkinson at dev.open-bio.org Tue Feb 6 14:25:17 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 14:25:17 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702061925.l16JPHE5019043@dev.open-bio.org> mwilkinson Tue Feb 6 14:25:17 EST 2007 Update of /home/repository/moby/moby-live/Perl In directory dev.open-bio.org:/tmp/cvs-serv19024 Modified Files: Makefile.PL Log Message: Removing note about SOAP::Lite .069 from Makefile moby-live/Perl Makefile.PL,1.18,1.19 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2006/05/03 16:03:11 1.18 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/06 19:25:17 1.19 @@ -84,13 +84,13 @@ my $soap_version = $SOAP::Lite::VERSION; my $max_soap_version_compatible = "0.60"; if ($soap_version gt $max_soap_version_compatible) { - print STDOUT < mwilkinson Tue Feb 6 14:25:55 EST 2007 Update of /home/repository/moby/moby-live/Perl In directory dev.open-bio.org:/tmp/cvs-serv19064 Modified Files: Makefile.PL Log Message: Removing note about SOAP::Lite .069 from Makefile moby-live/Perl Makefile.PL,1.19,1.20 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/06 19:25:17 1.19 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/06 19:25:55 1.20 @@ -82,7 +82,7 @@ eval { use SOAP::Lite; my $soap_version = $SOAP::Lite::VERSION; - my $max_soap_version_compatible = "0.60"; + my $max_soap_version_compatible = "0.69"; if ($soap_version gt $max_soap_version_compatible) { # print STDOUT < mwilkinson Tue Feb 6 14:27:28 EST 2007 Update of /home/repository/moby/moby-live/Perl In directory dev.open-bio.org:/tmp/cvs-serv19104 Modified Files: Makefile.PL Log Message: Removing note about SOAP::Lite .069 from Makefile moby-live/Perl Makefile.PL,1.20,1.21 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/06 19:25:55 1.20 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/06 19:27:28 1.21 @@ -78,26 +78,6 @@ sub MY::postamble { - # First, check for SOAP::Lite compatibility - eval { - use SOAP::Lite; - my $soap_version = $SOAP::Lite::VERSION; - my $max_soap_version_compatible = "0.69"; - if ($soap_version gt $max_soap_version_compatible) { -# print STDOUT < mwilkinson Tue Feb 6 14:59:31 EST 2007 Update of /home/repository/moby/moby-live/Perl In directory dev.open-bio.org:/tmp/cvs-serv19182 Modified Files: Makefile.PL Log Message: adding WSRF dependencies to Makefile moby-live/Perl Makefile.PL,1.21,1.22 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/06 19:27:28 1.21 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/06 19:59:31 1.22 @@ -3,79 +3,6 @@ use strict; my $VERSION = '0.87'; -# Anyone know why it was ever necessary to copy everything in "lib"? -#system "mkdir lib" unless (-e 'lib' && -d 'lib'); # put the files into the lib directory so that they will be properly installed -#my $os = $^O; -#if ($os =~ /(linux|unix)/) { system "cp -rf MOBY lib"; } -#elsif ($os =~ /ms.*win/i) { # windows only, usually $^O="mswin32", is this true on all Windows? -# system q{xcopy /E MOBY .\lib\MOBY\ }; -#} - -#my $WWW_ROOT_PATH = "/usr/local/apache" ; -#my $CGI_BIN = "cgi-bin" ; -#my $WWW_USER = "www" ; -## -## RMB - Singapore biohackethon - Work in progress, to make a cleaner installation -## Welcome... -#print STDERR "\n\nMOBY Installation (Perl Implementation)\n" ; -#print STDERR "=======================================\n\n" ; -# -#my $line ; -#print STDERR -# "I need to know your web server path...\n", -# "This is typically something like one of the following:\n\n", -# "\tStandard Apache Unix location: '/usr/local/apache'\n", -# "\tTypical location under Linux: '/var/www/'\n", -# "\tLocation under Mac OS X: '/Library/WebServer'\n\n", -# "Path to your WWW server root \[$WWW_ROOT_PATH\]? "; -#chomp ($line = <>); -#$WWW_ROOT_PATH=$line if ($line) ; -#print STDERR "Setting WWW server root path to '$WWW_ROOT_PATH'\n\n" ; -# -#print STDERR -# "I also need the name of your CGI script directory there:\n\n", -# "\tMost of the time, this is 'cgi-bin'\n", -# "\tbut Mac OS X uses 'CGI-Executables'\n\n", -# "Name of your CGI directory \[$CGI_BIN\]? "; -#chomp ($line = <>); -#$CGI_BIN=$line if ($line) ; -#my $CGI_BIN_PATH = "$WWW_ROOT_PATH/$CGI_BIN" ; -#print STDERR "Setting CGI bin path to '$CGI_BIN_PATH'\n\n" ; -# -#print STDERR -# "Your server runs under a specific user account.\n", -# "\tUnder most installations, this is usually 'nobody' or 'www'\n", -# "\tUnder Mac OS X, this is 'root'\n\n", -# "Name of WWW server user account \[$WWW_USER\]? "; -#chomp ($line = <>); -#$WWW_USER=$line if ($line) ; -#print STDERR "Setting WWW user to '$WWW_USER'\n\n" ; -# -#my $WWW_GROUP=$WWW_USER ; -#print STDERR -# "A UNIX group is also generally associated with the web directories.\n", -# "\tThis may be the same as the above user account name, or\n", -# "\tin be something else, like 'admin' in Mac OS X\n\n", -# "Name of WWW server group \[$WWW_GROUP\]? "; -#chomp($line = <>) ; -#$WWW_GROUP=$line if($line) ; -#print STDERR "Setting WWW group to '$WWW_GROUP'\n\n" ; -#print STDERR "Press any key to continue...\n\n" ; -#$line=<>; -# -#sub MY::post_initialize { -# return <<"MAKE_FRAG"; -#MOBY_WWW_ROOT_PATH = $WWW_ROOT_PATH -#MOBY_CGI_BIN_PATH = $CGI_BIN_PATH -#MOBY_WWW_USER = $WWW_USER -#MOBY_WWW_GROUP = $WWW_GROUP -#MAKE_FRAG -#} -# -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. - - sub MY::postamble { # Now build documentation. @@ -213,7 +140,7 @@ # Version numbers specified for prerequiisites are simply "desired" versions, # not minimum, or anything else. PREREQ_PM => { - 'SOAP::Lite' => 0.60, + 'SOAP::Lite' => 0.69, 'SOAP::MIME' => 0.55, 'XML::LibXML' => 1.58, 'XML::XPath' => 1.12, @@ -223,6 +150,19 @@ # Database stuff required only for local registry, but notify user if missing anyway. 'DBI' => 0.01, 'DBD::mysql' => 0.01, + 'WSRF::Lite' => '', + 'Test::Simple' => 0.44, + 'XML::DOM' => '', + 'DateTime::Format::Epoch' => '', + 'DateTime::Format::W3CDTF' => '', + 'HTTP::Daemon' => '', + 'HTTP::Daemon::SSL' => '', + 'MIME::Base64' => '', + 'Digest::SHA1' => '', + 'Crypt::OpenSSL::X509' => '', + 'Crypt::OpenSSL::RSA' => '', + 'XML::CanonicalizeXML' => 0.02, + 'Sys::Hostname::Long' => '' # LS::ID => 1.1.1, }, # e.g., Module::Name => 1.1 #PM_FILTER => "", From mwilkinson at dev.open-bio.org Tue Feb 6 16:11:49 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 16:11:49 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702062111.l16LBnf8019382@dev.open-bio.org> mwilkinson Tue Feb 6 16:11:49 EST 2007 Update of /home/repository/moby/moby-live/Database In directory dev.open-bio.org:/tmp/cvs-serv19363 Modified Files: mobycentral.mysql Log Message: adding async to the database template moby-live/Database mobycentral.mysql,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Database/mobycentral.mysql,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Database/mobycentral.mysql 2005/07/08 19:03:17 1.5 +++ /home/repository/moby/moby-live/Database/mobycentral.mysql 2007/02/06 21:11:49 1.6 @@ -48,7 +48,7 @@ maximum_value float default NULL, minimum_value float default NULL, enum_value text, - datatype enum('String','Integer','DateTime','Float') default NULL, + datatype enum('String','Integer','DateTime','Float','Boolean') default NULL, article_name varchar(255) default NULL, service_instance_id int(10) unsigned NOT NULL default '0', PRIMARY KEY (secondary_input_id) @@ -59,7 +59,7 @@ -- CREATE TABLE service_instance ( - category enum('moby','soap','wsdl','cgi') default NULL, + category enum('moby','soap','wsdl','cgi','moby-async') default NULL, servicename varchar(255) NOT NULL default '', service_type_uri varchar(255) NOT NULL default '', authority_id int(10) unsigned NOT NULL default '0', From mwilkinson at dev.open-bio.org Tue Feb 6 16:46:12 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 16:46:12 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702062146.l16LkCuN019462@dev.open-bio.org> mwilkinson Tue Feb 6 16:46:12 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv19443/MOBY/Client Modified Files: Service.pm Log Message: Asynchronous services will not necessarily report the correct serviceName in the old code due to undefined Perl hash orders, so we have to explicitly extract it. Added a new method 'methods' that will retrieve all of the method calls for an Asynchronous service moby-live/Perl/MOBY/Client Service.pm,1.31,1.32 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/06 02:53:11 1.31 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/06 21:46:12 1.32 @@ -129,9 +129,10 @@ my $soap = SOAP::Lite->service( "data:,$wsdl" ); $soap->soapversion('1.1'); - if ( $self->uri ) { $soap->uri( $self->uri ) } - $self->serviceName( &_getServiceName( $soap ) ); $self->_soapService( $soap ); + if ( $self->uri ) { $soap->uri( $self->uri ) } + $self->serviceName( $self->_getServiceName() ); + return undef unless $self->serviceName; # servicename could not be determined, so no methods can be called return $self; } @@ -336,6 +337,22 @@ return $result; } +=head2 methods + + Usage : $name = $Service->methods() + Function : Internal method to retrieve all methods from a service + Returns : listref of method names as strings + Args : none + +=cut + +sub methods { + my ($self) = @_; + my $service = $self->_soapService; + no strict; + my @methods = @{ join '::', ref $service, 'EXPORT_OK' }; + return \@methods +} =head2 serviceName @@ -351,18 +368,27 @@ Usage : $name = $Service->_getServiceName() Function : Internal method to retrieve the name of the service from the SOAP object + In the case of Asynchronous services it will return the base name of + the service (i.e. myService, rather than myService_submit). This base name + is not guaranteed to give you any output if you call it! Returns : string Args : none =cut sub _getServiceName { - my ( $service ) = @_; - no strict; - my ( $method ) = @{ join '::', ref $service, 'EXPORT_OK' }; - return $method; + my ( $self ) = @_; + my @methods = @{$self->methods}; + return shift @methods if scalar @methods <=1; # in case of non-asynch services it is the only one there. + foreach (@methods){ + next unless m/^(\S+)_submit/; + return $1; + } + return undef } + + sub AUTOLOAD { no strict "refs"; my ( $self, $newval ) = @_; From mwilkinson at dev.open-bio.org Tue Feb 6 19:07:11 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 19:07:11 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702070007.l1707B1Q019710@dev.open-bio.org> mwilkinson Tue Feb 6 19:07:11 EST 2007 Update of /home/repository/moby/moby-live/Perl In directory dev.open-bio.org:/tmp/cvs-serv19691 Modified Files: Makefile.PL Log Message: removing WSRF dependencies for the time being to silence CRON reports from the auto documentation update on Biomoby.org. I'll put them back in when Chris has installed the various Perl modules from CPAN. moby-live/Perl Makefile.PL,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/06 19:59:31 1.22 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/07 00:07:11 1.23 @@ -151,18 +151,18 @@ 'DBI' => 0.01, 'DBD::mysql' => 0.01, 'WSRF::Lite' => '', - 'Test::Simple' => 0.44, - 'XML::DOM' => '', - 'DateTime::Format::Epoch' => '', - 'DateTime::Format::W3CDTF' => '', - 'HTTP::Daemon' => '', - 'HTTP::Daemon::SSL' => '', - 'MIME::Base64' => '', - 'Digest::SHA1' => '', - 'Crypt::OpenSSL::X509' => '', - 'Crypt::OpenSSL::RSA' => '', - 'XML::CanonicalizeXML' => 0.02, - 'Sys::Hostname::Long' => '' + #'Test::Simple' => 0.44, + #'XML::DOM' => '', + #'DateTime::Format::Epoch' => '', + #'DateTime::Format::W3CDTF' => '', + #'HTTP::Daemon' => '', + #'HTTP::Daemon::SSL' => '', + #'MIME::Base64' => '', + #'Digest::SHA1' => '', + #'Crypt::OpenSSL::X509' => '', + #'Crypt::OpenSSL::RSA' => '', + #'XML::CanonicalizeXML' => 0.02, + #'Sys::Hostname::Long' => '' # LS::ID => 1.1.1, }, # e.g., Module::Name => 1.1 #PM_FILTER => "", From mwilkinson at dev.open-bio.org Tue Feb 6 19:07:11 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 19:07:11 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702070007.l1707B1F019730@dev.open-bio.org> mwilkinson Tue Feb 6 19:07:11 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv19691/MOBY/Client Modified Files: Central.pm Log Message: removing WSRF dependencies for the time being to silence CRON reports from the auto documentation update on Biomoby.org. I'll put them back in when Chris has installed the various Perl modules from CPAN. moby-live/Perl/MOBY/Client Central.pm,1.144,1.145 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.144 retrieving revision 1.145 diff -u -r1.144 -r1.145 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/01 14:14:11 1.144 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/07 00:07:11 1.145 @@ -1939,7 +1939,7 @@ for my $in ( 1 .. $xPuts->size() ) { my $current = $xPuts->get_node($in); foreach my $child ( $current->childNodes ) - { # child nodes will be either "Simple" or "Complex" tagnames + { # child nodes will be either "Simple" or "Collection" tagnames next unless $child->nodeType == ELEMENT_NODE; my $THIS; if ( $child->nodeName eq "Simple" ) { From mwilkinson at dev.open-bio.org Tue Feb 6 19:25:01 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 19:25:01 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702070025.l170P1dZ019792@dev.open-bio.org> mwilkinson Tue Feb 6 19:25:01 EST 2007 Update of /home/repository/moby/moby-live/Perl In directory dev.open-bio.org:/tmp/cvs-serv19773 Modified Files: Makefile.PL Log Message: starting to clean up Perl module documentation moby-live/Perl Makefile.PL,1.23,1.24 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/07 00:07:11 1.23 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/07 00:25:01 1.24 @@ -98,12 +98,15 @@

MOBY-S Perl Modules Documentation

-These documents (including this one) are generated by pod2html from the various perl -modules. +For an overview of how to do various things in Perl, see the +Perl Tutorial

+The documents below (including this one) are generated by pod2html from the various perl +modules and give specific interface information for each of the Perl modules described in the tutorial. +

    HEAD for (my $i = 0; $i < @{$pms}; $i++) { - print INDEX "
  • [$i]\">$mod_names->[$i]
  • \n"; + print INDEX "
  • [$i]\">MOBY::$mod_names->[$i]
  • \n"; } print INDEX < From mwilkinson at dev.open-bio.org Tue Feb 6 20:10:22 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 20:10:22 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702070110.l171AMbH019914@dev.open-bio.org> mwilkinson Tue Feb 6 20:10:22 EST 2007 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory dev.open-bio.org:/tmp/cvs-serv19891/MOBY-S_API/Perl Modified Files: ConstructingYourService.html RegisterServiceInstance.html Added Files: DiscoverService.html Log Message: adding and fixing the Perl library documentation moby-live/Docs/MOBY-S_API/Perl DiscoverService.html,NONE,1.1 ConstructingYourService.html,1.20,1.21 RegisterServiceInstance.html,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2006/06/23 15:16:01 1.20 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2007/02/07 01:10:22 1.21 @@ -158,6 +158,8 @@
  • The "handle" method starts the script listening.
  • +
  • To deploy the dispatcher, simply put it in your cgi-bin folder of your webserver.
  • +

    The service module

    =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterServiceInstance.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterServiceInstance.html 2006/06/02 08:21:34 1.4 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterServiceInstance.html 2007/02/07 01:10:22 1.5 @@ -63,8 +63,8 @@

    Registering your service

    -To register the service getGoTerm service that you created at the end -of ConstructingYourService +To register the service getGoTerm that you created at the end +of Constructing Your Service you would use the following code:

    @@ -73,6 +73,36 @@ use MOBY::Client::Central; my $m = MOBY::Client::Central->new; +#NOTE: the service Name MUST be identical to the name you +# called it in the Dispatcher +# and identical to the name of the subroutine itself. +my $serviceName = "getGoTerm"; + + +# this is a term taken from the MOBY Service Ontology +# that most closely reflects the nature of what your service does +my $serviceType = "Retrieval"; + + +# this is a unique string in the form nnn.nnn.nnn that +# identifies you as a particular service provider. Your +# domain name (excluding http://) is most useful +my $authURI = "mydomain.mycompany.org"; + + +# this is the URL where your Dispatcher is located +my $URL = "http://mydomain.mycompany.org/cgi-bin/MOBY/Dispatcher.cgi"; + + +# finally, you want to make a nice human-readable description for +# your service. This should include things like what organism your +# database provides information about, or what data or algorithm you +# use. Things that might help people find you based on a keyword search +my $description = "This service consumes GO ID's and returns GO Terms and definitions"; + + +# now start constructing the descriptions of your inputs and outputs: + my @input_namespaces = ('GO'); # a list of valid input namespaces my @input_simples = ('Object', \@input_namespaces); @@ -96,7 +126,7 @@ serviceType => $serviceType, authURI => $authURI, contactEmail => "your at mail.address", - description => $human_readable_description, + description => $description, category => "moby" URL => $URL_TO_SERVICE input => \@all_inputs, From mwilkinson at dev.open-bio.org Tue Feb 6 20:21:24 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 20:21:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702070121.l171LOFn019992@dev.open-bio.org> mwilkinson Tue Feb 6 20:21:24 EST 2007 Update of /home/repository/moby/moby-live/Perl In directory dev.open-bio.org:/tmp/cvs-serv19973 Modified Files: Makefile.PL Log Message: added more documentation for the MOBY::Client::SecondaryArticle API and un-commented the WSRF dependencies in the Makefile because Chris Dag added them to biomoby.org so rapidly moby-live/Perl Makefile.PL,1.24,1.25 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/07 00:25:01 1.24 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/07 01:21:24 1.25 @@ -154,18 +154,18 @@ 'DBI' => 0.01, 'DBD::mysql' => 0.01, 'WSRF::Lite' => '', - #'Test::Simple' => 0.44, - #'XML::DOM' => '', - #'DateTime::Format::Epoch' => '', - #'DateTime::Format::W3CDTF' => '', - #'HTTP::Daemon' => '', - #'HTTP::Daemon::SSL' => '', - #'MIME::Base64' => '', - #'Digest::SHA1' => '', - #'Crypt::OpenSSL::X509' => '', - #'Crypt::OpenSSL::RSA' => '', - #'XML::CanonicalizeXML' => 0.02, - #'Sys::Hostname::Long' => '' + 'Test::Simple' => 0.44, + 'XML::DOM' => '', + 'DateTime::Format::Epoch' => '', + 'DateTime::Format::W3CDTF' => '', + 'HTTP::Daemon' => '', + 'HTTP::Daemon::SSL' => '', + 'MIME::Base64' => '', + 'Digest::SHA1' => '', + 'Crypt::OpenSSL::X509' => '', + 'Crypt::OpenSSL::RSA' => '', + 'XML::CanonicalizeXML' => 0.02, + 'Sys::Hostname::Long' => '' # LS::ID => 1.1.1, }, # e.g., Module::Name => 1.1 #PM_FILTER => "", From mwilkinson at dev.open-bio.org Tue Feb 6 20:21:24 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 20:21:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702070121.l171LONB020012@dev.open-bio.org> mwilkinson Tue Feb 6 20:21:24 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv19973/MOBY/Client Modified Files: SecondaryArticle.pm Log Message: added more documentation for the MOBY::Client::SecondaryArticle API and un-commented the WSRF dependencies in the Makefile because Chris Dag added them to biomoby.org so rapidly moby-live/Perl/MOBY/Client SecondaryArticle.pm,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm 2006/05/30 18:56:16 1.12 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm 2007/02/07 01:21:24 1.13 @@ -70,13 +70,51 @@ Returns : string Arguments : (optional) string representing articleName to set -=head2 value +=head2 datatype - Usage : $name = $SA->value() - Function : get value of parameter - Returns : value of the parameter as a string (regardless of actual type) + Usage : $name = $SA->datatype($type) + Function : get/set datatype: Integer, Float, DateTime, Boolean, String + Returns : the datatype Arguments : +=head2 min + + Usage : $name = $SA->min($value) + Function : get/set the minimum value of a datatype + Returns : min value + Arguments : + +=head2 max + + Usage : $name = $SA->max($value) + Function : get/set maximum value of the datatype + Returns : max value + Arguments : + +=head2 default + + Usage : $name = $SA->default($value) + Function : get/set the default value of parameter + Returns : default value + Arguments : + + +=head2 enum + + Usage : $name = $SA->enum(\@possible_values) + Function : get/set the enumerated values for discreet variables + Returns : listref of string values + Arguments : + + +=head2 addEnum + + Usage : $name = $SA->addEnum($new_possible_values) + Function : add to the list of enumerated values for discreet variables + Returns : new listref of string values + Arguments : + + =head2 description Usage : $namespaces = $SA->description("text description here") @@ -169,6 +207,7 @@ $self->{enum} = [] unless $self->{enum}; return() unless defined ($enum); push @{ $self->{enum} }, $enum; + return $self->enum; } } From d.haase at dev.open-bio.org Wed Feb 7 10:19:00 2007 From: d.haase at dev.open-bio.org (Dirk Haase) Date: Wed, 7 Feb 2007 10:19:00 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702071519.l17FJ0Ln022633@dev.open-bio.org> d.haase Wed Feb 7 10:19:00 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi In directory dev.open-bio.org:/tmp/cvs-serv22598 Modified Files: mysql.pm Log Message: changed 'collection_input_id' to 'collection_${inout}_id' in query of &find_by_simple to prevent 'unknown column' error for output case moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.82,1.83 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2007/01/30 15:08:33 1.82 +++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2007/02/07 15:19:00 1.83 @@ -1209,7 +1209,7 @@ my $ancestor_string = $args{'ancestor_string'}; my $namespaceURIs = $args{'namespaceURIs'}; - my $query ="select service_instance_id, namespace_type_uris from simple_$inout where object_type_uri in ($ancestor_string) and collection_input_id IS NULL " + my $query ="select service_instance_id, namespace_type_uris from simple_$inout where object_type_uri in ($ancestor_string) and collection_${inout}_id IS NULL " ; # if service_instance_id is null then it must be a collection input. my $nsquery; foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's From gordonp at dev.open-bio.org Thu Feb 8 11:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18GxwXl027276@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv27169/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java MobyComplexBuilder.java Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.3,1.4 MobyComplexBuilder.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2006/10/26 01:32:06 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/02/08 16:59:58 1.4 @@ -29,6 +29,10 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +/** + * The engine that finds MOBY data in unstructured text or DOM of other XML languages according + * to a rules database. Used in Seahawk to provide the service options popup items. + */ public class MobyClient { public static final String DATA_MAPPING_XML_RESOURCE = "ca/ucalgary/seahawk/resources/mobyBuilderRules.xml"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java 2007/02/08 16:59:58 1.2 @@ -14,6 +14,10 @@ import java.util.Map; import java.util.regex.Matcher; +/** + * Class used by MobyClient to build the MOBY rule database from a configuration file. + */ + public class MobyComplexBuilder{ private Map namespaceRules; From gordonp at dev.open-bio.org Thu Feb 8 11:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18GxwCw027250@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test In directory dev.open-bio.org:/tmp/cvs-serv27169/main/ca/ucalgary/seahawk/gui/test Modified Files: SeahawkTestCase.java Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test SeahawkTestCase.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java 2006/11/22 22:23:54 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java 2007/02/08 16:59:58 1.4 @@ -1,10 +1,3 @@ -/** - * Tests all of the major functionality of Seahawk, the standalone MOBY - * browser that can be embedded in other applications too. If you add classes - * to Seahawk, you MUST test them here, otherwise they will not end up in the - * Seahawk deployment JAR. - */ - package ca.ucalgary.seahawk.gui.test; import ca.ucalgary.seahawk.gui.MobyContentGUI; @@ -32,6 +25,13 @@ import java.util.List; import java.util.Vector; +/** + * Tests all of the major functionality of Seahawk, the standalone MOBY + * browser that can be embedded in other applications too. If you add classes + * to Seahawk, you MUST test them here, otherwise they will not end up in the + * Seahawk deployment JAR. + */ + public class SeahawkTestCase extends JFCTestCase{ private final static String TEST_MOBYEX_XML = "ca/ucalgary/seahawk/gui/test/moby_exception.xml"; private final static String TEST_MOBY_XML = "ca/ucalgary/seahawk/gui/test/allDataTypes.xml"; From gordonp at dev.open-bio.org Thu Feb 8 11:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18Gxw3i027394@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test In directory dev.open-bio.org:/tmp/cvs-serv27169/main/org/biomoby/service/test Modified Files: ConvertAAtoFASTA_AA.java FromFastaToDNASequence.java Log Message: Documentation updates moby-live/Java/src/main/org/biomoby/service/test ConvertAAtoFASTA_AA.java,1.1,1.2 FromFastaToDNASequence.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/ConvertAAtoFASTA_AA.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/test/ConvertAAtoFASTA_AA.java 2006/12/06 16:07:10 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/ConvertAAtoFASTA_AA.java 2007/02/08 16:59:58 1.2 @@ -1,13 +1,13 @@ -/** - * Simple service used for exemplary and testing purposes. - */ - package org.biomoby.service.test; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.data.*; import org.biomoby.service.*; +/** + * Simple service used for exemplary and testing purposes. + */ + @mobyService(name="ConvertAAtoFASTA_AA", type="FormatConversion", provider="moby.ucalgary.ca", @@ -19,6 +19,10 @@ public class ConvertAAtoFASTA_AA extends MobyServlet{ + /** + * Builds a FastA record from a MOBY AminoAcidSequence object. Demonstrates + * how to access fields of a MOBY object, and how to build a new object. + */ public void processRequest(MobyDataJob request, MobyDataJob result) throws Exception{ // The input parameter for this method is registered as "inseq" MobyDataComposite aaSeqObject = (MobyDataComposite) request.get("inseq"); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/FromFastaToDNASequence.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/test/FromFastaToDNASequence.java 2006/12/06 16:07:10 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/FromFastaToDNASequence.java 2007/02/08 16:59:58 1.2 @@ -13,8 +13,19 @@ description={"Converts FastA formatted records into DNASequences, ", "primarily to increase inter-service compatibility"}) +/** + * Simple service used for testing and as an example for users of how to use exceptions + * and warnings in MOBY services. + */ + public class FromFastaToDNASequence extends MobyServlet{ + /** + * Parses a FastA string into its header component and sequence, constructing + * a MOBY DNASequence object (or subclass thereof), which can be used in more services. + * An exception will be thrown if the data doesn't appear to be FastA, or a warning + * will be added to the results if the sequence doesn't appear to be DNA. + */ public void processRequest(MobyDataJob request, MobyDataJob result) throws Exception{ // The input parameter for this method is registered as "inseq" MobyDataComposite fastaObject = (MobyDataComposite) request.get("inseq"); From gordonp at dev.open-bio.org Thu Feb 8 11:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18Gxw3E027338@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory dev.open-bio.org:/tmp/cvs-serv27169/main/org/biomoby/client Modified Files: MobyRequest.java Log Message: Documentation updates moby-live/Java/src/main/org/biomoby/client MobyRequest.java,1.21,1.22 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2006/11/21 21:03:48 1.21 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2007/02/08 16:59:58 1.22 @@ -773,6 +773,7 @@ throw me; } catch(Exception e){ + e.printStackTrace(); throw new MobyException("Could not create MOBY payload XML from input data: " +e); } From gordonp at dev.open-bio.org Thu Feb 8 11:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18GxwPZ027232@dev.open-bio.org> gordonp Thu Feb 8 11:59:57 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv27169/main/ca/ucalgary/seahawk/gui Modified Files: FileAndTextTransferHandler.java MobyContentClipboard.java MobyContentGUI.java MobyContentHelpPane.java MobyContentPane.java MobySaveDialog.java MobyServicesGUI.java MobyShimmer.java Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/gui FileAndTextTransferHandler.java,1.2,1.3 MobyContentClipboard.java,1.1,1.2 MobyContentGUI.java,1.3,1.4 MobyContentHelpPane.java,1.1,1.2 MobyContentPane.java,1.3,1.4 MobySaveDialog.java,1.1,1.2 MobyServicesGUI.java,1.6,1.7 MobyShimmer.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2006/12/15 04:40:36 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2007/02/08 16:59:57 1.3 @@ -1,8 +1,3 @@ -/* - * This class allows Seahawk to accept drop events from the native - * windowing system, so dropped files, URLs and string can be loaded into - * tabs. Dragging from Seahawk tabs is not yet supported. - */ package ca.ucalgary.seahawk.gui; import org.biomoby.shared.MobyPrefixResolver; @@ -21,6 +16,11 @@ import javax.swing.*; import javax.swing.text.*; +/* + * This class allows Seahawk to accept drop events from the native + * windowing system, so dropped files, URLs and string can be loaded into + * tabs. Dragging from Seahawk tabs is not yet supported. + */ class FileAndTextTransferHandler extends TransferHandler { private DataFlavor fileFlavor, stringFlavor; private MobyContentGUI gui; @@ -169,7 +169,7 @@ } } catch(Exception e){ // Not good MOBY XML, oh well, lets fall back on the HTML-based display below... - //e.printStackTrace(); + e.printStackTrace(); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentClipboard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentClipboard.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentClipboard.java 2007/02/08 16:59:57 1.2 @@ -1,7 +1,3 @@ -/** - * The clipboard is a special tab that holds a query with a MOBY Collection - * that the user can add and subtract MobyDataInstances from. - */ package ca.ucalgary.seahawk.gui; @@ -29,6 +25,10 @@ import java.net.URL; import java.util.*; +/** + * The clipboard is a special tab that holds a query with a MOBY Collection + * that the user can add and subtract MobyDataInstances from. + */ public class MobyContentClipboard extends MobyContentPane implements ActionListener{ public final static String CLEAR_CLIPBOARD_OPTION = "Clear Clipboard"; public final static String CLIPBOARD_FILE_NAME = "SeaHawkClipboard"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2006/10/26 00:37:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2007/02/08 16:59:57 1.4 @@ -22,9 +22,8 @@ import ca.ucalgary.seahawk.util.DescriptiveFileFilter; /** - * A class for textually displaying the data in a MOBY content XML document. - * We use this in Bluejay for example, so that following a MOBY link doesn't destroy - * the current XML document you are visualizing in the main window. + * Main interface component: textually displays the data in a MOBY content XML document. + * For details on embedding in your own app, please see the documentation. * * @author Paul Gordon (gordonp at ucalgary.ca) */ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentHelpPane.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentHelpPane.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentHelpPane.java 2007/02/08 16:59:57 1.2 @@ -23,6 +23,10 @@ import java.util.Iterator; import java.util.TreeMap; +/** + * Special text display tab in Seahawk for the Seahawk help file. Ensures that + * links and services are launched in new tabs so that the help doesn't disappear. + */ public class MobyContentHelpPane extends MobyContentPane{ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java 2006/12/14 22:20:10 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java 2007/02/08 16:59:57 1.4 @@ -50,6 +50,11 @@ import java.util.StringTokenizer; import java.util.Vector; +/** + * Text area contained in a Seahawk GUI tab. Displays HTML, RTF, text etc. using a JEditorPane. + * Also provides link handling (including service options popup) and drag 'n' drop capabilities. + */ + public class MobyContentPane extends JPanel implements Printable, CaretListener, HyperlinkListener, MouseListener, MobyRequestEventHandler{ public static final String MOBY_SERVICE_POPUP_NAME = "seahawkServicePopup"; public static final String WAITING_TAB_ICON_RESOURCE = "ca/ucalgary/seahawk/resources/images/hourglass.gif"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySaveDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySaveDialog.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySaveDialog.java 2007/02/08 16:59:57 1.2 @@ -6,7 +6,7 @@ import ca.ucalgary.seahawk.util.DescriptiveFileFilter; /** - * A utility to save the current document as XML or HTML. + * A utility to save the current document as XML or HTML, or the tab's history as a workflow (SCUFL format). * * @author Paul Gordon */ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/11/01 23:44:34 1.6 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2007/02/08 16:59:57 1.7 @@ -17,6 +17,10 @@ import javax.swing.event.PopupMenuListener; import javax.swing.event.PopupMenuEvent; +/** + * Implementation of the actually popup menu that lists services available, and invokes them. + */ + public class MobyServicesGUI implements ActionListener, Comparator, PopupMenuListener{ public final static int MAX_ID_LEN = 30; public final static String SERVICE_SUBMENU_NAME = "seahawkPopupSubMenuName"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyShimmer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyShimmer.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyShimmer.java 2007/02/08 16:59:57 1.2 @@ -1,11 +1,5 @@ package ca.ucalgary.seahawk.gui; -/** - * The purpose of this class is to improve service interoperability "shims" by - * checking the MOBY service listings for services that do format conversion - * on the given data, then adds service options for the output types of those services, - * if they aren't in the menu already. - */ import ca.ucalgary.seahawk.services.MobyClient; import javax.swing.*; @@ -23,6 +17,12 @@ import java.text.Collator; import java.util.*; +/** + * The purpose of this class is to improve service interoperability "shims" by + * checking the MOBY service listings for services that do format conversion + * on the given data, then adds service options for the output types of those services, + * if they aren't in the menu already. Not fully functional yet. + */ public class MobyShimmer implements MobyRequestEventHandler{ public static final String MOBY_SHIM_SERVICE_TYPE = "FormatConversion"; From gordonp at dev.open-bio.org Thu Feb 8 11:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18GxwHm027428@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv27169/main/org/biomoby/shared/data Modified Files: MobyDataJob.java MobyDataObjectVector.java MobyDataServiceAssocInstance.java package.html Log Message: Documentation updates moby-live/Java/src/main/org/biomoby/shared/data MobyDataJob.java,1.2,1.3 MobyDataObjectVector.java,1.1,1.2 MobyDataServiceAssocInstance.java,1.2,1.3 package.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataJob.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/data/MobyDataJob.java 2006/12/11 19:00:07 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataJob.java 2007/02/08 16:59:58 1.3 @@ -1,3 +1,9 @@ +package org.biomoby.shared.data; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Vector; + /** * Groups together the primary and secondary data corresponding to a MOBY XML "mobyData" block, i.e. * a request for, or response from, a service. One or more MobyDataJobs can be put in one MobyContentInstance @@ -6,12 +12,6 @@ * would with any Map. */ -package org.biomoby.shared.data; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Vector; - public class MobyDataJob extends HashMap{ protected String id = "no id specified"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObjectVector.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/data/MobyDataObjectVector.java 2006/07/07 04:12:40 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObjectVector.java 2007/02/08 16:59:58 1.2 @@ -1,9 +1,3 @@ -/** - * This class is primarily intended for use by MobyDataComposite to represent - * Object members in the HAS (i-to-many) relationship. Not all MobyDataObject - * behaviours are well defined for this object, but should rather be called on its members. - * If you are looking to represent a MOBY XML Collection please see MobyDataObjectSet. - */ package org.biomoby.shared.data; @@ -16,6 +10,12 @@ import org.biomoby.shared.MobyPrefixResolver; import org.biomoby.shared.MobyRelationship; +/** + * This class is primarily intended for use by MobyDataComposite to represent + * Object members in the HAS (1-to-many) relationship. Not all MobyDataObject + * behaviours are well defined for this object, but should rather be called on its members. + * If you are looking to represent a MOBY XML Collection please see MobyDataObjectSet. + */ public class MobyDataObjectVector extends MobyDataObject implements List{ private Vector members; @@ -32,7 +32,7 @@ members = new Vector(initialCapacity); } - // TODO: deal with cloning, CRIB and RIB setting + // TODO: deal with cloning, CRIB and PIB setting public String toXML(){ StringBuffer concatXML = new StringBuffer(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataServiceAssocInstance.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/data/MobyDataServiceAssocInstance.java 2006/07/07 04:12:40 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataServiceAssocInstance.java 2007/02/08 16:59:58 1.3 @@ -1,3 +1,7 @@ +package org.biomoby.shared.data; + +import org.biomoby.shared.MobyService; + /** * This interface defines a data instance that has already had remote * MOBY services associated with it, probably through a call to MOBY central. @@ -5,10 +9,6 @@ * take it as valid input. */ -package org.biomoby.shared.data; - -import org.biomoby.shared.MobyService; - public interface MobyDataServiceAssocInstance extends MobyDataInstance { public MobyService[] getServices(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/package.html,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/data/package.html 2006/07/07 04:12:40 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/package.html 2007/02/08 16:59:58 1.2 @@ -6,6 +6,6 @@ The package org.biomoby.shared.data allows you to easily build MOBY data instances for sending to services, or querying -the registry. Please see the In Anger +the registry. Please see the In Anger document for more information.

    From gordonp at dev.open-bio.org Thu Feb 8 11:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18GxwNU027368@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service In directory dev.open-bio.org:/tmp/cvs-serv27169/main/org/biomoby/service Modified Files: Asynchronous.java MobyServlet.java mobyService.java Log Message: Documentation updates moby-live/Java/src/main/org/biomoby/service Asynchronous.java,1.1,1.2 MobyServlet.java,1.4,1.5 mobyService.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/Asynchronous.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/Asynchronous.java 2006/12/06 16:07:10 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/Asynchronous.java 2007/02/08 16:59:58 1.2 @@ -1,3 +1,5 @@ +package org.biomoby.service; + /** * This interface is used by MobyServlet to determine if the processRequest() * method should be spawned in a separate thread. Any subclass of MobyServlet @@ -5,6 +7,4 @@ * the maximum number of threads allowed is the number of processors on the machine. */ -package org.biomoby.service; - public interface Asynchronous{} =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/MobyServlet.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/MobyServlet.java 2006/12/07 16:37:36 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/MobyServlet.java 2007/02/08 16:59:58 1.5 @@ -1,12 +1,5 @@ -package org.biomoby.service; - -/** - * This the base implementation of a MOBY servlet that can be - * easily extended to provide a meaningful service (by overriding - * processRequest()). Please see - * the documentation on how to use this servlet. - */ +package org.biomoby.service; import org.biomoby.service.test.TestServletConfig; import org.biomoby.service.test.TestServletContext; @@ -33,6 +26,13 @@ import java.util.Vector; import java.math.*; +/** + * This the base implementation of a MOBY servlet that can be + * easily extended to provide a meaningful service (by overriding + * processRequest()). Please see + * the documentation on how to use this servlet. + */ + @mobyService(name="MobyServlet", type="Testing", provider="moby.ucalgary.ca", @@ -1112,7 +1112,7 @@ * To add any other type of non-fatal error (e.g. a WARN), call addException() explicitly, * rather than throwing a Java Exception which stops the job's execution. * - * @param request the request to process, with params guaranteed to be of the type specified in WEB-INF/web.xml + * @param request the request to process, with params guaranteed to be of the type specified in the mobyService annotation, or values overriding the annjotation in a WAR file's WEB-INF/web.xml */ public void processRequest(MobyDataJob request, MobyDataJob result) throws Exception{ } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/mobyService.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/mobyService.java 2006/12/04 22:33:50 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/mobyService.java 2007/02/08 16:59:58 1.2 @@ -1,13 +1,14 @@ package org.biomoby.service; +import java.lang.annotation.*; + /** * Indicates that the annotated class is a MOBY Semantic Web Service, * and provides the information that will populate the MOBY Central - * registry for this service instance. + * registry for this service instance. For information on how to use this + * interface, please see the MobyServlet HOW-TO. */ -import java.lang.annotation.*; - @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Documented From gordonp at dev.open-bio.org Thu Feb 8 11:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18Gxw7B027316@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv27169/main/ca/ucalgary/seahawk/util Modified Files: DynamicJPopupMenu.java MobyUtils.java NamespaceContextImpl.java PrintableJEditorPane.java Sequence.java Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/util DynamicJPopupMenu.java,1.1,1.2 MobyUtils.java,1.4,1.5 NamespaceContextImpl.java,1.1,1.2 PrintableJEditorPane.java,1.1,1.2 Sequence.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/DynamicJPopupMenu.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/DynamicJPopupMenu.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/DynamicJPopupMenu.java 2007/02/08 16:59:58 1.2 @@ -1,5 +1,8 @@ package ca.ucalgary.seahawk.util; +import java.awt.Component; +import javax.swing.*; + /** * This class was created to overcome the basic issue that JPopupMenus do not like to be resized * once they have been set visible. To do this, you must make it invisible, add/delete items, and @@ -11,11 +14,6 @@ * @author Paul Gordon gordonp at ucalgary.ca */ - -import java.awt.Component; -import javax.swing.*; - - public class DynamicJPopupMenu extends JPopupMenu{ private Object semaphore; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/27 20:11:01 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2007/02/08 16:59:58 1.5 @@ -10,6 +10,11 @@ import java.util.Vector; import javax.swing.JLabel; +/** + * Contains utility methods for Moby Object creation from unstructured data, and for + * creating the Seahawk GUI. + */ + public class MobyUtils{ public static final int MAX_OBJ_NAME_LEN = 18; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/NamespaceContextImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/NamespaceContextImpl.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/NamespaceContextImpl.java 2007/02/08 16:59:58 1.2 @@ -1,7 +1,3 @@ -/** - * This class is used to provide namespace context for XPath espression evaluation - * in the Seahawk data mapping rules file. - */ package ca.ucalgary.seahawk.util; @@ -13,6 +9,10 @@ import java.util.Iterator; import java.util.Map; +/** + * This class is used to provide namespace context for XPath espression evaluation + * in the Seahawk data mapping rules file. + */ public class NamespaceContextImpl implements NamespaceContext, PrefixResolver{ private Map prefixes; private Map nsURIs; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/PrintableJEditorPane.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/PrintableJEditorPane.java 2006/10/25 02:33:23 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/PrintableJEditorPane.java 2007/02/08 16:59:58 1.2 @@ -1,8 +1,3 @@ -/** - * A class used to make the rendered contents of a JEditorPane printable in Java. - * - * @author Paul Gordon (gordonp at ucalgary.ca) - */ package ca.ucalgary.seahawk.util; import java.awt.Dimension; @@ -14,6 +9,11 @@ import javax.swing.JEditorPane; import javax.swing.RepaintManager; +/** + * A class used to make the rendered contents of a JEditorPane printable in Java. + * + * @author Paul Gordon (gordonp at ucalgary.ca) + */ public class PrintableJEditorPane extends JEditorPane implements Printable{ public int print (Graphics g, PageFormat pf, int pageIndex) throws PrinterException{ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java 2006/10/25 02:33:23 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java 2007/02/08 16:59:58 1.2 @@ -1,9 +1,9 @@ +package ca.ucalgary.seahawk.util; + /** - * Utility methods to report properties of DNA and protein sequence + * Utility methods to report properties of DNA and protein sequence. */ -package ca.ucalgary.seahawk.util; - public class Sequence{ /** From gordonp at dev.open-bio.org Thu Feb 8 12:00:21 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 12:00:21 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081700.l18H0LEx027473@dev.open-bio.org> gordonp Thu Feb 8 12:00:21 EST 2007 Update of /home/repository/moby/moby-live/Java In directory dev.open-bio.org:/tmp/cvs-serv27438 Modified Files: build.xml Log Message: Documentation updates moby-live/Java build.xml,1.62,1.63 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- /home/repository/moby/moby-live/Java/build.xml 2006/12/06 16:07:10 1.62 +++ /home/repository/moby/moby-live/Java/build.xml 2007/02/08 17:00:21 1.63 @@ -351,7 +351,7 @@ packages="org.biomoby.shared,org.biomoby.shared.*"/> + packages="org.biomoby.client,org.biomoby.client.*:ca.ucalgary.seahawk.*"/> From gordonp at dev.open-bio.org Thu Feb 8 12:01:30 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 12:01:30 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081701.l18H1U9U027556@dev.open-bio.org> gordonp Thu Feb 8 12:01:30 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv27525/src/main/ca/ucalgary/seahawk/gui Added Files: package.html Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/gui package.html,NONE,1.1 From gordonp at dev.open-bio.org Thu Feb 8 12:05:12 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 12:05:12 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081705.l18H5Cu9027658@dev.open-bio.org> gordonp Thu Feb 8 12:05:11 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv27623/src/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/02/08 16:59:58 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/02/08 17:05:11 1.5 @@ -31,7 +31,9 @@ /** * The engine that finds MOBY data in unstructured text or DOM of other XML languages according - * to a rules database. Used in Seahawk to provide the service options popup items. + * to a rules database. The format of this database is + * described + * here. Used in Seahawk to provide the service options popup items. */ public class MobyClient { From mwilkinson at dev.open-bio.org Thu Feb 8 13:44:52 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 13:44:52 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081844.l18Iiq2W027993@dev.open-bio.org> mwilkinson Thu Feb 8 13:44:52 EST 2007 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory dev.open-bio.org:/tmp/cvs-serv27974/Perl Modified Files: RegisterServiceInstance.html Added Files: ExecuteSyncService.html Log Message: adding the Execute Service tutorial moby-live/Docs/MOBY-S_API/Perl ExecuteSyncService.html,NONE,1.1 RegisterServiceInstance.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterServiceInstance.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterServiceInstance.html 2007/02/07 01:10:22 1.5 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterServiceInstance.html 2007/02/08 18:44:51 1.6 @@ -103,23 +103,27 @@ # now start constructing the descriptions of your inputs and outputs: + # a list of valid input namespaces my @input_namespaces = ('GO'); -# a list of valid input namespaces + # a list of inputs and their namespaces, in this case, a single input 'Object' my @input_simples = ('Object', \@input_namespaces); -# a list of inputs and their namespaces, in this case, a single input 'Object' -my @input_articles = ('', \@input_simples); -# a list of named input articles + # note: if you alternately wanted to consume a collection of inputs as opposed + # to a simple input, you would have done the following: + # my @input_simples = (['Object', \@input_namespaces)]); + # a list of named input articles +my @input_articles = ('my_input_parametername', \@input_simples); + # the complete set of inputs to a single invocation of the service my @all_inputs = (\@input_articles); -# the complete set of inputs to a single invocation of the service + + # a list of valid input namespaces my @output_namespaces = ('GO'); -# a list of valid input namespaces + # a list of outputs and their namespaces, in this case, a single output type 'GO_Term' my @output_simples = ('GO_Term', \@output_namespaces); -# a list of outputs and their namespaces, in this case, a single output type 'GO_Term' -my @output_articles = ('', \@output_simples); -# a list of (un)named output articles + # a list of (un)named output articles +my @output_articles = ('my_output_parametername', \@output_simples); + # the complete set of outputs from a single invocation of the service my @all_outputs = (\@output_articles); -# the complete set of outputs from a single invocation of the service $REG = $m->registerService( serviceName => $serviceName, From mwilkinson at dev.open-bio.org Thu Feb 8 13:50:24 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 13:50:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081850.l18IoOk1028055@dev.open-bio.org> mwilkinson Thu Feb 8 13:50:24 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv28032/MOBY/Client Modified Files: Service.pm ServiceInstance.pm Log Message: fixing documentation moby-live/Perl/MOBY/Client Service.pm,1.32,1.33 ServiceInstance.pm,1.18,1.19 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/06 21:46:12 1.32 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/08 18:50:24 1.33 @@ -166,11 +166,12 @@ To have the service iterate over multiple equivalent objects, and return all the results in a single message, use this syntax (ARGS = -([...], [...], ...): +([...], [...], ...). Here, the articleName of the input parameter is +"input1": $Service->execute(XMLinputlist => [ - ['object1', ''], - ['object2', ''] + ['input1', ''], + ['input1', ''] ]); This would invoke the service twice (in a single message) the first @@ -178,10 +179,11 @@ =item Process a Collection -To pass in a Collection, you need this syntax (ARGS = [ '', [..., ..., ...] ]): +To pass in a Collection, you need this syntax (ARGS = [ '', [..., ..., ...] ]). +Here, the articleName of the input is "input1". $Service->execute(XMLinputlist => [ - ['', [ + ['input1', [ '', ''] ]); @@ -191,7 +193,9 @@ =item Process multiple Simple inputs -To pass in multiple inputs, to be considered neither a Collection nor sequentially evaluated, use this syntax (ARGS = [..., ..., ...]) +To pass in multiple inputs, to be considered neither a Collection nor sequentially +evaluated, use this syntax (ARGS = [..., ..., ...]). Here, the service consumes +two inputs with articleName input1 and input2 $Service->execute(XMLinputlist => [ [ @@ -200,8 +204,7 @@ ] ]); -This would cause a single invocation of a service requiring two input -parameters named "input1" and "input2" +This would cause a single invocation of a service. =item Parameters =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2006/08/10 23:05:18 1.18 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2007/02/08 18:50:24 1.19 @@ -98,6 +98,17 @@ =cut +=head2 category + + Title : category + Usage : $category = $Service->category($arg) + Args : (optional) scalar string with moby service category ['moby' | 'post' | 'moby-async'] + Function : get/set category + Returns : string + +=cut + + =head2 input Title : input From mwilkinson at dev.open-bio.org Thu Feb 8 18:03:45 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 18:03:45 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702082303.l18N3jFm031340@dev.open-bio.org> mwilkinson Thu Feb 8 18:03:45 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv31321/MOBY Modified Files: CommonSubs.pm Log Message: significant updates to CommonSubs. Revamp of documentation to reveal client-side functionality that hasnt been discussed anywhere else. Added a new function (just a renamed reference to an old function) to show that the server-side parser can also be used client-side for parsing a MOBY message. rearranged order of functions in documentation to make more sense. moby-live/Perl/MOBY CommonSubs.pm,1.93,1.94 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/01/30 22:50:52 1.93 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/02/08 23:03:45 1.94 @@ -23,11 +23,58 @@ FUNCTION WITH SERVICES THAT ARE NOT COMPLIANT WITH THE NEW API - FOR EXAMPLE SERVICES THAT ARE NOT USING NAMED INPUTS AND OUTPUTS! -=head1 PARADIGMATIC USAGE +=head1 COMMON USAGE EXAMPLES =head2 Client Side Paradigm -not written yet + +The following is a generalized architecture for all +BioMOBY services showing how to parse response messages +using the subroutines provided in CommonSubs + +=head3 Services Returning Simples + + my $resp = $SI->execute(XMLInputList => \@input_data); + + my $responses = serviceResponseParser($resp); # returns MOBY objects + foreach my $queryID(keys %$responses){ + $this_invocation = $inputs->{$queryID}; # this is the block with this queryID + my $this_output = ""; + + if (my $data = $this_invocation->{'responseArticleName'}){ + # $data is a MOBY::Client::Simple|Collection|ParameterArticle + my ($namespace) = @{$data->namespaces}; + my $id = $data->id; + my $XML_LibXML = $input->XML_DOM; # get access to the DOM + my $desc = getNodeContentWithArticle($XML_LibXML, "String", "Description"); + ################### + # DO SOMETHING TO RESPOSE DATA HERE + ################### + } + + } + + +=head3 Services Returning Collections + + my $resp = $SI->execute(XMLInputList => \@input_data); + + my $responses = serviceResponseParser($resp); # returns MOBY objects + foreach my $queryID(keys %$responses){ # $inputs is a hashref of $input{queryid}->{articlename} = input object + my $this_invocation = $inputs->{$queryID}; + if (my $data = $this_invocation->{'responseArticleName'}){ # $input is a MOBY::Client::Simple|Collection|Parameter object + my $simples = $data->Simples; + foreach my $simple(@$simples){ + my $id = $simple->id; + my $id = $simple->namespace; + my $XML_LibXML = $input->XML_DOM; # get access to the DOM + + } + } + } + + + =head2 Service-Side Paradigm @@ -35,7 +82,7 @@ BioMOBY services showing how to parse incoming messages using the subroutines provided in CommonSubs -=head3 SIMPLE SERVICES +=head3 Services Generating simple outputs sub _generic_service_name { my ($caller, $data) = @_; @@ -68,7 +115,7 @@ return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); } -=head3 COLLECTION SERVICES +=head3 Services generating collection outputs sub _generic_service_returning_collections { my($caller, $message) = @_; @@ -169,12 +216,6 @@ } -=head1 AUTHORS - -Mark Wilkinson (markw at illuminae dot com), Pieter Neerincx, Frank Gibbons - -BioMOBY Project: http://www.biomoby.org - =cut package MOBY::CommonSubs; @@ -243,32 +284,38 @@ our @EXPORT_OK = (@{$EXPORT_TAGS{'all'}}); -=head1 PARSING MOBY SERVICE INVOCATIONS +=head1 PARSING MOBY INPUT AND OUTPUT -=head2 serviceInputParser +=head2 serviceInputParser and serviceResponseParser -B This routine will take a MOBY service invocation -message and extract the Simple/Collection/Parameter objects out of it +B These routines will take a Moby invocation (server side usage) or +response (client-side usage) and extract the Simple/Collection/Parameter objects out of it as MOBY::Client::SimpleArticle, MOBY::Client::CollectionArticle, and/or MOBY::Client::SecondaryArticle objects. The inputs are broken -up into individual queryID's (invocations). Each queryID is associated with -one or more individual input articles that are required to invoke that service, and -each input article is available by its articleName. +up into individual queryID's. Each queryID is associated with +one or more individual articles, and each article is available by its articleName. -B C +B C +B C B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message -B C<$inputs> is a hashref with the following structure: +B C<$inputs> or C<$outputs> are a hashref with the following structure: - $inputs->{$queryID}->{articleName} = + $Xputs->{$queryID}->{articleName} = MOBY::Client::SimpleArticle | MOBY::Client::CollectionArticle | MOBY::Client::SecondaryArticle -See also: +the SimpleArticle and CollectionArticle have methods to provide you with their +objectType, their namespace and their ID. If you want to get more out of them, +you should retrieve the XML::LibXML DOM using the ->XML_DOM method call +in either of those objects. This can be passed into other CommonSubs routines +such as getNodeContentWithArticle in order to retrieve sub-components of the +Moby object you have in-hand. +See also: =head3 Simples @@ -289,8 +336,7 @@ $inputs->{a1a}->{cutoff} = $MOBY::Client::Secondary # block - -=head3 Collections +=head3 Collections With inputs that have collections these are presented as a listref of Simple article DOM's. So for the following message: @@ -311,8 +357,8 @@ will become - $inputs->{2b2}->{name1} $MOBY::Client::Collection, # the Block - $inputs->{2b2}->{cutoff} $MOBY::Client::Secondary, # the Block + $inputs->{2b2}->{name1} = $MOBY::Client::Collection, # the Block + $inputs->{2b2}->{cutoff} = $MOBY::Client::Secondary, # the Block @@ -322,11 +368,11 @@ sub serviceInputParser { my ( $message ) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs( $message ); # returns XML::LibXML nodes ... + my @queries = _getInputs( $message ); # returns XML::LibXML nodes ... my %input_parameters; # $input_parameters{$queryID} = [ foreach my $query ( @queries ) { - my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData - my @input_articles = getArticlesAsObjects( $query ); + my $queryID = _getQID( $query ); # get the queryID attribute of the mobyData + my @input_articles = _getArticlesAsObjects( $query ); foreach my $article ( @input_articles ) { ${$input_parameters{$queryID}}{$article->articleName} = $article; } @@ -334,7 +380,58 @@ return \%input_parameters; } +*serviceResponseParser = \&serviceInputParser; +*serviceResponseParser = \&serviceInputParser; + +sub _getInputs { + my ( $XML ) = @_; + my $moby = _string_to_DOM($XML); + my @queries; + foreach my $querytag qw(mobyData moby:mobyData ) + { + my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block + for ( 1 .. $x->size() ) { # there may be more than one mobyData per message + push @queries, $x->get_node( $_ ); + } + } + return @queries; # return them in the order that they were discovered. +} + + +sub _getArticlesAsObjects { + my ( $moby ) = @_; + $moby = _string_to_DOM($moby); + return undef unless $moby->nodeType == ELEMENT_NODE; + return undef + unless ($moby->nodeName =~ /^(moby:|)mobyData$/); + my @articles; + foreach my $child ( $moby->childNodes ) + { # there may be more than one Simple/Collection per input; iterate over them + next unless $child->nodeType == ELEMENT_NODE; # ignore whitespace + next + unless ( $child->nodeName =~ /^(moby:|)(Simple|Collection|Parameter)$/ ); + my $object; + if ( $child->nodeName =~ /^(moby:|)Simple$/ ) { + $object = MOBY::Client::SimpleArticle->new( XML_DOM => $child ); + } elsif ( $child->nodeName =~ /^(moby:|)Collection$/ ) { + $object = MOBY::Client::CollectionArticle->new( XML_DOM => $child ); + } elsif ( $child->nodeName =~ /^(moby:|)Parameter$/ ) { + $object = MOBY::Client::SecondaryArticle->new( XML_DOM => $child ); + } + next unless $object; + push @articles, $object; # take the child elements, which are or + } + return @articles; # return them. +} + +sub _getQID { + my ( $XML ) = @_; + my $moby = _string_to_DOM($XML); + return '' unless ( $moby->nodeName =~ /^(moby:|)mobyData$/ ); + my $qid = _moby_getAttribute($moby, 'queryID' ); + return defined( $qid ) ? $qid : ''; +} =head1 MESSAGE COMPONENT IDENTITY AND VALIDATION @@ -735,6 +832,65 @@ } +=head1 Client-Side Common Subroutines + +These are the subroutines that will be most commonly used Client-Side for +processing the output of a MOBY service + +=head2 processResponse + +=cut + +sub processResponse { + my ( $result ) = @_; + return ( [], [] ) unless $result; + my $moby; + unless ( ref( $result ) =~ /XML\:\:LibXML/ ) { + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string( $result ); + $moby = $doc->getDocumentElement(); + } else { + $moby = $result->getDocumentElement(); + } + my @objects; + my @collections; + my @Xrefs; + my $success = 0; + foreach my $which ('mobyData', 'moby:mobyData') { + my $responses = $moby->getElementsByTagName( $which ); + next unless $responses; + foreach my $n ( 1 .. ( $responses->size() ) ) { + my $resp = $responses->get_node( $n ); + foreach my $response_component ( $resp->childNodes ) { + next unless $response_component->nodeType == ELEMENT_NODE; + if ( $response_component->nodeName =~ /^(moby:|)Simple$/ ) + { + foreach my $Object ( $response_component->childNodes ) { + next unless $Object->nodeType == ELEMENT_NODE; + $success = 1; + push @objects, $Object; + } + } elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ ) + { + my @objects; + foreach my $simple ( $response_component->childNodes ) { + next unless $simple->nodeType == ELEMENT_NODE; + next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ ); + foreach my $Object ( $simple->childNodes ) { + next unless $Object->nodeType == ELEMENT_NODE; + $success = 1; + push @objects, $Object; + } + } + push @collections, \@objects + ; #I'm not using collections yet, so we just use Simples. + } + } + } + } + return ( \@collections, \@objects ); +} + =head1 ANCILIARY ELEMENTS @@ -879,16 +1035,13 @@ } -=head1 MISCELLANEOUS +=head1 MISCELLANEOUS FUNCTIONS This section contains routines that didn't quite seem to fit anywhere else. -=cut - - =head2 getNodeContentWithArticle - give me a DOM, a TagName, an articleName and I will return you the content +B give me a DOM, a TagName, an articleName and I will return you the content of that node **as a string** (beware if there are additional XML tags in there!) this is meant for MOBYesque PRIMITIVES - things like: TAGCTGATCGAGCTGATGCTGA @@ -1032,24 +1185,21 @@ } - -=head2 _moby_getAttributeNode, _moby_getAttribute - -B Perform the same task as the DOM routine -getAttribute(Node), but check for both the prefixed and un-prefixed -attribute name (the prefix in question being, of course, -"moby:"). - -B - - $id = _moby_getAttribute($xml_libxml, "id"); - -where C is an attribute in the XML block given as C<$xml_libxml> - -B This function is intended for use internal to this package -only. It's not exported. - -=cut +#B Perform the same task as the DOM routine +#getAttribute(Node), but check for both the prefixed and un-prefixed +#attribute name (the prefix in question being, of course, +#"moby:"). +# +#B +# +# $id = _moby_getAttribute($xml_libxml, "id"); +# +#where C is an attribute in the XML block given as C<$xml_libxml> +# +#B This function is intended for use internal to this package +#only. It's not exported. +# +#=cut sub _moby_getAttributeNode { # Mimics behavior of XML::LibXML method getAttributeNode, but if the unqualified attribute cannot be found, @@ -1214,11 +1364,30 @@ sub _getQueryID { my ( $query ) = @_; $query = _string_to_XML($query); - return '' unless ( $query->nodeName =~ /^(moby:|)(queryInput|mobyData)$/ ); #Eddie - unsure + return '' unless ( $query->nodeName =~ /^(moby:|)mobyData$/ ); #Eddie - unsure return _moby_getAttribute($query, 'queryID' ); } -=head1 DEPRECATED + +sub _string_to_DOM { +# Convert string to DOM. +# If DOM passed in, just return it (i.e., this should be idempotent) +# By Frank Gibbons, Aug. 2005 +# Utility subroutine, not for external use (no export), widely used in this package. + my $XML = shift; + my $moby; + return $XML if ( ref($XML) =~ /^XML\:\:LibXML/ ); + + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ) }; + die("CommonSubs couldn't parse XML '$XML' because\n\t$@") if $@; + return $doc->getDocumentElement(); +} + + + +=head1 DEPRECATED FUNCTIONS =head2 genericServiceInputParser @@ -1228,6 +1397,7 @@ =cut sub genericServiceInputParser { +print STDERR "the genericServiceInputParser function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $message ) = @_; # get the incoming MOBY query XML my @inputs; # set empty response my @queries = getInputs( $message ); # returns XML::LibXML nodes ... @@ -1259,6 +1429,7 @@ =cut sub complexServiceInputParser { +print STDERR "the complexServiceInputParser function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $message ) = @_; # get the incoming MOBY query XML my @inputs; # set empty response my @queries = getInputs( $message ); # returns XML::LibXML nodes ... @@ -1291,6 +1462,7 @@ =cut sub getArticles { +print STDERR "the getArticles function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef @@ -1316,6 +1488,7 @@ sub getSimpleArticleIDs { +print STDERR "the getSimpleArticleIDs function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $desired_namespace, $input_nodes ) = @_; if ( $desired_namespace && !$input_nodes ) { # if called with ONE argument, then these are the input nodes! @@ -1390,6 +1563,7 @@ sub getSimpleArticleNamespaceURI { +print STDERR "the getSimpleArticleNamespaceURI function of MOBY::CommonSubs is deprecated. Please see documentation\n"; # pass me a input node and I will give you the lsid of the namespace of that input object my ( $input_node ) = @_; @@ -1410,21 +1584,6 @@ } } -sub _string_to_DOM { -# Convert string to DOM. -# If DOM passed in, just return it (i.e., this should be idempotent) -# By Frank Gibbons, Aug. 2005 -# Utility subroutine, not for external use (no export), widely used in this package. - my $XML = shift; - my $moby; - return $XML if ( ref($XML) =~ /^XML\:\:LibXML/ ); - - my $parser = XML::LibXML->new(); - my $doc; - eval { $doc = $parser->parse_string( $XML ) }; - die("CommonSubs couldn't parse XML '$XML' because\n\t$@") if $@; - return $doc->getDocumentElement(); -} =head2 getInputs @@ -1433,6 +1592,7 @@ =cut sub getInputs { + print STDERR "getInputs is now deprecated. Please update your code to use the serviceInputParser\n"; my ( $XML ) = @_; my $moby = _string_to_DOM($XML); my @queries; @@ -1453,6 +1613,7 @@ =cut sub getInputID { + print STDERR "getInputID method is now deprecated. Please use serviceInputParser or serviceResponseParser\n"; my ( $XML ) = @_; my $moby = _string_to_DOM($XML); return '' unless ( $moby->nodeName =~ /^(moby:|)queryInput|mobyData$/ ); @@ -1467,6 +1628,7 @@ =cut sub getArticlesAsObjects { + print STDERR "getArticlesAsObjects is now deprecated. Please use the serviceInputParser"; my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef unless $moby->nodeType == ELEMENT_NODE; @@ -1499,6 +1661,7 @@ =cut sub getCollectedSimples { +print STDERR "the getCollectedSimples function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef unless $moby->nodeType == ELEMENT_NODE; @@ -1520,6 +1683,8 @@ =cut sub getInputArticles { +print STDERR "the getInputArticles function of MOBY::CommonSubs is deprecated. Please see documentation\n"; + my ( $moby ) = @_; $moby = _string_to_DOM($moby); my $x; @@ -1548,6 +1713,7 @@ =cut sub extractRawContent { +print STDERR "the extractRawContent function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $article ) = @_; return "" unless ( $article || (ref( $article ) =~ /XML\:\:LibXML/) ); my $response; @@ -1569,6 +1735,7 @@ =cut sub extractResponseArticles { +print STDERR "the extractResponseArticles function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $result ) = @_; return ( [], [] ) unless $result; my $moby; @@ -1620,6 +1787,14 @@ return ( \@collections, \@objects ); } + +=head1 AUTHORS + +Mark Wilkinson (markw at illuminae dot com), Pieter Neerincx, Frank Gibbons + +BioMOBY Project: http://www.biomoby.org + + =head1 SEE ALSO From kawas at dev.open-bio.org Thu Feb 8 18:11:34 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 8 Feb 2007 18:11:34 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702082311.l18NBYFr031443@dev.open-bio.org> kawas Thu Feb 8 18:11:34 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/SOAP In directory dev.open-bio.org:/tmp/cvs-serv31408/SOAP Modified Files: Serializer.pm Log Message: fixed the problem where a client calls DUMP and the soap fails to parse. This fix must be extended to the case where SOAP::Data is passed (if that ever happens) moby-live/Perl/MOBY/SOAP Serializer.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/SOAP/Serializer.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/SOAP/Serializer.pm 2007/02/01 14:15:11 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/SOAP/Serializer.pm 2007/02/08 23:11:34 1.2 @@ -3,7 +3,7 @@ # this module serializes SOAP messages to ensure # compatibility with other soap clients (Java) -# All that you have to do to make this your serializer, +# All that you have to do to make this your serializer, # is to uncomment, from MOBY-Central.pl, the line: # # $x->serializer(MOBY::SOAP::Serializer->new); @@ -12,8 +12,8 @@ # # MAKE SURE TO 'use MOBY::SOAP::Serializer;' # -# This ensures that mobycentral is compatible with -# SOAP-lite version >= .6 +# This ensures that mobycentral is compatible with +# SOAP-lite version >= .6 @MOBY::SOAP::Serializer::ISA = 'SOAP::Serializer'; sub envelope { @@ -21,6 +21,7 @@ # only 'transform' soap responses UNIVERSAL::isa( $_[3] => 'SOAP::Data' ) ? do { + # below encodes data #my $xml = $_[3]->value; #$xml =~ s"&"&"g; @@ -28,20 +29,29 @@ #$xml =~ s"\]\]\>"\]\]>"g; #$_[3]->value($xml); # when we set to string, we dont have to encode - $_[3]->type( 'string' => $_[3] ); + #FIXME - this wont work for the DUMP call if and when a SOAP::Data object is passed + $_[3]->type( 'string' => $_[3]->value() ); } : do { - - # below encodes data -> set type to string and we dont have to - #$_[3] =~ s"&"&"g; - #$_[3] =~ s"\<"<"g; - #$_[3] =~ s"\]\]\>"\]\]>"g; - # set to string to avoid encoding - $_[3] = SOAP::Data->type( 'string' => $_[3] ); + do { + # for dumps, they are of type array: set them accordingly + $_[3]->[0] = SOAP::Data->type( 'string' => $_[3]->[0] ) if $_[3]->[0]; + $_[3]->[1] = SOAP::Data->type( 'string' => $_[3]->[1] ) if $_[3]->[1]; + $_[3]->[2] = SOAP::Data->type( 'string' => $_[3]->[2] ) if $_[3]->[2]; + $_[3]->[3] = SOAP::Data->type( 'string' => $_[3]->[3] ) if $_[3]->[3]; + $_[3]->[4] = SOAP::Data->type( 'string' => $_[3]->[4] ) if $_[3]->[4]; + } if ( ref( $_[3] ) eq 'ARRAY' ); + do { + # below encodes data -> set type to string and we dont have to + #$_[3] =~ s"&"&"g; + #$_[3] =~ s"\<"<"g; + #$_[3] =~ s"\]\]\>"\]\]>"g; + # set to string to avoid encoding + $_[3] = SOAP::Data->type( 'string' => $_[3] ); + } unless ( ref( $_[3] ) eq 'ARRAY' ); } if $_[1] =~ /^(?:method|response)$/; - shift->SUPER::envelope(@_); } -1; +1; \ No newline at end of file From mwilkinson at dev.open-bio.org Thu Feb 8 19:19:01 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 19:19:01 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702090019.l190J1uV031851@dev.open-bio.org> mwilkinson Thu Feb 8 19:19:01 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv31832/MOBY Modified Files: CommonSubs.pm Log Message: revamping test suite for CommonSubs to use only the new methods. Please God let the deprecated methods die a horrible death. There's a lot more cleaning-up that could be done in CommonSubs with respect to using 'Local' tags rather than testing whether or not the moby: namespace is there each time, but that can come later. moby-live/Perl/MOBY CommonSubs.pm,1.94,1.95 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.94 retrieving revision 1.95 diff -u -r1.94 -r1.95 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/02/08 23:03:45 1.94 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/02/09 00:19:01 1.95 @@ -61,12 +61,12 @@ my $responses = serviceResponseParser($resp); # returns MOBY objects foreach my $queryID(keys %$responses){ # $inputs is a hashref of $input{queryid}->{articlename} = input object - my $this_invocation = $inputs->{$queryID}; + my $this_invocation = $responses->{$queryID}; if (my $data = $this_invocation->{'responseArticleName'}){ # $input is a MOBY::Client::Simple|Collection|Parameter object my $simples = $data->Simples; foreach my $simple(@$simples){ + my ($ns) = @{$simple->namespaces}; my $id = $simple->id; - my $id = $simple->namespace; my $XML_LibXML = $input->XML_DOM; # get access to the DOM } @@ -262,7 +262,7 @@ genericServiceInputParserAsObject complexServiceInputParser serviceInputParser - serviceInputParser + serviceResponseParser whichDeepestParentObject getServiceNotes simpleResponse @@ -387,9 +387,9 @@ my ( $XML ) = @_; my $moby = _string_to_DOM($XML); my @queries; - foreach my $querytag qw(mobyData moby:mobyData ) + foreach my $querytag qw(mobyData ) { - my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block + my $x = $moby->getElementsByLocalName( $querytag ); # get the mobyData block for ( 1 .. $x->size() ) { # there may be more than one mobyData per message push @queries, $x->get_node( $_ ); } @@ -667,7 +667,7 @@ the article's raw XML for simples and secondaries or a reference to an array containing [$articleName, $simpleXML] elements for a collection of simples. -C<$queryID> - (optional, but strongly recommended) the queryID value for +C<$queryID> - the queryID value for the mobyData block to which you are responding B as required by the API you must return a response for every From mwilkinson at dev.open-bio.org Thu Feb 8 19:19:01 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 19:19:01 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702090019.l190J16G031871@dev.open-bio.org> mwilkinson Thu Feb 8 19:19:01 EST 2007 Update of /home/repository/moby/moby-live/Perl/t In directory dev.open-bio.org:/tmp/cvs-serv31832/t Modified Files: CommonSubs.t Log Message: revamping test suite for CommonSubs to use only the new methods. Please God let the deprecated methods die a horrible death. There's a lot more cleaning-up that could be done in CommonSubs with respect to using 'Local' tags rather than testing whether or not the moby: namespace is there each time, but that can come later. moby-live/Perl/t CommonSubs.t,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/CommonSubs.t,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/t/CommonSubs.t 2006/06/07 20:39:27 1.6 +++ /home/repository/moby/moby-live/Perl/t/CommonSubs.t 2007/02/09 00:19:01 1.7 @@ -54,30 +54,20 @@ my @must_implement = qw/ + serviceInputParser + serviceResponseParser + simpleResponse collectionResponse complexResponse - complexServiceInputParser + isCollectionArticle + isSecondaryArticle + isSimpleArticle extractRawContent - extractResponseArticles - genericServiceInputParser - genericServiceInputParserAsObject - getArticles - getCollectedSimples getCrossReferences - getInputArticles - getInputID - getInputs getNodeContentWithArticle - getResponseArticles getServiceNotes - getSimpleArticleIDs - getSimpleArticleNamespaceURI - isCollectionArticle - isSecondaryArticle - isSimpleArticle responseFooter responseHeader - simpleResponse validateNamespaces validateThisNamespace whichDeepestParentObject @@ -86,34 +76,33 @@ can_ok('MOBY::CommonSubs', @must_implement) or diag("CommonSubs doesn't implement all the methods that it should"); -# Test each function individually - -######## PARSE INPUTS ######### -# genericServiceInputParser -# genericServiceInputParserAsObject -# complexServiceInputParser ######## EXTRACT CONTENTS ######### -my @query_ids = (1, 'a', 23, 24); -my $msg = < - - -foo -EOF - -my @inputs = getInputs(responseHeader() . $msg . responseFooter()); -is(scalar @inputs, scalar @query_ids) - or diag("Wrong number of inputs returned from getInputs"); -for (my $i = 0; $i < @query_ids; $i++) { - is(getInputID($inputs[$i]), $query_ids[$i]) - or diag("Wrong input ID returned for queryID $i: $inputs[$i]"); -} +#my @query_ids = (1, 'a', 23, 24); +#my $msg = < +#foo +#EOF +# +#my @inputs = getInputs(responseHeader() . $msg . responseFooter()); +#is(scalar @inputs, scalar @query_ids) +# or diag("Wrong number of inputs returned from getInputs"); +#for (my $i = 0; $i < @query_ids; $i++) { +# is(getInputID($inputs[$i]), $query_ids[$i]) +# or diag("Wrong input ID returned for queryID $i: $inputs[$i]"); +#} # This message contains two articles: Collection, and Parameter # The Collection, of course, contains some Simple Articles, but they are not top-level articles. -my $article_msg = < - + + + +my $moby_msg = < + + + CONTENT + + @@ -124,98 +113,54 @@ 10 - + ARTICLES -my @articles = getArticles($article_msg); -is(scalar @articles, 2) or diag("Wrong number of articles returned"); -my ($collection, $parameter) = @articles; -# Check that first one is a Collection... -is(isCollectionArticle($collection->[1]), 1) or diag("Expected Collection"); -# ...then pull out the Simples contained in it. -is(scalar getCollectedSimples($collection->[1]), 2) - or diag("Expected 2 Simples, didn't find them."); -is(isSecondaryArticle($parameter->[1]), 1) - or diag("Expected Secondary/Parameter"); - -TODO: { -local $TODO = "Need test for extractRawContent"; -#ok(extractRawContent($collection->[1]) -# =~ ".*<\/Simple>.*<\/Simple>") -# or diag("Couldn't extract raw content."); -} +my $responses = serviceResponseParser($moby_msg); # returns MOBY objects +isa_ok ($responses, "HASH", "response parser returned a HASH" ) or die "serviceResponseParser didn't return a hashref\n"; +my @ids = keys %{$responses}; +ok (scalar(@ids) == 1) or die "serviceResponseParser didn't find right number of invocation messages\n"; +ok ($ids[0] eq "query1") or die "service4ResponseParser didn't find the query1 query id\n"; + +my $this_invocation = $responses->{$ids[0]}; +ok ($this_invocation->{'simple1'}) or die "parser didn't find simple article in message\n"; +ok ($this_invocation->{'collection1'}) or die "parser didn't find collection article in message\n"; +ok ($this_invocation->{'e value cutoff'}) or die "parser didn't find secondary parameter article in message\n"; + +my $simple = $this_invocation->{'simple1'}; +my $collection = $this_invocation->{'collection1'}; +my $secondary = $this_invocation->{'e value cutoff'}; + +isa_ok($simple, "MOBY::Client::SimpleArticle") or die "retrieved Simple isn't a MOBY::Client::SimpleArticle object\n"; +isa_ok($collection, "MOBY::Client::CollectionArticle") or die "retrieved Collection isn't a MOBY::Client::CollectionArticle Object\n"; +isa_ok($secondary, "MOBY::Client::SecondaryArticle") or die "retrieved Secondary isn't a MOBY::Client::SecondaryArticle object\n"; +# other tests of the MOBY::Client::*Article should be done in their own test suite # Test getInputArticles with one, and with more than one mobyData block. my $two_mobyDatas = < - + - + + INP_ART -is(scalar getInputArticles(responseHeader() - . $article_msg - . responseFooter()), 1) - or diag("Couldn't find right number of input articles"); - -is(scalar getInputArticles(responseHeader() - . $two_mobyDatas - . responseFooter()), 2) - or diag("Couldn't find right number of input articles"); - -# getSimpleArticleIDs can be called in a number of ways, and of course, we have to test them all. -# 1. If just one argument, it's assumed to be listref of Simple DOMs, and all ID's should be returned, -# regardless of namespace -# 2. If two arguments, first is taken to be namespace. Only articlenames from that namespace will -# be returned; other articlenames will generate a 'undef' response, so that the number of inputs -# matches the number of outputs. - -my @NS = ("Rub1", "Rub2"); -my $articles = [ XML_maker(""), - XML_maker(""), - XML_maker("") - ]; - -is(getSimpleArticleIDs($articles), 3) - or diag("Wrong number of Simple Articles IDs returned (no namespace)"); -for my $ns (@NS) { # Should get three responses (one for each input), but two should be 'undef' - my @responses = getSimpleArticleIDs($ns, $articles); - is(scalar @responses, 3) - or diag("Wrong number of Simple Articles IDs returned (with namespace)"); - my $count_undef = 0; - for my $r (@responses) { $count_undef++ if (!defined ($r)) } - is($count_undef, 2) - or diag("Wrong number of 'undef's returned by getSimpleArticleIDs"); -} - -my @bogus; -my $bogus_ns = "bogus NS"; -eval { @bogus = getSimpleArticleIDs($bogus_ns, $articles) }; -isnt($@, undef) - or diag("Invalid namespace '$bogus_ns' should have 'die'd, but didn't"); -is(scalar @bogus , 0) - or diag("Wrong number of Simple Articles IDs returned " . - "(expected zero for bogus namespace)"); - -is(scalar getSimpleArticleIDs('Rub1', $articles), scalar @{$articles}) - or diag("Wrong number of Simple Articles IDs returned " . - "(expected zero for valid but unused namespace)"); - -ok(getSimpleArticleNamespaceURI($articles->[0]) - =~ /^urn\:lsid\:biomoby\.org\:namespacetype\:/) - or diag("Got bad LSID for valid namespace"); - -is( getSimpleArticleNamespaceURI($articles->[1]), undef) -# =~ /^urn\:lsid\:biomoby\.org\:namespacetype\:/ ) ) - or diag("Got valid LSID for invalid namespace"); +$responses = serviceResponseParser($two_mobyDatas); # returns MOBY objects +isa_ok ($responses, "HASH", "response parser returned a HASH" ) or die "serviceResponseParser didn't return a hashref for multiple input test\n"; + at ids = keys %{$responses}; +ok (scalar(@ids) == 2) or die "serviceResponseParser didn't find right number of invocation messages when two were passed\n"; +ok ($ids[0] eq "first") or die "serviceResponseParser didn't find the first query id\n"; +ok ($ids[1] eq "second") or die "serviceResponseParser didn't find the second query id\n"; + my $sequence = "TAGCTGATCGAGCTGATGCTGA"; my $articlename = "SequenceString"; @@ -374,10 +319,10 @@ # and that bogus ones do NOT. my @LSIDs = validateNamespaces('bogus-ns', @ns, 'other bogus-ns'); foreach ($LSIDs[0], $LSIDs[-1]) { - is($_, undef) or diag("Bogus namespace ($LSIDs[0]) got an LSID"); + is($_, undef,"validate namespace lsids") or diag("Bogus namespace ($LSIDs[0]) got an LSID"); } foreach (@LSIDs[1..-2]) { - isnt($_, undef) or diag("Bona fide namespace ($_) had no LSID"); + isnt($_, undef, "validate namespace lsids2") or diag("Bona fide namespace ($_) had no LSID"); } ######## GENERATE RESPONSE ######### @@ -389,14 +334,13 @@ . responseFooter()); $sresp = $sresp->getElementsByTagName('moby:mobyData'); # || $sresp->getElementsByTagName('mobyData'); -is($sresp->size(), 1) +is($sresp->size(), 1,"response size OK") or diag("SimpleResponse should contain only a single mobyData element."); my $mobyData = $sresp->get_node(1); is($mobyData->getAttribute('moby:queryID') || $mobyData->getAttribute('queryID'), $qID) or diag("SimpleResponse didn't contain right queryID"); -my $simple; my $count_elements = 0; foreach ($mobyData->childNodes->get_nodelist) { if ($_->nodeType == ELEMENT_NODE) { $count_elements++ } @@ -440,15 +384,15 @@ or diag("collectionResponse should have mobyData as outermost tag: got '$coll_resp'"); # Now parse the XML, and make sure it checks out according to DOM my $coll_resp_dom = XML_maker(responseHeader() . $coll_resp . responseFooter()); - my $mData = $coll_resp_dom->getElementsByTagName('moby:mobyData'); - is($mData->size(), 1) + my $mData = $coll_resp_dom->getElementsByLocalName('mobyData'); + is($mData->size(), 1,"collection response size is correct") or diag("CollectionResponse should contain only a single mobyData element."); $mData = $mData->get_node(1); is($mData->getAttribute('moby:queryID') || $mData->getAttribute('queryID'), $qID) or diag("CollectionResponse's mobyData element didn't contain correct queryID"); - my $colls = $mData->getElementsByTagName("moby:Collection"); - is ($colls->size(), 1) + my $colls = $mData->getElementsByLocalName("Collection"); + is ($colls->size(), 1,"collection has wrong number of children") or diag("CollectionResponse should have only a single child: Collection."); my $Coll = $colls->get_node(1); is($Coll->getAttribute('moby:articleName') || $Coll->getAttribute('articleName'), @@ -460,19 +404,9 @@ or diag("CollectionResponse contains wrong number of Simples"); # # Finally, parse the sucker with the tools in CommonSubs: it should be able to understand its own creations! - my @inputs = getInputs(responseHeader() . $coll_resp . responseFooter() ); - is(scalar @inputs, 1) - or diag("CollectionResponse should contain only one mobyData block"); - is(getInputID($inputs[0]), $qID) - or diag("CollectionResponse returned mobyData block with incorrect queryID attribute"); - my @articles = getArticles($inputs[0]); - is(scalar @articles, 1) - or diag("CollectionResponse should contain only one Collection"); - is($articles[0]->[0], $aname) - or diag("CollectionResponse had incorrect articleName"); - my @collected_simples = getCollectedSimples($articles[0]->[1]); - is(scalar @collected_simples , scalar @{$data}) - or diag("CollectionResponse contained incorrect number of Simples"); + my $inputs = serviceInputParser(responseHeader() . $coll_resp . responseFooter() ); + +ok (scalar(keys %{$inputs}) == 1) or diag("can't eat my own dogfood!"); # Test response when one or more simples are empty/undef. # They should result in empty Simple tags, but the total response should NOT be empty. From mwilkinson at dev.open-bio.org Thu Feb 8 19:27:07 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 19:27:07 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702090027.l190R7Td032177@dev.open-bio.org> mwilkinson Thu Feb 8 19:27:07 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv32158/MOBY Modified Files: CommonSubs.pm Log Message: one more function needs to be deprecated since it isnt API compliant (it doesn't use query id's) moby-live/Perl/MOBY CommonSubs.pm,1.95,1.96 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.95 retrieving revision 1.96 diff -u -r1.95 -r1.96 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/02/09 00:19:01 1.95 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/02/09 00:27:07 1.96 @@ -832,65 +832,6 @@ } -=head1 Client-Side Common Subroutines - -These are the subroutines that will be most commonly used Client-Side for -processing the output of a MOBY service - -=head2 processResponse - -=cut - -sub processResponse { - my ( $result ) = @_; - return ( [], [] ) unless $result; - my $moby; - unless ( ref( $result ) =~ /XML\:\:LibXML/ ) { - my $parser = XML::LibXML->new(); - my $doc = $parser->parse_string( $result ); - $moby = $doc->getDocumentElement(); - } else { - $moby = $result->getDocumentElement(); - } - my @objects; - my @collections; - my @Xrefs; - my $success = 0; - foreach my $which ('mobyData', 'moby:mobyData') { - my $responses = $moby->getElementsByTagName( $which ); - next unless $responses; - foreach my $n ( 1 .. ( $responses->size() ) ) { - my $resp = $responses->get_node( $n ); - foreach my $response_component ( $resp->childNodes ) { - next unless $response_component->nodeType == ELEMENT_NODE; - if ( $response_component->nodeName =~ /^(moby:|)Simple$/ ) - { - foreach my $Object ( $response_component->childNodes ) { - next unless $Object->nodeType == ELEMENT_NODE; - $success = 1; - push @objects, $Object; - } - } elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ ) - { - my @objects; - foreach my $simple ( $response_component->childNodes ) { - next unless $simple->nodeType == ELEMENT_NODE; - next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ ); - foreach my $Object ( $simple->childNodes ) { - next unless $Object->nodeType == ELEMENT_NODE; - $success = 1; - push @objects, $Object; - } - } - push @collections, \@objects - ; #I'm not using collections yet, so we just use Simples. - } - } - } - } - return ( \@collections, \@objects ); -} - =head1 ANCILIARY ELEMENTS @@ -1389,6 +1330,63 @@ =head1 DEPRECATED FUNCTIONS +=head2 processResponse + +DEPRECATED + +=cut + +sub processResponse { +print STDERR "the processResponse subroutine in MOBY::CommonSubs is deprecated. Please use serviceResponseParser for API compliance\n"; + my ( $result ) = @_; + return ( [], [] ) unless $result; + my $moby; + unless ( ref( $result ) =~ /XML\:\:LibXML/ ) { + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string( $result ); + $moby = $doc->getDocumentElement(); + } else { + $moby = $result->getDocumentElement(); + } + my @objects; + my @collections; + my @Xrefs; + my $success = 0; + foreach my $which ('mobyData', 'moby:mobyData') { + my $responses = $moby->getElementsByTagName( $which ); + next unless $responses; + foreach my $n ( 1 .. ( $responses->size() ) ) { + my $resp = $responses->get_node( $n ); + foreach my $response_component ( $resp->childNodes ) { + next unless $response_component->nodeType == ELEMENT_NODE; + if ( $response_component->nodeName =~ /^(moby:|)Simple$/ ) + { + foreach my $Object ( $response_component->childNodes ) { + next unless $Object->nodeType == ELEMENT_NODE; + $success = 1; + push @objects, $Object; + } + } elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ ) + { + my @objects; + foreach my $simple ( $response_component->childNodes ) { + next unless $simple->nodeType == ELEMENT_NODE; + next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ ); + foreach my $Object ( $simple->childNodes ) { + next unless $Object->nodeType == ELEMENT_NODE; + $success = 1; + push @objects, $Object; + } + } + push @collections, \@objects + ; #I'm not using collections yet, so we just use Simples. + } + } + } + } + return ( \@collections, \@objects ); +} + =head2 genericServiceInputParser From mwilkinson at dev.open-bio.org Fri Feb 9 16:38:28 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Fri, 9 Feb 2007 16:38:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702092138.l19LcScg006850@dev.open-bio.org> mwilkinson Fri Feb 9 16:38:28 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv6831/MOBY/Client Modified Files: Central.pm Log Message: fixing potential infinite loop that Eddie found moby-live/Perl/MOBY/Client Central.pm,1.145,1.146 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.145 retrieving revision 1.146 diff -u -r1.145 -r1.146 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/07 00:07:11 1.145 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/09 21:38:28 1.146 @@ -184,11 +184,11 @@ sub Connection { my ( $self, $desired ) = @_; if ($desired) { - while ( my ( $name, $type, $connect ) = - ( @{ $self->Connections->[0] } ) ) - { - return ( $type, $connect ) if $name eq $desired; - } + my @registries = @{$self->Connections}; + foreach (@registries){ + my ( $name, $type, $connect ) = @{$_}; + return ( $type, $connect ) if $name eq $desired; + } } else { my ( $name, $type, $connect ) = @{ $self->Connections->[0] }; From mwilkinson at dev.open-bio.org Fri Feb 9 16:46:34 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Fri, 9 Feb 2007 16:46:34 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702092146.l19LkYBs006911@dev.open-bio.org> mwilkinson Fri Feb 9 16:46:34 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv6892/MOBY/Client Modified Files: Central.pm Log Message: fixing potential infinite loop that Eddie found moby-live/Perl/MOBY/Client Central.pm,1.146,1.147 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.146 retrieving revision 1.147 diff -u -r1.146 -r1.147 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/09 21:38:28 1.146 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/09 21:46:34 1.147 @@ -272,6 +272,8 @@ my $regno = 0; my %reg = %{ $self->Registries }; while ( my ( $name, $acc ) = each %reg ) { + $self->default_MOBY_servername($name); # set the current as the default... if there is only one, then it becomes default, which is nice! If ther eis more than one, then the person shold be explicitly calling one or the other anyway + $regno++; # count how many registries we have in total my $url = $acc->{URL} ? $acc->{URL} : $self->default_MOBY_server; my $uri = $acc->{URI} ? $acc->{URI} : $self->default_MOBY_uri; From kawas at dev.open-bio.org Fri Feb 9 16:55:33 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 9 Feb 2007 16:55:33 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702092155.l19LtXD6007036@dev.open-bio.org> kawas Fri Feb 9 16:55:32 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv7001/Client Modified Files: Service.pm Log Message: applying a client side patch for the wsdl returned by a server running the old codebase. moby-live/Perl/MOBY/Client Service.pm,1.33,1.34 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/08 18:50:24 1.33 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/09 21:55:32 1.34 @@ -117,14 +117,12 @@ $self->category('post'); } - #my $dir = cwd; - # seems to be a bug in SOAP::Lite that the WSDL document - # fails a parse if it is passed as a scalar rather than a file - # this section can be removed when this bug is fixed - #open (OUT, ">$dir/Service.wsdl") || die "cant open dump of wsdl file"; - #print OUT $self->service; - #close OUT; - # ________________________________________ + # TODO - added to make old WSDL compliant with soap lite 0.69 + if ( $wsdl =~ /element="xsd1:NOT_YET_DEFINED_INPUTS"/ ) { + $wsdl =~ s/name="body" element="xsd1:NOT_YET_DEFINED_INPUTS"/name="data" type="xsd:string"/g; + $wsdl =~ s/element="xsd1:NOT_YET_DEFINED_OUTPUTS"/type="xsd:string"/g; + } + $wsdl = URI::Escape::uri_escape( $self->service ); # this seems to fix the bug my $soap = SOAP::Lite->service( "data:,$wsdl" ); From mwilkinson at dev.open-bio.org Fri Feb 9 20:52:57 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Fri, 9 Feb 2007 20:52:57 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702100152.l1A1qvsW007558@dev.open-bio.org> mwilkinson Fri Feb 9 20:52:57 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv7539/MOBY/Client Modified Files: Service.pm Log Message: added a new function to MOBY::Client::Central that allows the client to specify the queryIDs. This is necesary if a client program needs to keep a maping between the input and the associated output. I know, I know. This should have been done years ago. Sorry :-( moby-live/Perl/MOBY/Client Service.pm,1.34,1.35 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/09 21:55:32 1.34 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/10 01:52:57 1.35 @@ -338,10 +338,107 @@ return $result; } + +=head2 enumerated_execute + + Usage : $result = $Service->enumerated_execute(%args) + Function : execute the MOBY service using self-enumerated inputs + Returns : whatever the Service provides as output + Args : Input => %data + Comment : %data is a hash of single invocation inputs + the structure of %data is: + + $data{$queryID} = {articleName => $inputXML1, # for simples and parameters + articleNmae => [$inputXML2, $inputXML3], # for collections + } + $inputXML is the actual XML of the Input object + for example + + a full example might be: + + $data{invocation1} = {id_to_match => "", + id_list => [", + ",... + ] + cutoff => "10" + } + + +=cut + + + +sub enumerated_execute { + my ( $self, %args ) = @_; + die "ERROR: expected Input to be a HASH ref " + unless ( ref( $args{Input} ) eq 'HASH' ); + my %inputs = %{$args{Input}}; +# structure of %input is: +#$input{qid} = {articleName => "", # for simples +# articleName2 => ["", ""], # for collections +# } + + my $data; + foreach my $qID( keys %inputs ) { + die "ERROR: expected hashref {articleName => XML} for each queryID" unless ( ref($inputs{$qID}) eq 'HASH' ); + my %articles = %{$inputs{$qID}}; + $data .= ""; + foreach my $articleName(keys %articles){ + my $XML = $articles{$articleName}; + if ( ref( $XML ) ne 'ARRAY' ) { + $XML ||= ""; + if ( $XML =~ /\<(moby\:|)Value\>/ ){ + $data .= "$XML"; + } else { + $data .= "\n$XML\n\n"; + } + } elsif ( ref( $XML ) eq 'ARRAY' ) { + my @objs = @{$XML}; + $data .= "\n"; + foreach ( @objs ) { + $data .= "$_\n"; + } + $data .= "\n"; + } + } + $data .= "\n"; + } + ################### + # this was added on January 19th, 2005 and may not work! + ################### + ################### + my $version = $self->smessageVersion(); + $data = " + + + $data + + "; + my $METHOD = $self->serviceName; + &_LOG( %args, $METHOD ); + my $response; + + if ($self->category eq 'moby'){ + eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; + if ($@) { die "Service execution failed: $@"} + else {return $response;} # the service execution failed then pass back "" + } elsif ($self->category eq 'post'){ + my $response = $self->_executePOSTService(data => $data, method => $METHOD); + # currently SOAP::Lite does not execute POST WSDL, so we need to + # use LWP or something like that in the executePOSTService method + #eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; + unless ($response){ die "Service execution failed: $@"} + else {return $response;} # the service execution failed then pass back "" + } +} + + + + =head2 methods Usage : $name = $Service->methods() - Function : Internal method to retrieve all methods from a service + Function : retrieve all possible method calls for a given service Returns : listref of method names as strings Args : none From kawas at dev.open-bio.org Thu Feb 15 12:16:42 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 15 Feb 2007 12:16:42 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702151716.l1FHGgDJ032469@dev.open-bio.org> kawas Thu Feb 15 12:16:42 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv32434 Modified Files: Central.pm Log Message: async wsdl had element="" instead of type="" when defining inputs/outputs moby-live/Perl/MOBY Central.pm,1.279,1.280 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.279 retrieving revision 1.280 diff -u -r1.279 -r1.280 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/06 18:04:48 1.279 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/15 17:16:41 1.280 @@ -4115,7 +4115,7 @@ xmlns:tns="http://biomoby.org/Central.wsdl" xmlns:xsd1="http://biomoby.org/CentralXSDs.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:xsd="http://www.w3.org/1999/XMLSchema" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd" @@ -4148,16 +4148,16 @@ - + - + - + - + From kawas at dev.open-bio.org Thu Feb 15 12:44:38 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 15 Feb 2007 12:44:38 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702151744.l1FHic3M032719@dev.open-bio.org> kawas Thu Feb 15 12:44:37 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv32684 Modified Files: Central.pm Log Message: made the async wsdl to consume string moby-live/Perl/MOBY Central.pm,1.280,1.281 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.280 retrieving revision 1.281 diff -u -r1.280 -r1.281 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/15 17:16:41 1.280 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/15 17:44:37 1.281 @@ -4148,16 +4148,16 @@ - + - + - + - + From mwilkinson at dev.open-bio.org Mon Feb 19 16:10:24 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 19 Feb 2007 16:10:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702192110.l1JLAOMu005201@dev.open-bio.org> mwilkinson Mon Feb 19 16:10:23 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv5182/MOBY/Client Modified Files: Service.pm Log Message: somehow the encodig of the MOBY message got screwed up. Should be correct now. moby-live/Perl/MOBY/Client Service.pm,1.35,1.36 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/10 01:52:57 1.35 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/19 21:10:23 1.36 @@ -295,7 +295,7 @@ my $response; if ($self->category eq 'moby'){ - eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; + eval { ( $response ) = $self->_soapService->$METHOD( SOAP::Data->type('string' => $data) ) }; if ($@) { die "Service execution failed: $@"} else {return $response;} # the service execution failed then pass back "" } elsif ($self->category eq 'post'){ @@ -419,7 +419,7 @@ my $response; if ($self->category eq 'moby'){ - eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; + eval { ( $response ) = $self->_soapService->$METHOD( SOAP::Data->type('string' => $data) ) }; if ($@) { die "Service execution failed: $@"} else {return $response;} # the service execution failed then pass back "" } elsif ($self->category eq 'post'){ From mwilkinson at dev.open-bio.org Mon Feb 19 17:36:12 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 19 Feb 2007 17:36:12 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702192236.l1JMaCl4005389@dev.open-bio.org> mwilkinson Mon Feb 19 17:36:12 EST 2007 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory dev.open-bio.org:/tmp/cvs-serv5342 Modified Files: ConstructingYourService.html DesignAnObject.html DiscoverService.html ExecuteSyncService.html RegisterAnObject.html RegisterNamespace.html RegisterServiceInstance.html RegisterServiceType.html Log Message: fixed HTML to solve rendering problem in IE moby-live/Docs/MOBY-S_API/Perl ConstructingYourService.html,1.21,1.22 DesignAnObject.html,1.4,1.5 DiscoverService.html,1.1,1.2 ExecuteSyncService.html,1.1,1.2 RegisterAnObject.html,1.4,1.5 RegisterNamespace.html,1.4,1.5 RegisterServiceInstance.html,1.6,1.7 RegisterServiceType.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2007/02/07 01:10:22 1.21 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2007/02/19 22:36:12 1.22 @@ -59,7 +59,7 @@
    - +

    Constructing =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DesignAnObject.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DesignAnObject.html 2006/02/21 15:28:52 1.4 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DesignAnObject.html 2007/02/19 22:36:12 1.5 @@ -1,4 +1,3 @@ - @@ -60,7 +59,7 @@
    - +

    Designing MOBY-S Objects

    Fundamental Facts about MOBY-S Objects

    =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DiscoverService.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DiscoverService.html 2007/02/07 01:10:22 1.1 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DiscoverService.html 2007/02/19 22:36:12 1.2 @@ -1,4 +1,3 @@ - @@ -60,7 +59,7 @@
    - +

    Discovering your service

    To discover a service (for example, the service "getGoTerm" that you just registered in =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ExecuteSyncService.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ExecuteSyncService.html 2007/02/08 18:44:51 1.1 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ExecuteSyncService.html 2007/02/19 22:36:12 1.2 @@ -1,4 +1,3 @@ - @@ -56,7 +55,7 @@
    - +

    Executing a service in Synchronous mode

    The "getGoTerm" service that we have been discussing in this tutorial is a Sychronous Moby Service, meaning that if you execute it, the response from the =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html 2006/06/02 08:21:34 1.4 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html 2007/02/19 22:36:12 1.5 @@ -1,4 +1,3 @@ - @@ -60,7 +59,6 @@
    -

    Using the Perl API to register an object

    =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html 2006/06/02 08:21:34 1.4 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html 2007/02/19 22:36:12 1.5 @@ -1,7 +1,7 @@ - + @@ -30,13 +30,7 @@ #headerimg { background: url('http://biomoby.open-bio.org/wordpress/wp-content/themes/moby/images/moby1.gif') no-repeat left;} - - - -

    @@ -73,6 +73,36 @@ use MOBY::Client::Central; my $m = MOBY::Client::Central->new; +#NOTE: the service Name MUST be identical to the name you +# called it in the Dispatcher +# and identical to the name of the subroutine itself. +my $serviceName = "getGoTerm"; + + +# this is a term taken from the MOBY Service Ontology +# that most closely reflects the nature of what your service does +my $serviceType = "Retrieval"; + + +# this is a unique string in the form nnn.nnn.nnn that +# identifies you as a particular service provider. Your +# domain name (excluding http://) is most useful +my $authURI = "mydomain.mycompany.org"; + + +# this is the URL where your Dispatcher is located +my $URL = "http://mydomain.mycompany.org/cgi-bin/MOBY/Dispatcher.cgi"; + + +# finally, you want to make a nice human-readable description for +# your service. This should include things like what organism your +# database provides information about, or what data or algorithm you +# use. Things that might help people find you based on a keyword search +my $description = "This service consumes GO ID's and returns GO Terms and definitions"; + + +# now start constructing the descriptions of your inputs and outputs: + my @input_namespaces = ('GO'); # a list of valid input namespaces my @input_simples = ('Object', \@input_namespaces); @@ -96,7 +126,7 @@ serviceType => $serviceType, authURI => $authURI, contactEmail => "your at mail.address", - description => $human_readable_description, + description => $description, category => "moby" URL => $URL_TO_SERVICE input => \@all_inputs, From mwilkinson at dev.open-bio.org Wed Feb 7 01:21:24 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 20:21:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702070121.l171LOFn019992@dev.open-bio.org> mwilkinson Tue Feb 6 20:21:24 EST 2007 Update of /home/repository/moby/moby-live/Perl In directory dev.open-bio.org:/tmp/cvs-serv19973 Modified Files: Makefile.PL Log Message: added more documentation for the MOBY::Client::SecondaryArticle API and un-commented the WSRF dependencies in the Makefile because Chris Dag added them to biomoby.org so rapidly moby-live/Perl Makefile.PL,1.24,1.25 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/07 00:25:01 1.24 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2007/02/07 01:21:24 1.25 @@ -154,18 +154,18 @@ 'DBI' => 0.01, 'DBD::mysql' => 0.01, 'WSRF::Lite' => '', - #'Test::Simple' => 0.44, - #'XML::DOM' => '', - #'DateTime::Format::Epoch' => '', - #'DateTime::Format::W3CDTF' => '', - #'HTTP::Daemon' => '', - #'HTTP::Daemon::SSL' => '', - #'MIME::Base64' => '', - #'Digest::SHA1' => '', - #'Crypt::OpenSSL::X509' => '', - #'Crypt::OpenSSL::RSA' => '', - #'XML::CanonicalizeXML' => 0.02, - #'Sys::Hostname::Long' => '' + 'Test::Simple' => 0.44, + 'XML::DOM' => '', + 'DateTime::Format::Epoch' => '', + 'DateTime::Format::W3CDTF' => '', + 'HTTP::Daemon' => '', + 'HTTP::Daemon::SSL' => '', + 'MIME::Base64' => '', + 'Digest::SHA1' => '', + 'Crypt::OpenSSL::X509' => '', + 'Crypt::OpenSSL::RSA' => '', + 'XML::CanonicalizeXML' => 0.02, + 'Sys::Hostname::Long' => '' # LS::ID => 1.1.1, }, # e.g., Module::Name => 1.1 #PM_FILTER => "", From mwilkinson at dev.open-bio.org Wed Feb 7 01:21:24 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Tue, 6 Feb 2007 20:21:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702070121.l171LONB020012@dev.open-bio.org> mwilkinson Tue Feb 6 20:21:24 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv19973/MOBY/Client Modified Files: SecondaryArticle.pm Log Message: added more documentation for the MOBY::Client::SecondaryArticle API and un-commented the WSRF dependencies in the Makefile because Chris Dag added them to biomoby.org so rapidly moby-live/Perl/MOBY/Client SecondaryArticle.pm,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm 2006/05/30 18:56:16 1.12 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm 2007/02/07 01:21:24 1.13 @@ -70,13 +70,51 @@ Returns : string Arguments : (optional) string representing articleName to set -=head2 value +=head2 datatype - Usage : $name = $SA->value() - Function : get value of parameter - Returns : value of the parameter as a string (regardless of actual type) + Usage : $name = $SA->datatype($type) + Function : get/set datatype: Integer, Float, DateTime, Boolean, String + Returns : the datatype Arguments : +=head2 min + + Usage : $name = $SA->min($value) + Function : get/set the minimum value of a datatype + Returns : min value + Arguments : + +=head2 max + + Usage : $name = $SA->max($value) + Function : get/set maximum value of the datatype + Returns : max value + Arguments : + +=head2 default + + Usage : $name = $SA->default($value) + Function : get/set the default value of parameter + Returns : default value + Arguments : + + +=head2 enum + + Usage : $name = $SA->enum(\@possible_values) + Function : get/set the enumerated values for discreet variables + Returns : listref of string values + Arguments : + + +=head2 addEnum + + Usage : $name = $SA->addEnum($new_possible_values) + Function : add to the list of enumerated values for discreet variables + Returns : new listref of string values + Arguments : + + =head2 description Usage : $namespaces = $SA->description("text description here") @@ -169,6 +207,7 @@ $self->{enum} = [] unless $self->{enum}; return() unless defined ($enum); push @{ $self->{enum} }, $enum; + return $self->enum; } } From d.haase at dev.open-bio.org Wed Feb 7 15:19:00 2007 From: d.haase at dev.open-bio.org (Dirk Haase) Date: Wed, 7 Feb 2007 10:19:00 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702071519.l17FJ0Ln022633@dev.open-bio.org> d.haase Wed Feb 7 10:19:00 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi In directory dev.open-bio.org:/tmp/cvs-serv22598 Modified Files: mysql.pm Log Message: changed 'collection_input_id' to 'collection_${inout}_id' in query of &find_by_simple to prevent 'unknown column' error for output case moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.82,1.83 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2007/01/30 15:08:33 1.82 +++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2007/02/07 15:19:00 1.83 @@ -1209,7 +1209,7 @@ my $ancestor_string = $args{'ancestor_string'}; my $namespaceURIs = $args{'namespaceURIs'}; - my $query ="select service_instance_id, namespace_type_uris from simple_$inout where object_type_uri in ($ancestor_string) and collection_input_id IS NULL " + my $query ="select service_instance_id, namespace_type_uris from simple_$inout where object_type_uri in ($ancestor_string) and collection_${inout}_id IS NULL " ; # if service_instance_id is null then it must be a collection input. my $nsquery; foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's From gordonp at dev.open-bio.org Thu Feb 8 16:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18GxwXl027276@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv27169/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java MobyComplexBuilder.java Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.3,1.4 MobyComplexBuilder.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2006/10/26 01:32:06 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/02/08 16:59:58 1.4 @@ -29,6 +29,10 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +/** + * The engine that finds MOBY data in unstructured text or DOM of other XML languages according + * to a rules database. Used in Seahawk to provide the service options popup items. + */ public class MobyClient { public static final String DATA_MAPPING_XML_RESOURCE = "ca/ucalgary/seahawk/resources/mobyBuilderRules.xml"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java 2007/02/08 16:59:58 1.2 @@ -14,6 +14,10 @@ import java.util.Map; import java.util.regex.Matcher; +/** + * Class used by MobyClient to build the MOBY rule database from a configuration file. + */ + public class MobyComplexBuilder{ private Map namespaceRules; From gordonp at dev.open-bio.org Thu Feb 8 16:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18GxwCw027250@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test In directory dev.open-bio.org:/tmp/cvs-serv27169/main/ca/ucalgary/seahawk/gui/test Modified Files: SeahawkTestCase.java Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test SeahawkTestCase.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java 2006/11/22 22:23:54 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java 2007/02/08 16:59:58 1.4 @@ -1,10 +1,3 @@ -/** - * Tests all of the major functionality of Seahawk, the standalone MOBY - * browser that can be embedded in other applications too. If you add classes - * to Seahawk, you MUST test them here, otherwise they will not end up in the - * Seahawk deployment JAR. - */ - package ca.ucalgary.seahawk.gui.test; import ca.ucalgary.seahawk.gui.MobyContentGUI; @@ -32,6 +25,13 @@ import java.util.List; import java.util.Vector; +/** + * Tests all of the major functionality of Seahawk, the standalone MOBY + * browser that can be embedded in other applications too. If you add classes + * to Seahawk, you MUST test them here, otherwise they will not end up in the + * Seahawk deployment JAR. + */ + public class SeahawkTestCase extends JFCTestCase{ private final static String TEST_MOBYEX_XML = "ca/ucalgary/seahawk/gui/test/moby_exception.xml"; private final static String TEST_MOBY_XML = "ca/ucalgary/seahawk/gui/test/allDataTypes.xml"; From gordonp at dev.open-bio.org Thu Feb 8 16:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18Gxw3i027394@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test In directory dev.open-bio.org:/tmp/cvs-serv27169/main/org/biomoby/service/test Modified Files: ConvertAAtoFASTA_AA.java FromFastaToDNASequence.java Log Message: Documentation updates moby-live/Java/src/main/org/biomoby/service/test ConvertAAtoFASTA_AA.java,1.1,1.2 FromFastaToDNASequence.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/ConvertAAtoFASTA_AA.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/test/ConvertAAtoFASTA_AA.java 2006/12/06 16:07:10 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/ConvertAAtoFASTA_AA.java 2007/02/08 16:59:58 1.2 @@ -1,13 +1,13 @@ -/** - * Simple service used for exemplary and testing purposes. - */ - package org.biomoby.service.test; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.data.*; import org.biomoby.service.*; +/** + * Simple service used for exemplary and testing purposes. + */ + @mobyService(name="ConvertAAtoFASTA_AA", type="FormatConversion", provider="moby.ucalgary.ca", @@ -19,6 +19,10 @@ public class ConvertAAtoFASTA_AA extends MobyServlet{ + /** + * Builds a FastA record from a MOBY AminoAcidSequence object. Demonstrates + * how to access fields of a MOBY object, and how to build a new object. + */ public void processRequest(MobyDataJob request, MobyDataJob result) throws Exception{ // The input parameter for this method is registered as "inseq" MobyDataComposite aaSeqObject = (MobyDataComposite) request.get("inseq"); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/FromFastaToDNASequence.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/test/FromFastaToDNASequence.java 2006/12/06 16:07:10 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/FromFastaToDNASequence.java 2007/02/08 16:59:58 1.2 @@ -13,8 +13,19 @@ description={"Converts FastA formatted records into DNASequences, ", "primarily to increase inter-service compatibility"}) +/** + * Simple service used for testing and as an example for users of how to use exceptions + * and warnings in MOBY services. + */ + public class FromFastaToDNASequence extends MobyServlet{ + /** + * Parses a FastA string into its header component and sequence, constructing + * a MOBY DNASequence object (or subclass thereof), which can be used in more services. + * An exception will be thrown if the data doesn't appear to be FastA, or a warning + * will be added to the results if the sequence doesn't appear to be DNA. + */ public void processRequest(MobyDataJob request, MobyDataJob result) throws Exception{ // The input parameter for this method is registered as "inseq" MobyDataComposite fastaObject = (MobyDataComposite) request.get("inseq"); From gordonp at dev.open-bio.org Thu Feb 8 16:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18Gxw3E027338@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory dev.open-bio.org:/tmp/cvs-serv27169/main/org/biomoby/client Modified Files: MobyRequest.java Log Message: Documentation updates moby-live/Java/src/main/org/biomoby/client MobyRequest.java,1.21,1.22 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2006/11/21 21:03:48 1.21 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2007/02/08 16:59:58 1.22 @@ -773,6 +773,7 @@ throw me; } catch(Exception e){ + e.printStackTrace(); throw new MobyException("Could not create MOBY payload XML from input data: " +e); } From gordonp at dev.open-bio.org Thu Feb 8 16:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18GxwPZ027232@dev.open-bio.org> gordonp Thu Feb 8 11:59:57 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv27169/main/ca/ucalgary/seahawk/gui Modified Files: FileAndTextTransferHandler.java MobyContentClipboard.java MobyContentGUI.java MobyContentHelpPane.java MobyContentPane.java MobySaveDialog.java MobyServicesGUI.java MobyShimmer.java Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/gui FileAndTextTransferHandler.java,1.2,1.3 MobyContentClipboard.java,1.1,1.2 MobyContentGUI.java,1.3,1.4 MobyContentHelpPane.java,1.1,1.2 MobyContentPane.java,1.3,1.4 MobySaveDialog.java,1.1,1.2 MobyServicesGUI.java,1.6,1.7 MobyShimmer.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2006/12/15 04:40:36 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2007/02/08 16:59:57 1.3 @@ -1,8 +1,3 @@ -/* - * This class allows Seahawk to accept drop events from the native - * windowing system, so dropped files, URLs and string can be loaded into - * tabs. Dragging from Seahawk tabs is not yet supported. - */ package ca.ucalgary.seahawk.gui; import org.biomoby.shared.MobyPrefixResolver; @@ -21,6 +16,11 @@ import javax.swing.*; import javax.swing.text.*; +/* + * This class allows Seahawk to accept drop events from the native + * windowing system, so dropped files, URLs and string can be loaded into + * tabs. Dragging from Seahawk tabs is not yet supported. + */ class FileAndTextTransferHandler extends TransferHandler { private DataFlavor fileFlavor, stringFlavor; private MobyContentGUI gui; @@ -169,7 +169,7 @@ } } catch(Exception e){ // Not good MOBY XML, oh well, lets fall back on the HTML-based display below... - //e.printStackTrace(); + e.printStackTrace(); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentClipboard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentClipboard.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentClipboard.java 2007/02/08 16:59:57 1.2 @@ -1,7 +1,3 @@ -/** - * The clipboard is a special tab that holds a query with a MOBY Collection - * that the user can add and subtract MobyDataInstances from. - */ package ca.ucalgary.seahawk.gui; @@ -29,6 +25,10 @@ import java.net.URL; import java.util.*; +/** + * The clipboard is a special tab that holds a query with a MOBY Collection + * that the user can add and subtract MobyDataInstances from. + */ public class MobyContentClipboard extends MobyContentPane implements ActionListener{ public final static String CLEAR_CLIPBOARD_OPTION = "Clear Clipboard"; public final static String CLIPBOARD_FILE_NAME = "SeaHawkClipboard"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2006/10/26 00:37:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2007/02/08 16:59:57 1.4 @@ -22,9 +22,8 @@ import ca.ucalgary.seahawk.util.DescriptiveFileFilter; /** - * A class for textually displaying the data in a MOBY content XML document. - * We use this in Bluejay for example, so that following a MOBY link doesn't destroy - * the current XML document you are visualizing in the main window. + * Main interface component: textually displays the data in a MOBY content XML document. + * For details on embedding in your own app, please see the documentation. * * @author Paul Gordon (gordonp at ucalgary.ca) */ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentHelpPane.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentHelpPane.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentHelpPane.java 2007/02/08 16:59:57 1.2 @@ -23,6 +23,10 @@ import java.util.Iterator; import java.util.TreeMap; +/** + * Special text display tab in Seahawk for the Seahawk help file. Ensures that + * links and services are launched in new tabs so that the help doesn't disappear. + */ public class MobyContentHelpPane extends MobyContentPane{ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java 2006/12/14 22:20:10 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java 2007/02/08 16:59:57 1.4 @@ -50,6 +50,11 @@ import java.util.StringTokenizer; import java.util.Vector; +/** + * Text area contained in a Seahawk GUI tab. Displays HTML, RTF, text etc. using a JEditorPane. + * Also provides link handling (including service options popup) and drag 'n' drop capabilities. + */ + public class MobyContentPane extends JPanel implements Printable, CaretListener, HyperlinkListener, MouseListener, MobyRequestEventHandler{ public static final String MOBY_SERVICE_POPUP_NAME = "seahawkServicePopup"; public static final String WAITING_TAB_ICON_RESOURCE = "ca/ucalgary/seahawk/resources/images/hourglass.gif"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySaveDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySaveDialog.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySaveDialog.java 2007/02/08 16:59:57 1.2 @@ -6,7 +6,7 @@ import ca.ucalgary.seahawk.util.DescriptiveFileFilter; /** - * A utility to save the current document as XML or HTML. + * A utility to save the current document as XML or HTML, or the tab's history as a workflow (SCUFL format). * * @author Paul Gordon */ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/11/01 23:44:34 1.6 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2007/02/08 16:59:57 1.7 @@ -17,6 +17,10 @@ import javax.swing.event.PopupMenuListener; import javax.swing.event.PopupMenuEvent; +/** + * Implementation of the actually popup menu that lists services available, and invokes them. + */ + public class MobyServicesGUI implements ActionListener, Comparator, PopupMenuListener{ public final static int MAX_ID_LEN = 30; public final static String SERVICE_SUBMENU_NAME = "seahawkPopupSubMenuName"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyShimmer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyShimmer.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyShimmer.java 2007/02/08 16:59:57 1.2 @@ -1,11 +1,5 @@ package ca.ucalgary.seahawk.gui; -/** - * The purpose of this class is to improve service interoperability "shims" by - * checking the MOBY service listings for services that do format conversion - * on the given data, then adds service options for the output types of those services, - * if they aren't in the menu already. - */ import ca.ucalgary.seahawk.services.MobyClient; import javax.swing.*; @@ -23,6 +17,12 @@ import java.text.Collator; import java.util.*; +/** + * The purpose of this class is to improve service interoperability "shims" by + * checking the MOBY service listings for services that do format conversion + * on the given data, then adds service options for the output types of those services, + * if they aren't in the menu already. Not fully functional yet. + */ public class MobyShimmer implements MobyRequestEventHandler{ public static final String MOBY_SHIM_SERVICE_TYPE = "FormatConversion"; From gordonp at dev.open-bio.org Thu Feb 8 16:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18GxwHm027428@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv27169/main/org/biomoby/shared/data Modified Files: MobyDataJob.java MobyDataObjectVector.java MobyDataServiceAssocInstance.java package.html Log Message: Documentation updates moby-live/Java/src/main/org/biomoby/shared/data MobyDataJob.java,1.2,1.3 MobyDataObjectVector.java,1.1,1.2 MobyDataServiceAssocInstance.java,1.2,1.3 package.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataJob.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/data/MobyDataJob.java 2006/12/11 19:00:07 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataJob.java 2007/02/08 16:59:58 1.3 @@ -1,3 +1,9 @@ +package org.biomoby.shared.data; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Vector; + /** * Groups together the primary and secondary data corresponding to a MOBY XML "mobyData" block, i.e. * a request for, or response from, a service. One or more MobyDataJobs can be put in one MobyContentInstance @@ -6,12 +12,6 @@ * would with any Map. */ -package org.biomoby.shared.data; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Vector; - public class MobyDataJob extends HashMap{ protected String id = "no id specified"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObjectVector.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/data/MobyDataObjectVector.java 2006/07/07 04:12:40 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObjectVector.java 2007/02/08 16:59:58 1.2 @@ -1,9 +1,3 @@ -/** - * This class is primarily intended for use by MobyDataComposite to represent - * Object members in the HAS (i-to-many) relationship. Not all MobyDataObject - * behaviours are well defined for this object, but should rather be called on its members. - * If you are looking to represent a MOBY XML Collection please see MobyDataObjectSet. - */ package org.biomoby.shared.data; @@ -16,6 +10,12 @@ import org.biomoby.shared.MobyPrefixResolver; import org.biomoby.shared.MobyRelationship; +/** + * This class is primarily intended for use by MobyDataComposite to represent + * Object members in the HAS (1-to-many) relationship. Not all MobyDataObject + * behaviours are well defined for this object, but should rather be called on its members. + * If you are looking to represent a MOBY XML Collection please see MobyDataObjectSet. + */ public class MobyDataObjectVector extends MobyDataObject implements List{ private Vector members; @@ -32,7 +32,7 @@ members = new Vector(initialCapacity); } - // TODO: deal with cloning, CRIB and RIB setting + // TODO: deal with cloning, CRIB and PIB setting public String toXML(){ StringBuffer concatXML = new StringBuffer(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataServiceAssocInstance.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/data/MobyDataServiceAssocInstance.java 2006/07/07 04:12:40 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataServiceAssocInstance.java 2007/02/08 16:59:58 1.3 @@ -1,3 +1,7 @@ +package org.biomoby.shared.data; + +import org.biomoby.shared.MobyService; + /** * This interface defines a data instance that has already had remote * MOBY services associated with it, probably through a call to MOBY central. @@ -5,10 +9,6 @@ * take it as valid input. */ -package org.biomoby.shared.data; - -import org.biomoby.shared.MobyService; - public interface MobyDataServiceAssocInstance extends MobyDataInstance { public MobyService[] getServices(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/package.html,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/data/package.html 2006/07/07 04:12:40 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/package.html 2007/02/08 16:59:58 1.2 @@ -6,6 +6,6 @@ The package org.biomoby.shared.data allows you to easily build MOBY data instances for sending to services, or querying -the registry. Please see the In Anger +the registry. Please see the In Anger document for more information.

    From gordonp at dev.open-bio.org Thu Feb 8 16:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18GxwNU027368@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service In directory dev.open-bio.org:/tmp/cvs-serv27169/main/org/biomoby/service Modified Files: Asynchronous.java MobyServlet.java mobyService.java Log Message: Documentation updates moby-live/Java/src/main/org/biomoby/service Asynchronous.java,1.1,1.2 MobyServlet.java,1.4,1.5 mobyService.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/Asynchronous.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/Asynchronous.java 2006/12/06 16:07:10 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/Asynchronous.java 2007/02/08 16:59:58 1.2 @@ -1,3 +1,5 @@ +package org.biomoby.service; + /** * This interface is used by MobyServlet to determine if the processRequest() * method should be spawned in a separate thread. Any subclass of MobyServlet @@ -5,6 +7,4 @@ * the maximum number of threads allowed is the number of processors on the machine. */ -package org.biomoby.service; - public interface Asynchronous{} =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/MobyServlet.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/MobyServlet.java 2006/12/07 16:37:36 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/MobyServlet.java 2007/02/08 16:59:58 1.5 @@ -1,12 +1,5 @@ -package org.biomoby.service; - -/** - * This the base implementation of a MOBY servlet that can be - * easily extended to provide a meaningful service (by overriding - * processRequest()). Please see - * the documentation on how to use this servlet. - */ +package org.biomoby.service; import org.biomoby.service.test.TestServletConfig; import org.biomoby.service.test.TestServletContext; @@ -33,6 +26,13 @@ import java.util.Vector; import java.math.*; +/** + * This the base implementation of a MOBY servlet that can be + * easily extended to provide a meaningful service (by overriding + * processRequest()). Please see + * the documentation on how to use this servlet. + */ + @mobyService(name="MobyServlet", type="Testing", provider="moby.ucalgary.ca", @@ -1112,7 +1112,7 @@ * To add any other type of non-fatal error (e.g. a WARN), call addException() explicitly, * rather than throwing a Java Exception which stops the job's execution. * - * @param request the request to process, with params guaranteed to be of the type specified in WEB-INF/web.xml + * @param request the request to process, with params guaranteed to be of the type specified in the mobyService annotation, or values overriding the annjotation in a WAR file's WEB-INF/web.xml */ public void processRequest(MobyDataJob request, MobyDataJob result) throws Exception{ } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/mobyService.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/mobyService.java 2006/12/04 22:33:50 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/mobyService.java 2007/02/08 16:59:58 1.2 @@ -1,13 +1,14 @@ package org.biomoby.service; +import java.lang.annotation.*; + /** * Indicates that the annotated class is a MOBY Semantic Web Service, * and provides the information that will populate the MOBY Central - * registry for this service instance. + * registry for this service instance. For information on how to use this + * interface, please see the MobyServlet HOW-TO. */ -import java.lang.annotation.*; - @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Documented From gordonp at dev.open-bio.org Thu Feb 8 16:59:58 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 11:59:58 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081659.l18Gxw7B027316@dev.open-bio.org> gordonp Thu Feb 8 11:59:58 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv27169/main/ca/ucalgary/seahawk/util Modified Files: DynamicJPopupMenu.java MobyUtils.java NamespaceContextImpl.java PrintableJEditorPane.java Sequence.java Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/util DynamicJPopupMenu.java,1.1,1.2 MobyUtils.java,1.4,1.5 NamespaceContextImpl.java,1.1,1.2 PrintableJEditorPane.java,1.1,1.2 Sequence.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/DynamicJPopupMenu.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/DynamicJPopupMenu.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/DynamicJPopupMenu.java 2007/02/08 16:59:58 1.2 @@ -1,5 +1,8 @@ package ca.ucalgary.seahawk.util; +import java.awt.Component; +import javax.swing.*; + /** * This class was created to overcome the basic issue that JPopupMenus do not like to be resized * once they have been set visible. To do this, you must make it invisible, add/delete items, and @@ -11,11 +14,6 @@ * @author Paul Gordon gordonp at ucalgary.ca */ - -import java.awt.Component; -import javax.swing.*; - - public class DynamicJPopupMenu extends JPopupMenu{ private Object semaphore; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/27 20:11:01 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2007/02/08 16:59:58 1.5 @@ -10,6 +10,11 @@ import java.util.Vector; import javax.swing.JLabel; +/** + * Contains utility methods for Moby Object creation from unstructured data, and for + * creating the Seahawk GUI. + */ + public class MobyUtils{ public static final int MAX_OBJ_NAME_LEN = 18; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/NamespaceContextImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/NamespaceContextImpl.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/NamespaceContextImpl.java 2007/02/08 16:59:58 1.2 @@ -1,7 +1,3 @@ -/** - * This class is used to provide namespace context for XPath espression evaluation - * in the Seahawk data mapping rules file. - */ package ca.ucalgary.seahawk.util; @@ -13,6 +9,10 @@ import java.util.Iterator; import java.util.Map; +/** + * This class is used to provide namespace context for XPath espression evaluation + * in the Seahawk data mapping rules file. + */ public class NamespaceContextImpl implements NamespaceContext, PrefixResolver{ private Map prefixes; private Map nsURIs; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/PrintableJEditorPane.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/PrintableJEditorPane.java 2006/10/25 02:33:23 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/PrintableJEditorPane.java 2007/02/08 16:59:58 1.2 @@ -1,8 +1,3 @@ -/** - * A class used to make the rendered contents of a JEditorPane printable in Java. - * - * @author Paul Gordon (gordonp at ucalgary.ca) - */ package ca.ucalgary.seahawk.util; import java.awt.Dimension; @@ -14,6 +9,11 @@ import javax.swing.JEditorPane; import javax.swing.RepaintManager; +/** + * A class used to make the rendered contents of a JEditorPane printable in Java. + * + * @author Paul Gordon (gordonp at ucalgary.ca) + */ public class PrintableJEditorPane extends JEditorPane implements Printable{ public int print (Graphics g, PageFormat pf, int pageIndex) throws PrinterException{ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java 2006/10/25 02:33:23 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java 2007/02/08 16:59:58 1.2 @@ -1,9 +1,9 @@ +package ca.ucalgary.seahawk.util; + /** - * Utility methods to report properties of DNA and protein sequence + * Utility methods to report properties of DNA and protein sequence. */ -package ca.ucalgary.seahawk.util; - public class Sequence{ /** From gordonp at dev.open-bio.org Thu Feb 8 17:00:21 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 12:00:21 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081700.l18H0LEx027473@dev.open-bio.org> gordonp Thu Feb 8 12:00:21 EST 2007 Update of /home/repository/moby/moby-live/Java In directory dev.open-bio.org:/tmp/cvs-serv27438 Modified Files: build.xml Log Message: Documentation updates moby-live/Java build.xml,1.62,1.63 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- /home/repository/moby/moby-live/Java/build.xml 2006/12/06 16:07:10 1.62 +++ /home/repository/moby/moby-live/Java/build.xml 2007/02/08 17:00:21 1.63 @@ -351,7 +351,7 @@ packages="org.biomoby.shared,org.biomoby.shared.*"/> + packages="org.biomoby.client,org.biomoby.client.*:ca.ucalgary.seahawk.*"/> From gordonp at dev.open-bio.org Thu Feb 8 17:01:30 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 12:01:30 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081701.l18H1U9U027556@dev.open-bio.org> gordonp Thu Feb 8 12:01:30 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv27525/src/main/ca/ucalgary/seahawk/gui Added Files: package.html Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/gui package.html,NONE,1.1 From gordonp at dev.open-bio.org Thu Feb 8 17:05:12 2007 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Thu, 8 Feb 2007 12:05:12 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081705.l18H5Cu9027658@dev.open-bio.org> gordonp Thu Feb 8 12:05:11 EST 2007 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv27623/src/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java Log Message: Documentation updates moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/02/08 16:59:58 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2007/02/08 17:05:11 1.5 @@ -31,7 +31,9 @@ /** * The engine that finds MOBY data in unstructured text or DOM of other XML languages according - * to a rules database. Used in Seahawk to provide the service options popup items. + * to a rules database. The format of this database is + * described + * here. Used in Seahawk to provide the service options popup items. */ public class MobyClient { From mwilkinson at dev.open-bio.org Thu Feb 8 18:44:52 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 13:44:52 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081844.l18Iiq2W027993@dev.open-bio.org> mwilkinson Thu Feb 8 13:44:52 EST 2007 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory dev.open-bio.org:/tmp/cvs-serv27974/Perl Modified Files: RegisterServiceInstance.html Added Files: ExecuteSyncService.html Log Message: adding the Execute Service tutorial moby-live/Docs/MOBY-S_API/Perl ExecuteSyncService.html,NONE,1.1 RegisterServiceInstance.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterServiceInstance.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterServiceInstance.html 2007/02/07 01:10:22 1.5 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterServiceInstance.html 2007/02/08 18:44:51 1.6 @@ -103,23 +103,27 @@ # now start constructing the descriptions of your inputs and outputs: + # a list of valid input namespaces my @input_namespaces = ('GO'); -# a list of valid input namespaces + # a list of inputs and their namespaces, in this case, a single input 'Object' my @input_simples = ('Object', \@input_namespaces); -# a list of inputs and their namespaces, in this case, a single input 'Object' -my @input_articles = ('', \@input_simples); -# a list of named input articles + # note: if you alternately wanted to consume a collection of inputs as opposed + # to a simple input, you would have done the following: + # my @input_simples = (['Object', \@input_namespaces)]); + # a list of named input articles +my @input_articles = ('my_input_parametername', \@input_simples); + # the complete set of inputs to a single invocation of the service my @all_inputs = (\@input_articles); -# the complete set of inputs to a single invocation of the service + + # a list of valid input namespaces my @output_namespaces = ('GO'); -# a list of valid input namespaces + # a list of outputs and their namespaces, in this case, a single output type 'GO_Term' my @output_simples = ('GO_Term', \@output_namespaces); -# a list of outputs and their namespaces, in this case, a single output type 'GO_Term' -my @output_articles = ('', \@output_simples); -# a list of (un)named output articles + # a list of (un)named output articles +my @output_articles = ('my_output_parametername', \@output_simples); + # the complete set of outputs from a single invocation of the service my @all_outputs = (\@output_articles); -# the complete set of outputs from a single invocation of the service $REG = $m->registerService( serviceName => $serviceName, From mwilkinson at dev.open-bio.org Thu Feb 8 18:50:24 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 13:50:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702081850.l18IoOk1028055@dev.open-bio.org> mwilkinson Thu Feb 8 13:50:24 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv28032/MOBY/Client Modified Files: Service.pm ServiceInstance.pm Log Message: fixing documentation moby-live/Perl/MOBY/Client Service.pm,1.32,1.33 ServiceInstance.pm,1.18,1.19 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/06 21:46:12 1.32 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/08 18:50:24 1.33 @@ -166,11 +166,12 @@ To have the service iterate over multiple equivalent objects, and return all the results in a single message, use this syntax (ARGS = -([...], [...], ...): +([...], [...], ...). Here, the articleName of the input parameter is +"input1": $Service->execute(XMLinputlist => [ - ['object1', ''], - ['object2', ''] + ['input1', ''], + ['input1', ''] ]); This would invoke the service twice (in a single message) the first @@ -178,10 +179,11 @@ =item Process a Collection -To pass in a Collection, you need this syntax (ARGS = [ '', [..., ..., ...] ]): +To pass in a Collection, you need this syntax (ARGS = [ '', [..., ..., ...] ]). +Here, the articleName of the input is "input1". $Service->execute(XMLinputlist => [ - ['', [ + ['input1', [ '', ''] ]); @@ -191,7 +193,9 @@ =item Process multiple Simple inputs -To pass in multiple inputs, to be considered neither a Collection nor sequentially evaluated, use this syntax (ARGS = [..., ..., ...]) +To pass in multiple inputs, to be considered neither a Collection nor sequentially +evaluated, use this syntax (ARGS = [..., ..., ...]). Here, the service consumes +two inputs with articleName input1 and input2 $Service->execute(XMLinputlist => [ [ @@ -200,8 +204,7 @@ ] ]); -This would cause a single invocation of a service requiring two input -parameters named "input1" and "input2" +This would cause a single invocation of a service. =item Parameters =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2006/08/10 23:05:18 1.18 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2007/02/08 18:50:24 1.19 @@ -98,6 +98,17 @@ =cut +=head2 category + + Title : category + Usage : $category = $Service->category($arg) + Args : (optional) scalar string with moby service category ['moby' | 'post' | 'moby-async'] + Function : get/set category + Returns : string + +=cut + + =head2 input Title : input From mwilkinson at dev.open-bio.org Thu Feb 8 23:03:45 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 18:03:45 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702082303.l18N3jFm031340@dev.open-bio.org> mwilkinson Thu Feb 8 18:03:45 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv31321/MOBY Modified Files: CommonSubs.pm Log Message: significant updates to CommonSubs. Revamp of documentation to reveal client-side functionality that hasnt been discussed anywhere else. Added a new function (just a renamed reference to an old function) to show that the server-side parser can also be used client-side for parsing a MOBY message. rearranged order of functions in documentation to make more sense. moby-live/Perl/MOBY CommonSubs.pm,1.93,1.94 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/01/30 22:50:52 1.93 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/02/08 23:03:45 1.94 @@ -23,11 +23,58 @@ FUNCTION WITH SERVICES THAT ARE NOT COMPLIANT WITH THE NEW API - FOR EXAMPLE SERVICES THAT ARE NOT USING NAMED INPUTS AND OUTPUTS! -=head1 PARADIGMATIC USAGE +=head1 COMMON USAGE EXAMPLES =head2 Client Side Paradigm -not written yet + +The following is a generalized architecture for all +BioMOBY services showing how to parse response messages +using the subroutines provided in CommonSubs + +=head3 Services Returning Simples + + my $resp = $SI->execute(XMLInputList => \@input_data); + + my $responses = serviceResponseParser($resp); # returns MOBY objects + foreach my $queryID(keys %$responses){ + $this_invocation = $inputs->{$queryID}; # this is the block with this queryID + my $this_output = ""; + + if (my $data = $this_invocation->{'responseArticleName'}){ + # $data is a MOBY::Client::Simple|Collection|ParameterArticle + my ($namespace) = @{$data->namespaces}; + my $id = $data->id; + my $XML_LibXML = $input->XML_DOM; # get access to the DOM + my $desc = getNodeContentWithArticle($XML_LibXML, "String", "Description"); + ################### + # DO SOMETHING TO RESPOSE DATA HERE + ################### + } + + } + + +=head3 Services Returning Collections + + my $resp = $SI->execute(XMLInputList => \@input_data); + + my $responses = serviceResponseParser($resp); # returns MOBY objects + foreach my $queryID(keys %$responses){ # $inputs is a hashref of $input{queryid}->{articlename} = input object + my $this_invocation = $inputs->{$queryID}; + if (my $data = $this_invocation->{'responseArticleName'}){ # $input is a MOBY::Client::Simple|Collection|Parameter object + my $simples = $data->Simples; + foreach my $simple(@$simples){ + my $id = $simple->id; + my $id = $simple->namespace; + my $XML_LibXML = $input->XML_DOM; # get access to the DOM + + } + } + } + + + =head2 Service-Side Paradigm @@ -35,7 +82,7 @@ BioMOBY services showing how to parse incoming messages using the subroutines provided in CommonSubs -=head3 SIMPLE SERVICES +=head3 Services Generating simple outputs sub _generic_service_name { my ($caller, $data) = @_; @@ -68,7 +115,7 @@ return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); } -=head3 COLLECTION SERVICES +=head3 Services generating collection outputs sub _generic_service_returning_collections { my($caller, $message) = @_; @@ -169,12 +216,6 @@ } -=head1 AUTHORS - -Mark Wilkinson (markw at illuminae dot com), Pieter Neerincx, Frank Gibbons - -BioMOBY Project: http://www.biomoby.org - =cut package MOBY::CommonSubs; @@ -243,32 +284,38 @@ our @EXPORT_OK = (@{$EXPORT_TAGS{'all'}}); -=head1 PARSING MOBY SERVICE INVOCATIONS +=head1 PARSING MOBY INPUT AND OUTPUT -=head2 serviceInputParser +=head2 serviceInputParser and serviceResponseParser -B This routine will take a MOBY service invocation -message and extract the Simple/Collection/Parameter objects out of it +B These routines will take a Moby invocation (server side usage) or +response (client-side usage) and extract the Simple/Collection/Parameter objects out of it as MOBY::Client::SimpleArticle, MOBY::Client::CollectionArticle, and/or MOBY::Client::SecondaryArticle objects. The inputs are broken -up into individual queryID's (invocations). Each queryID is associated with -one or more individual input articles that are required to invoke that service, and -each input article is available by its articleName. +up into individual queryID's. Each queryID is associated with +one or more individual articles, and each article is available by its articleName. -B C +B C +B C B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message -B C<$inputs> is a hashref with the following structure: +B C<$inputs> or C<$outputs> are a hashref with the following structure: - $inputs->{$queryID}->{articleName} = + $Xputs->{$queryID}->{articleName} = MOBY::Client::SimpleArticle | MOBY::Client::CollectionArticle | MOBY::Client::SecondaryArticle -See also: +the SimpleArticle and CollectionArticle have methods to provide you with their +objectType, their namespace and their ID. If you want to get more out of them, +you should retrieve the XML::LibXML DOM using the ->XML_DOM method call +in either of those objects. This can be passed into other CommonSubs routines +such as getNodeContentWithArticle in order to retrieve sub-components of the +Moby object you have in-hand. +See also: =head3 Simples @@ -289,8 +336,7 @@ $inputs->{a1a}->{cutoff} = $MOBY::Client::Secondary # block - -=head3 Collections +=head3 Collections With inputs that have collections these are presented as a listref of Simple article DOM's. So for the following message: @@ -311,8 +357,8 @@ will become - $inputs->{2b2}->{name1} $MOBY::Client::Collection, # the Block - $inputs->{2b2}->{cutoff} $MOBY::Client::Secondary, # the Block + $inputs->{2b2}->{name1} = $MOBY::Client::Collection, # the Block + $inputs->{2b2}->{cutoff} = $MOBY::Client::Secondary, # the Block @@ -322,11 +368,11 @@ sub serviceInputParser { my ( $message ) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = getInputs( $message ); # returns XML::LibXML nodes ... + my @queries = _getInputs( $message ); # returns XML::LibXML nodes ... my %input_parameters; # $input_parameters{$queryID} = [ foreach my $query ( @queries ) { - my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData - my @input_articles = getArticlesAsObjects( $query ); + my $queryID = _getQID( $query ); # get the queryID attribute of the mobyData + my @input_articles = _getArticlesAsObjects( $query ); foreach my $article ( @input_articles ) { ${$input_parameters{$queryID}}{$article->articleName} = $article; } @@ -334,7 +380,58 @@ return \%input_parameters; } +*serviceResponseParser = \&serviceInputParser; +*serviceResponseParser = \&serviceInputParser; + +sub _getInputs { + my ( $XML ) = @_; + my $moby = _string_to_DOM($XML); + my @queries; + foreach my $querytag qw(mobyData moby:mobyData ) + { + my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block + for ( 1 .. $x->size() ) { # there may be more than one mobyData per message + push @queries, $x->get_node( $_ ); + } + } + return @queries; # return them in the order that they were discovered. +} + + +sub _getArticlesAsObjects { + my ( $moby ) = @_; + $moby = _string_to_DOM($moby); + return undef unless $moby->nodeType == ELEMENT_NODE; + return undef + unless ($moby->nodeName =~ /^(moby:|)mobyData$/); + my @articles; + foreach my $child ( $moby->childNodes ) + { # there may be more than one Simple/Collection per input; iterate over them + next unless $child->nodeType == ELEMENT_NODE; # ignore whitespace + next + unless ( $child->nodeName =~ /^(moby:|)(Simple|Collection|Parameter)$/ ); + my $object; + if ( $child->nodeName =~ /^(moby:|)Simple$/ ) { + $object = MOBY::Client::SimpleArticle->new( XML_DOM => $child ); + } elsif ( $child->nodeName =~ /^(moby:|)Collection$/ ) { + $object = MOBY::Client::CollectionArticle->new( XML_DOM => $child ); + } elsif ( $child->nodeName =~ /^(moby:|)Parameter$/ ) { + $object = MOBY::Client::SecondaryArticle->new( XML_DOM => $child ); + } + next unless $object; + push @articles, $object; # take the child elements, which are or + } + return @articles; # return them. +} + +sub _getQID { + my ( $XML ) = @_; + my $moby = _string_to_DOM($XML); + return '' unless ( $moby->nodeName =~ /^(moby:|)mobyData$/ ); + my $qid = _moby_getAttribute($moby, 'queryID' ); + return defined( $qid ) ? $qid : ''; +} =head1 MESSAGE COMPONENT IDENTITY AND VALIDATION @@ -735,6 +832,65 @@ } +=head1 Client-Side Common Subroutines + +These are the subroutines that will be most commonly used Client-Side for +processing the output of a MOBY service + +=head2 processResponse + +=cut + +sub processResponse { + my ( $result ) = @_; + return ( [], [] ) unless $result; + my $moby; + unless ( ref( $result ) =~ /XML\:\:LibXML/ ) { + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string( $result ); + $moby = $doc->getDocumentElement(); + } else { + $moby = $result->getDocumentElement(); + } + my @objects; + my @collections; + my @Xrefs; + my $success = 0; + foreach my $which ('mobyData', 'moby:mobyData') { + my $responses = $moby->getElementsByTagName( $which ); + next unless $responses; + foreach my $n ( 1 .. ( $responses->size() ) ) { + my $resp = $responses->get_node( $n ); + foreach my $response_component ( $resp->childNodes ) { + next unless $response_component->nodeType == ELEMENT_NODE; + if ( $response_component->nodeName =~ /^(moby:|)Simple$/ ) + { + foreach my $Object ( $response_component->childNodes ) { + next unless $Object->nodeType == ELEMENT_NODE; + $success = 1; + push @objects, $Object; + } + } elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ ) + { + my @objects; + foreach my $simple ( $response_component->childNodes ) { + next unless $simple->nodeType == ELEMENT_NODE; + next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ ); + foreach my $Object ( $simple->childNodes ) { + next unless $Object->nodeType == ELEMENT_NODE; + $success = 1; + push @objects, $Object; + } + } + push @collections, \@objects + ; #I'm not using collections yet, so we just use Simples. + } + } + } + } + return ( \@collections, \@objects ); +} + =head1 ANCILIARY ELEMENTS @@ -879,16 +1035,13 @@ } -=head1 MISCELLANEOUS +=head1 MISCELLANEOUS FUNCTIONS This section contains routines that didn't quite seem to fit anywhere else. -=cut - - =head2 getNodeContentWithArticle - give me a DOM, a TagName, an articleName and I will return you the content +B give me a DOM, a TagName, an articleName and I will return you the content of that node **as a string** (beware if there are additional XML tags in there!) this is meant for MOBYesque PRIMITIVES - things like: TAGCTGATCGAGCTGATGCTGA @@ -1032,24 +1185,21 @@ } - -=head2 _moby_getAttributeNode, _moby_getAttribute - -B Perform the same task as the DOM routine -getAttribute(Node), but check for both the prefixed and un-prefixed -attribute name (the prefix in question being, of course, -"moby:"). - -B - - $id = _moby_getAttribute($xml_libxml, "id"); - -where C is an attribute in the XML block given as C<$xml_libxml> - -B This function is intended for use internal to this package -only. It's not exported. - -=cut +#B Perform the same task as the DOM routine +#getAttribute(Node), but check for both the prefixed and un-prefixed +#attribute name (the prefix in question being, of course, +#"moby:"). +# +#B +# +# $id = _moby_getAttribute($xml_libxml, "id"); +# +#where C is an attribute in the XML block given as C<$xml_libxml> +# +#B This function is intended for use internal to this package +#only. It's not exported. +# +#=cut sub _moby_getAttributeNode { # Mimics behavior of XML::LibXML method getAttributeNode, but if the unqualified attribute cannot be found, @@ -1214,11 +1364,30 @@ sub _getQueryID { my ( $query ) = @_; $query = _string_to_XML($query); - return '' unless ( $query->nodeName =~ /^(moby:|)(queryInput|mobyData)$/ ); #Eddie - unsure + return '' unless ( $query->nodeName =~ /^(moby:|)mobyData$/ ); #Eddie - unsure return _moby_getAttribute($query, 'queryID' ); } -=head1 DEPRECATED + +sub _string_to_DOM { +# Convert string to DOM. +# If DOM passed in, just return it (i.e., this should be idempotent) +# By Frank Gibbons, Aug. 2005 +# Utility subroutine, not for external use (no export), widely used in this package. + my $XML = shift; + my $moby; + return $XML if ( ref($XML) =~ /^XML\:\:LibXML/ ); + + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ) }; + die("CommonSubs couldn't parse XML '$XML' because\n\t$@") if $@; + return $doc->getDocumentElement(); +} + + + +=head1 DEPRECATED FUNCTIONS =head2 genericServiceInputParser @@ -1228,6 +1397,7 @@ =cut sub genericServiceInputParser { +print STDERR "the genericServiceInputParser function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $message ) = @_; # get the incoming MOBY query XML my @inputs; # set empty response my @queries = getInputs( $message ); # returns XML::LibXML nodes ... @@ -1259,6 +1429,7 @@ =cut sub complexServiceInputParser { +print STDERR "the complexServiceInputParser function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $message ) = @_; # get the incoming MOBY query XML my @inputs; # set empty response my @queries = getInputs( $message ); # returns XML::LibXML nodes ... @@ -1291,6 +1462,7 @@ =cut sub getArticles { +print STDERR "the getArticles function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef @@ -1316,6 +1488,7 @@ sub getSimpleArticleIDs { +print STDERR "the getSimpleArticleIDs function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $desired_namespace, $input_nodes ) = @_; if ( $desired_namespace && !$input_nodes ) { # if called with ONE argument, then these are the input nodes! @@ -1390,6 +1563,7 @@ sub getSimpleArticleNamespaceURI { +print STDERR "the getSimpleArticleNamespaceURI function of MOBY::CommonSubs is deprecated. Please see documentation\n"; # pass me a input node and I will give you the lsid of the namespace of that input object my ( $input_node ) = @_; @@ -1410,21 +1584,6 @@ } } -sub _string_to_DOM { -# Convert string to DOM. -# If DOM passed in, just return it (i.e., this should be idempotent) -# By Frank Gibbons, Aug. 2005 -# Utility subroutine, not for external use (no export), widely used in this package. - my $XML = shift; - my $moby; - return $XML if ( ref($XML) =~ /^XML\:\:LibXML/ ); - - my $parser = XML::LibXML->new(); - my $doc; - eval { $doc = $parser->parse_string( $XML ) }; - die("CommonSubs couldn't parse XML '$XML' because\n\t$@") if $@; - return $doc->getDocumentElement(); -} =head2 getInputs @@ -1433,6 +1592,7 @@ =cut sub getInputs { + print STDERR "getInputs is now deprecated. Please update your code to use the serviceInputParser\n"; my ( $XML ) = @_; my $moby = _string_to_DOM($XML); my @queries; @@ -1453,6 +1613,7 @@ =cut sub getInputID { + print STDERR "getInputID method is now deprecated. Please use serviceInputParser or serviceResponseParser\n"; my ( $XML ) = @_; my $moby = _string_to_DOM($XML); return '' unless ( $moby->nodeName =~ /^(moby:|)queryInput|mobyData$/ ); @@ -1467,6 +1628,7 @@ =cut sub getArticlesAsObjects { + print STDERR "getArticlesAsObjects is now deprecated. Please use the serviceInputParser"; my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef unless $moby->nodeType == ELEMENT_NODE; @@ -1499,6 +1661,7 @@ =cut sub getCollectedSimples { +print STDERR "the getCollectedSimples function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef unless $moby->nodeType == ELEMENT_NODE; @@ -1520,6 +1683,8 @@ =cut sub getInputArticles { +print STDERR "the getInputArticles function of MOBY::CommonSubs is deprecated. Please see documentation\n"; + my ( $moby ) = @_; $moby = _string_to_DOM($moby); my $x; @@ -1548,6 +1713,7 @@ =cut sub extractRawContent { +print STDERR "the extractRawContent function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $article ) = @_; return "" unless ( $article || (ref( $article ) =~ /XML\:\:LibXML/) ); my $response; @@ -1569,6 +1735,7 @@ =cut sub extractResponseArticles { +print STDERR "the extractResponseArticles function of MOBY::CommonSubs is deprecated. Please see documentation\n"; my ( $result ) = @_; return ( [], [] ) unless $result; my $moby; @@ -1620,6 +1787,14 @@ return ( \@collections, \@objects ); } + +=head1 AUTHORS + +Mark Wilkinson (markw at illuminae dot com), Pieter Neerincx, Frank Gibbons + +BioMOBY Project: http://www.biomoby.org + + =head1 SEE ALSO From kawas at dev.open-bio.org Thu Feb 8 23:11:34 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 8 Feb 2007 18:11:34 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702082311.l18NBYFr031443@dev.open-bio.org> kawas Thu Feb 8 18:11:34 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/SOAP In directory dev.open-bio.org:/tmp/cvs-serv31408/SOAP Modified Files: Serializer.pm Log Message: fixed the problem where a client calls DUMP and the soap fails to parse. This fix must be extended to the case where SOAP::Data is passed (if that ever happens) moby-live/Perl/MOBY/SOAP Serializer.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/SOAP/Serializer.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/MOBY/SOAP/Serializer.pm 2007/02/01 14:15:11 1.1 +++ /home/repository/moby/moby-live/Perl/MOBY/SOAP/Serializer.pm 2007/02/08 23:11:34 1.2 @@ -3,7 +3,7 @@ # this module serializes SOAP messages to ensure # compatibility with other soap clients (Java) -# All that you have to do to make this your serializer, +# All that you have to do to make this your serializer, # is to uncomment, from MOBY-Central.pl, the line: # # $x->serializer(MOBY::SOAP::Serializer->new); @@ -12,8 +12,8 @@ # # MAKE SURE TO 'use MOBY::SOAP::Serializer;' # -# This ensures that mobycentral is compatible with -# SOAP-lite version >= .6 +# This ensures that mobycentral is compatible with +# SOAP-lite version >= .6 @MOBY::SOAP::Serializer::ISA = 'SOAP::Serializer'; sub envelope { @@ -21,6 +21,7 @@ # only 'transform' soap responses UNIVERSAL::isa( $_[3] => 'SOAP::Data' ) ? do { + # below encodes data #my $xml = $_[3]->value; #$xml =~ s"&"&"g; @@ -28,20 +29,29 @@ #$xml =~ s"\]\]\>"\]\]>"g; #$_[3]->value($xml); # when we set to string, we dont have to encode - $_[3]->type( 'string' => $_[3] ); + #FIXME - this wont work for the DUMP call if and when a SOAP::Data object is passed + $_[3]->type( 'string' => $_[3]->value() ); } : do { - - # below encodes data -> set type to string and we dont have to - #$_[3] =~ s"&"&"g; - #$_[3] =~ s"\<"<"g; - #$_[3] =~ s"\]\]\>"\]\]>"g; - # set to string to avoid encoding - $_[3] = SOAP::Data->type( 'string' => $_[3] ); + do { + # for dumps, they are of type array: set them accordingly + $_[3]->[0] = SOAP::Data->type( 'string' => $_[3]->[0] ) if $_[3]->[0]; + $_[3]->[1] = SOAP::Data->type( 'string' => $_[3]->[1] ) if $_[3]->[1]; + $_[3]->[2] = SOAP::Data->type( 'string' => $_[3]->[2] ) if $_[3]->[2]; + $_[3]->[3] = SOAP::Data->type( 'string' => $_[3]->[3] ) if $_[3]->[3]; + $_[3]->[4] = SOAP::Data->type( 'string' => $_[3]->[4] ) if $_[3]->[4]; + } if ( ref( $_[3] ) eq 'ARRAY' ); + do { + # below encodes data -> set type to string and we dont have to + #$_[3] =~ s"&"&"g; + #$_[3] =~ s"\<"<"g; + #$_[3] =~ s"\]\]\>"\]\]>"g; + # set to string to avoid encoding + $_[3] = SOAP::Data->type( 'string' => $_[3] ); + } unless ( ref( $_[3] ) eq 'ARRAY' ); } if $_[1] =~ /^(?:method|response)$/; - shift->SUPER::envelope(@_); } -1; +1; \ No newline at end of file From mwilkinson at dev.open-bio.org Fri Feb 9 00:19:01 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 19:19:01 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702090019.l190J1uV031851@dev.open-bio.org> mwilkinson Thu Feb 8 19:19:01 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv31832/MOBY Modified Files: CommonSubs.pm Log Message: revamping test suite for CommonSubs to use only the new methods. Please God let the deprecated methods die a horrible death. There's a lot more cleaning-up that could be done in CommonSubs with respect to using 'Local' tags rather than testing whether or not the moby: namespace is there each time, but that can come later. moby-live/Perl/MOBY CommonSubs.pm,1.94,1.95 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.94 retrieving revision 1.95 diff -u -r1.94 -r1.95 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/02/08 23:03:45 1.94 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/02/09 00:19:01 1.95 @@ -61,12 +61,12 @@ my $responses = serviceResponseParser($resp); # returns MOBY objects foreach my $queryID(keys %$responses){ # $inputs is a hashref of $input{queryid}->{articlename} = input object - my $this_invocation = $inputs->{$queryID}; + my $this_invocation = $responses->{$queryID}; if (my $data = $this_invocation->{'responseArticleName'}){ # $input is a MOBY::Client::Simple|Collection|Parameter object my $simples = $data->Simples; foreach my $simple(@$simples){ + my ($ns) = @{$simple->namespaces}; my $id = $simple->id; - my $id = $simple->namespace; my $XML_LibXML = $input->XML_DOM; # get access to the DOM } @@ -262,7 +262,7 @@ genericServiceInputParserAsObject complexServiceInputParser serviceInputParser - serviceInputParser + serviceResponseParser whichDeepestParentObject getServiceNotes simpleResponse @@ -387,9 +387,9 @@ my ( $XML ) = @_; my $moby = _string_to_DOM($XML); my @queries; - foreach my $querytag qw(mobyData moby:mobyData ) + foreach my $querytag qw(mobyData ) { - my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block + my $x = $moby->getElementsByLocalName( $querytag ); # get the mobyData block for ( 1 .. $x->size() ) { # there may be more than one mobyData per message push @queries, $x->get_node( $_ ); } @@ -667,7 +667,7 @@ the article's raw XML for simples and secondaries or a reference to an array containing [$articleName, $simpleXML] elements for a collection of simples. -C<$queryID> - (optional, but strongly recommended) the queryID value for +C<$queryID> - the queryID value for the mobyData block to which you are responding B as required by the API you must return a response for every From mwilkinson at dev.open-bio.org Fri Feb 9 00:19:01 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 19:19:01 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702090019.l190J16G031871@dev.open-bio.org> mwilkinson Thu Feb 8 19:19:01 EST 2007 Update of /home/repository/moby/moby-live/Perl/t In directory dev.open-bio.org:/tmp/cvs-serv31832/t Modified Files: CommonSubs.t Log Message: revamping test suite for CommonSubs to use only the new methods. Please God let the deprecated methods die a horrible death. There's a lot more cleaning-up that could be done in CommonSubs with respect to using 'Local' tags rather than testing whether or not the moby: namespace is there each time, but that can come later. moby-live/Perl/t CommonSubs.t,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/CommonSubs.t,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/t/CommonSubs.t 2006/06/07 20:39:27 1.6 +++ /home/repository/moby/moby-live/Perl/t/CommonSubs.t 2007/02/09 00:19:01 1.7 @@ -54,30 +54,20 @@ my @must_implement = qw/ + serviceInputParser + serviceResponseParser + simpleResponse collectionResponse complexResponse - complexServiceInputParser + isCollectionArticle + isSecondaryArticle + isSimpleArticle extractRawContent - extractResponseArticles - genericServiceInputParser - genericServiceInputParserAsObject - getArticles - getCollectedSimples getCrossReferences - getInputArticles - getInputID - getInputs getNodeContentWithArticle - getResponseArticles getServiceNotes - getSimpleArticleIDs - getSimpleArticleNamespaceURI - isCollectionArticle - isSecondaryArticle - isSimpleArticle responseFooter responseHeader - simpleResponse validateNamespaces validateThisNamespace whichDeepestParentObject @@ -86,34 +76,33 @@ can_ok('MOBY::CommonSubs', @must_implement) or diag("CommonSubs doesn't implement all the methods that it should"); -# Test each function individually - -######## PARSE INPUTS ######### -# genericServiceInputParser -# genericServiceInputParserAsObject -# complexServiceInputParser ######## EXTRACT CONTENTS ######### -my @query_ids = (1, 'a', 23, 24); -my $msg = < - - -foo -EOF - -my @inputs = getInputs(responseHeader() . $msg . responseFooter()); -is(scalar @inputs, scalar @query_ids) - or diag("Wrong number of inputs returned from getInputs"); -for (my $i = 0; $i < @query_ids; $i++) { - is(getInputID($inputs[$i]), $query_ids[$i]) - or diag("Wrong input ID returned for queryID $i: $inputs[$i]"); -} +#my @query_ids = (1, 'a', 23, 24); +#my $msg = < +#foo +#EOF +# +#my @inputs = getInputs(responseHeader() . $msg . responseFooter()); +#is(scalar @inputs, scalar @query_ids) +# or diag("Wrong number of inputs returned from getInputs"); +#for (my $i = 0; $i < @query_ids; $i++) { +# is(getInputID($inputs[$i]), $query_ids[$i]) +# or diag("Wrong input ID returned for queryID $i: $inputs[$i]"); +#} # This message contains two articles: Collection, and Parameter # The Collection, of course, contains some Simple Articles, but they are not top-level articles. -my $article_msg = < - + + + +my $moby_msg = < + + + CONTENT + + @@ -124,98 +113,54 @@ 10 - + ARTICLES -my @articles = getArticles($article_msg); -is(scalar @articles, 2) or diag("Wrong number of articles returned"); -my ($collection, $parameter) = @articles; -# Check that first one is a Collection... -is(isCollectionArticle($collection->[1]), 1) or diag("Expected Collection"); -# ...then pull out the Simples contained in it. -is(scalar getCollectedSimples($collection->[1]), 2) - or diag("Expected 2 Simples, didn't find them."); -is(isSecondaryArticle($parameter->[1]), 1) - or diag("Expected Secondary/Parameter"); - -TODO: { -local $TODO = "Need test for extractRawContent"; -#ok(extractRawContent($collection->[1]) -# =~ ".*<\/Simple>.*<\/Simple>") -# or diag("Couldn't extract raw content."); -} +my $responses = serviceResponseParser($moby_msg); # returns MOBY objects +isa_ok ($responses, "HASH", "response parser returned a HASH" ) or die "serviceResponseParser didn't return a hashref\n"; +my @ids = keys %{$responses}; +ok (scalar(@ids) == 1) or die "serviceResponseParser didn't find right number of invocation messages\n"; +ok ($ids[0] eq "query1") or die "service4ResponseParser didn't find the query1 query id\n"; + +my $this_invocation = $responses->{$ids[0]}; +ok ($this_invocation->{'simple1'}) or die "parser didn't find simple article in message\n"; +ok ($this_invocation->{'collection1'}) or die "parser didn't find collection article in message\n"; +ok ($this_invocation->{'e value cutoff'}) or die "parser didn't find secondary parameter article in message\n"; + +my $simple = $this_invocation->{'simple1'}; +my $collection = $this_invocation->{'collection1'}; +my $secondary = $this_invocation->{'e value cutoff'}; + +isa_ok($simple, "MOBY::Client::SimpleArticle") or die "retrieved Simple isn't a MOBY::Client::SimpleArticle object\n"; +isa_ok($collection, "MOBY::Client::CollectionArticle") or die "retrieved Collection isn't a MOBY::Client::CollectionArticle Object\n"; +isa_ok($secondary, "MOBY::Client::SecondaryArticle") or die "retrieved Secondary isn't a MOBY::Client::SecondaryArticle object\n"; +# other tests of the MOBY::Client::*Article should be done in their own test suite # Test getInputArticles with one, and with more than one mobyData block. my $two_mobyDatas = < - + - + + INP_ART -is(scalar getInputArticles(responseHeader() - . $article_msg - . responseFooter()), 1) - or diag("Couldn't find right number of input articles"); - -is(scalar getInputArticles(responseHeader() - . $two_mobyDatas - . responseFooter()), 2) - or diag("Couldn't find right number of input articles"); - -# getSimpleArticleIDs can be called in a number of ways, and of course, we have to test them all. -# 1. If just one argument, it's assumed to be listref of Simple DOMs, and all ID's should be returned, -# regardless of namespace -# 2. If two arguments, first is taken to be namespace. Only articlenames from that namespace will -# be returned; other articlenames will generate a 'undef' response, so that the number of inputs -# matches the number of outputs. - -my @NS = ("Rub1", "Rub2"); -my $articles = [ XML_maker(""), - XML_maker(""), - XML_maker("") - ]; - -is(getSimpleArticleIDs($articles), 3) - or diag("Wrong number of Simple Articles IDs returned (no namespace)"); -for my $ns (@NS) { # Should get three responses (one for each input), but two should be 'undef' - my @responses = getSimpleArticleIDs($ns, $articles); - is(scalar @responses, 3) - or diag("Wrong number of Simple Articles IDs returned (with namespace)"); - my $count_undef = 0; - for my $r (@responses) { $count_undef++ if (!defined ($r)) } - is($count_undef, 2) - or diag("Wrong number of 'undef's returned by getSimpleArticleIDs"); -} - -my @bogus; -my $bogus_ns = "bogus NS"; -eval { @bogus = getSimpleArticleIDs($bogus_ns, $articles) }; -isnt($@, undef) - or diag("Invalid namespace '$bogus_ns' should have 'die'd, but didn't"); -is(scalar @bogus , 0) - or diag("Wrong number of Simple Articles IDs returned " . - "(expected zero for bogus namespace)"); - -is(scalar getSimpleArticleIDs('Rub1', $articles), scalar @{$articles}) - or diag("Wrong number of Simple Articles IDs returned " . - "(expected zero for valid but unused namespace)"); - -ok(getSimpleArticleNamespaceURI($articles->[0]) - =~ /^urn\:lsid\:biomoby\.org\:namespacetype\:/) - or diag("Got bad LSID for valid namespace"); - -is( getSimpleArticleNamespaceURI($articles->[1]), undef) -# =~ /^urn\:lsid\:biomoby\.org\:namespacetype\:/ ) ) - or diag("Got valid LSID for invalid namespace"); +$responses = serviceResponseParser($two_mobyDatas); # returns MOBY objects +isa_ok ($responses, "HASH", "response parser returned a HASH" ) or die "serviceResponseParser didn't return a hashref for multiple input test\n"; + at ids = keys %{$responses}; +ok (scalar(@ids) == 2) or die "serviceResponseParser didn't find right number of invocation messages when two were passed\n"; +ok ($ids[0] eq "first") or die "serviceResponseParser didn't find the first query id\n"; +ok ($ids[1] eq "second") or die "serviceResponseParser didn't find the second query id\n"; + my $sequence = "TAGCTGATCGAGCTGATGCTGA"; my $articlename = "SequenceString"; @@ -374,10 +319,10 @@ # and that bogus ones do NOT. my @LSIDs = validateNamespaces('bogus-ns', @ns, 'other bogus-ns'); foreach ($LSIDs[0], $LSIDs[-1]) { - is($_, undef) or diag("Bogus namespace ($LSIDs[0]) got an LSID"); + is($_, undef,"validate namespace lsids") or diag("Bogus namespace ($LSIDs[0]) got an LSID"); } foreach (@LSIDs[1..-2]) { - isnt($_, undef) or diag("Bona fide namespace ($_) had no LSID"); + isnt($_, undef, "validate namespace lsids2") or diag("Bona fide namespace ($_) had no LSID"); } ######## GENERATE RESPONSE ######### @@ -389,14 +334,13 @@ . responseFooter()); $sresp = $sresp->getElementsByTagName('moby:mobyData'); # || $sresp->getElementsByTagName('mobyData'); -is($sresp->size(), 1) +is($sresp->size(), 1,"response size OK") or diag("SimpleResponse should contain only a single mobyData element."); my $mobyData = $sresp->get_node(1); is($mobyData->getAttribute('moby:queryID') || $mobyData->getAttribute('queryID'), $qID) or diag("SimpleResponse didn't contain right queryID"); -my $simple; my $count_elements = 0; foreach ($mobyData->childNodes->get_nodelist) { if ($_->nodeType == ELEMENT_NODE) { $count_elements++ } @@ -440,15 +384,15 @@ or diag("collectionResponse should have mobyData as outermost tag: got '$coll_resp'"); # Now parse the XML, and make sure it checks out according to DOM my $coll_resp_dom = XML_maker(responseHeader() . $coll_resp . responseFooter()); - my $mData = $coll_resp_dom->getElementsByTagName('moby:mobyData'); - is($mData->size(), 1) + my $mData = $coll_resp_dom->getElementsByLocalName('mobyData'); + is($mData->size(), 1,"collection response size is correct") or diag("CollectionResponse should contain only a single mobyData element."); $mData = $mData->get_node(1); is($mData->getAttribute('moby:queryID') || $mData->getAttribute('queryID'), $qID) or diag("CollectionResponse's mobyData element didn't contain correct queryID"); - my $colls = $mData->getElementsByTagName("moby:Collection"); - is ($colls->size(), 1) + my $colls = $mData->getElementsByLocalName("Collection"); + is ($colls->size(), 1,"collection has wrong number of children") or diag("CollectionResponse should have only a single child: Collection."); my $Coll = $colls->get_node(1); is($Coll->getAttribute('moby:articleName') || $Coll->getAttribute('articleName'), @@ -460,19 +404,9 @@ or diag("CollectionResponse contains wrong number of Simples"); # # Finally, parse the sucker with the tools in CommonSubs: it should be able to understand its own creations! - my @inputs = getInputs(responseHeader() . $coll_resp . responseFooter() ); - is(scalar @inputs, 1) - or diag("CollectionResponse should contain only one mobyData block"); - is(getInputID($inputs[0]), $qID) - or diag("CollectionResponse returned mobyData block with incorrect queryID attribute"); - my @articles = getArticles($inputs[0]); - is(scalar @articles, 1) - or diag("CollectionResponse should contain only one Collection"); - is($articles[0]->[0], $aname) - or diag("CollectionResponse had incorrect articleName"); - my @collected_simples = getCollectedSimples($articles[0]->[1]); - is(scalar @collected_simples , scalar @{$data}) - or diag("CollectionResponse contained incorrect number of Simples"); + my $inputs = serviceInputParser(responseHeader() . $coll_resp . responseFooter() ); + +ok (scalar(keys %{$inputs}) == 1) or diag("can't eat my own dogfood!"); # Test response when one or more simples are empty/undef. # They should result in empty Simple tags, but the total response should NOT be empty. From mwilkinson at dev.open-bio.org Fri Feb 9 00:27:07 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Thu, 8 Feb 2007 19:27:07 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702090027.l190R7Td032177@dev.open-bio.org> mwilkinson Thu Feb 8 19:27:07 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv32158/MOBY Modified Files: CommonSubs.pm Log Message: one more function needs to be deprecated since it isnt API compliant (it doesn't use query id's) moby-live/Perl/MOBY CommonSubs.pm,1.95,1.96 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.95 retrieving revision 1.96 diff -u -r1.95 -r1.96 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/02/09 00:19:01 1.95 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2007/02/09 00:27:07 1.96 @@ -832,65 +832,6 @@ } -=head1 Client-Side Common Subroutines - -These are the subroutines that will be most commonly used Client-Side for -processing the output of a MOBY service - -=head2 processResponse - -=cut - -sub processResponse { - my ( $result ) = @_; - return ( [], [] ) unless $result; - my $moby; - unless ( ref( $result ) =~ /XML\:\:LibXML/ ) { - my $parser = XML::LibXML->new(); - my $doc = $parser->parse_string( $result ); - $moby = $doc->getDocumentElement(); - } else { - $moby = $result->getDocumentElement(); - } - my @objects; - my @collections; - my @Xrefs; - my $success = 0; - foreach my $which ('mobyData', 'moby:mobyData') { - my $responses = $moby->getElementsByTagName( $which ); - next unless $responses; - foreach my $n ( 1 .. ( $responses->size() ) ) { - my $resp = $responses->get_node( $n ); - foreach my $response_component ( $resp->childNodes ) { - next unless $response_component->nodeType == ELEMENT_NODE; - if ( $response_component->nodeName =~ /^(moby:|)Simple$/ ) - { - foreach my $Object ( $response_component->childNodes ) { - next unless $Object->nodeType == ELEMENT_NODE; - $success = 1; - push @objects, $Object; - } - } elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ ) - { - my @objects; - foreach my $simple ( $response_component->childNodes ) { - next unless $simple->nodeType == ELEMENT_NODE; - next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ ); - foreach my $Object ( $simple->childNodes ) { - next unless $Object->nodeType == ELEMENT_NODE; - $success = 1; - push @objects, $Object; - } - } - push @collections, \@objects - ; #I'm not using collections yet, so we just use Simples. - } - } - } - } - return ( \@collections, \@objects ); -} - =head1 ANCILIARY ELEMENTS @@ -1389,6 +1330,63 @@ =head1 DEPRECATED FUNCTIONS +=head2 processResponse + +DEPRECATED + +=cut + +sub processResponse { +print STDERR "the processResponse subroutine in MOBY::CommonSubs is deprecated. Please use serviceResponseParser for API compliance\n"; + my ( $result ) = @_; + return ( [], [] ) unless $result; + my $moby; + unless ( ref( $result ) =~ /XML\:\:LibXML/ ) { + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string( $result ); + $moby = $doc->getDocumentElement(); + } else { + $moby = $result->getDocumentElement(); + } + my @objects; + my @collections; + my @Xrefs; + my $success = 0; + foreach my $which ('mobyData', 'moby:mobyData') { + my $responses = $moby->getElementsByTagName( $which ); + next unless $responses; + foreach my $n ( 1 .. ( $responses->size() ) ) { + my $resp = $responses->get_node( $n ); + foreach my $response_component ( $resp->childNodes ) { + next unless $response_component->nodeType == ELEMENT_NODE; + if ( $response_component->nodeName =~ /^(moby:|)Simple$/ ) + { + foreach my $Object ( $response_component->childNodes ) { + next unless $Object->nodeType == ELEMENT_NODE; + $success = 1; + push @objects, $Object; + } + } elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ ) + { + my @objects; + foreach my $simple ( $response_component->childNodes ) { + next unless $simple->nodeType == ELEMENT_NODE; + next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ ); + foreach my $Object ( $simple->childNodes ) { + next unless $Object->nodeType == ELEMENT_NODE; + $success = 1; + push @objects, $Object; + } + } + push @collections, \@objects + ; #I'm not using collections yet, so we just use Simples. + } + } + } + } + return ( \@collections, \@objects ); +} + =head2 genericServiceInputParser From mwilkinson at dev.open-bio.org Fri Feb 9 21:38:28 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Fri, 9 Feb 2007 16:38:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702092138.l19LcScg006850@dev.open-bio.org> mwilkinson Fri Feb 9 16:38:28 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv6831/MOBY/Client Modified Files: Central.pm Log Message: fixing potential infinite loop that Eddie found moby-live/Perl/MOBY/Client Central.pm,1.145,1.146 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.145 retrieving revision 1.146 diff -u -r1.145 -r1.146 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/07 00:07:11 1.145 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/09 21:38:28 1.146 @@ -184,11 +184,11 @@ sub Connection { my ( $self, $desired ) = @_; if ($desired) { - while ( my ( $name, $type, $connect ) = - ( @{ $self->Connections->[0] } ) ) - { - return ( $type, $connect ) if $name eq $desired; - } + my @registries = @{$self->Connections}; + foreach (@registries){ + my ( $name, $type, $connect ) = @{$_}; + return ( $type, $connect ) if $name eq $desired; + } } else { my ( $name, $type, $connect ) = @{ $self->Connections->[0] }; From mwilkinson at dev.open-bio.org Fri Feb 9 21:46:34 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Fri, 9 Feb 2007 16:46:34 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702092146.l19LkYBs006911@dev.open-bio.org> mwilkinson Fri Feb 9 16:46:34 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv6892/MOBY/Client Modified Files: Central.pm Log Message: fixing potential infinite loop that Eddie found moby-live/Perl/MOBY/Client Central.pm,1.146,1.147 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.146 retrieving revision 1.147 diff -u -r1.146 -r1.147 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/09 21:38:28 1.146 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2007/02/09 21:46:34 1.147 @@ -272,6 +272,8 @@ my $regno = 0; my %reg = %{ $self->Registries }; while ( my ( $name, $acc ) = each %reg ) { + $self->default_MOBY_servername($name); # set the current as the default... if there is only one, then it becomes default, which is nice! If ther eis more than one, then the person shold be explicitly calling one or the other anyway + $regno++; # count how many registries we have in total my $url = $acc->{URL} ? $acc->{URL} : $self->default_MOBY_server; my $uri = $acc->{URI} ? $acc->{URI} : $self->default_MOBY_uri; From kawas at dev.open-bio.org Fri Feb 9 21:55:33 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 9 Feb 2007 16:55:33 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702092155.l19LtXD6007036@dev.open-bio.org> kawas Fri Feb 9 16:55:32 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv7001/Client Modified Files: Service.pm Log Message: applying a client side patch for the wsdl returned by a server running the old codebase. moby-live/Perl/MOBY/Client Service.pm,1.33,1.34 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/08 18:50:24 1.33 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/09 21:55:32 1.34 @@ -117,14 +117,12 @@ $self->category('post'); } - #my $dir = cwd; - # seems to be a bug in SOAP::Lite that the WSDL document - # fails a parse if it is passed as a scalar rather than a file - # this section can be removed when this bug is fixed - #open (OUT, ">$dir/Service.wsdl") || die "cant open dump of wsdl file"; - #print OUT $self->service; - #close OUT; - # ________________________________________ + # TODO - added to make old WSDL compliant with soap lite 0.69 + if ( $wsdl =~ /element="xsd1:NOT_YET_DEFINED_INPUTS"/ ) { + $wsdl =~ s/name="body" element="xsd1:NOT_YET_DEFINED_INPUTS"/name="data" type="xsd:string"/g; + $wsdl =~ s/element="xsd1:NOT_YET_DEFINED_OUTPUTS"/type="xsd:string"/g; + } + $wsdl = URI::Escape::uri_escape( $self->service ); # this seems to fix the bug my $soap = SOAP::Lite->service( "data:,$wsdl" ); From mwilkinson at dev.open-bio.org Sat Feb 10 01:52:57 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Fri, 9 Feb 2007 20:52:57 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702100152.l1A1qvsW007558@dev.open-bio.org> mwilkinson Fri Feb 9 20:52:57 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv7539/MOBY/Client Modified Files: Service.pm Log Message: added a new function to MOBY::Client::Central that allows the client to specify the queryIDs. This is necesary if a client program needs to keep a maping between the input and the associated output. I know, I know. This should have been done years ago. Sorry :-( moby-live/Perl/MOBY/Client Service.pm,1.34,1.35 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/09 21:55:32 1.34 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/10 01:52:57 1.35 @@ -338,10 +338,107 @@ return $result; } + +=head2 enumerated_execute + + Usage : $result = $Service->enumerated_execute(%args) + Function : execute the MOBY service using self-enumerated inputs + Returns : whatever the Service provides as output + Args : Input => %data + Comment : %data is a hash of single invocation inputs + the structure of %data is: + + $data{$queryID} = {articleName => $inputXML1, # for simples and parameters + articleNmae => [$inputXML2, $inputXML3], # for collections + } + $inputXML is the actual XML of the Input object + for example + + a full example might be: + + $data{invocation1} = {id_to_match => "", + id_list => [", + ",... + ] + cutoff => "10" + } + + +=cut + + + +sub enumerated_execute { + my ( $self, %args ) = @_; + die "ERROR: expected Input to be a HASH ref " + unless ( ref( $args{Input} ) eq 'HASH' ); + my %inputs = %{$args{Input}}; +# structure of %input is: +#$input{qid} = {articleName => "", # for simples +# articleName2 => ["", ""], # for collections +# } + + my $data; + foreach my $qID( keys %inputs ) { + die "ERROR: expected hashref {articleName => XML} for each queryID" unless ( ref($inputs{$qID}) eq 'HASH' ); + my %articles = %{$inputs{$qID}}; + $data .= ""; + foreach my $articleName(keys %articles){ + my $XML = $articles{$articleName}; + if ( ref( $XML ) ne 'ARRAY' ) { + $XML ||= ""; + if ( $XML =~ /\<(moby\:|)Value\>/ ){ + $data .= "$XML"; + } else { + $data .= "\n$XML\n\n"; + } + } elsif ( ref( $XML ) eq 'ARRAY' ) { + my @objs = @{$XML}; + $data .= "\n"; + foreach ( @objs ) { + $data .= "$_\n"; + } + $data .= "\n"; + } + } + $data .= "\n"; + } + ################### + # this was added on January 19th, 2005 and may not work! + ################### + ################### + my $version = $self->smessageVersion(); + $data = " + + + $data + + "; + my $METHOD = $self->serviceName; + &_LOG( %args, $METHOD ); + my $response; + + if ($self->category eq 'moby'){ + eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; + if ($@) { die "Service execution failed: $@"} + else {return $response;} # the service execution failed then pass back "" + } elsif ($self->category eq 'post'){ + my $response = $self->_executePOSTService(data => $data, method => $METHOD); + # currently SOAP::Lite does not execute POST WSDL, so we need to + # use LWP or something like that in the executePOSTService method + #eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; + unless ($response){ die "Service execution failed: $@"} + else {return $response;} # the service execution failed then pass back "" + } +} + + + + =head2 methods Usage : $name = $Service->methods() - Function : Internal method to retrieve all methods from a service + Function : retrieve all possible method calls for a given service Returns : listref of method names as strings Args : none From kawas at dev.open-bio.org Thu Feb 15 17:16:42 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 15 Feb 2007 12:16:42 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702151716.l1FHGgDJ032469@dev.open-bio.org> kawas Thu Feb 15 12:16:42 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv32434 Modified Files: Central.pm Log Message: async wsdl had element="" instead of type="" when defining inputs/outputs moby-live/Perl/MOBY Central.pm,1.279,1.280 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.279 retrieving revision 1.280 diff -u -r1.279 -r1.280 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/06 18:04:48 1.279 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/15 17:16:41 1.280 @@ -4115,7 +4115,7 @@ xmlns:tns="http://biomoby.org/Central.wsdl" xmlns:xsd1="http://biomoby.org/CentralXSDs.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:xsd="http://www.w3.org/1999/XMLSchema" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd" @@ -4148,16 +4148,16 @@ - + - + - + - + From kawas at dev.open-bio.org Thu Feb 15 17:44:38 2007 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 15 Feb 2007 12:44:38 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702151744.l1FHic3M032719@dev.open-bio.org> kawas Thu Feb 15 12:44:37 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv32684 Modified Files: Central.pm Log Message: made the async wsdl to consume string moby-live/Perl/MOBY Central.pm,1.280,1.281 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.280 retrieving revision 1.281 diff -u -r1.280 -r1.281 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/15 17:16:41 1.280 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/15 17:44:37 1.281 @@ -4148,16 +4148,16 @@ - + - + - + - + From mwilkinson at dev.open-bio.org Mon Feb 19 21:10:24 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 19 Feb 2007 16:10:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702192110.l1JLAOMu005201@dev.open-bio.org> mwilkinson Mon Feb 19 16:10:23 EST 2007 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv5182/MOBY/Client Modified Files: Service.pm Log Message: somehow the encodig of the MOBY message got screwed up. Should be correct now. moby-live/Perl/MOBY/Client Service.pm,1.35,1.36 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/10 01:52:57 1.35 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/19 21:10:23 1.36 @@ -295,7 +295,7 @@ my $response; if ($self->category eq 'moby'){ - eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; + eval { ( $response ) = $self->_soapService->$METHOD( SOAP::Data->type('string' => $data) ) }; if ($@) { die "Service execution failed: $@"} else {return $response;} # the service execution failed then pass back "" } elsif ($self->category eq 'post'){ @@ -419,7 +419,7 @@ my $response; if ($self->category eq 'moby'){ - eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; + eval { ( $response ) = $self->_soapService->$METHOD( SOAP::Data->type('string' => $data) ) }; if ($@) { die "Service execution failed: $@"} else {return $response;} # the service execution failed then pass back "" } elsif ($self->category eq 'post'){ From mwilkinson at dev.open-bio.org Mon Feb 19 22:36:12 2007 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 19 Feb 2007 17:36:12 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200702192236.l1JMaCl4005389@dev.open-bio.org> mwilkinson Mon Feb 19 17:36:12 EST 2007 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory dev.open-bio.org:/tmp/cvs-serv5342 Modified Files: ConstructingYourService.html DesignAnObject.html DiscoverService.html ExecuteSyncService.html RegisterAnObject.html RegisterNamespace.html RegisterServiceInstance.html RegisterServiceType.html Log Message: fixed HTML to solve rendering problem in IE moby-live/Docs/MOBY-S_API/Perl ConstructingYourService.html,1.21,1.22 DesignAnObject.html,1.4,1.5 DiscoverService.html,1.1,1.2 ExecuteSyncService.html,1.1,1.2 RegisterAnObject.html,1.4,1.5 RegisterNamespace.html,1.4,1.5 RegisterServiceInstance.html,1.6,1.7 RegisterServiceType.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2007/02/07 01:10:22 1.21 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2007/02/19 22:36:12 1.22 @@ -59,7 +59,7 @@
    - +

    Constructing =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DesignAnObject.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DesignAnObject.html 2006/02/21 15:28:52 1.4 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DesignAnObject.html 2007/02/19 22:36:12 1.5 @@ -1,4 +1,3 @@ - @@ -60,7 +59,7 @@
    - +

    Designing MOBY-S Objects

    Fundamental Facts about MOBY-S Objects

    =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DiscoverService.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DiscoverService.html 2007/02/07 01:10:22 1.1 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/DiscoverService.html 2007/02/19 22:36:12 1.2 @@ -1,4 +1,3 @@ - @@ -60,7 +59,7 @@
    - +

    Discovering your service

    To discover a service (for example, the service "getGoTerm" that you just registered in =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ExecuteSyncService.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ExecuteSyncService.html 2007/02/08 18:44:51 1.1 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ExecuteSyncService.html 2007/02/19 22:36:12 1.2 @@ -1,4 +1,3 @@ - @@ -56,7 +55,7 @@
    - +

    Executing a service in Synchronous mode

    The "getGoTerm" service that we have been discussing in this tutorial is a Sychronous Moby Service, meaning that if you execute it, the response from the =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html 2006/06/02 08:21:34 1.4 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html 2007/02/19 22:36:12 1.5 @@ -1,4 +1,3 @@ - @@ -60,7 +59,6 @@
    -

    Using the Perl API to register an object

    =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html 2006/06/02 08:21:34 1.4 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html 2007/02/19 22:36:12 1.5 @@ -1,7 +1,7 @@ - + @@ -30,13 +30,7 @@ #headerimg { background: url('http://biomoby.open-bio.org/wordpress/wp-content/themes/moby/images/moby1.gif') no-repeat left;} - - - -