From gordonp at dev.open-bio.org Wed Mar 11 20:02:46 2009 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 11 Mar 2009 20:02:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903120002.n2C02kKQ007988@dev.open-bio.org> gordonp Wed Mar 11 20:02:46 EDT 2009 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv7952/src/main/org/biomoby/shared Modified Files: NamespaceContextImpl.java Log Message: Added c-tor that creates a context based on a given DOM node, to be used in the Seahawk PBE system moby-live/Java/src/main/org/biomoby/shared NamespaceContextImpl.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/NamespaceContextImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/NamespaceContextImpl.java 2008/03/12 17:47:18 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/NamespaceContextImpl.java 2009/03/12 00:02:46 1.6 @@ -1,6 +1,8 @@ package org.biomoby.shared; +import org.w3c.dom.*; + import javax.xml.namespace.NamespaceContext; import java.util.HashMap; @@ -16,6 +18,51 @@ private Map prefixes; private Map nsURIs; + /** + * Traverses up the DOM from the given element to enumerate all of the prefix <-> namespace mappings + * valid for this node. Note that the DOM does not explicitly contain the xmlns attributes + * therefore we glean this info from the qualified elements and attributes. + */ + public NamespaceContextImpl(Node contextNode, String defaultNSPrefix){ + prefixes = new HashMap(); + nsURIs = new HashMap(); + + for(Node currentNode = contextNode; currentNode != null; currentNode = currentNode.getParentNode()){ + if(currentNode instanceof Element){ + Element el = (Element) currentNode; + String uri = el.getNamespaceURI(); + String prefix = el.getPrefix(); + if(uri != null && uri.length() != 0){ + if(prefix == null){ + prefix = defaultNSPrefix; + } + if(!nsURIs.containsKey(prefix)){ + nsURIs.put(prefix, uri); + } + } + + NamedNodeMap xmlnsAttrs = ((Element) currentNode).getAttributes(); + for(int i = 0; i < xmlnsAttrs.getLength(); i++){ + Attr xmlnsDecl = (Attr) xmlnsAttrs.item(i); + if(xmlnsDecl.getNamespaceURI() == null || + xmlnsDecl.getPrefix() == null){ + continue; + } + + if(!prefixes.containsKey(xmlnsDecl.getNamespaceURI())){ + prefixes.put(xmlnsDecl.getNamespaceURI(), xmlnsDecl.getPrefix()); + } + if(!nsURIs.containsKey(xmlnsDecl.getPrefix())){ + nsURIs.put(xmlnsDecl.getPrefix(), xmlnsDecl.getNamespaceURI()); + } + } + } + } + } + + /** + * Populates the mapping table with an assortment of prefixes and namespaces used in Moby (see MobyPrefixResolver) + */ public NamespaceContextImpl(){ prefixes = new HashMap(); nsURIs = new HashMap(); @@ -35,6 +82,7 @@ prefixes.put(MobyPrefixResolver.HTTP_NAMESPACE, MobyPrefixResolver.HTTP_PREFIX); prefixes.put(MobyPrefixResolver.SAWSDL_NAMESPACE, MobyPrefixResolver.SAWSDL_PREFIX); prefixes.put(MobyPrefixResolver.LSID_NAMESPACE, MobyPrefixResolver.LSID_PREFIX); + prefixes.put(MobyPrefixResolver.XSD_NAMESPACE, MobyPrefixResolver.XSD_PREFIX); // Reverse map prefix -> nsURI nsURIs.put(MobyPrefixResolver.XSI_PREFIX, MobyPrefixResolver.XSI_NAMESPACE2001); From kawas at dev.open-bio.org Fri Mar 13 15:20:03 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 13 Mar 2009 15:20:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903131920.n2DJK3jJ018632@dev.open-bio.org> kawas Fri Mar 13 15:20:02 EDT 2009 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory dev.open-bio.org:/tmp/cvs-serv18596/Docs/MOBY-S_API/Perl Modified Files: ConstructingYourService.html Log Message: removed dead links. added a referal to moses, dashboard and the MOBYRegistrationPages. moby-live/Docs/MOBY-S_API/Perl ConstructingYourService.html,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2007/02/19 22:36:12 1.22 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2009/03/13 19:20:02 1.23 @@ -71,37 +71,41 @@
  • Do the object type(s) that your service will consume already exist in the - -Object Ontology? If not, learn how to design your own MOBY objects
  • Do the object type(s) that your service will produce already -exist in the -Object Ontology? If not, then you need to register your objects in the MOBY-S object/class ontology
  • Does an appropriate service type term already exist in the -Service Ontology? You need to register your new service type in the MOBY-S service ontology.
  • Do the namespaces that you are going to use in your objects -already exist in the -Namespace Ontology? Register your namespace, if it doesn't already exist.
  • - -If all object types, service types, and namespaces already exist in -the ontology then you are ready to set up your service. Once you have finished setting it up following the guidelines below, you will then need to Register your service for it to become visible on the MOBY Central registry. - -In Perl, MOBY-S services are currently limited to SOAP over HTTP; the -name of the method call (i.e. the SOAP Action header) is the same as -the service name registered in the MOBY Central registry. - +

    If you want a graphical way for registering your terms into the ontologies, you can try:

    + +

    If all object types, service types, and namespaces already exist in + the ontology then you are ready to set up your service. Once you have finished setting it up following the guidelines below, you will then need to Register your service for it to become visible on the MOBY Central registry. + + In Perl, MOBY-S services are currently limited to SOAP over HTTP; the + name of the method call (i.e. the SOAP Action header) is the same as + the service name registered in the MOBY Central registry.

    +

    Alternatively, a new, more simple way to implement your service exists in Perl MOSES!

    The dispatcher

    The most straightforward paradigm is to have a single SOAP server running as a CGI script, and this listener hands-off requests to the From kawas at dev.open-bio.org Thu Mar 26 14:41:42 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 26 Mar 2009 14:41:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903261841.n2QIfg7b003394@dev.open-bio.org> kawas Thu Mar 26 14:41:41 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY In directory dev.open-bio.org:/tmp/cvs-serv3359/Perl/MOBY-Server/lib/MOBY Modified Files: Central.pm Log Message: bug fix: datatypes registered with similarly named members were not flagged as incorrect. piggy backed here is code for async post (WSDL) - registry wont handle it just yet . full code to be committed saturday march 28, 2009 as long as no one objects to the rfc. moby-live/Perl/MOBY-Server/lib/MOBY Central.pm,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm 2008/09/02 13:14:18 1.7 +++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm 2009/03/26 18:41:41 1.8 @@ -9,7 +9,7 @@ package MOBY::Central; use strict; use Carp; -use vars qw($AUTOLOAD $WSDL_TEMPLATE $WSDL_POST_TEMPLATE $WSDL_ASYNC_TEMPLATE); +use vars qw($AUTOLOAD $WSDL_TEMPLATE $WSDL_POST_TEMPLATE $WSDL_ASYNC_TEMPLATE $WSDL_ASYNC_POST_TEMPLATE); use XML::LibXML; use MOBY::OntologyServer; use MOBY::service_type; @@ -384,10 +384,35 @@ } } } + # are the article names unique? + if ( keys %{$relationships} ) { + my $parent_type; + my %art_names = (); + while ( my ( $reltype, $obj ) = each %{$relationships} ) { + # one isa relationship + if ($reltype =~ /isa/i) { + foreach ( @{$obj} ) { + my ( $objectType, $articleName ) = @{$_}; + $parent_type = $objectType; + } + } else { + #has/hasa relationship + foreach ( @{$obj} ) { + my ( $objectType, $articleName ) = @{$_}; + return return &_error( "Article names for HAS/HASA relationships must be unique. Please ensure that names are unique!", "" ) + if $art_names{$articleName}; + # add name to the hash + $art_names{$articleName} = 1; + } + } + } + unless (&_extract_terms($parent_type, \%art_names)){ + return &_error( "Article names for HAS/HASA relationships (including those inherited) must be unique. Please ensure that names are unique!", "" ); + } + } # should be good to go now... - ( $success, $message, $URI ) = $OntologyServer->createObject( node => $term, description => $desc, @@ -435,6 +460,37 @@ return &_success( "Object $term registered successfully.", $URI ); } +############################### +# +############################### + +sub _extract_terms { + + my ( $datatype, $articles ) = @_; + my $ont_serv = MOBY::OntologyServer->new( ontology => "object" ); + my $stuff = $ont_serv->retrieveObject( type => $datatype ); + return 1 unless $stuff; + + # extract all isa/hasa/has relationships + my $rels = $stuff->{Relationships} if defined $stuff->{Relationships}; + for my $relation ( keys %{$rels} ) { + for my $term ( @{ $rels->{$relation} } ) { + + # pos 1 has articlename, pos 2 has datatype + # if we are in isa, then drill into it + if ( $relation =~ m/\:isa$/i ) { + return 0 unless &_extract_terms( @{$term}[2], $articles ); + } else { + + # check if we already processed the articlename ... + return 0 if defined @{$term}[1] and $articles->{ @{$term}[1] }; + $articles->{ @{$term}[1] } = 1 if @{$term}[1]; + } + } + } + return 1; +} + #Eddie - converted sub _registerObjectPayload { my ($payload) = @_; #EDDIE - assuming that payload is a string @@ -1127,7 +1183,7 @@ Input XML : - moby + moby YourServiceNameHere TypeOntologyTerm http://path.to/your/signature/RDF.rdf @@ -1360,7 +1416,7 @@ $error .= "invalid character encoding; service name not encoded as UTF-8\n" unless decode_utf8( $serviceName ) eq $serviceName; return &_error( "malformed payload $error\n\n", "" ) if ($error); return &_error( - "Category may take the (case sensitive) values 'moby', 'moby-async', 'cgi', 'doc-literal', and 'doc-literal-async', \n", + "Category may take the (case sensitive) values 'moby', 'moby-async', 'cgi', 'cgi-async', 'doc-literal', and 'doc-literal-async', \n", "" ) unless ( @@ -1368,6 +1424,7 @@ || ( $Category eq "moby" ) || ( $Category eq "moby-async" ) || ( $Category eq "cgi" ) + || ( $Category eq "cgi-async" ) || ( $Category eq "doc-literal" ) || ( $Category eq "doc-literal-async")); @@ -3314,6 +3371,8 @@ $wsdl = &_doMobyWSDLReplacement(@_) } elsif ($serviceType eq "moby-async"){ $wsdl = &_doAsyncWSDLReplacement(@_) + } elsif ($serviceType eq "cgi-async"){ + $wsdl = &_doAsyncPostWSDLReplacement(@_) } return $wsdl; } @@ -3347,6 +3406,35 @@ return $wsdl; } +sub _doAsyncPostWSDLReplacement { + my ( $SI, $InputXML, $OutputXML, $SecondaryXML ) = @_; + my $wsdl = $WSDL_ASYNC_POST_TEMPLATE; + $wsdl =~ s/^\n//gs; + my $serviceName = $SI->servicename; + my $AuthURI = $SI->authority_uri; + my $desc = $SI->description; + if ( $desc =~ /[^\]]+))\]\]>/ ) { + $desc = $1; + } + $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 ); + my $OUTxsd = &_getOutputXSD($OutputXML); + $INxsd ||= ""; + $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__NAME/$serviceName/g; # finally replace the actual subroutine call + return $wsdl; +} sub _doPostWSDLReplacement { my ( $SI, $InputXML, $OutputXML, $SecondaryXML ) = @_; @@ -4162,6 +4250,139 @@ END2 +$WSDL_ASYNC_POST_TEMPLATE =< + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +END # for MOBY Asynchronous services. This WSDL is not correct YET! From kawas at dev.open-bio.org Fri Mar 27 13:11:39 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 27 Mar 2009 13:11:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903271711.n2RHBddN006784@dev.open-bio.org> kawas Fri Mar 27 13:11:39 EDT 2009 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory dev.open-bio.org:/tmp/cvs-serv6749/Docs/MOBY-S_API Modified Files: XMLPayloads.html Log Message: added a note on article names when registering datatypes. moby-live/Docs/MOBY-S_API XMLPayloads.html,1.23,1.24 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2009/02/05 17:38:09 1.23 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2009/03/27 17:11:39 1.24 @@ -788,7 +788,9 @@ indicate an article name for each contained object type. Thus, for example, you could have a sequence object that contained a String object with name "nucleotideSequence" and an Integer object with the -name "sequenceLength". +name "sequenceLength".
    +
    +Note: These article names must be unique among all relationships, including those contained by the parent node.
  • Article names for each contained object type may not contain spaces or other special characters, like:
    From kawas at dev.open-bio.org Mon Mar 30 09:06:19 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:06:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301306.n2UD6JOQ024395@dev.open-bio.org> kawas Mon Mar 30 09:06:18 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOBY-Server/share/db/schema In directory dev.open-bio.org:/tmp/cvs-serv24360/Perl/MOBY-Server/share/db/schema Modified Files: mobycentral.mysql Log Message: updated enum to include cgi-async moby-live/Perl/MOBY-Server/share/db/schema mobycentral.mysql,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/share/db/schema/mobycentral.mysql,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY-Server/share/db/schema/mobycentral.mysql 2008/05/14 14:00:05 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY-Server/share/db/schema/mobycentral.mysql 2009/03/30 13:06:18 1.4 @@ -60,7 +60,7 @@ -- CREATE TABLE service_instance ( - category enum('moby','soap','wsdl','cgi','moby-async') default NULL, + category enum('moby','soap','wsdl','cgi','moby-async', 'cgi-async', 'doc-literal', 'doc-literal-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 kawas at dev.open-bio.org Mon Mar 30 09:06:59 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:06:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301306.n2UD6xaE024453@dev.open-bio.org> kawas Mon Mar 30 09:06:59 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv24418/Perl/MOBY-Server/lib/MOBY/Client Modified Files: Central.pm Log Message: updated category documentation for registerService to include cgi-async moby-live/Perl/MOBY-Server/lib/MOBY/Client Central.pm,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm 2008/09/02 13:11:40 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm 2009/03/30 13:06:59 1.7 @@ -643,7 +643,7 @@ authURI => $authURI, contactEmail => "your at mail.address", description => $human_readable_description, - category => "moby" | "cgi" | "moby-async" + category => "moby" | "cgi-async" | "cgi" | "moby-async" | "doc-literal" | "doc-literal-async" URL => $URL_TO_SERVICE (or URL to WSDL document for wsdl-type services) input: listref; (articleName may be undef) From kawas at dev.open-bio.org Mon Mar 30 09:10:20 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:10:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301310.n2UDAKRv024531@dev.open-bio.org> kawas Mon Mar 30 09:10:19 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOBY-Server In directory dev.open-bio.org:/tmp/cvs-serv24496/Perl/MOBY-Server Modified Files: Changes Log Message: updated changes to reflect recent commits moby-live/Perl/MOBY-Server Changes,1.20,1.21 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/Changes,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- /home/repository/moby/moby-live/Perl/MOBY-Server/Changes 2009/02/12 19:33:27 1.20 +++ /home/repository/moby/moby-live/Perl/MOBY-Server/Changes 2009/03/30 13:10:19 1.21 @@ -21,6 +21,9 @@ - updated service_unit_tester.pl to handle cgi/moby/moby-async services and to take into account that services can have >= 0 unit tests. + - fixed bug in Central.pm that allowed you to register datatypes + with similar articlenames to other members in the datatype. + - added cgi-async to category of services that registry understands. 1.06 - Changes to makefile reflecting the cpan addition of wsrf. From kawas at dev.open-bio.org Mon Mar 30 09:12:34 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:12:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301312.n2UDCYbH024585@dev.open-bio.org> kawas Mon Mar 30 09:12:34 EDT 2009 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory dev.open-bio.org:/tmp/cvs-serv24554/Docs/MOBY-S_API/Perl Added Files: construct_moses_cgi_async_service.html Log Message: new tutorial for creating async cgi services. moby-live/Docs/MOBY-S_API/Perl construct_moses_cgi_async_service.html,NONE,1.1 From kawas at dev.open-bio.org Mon Mar 30 09:14:09 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:14:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301314.n2UDE99O024679@dev.open-bio.org> kawas Mon Mar 30 09:14:09 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates In directory dev.open-bio.org:/tmp/cvs-serv24644/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates Modified Files: service-cgi.tt Added Files: service-cgi-async.tt Log Message: new cgi-async service template moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates service-cgi-async.tt,NONE,1.1 service-cgi.tt,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates/service-cgi.tt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates/service-cgi.tt 2009/02/11 19:11:30 1.2 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates/service-cgi.tt 2009/03/30 13:14:09 1.3 @@ -43,7 +43,7 @@ my $q = new CGI; # get the data from the 'data' parameter -my $data = $q->param('data') | $q->param('POSTDATA') | ""; +my $data = $q->param('data') || $q->param('POSTDATA') || ""; # call the service my $x = __PACKAGE__->[% obj.name %]($data); From kawas at dev.open-bio.org Mon Mar 30 09:15:03 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:15:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301315.n2UDF3qi024737@dev.open-bio.org> kawas Mon Mar 30 09:15:03 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators In directory dev.open-bio.org:/tmp/cvs-serv24702/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators Modified Files: GenServices.pm Log Message: added sub to generate cgi async services moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators GenServices.pm,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/GenServices.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/GenServices.pm 2009/02/25 20:31:22 1.8 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/GenServices.pm 2009/03/30 13:15:03 1.9 @@ -312,39 +312,117 @@ 'service-cgi.tt') ); foreach my $obj (@services) { - my $name = $obj->name; - $LOG->debug ("$name\n"); - if ($args{outcode}) { - # check if the same service is already loaded - # (it can happen when this subroutine is called several times) - next if eval '%' . $obj->module_name . '::'; - $tt->process ( - $input, - { - obj => $obj, - pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, - generated_dir => $MOBYCFG::GENERATORS_OUTDIR, - services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, - }, - $args{outcode} ) - || $LOG->logdie ($tt->error()); - } else { - # we cannot easily check whether the same file was already - # generated - so we don't - my $outfile = - File::Spec->catfile ( $outdir, split (/\./, $obj->authority), $obj->name ) . '.cgi'; - $tt->process ( $input, - { - obj => $obj, - pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, - generated_dir => $MOBYCFG::GENERATORS_OUTDIR, - services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, - }, - $outfile ) || $LOG->logdie ($tt->error()); - chmod (0755, $outfile); - $LOG->info ("\tCGI service created at '$outfile'\n"); - - } + my $name = $obj->name; + $LOG->debug ("$name\n"); + if ($args{outcode}) { + # check if the same service is already loaded + # (it can happen when this subroutine is called several times) + next if eval '%' . $obj->module_name . '::'; + $tt->process ( + $input, + { + obj => $obj, + pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, + generated_dir => $MOBYCFG::GENERATORS_OUTDIR, + services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, + }, + $args{outcode} ) + || $LOG->logdie ($tt->error()); + } else { + # we cannot easily check whether the same file was already + # generated - so we don't + my $outfile = + File::Spec->catfile ( $outdir, split (/\./, $obj->authority), $obj->name ) . '.cgi'; + $tt->process ( $input, + { + obj => $obj, + pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, + generated_dir => $MOBYCFG::GENERATORS_OUTDIR, + services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, + }, + $outfile ) || $LOG->logdie ($tt->error()); + chmod (0755, $outfile); + $LOG->info ("\tCGI service created at '$outfile'\n"); + + } + } +} + +#----------------------------------------------------------------- +# generate_async_cgi +#----------------------------------------------------------------- +sub generate_async_cgi { + my ($self, @args) = @_; + my %args = + ( # some default values + outdir => $MOBYCFG::GENERATORS_IMPL_OUTDIR || + MOSES::MOBY::Generators::Utils->find_file ($Bin, 'services'), + cachedir => $self->cachedir, + registry => $self->registry, + service_names => [], + + # other args, with no default values + # authority => 'authority' + # outcode => ref SCALAR + + # and the real parameters + @args ); + $self->_check_outcode (%args); + + my $outdir = File::Spec->rel2abs ($args{outdir} . "/../cgi" ); + $LOG->debug ("Arguments for generating async cgi services: " . $self->toString (\%args)) + if ($LOG->is_debug); + $LOG->info ("Async CGI Services will be generated into: '$outdir'") + unless $args{outcode}; + + # get objects from a local cache + my $cache = MOSES::MOBY::Cache::Central->new (cachedir => $args{cachedir}, registry => $args{registry}); + my @names = (); + push (@names, $args{authority}, @{ $args{service_names} }) + if $args{authority}; + my @services = $cache->get_services (@names); + + # generate from template + my $tt = Template->new ( ABSOLUTE => 1 ); + my $input = File::Spec->rel2abs ( MOSES::MOBY::Generators::Utils->find_file + ($Bin, + 'MOSES', 'MOBY', 'Generators', 'templates', + 'service-cgi-async.tt') ); + + foreach my $obj (@services) { + my $name = $obj->name; + $LOG->debug ("$name\n"); + if ($args{outcode}) { + # check if the same service is already loaded + # (it can happen when this subroutine is called several times) + next if eval '%' . $obj->module_name . '::'; + $tt->process ( + $input, + { + obj => $obj, + pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, + generated_dir => $MOBYCFG::GENERATORS_OUTDIR, + services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, + }, + $args{outcode} ) + || $LOG->logdie ($tt->error()); + } else { + # we cannot easily check whether the same file was already + # generated - so we don't + my $outfile = + File::Spec->catfile ( $outdir, split (/\./, $obj->authority), $obj->name ) . '.cgi'; + $tt->process ( $input, + { + obj => $obj, + pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, + generated_dir => $MOBYCFG::GENERATORS_OUTDIR, + services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, + }, + $outfile ) || $LOG->logdie ($tt->error()); + chmod (0755, $outfile); + $LOG->info ("\tAsync CGI service created at '$outfile'\n"); + + } } } From kawas at dev.open-bio.org Mon Mar 30 09:16:00 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:16:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301316.n2UDG0Y1024791@dev.open-bio.org> kawas Mon Mar 30 09:16:00 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY In directory dev.open-bio.org:/tmp/cvs-serv24760/Perl/MOSES-MOBY/lib/MOSES/MOBY Added Files: Async.pm Log Message: new module that includes the subroutines needed for async post services. moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY Async.pm,NONE,1.1 From kawas at dev.open-bio.org Mon Mar 30 09:16:38 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:16:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301316.n2UDGcu9024849@dev.open-bio.org> kawas Mon Mar 30 09:16:38 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts In directory dev.open-bio.org:/tmp/cvs-serv24814/Perl/MOSES-MOBY/bin/scripts Modified Files: moses-generate-services.pl Log Message: added support for async cgi services. moby-live/Perl/MOSES-MOBY/bin/scripts moses-generate-services.pl,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-generate-services.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-generate-services.pl 2008/08/25 16:28:57 1.6 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-generate-services.pl 2009/03/30 13:16:38 1.7 @@ -8,8 +8,8 @@ # some command-line options use Getopt::Std; -use vars qw/ $opt_h $opt_A $opt_d $opt_R $opt_v $opt_a $opt_s $opt_b $opt_f $opt_u $opt_F $opt_S $opt_t $opt_c /; -getopts('hdvasbfuFStcAR:'); +use vars qw/ $opt_h $opt_A $opt_d $opt_R $opt_v $opt_a $opt_s $opt_b $opt_f $opt_u $opt_F $opt_S $opt_t $opt_c $opt_C /; +getopts('hdvasbfuFStcCAR:'); # usage if (not($opt_u or $opt_f)) { if ($opt_h or (not $opt_a and @ARGV == 0)) { @@ -39,8 +39,12 @@ -S ... generate implementation and the base of service[s], the implementation module has enabled option to read the base statically (that is why it is also generated here) + -i ... generate an implementation of the given service + -c ... generate a cgi based implementation of the given service + -C ... generate an asynchronous cgi based implementation of the given service + -A ... generate an asynchronous based implementation of the given service -t ... update dispatch table of services (a table used by the cgi-bin script and SOAP::Lite to dispatch requests); @@ -118,6 +122,9 @@ } elsif ($opt_c) { $generator->generate_impl; $generator->generate_cgi; + } elsif ($opt_C) { + $generator->generate_impl; + $generator->generate_async_cgi; } elsif ($opt_t) { $generator->update_table; } elsif ($opt_A) { @@ -144,7 +151,14 @@ $generator->generate_cgi(service_names => [@ARGV], authority => $authority, outcode => \$code); - }elsif ($opt_A) { + } elsif ($opt_C) { + $generator->generate_impl(service_names => [@ARGV], + authority => $authority, + outcode => \$code); + $generator->generate_async_cgi(service_names => [@ARGV], + authority => $authority, + outcode => \$code); + } elsif ($opt_A) { $generator->generate_async(service_names => [@ARGV], authority => $authority, outcode => \$code); @@ -186,6 +200,13 @@ force_over => $opt_F); $generator->generate_cgi(service_names => [@ARGV], authority => $authority); + } elsif ($opt_C) { + $generator->generate_impl( + service_names => [@ARGV], + authority => $authority, + force_over => $opt_F); + $generator->generate_async_cgi(service_names => [@ARGV], + authority => $authority); } elsif ($opt_t) { $generator->update_table (service_names => [@ARGV], authority => $authority); From kawas at dev.open-bio.org Mon Mar 30 09:17:04 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:17:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301317.n2UDH4T6024907@dev.open-bio.org> kawas Mon Mar 30 09:17:04 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts In directory dev.open-bio.org:/tmp/cvs-serv24872/Perl/MOSES-MOBY/bin/scripts Modified Files: moses-install.pl Log Message: removed a duplicate variable moby-live/Perl/MOSES-MOBY/bin/scripts moses-install.pl,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-install.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-install.pl 2008/08/25 16:28:57 1.5 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-install.pl 2009/03/30 13:17:04 1.6 @@ -271,8 +271,6 @@ } # AsyncMobyServer.cgi file -my $async_services_table = $MOBYCFG::GENERATORS_ASYNC_IMPL_SERVICES_TABLE || - 'ASYNC_SERVICES_TABLE'; my $async_cgibin_file = "$pmoses_home/AsyncMobyServer.cgi"; if (-e $async_cgibin_file and ! $opt_F) { From kawas at dev.open-bio.org Mon Mar 30 09:18:33 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:18:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301318.n2UDIXdw025068@dev.open-bio.org> kawas Mon Mar 30 09:18:33 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY In directory dev.open-bio.org:/tmp/cvs-serv25029/Perl/MOSES-MOBY Modified Files: Makefile.PL Changes Log Message: updated changes. update makefile to include an appropriate version of wsrf moby-live/Perl/MOSES-MOBY Makefile.PL,1.12,1.13 Changes,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/Makefile.PL,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/Makefile.PL 2009/01/12 22:21:22 1.12 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/Makefile.PL 2009/03/30 13:18:33 1.13 @@ -37,7 +37,7 @@ # for async services requires 'MOBY::Client::Central' => 1.06; - requires 'WSRF::Lite' => '0.8.2.6'; + requires 'WSRF::Lite' => '0.8.2.5'; build_requires 'Test::More' => '0.42'; no_index 'directory' => 'bin/scripts'; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/Changes,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/Changes 2008/11/19 14:24:13 1.10 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/Changes 2009/03/30 13:18:33 1.11 @@ -1,5 +1,11 @@ Revision history for Perl extension MOSES::MOBY. +.88 + - Added support for Asynchronous POST services. + moses-service-tester, moses-generate-services, + and moses-install all have been updated. + + .87 - fixed a string append bug where '+' was used instead of '.' From kawas at dev.open-bio.org Mon Mar 30 10:03:02 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 10:03:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301403.n2UE32dt025238@dev.open-bio.org> kawas Mon Mar 30 10:03:02 EDT 2009 Update of /home/repository/moby/moby-live/Database In directory dev.open-bio.org:/tmp/cvs-serv25207/Database Added Files: Update_DB_088_to_107.pl Log Message: added a little script to update the mobycentral database to include the enum field 'cgi-async' for category. this script doesnt really belong here, but until i find a good place for it, this place is better than nothing. moby-live/Database Update_DB_088_to_107.pl,NONE,1.1 From kawas at dev.open-bio.org Tue Mar 31 17:19:37 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 31 Mar 2009 17:19:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903312119.n2VLJbTJ004162@dev.open-bio.org> kawas Tue Mar 31 17:19:36 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv4127/Perl/MOBY-Server/lib/MOBY/Client Modified Files: Central.pm Log Message: added cgi-async to the list of categories for service registration moby-live/Perl/MOBY-Server/lib/MOBY/Client Central.pm,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm 2009/03/30 13:06:59 1.7 +++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm 2009/03/31 21:19:36 1.8 @@ -741,10 +741,11 @@ #____________________________________________________________________________________________ return $self->errorRegXML( -"Only 'moby', 'cgi', 'moby-async', 'doc-literal', 'doc-literal-async' Service Categories are currently allowed - you gave me $Category" +"Only 'moby', 'cgi', 'cgi-async', 'moby-async', 'doc-literal', 'doc-literal-async' Service Categories are currently allowed - you gave me $Category" ) unless ( ( $Category eq 'moby' ) || ( $Category eq 'moby-async' ) + || ( $Category eq 'cgi-async' ) || ( $Category eq 'doc-literal' ) || ( $Category eq 'doc-literal-async' ) || ( $Category eq 'cgi' )); From kawas at dev.open-bio.org Tue Mar 31 17:25:49 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 31 Mar 2009 17:25:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903312125.n2VLPntj004248@dev.open-bio.org> kawas Tue Mar 31 17:25:49 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY In directory dev.open-bio.org:/tmp/cvs-serv4213/Perl/MOSES-MOBY Modified Files: MANIFEST Log Message: added cgi async template file (.tt) and Async.pm to the manifest moby-live/Perl/MOSES-MOBY MANIFEST,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/MANIFEST,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/MANIFEST 2008/08/25 16:27:28 1.6 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/MANIFEST 2009/03/31 21:25:49 1.7 @@ -23,6 +23,7 @@ inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/MOSES/MOBY.pm +lib/MOSES/MOBY/Async.pm lib/MOSES/MOBY/Base.pm lib/MOSES/MOBY/Cache/Central.pm lib/MOSES/MOBY/Cache/Registries.pm @@ -46,6 +47,7 @@ lib/MOSES/MOBY/Generators/templates/datatype.tt lib/MOSES/MOBY/Generators/templates/service-async.tt lib/MOSES/MOBY/Generators/templates/service-base.tt +lib/MOSES/MOBY/Generators/templates/service-cgi-async.tt lib/MOSES/MOBY/Generators/templates/service-cgi.tt lib/MOSES/MOBY/Generators/templates/service.tt lib/MOSES/MOBY/Generators/Utils.pm From gordonp at dev.open-bio.org Thu Mar 12 00:02:46 2009 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 11 Mar 2009 20:02:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903120002.n2C02kKQ007988@dev.open-bio.org> gordonp Wed Mar 11 20:02:46 EDT 2009 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv7952/src/main/org/biomoby/shared Modified Files: NamespaceContextImpl.java Log Message: Added c-tor that creates a context based on a given DOM node, to be used in the Seahawk PBE system moby-live/Java/src/main/org/biomoby/shared NamespaceContextImpl.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/NamespaceContextImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/NamespaceContextImpl.java 2008/03/12 17:47:18 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/NamespaceContextImpl.java 2009/03/12 00:02:46 1.6 @@ -1,6 +1,8 @@ package org.biomoby.shared; +import org.w3c.dom.*; + import javax.xml.namespace.NamespaceContext; import java.util.HashMap; @@ -16,6 +18,51 @@ private Map prefixes; private Map nsURIs; + /** + * Traverses up the DOM from the given element to enumerate all of the prefix <-> namespace mappings + * valid for this node. Note that the DOM does not explicitly contain the xmlns attributes + * therefore we glean this info from the qualified elements and attributes. + */ + public NamespaceContextImpl(Node contextNode, String defaultNSPrefix){ + prefixes = new HashMap(); + nsURIs = new HashMap(); + + for(Node currentNode = contextNode; currentNode != null; currentNode = currentNode.getParentNode()){ + if(currentNode instanceof Element){ + Element el = (Element) currentNode; + String uri = el.getNamespaceURI(); + String prefix = el.getPrefix(); + if(uri != null && uri.length() != 0){ + if(prefix == null){ + prefix = defaultNSPrefix; + } + if(!nsURIs.containsKey(prefix)){ + nsURIs.put(prefix, uri); + } + } + + NamedNodeMap xmlnsAttrs = ((Element) currentNode).getAttributes(); + for(int i = 0; i < xmlnsAttrs.getLength(); i++){ + Attr xmlnsDecl = (Attr) xmlnsAttrs.item(i); + if(xmlnsDecl.getNamespaceURI() == null || + xmlnsDecl.getPrefix() == null){ + continue; + } + + if(!prefixes.containsKey(xmlnsDecl.getNamespaceURI())){ + prefixes.put(xmlnsDecl.getNamespaceURI(), xmlnsDecl.getPrefix()); + } + if(!nsURIs.containsKey(xmlnsDecl.getPrefix())){ + nsURIs.put(xmlnsDecl.getPrefix(), xmlnsDecl.getNamespaceURI()); + } + } + } + } + } + + /** + * Populates the mapping table with an assortment of prefixes and namespaces used in Moby (see MobyPrefixResolver) + */ public NamespaceContextImpl(){ prefixes = new HashMap(); nsURIs = new HashMap(); @@ -35,6 +82,7 @@ prefixes.put(MobyPrefixResolver.HTTP_NAMESPACE, MobyPrefixResolver.HTTP_PREFIX); prefixes.put(MobyPrefixResolver.SAWSDL_NAMESPACE, MobyPrefixResolver.SAWSDL_PREFIX); prefixes.put(MobyPrefixResolver.LSID_NAMESPACE, MobyPrefixResolver.LSID_PREFIX); + prefixes.put(MobyPrefixResolver.XSD_NAMESPACE, MobyPrefixResolver.XSD_PREFIX); // Reverse map prefix -> nsURI nsURIs.put(MobyPrefixResolver.XSI_PREFIX, MobyPrefixResolver.XSI_NAMESPACE2001); From kawas at dev.open-bio.org Fri Mar 13 19:20:03 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 13 Mar 2009 15:20:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903131920.n2DJK3jJ018632@dev.open-bio.org> kawas Fri Mar 13 15:20:02 EDT 2009 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory dev.open-bio.org:/tmp/cvs-serv18596/Docs/MOBY-S_API/Perl Modified Files: ConstructingYourService.html Log Message: removed dead links. added a referal to moses, dashboard and the MOBYRegistrationPages. moby-live/Docs/MOBY-S_API/Perl ConstructingYourService.html,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2007/02/19 22:36:12 1.22 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2009/03/13 19:20:02 1.23 @@ -71,37 +71,41 @@
  • Do the object type(s) that your service will consume already exist in the - -Object Ontology? If not, learn how to design your own MOBY objects
  • Do the object type(s) that your service will produce already -exist in the -Object Ontology? If not, then you need to register your objects in the MOBY-S object/class ontology
  • Does an appropriate service type term already exist in the -Service Ontology? You need to register your new service type in the MOBY-S service ontology.
  • Do the namespaces that you are going to use in your objects -already exist in the -Namespace Ontology? Register your namespace, if it doesn't already exist.
  • - -If all object types, service types, and namespaces already exist in -the ontology then you are ready to set up your service. Once you have finished setting it up following the guidelines below, you will then need to Register your service for it to become visible on the MOBY Central registry. - -In Perl, MOBY-S services are currently limited to SOAP over HTTP; the -name of the method call (i.e. the SOAP Action header) is the same as -the service name registered in the MOBY Central registry. - +

    If you want a graphical way for registering your terms into the ontologies, you can try:

    + +

    If all object types, service types, and namespaces already exist in + the ontology then you are ready to set up your service. Once you have finished setting it up following the guidelines below, you will then need to Register your service for it to become visible on the MOBY Central registry. + + In Perl, MOBY-S services are currently limited to SOAP over HTTP; the + name of the method call (i.e. the SOAP Action header) is the same as + the service name registered in the MOBY Central registry.

    +

    Alternatively, a new, more simple way to implement your service exists in Perl MOSES!

    The dispatcher

    The most straightforward paradigm is to have a single SOAP server running as a CGI script, and this listener hands-off requests to the From kawas at dev.open-bio.org Thu Mar 26 18:41:42 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 26 Mar 2009 14:41:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903261841.n2QIfg7b003394@dev.open-bio.org> kawas Thu Mar 26 14:41:41 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY In directory dev.open-bio.org:/tmp/cvs-serv3359/Perl/MOBY-Server/lib/MOBY Modified Files: Central.pm Log Message: bug fix: datatypes registered with similarly named members were not flagged as incorrect. piggy backed here is code for async post (WSDL) - registry wont handle it just yet . full code to be committed saturday march 28, 2009 as long as no one objects to the rfc. moby-live/Perl/MOBY-Server/lib/MOBY Central.pm,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm 2008/09/02 13:14:18 1.7 +++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm 2009/03/26 18:41:41 1.8 @@ -9,7 +9,7 @@ package MOBY::Central; use strict; use Carp; -use vars qw($AUTOLOAD $WSDL_TEMPLATE $WSDL_POST_TEMPLATE $WSDL_ASYNC_TEMPLATE); +use vars qw($AUTOLOAD $WSDL_TEMPLATE $WSDL_POST_TEMPLATE $WSDL_ASYNC_TEMPLATE $WSDL_ASYNC_POST_TEMPLATE); use XML::LibXML; use MOBY::OntologyServer; use MOBY::service_type; @@ -384,10 +384,35 @@ } } } + # are the article names unique? + if ( keys %{$relationships} ) { + my $parent_type; + my %art_names = (); + while ( my ( $reltype, $obj ) = each %{$relationships} ) { + # one isa relationship + if ($reltype =~ /isa/i) { + foreach ( @{$obj} ) { + my ( $objectType, $articleName ) = @{$_}; + $parent_type = $objectType; + } + } else { + #has/hasa relationship + foreach ( @{$obj} ) { + my ( $objectType, $articleName ) = @{$_}; + return return &_error( "Article names for HAS/HASA relationships must be unique. Please ensure that names are unique!", "" ) + if $art_names{$articleName}; + # add name to the hash + $art_names{$articleName} = 1; + } + } + } + unless (&_extract_terms($parent_type, \%art_names)){ + return &_error( "Article names for HAS/HASA relationships (including those inherited) must be unique. Please ensure that names are unique!", "" ); + } + } # should be good to go now... - ( $success, $message, $URI ) = $OntologyServer->createObject( node => $term, description => $desc, @@ -435,6 +460,37 @@ return &_success( "Object $term registered successfully.", $URI ); } +############################### +# +############################### + +sub _extract_terms { + + my ( $datatype, $articles ) = @_; + my $ont_serv = MOBY::OntologyServer->new( ontology => "object" ); + my $stuff = $ont_serv->retrieveObject( type => $datatype ); + return 1 unless $stuff; + + # extract all isa/hasa/has relationships + my $rels = $stuff->{Relationships} if defined $stuff->{Relationships}; + for my $relation ( keys %{$rels} ) { + for my $term ( @{ $rels->{$relation} } ) { + + # pos 1 has articlename, pos 2 has datatype + # if we are in isa, then drill into it + if ( $relation =~ m/\:isa$/i ) { + return 0 unless &_extract_terms( @{$term}[2], $articles ); + } else { + + # check if we already processed the articlename ... + return 0 if defined @{$term}[1] and $articles->{ @{$term}[1] }; + $articles->{ @{$term}[1] } = 1 if @{$term}[1]; + } + } + } + return 1; +} + #Eddie - converted sub _registerObjectPayload { my ($payload) = @_; #EDDIE - assuming that payload is a string @@ -1127,7 +1183,7 @@ Input XML : - moby + moby YourServiceNameHere TypeOntologyTerm http://path.to/your/signature/RDF.rdf @@ -1360,7 +1416,7 @@ $error .= "invalid character encoding; service name not encoded as UTF-8\n" unless decode_utf8( $serviceName ) eq $serviceName; return &_error( "malformed payload $error\n\n", "" ) if ($error); return &_error( - "Category may take the (case sensitive) values 'moby', 'moby-async', 'cgi', 'doc-literal', and 'doc-literal-async', \n", + "Category may take the (case sensitive) values 'moby', 'moby-async', 'cgi', 'cgi-async', 'doc-literal', and 'doc-literal-async', \n", "" ) unless ( @@ -1368,6 +1424,7 @@ || ( $Category eq "moby" ) || ( $Category eq "moby-async" ) || ( $Category eq "cgi" ) + || ( $Category eq "cgi-async" ) || ( $Category eq "doc-literal" ) || ( $Category eq "doc-literal-async")); @@ -3314,6 +3371,8 @@ $wsdl = &_doMobyWSDLReplacement(@_) } elsif ($serviceType eq "moby-async"){ $wsdl = &_doAsyncWSDLReplacement(@_) + } elsif ($serviceType eq "cgi-async"){ + $wsdl = &_doAsyncPostWSDLReplacement(@_) } return $wsdl; } @@ -3347,6 +3406,35 @@ return $wsdl; } +sub _doAsyncPostWSDLReplacement { + my ( $SI, $InputXML, $OutputXML, $SecondaryXML ) = @_; + my $wsdl = $WSDL_ASYNC_POST_TEMPLATE; + $wsdl =~ s/^\n//gs; + my $serviceName = $SI->servicename; + my $AuthURI = $SI->authority_uri; + my $desc = $SI->description; + if ( $desc =~ /[^\]]+))\]\]>/ ) { + $desc = $1; + } + $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 ); + my $OUTxsd = &_getOutputXSD($OutputXML); + $INxsd ||= ""; + $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__NAME/$serviceName/g; # finally replace the actual subroutine call + return $wsdl; +} sub _doPostWSDLReplacement { my ( $SI, $InputXML, $OutputXML, $SecondaryXML ) = @_; @@ -4162,6 +4250,139 @@ END2 +$WSDL_ASYNC_POST_TEMPLATE =< + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +END # for MOBY Asynchronous services. This WSDL is not correct YET! From kawas at dev.open-bio.org Fri Mar 27 17:11:39 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 27 Mar 2009 13:11:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903271711.n2RHBddN006784@dev.open-bio.org> kawas Fri Mar 27 13:11:39 EDT 2009 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory dev.open-bio.org:/tmp/cvs-serv6749/Docs/MOBY-S_API Modified Files: XMLPayloads.html Log Message: added a note on article names when registering datatypes. moby-live/Docs/MOBY-S_API XMLPayloads.html,1.23,1.24 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2009/02/05 17:38:09 1.23 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2009/03/27 17:11:39 1.24 @@ -788,7 +788,9 @@ indicate an article name for each contained object type. Thus, for example, you could have a sequence object that contained a String object with name "nucleotideSequence" and an Integer object with the -name "sequenceLength". +name "sequenceLength".
    +
    +Note: These article names must be unique among all relationships, including those contained by the parent node.
  • Article names for each contained object type may not contain spaces or other special characters, like:
    From kawas at dev.open-bio.org Mon Mar 30 13:06:19 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:06:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301306.n2UD6JOQ024395@dev.open-bio.org> kawas Mon Mar 30 09:06:18 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOBY-Server/share/db/schema In directory dev.open-bio.org:/tmp/cvs-serv24360/Perl/MOBY-Server/share/db/schema Modified Files: mobycentral.mysql Log Message: updated enum to include cgi-async moby-live/Perl/MOBY-Server/share/db/schema mobycentral.mysql,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/share/db/schema/mobycentral.mysql,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY-Server/share/db/schema/mobycentral.mysql 2008/05/14 14:00:05 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY-Server/share/db/schema/mobycentral.mysql 2009/03/30 13:06:18 1.4 @@ -60,7 +60,7 @@ -- CREATE TABLE service_instance ( - category enum('moby','soap','wsdl','cgi','moby-async') default NULL, + category enum('moby','soap','wsdl','cgi','moby-async', 'cgi-async', 'doc-literal', 'doc-literal-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 kawas at dev.open-bio.org Mon Mar 30 13:06:59 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:06:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301306.n2UD6xaE024453@dev.open-bio.org> kawas Mon Mar 30 09:06:59 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv24418/Perl/MOBY-Server/lib/MOBY/Client Modified Files: Central.pm Log Message: updated category documentation for registerService to include cgi-async moby-live/Perl/MOBY-Server/lib/MOBY/Client Central.pm,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm 2008/09/02 13:11:40 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm 2009/03/30 13:06:59 1.7 @@ -643,7 +643,7 @@ authURI => $authURI, contactEmail => "your at mail.address", description => $human_readable_description, - category => "moby" | "cgi" | "moby-async" + category => "moby" | "cgi-async" | "cgi" | "moby-async" | "doc-literal" | "doc-literal-async" URL => $URL_TO_SERVICE (or URL to WSDL document for wsdl-type services) input: listref; (articleName may be undef) From kawas at dev.open-bio.org Mon Mar 30 13:10:20 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:10:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301310.n2UDAKRv024531@dev.open-bio.org> kawas Mon Mar 30 09:10:19 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOBY-Server In directory dev.open-bio.org:/tmp/cvs-serv24496/Perl/MOBY-Server Modified Files: Changes Log Message: updated changes to reflect recent commits moby-live/Perl/MOBY-Server Changes,1.20,1.21 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/Changes,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- /home/repository/moby/moby-live/Perl/MOBY-Server/Changes 2009/02/12 19:33:27 1.20 +++ /home/repository/moby/moby-live/Perl/MOBY-Server/Changes 2009/03/30 13:10:19 1.21 @@ -21,6 +21,9 @@ - updated service_unit_tester.pl to handle cgi/moby/moby-async services and to take into account that services can have >= 0 unit tests. + - fixed bug in Central.pm that allowed you to register datatypes + with similar articlenames to other members in the datatype. + - added cgi-async to category of services that registry understands. 1.06 - Changes to makefile reflecting the cpan addition of wsrf. From kawas at dev.open-bio.org Mon Mar 30 13:12:34 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:12:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301312.n2UDCYbH024585@dev.open-bio.org> kawas Mon Mar 30 09:12:34 EDT 2009 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory dev.open-bio.org:/tmp/cvs-serv24554/Docs/MOBY-S_API/Perl Added Files: construct_moses_cgi_async_service.html Log Message: new tutorial for creating async cgi services. moby-live/Docs/MOBY-S_API/Perl construct_moses_cgi_async_service.html,NONE,1.1 From kawas at dev.open-bio.org Mon Mar 30 13:14:09 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:14:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301314.n2UDE99O024679@dev.open-bio.org> kawas Mon Mar 30 09:14:09 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates In directory dev.open-bio.org:/tmp/cvs-serv24644/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates Modified Files: service-cgi.tt Added Files: service-cgi-async.tt Log Message: new cgi-async service template moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates service-cgi-async.tt,NONE,1.1 service-cgi.tt,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates/service-cgi.tt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates/service-cgi.tt 2009/02/11 19:11:30 1.2 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates/service-cgi.tt 2009/03/30 13:14:09 1.3 @@ -43,7 +43,7 @@ my $q = new CGI; # get the data from the 'data' parameter -my $data = $q->param('data') | $q->param('POSTDATA') | ""; +my $data = $q->param('data') || $q->param('POSTDATA') || ""; # call the service my $x = __PACKAGE__->[% obj.name %]($data); From kawas at dev.open-bio.org Mon Mar 30 13:15:03 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:15:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301315.n2UDF3qi024737@dev.open-bio.org> kawas Mon Mar 30 09:15:03 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators In directory dev.open-bio.org:/tmp/cvs-serv24702/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators Modified Files: GenServices.pm Log Message: added sub to generate cgi async services moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators GenServices.pm,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/GenServices.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/GenServices.pm 2009/02/25 20:31:22 1.8 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/GenServices.pm 2009/03/30 13:15:03 1.9 @@ -312,39 +312,117 @@ 'service-cgi.tt') ); foreach my $obj (@services) { - my $name = $obj->name; - $LOG->debug ("$name\n"); - if ($args{outcode}) { - # check if the same service is already loaded - # (it can happen when this subroutine is called several times) - next if eval '%' . $obj->module_name . '::'; - $tt->process ( - $input, - { - obj => $obj, - pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, - generated_dir => $MOBYCFG::GENERATORS_OUTDIR, - services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, - }, - $args{outcode} ) - || $LOG->logdie ($tt->error()); - } else { - # we cannot easily check whether the same file was already - # generated - so we don't - my $outfile = - File::Spec->catfile ( $outdir, split (/\./, $obj->authority), $obj->name ) . '.cgi'; - $tt->process ( $input, - { - obj => $obj, - pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, - generated_dir => $MOBYCFG::GENERATORS_OUTDIR, - services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, - }, - $outfile ) || $LOG->logdie ($tt->error()); - chmod (0755, $outfile); - $LOG->info ("\tCGI service created at '$outfile'\n"); - - } + my $name = $obj->name; + $LOG->debug ("$name\n"); + if ($args{outcode}) { + # check if the same service is already loaded + # (it can happen when this subroutine is called several times) + next if eval '%' . $obj->module_name . '::'; + $tt->process ( + $input, + { + obj => $obj, + pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, + generated_dir => $MOBYCFG::GENERATORS_OUTDIR, + services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, + }, + $args{outcode} ) + || $LOG->logdie ($tt->error()); + } else { + # we cannot easily check whether the same file was already + # generated - so we don't + my $outfile = + File::Spec->catfile ( $outdir, split (/\./, $obj->authority), $obj->name ) . '.cgi'; + $tt->process ( $input, + { + obj => $obj, + pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, + generated_dir => $MOBYCFG::GENERATORS_OUTDIR, + services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, + }, + $outfile ) || $LOG->logdie ($tt->error()); + chmod (0755, $outfile); + $LOG->info ("\tCGI service created at '$outfile'\n"); + + } + } +} + +#----------------------------------------------------------------- +# generate_async_cgi +#----------------------------------------------------------------- +sub generate_async_cgi { + my ($self, @args) = @_; + my %args = + ( # some default values + outdir => $MOBYCFG::GENERATORS_IMPL_OUTDIR || + MOSES::MOBY::Generators::Utils->find_file ($Bin, 'services'), + cachedir => $self->cachedir, + registry => $self->registry, + service_names => [], + + # other args, with no default values + # authority => 'authority' + # outcode => ref SCALAR + + # and the real parameters + @args ); + $self->_check_outcode (%args); + + my $outdir = File::Spec->rel2abs ($args{outdir} . "/../cgi" ); + $LOG->debug ("Arguments for generating async cgi services: " . $self->toString (\%args)) + if ($LOG->is_debug); + $LOG->info ("Async CGI Services will be generated into: '$outdir'") + unless $args{outcode}; + + # get objects from a local cache + my $cache = MOSES::MOBY::Cache::Central->new (cachedir => $args{cachedir}, registry => $args{registry}); + my @names = (); + push (@names, $args{authority}, @{ $args{service_names} }) + if $args{authority}; + my @services = $cache->get_services (@names); + + # generate from template + my $tt = Template->new ( ABSOLUTE => 1 ); + my $input = File::Spec->rel2abs ( MOSES::MOBY::Generators::Utils->find_file + ($Bin, + 'MOSES', 'MOBY', 'Generators', 'templates', + 'service-cgi-async.tt') ); + + foreach my $obj (@services) { + my $name = $obj->name; + $LOG->debug ("$name\n"); + if ($args{outcode}) { + # check if the same service is already loaded + # (it can happen when this subroutine is called several times) + next if eval '%' . $obj->module_name . '::'; + $tt->process ( + $input, + { + obj => $obj, + pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, + generated_dir => $MOBYCFG::GENERATORS_OUTDIR, + services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, + }, + $args{outcode} ) + || $LOG->logdie ($tt->error()); + } else { + # we cannot easily check whether the same file was already + # generated - so we don't + my $outfile = + File::Spec->catfile ( $outdir, split (/\./, $obj->authority), $obj->name ) . '.cgi'; + $tt->process ( $input, + { + obj => $obj, + pmoses_home => $MOBYCFG::USER_REGISTRIES_USER_REGISTRIES_DIR, + generated_dir => $MOBYCFG::GENERATORS_OUTDIR, + services_dir => $MOBYCFG::GENERATORS_IMPL_OUTDIR, + }, + $outfile ) || $LOG->logdie ($tt->error()); + chmod (0755, $outfile); + $LOG->info ("\tAsync CGI service created at '$outfile'\n"); + + } } } From kawas at dev.open-bio.org Mon Mar 30 13:16:00 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:16:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301316.n2UDG0Y1024791@dev.open-bio.org> kawas Mon Mar 30 09:16:00 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY In directory dev.open-bio.org:/tmp/cvs-serv24760/Perl/MOSES-MOBY/lib/MOSES/MOBY Added Files: Async.pm Log Message: new module that includes the subroutines needed for async post services. moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY Async.pm,NONE,1.1 From kawas at dev.open-bio.org Mon Mar 30 13:16:38 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:16:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301316.n2UDGcu9024849@dev.open-bio.org> kawas Mon Mar 30 09:16:38 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts In directory dev.open-bio.org:/tmp/cvs-serv24814/Perl/MOSES-MOBY/bin/scripts Modified Files: moses-generate-services.pl Log Message: added support for async cgi services. moby-live/Perl/MOSES-MOBY/bin/scripts moses-generate-services.pl,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-generate-services.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-generate-services.pl 2008/08/25 16:28:57 1.6 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-generate-services.pl 2009/03/30 13:16:38 1.7 @@ -8,8 +8,8 @@ # some command-line options use Getopt::Std; -use vars qw/ $opt_h $opt_A $opt_d $opt_R $opt_v $opt_a $opt_s $opt_b $opt_f $opt_u $opt_F $opt_S $opt_t $opt_c /; -getopts('hdvasbfuFStcAR:'); +use vars qw/ $opt_h $opt_A $opt_d $opt_R $opt_v $opt_a $opt_s $opt_b $opt_f $opt_u $opt_F $opt_S $opt_t $opt_c $opt_C /; +getopts('hdvasbfuFStcCAR:'); # usage if (not($opt_u or $opt_f)) { if ($opt_h or (not $opt_a and @ARGV == 0)) { @@ -39,8 +39,12 @@ -S ... generate implementation and the base of service[s], the implementation module has enabled option to read the base statically (that is why it is also generated here) + -i ... generate an implementation of the given service + -c ... generate a cgi based implementation of the given service + -C ... generate an asynchronous cgi based implementation of the given service + -A ... generate an asynchronous based implementation of the given service -t ... update dispatch table of services (a table used by the cgi-bin script and SOAP::Lite to dispatch requests); @@ -118,6 +122,9 @@ } elsif ($opt_c) { $generator->generate_impl; $generator->generate_cgi; + } elsif ($opt_C) { + $generator->generate_impl; + $generator->generate_async_cgi; } elsif ($opt_t) { $generator->update_table; } elsif ($opt_A) { @@ -144,7 +151,14 @@ $generator->generate_cgi(service_names => [@ARGV], authority => $authority, outcode => \$code); - }elsif ($opt_A) { + } elsif ($opt_C) { + $generator->generate_impl(service_names => [@ARGV], + authority => $authority, + outcode => \$code); + $generator->generate_async_cgi(service_names => [@ARGV], + authority => $authority, + outcode => \$code); + } elsif ($opt_A) { $generator->generate_async(service_names => [@ARGV], authority => $authority, outcode => \$code); @@ -186,6 +200,13 @@ force_over => $opt_F); $generator->generate_cgi(service_names => [@ARGV], authority => $authority); + } elsif ($opt_C) { + $generator->generate_impl( + service_names => [@ARGV], + authority => $authority, + force_over => $opt_F); + $generator->generate_async_cgi(service_names => [@ARGV], + authority => $authority); } elsif ($opt_t) { $generator->update_table (service_names => [@ARGV], authority => $authority); From kawas at dev.open-bio.org Mon Mar 30 13:17:04 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:17:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301317.n2UDH4T6024907@dev.open-bio.org> kawas Mon Mar 30 09:17:04 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts In directory dev.open-bio.org:/tmp/cvs-serv24872/Perl/MOSES-MOBY/bin/scripts Modified Files: moses-install.pl Log Message: removed a duplicate variable moby-live/Perl/MOSES-MOBY/bin/scripts moses-install.pl,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-install.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-install.pl 2008/08/25 16:28:57 1.5 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-install.pl 2009/03/30 13:17:04 1.6 @@ -271,8 +271,6 @@ } # AsyncMobyServer.cgi file -my $async_services_table = $MOBYCFG::GENERATORS_ASYNC_IMPL_SERVICES_TABLE || - 'ASYNC_SERVICES_TABLE'; my $async_cgibin_file = "$pmoses_home/AsyncMobyServer.cgi"; if (-e $async_cgibin_file and ! $opt_F) { From kawas at dev.open-bio.org Mon Mar 30 13:18:33 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 09:18:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301318.n2UDIXdw025068@dev.open-bio.org> kawas Mon Mar 30 09:18:33 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY In directory dev.open-bio.org:/tmp/cvs-serv25029/Perl/MOSES-MOBY Modified Files: Makefile.PL Changes Log Message: updated changes. update makefile to include an appropriate version of wsrf moby-live/Perl/MOSES-MOBY Makefile.PL,1.12,1.13 Changes,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/Makefile.PL,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/Makefile.PL 2009/01/12 22:21:22 1.12 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/Makefile.PL 2009/03/30 13:18:33 1.13 @@ -37,7 +37,7 @@ # for async services requires 'MOBY::Client::Central' => 1.06; - requires 'WSRF::Lite' => '0.8.2.6'; + requires 'WSRF::Lite' => '0.8.2.5'; build_requires 'Test::More' => '0.42'; no_index 'directory' => 'bin/scripts'; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/Changes,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/Changes 2008/11/19 14:24:13 1.10 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/Changes 2009/03/30 13:18:33 1.11 @@ -1,5 +1,11 @@ Revision history for Perl extension MOSES::MOBY. +.88 + - Added support for Asynchronous POST services. + moses-service-tester, moses-generate-services, + and moses-install all have been updated. + + .87 - fixed a string append bug where '+' was used instead of '.' From kawas at dev.open-bio.org Mon Mar 30 14:03:02 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 30 Mar 2009 10:03:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903301403.n2UE32dt025238@dev.open-bio.org> kawas Mon Mar 30 10:03:02 EDT 2009 Update of /home/repository/moby/moby-live/Database In directory dev.open-bio.org:/tmp/cvs-serv25207/Database Added Files: Update_DB_088_to_107.pl Log Message: added a little script to update the mobycentral database to include the enum field 'cgi-async' for category. this script doesnt really belong here, but until i find a good place for it, this place is better than nothing. moby-live/Database Update_DB_088_to_107.pl,NONE,1.1 From kawas at dev.open-bio.org Tue Mar 31 21:19:37 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 31 Mar 2009 17:19:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903312119.n2VLJbTJ004162@dev.open-bio.org> kawas Tue Mar 31 17:19:36 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv4127/Perl/MOBY-Server/lib/MOBY/Client Modified Files: Central.pm Log Message: added cgi-async to the list of categories for service registration moby-live/Perl/MOBY-Server/lib/MOBY/Client Central.pm,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm 2009/03/30 13:06:59 1.7 +++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/Central.pm 2009/03/31 21:19:36 1.8 @@ -741,10 +741,11 @@ #____________________________________________________________________________________________ return $self->errorRegXML( -"Only 'moby', 'cgi', 'moby-async', 'doc-literal', 'doc-literal-async' Service Categories are currently allowed - you gave me $Category" +"Only 'moby', 'cgi', 'cgi-async', 'moby-async', 'doc-literal', 'doc-literal-async' Service Categories are currently allowed - you gave me $Category" ) unless ( ( $Category eq 'moby' ) || ( $Category eq 'moby-async' ) + || ( $Category eq 'cgi-async' ) || ( $Category eq 'doc-literal' ) || ( $Category eq 'doc-literal-async' ) || ( $Category eq 'cgi' )); From kawas at dev.open-bio.org Tue Mar 31 21:25:49 2009 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 31 Mar 2009 17:25:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200903312125.n2VLPntj004248@dev.open-bio.org> kawas Tue Mar 31 17:25:49 EDT 2009 Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY In directory dev.open-bio.org:/tmp/cvs-serv4213/Perl/MOSES-MOBY Modified Files: MANIFEST Log Message: added cgi async template file (.tt) and Async.pm to the manifest moby-live/Perl/MOSES-MOBY MANIFEST,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/MANIFEST,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOSES-MOBY/MANIFEST 2008/08/25 16:27:28 1.6 +++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/MANIFEST 2009/03/31 21:25:49 1.7 @@ -23,6 +23,7 @@ inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/MOSES/MOBY.pm +lib/MOSES/MOBY/Async.pm lib/MOSES/MOBY/Base.pm lib/MOSES/MOBY/Cache/Central.pm lib/MOSES/MOBY/Cache/Registries.pm @@ -46,6 +47,7 @@ lib/MOSES/MOBY/Generators/templates/datatype.tt lib/MOSES/MOBY/Generators/templates/service-async.tt lib/MOSES/MOBY/Generators/templates/service-base.tt +lib/MOSES/MOBY/Generators/templates/service-cgi-async.tt lib/MOSES/MOBY/Generators/templates/service-cgi.tt lib/MOSES/MOBY/Generators/templates/service.tt lib/MOSES/MOBY/Generators/Utils.pm