annotate WebServiceToolWorkflow/getMethods1.py~ @ 0:e7482c82796e 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 17:34:26 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
1 import warnings
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
2
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
3 with warnings.catch_warnings():
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
4 warnings.simplefilter("ignore")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
5 import platform
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
6
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
7 from jpype._jpackage import JPackage
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
8 from jpype import *
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
9 import os.path
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
10 import sys
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
11
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
12 class Document1(object):
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
13
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
14 def getWADLMethods(self, wadlUrl, outputFileUrl ):
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
15 javahome = os.environ.get('JAVA_HOME')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
16 galaxyhome=os.environ.get('GALAXY_HOME')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
17 classpath= galaxyhome + '/tools/WebServiceToolWorkflow/ParserForWADL/bin'
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
18 jarpath = galaxyhome + '/tools/WebServiceToolWorkflow/ParserForWADL/lib/'
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
19 machine = platform.machine()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
20 if machine == 'x86_64' :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
21 startJVM("%s/jre/lib/amd64/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
22 elif machine == 'i686' :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
23 startJVM("%s/jre/lib/i386/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
24 elif machine == 'sun4u' :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
25 startJVM("%s/jre/lib/sparc/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
26 else :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
27 System.exit("Could not identify machine, please specify path to libjvm.so")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
28 pkg=JPackage('lsdis')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
29 urlToPass=java.net.URL(wadlUrl)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
30
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
31 outputfile=open(outputFileUrl,'w')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
32 outputfile.seek(0,0)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
33
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
34 urls = []
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
35 methods = []
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
36
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
37 WADLParserDriver=pkg.WADLParserDriver
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
38 wPD=WADLParserDriver()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
39 wPD.parse(urlToPass)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
40 urls = wPD.getUrl()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
41 methods = wPD.getCompleteMethodList()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
42
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
43 i=0
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
44 for url in urls:
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
45 outputfile.write(wadlUrl+"\t")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
46 outputfile.write(str(methods[i].getId())+"\t")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
47 outputfile.write(str(url)+"\n")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
48 i=i+1
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
49
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
50
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
51
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
52 def getWSDLMethods(self, wsdlUrl, outputFileUrl ):
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
53 javahome = os.environ.get('JAVA_HOME')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
54 galaxyhome=os.environ.get('GALAXY_HOME')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
55 classpath= galaxyhome + '/tools/WebServiceToolWorkflow/WodenWSDLParser/bin'
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
56 jarpath = galaxyhome + '/tools/WebServiceToolWorkflow/WodenWSDLParser/lib/'
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
57 machine = platform.machine()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
58 if machine == 'x86_64' :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
59 startJVM("%s/jre/lib/amd64/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
60 elif machine == 'i686' :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
61 startJVM("%s/jre/lib/i386/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
62 elif machine == 'sun4u' :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
63 startJVM("%s/jre/lib/sparc/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
64 else :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
65 System.exit("Could not identify machine, please specify path to libjvm.so")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
66
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
67 pkg=JPackage('lsdis')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
68
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
69 outputfile=open(outputFileUrl,'w')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
70 outputfile.seek(0,0)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
71 length=(len(sys.argv))
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
72
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
73 urls = []
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
74 methods = []
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
75
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
76 WSDLParserDriver=pkg.WSDLParserDriver
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
77 wPD=WSDLParserDriver()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
78 wPD.parse(wsdlUrl)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
79 urls = wPD.getUrl()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
80 methods = wPD.getCompleteMethodList()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
81
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
82 i=0
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
83 for url in urls:
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
84 outputfile.write(wsdlUrl+"\t")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
85 outputfile.write(str(methods[i].getName().getLocalPart())+"\t")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
86 outputfile.write(str(url)+"\n")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
87 i=i+1
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
88
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
89
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
90
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
91
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
92 def getSAWADLMethods(self, sawadlUrl, outputFileUrl ):
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
93 javahome = os.environ.get('JAVA_HOME')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
94 galaxyhome=os.environ.get('GALAXY_HOME')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
95 classpath= galaxyhome + '/tools/restclientSAWADL/lib/SAWADLParser/bin'
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
96
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
97 machine = platform.machine()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
98 if machine == 'x86_64' :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
99 startJVM("%s/jre/lib/amd64/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
100 elif machine == 'i686' :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
101 startJVM("%s/jre/lib/i386/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
102 elif machine == 'sun4u' :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
103 startJVM("%s/jre/lib/sparc/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
104 else :
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
105 System.exit("Could not identify machine, please specify path to libjvm.so")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
106
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
107 pkg=JPackage('edu.uga.cs.lsdis.meteors.wadls')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
108
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
109
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
110
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
111 outputfile=open(outputFileUrl,'w')
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
112 outputfile.seek(0,0)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
113
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
114
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
115 urls = []
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
116 methods = []
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
117
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
118 SAWADLParserDriver=pkg.SAWADLParserDriver
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
119 sawPD=SAWADLParserDriver()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
120 sawPD.parse(sawadlUrl)
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
121 urls = sawPD.getUrl()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
122 methods = sawPD.getCompleteMethodList()
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
123
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
124 i=0
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
125 for url in urls:
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
126 outputfile.write(sawadlUrl+"\t")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
127 outputfile.write(str(methods[i].getName())+"\t")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
128 outputfile.write(str(url)+"\n")
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
129 i=i+1
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
130
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
131
e7482c82796e Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
132