Changeset 818


Ignore:
Timestamp:
Nov 21, 2008, 9:20:58 PM (13 years ago)
Author:
Jari Häkkinen
Message:

First commit of the AbstractRunBinaryPlugin? class. Still very Affymetrix biased.

Location:
plugins/base2/net.sf.basedb.pluginutilities/trunk
Files:
5 added
4 copied

Legend:

Unmodified
Added
Removed
  • plugins/base2/net.sf.basedb.pluginutilities/trunk/README

    r816 r818  
    11$Id$
    22
    3 = About `se.lu.onk.BaseFile` =
     3= About `net.sf.basedb.pluginutilities` =
    44
    5 The `se.lu.onk.BaseFile` package is a utility class used by many of
    6 the se.lu.onk plug-ins. Simply add the jar file supplied by this
    7 package to the classpath for the plug-in you want to run or
    8 compile. See specific plug-ins for further details on how to use this
    9 package.
     5The `net.sf.basedb.pluginutilities` package is a utility class package
     6for use when creating BASE plug-ins. The aim is to simplify creation of
     7BASE plug-ins. Simply add the jar file supplied by this package to the
     8classpath for the plug-in you want to run or compile. See specific
     9plug-ins for further details on how to use this package.
    1010
    11 `se.lu.onk.BaseFile` is free software. See the file license.txt for
    12 copying conditions.
     11`net.sf.basedb.pluginutilities` is free software. See the file
     12license.txt for copying conditions.
    1313
    14 The package was created by Johan Enell and is currently maintained by
    15 Jari Häkkinen.
     14The package was created, and is currently maintained, Jari Häkkinen.
    1615
    1716
    1817== Downloading ==
    1918
    20 `se.lu.onk.BaseFile` can be obtained from
     19`net.sf.basedb.pluginutilities` can be obtained from
    2120
    2221  http://baseplugins.thep.lu.se/wiki/PluginDownload
     
    3029
    3130If you want to modify and compile this package you must check it out
    32 from the repository, change to the package directory and issue `ant`;
     31from the repository, change to the package directory and issue a
     32couple of `ant` commands:
    3333{{{
    3434  check out project, see instructions below
    35   # cd /path/to/se.lu.onk.BaseFile
     35  # cd /path/to/net.sf.basedb.pluginutilities
     36  # ant download-lib
    3637  # ant
    3738}}}
    38 This will create a jar file `dist/BaseFile.jar`.
     39This will create a jar file `dist/AbstractRunBinary.jar`.
    3940
    4041
    4142== Creating a distribution ==
    4243
    43 Update the version number in `build.xml`, and issue `ant package`. This
    44 creates a distribution package with all required components.
     44Update the version number in `build.xml`, and issue `ant download-lib
     45; ant package`. This creates a distribution package with all required
     46components.
    4547
    4648
    4749== Bug Reporting ==
    4850
    49 You can report `se.lu.onk.BaseFile` bugs on
     51You can report `net.sf.basedb.pluginutilities` bugs on
    5052
    5153  http://baseplugins.thep.lu.se/newticket
     
    5658== Subversion Access ==
    5759
    58 The `se.lu.onk.BaseFile` source repository is available via anonymous
    59 subversion access, issue:
     60The `net.sf.basedb.pluginutilities` source repository is available via
     61anonymous subversion access. For the latest maybe unstable version
     62issue:
    6063
    61   `svn co http://baseplugins.thep.lu.se/svn/plugins/base1/se.lu.onk.BaseFile/trunk se.lu.onk.BaseFile`
     64  `svn co http://baseplugins.thep.lu.se/svn/plugins/base2/net.sf.basedb.pluginutilities/trunk net.sf.basedb.pluginutilities`
    6265
    6366There is no guarantees about the contents or quality of the latest
     
    7275Copyright (C) 2008 Jari Häkkinen
    7376
    74 This file is part of the se.lu.onk.BaseFile package, a utility package
    75 for reading files generated by BASE. The package is available at
    76 http://baseplugins.thep.lu.se/ and BASE web site is
     77This file is part of the net.sf.basedb.pluginutilities package, a
     78utility package that simplifies creation of BASE plug-ins. The package
     79is available at http://baseplugins.thep.lu.se/ and BASE web site is
    7780http://base.thep.lu.se
    7881
  • plugins/base2/net.sf.basedb.pluginutilities/trunk/build.xml

    r816 r818  
    11<?xml version="1.0" encoding="UTF-8"?>
     2<!--
     3    $Id$
    24
    3 <!-- $Id$ -->
     5    Copyright (C) 2008 Jari Hakkinen, Nicklas Nordborg
    46
    5 <project
    6   name="IlluminaPlugins"
    7   default="dist"
    8   basedir=".">
     7    This file is part of the net.sf.basedb.pluginutilities package, a
     8    utility package that simplifies creation of BASE plug-ins. The
     9    package is available at http://baseplugins.thep.lu.se/ and BASE
     10    web site is http://base.thep.lu.se
     11
     12    This is free software; you can redistribute it and/or modify it
     13    under the terms of the GNU General Public License as published by
     14    the Free Software Foundation; either version 3 of the License, or
     15    (at your option) any later version.
     16
     17    The software is distributed in the hope that it will be useful,
     18    but WITHOUT ANY WARRANTY; without even the implied warranty of
     19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
     20    General Public License for more details.
     21
     22    You should have received a copy of the GNU General Public License
     23    along with BASE. If not, see <http://www.gnu.org/licenses/>.
     24-->
     25<project name="AbstractRunBinaryPlugin" default="build" basedir=".">
    926
    1027  <!--create this file if you need to override values from properties below -->
    1128  <property file="build.properties" />
    1229
    13  
    1430  <!-- variables used -->
    15   <property name="name" value="illumina-plugins" />
    16   <property name="version" value="1.2pre" />
     31  <property name="name" value="AbstractRunBinaryPlugin" />
     32  <property name="version" value="0.1pre" />
    1733  <property name="src" location="src" description="Location of source files" />
    18   <property name="build" location="build" description="Location of compiled files" />
    19   <property name="dist" location="dist" description="Directory where distribution should be created" />
    20   <property name="package" location="package" description="Directory where packaged distribution files are created"/>
    21   <property name="javac.arg" value="-Xlint:unchecked" />
     34  <property name="build" location="build"
     35            description="Location of compiled files" />
     36  <property name="dist" location="dist"
     37            description="Directory where distribution should be created" />
     38  <property name="lib" location="lib"
     39            description="Directory for jars required for compilation" />
     40  <property name="package" location="package"
     41            description="Directory for created packaged distribution files"/>
    2242  <property name="javac.source" value="1.5" />
    2343  <property name="javac.target" value="1.5" />
    2444  <property name="javac.encoding" value="ISO-8859-1" />
    2545  <property name="depend.jars"
    26     value="http://base2.thep.lu.se/base/jars/2.9.0"
     46    value="http://base2.thep.lu.se/base/jars/2.8.4"
    2747    description="The location of the BASE core JARs that we depend on"
    2848  />
     
    3858    <mkdir dir="${build}" />
    3959    <mkdir dir="${dist}" />
     60    <mkdir dir="${lib}" />
    4061  </target>
    41    
     62
    4263  <target name="clean">
    4364    <delete failonerror="false" includeemptydirs="true">
     
    4768    </delete>
    4869  </target>
    49  
    50   <target
    51     name="dist"
    52     depends="clean,build"
     70
     71  <target name="distclean" depends="clean" >
     72    <delete failonerror="false" includeemptydirs="true">
     73      <fileset dir="${lib}" defaultexcludes="no" />
     74    </delete>
     75  </target>
     76
     77  <target
     78    name="dist"
     79    depends="clean, build"
    5380    >
     81    <property name="jar" value="${name}.jar" />
     82    <jar
     83      jarfile="${dist}/${jar}"
     84      basedir="${build}"
     85      >
     86    </jar>
    5487    <copy todir="${dist}">
    55       <fileset dir="." includes="README*,LICENSE,INSTALL" />
    56       <fileset dir="." includes="config/*" />
     88      <fileset dir="." includes="README*, license.txt" />
    5789    </copy>
    5890  </target>
    59  
     91
    6092  <target
    6193    name="package"
     
    6698    <mkdir dir="${package}" />
    6799    <tar
    68       destfile="${package}/${tar.prefix}.tar.gz"
     100      destfile="${package}/${tar.prefix}.tgz"
    69101      longfile="gnu"
    70102      compression="gzip"
     
    72104      <tarfileset
    73105        dir="${dist}"
    74         mode="755"
    75106        prefix="${tar.prefix}"
    76107        preserveLeadingSlashes="true"
    77108        >
    78         <include name="**/*.sh" />
    79       </tarfileset>
    80       <tarfileset
    81         dir="${dist}"
    82         prefix="${tar.prefix}"
    83         preserveLeadingSlashes="true"
    84         >
    85         <exclude name="**/*.sh" />
    86109      </tarfileset>
    87110    </tar>
     111    <checksum file="${package}/${tar.prefix}.tgz" />
    88112  </target>
    89  
    90   <target 
     113
     114  <target
    91115    name="build"
    92     depends="init,checkjar"
    93     description="Compiles the plugin and put in jar"
     116    depends="init, checkjar"
     117    description="Compiles the package"
    94118    >
    95     <property name="jar" value="${name}.jar" />
    96     <mkdir dir="${build}" />
    97119    <javac
    98       encoding="${javac.encoding}"
    99       srcdir="${src}"
    100       destdir="${build}"
    101       debug="true"
     120      encoding="${javac.encoding}"
     121      srcdir="${src}"
     122      destdir="${build}"
     123      debug="true"
     124      deprecation="true"
    102125      classpathref="classpath"
    103       source="${javac.source}"
    104       target="${javac.target}"
    105126      >
    106       <compilerarg value="${javac.arg}" />
    107127    </javac>
    108     <copy todir="${build}">
    109       <fileset dir="." includes="META-INF/*" />
    110     </copy>
    111     <replace token="%%plugins.jar%%" value="${jar}" file="${build}/META-INF/base-plugins.xml" />
    112     <jar
    113       jarfile="${dist}/${jar}"
    114       basedir="${build}"
    115       >
    116     </jar>
    117128  </target>
    118129 
    119130  <target
    120131    name="checkjar"
    121     description="Checks that the BASE2Core.jar, BASE2CorePlugins.jar and BASE2WSClient.jar exists."
     132    description="Check existence of jars BASE2Core and BASE2WSClient."
    122133    >
    123     <available classname="net.sf.basedb.core.Application" 
     134    <available classname="net.sf.basedb.core.Application"
    124135      classpathref="classpath" property="base2core" />
    125     <available classname="net.sf.basedb.plugins.ReporterFlatFileImporter"
    126       classpathref="classpath" property="base2coreplugins" />
    127136    <available classname="net.sf.basedb.ws.client.SessionClient"
    128137      classpathref="classpath" property="base2wsclient" />
    129     <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
    130     <fail unless="base2coreplugins" message="Can't find BASE2CorePlugins.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
    131     <fail unless="base2wsclient" message="Can't find BASE2WSClient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
    132     <echo>Found BASE2Core.jar, BASE2CorePlugins.jar, and BASE2WSClient.jar.</echo>
     138    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib. Try 'ant download-lib' to download the missing file." />
     139    <fail unless="base2wsclient" message="Can't find BASE2WSClient.jar in ./lib. Try 'ant download-lib' to download the missing file." />
     140    <echo>Found BASE2Core.jar and BASE2WSClient.jar.</echo>
    133141  </target>
    134142
    135     <target
     143  <target
    136144    name="download-lib"
    137     description="Download BASE2Core.jar, BASE2CorePlugins.jar and BASE2WSClient.jar."
     145    depends="init"
     146    description="Download jars BASE2Core and BASE2WSClient."
    138147    >
    139148    <echo>
    140 -------------------------------------------------------   
    141 NOTE! You may specifiy a different download location by
     149-------------------------------------------------------
     150NOTE! You may specify a different download location by
    142151creating the file './build.properties' and
    143152setting 'depend.jars' to the URL to download from.
     
    145154    </echo>
    146155    <download-lib file="BASE2Core.jar" />
    147     <download-lib file="BASE2CorePlugins.jar" />
    148156    <download-lib file="BASE2WSClient.jar" />
    149157  </target>
    150  
     158
    151159  <macrodef name="download-lib" description="Download BASE core JAR files">
    152160    <attribute name="file" />
    153161    <sequential>
    154       <get 
    155         dest="lib/compile/@{file}"
    156         src="${depend.jars}/@{file}" 
    157         usetimestamp="true" 
     162      <get
     163        dest="lib/@{file}"
     164        src="${depend.jars}/@{file}"
     165        usetimestamp="true"
    158166        verbose="true"
    159167        ignoreerrors="true"
    160168      />
    161169    </sequential>
    162   </macrodef> 
     170  </macrodef>
    163171
    164172</project>
  • plugins/base2/net.sf.basedb.pluginutilities/trunk/src/net/sf/basedb/plugins/AbstractRunBinaryPlugin.java

    r816 r818  
    22  $Id$
    33
    4   Copyright (C) 2006 Jari Hakkinen
    5   Copyright (C) 2007 Peter Johansson
    6  
    7   This file is part of BASEPlugIns - Non-core plug-ins for BASE,
    8   BioArray Software Environment.
    9   BASEPlugIns is available at http://baseplugins.thep.lu.se/
    10   BASE is available at http://base.thep.lu.se/
    11 
    12   BASEPlugIns is free software; you can redistribute it and/or modify
    13   it under the terms of the GNU General Public License as published by
    14   the Free Software Foundation; either version 2 of the License, or
     4  Copyright (C) 2008 Jari Hakkinen
     5
     6  This file is part of the net.sf.basedb.pluginutilities package, a
     7  utility package that simplifies creation of BASE plug-ins. The
     8  package is available at http://baseplugins.thep.lu.se/ and BASE web
     9  site is http://base.thep.lu.se
     10
     11  This is free software; you can redistribute it and/or modify it
     12  under the terms of the GNU General Public License as published by
     13  the Free Software Foundation; either version 3 of the License, or
    1514  (at your option) any later version.
    1615
    17   BASEPlugIns is distributed in the hope that it will be useful, but
     16  The software is distributed in the hope that it will be useful, but
    1817  WITHOUT ANY WARRANTY; without even the implied warranty of
    19   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    2019  General Public License for more details.
    2120
    2221  You should have received a copy of the GNU General Public License
    23   along with this program; if not, write to the Free Software
    24   Foundation, Inc., 59 Temple Place - Suite 330,
    25   Boston, MA  02111-1307, USA.
     22  along with BASE. If not, see <http://www.gnu.org/licenses/>.
    2623*/
    2724
    28 package se.lu.thep.wenni;
     25package net.sf.basedb.plugins;
    2926
    3027import net.sf.basedb.core.BaseException;
     
    4037import net.sf.basedb.core.ItemQuery;
    4138import net.sf.basedb.core.Job;
     39import net.sf.basedb.core.Platform;
    4240import net.sf.basedb.core.PluginDefinition;
    4341import net.sf.basedb.core.PluginParameter;
     
    8078*/
    8179
    82 abstract public class RunBinaryPlugin
     80abstract public class AbstractRunBinaryPlugin
    8381  extends AbstractPlugin
    8482  implements InteractivePlugin
    8583{
    8684
    87   protected RunBinaryPlugin() {}
     85  protected AbstractRunBinaryPlugin() {}
    8886
    8987  @SuppressWarnings("unchecked")
     
    106104        try {
    107105          experiment = Experiment.getById(dc, experiment.getId());
    108           if (!experiment.getRawDataType().isAffymetrix())
     106          if (!experiment.getRawDataType().getPlatform(dc).equals(Platform.AFFYMETRIX))
    109107            throw new BaseException("Raw data type '" +
    110108                                    experiment.getRawDataType() +
     
    262260      Experiment e=Experiment.getById
    263261        (dc, sc.getCurrentContext(Item.EXPERIMENT).getId());
    264       if (!e.getRawDataType().isAffymetrix())
     262      if (!e.getRawDataType().getPlatform(dc).equals(Platform.AFFYMETRIX))
    265263        return ("Raw data type '" + e.getRawDataType() +
    266264                "' is not supoorted by this plug-in.");
Note: See TracChangeset for help on using the changeset viewer.