Changeset 3983


Ignore:
Timestamp:
Nov 20, 2007, 11:28:06 AM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #827: Add more web services methods

  • Added getById() method to services that didn't have it
  • Added listing/query method to services that didn't have one
Location:
trunk/src/webservices
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/webservices/client/java/net/sf/basedb/ws/client/ArrayDesignClient.java

    r3964 r3983  
    2424package net.sf.basedb.ws.client;
    2525
     26import net.sf.basedb.info.ArrayDesignInfo;
    2627import net.sf.basedb.info.DataFileTypeInfo;
    2728import net.sf.basedb.info.QueryOptions;
     
    5859  }
    5960
     61  /**
     62    Get info about an array design when you know the ID.
     63    @param itemId The ID of the array design
     64    @return An ArrayDesignInfo object
     65  */
     66  public ArrayDesignInfo getById(int itemId)
     67    throws AxisFault
     68  {
     69    return invokeBlocking("getById", ArrayDesignInfo.class,
     70      session.getId(), itemId);
     71  }
     72 
     73  /**
     74    Gets info about array designs that are available in the logged in session.
     75      @param qOpt Options to put on the query
     76      @return An array with info object for each array design that was found.
     77      @throws AxisFault If communication with web service fails.
     78   */
     79  public ArrayDesignInfo[] getArrayDesigns(QueryOptions qOpt)
     80    throws AxisFault
     81  {
     82    ArrayDesignInfo[] result = invokeBlocking("getArrayDesigns", ArrayDesignInfo[].class, session.getId(), qOpt);
     83    return result;
     84  }
     85 
    6086  /**
    6187    Downloads an arraydesign as a file,
  • trunk/src/webservices/client/java/net/sf/basedb/ws/client/ExperimentClient.java

    r3976 r3983  
    5252    super(session.getUrl(), "Experiment");
    5353    this.session = session;
     54  }
     55 
     56  /**
     57    Get info about an experiment when you know the ID.
     58    @param itemId The ID of the experiment
     59    @return An ExperimentInfo object
     60  */
     61  public ExperimentInfo getById(int itemId)
     62    throws AxisFault
     63  {
     64    return invokeBlocking("getById", ExperimentInfo.class,
     65      session.getId(), itemId);
    5466  }
    5567 
  • trunk/src/webservices/client/java/net/sf/basedb/ws/client/ProjectClient.java

    r3952 r3983  
    5151 
    5252  /**
     53    Get info about a project when you know the ID.
     54    @param itemId The ID of the project
     55    @return An ExperimentInfo object
     56  */
     57  public ProjectInfo getById(int itemId)
     58    throws AxisFault
     59  {
     60    return invokeBlocking("getById", ProjectInfo.class,
     61      session.getId(), itemId);
     62}
     63
     64 
     65  /**
    5366    Sets a project to be active.
    5467      @param projectId Id of the project that should be put active.
  • trunk/src/webservices/client/java/net/sf/basedb/ws/client/RawBioAssayClient.java

    r3973 r3983  
    2828import net.sf.basedb.info.DataFileTypeInfo;
    2929import net.sf.basedb.info.QueryOptions;
     30import net.sf.basedb.info.RawBioAssayInfo;
    3031
    3132import java.io.IOException;
     
    6061    this.session = session;
    6162  }
     63 
     64  /**
     65    Get info about a raw bioassay when you know the ID.
     66    @param itemId The ID of the raw bioassay
     67    @return An RawBioAssayInfo object
     68  */
     69  public RawBioAssayInfo getById(int itemId)
     70    throws AxisFault
     71  {
     72    return invokeBlocking("getById", RawBioAssayInfo.class,
     73      session.getId(), itemId);
     74  }
     75 
     76  /**
     77    Gets info about raw bioassays that are available in the logged in session.
     78      @param qOpt Options to put on the query
     79      @return An array with info object for each raw bioassay that was found.
     80      @throws AxisFault If communication with web service fails.
     81   */
     82  public RawBioAssayInfo[] getRawBioAssays(QueryOptions qOpt)
     83    throws AxisFault
     84  {
     85    RawBioAssayInfo[] result = invokeBlocking("getRawBioAssays", RawBioAssayInfo[].class, session.getId(), qOpt);
     86    return result;
     87  }
    6288 
    6389  /**
  • trunk/src/webservices/server/net/sf/basedb/ws/server/ArrayDesignService.java

    r3973 r3983  
    2323*/
    2424package net.sf.basedb.ws.server;
     25
    2526
    2627import net.sf.basedb.core.ArrayDesign;
     
    3334import net.sf.basedb.core.SessionControl;
    3435import net.sf.basedb.info.AnnotationInfo;
     36import net.sf.basedb.info.ArrayDesignInfo;
    3537import net.sf.basedb.info.DataFileTypeInfo;
    3638import net.sf.basedb.info.QueryOptions;
     
    5456  public ArrayDesignService()
    5557  {}
     58 
     59  /**
     60    Get information about an array design that you know the ID of.
     61    @param ID Id to identify the session.
     62    @param itemId The ID of the array design
     63    @return The array design information
     64  */
     65  public ArrayDesignInfo getById(String ID, int itemId)
     66  {
     67    SessionControl sc = getSessionControl(ID);
     68    DbControl dc = sc.newDbControl();
     69    try
     70    {
     71      ArrayDesign ad = ArrayDesign.getById(dc, itemId);
     72      return ad.toTransferable(new ArrayDesignInfo());
     73    }
     74    finally
     75    {
     76      if (dc != null) dc.close();
     77    }
     78  }
     79 
     80 
     81  /**
     82    Gets an array with info about array designs
     83    available for the active session.
     84      @param ID Id for the session to use.
     85      @param qOpt QueryOptions to put on the query
     86      @return An ArrayDesignInfo array.
     87   */
     88  public ArrayDesignInfo[] getArrayDesigns(String ID, QueryOptions qOpt)
     89  {
     90    SessionControl sc = getSessionControl(ID);
     91    DbControl dc = sc.newDbControl();
     92    try
     93    {
     94      ItemQuery<ArrayDesign> query= ArrayDesign.getQuery();   
     95      query = util.getConfiguredItemQuery(query, qOpt);
     96      return util.listToInfo(query.list(dc), ArrayDesignInfo.class);
     97    }
     98    finally
     99    {
     100      if (dc != null) dc.close();
     101    }
     102  }
    56103 
    57104  /**
  • trunk/src/webservices/server/net/sf/basedb/ws/server/ExperimentService.java

    r3976 r3983  
    4141import net.sf.basedb.info.ReporterListInfo;
    4242
    43 import java.util.LinkedList;
    44 import java.util.List;
    45 
    4643/**
    4744  Web Service class for
     
    6057 
    6158  /**
     59    Get information about an experiment that you know the ID of.
     60    @param ID Id to identify the session.
     61    @param itemId The ID of the experiment
     62    @return The experiment information
     63  */
     64  public ExperimentInfo getById(String ID, int itemId)
     65  {
     66    SessionControl sc = getSessionControl(ID);
     67    DbControl dc = sc.newDbControl();
     68    try
     69    {
     70      Experiment e = Experiment.getById(dc, itemId);
     71      return e.toTransferable(new ExperimentInfo());
     72    }
     73    finally
     74    {
     75      if (dc != null) dc.close();
     76    }
     77  }
     78 
     79 
     80  /**
    6281    Gets an array with info about experiments
    6382    available for the active session.
     
    7089    SessionControl sc = getSessionControl(ID);
    7190    DbControl dc = sc.newDbControl();
    72     List<ExperimentInfo> experiments = new LinkedList<ExperimentInfo>();
    7391    try
    7492    {
  • trunk/src/webservices/server/net/sf/basedb/ws/server/ProjectService.java

    r3972 r3983  
    4848 
    4949  /**
     50    Get information about a project that you know the ID of.
     51    @param ID Id to identify the session.
     52    @param itemId The ID of the project
     53    @return The project information
     54  */
     55  public ProjectInfo getById(String ID, int itemId)
     56  {
     57    SessionControl sc = getSessionControl(ID);
     58    DbControl dc = sc.newDbControl();
     59    try
     60    {
     61      Project p = Project.getById(dc, itemId);
     62      return p.toTransferable(new ProjectInfo());
     63    }
     64    finally
     65    {
     66      if (dc != null) dc.close();
     67    }
     68  }
     69 
     70  /**
    5071    Sets a project active
    5172      @param ID Id to identify the active session
  • trunk/src/webservices/server/net/sf/basedb/ws/server/RawBioAssayService.java

    r3974 r3983  
    3737import net.sf.basedb.info.DataFileTypeInfo;
    3838import net.sf.basedb.info.QueryOptions;
     39import net.sf.basedb.info.RawBioAssayInfo;
    3940
    4041
     
    5556  public RawBioAssayService()
    5657  {}
     58 
     59  /**
     60    Get information about a raw bioassay that you know the ID of.
     61    @param ID Id to identify the session.
     62    @param itemId The ID of the raw bioassay
     63    @return The raw bioassay information
     64  */
     65  public RawBioAssayInfo getById(String ID, int itemId)
     66  {
     67    SessionControl sc = getSessionControl(ID);
     68    DbControl dc = sc.newDbControl();
     69    try
     70    {
     71      RawBioAssay rba = RawBioAssay.getById(dc, itemId);
     72      return rba.toTransferable(new RawBioAssayInfo());
     73    }
     74    finally
     75    {
     76      if (dc != null) dc.close();
     77    }
     78  }
     79 
     80  /**
     81    Gets an array with info about raw bioassays
     82    available for the active session.
     83      @param ID Id for the session to use.
     84      @param qOpt QueryOptions to put on the query
     85      @return An RawBioAssayInfo array.
     86   */
     87  public RawBioAssayInfo[] getRawBioAssays(String ID, QueryOptions qOpt)
     88  {
     89    SessionControl sc = getSessionControl(ID);
     90    DbControl dc = sc.newDbControl();
     91    try
     92    {
     93      ItemQuery<RawBioAssay> query= RawBioAssay.getQuery();   
     94      query = util.getConfiguredItemQuery(query, qOpt);
     95      return util.listToInfo(query.list(dc), RawBioAssayInfo.class);
     96    }
     97    finally
     98    {
     99      if (dc != null) dc.close();
     100    }
     101  }
    57102 
    58103  /**
Note: See TracChangeset for help on using the changeset viewer.