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