comparison WebServiceToolWorkflow/WebServiceTool_input_method.py @ 0:d5cd409b8a18 default tip

Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author ganjoo
date Tue, 07 Jun 2011 18:00:50 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d5cd409b8a18
1 import warnings
2 import platform
3 import os,sys
4 from generateClient import *
5 from generateClient1 import *
6
7 '''input : wadl/wsdl/sawadl-url, method name
8 purpose:
9 1. Calls methods from generateClient1.py to generate client description for one-time invocation
10 of the Web service. This client description is added as a xml file under ./clients/
11 2. Calls methods from generateClient.py to generate client description for invocation of Web service
12 in a workflow. This client description is added as a xml file under ./workflowclients/
13 3. Adds the path to the above xml files to Galaxy tool-conf.xml file using call edit_tool_conf.py
14 '''
15
16 #read the url passed as an argument
17 url = sys.argv[2]
18
19 #split url passed on '.' character
20 urllist = url.split('.')
21
22 clientGenerator = ClientGenerator(sys.argv[2],sys.argv[3],sys.argv[4],sys.argv[5])
23 clientGenerator1 = ClientGenerator1(sys.argv[2],sys.argv[3],sys.argv[4],sys.argv[5])
24
25 #if url passed is of a WADL document
26 if urllist[len(urllist)-1]=='wadl' or urllist[len(urllist)-1]=='WADL':
27 javahome = os.environ.get('JAVA_HOME')
28 galaxyhome=os.environ.get('GALAXY_HOME')
29 classpath= galaxyhome + '/tools/WebServiceToolWorkflow/ParserForWADL/bin'
30 jarpath = galaxyhome + '/tools/WebServiceToolWorkflow/ParserForWADL/lib/'
31 machine = platform.machine()
32
33 #start JVM depending on the machine. The location of libjvm.so is assumed to be standard.
34 #you can replace lines 32 to 41, with startJVM("LOCATION OF YOUR LIBJVM.SO","-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
35 if machine == 'x86_64' :
36 print 'a'
37 startJVM("%s/jre/lib/amd64/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
38 elif machine == 'i686' :
39 print 'b'
40 startJVM("%s/jre/lib/i386/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
41 elif machine == 'sun4u' :
42 startJVM("%s/jre/lib/sparc/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
43 else :
44 System.exit("Could not identify machine, please specify path to libjvm.so")
45
46 #generate client xml for one time invocation of a Web service
47 clientGenerator1.wadlClient()
48
49 #generate client xml for invocation of a Web service in workflows
50 clientGenerator.wadlClient()
51
52 #if url passed is of a WSDL 2.0 document
53 elif urllist[len(urllist)-1]=='wsdl' or urllist[len(urllist)-1]=='WSDL':
54 clientGenerator.wsdlClient()
55 clientGenerator1.wsdlClient()
56
57 #if url passed is of a SAWADL document
58 elif urllist[len(urllist)-1]=='sawadl' or urllist[len(urllist)-1]=='SAWADL':
59
60 javahome = os.environ.get('JAVA_HOME')
61 galaxyhome=os.environ.get('GALAXY_HOME')
62 classpath= galaxyhome + '/tools/WebServiceToolWorkflow/lib/SAWADLParser/bin'
63 jarpath = galaxyhome + '/tools/WebServiceToolWorkflow/lib/'
64 machine = platform.machine()
65
66 if machine == 'x86_64' :
67 print 'a'
68 startJVM("%s/jre/lib/amd64/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
69 elif machine == 'i686' :
70 print 'b'
71 startJVM("%s/jre/lib/i386/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
72 elif machine == 'sun4u' :
73 startJVM("%s/jre/lib/sparc/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
74 else :
75 print 'c'
76 System.exit("Could not identify machine, please specify path to libjvm.so")
77
78 #f=open(sys.argv[5],'w')
79 #f.write('reached here 2 \t')
80 #f.close()
81
82 clientGenerator.sawadlClient()
83 clientGenerator1.sawadlClient()
84 #f=open(sys.argv[5],'w')
85 #f.write('reached here 3')
86 #f.close()
87
88 shutdownJVM()
89
90
91
92
93
94