Changeset 3773


Ignore:
Timestamp:
Sep 25, 2007, 12:13:04 AM (15 years ago)
Author:
Jari Häkkinen
Message:

Merged patch release 2.4.2 to the webservices bracnh. Delta 2.4.2 - 2.4.1

Location:
branches/webservices
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • branches/webservices/build.xml

    r3695 r3773  
    5050
    5151    Documentation:
    52     doc:          Build documentation for local use
    53     docbook:      Build html and pdf from docbook (to be included in 'ant doc')
     52    doc:          Build all documentation for local use
     53    docbook:      Build only html and pdf from docbook
    5454    helptext:     Generate help text import file from the docbook documentation
    5555
     
    6666  <property name="base.majorversion" value="2" />
    6767  <property name="base.minorversion" value="4" />
    68   <property name="base.maintenanceversion" value="0ws" />
     68  <property name="base.maintenanceversion" value="2ws" />
    6969  <property name="base.version"
    7070    value="${base.majorversion}.${base.minorversion}.${base.maintenanceversion}" />
  • branches/webservices/doc/src/docbook/admindoc/installation_upgrade.xml

    r3724 r3773  
    343343            </listitem>
    344344          </varlistentry>
    345           <varlistentry>
    346             <term id="installation_upgrade.jobagent.user_account">Enable the job agent user account</term>
     345          <varlistentry id="installation_upgrade.jobagent.user_account">
     346            <term>Enable the job agent user account</term>
    347347            <listitem>
    348348              <para>
     
    367367      <para>
    368368        <variablelist>
    369           <varlistentry>
    370             <term id="installation_upgrade.jobagent.database">Create a user account on the database</term>
     369          <varlistentry id="installation_upgrade.jobagent.database">
     370            <term>Create a user account on the database</term>
    371371            <listitem>
    372372              <para>
     
    413413            </listitem>
    414414          </varlistentry>
    415           <varlistentry>
    416             <term id="installation_upgrade.jobagent.client.config">Edit the <filename>base.config</filename> file</term>
     415          <varlistentry id="installation_upgrade.jobagent.client.config">
     416            <term>Edit the <filename>base.config</filename> file</term>
    417417            <listitem>
    418418              <para>
     
    462462            </listitem>
    463463          </varlistentry>
    464           <varlistentry>
    465             <term id="installation_upgrade.jobagent.client.properties">Edit
     464          <varlistentry id="installation_upgrade.jobagent.client.properties">
     465            <term>Edit
    466466            the <filename>jobagent.properties</filename> file</term>
    467467            <listitem>
     
    744744      </varlistentry>
    745745
    746       <varlistentry>
    747         <term id="installation_upgrade.installation.database">BASE (database engine)</term>
     746      <varlistentry id="installation_upgrade.installation.database">
     747        <term>BASE (database engine)</term>
    748748        <listitem>
    749749          <para>
     
    841841      </varlistentry>
    842842
    843       <varlistentry>
    844         <term id="installation_upgrade.installation.configuration">BASE (configuration)</term>
     843      <varlistentry id="installation_upgrade.installation.configuration">
     844        <term>BASE (configuration)</term>
    845845        <listitem>
    846846          <para>
  • branches/webservices/doc/src/docbook/overviewdoc/resources.xml

    r3695 r3773  
    225225      to install it. Follow the link on BASE 2's home page to the demo server or go directly
    226226      to
    227       <ulink url="http://base2.thep.lu.se:8080/demo/">
    228         http://base2.thep.lu.se:8080/demo/
     227      <ulink url="http://base2.thep.lu.se/demo/">
     228        http://base2.thep.lu.se/demo/
    229229      </ulink>
    230230    </para>
     
    284284    </important>
    285285  </sect1>
     286
     287  <sect1 id="resources.basehacks">
     288    <title>BASE-hacks</title>
     289    <para>
     290      There is a trac/subversion server keeping track of changes made
     291      to third party projects that are changed to make them work with
     292      BASE. Open source project usually have a requirement that
     293      changes are made public. On
     294      the <ulink
     295      url='http://trac.thep.lu.se/trac/basehacks'>BASE-hacks web
     296      site</ulink> you will find a list of modified packages and
     297      information about the changes performed.
     298    </para>
     299  </sect1>
     300
    286301</chapter>
  • branches/webservices/doc/src/docbook/userdoc/analyse_mev.xml

    r3695 r3773  
    2929<sect1 id="experiments_analysis.mev">
    3030  <title>Analysing data with Multiexperiment Viewer (MeV)</title>
    31   <para>TODO</para>
     31  <para>
     32    MeV is a versatile microarray data analysis tool, incorporating
     33    sophisticated algorithms for clustering, visualization,
     34    classification, statistical analysis and biological theme
     35    discovery, <ulink
     36    url='http://www.tm4.org'>http://www.tm4.org</ulink>. We use a
     37    modified version of MeV and provide information about the changes
     38    at
     39    the <ulink url='http://trac.thep.lu.se/trac/basehacks'>BASE-hacks
     40    web site</ulink>.
     41  </para>
    3242</sect1>
  • branches/webservices/src/clients/migrate/net/sf/basedb/clients/migrate/QuotaTransfer.java

    r3724 r3773  
    9797      quotas.put(totalQuota, quota);
    9898    }
    99     else
     99    else if (quota.isInDatabase())
    100100    {
    101101      quota = Quota.getById(dc, quota.getId());
  • branches/webservices/src/clients/web/net/sf/basedb/clients/web/Base.java

    r3695 r3773  
    511511            if (value != null)
    512512            {
     513              boolean hasWildcard = value.indexOf('%') >= 0;
    513514              Type valueType = Type.valueOf(name.substring(7, colonIndex));
    514515 
     
    517518              filter.setValueType(valueType);
    518519             
    519               Operator op = Operator.EQ;
     520              Operator op = hasWildcard ? Operator.LIKE : Operator.EQ;
    520521              if (value.startsWith("<>") || value.startsWith("!="))
    521522              {
    522                 op = Operator.NEQ;
     523                op = hasWildcard ? Operator.NOTLIKE : Operator.NEQ;
    523524                value = value.substring(2);
    524525              }
     
    545546              else if (value.startsWith("="))
    546547              {
    547                 op = Operator.EQ;
     548                op = hasWildcard ? Operator.LIKE : Operator.EQ;
    548549                value = value.substring(1);
    549               }
    550               else if (value.indexOf('%') >= 0)
    551               {
    552                 op = Operator.LIKE;
    553550              }
    554551              if ("".equals(value)) value = null;
     
    669666        {}
    670667      }
    671       if (op == Operator.EQ && (value == null || (value != null && value.indexOf('%') >= 0)))
     668      if (op == Operator.EQ && value == null)
    672669      {
    673670        result = "=";
    674671      }
    675       else if (op == Operator.NEQ)
     672      else if (op == Operator.NEQ || op == Operator.NOTLIKE)
    676673      {
    677674        result = "<>";
  • branches/webservices/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java

    r3695 r3773  
    227227    String whichItems = (String)job.getValue(WHICH_ITEMS);
    228228    String format = (String)job.getValue(FORMAT);
    229     List<Integer> selectedItems = (List<Integer>)job.getValues("item");
    230229    List<String> columns = (List<String>)job.getValues(WHICH_PROPERTIES);
    231230   
     
    265264    QueryWrapper queryWrapper = null;
    266265    ResultIterator result = null;
     266    Set<Integer>selectedItems = cc.getSelected();
    267267   
    268268    // The query wrapper allows us to get results from the query in a simplier way
  • branches/webservices/src/core/net/sf/basedb/core/AbstractBatcher.java

    r3695 r3773  
    7575 
    7676  /**
    77     Constructor that initiate everything.
    78 
    79     @param dc The <code>DbControl</code> to get database access
     77    Constructor for a batcher.
    8078    @throws BaseException If there is an error
    8179  */
    82   AbstractBatcher(DbControl dc)
    83   {
    84     assert dc != null : "dc == null";
    85     this.dc = new WeakReference<DbControl>(dc);
    86     this.sc = dc.getSessionControl();
     80  AbstractBatcher()
     81  {
    8782    this.batchSize = Config.getInt("db.batch-size", 50);
    88     dc.addBatcher(this);
    8983  }
    9084
     
    133127  {
    134128    sc.updateLastAccess();
     129  }
     130 
     131  /**
     132    Set the DbControl that is controlling this batcher. This
     133    method MUST be called by all subclasses after successful construction
     134    of a batcher. This method also registers the batcher with the DbControl
     135    using {@link DbControl#addBatcher(Batcher)}
     136    @since 2.4.2
     137  */
     138  protected final void setDbControl(DbControl dc)
     139  {
     140    assert dc != null : "dc == null";
     141    this.dc = new WeakReference<DbControl>(dc);
     142    this.sc = dc.getSessionControl();
     143    dc.addBatcher(this);
    135144  }
    136145 
  • branches/webservices/src/core/net/sf/basedb/core/ArrayDesign.java

    r3695 r3773  
    532532    array design is an Affymetrix design information in the CDF file is
    533533    used, otherwise the database is queried.
    534     @return The number of features or probesets
     534    @return The number of features or probesets, or -1 if there is an
     535      error getting the number
    535536    @since 2.4
    536537  */
     
    540541    if (hasFeatures())
    541542    {
    542       if (isAffyChip())
     543      try
    543544      {
    544         FusionCDFData cdf = Affymetrix.loadCdfFile(Affymetrix.getCdfFile(this));
    545         numFeatures = cdf.getHeader().getNumProbeSets();
     545        if (isAffyChip())
     546        {
     547          FusionCDFData cdf = Affymetrix.loadCdfFile(Affymetrix.getCdfFile(this));
     548          numFeatures = cdf.getHeader().getNumProbeSets();
     549        }
     550        else
     551        {
     552          numFeatures = getFeatures().count(dc);
     553        }
    546554      }
    547       else
     555      catch (Throwable t)
    548556      {
    549         numFeatures = getFeatures().count(dc);
     557        Application.getLogger().warn("Could not get number of features for array design: " +
     558          this, t);
     559        numFeatures = -1;
    550560      }
    551561    }
  • branches/webservices/src/core/net/sf/basedb/core/BasicBatcher.java

    r3695 r3773  
    131131    Constructor that initiate everything.
    132132
    133     @param dc DbControl to get database access
    134133    @param dataClass The class of the data objects that are accepted by this batcher
    135134    @param entityName The entity name of the data as known by Hibernate, use null
     
    137136    @throws BaseException If there is an error
    138137  */
    139   BasicBatcher(DbControl dc, Class<D> dataClass, String entityName)
    140     throws BaseException
    141   {
    142     super(dc);
     138  BasicBatcher(org.hibernate.Session session, Class<D> dataClass, String entityName)
     139    throws BaseException
     140  {
     141    super();
    143142    assert dataClass != null : "dataClass == null";
    144143   
     
    159158    try
    160159    {
    161       java.sql.Connection c = HibernateUtil.getConnection(dc.getHibernateSession());
     160      java.sql.Connection c = HibernateUtil.getConnection(session);
    162161      insertStatement = c.prepareStatement(insertSql);
    163162      updateStatement = c.prepareStatement(updateSql);
  • branches/webservices/src/core/net/sf/basedb/core/DbControl.java

    r3695 r3773  
    269269          batcher.close();
    270270        }
    271         catch (BaseException ex)
     271        catch (Throwable ex)
    272272        {
    273273          log.warn("Exception during rollback in batcher.close()", ex);
     
    281281      if (hStatelessSession != null) HibernateUtil.close(hStatelessSession);
    282282    }
    283     catch (BaseException ex)
     283    catch (Throwable ex)
    284284    {
    285285      log.warn("Exception during rollback in Hibernate", ex);
  • branches/webservices/src/core/net/sf/basedb/core/FeatureBatcher.java

    r3695 r3773  
    9191    throws BaseException
    9292  {
    93     super(dc, FeatureData.class, null);
     93    super(dc.getHibernateSession(), FeatureData.class, null);
    9494    this.arrayDesign = arrayDesign;
    9595    this.arrayDesignData = arrayDesign.getData();
    9696    this.isAffy = arrayDesign.isAffyChip();
     97    setDbControl(dc);
    9798  }
    9899
  • branches/webservices/src/core/net/sf/basedb/core/FilterBatcher.java

    r3695 r3773  
    142142  FilterBatcher(DbControl dc, BioAssaySet bioAssaySet)
    143143  {
    144     super(dc);
     144    super();
    145145    this.bioAssaySet = bioAssaySet;
    146146    this.bytesPerRow = VirtualTable.FILTER.getBytesPerRow(bioAssaySet.getRawDataType());
     147    setDbControl(dc);
    147148  }
    148149
  • branches/webservices/src/core/net/sf/basedb/core/MappingBatcher.java

    r3695 r3773  
    106106  MappingBatcher(DbControl dc, DataCube dataCube)
    107107  {
    108     super(dc);
     108    super();
    109109    this.dataCube = dataCube;
    110110    this.noRawMapping = dataCube.isInDatabase();
    111111    this.bytesPerRow = VirtualTable.RAWPARENTS.getBytesPerRow(dataCube.getRawDataType());
     112    setDbControl(dc);
    112113  }
    113114
  • branches/webservices/src/core/net/sf/basedb/core/Operator.java

    r3695 r3773  
    126126      return Restrictions.like(lvalue, rvalue);
    127127    }
     128  },
     129 
     130  NOTLIKE(11, "NOT LIKE", "NOT LIKE", true)
     131  {
     132    public Restriction getRestriction(Expression lvalue, Expression rvalue)
     133      throws InvalidDataException
     134    {
     135      return Restrictions.not(Restrictions.like(lvalue, rvalue));
     136    }
    128137  };
    129138
  • branches/webservices/src/core/net/sf/basedb/core/PluginConfiguration.java

    r3695 r3773  
    467467
    468468    int newVersion = getNewParameterVersion();
     469    int copyFromVersion = copyFrom.getParameterVersion();
    469470    try
    470471    {
    471472      for (Map.Entry<VersionedParameter, ParameterValueData<?>> fromEntry : from.entrySet())
    472473      {
    473         VersionedParameter toName = new VersionedParameter(fromEntry.getKey().getName(), newVersion);
    474         ParameterValueData<?> fromParameter = fromEntry.getValue();
    475         Class<? extends ParameterValueData> dataClass = fromParameter.getClass();
    476         if (org.hibernate.proxy.HibernateProxy.class.isAssignableFrom(dataClass))
     474        VersionedParameter fromName = fromEntry.getKey();
     475        if (copyFromVersion == fromName.getVersion())
    477476        {
    478           // The 'fromParameter' is a proxy, we need the real data class
    479           dataClass =
    480             (Class<? extends ParameterValueData>)org.hibernate.Hibernate.getClass(fromParameter);
     477          VersionedParameter toName = new VersionedParameter(fromName.getName(), newVersion);
     478          ParameterValueData<?> fromParameter = fromEntry.getValue();
     479          Class<? extends ParameterValueData> dataClass = fromParameter.getClass();
     480          if (org.hibernate.proxy.HibernateProxy.class.isAssignableFrom(dataClass))
     481          {
     482            // The 'fromParameter' is a proxy, we need the real data class
     483            dataClass =
     484              (Class<? extends ParameterValueData>)org.hibernate.Hibernate.getClass(fromParameter);
     485          }
     486          ParameterValueData<?> toParameter = dataClass.newInstance();
     487          toParameter.setLabel(fromParameter.getLabel());
     488          toParameter.setDescription(fromParameter.getDescription());
     489          toParameter.replaceValues(fromParameter.getValues());
     490          to.put(toName, toParameter);
    481491        }
    482         ParameterValueData<?> toParameter = dataClass.newInstance();
    483         toParameter.setLabel(fromParameter.getLabel());
    484         toParameter.setDescription(fromParameter.getDescription());
    485         toParameter.replaceValues(fromParameter.getValues());
    486         to.put(toName, toParameter);
    487492      }
    488493    }
  • branches/webservices/src/core/net/sf/basedb/core/PositionBatcher.java

    r3695 r3773  
    106106  PositionBatcher(DbControl dc, DataCube dataCube)
    107107  {
    108     super(dc);
     108    super();
    109109    this.dataCube = dataCube;
    110110    this.bytesPerRow = VirtualTable.POSITION.getBytesPerRow(dataCube.getRawDataType());
     111    setDbControl(dc);
    111112  }
    112113
  • branches/webservices/src/core/net/sf/basedb/core/PositionExtraValueBatcher.java

    r3695 r3773  
    154154  PositionExtraValueBatcher(DbControl dc, ExtraValue extraValue)
    155155  {
    156     super(dc);
     156    super();
    157157    this.extraValue = extraValue;
    158158    this.bytesPerRow = extraValue.getVirtualTable().getBytesPerRow(extraValue.getRawDataType());
    159159    this.valueType = extraValue.getExtraValueType().getValueType();
    160160    this.sqlType = valueType.getSQLType();
     161    setDbControl(dc);
    161162  }
    162163
  • branches/webservices/src/core/net/sf/basedb/core/RawBioAssay.java

    r3695 r3773  
    291291  {
    292292    super.onBeforeCommit(action);
    293     if (action == Transactional.Action.DELETE && getSpots() > 0)
    294     {
    295       RawDataBatcher rdb = RawDataBatcher.getNew(getDbControl(), this);
    296       rdb.deleteAll();
     293    if (action == Transactional.Action.DELETE)
     294    {
     295      if (getRawDataType().isStoredInDb() && getSpots() > 0)
     296      {
     297        RawDataBatcher rdb = RawDataBatcher.getNew(getDbControl(), this);
     298        rdb.deleteAll();
     299      }
    297300    }
    298301  }
  • branches/webservices/src/core/net/sf/basedb/core/RawDataBatcher.java

    r3695 r3773  
    161161    throws BaseException
    162162  {
    163     super(dc, RawData.class, rawBioAssay.getRawDataType().getEntityName());
     163    super(dc.getHibernateSession(), RawData.class, rawBioAssay.getRawDataType().getEntityName());
    164164    this.rawBioAssay = rawBioAssay;
    165165    this.rawBioAssayData = rawBioAssay.getData();
     
    205205      this.preloaded = null;
    206206    }
     207    setDbControl(dc);
    207208  }
    208209
  • branches/webservices/src/core/net/sf/basedb/core/ReporterBatcher.java

    r3695 r3773  
    7777    throws BaseException
    7878  {
    79     super(dc, ReporterData.class, null);
     79    super(dc.getHibernateSession(), ReporterData.class, null);
    8080    extendedProperties = ExtendedProperties.getProperties("ReporterData");
    8181    batchedExternalIds = HibernateUtil.getDbEngine().caseInsensitiveComparison() ?
    8282      new TreeSet<String>(String.CASE_INSENSITIVE_ORDER) : new HashSet<String>();
     83    setDbControl(dc);
    8384  }
    8485
  • branches/webservices/src/core/net/sf/basedb/core/SpotBatcher.java

    r3695 r3773  
    141141  SpotBatcher(DbControl dc, BioAssaySet bioAssaySet)
    142142  {
    143     super(dc);
     143    super();
    144144    this.bioAssaySet = bioAssaySet;
    145145    this.numChannels = bioAssaySet.getRawDataType().getChannels();
    146146    this.bytesPerRow = VirtualTable.SPOT.getBytesPerRow(bioAssaySet.getRawDataType());
     147    setDbControl(dc);
    147148  }
    148149
  • branches/webservices/src/core/net/sf/basedb/core/SpotExtraValueBatcher.java

    r3695 r3773  
    144144  SpotExtraValueBatcher(DbControl dc, ExtraValue extraValue)
    145145  {
    146     super(dc);
     146    super();
    147147    this.extraValue = extraValue;
    148148    this.bytesPerRow = extraValue.getVirtualTable().getBytesPerRow(extraValue.getRawDataType());
    149149    this.valueType = extraValue.getExtraValueType().getValueType();
    150150    this.sqlType = valueType.getSQLType();
     151    setDbControl(dc);
    151152  }
    152153
  • branches/webservices/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java

    r3724 r3773  
    4444import net.sf.basedb.core.Include;
    4545import net.sf.basedb.core.IntegerParameterType;
    46 import net.sf.basedb.core.InvalidDataException;
    4746import net.sf.basedb.core.Item;
    4847import net.sf.basedb.core.ItemNotFoundException;
     
    5655import net.sf.basedb.core.PositionBatcher;
    5756import net.sf.basedb.core.ProgressReporter;
     57import net.sf.basedb.core.Reporter;
    5858import net.sf.basedb.core.RequestInformation;
    5959import net.sf.basedb.core.SpotBatcher;
     
    6363import net.sf.basedb.core.Type;
    6464import net.sf.basedb.core.User;
     65import net.sf.basedb.core.data.ReporterData;
    6566import net.sf.basedb.core.plugin.About;
    6667import net.sf.basedb.core.plugin.AboutImpl;
     
    109110import java.util.Set;
    110111import java.util.TreeMap;
    111 import java.util.regex.Matcher;
    112112import java.util.regex.Pattern;
    113113
     
    138138 
    139139  /**
    140     The plug-ing permissions.
     140    The plug-in permissions.
    141141  */
    142142  private static final Set<Permissions> permissions = new HashSet<Permissions>();
     
    207207 
    208208  /**
    209     The reporter fields that should be exported as a tab separeated string
     209    The reporter fields that should be exported as a tab separated string
    210210    of column headers.
    211211  */
     
    214214  /**
    215215    The spot fields that should be exported as a tab separated string of
    216     column headres.
     216    column headers.
    217217  */
    218218  private PluginParameter<String> usedFieldsParameter;
     
    265265  private int pluginDirectoryId = -1;
    266266
    267   /* From InteractivePlugin iterface*/
     267  /* From InteractivePlugin interface*/
    268268
    269269  /**
     
    273273    @param context The context from where the plugin is invoked.
    274274    @param item The item that should be checked if it is in context.
    275     @return null if the the item is in context, otherwise an error messge.
     275    @return null if the the item is in context, otherwise an error message.
    276276    @see net.sf.basedb.core.plugin.AbstractAnalysisPlugin#isInContext(net.sf.basedb.core.plugin.GuiContext, java.lang.Object)
    277277  */
     
    407407        storeValue(configuration, request, usedFieldsParameter);
    408408        storeValue(configuration, request, jobParametersParameter);
    409         // test the xml in the jobParameters parameres
     409        // test the xml in the jobParameters parameters
    410410        try
    411411        {
     
    448448 
    449449  /**
    450     Copies the content from a File to a directory on the filesystem.
     450    Copies the content from a File to a directory on the file system.
    451451   
    452452    @param f The file to be copied.
     
    483483        // Load existing...
    484484        jobDirectory = Directory.getByPath(dc, path);
    485         // ...and remove files and subdirectories in it
     485        // ...and remove files and sub directories in it
    486486        emptyDir(dc, path);
    487487      }
     
    503503 
    504504  /**
    505     Deletes all files and subdirectories under dir.
     505    Deletes all files and sub directories under dir.
    506506   
    507507    @param dir
    508     @return Returnes true if all deletions were succssful
     508    @return true if all deletions were successful
    509509  */
    510510  private boolean deleteDir(java.io.File dir)
     
    527527 
    528528  /**
    529     Deletes all files and subdirectories under dir. The directory given
     529    Deletes all files and sub directories under dir. The directory given
    530530    itself is not deleted.
    531531   
    532532    @param dc
    533533    @param dir
    534     @return Returnes true if all deletions were succssful
     534    @return true if all deletions were successful
    535535  */
    536536  private boolean emptyDir(DbControl dc, Path dir)
     
    567567      permissions.add(new Permissions(Item.PLUGINCONFIGURATION, EnumSet.of(Permission.WRITE), null));
    568568      permissions.add(new Permissions(Item.RAWBIOASSAY, null, EnumSet.of(Permission.READ)));
    569       permissions.add(new Permissions(Item.EXTRAVALUETYPE, null, EnumSet.of(Permission.READ)));
     569      permissions.add(new Permissions(Item.REPORTER, null, EnumSet.of(Permission.READ)));
     570      permissions.add(new Permissions(Item.EXTRAVALUETYPE, null, EnumSet.of(Permission.CREATE, Permission.USE)));
    570571      permissions.add(new Permissions(Item.USER, null, EnumSet.of(Permission.READ)));
    571572      permissions.add(new Permissions(Item.JOB, null, EnumSet.of(Permission.READ)));
     
    605606    {
    606607      DbControl dc = null;
     608      File stdin = null;
     609      File stdout = null;
     610      Transformation trans = null;
    607611      try
    608612      {
     
    611615        getConfigureJobParameters();
    612616 
    613         Transformation trans = null;
    614         File stdin = null;
    615617       
    616618        //Export
     
    653655          int exitValue = p.waitFor();
    654656
     657          progress.display(50, "Reading from error stream.");
    655658          for(int i = 0; errorStream.isAlive(); ++i)
    656659          {
     
    681684        {
    682685          //Copy files
    683           dc.deleteItem(stdin);
     686          progress.display(60, "Copying files to server.");
    684687          importFiles(dc, trans);
    685688          if (!deleteDir(getExecDirectory()))
     
    687690            response.setError("Could not remove execution directory: "+getExecDirectory().getAbsolutePath(), null);
    688691          }
    689         }
    690              
     692          stdout = File.getFile(dc, getPluginDirectory(dc), "stdout.txt", true);
     693        }
     694       
    691695        //Import data
    692696        try
    693697        {
    694698          progress.display(70, "Importing data from plugin.");
    695           importData(dc, trans);
     699          importData(dc, stdout, trans);
    696700          response.setDone(msg);
    697701        }
     
    700704          response.setError(ex.getMessage(), Arrays.asList(ex));
    701705          return;
     706        }
     707      }
     708      finally
     709      {
     710        if (dc != null)
     711        {
     712          dc.commit();
     713          dc.close();
     714        }
     715      }
     716     
     717      //Clean up
     718      try
     719      {
     720        dc = sc.newDbControl();
     721        if (!Values.getBoolean(String.valueOf(configuration.getValue(leaveStdinParameter.getName()))))
     722        {
     723          if (stdin != null)
     724          {
     725            stdin = File.getById(dc, stdin.getId());
     726            if (trans != null)
     727            {
     728              trans = Transformation.getById(dc, trans.getId());
     729              AnyToAny ata = AnyToAny.getByName(dc, trans, stdin.getPath().toString());
     730              dc.deleteItem(ata);
     731            }
     732            dc.deleteItem(stdin);
     733          }
     734        }
     735        if (!Values.getBoolean(String.valueOf(configuration.getValue(leaveStdoutParameter.getName()))))
     736        {
     737          if (stdout != null)
     738          {
     739            stdout = File.getById(dc, stdout.getId());
     740            if (trans != null)
     741            {
     742              trans = Transformation.getById(dc, trans.getId());
     743              AnyToAny ata = AnyToAny.getByName(dc, trans, stdout.getPath().toString());
     744              dc.deleteItem(ata);
     745            }
     746            dc.deleteItem(stdout);
     747          }
    702748        }
    703749      }
     
    801847    Map<String, String> names = new HashMap<String, String>();
    802848   
    803     names.put("reporter", "rep.id");
    804     names.put("reporterId", "rep.externalId");
    805    
    806849    ItemQuery<Formula> queryFormula = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION,
    807850      bas.getRawDataType());
     
    812855      names.put(f.getName(), "frm."+f.getId());
    813856    }
     857   
     858    names.put("lastUpdate", "rep.lastUpdate");
     859    names.put("geneName", "rep.name");
     860    names.put("position", "rep.position");
     861    names.put("reporter", "rep.id");
     862    names.put("reporterId", "rep.externalId");
     863    names.put("geneSymbol", "rep.symbol");
     864   
     865    names.put("rawPosition", "raw.position");
     866    names.put("block", "raw.block");
     867    names.put("numCol", "raw.col");
     868    names.put("numRow", "raw.row");
     869    names.put("x", "raw.x");
     870    names.put("y", "raw.y");
    814871   
    815872    for (ExtraValue ev : bas.getExtraValues().list(dc))
     
    11191176 
    11201177  /**
    1121     Get the exec directory as a java.io.File. The exec directory is a sudirectory in
     1178    Get the exec directory as a java.io.File. The exec directory is a sub directory in
    11221179    "java.io.tmpdir".
    11231180   
     
    12451302   
    12461303    @return The id of the transformation the data is connected to.
    1247     @throws IOException if there is any error reading from stdou.txt
    1248   */
    1249   private int importData(DbControl dc, Transformation t)
     1304    @throws IOException if there is any error reading from stdout.txt
     1305  */
     1306  private int importData(DbControl dc, File stdout, Transformation t)
    12501307    throws IOException
    12511308  {
    12521309    BioAssaySet bas = null;
    12531310    SpotBatcher spotBatcher = null;
    1254     PositionBatcher posBatcher = null;
    12551311
    12561312    HashMap<String, BioAssay> idMap = new HashMap<String, BioAssay>();
    1257     HashMap<Integer, Integer> posMap = new HashMap<Integer, Integer>();
     1313    HashMap<Integer, ReporterData> posRepMap = new HashMap<Integer, ReporterData>();
    12581314    HashMap<String, ExtraValueType> evtMap = new HashMap<String, ExtraValueType>();
    12591315
    1260     File stdout = File.getFile(dc, getPluginDirectory(dc), "stdout.txt", true);
    12611316    FlatFileParser ffp = getInitializedFlatFileParser(stdout.getDownloadStream(0));
    12621317   
     
    13251380        }
    13261381        spotBatcher = bas.getSpotBatcher();
    1327 //        posBatcher = bas.getPositionBatcher();
    13281382
    13291383        for (String assayId : assays)
     
    14531507              spotBatcher.insert(ba.getDataCubeColumnNo(), position, intensities);
    14541508             
    1455 //              if (posMap.containsKey(position))
    1456 //              {
    1457 //                if (!posMap.get(position).equals(reporter))
    1458 //                  throw new BaseException("Invalid data. Position, "+position+", occures twice with different reporter data.");
    1459 //               
    1460 //              }
    1461 //              else
    1462 //              {
    1463 //                posMap.put(position, reporter);
    1464 //                posBatcher.insert(position, Reporter.getById(dc, reporter));
    1465 //              }
     1509              if (posRepMap.containsKey(position))
     1510              {
     1511                if (!reporter.equals(posRepMap.get(position).getId()))
     1512                  throw new BaseException("Invalid data. Position, "+position+", occurs twice with different reporter data.");
     1513              }
     1514              else
     1515              {
     1516                posRepMap.put(position, Reporter.getById(dc, reporter));
     1517              }
     1518             
    14661519              for (int i = 0; i < evBatcher.size(); i++)
    14671520              {
     
    14821535      }
    14831536    }
     1537
     1538    //Batch reporters
     1539    if (bas != null)
     1540    {
     1541      PositionBatcher posBatcher = bas.getPositionBatcher();
     1542      for (Integer position : posRepMap.keySet())
     1543      {
     1544        posBatcher.insert(position, posRepMap.get(position));
     1545      }
     1546    }
     1547   
    14841548    // save bas
    14851549    if (bas != null)
     
    15621626 
    15631627  /**
    1564     This thread read everything from one input streat ant writes everything to an output stream.
     1628    This thread read everything from one input stream ant writes everything to an output stream.
    15651629   
    15661630    @author Johan Enell
     
    15801644
    15811645    /**
    1582       Creates a steam handler connected to the specifiv streams.
     1646      Creates a steam handler connected to the specific streams.
    15831647     
    15841648      @param is The stream to read from.
  • branches/webservices/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java

    r3695 r3773  
    778778      ExtraValueType evt = ev.getExtraValueType();
    779779      items.add(new QueryItem("xtra."+evt.getExternalId(), "[Extra] "+evt.getName(),
    780         evt.getName(), "xtra('" + evt.getExternalId() + "')", evt.getAverageMethod()));
     780        "_xc_"+evt.getName(), "xtra('" + evt.getExternalId() + "')", evt.getAverageMethod()));
    781781    }
    782782    Collections.sort(items, new QueryItemTitleComparator());
     
    815815  {
    816816    List<QueryItem> items = new ArrayList<QueryItem>();
    817     items.add(new QueryItem("raw.position", "[Raw] Position", "position", "raw('position')", Formula.AverageMethod.NONE));
     817    items.add(new QueryItem("raw.position", "[Raw] Position", "rawPosition", "raw('position')", Formula.AverageMethod.NONE));
    818818    items.add(new QueryItem("raw.block", "[Raw] Array block", "block", "raw('block')", Formula.AverageMethod.NONE));
    819819    items.add(new QueryItem("raw.metaGridX", "[Raw] Meta grid X", "metaGridX", "raw('metaGridX')", Formula.AverageMethod.NONE));
     
    838838    items.add(new QueryItem("rep.position", "Position", "position", "pos()", Formula.AverageMethod.NONE));
    839839    items.add(new QueryItem("rep.name", "Reporter Name", "name", "rep('name')", Formula.AverageMethod.MAX));
    840     items.add(new QueryItem("rep.externalId", "Reporter ID", "externalId", "rep('externalId')", Formula.AverageMethod.MAX));
     840    items.add(new QueryItem("rep.externalId", "Reporter ID", "reporterId", "rep('externalId')", Formula.AverageMethod.MAX));
    841841    items.add(new QueryItem("rep.symbol", "Gene symbol", "symbol", "rep('symbol')", Formula.AverageMethod.MAX));
    842842    items.add(new QueryItem("rep.description", "Description", "description", "rep('description')", Formula.AverageMethod.MAX));
  • branches/webservices/src/plugins/core/net/sf/basedb/plugins/FormulaFilter.java

    r3695 r3773  
    123123  }
    124124  /**
    125     Request use access to Experiment:s and read access to Job:s.
     125    Request use access to Experiment:s and read access to Job:s and ReporterLists.
    126126  */
    127127  public Collection<Permissions> getPermissions()
     
    131131      permissions.add(new Permissions(Item.EXPERIMENT, null, EnumSet.of(Permission.USE)));
    132132      permissions.add(new Permissions(Item.JOB, null, EnumSet.of(Permission.READ)));
     133      permissions.add(new Permissions(Item.REPORTERLIST, null, EnumSet.of(Permission.READ)));
    133134    }
    134135    return permissions;
  • branches/webservices/www/admin/jobagents/view_agent.jsp

    r3695 r3773  
    341341          {
    342342            PluginDefinition plugin = null;
     343            NameablePluginAdaptor nameableProxy = null;
    343344            boolean readPlugin = true;
    344345            try
    345346            {
    346347              plugin = settings.getPluginDefinition();
     348              nameableProxy = new NameablePluginAdaptor(plugin);
    347349            }
    348350            catch (PermissionDeniedException ex)
     
    354356            %>
    355357            <tbl:row>
    356               <tbl:cell column="plugin"><%=Base.getLinkedName(ID, new NameablePluginAdaptor(plugin), !readPlugin, true)%></tbl:cell>
     358              <tbl:cell column="plugin"><%=Base.getLinkedName(ID, nameableProxy, !readPlugin, true)%></tbl:cell>
    357359              <tbl:cell column="jarPath"><%=jarPath == null ? "<i>- internal -</i>" : HTML.encodeTags(jarPath)%></tbl:cell>
    358360              <tbl:cell column="trusted"><%=settings.isEffectivelyTrusted()%></tbl:cell>
  • branches/webservices/www/admin/pluginconfigurations/list_configurations.jsp

    r3695 r3773  
    429429              PluginConfiguration item = configurations.next();
    430430              PluginDefinition plugin = null;
     431              Nameable nameableProxy = null;
    431432              contexts.clear();
    432433              try
    433434              {
    434435                plugin = item.getPluginDefinition();
     436                nameableProxy = new NameablePluginAdaptor(plugin);
    435437                contexts.addAll(plugin.getGuiContexts());
    436438              }
     
    490492                <tbl:cell column="pluginType"><%=plugin == null ? "<i>- denied -</i>" : plugin.getMainType().toString()%></tbl:cell>
    491493                <tbl:cell column="contexts"><%=plugin == null ? "<i>- denied -</i>" : (contexts.isEmpty() ? "<i>- none -</i>" : Values.getString(contexts, ", ", true))%></tbl:cell>
    492                 <tbl:cell column="pluginDefinition"><%=mode.hasPropertyLink() ? Base.getLinkedName(ID, new NameablePluginAdaptor(plugin), plugin == null, mode.hasEditLink()): Base.getEncodedName(new NameablePluginAdaptor(plugin), plugin == null)%></a></tbl:cell>
     494                <tbl:cell column="pluginDefinition"><%=mode.hasPropertyLink() ? Base.getLinkedName(ID, nameableProxy, plugin == null, mode.hasEditLink()): Base.getEncodedName(nameableProxy, plugin == null)%></a></tbl:cell>
    493495                <tbl:cell column="owner"
    494496                  ><base:propertyvalue
  • branches/webservices/www/admin/pluginconfigurations/view_configuration.jsp

    r3695 r3773  
    9797  final Set<GuiContext> contexts = new TreeSet<GuiContext>(new ToStringComparator<GuiContext>(false));
    9898  PluginDefinition plugin = null;
     99  Nameable nameableProxy = null;
    99100  boolean readPlugin = true;
    100101  boolean configurable = false;
     
    102103  {
    103104    plugin = configuration.getPluginDefinition();
     105    nameableProxy = new NameablePluginAdaptor(plugin);
    104106    contexts.addAll(plugin.getGuiContexts());
    105107    configurable = plugin.isInteractive() && plugin.supportsConfigurations();
     
    265267        <td class="prompt">Plugin</td>
    266268        <td>
    267           <%=Base.getLinkedName(ID, new NameablePluginAdaptor(plugin), plugin == null, true)%>
     269          <%=Base.getLinkedName(ID, nameableProxy, plugin == null, true)%>
    268270        </td>
    269271      </tr>
  • branches/webservices/www/common/import/no_fileformat.jsp

    r3695 r3773  
    7171  "mainType", Operator.EQ, String.valueOf(Plugin.MainType.IMPORT.getValue()), Type.INT));
    7272pluginContext.setPropertyFilter(new PropertyFilter(
    73   "guiContexts.itemType", Operator.EQ, String.valueOf(itemType.getValue()), Type.INT));
     73  "$ctx.itemType", Operator.EQ, String.valueOf(itemType.getValue()), Type.INT));
    7474try
    7575{
  • branches/webservices/www/exception/exception.jsp

    r3724 r3773  
    204204    StackTraceElement[] st = ex.getStackTrace();
    205205    out.println("<pre>");
     206    out.println(exceptionClassName);
    206207    int i = 0;
    207208    for (i=0; i < st.length && i < 8; i++)
    208209    {
    209210      out.print("...at ");
    210       out.println(st[i].toString().replaceAll("net.sf.basedb.core.", ""));
     211      out.println(HTML.encodeTags(st[i].toString().replaceAll("net.sf.basedb.core.", "")));
    211212    }
    212213    out.println("</pre>");
     
    219220        {
    220221          out.print("...at ");
    221           out.println(st[j].toString().replaceAll("net.sf.basedb.core.", ""));
     222          out.println(HTML.encodeTags(st[j].toString().replaceAll("net.sf.basedb.core.", "")));
    222223        }
    223224        ex = ex.getCause();
  • branches/webservices/www/lims/arraydesigns/features/index.jsp

    r3695 r3773  
    3535  import="net.sf.basedb.core.Permission"
    3636  import="net.sf.basedb.core.PermissionDeniedException"
     37  import="net.sf.basedb.core.ArrayDesign"
     38  import="net.sf.basedb.core.data.FeatureData"
    3739  import="net.sf.basedb.clients.web.Base"
    3840  import="net.sf.basedb.clients.web.WebException"
     
    8991    forward = viewPage;
    9092  }
     93  else if ("ExportItems".equals(cmd))
     94  {
     95    // Run an export plugin in a list context
     96    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     97    dc = sc.newDbControl();   
     98    final ArrayDesign arrayDesign = ArrayDesign.getById(dc, arrayDesignId);
     99    final DataQuery<FeatureData> query = arrayDesign.getFeatures();
     100    cc.configureQuery(query, true);
     101    cc.setQuery(query);
     102    redirect = "../../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+features+of+array+design";
     103  }
    91104  else
    92105  {
Note: See TracChangeset for help on using the changeset viewer.