Changeset 1407 for webservices/net.sf.basedb.examples/trunk
- Timestamp:
- Oct 18, 2011, 2:50:36 PM (12 years ago)
- Location:
- webservices/net.sf.basedb.examples/trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
webservices/net.sf.basedb.examples/trunk
- Property svn:ignore
-
old new 3 3 build 4 4 dist 5 build.properties 6 .settings
-
- Property svn:ignore
-
webservices/net.sf.basedb.examples/trunk/LICENSE
r651 r1407 5 5 This is free software; you can redistribute it and/or 6 6 modify it under the terms of the GNU General Public License 7 as published by the Free Software Foundation; either version 27 as published by the Free Software Foundation; either version 3 8 8 of the License, or (at your option) any later version. 9 9 … … 14 14 15 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place - Suite 330, 18 Boston, MA 02111-1307, USA. 16 along with BASE. If not, see <http://www.gnu.org/licenses/>. -
webservices/net.sf.basedb.examples/trunk/README
r652 r1407 1 1 == Requirements == 2 2 3 1. Access to a BASE server with web services3 1. Access to a BASE 3.0 server with web services 4 4 2. Java 1.6 or later. 5 5 3. Ant 1.6 or later. … … 12 12 13 13 1. Unpack the tar.gz file to a directory of your choice. 14 2. Modify 'build.xml' and enter connection options: 14 2. Create a 'build.properties' file and enter connection options 15 as key=value pairs: 15 16 * services.url 16 17 The URL to the BASE web server. It should be the same URL as you use to login 17 18 with the web interface with '/services' appended to it. For example: 18 http://localhost:8080/base2/services 19 services.url=http://localhost:8080/base2/services 20 19 21 * services.login 20 22 The username for your account on the BASE web server. 23 21 24 * services.password 22 25 Your password for the BASE web server. 26 23 27 * download.dir 24 28 Set this option to a valid directory path to enable download of raw data from 25 29 all raw bioassays. NOTE! Be careful with this option if you have a lot of data. 26 All files from all raw bioassay will be downloaded! 30 All files from all raw bioassays will be downloaded! 31 27 32 3. Run `ant test` to run the example code 28 33 … … 32 37 `ant -Dservices.url=http://localhost/base/services 33 38 -Dservices.login=mylogin -Dservices.password=mypassword 34 -Ddownload.dir=. `39 -Ddownload.dir=./download test` 35 40 36 41 == Compiling == -
webservices/net.sf.basedb.examples/trunk/build.xml
r1296 r1407 5 5 basedir="."> 6 6 7 <!--create this file if you need to override values from properties below --> 8 <property file="build.properties" /> 9 7 10 <!-- settings for the BASE webservices server --> 8 11 <!-- modify the values as needed --> … … 15 18 <!-- variables used --> 16 19 <property name="name" value="example-webservices" /> 17 <property name="version" value=" 2.6" />20 <property name="version" value="3.0-beta" /> 18 21 <property name="src" location="src" description="Location of source files" /> 19 22 <property name="build" location="build" description="Location of compiled files" /> … … 26 29 <property name="javac.target" value="1.6" /> 27 30 <property name="javac.encoding" value="UTF-8" /> 31 <property name="depend.base-version" 32 value="3.0.0" 33 description="The BASE version that this project depends on." 34 /> 28 35 <property name="depend.jars" 29 value="http://base2.thep.lu.se/base/jars/ 2.17.0"30 description="The location of the BASE core JARs that we depend on"36 value="http://base2.thep.lu.se/base/jars/${depend.base-version}" 37 description="The location of the BASE core JARs that this project depends on." 31 38 /> 32 39 … … 138 145 <target 139 146 name="checkjar" 140 description="Checks that the BASE 2WSClient.jarexists."147 description="Checks that the BASE JAR files exists." 141 148 > 142 149 <available classname="net.sf.basedb.ws.client.SessionClient" 143 classpathref="classpath" property="base 2wsclient" />144 <fail unless="base 2wsclient" message="Can't find BASE2WSClient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />145 <echo>Found BASE2WSClient.jar.</echo>150 classpathref="classpath" property="base-wsclient" /> 151 <fail unless="base-wsclient" message="Can't find base-webservices-client-${depend.base-version}.jar in ./lib. Try 'ant download-lib' to download the missing file." /> 152 <echo>Found base-webservices-client-${depend.base-version}.jar</echo> 146 153 </target> 147 154 148 155 <target 149 156 name="download-lib" 150 description="Download BASE 2WSClient.jar."157 description="Download BASE JAR Files" 151 158 > 152 159 <echo> … … 157 164 ------------------------------------------------------- 158 165 </echo> 159 <download-lib file=" BASE2WSClient.jar" />166 <download-lib file="base-webservices-client-${depend.base-version}.jar" /> 160 167 </target> 161 168 162 <macrodef name="download-lib" description="Download BASE coreJAR files">169 <macrodef name="download-lib" description="Download BASE JAR files"> 163 170 <attribute name="file" /> 164 171 <sequential> -
webservices/net.sf.basedb.examples/trunk/lib
- Property svn:ignore
-
old new 1 BASE2WSClient.jar1 base-webservices-client-*.jar
-
- Property svn:ignore
-
webservices/net.sf.basedb.examples/trunk/src/net/sf/basedb/ws/example/Main.java
r651 r1407 4 4 Copyright (C) Authors contributing to this file. 5 5 6 This file is part of BASE - BioArray Software Environment. 7 Available at http://base.thep.lu.se/ 8 9 BASE is free software; you can redistribute it and/or 6 This is free software; you can redistribute it and/or 10 7 modify it under the terms of the GNU General Public License 11 as published by the Free Software Foundation; either version 28 as published by the Free Software Foundation; either version 3 12 9 of the License, or (at your option) any later version. 13 14 BASEis distributed in the hope that it will be useful,10 11 The software is distributed in the hope that it will be useful, 15 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 14 GNU General Public License for more details. 18 15 19 16 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, 22 Boston, MA 02111-1307, USA. 17 along with BASE. If not, see <http://www.gnu.org/licenses/>. 23 18 */ 24 19 package net.sf.basedb.ws.example; … … 35 30 import net.sf.basedb.info.DataFileTypeInfo; 36 31 import net.sf.basedb.info.ExperimentInfo; 32 import net.sf.basedb.info.FileInfo; 33 import net.sf.basedb.info.FileSetMemberInfo; 37 34 import net.sf.basedb.info.ProjectInfo; 38 35 import net.sf.basedb.info.QueryOptions; … … 254 251 throws AxisFault 255 252 { 256 DataFileTypeInfo[] files = rc.getDataFileTypes(info.getId(), new QueryOptions());253 FileSetMemberInfo[] files = rc.getDataFiles(info.getId(), new QueryOptions()); 257 254 if (files == null || files.length == 0) 258 255 { … … 261 258 else 262 259 { 263 for (DataFileTypeInfo fileType : files) 264 { 265 System.out.print(" " + fileType.getName()); 260 for (FileSetMemberInfo member : files) 261 { 262 DataFileTypeInfo fileType = member.getDataFileTypeInfo(); 263 FileInfo file = member.getFileInfo(); 264 265 System.out.println(" " + fileType.getName() + ": " + 266 file.getName() + " [id=" + file.getId() + "] " + file.getSize() + " bytes"); 266 267 if (downloadDir != null) 267 268 { 268 String extension = fileType.getExtension() == null ? "" : "." + fileType.getExtension(); 269 File downloadTo = new File(downloadDir, info.getName() + extension); 269 File downloadTo = new File(downloadDir, info.getName() + "." + file.getName()); 270 270 try 271 271 { … … 275 275 out.close(); 276 276 in.close(); 277 System.out.print(" ;Download --> " + downloadTo);277 System.out.print(" Download --> " + downloadTo); 278 278 } 279 279 catch (IOException ex) 280 280 { 281 System.out.print(" ;Download failed: " + ex.getMessage());281 System.out.print(" Download failed: " + ex.getMessage()); 282 282 } 283 283 }
Note: See TracChangeset
for help on using the changeset viewer.