Changeset 3958


Ignore:
Timestamp:
Nov 13, 2007, 2:59:30 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #822: Create a separate WS-client dist

Added some more client example code and updated documentation.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r3953 r3958  
    729729    <path id="examples.webservices.classpath" description="Class path for compiling example">
    730730      <path refid="lib.webservices.classpath"/>
     731      <pathelement location="${info.build}"/>
    731732      <pathelement location="${webservices.build}/client"/>
    732733    </path>
     
    763764    <copy todir="${examples}/webservices/bin">
    764765      <fileset  dir="${examples.webservices.build}" />
     766    </copy>
     767    <copy todir="${examples}/webservices/wsdl">
     768      <fileset dir="${webservices.wsdlpath}" />
    765769    </copy>
    766770    <copy todir="${examples}/webservices/lib">
  • trunk/doc/src/docbook/developerdoc/plugin_developer.xml

    r3953 r3958  
    5656<filename class="directory"><replaceable>pluginname</replaceable>/lib/</filename>
    5757<filename class="directory"><replaceable>pluginname</replaceable>/src/<replaceable>org/company</replaceable>/</filename>
     58<filename class="directory"><replaceable>pluginname</replaceable>/META-INF/</filename>
    5859          </literallayout>
    5960          The
     
    6869          class(es). See <ulink url="http://en.wikipedia.org/wiki/Java_package"
    6970          >http://en.wikipedia.org/wiki/Java_package</ulink> for information
    70           about conventions for naming packages.
     71          about conventions for naming packages. The
     72          <filename class="directory">META-INF</filename> directory contains metadata
     73          about the plug-in and are needed for best functionality.
    7174        </para>
    7275      </sect3>
     
    115118         jarfile="${plugin.name}.jar"
    116119         basedir="bin"
    117          manifest="MANIFEST.MF"
     120         manifest="META-INF/MANIFEST.MF"
    118121         &gt;
    119122         &lt;!--Include this to add required files for auto registration wizard--&gt;
    120          &lt;metainf file="./base-plugins.xml"&gt;&lt;/metainf&gt;
    121          &lt;metainf file="./base-configurations.xml"&gt;&lt;/metainf&gt;       
     123         &lt;metainf file="META-INF/base-plugins.xml"&gt;&lt;/metainf&gt;
     124         &lt;metainf file="META-INF/base-configurations.xml"&gt;&lt;/metainf&gt;       
    122125      &lt;/jar&gt;
    123126
     
    128131          If your plug-in depends on other JAR files than the
    129132          <filename>BASE2Core.jar</filename> you must create a file called
    130           <filename>MANIFEST.MF</filename> in the project root directory.
    131           List the other JAR files as in the following example.
    132           If your plug-in does not depend on other JAR files, remove the
     133          <filename>MANIFEST.MF</filename> in the project <filename>META-INF</filename>
     134          directory. List the other JAR files as in the following example.
     135          If your plug-in does not depend on other JAR files, you may remove the
    133136          <sgmltag class="attribute">manifest</sgmltag>
    134137          attribute of the <sgmltag class="starttag">jar</sgmltag> tag.
     
    139142          If your plug-in should support registration with the auto-installation
    140143          wizard it is a good idea to add the <sgmltag class="element">metainf</sgmltag>
    141           tags. This will add the two files <filename>base-plugins.xml</filename>
    142           and <filename>base-configurations.xml</filename> to the
     144          tags. This will add the two files <filename>META-INF/base-plugins.xml</filename>
     145          and <filename>META-INF/base-configurations.xml</filename> to the
    143146          <filename>META-INF</filename> directory in the JAR file. The two files
    144147          contains information about your plug-in and BASE can automatically
     
    248251                The plug-in will not be included in auto installer if the
    249252                BASE-version is lower then the value of this tag. The format of the
    250                 value in this tag should be
    251                 <emphasis>majorversion</emphasis>.<emphasis>minorversion</emphasis>
     253                value in this tag should be (numeric)
     254                <emphasis>majorversion</emphasis>.<emphasis>minorversion</emphasis>.
     255                It is not possible to check the bugfix or revision numbers.
    252256              </para>
    253257            </listitem>
  • trunk/src/examples/webservices/README

    r3953 r3958  
    3636/bin       Compiled code
    3737/lib       Libraries that are needed to connect with web services
    38 /src       Source code for the examples
     38/src       Source code for the example
     39/wsdl      WSDL files for the currently implemented services
    3940build.xml  Ant build script
    4041
  • trunk/src/examples/webservices/src/net/sf/basedb/ws/example/Main.java

    r3953 r3958  
    2626import org.apache.axis2.AxisFault;
    2727
     28import net.sf.basedb.info.ExperimentInfo;
     29import net.sf.basedb.info.ProjectInfo;
     30import net.sf.basedb.info.QueryOptions;
     31import net.sf.basedb.ws.client.ExperimentClient;
     32import net.sf.basedb.ws.client.ProjectClient;
    2833import net.sf.basedb.ws.client.SessionClient;
    2934
    3035/**
     36  Example code for using BASE web services. This class need
     37  three arguments to it's main method:
     38 
     39  <pre>
     40  servicesUrl
     41  login
     42  password
     43  </pre>
     44 
     45  This class will connect to the BASE server as specified in the
     46  <code>servicesUrl</code>, login, list all projects and experiments
     47  the the user has access to and then logout again.
    3148
    3249  @author nicklas
     
    5370      System.out.println("Connecting to: " + serviceUrl);
    5471      main.connect(serviceUrl);
     72      System.out.println("------------");
    5573      main.login(username, password);
    56       //main.listProjects();
    57       //main.listExperiments();
     74      System.out.println("------------");
     75      main.listProjects();
     76      System.out.println("------------");
     77      main.listExperiments();
     78      System.out.println("------------");
    5879      main.logout();
    5980    }
     
    79100  {}
    80101 
     102  /**
     103    Connect to BASE with web services.
     104    @param serviceUrl The URL to the BASE webservices server
     105  */
    81106  public void connect(String serviceUrl)
    82107    throws AxisFault
     
    89114  }
    90115 
     116  /**
     117    Login to BASE.
     118    @param login The login for the account
     119    @param password The password
     120  */
    91121  public void login(String login, String password)
    92122    throws AxisFault
     
    98128  }
    99129 
     130  /**
     131    Logout from BASE.
     132  */
    100133  public void logout()
    101134    throws AxisFault
     
    104137    System.out.println("Logged out!");
    105138  }
     139
     140  /**
     141    List all projects that the logged in user is has access to.
     142  */
     143  public void listProjects()
     144    throws AxisFault
     145  {
     146    ProjectClient pc = new ProjectClient(session);
     147    ProjectInfo[] projects = pc.getProjects(new QueryOptions());
     148   
     149    if (projects == null || projects.length == 0)
     150    {
     151      System.out.println("No projects found.");
     152    }
     153    else
     154    {
     155      System.out.println(projects.length + " projects found");
     156      int i = 0;
     157      while (i < projects.length)
     158      {
     159        ProjectInfo info = projects[i];
     160        ++i;
     161        System.out.println( i + ". " + info.getName() + " [" + info.getId() + "]");
     162      }
     163    }
     164  }
     165
     166  /**
     167    List all experiments that the logged in user is has access to.
     168  */
     169  public void listExperiments()
     170    throws AxisFault
     171  {
     172    ExperimentClient ec = new ExperimentClient(session);
     173    ExperimentInfo[] experiments = ec.getExperiments(new QueryOptions());
     174   
     175    if (experiments == null || experiments.length == 0)
     176    {
     177      System.out.println("No experiments found.");
     178    }
     179    else
     180    {
     181      System.out.println(experiments.length + " experiments found");
     182      int i = 0;
     183      while (i < experiments.length)
     184      {
     185        ExperimentInfo info = experiments[i];
     186        ++i;
     187        System.out.println( i + ". " + info.getName() + " [" + info.getId() + "]");
     188      }
     189    }
     190  }
    106191 
    107192 
Note: See TracChangeset for help on using the changeset viewer.