Changeset 4095


Ignore:
Timestamp:
Jan 21, 2008, 5:10:00 PM (15 years ago)
Author:
Johan Enell
Message:

Merged patch release 2.5.1 to the trunk. Delta 2.5 - 2.5.1

Location:
trunk
Files:
27 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r4094 r4095  
    6161
    6262    Packaging:
    63     package:          Create *.tar.gz files with binary, source and example distributions
     63    package:          Create *.tar.gz files with binary, source and exampele distributions
    6464    package.bin       Create binary distribution only
    6565    package.src       Create source distribution only
     
    772772  <target
    773773    name="examples.webservices"
    774     depends="examples.webservices.compile,webservices.jar"
     774    depends="examples.webservices.compile,webservices.jar,webservices.wsdl"
    775775    description="Put together the webservices examples in the examples/webservices directory"
    776776    >
     
    880880  <target
    881881    name="web.compile"
    882     depends="web.init,core.compile"
     882    depends="web.init,core.compile,coreplugins.compile"
    883883    description="Compile the web client application"
    884884    >
     
    966966  <target
    967967    name="webservices.init"
    968     depends="core.init,coreplugins.init"
     968    depends="core.init,coreplugins.init,web.init"
    969969    >
    970970    <property name="webservices.src" location="${src}/webservices"
     
    10241024    name="webservices.server.compile"
    10251025    description="Compile the server part of webservices"
    1026     depends="webservices.init,core.compile,coreplugins.compile"
     1026    depends="webservices.init,core.compile,coreplugins.compile,web.compile"
    10271027    >
    10281028    <mkdir dir="${webservices.build}/server" />
  • trunk/src/clients/web/net/sf/basedb/clients/web/fileupload/FileUpload.java

    r4093 r4095  
    774774      throws IOException
    775775    {
    776       if (status.eof || status.atBoundary) return -1;
     776      int available = end - start;
     777      if (available == 0)
     778      {
     779        if (status.eof || status.atBoundary) return -1;
     780        available = readMoreData();
     781      }
    777782      int result = -1;
    778       int available = end - start;
    779       if (available == 0) available = readMoreData();
    780783      if (available > 0)
    781784      {
    782         result = buffer[start];
     785        // Important! Mask with 0xff to get values in range (0,255), NOT (-128,127)
     786        result = buffer[start] & 0xff;
    783787        start++;
    784788      }
  • trunk/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java

    r4093 r4095  
    468468    template.writeHeaders();
    469469   
    470     int numExported = 0;
     470    long numExported = 0;
    471471    ResultIterator result = null;
    472472    try
     
    506506          if (progress != null)
    507507          {
    508             int percent = (int)(100f * numExported / totalItems);
     508            int percent = (int)(100L * numExported / totalItems);
    509509            progress.display(percent, numExported + " of " + totalItems + " done.");
    510510          }
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Page.java

    r4093 r4095  
    278278    throws JspException
    279279  {
    280     StringBuilder sb = new StringBuilder();
    281     sb.append("</html>\n");
    282     try
    283     {
    284       pageContext.getOut().print(sb.toString());
    285     }
    286     catch (Exception ex)
    287     {
    288       throw new JspTagException(ex.getMessage());
     280    if (type != PAGE_TYPE_INCLUDE)
     281    {
     282      StringBuilder sb = new StringBuilder();
     283      sb.append("</html>\n");
     284      try
     285      {
     286        pageContext.getOut().print(sb.toString());
     287      }
     288      catch (Exception ex)
     289      {
     290        throw new JspTagException(ex.getMessage());
     291      }
    289292    }
    290293    return EVAL_PAGE;
  • trunk/src/core/common-queries.xml

    r4093 r4095  
    524524      SELECT s
    525525      FROM net.sf.basedb.core.data.MimeTypeData s
    526       WHERE s.extension = :extension
     526      WHERE LOWER(s.extension) = LOWER(:extension)
    527527    </sql>
    528528    <description>
  • trunk/src/core/net/sf/basedb/core/Affymetrix.java

    r4093 r4095  
    357357      if (hasProgress && (index % progressInterval == 0))
    358358      {
    359         int percent = 5 + 90 * index / numProbesets;
     359        int percent = 5 + (int)(90L * (long)index / numProbesets);
    360360        int remain = numProbesets - index;
    361361        String created = create ? "; " + numCreated + " created" : "";
  • trunk/src/core/net/sf/basedb/core/Job.java

    r4093 r4095  
    12791279    private long lastUpdate;
    12801280   
     1281    private int lastValue;
     1282    private int offset;
     1283   
    12811284    ProgressReporterImpl(Job job, String server, ProgressReporter chained)
    12821285      throws BaseException
     
    12881291      this.chained = chained;
    12891292      this.lastUpdate = 0;
     1293      this.lastValue = 0;
     1294      this.offset = 0;
    12901295    }
    12911296   
     
    12991304      if (System.currentTimeMillis() - lastUpdate > UPDATE_INTERVAL || percent == 100)
    13001305      {
     1306        // If the percent is negative and less then the last value, an offset will be calculated.
     1307        // This will adjust the percent to a realistic value.
     1308        //Notice: It is only possible to give a value close to what expected.
     1309        if (percent < lastValue && percent < 0)
     1310        {
     1311          if (Math.abs(percent) < Math.abs(lastValue))
     1312          {
     1313            offset = offset + 2*Math.abs(lastValue);
     1314          }
     1315          else
     1316          {
     1317            offset = offset + 2*Math.abs(percent);
     1318          }
     1319        }
     1320        lastValue = percent;   
     1321        percent = percent + offset;
     1322       
    13011323        lastUpdate = System.currentTimeMillis();
    13021324        DbControl dc = null;
  • trunk/src/core/net/sf/basedb/core/RawBioAssay.java

    r4093 r4095  
    11641164
    11651165      DataResultIterator<RawData> result = rawQuery.iterate(dc);
    1166       int numValidated = 0;
     1166      long numValidated = 0;
    11671167      int numTotal = getNumDbSpots();
    11681168      while (result.hasNext())
     
    12211221        if (progress != null && numValidated % 100 == 0)
    12221222        {
    1223           int percent = 10 + (90 * numValidated) / numTotal;
     1223          int percent = 10 + ((int)(90L * numValidated) / numTotal);
    12241224          progress.display(percent, "Validated " + numValidated + " of " + numTotal + " spots.");
    12251225        }
  • trunk/src/core/net/sf/basedb/core/SpotImages.java

    r4093 r4095  
    472472          if (progress != null)
    473473          {
    474             int spotsDone = spotImagesPerImage*imageNumber;
    475             int percent = 10 + 90 * spotsDone / totalSpots;
     474            long spotsDone = spotImagesPerImage*imageNumber;
     475            int percent = 10 + (int)(90L * spotsDone / totalSpots);
    476476            progress.display(percent, "Generating spot images ("+spotsDone+" done)...");
    477477          }
  • trunk/src/core/net/sf/basedb/util/BioAssaySetFilterUtil.java

    r4093 r4095  
    123123    }
    124124   
    125     int spotsDone = 0;
     125    long spotsDone = 0;
    126126    int spotsAfter = 0;
    127127    if (progress != null) progress.display(10, "Filtering spots (0 done; "+spotsTotal+" total)...");
     
    139139      if (progress != null)
    140140      {
    141         int percent = 10 + 90 * spotsDone / spotsTotal;
     141        int percent = 10 + (int)(90L * spotsDone / spotsTotal);
    142142        progress.display(percent,
    143143          "Filtering spot intensities ("+spotsDone+" done; "+spotsTotal+" total)...");
     
    205205    // Prepare progress reporting
    206206    int interval = 10;  // Update progress after this many spots >= 10
    207     int spotsDone = 0;
     207    long spotsDone = 0;
    208208    int spotsAfter = 0;
    209209    if (progress != null)
     
    236236            if (spotsDone % interval == 0)
    237237            {
    238               int percent = 10 + 90 * spotsDone / spotsTotal;
     238              int percent = 10 + (int)(90L * spotsDone / spotsTotal);
    239239              progress.display(percent,
    240240                "Filtering spot intensities ("+spotsDone+" done; "+spotsTotal+" total)...");
  • trunk/src/core/net/sf/basedb/util/IntensityCalculatorUtil.java

    r4093 r4095  
    305305    int maxPosition = 0;
    306306   
    307     int spotsDone = 0; // Number of calculated spots
     307    long spotsDone = 0; // Number of calculated spots
    308308    int totalSpots = 0; // Total number of spots
    309309    int interval = 0; // Interval between reporter to the progress reporter
     
    426426          if (spotsDone % interval == 0)
    427427          {
    428             int percent = 10 + 90 * spotsDone / totalSpots;
     428            int percent = 10 + (int)((90L * spotsDone) / totalSpots);
    429429            progress.display(percent, "Calculating spot intensities ("+spotsDone+" done)...");
    430430          }
  • trunk/src/core/net/sf/basedb/util/parser/FlatFileParser.java

    r4093 r4095  
    4747import net.sf.basedb.core.BaseException;
    4848import net.sf.basedb.core.Config;
     49import net.sf.basedb.util.InputStreamTracker;
    4950
    5051/**
     
    176177
    177178  /**
     179    For keeping track of the number of bytes parsed.
     180  */
     181  private InputStreamTracker tracker;
     182 
     183  /**
    178184    The regular expression for matching a header line.
    179185  */
     
    522528  {
    523529    Charset cs = Charset.forName(charsetName == null ? Config.getCharset() : charsetName);
    524     this.reader = new BufferedReader(new InputStreamReader(in, cs));
     530    this.tracker = new InputStreamTracker(in);
     531    this.reader = new BufferedReader(new InputStreamReader(tracker, cs));
    525532  }
    526533
     
    11161123    correspond to the number of parsed bytes depending on the character
    11171124    set of the file.
     1125    @see #getParsedBytes()
    11181126  */
    11191127  public long getParsedCharacters()
    11201128  {
    11211129    return parsedCharacters;
     1130  }
     1131 
     1132  /**
     1133    Get the number of parsed bytes so far. This value may or may not
     1134    correspond to the number of parsed characters depending on the character
     1135    set of the file.
     1136    @since 2.5.1
     1137    @see #getParsedCharacters()
     1138  */
     1139  public long getParsedBytes()
     1140  {
     1141    return tracker == null ? 0 : tracker.getNumRead();
    11221142  }
    11231143 
  • trunk/src/core/net/sf/basedb/util/zip/TarFilePacker.java

    r4093 r4095  
    9797    if (lastModified > 0) entry.setModTime(lastModified);
    9898    entry.setSize(size);
    99     tar.putNextEntry(entry);
     99    TarUtil.putNextEntry(entry, tar);
    100100    if (!isDirectory) FileUtil.copy(in, tar);
    101101    tar.closeEntry();
  • trunk/src/plugins/core/net/sf/basedb/plugins/AbstractFlatFileImporter.java

    r4093 r4095  
    542542        if (section != null && section.type() == FlatFileParser.LineType.SECTION)
    543543        {
    544           if (progress != null) progress.display(getProgress(ffp.getParsedCharacters()), "Parsing section "+section.name()+"...");
     544          if (progress != null) progress.display(getProgress(ffp), "Parsing section "+section.name()+"...");
    545545          try
    546546          {
     
    571571        else
    572572        {
    573           if (progress != null) progress.display(getProgress(ffp.getParsedCharacters()), "Parsing headers...");
     573          if (progress != null) progress.display(getProgress(ffp), "Parsing headers...");
    574574        }
    575575        FlatFileParser.LineType result = ffp.parseHeaders();
     
    609609            " on line " + (line == null ? "-1" : line.lineNo() + ": " + StringUtil.trimString(line.line(), 20)), t);     
    610610        }
    611         if (progress != null) progress.display(getProgress(ffp.getParsedCharacters()), "Parsing data...");
     611        if (progress != null) progress.display(getProgress(ffp), "Parsing data...");
    612612        int progressLine = 0;
    613613       
     
    640640              if (progress != null)
    641641              {
    642                 progress.display(getProgress(ffp.getParsedCharacters()), "Parsing data... (" + ffp.getParsedLines() + " lines so far)");
     642                progress.display(getProgress(ffp), "Parsing data... (" + ffp.getParsedLines() + " lines so far)");
    643643              }
    644644            }
     
    685685  // -------------------------------------------
    686686
    687   private int getProgress(long parsedCharacters)
    688   {
    689     return (int) (100 * parsedCharacters / fileSize);
     687  private int getProgress(FlatFileParser ffp)
     688  {
     689    return (int) (100 * ffp.getParsedBytes() / fileSize);
    690690  }
    691691
  • trunk/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java

    r4093 r4095  
    18061806        case STRING:
    18071807        {
    1808           StringParameterType t = new StringParameterType(255, defaultValue, false, 1, new Integer(options), 1);
     1808          StringParameterType t = new StringParameterType(65535, defaultValue, false, 1, new Integer(options), 1);
    18091809          parameter = new PluginParameter<String>(name, commonName, "", t);
    18101810          break;
     
    18271827        case HIDDEN_STRING:
    18281828        {
    1829           StringParameterType t = new StringParameterType(255, defaultValue, false, 1, 0, 1);
     1829          StringParameterType t = new StringParameterType(65535, defaultValue, false, 1, 0, 1);
    18301830          parameter = new PluginParameter<String>(name, null, "", t);
    18311831          break;
     
    18551855            enums.add(at.getName(), at.getName());
    18561856          }
    1857           StringParameterType t = new StringParameterType(255, null, false, 1, Values.getInt(options, 30), 1, enums);
     1857          StringParameterType t = new StringParameterType(65535, null, false, 1, Values.getInt(options, 30), 1, enums);
    18581858          parameter = new PluginParameter<String>(name, commonName, "", t);
    18591859          break;
     
    18611861        case ENUMERATION:
    18621862        {
    1863           StringParameterType t = new StringParameterType(255, defaultValue, false, 1, Values.getInt(options, 30), 1, enumOptions);
     1863          StringParameterType t = new StringParameterType(65535, defaultValue, false, 1, Values.getInt(options, 30), 1, enumOptions);
    18641864          parameter = new PluginParameter<String>(name, commonName, "", t);
    18651865          break;
  • trunk/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java

    r4093 r4095  
    685685    int nof_reporters=bioassayset.getNumReporters();
    686686    int progress_report_interval=nof_reporters/10;
    687     int nof_processed_reporters=0;
     687    long nof_processed_reporters=0;
    688688    while (spotData.hasNext())
    689689    {
    690690      if (progress != null && (nof_processed_reporters%progress_report_interval == 0))
    691691      {
    692         progress.display(100 * nof_processed_reporters / nof_reporters,
     692        progress.display((int)(100L * nof_processed_reporters / nof_reporters),
    693693                         "Exporting ... " + nof_processed_reporters + " of " +
    694694                         nof_reporters + " done.");
     
    781781    int nof_spots=bioassayset.getNumSpots();
    782782    int progress_spot_interval=nof_spots/10;
    783     int nof_processed_spots=0;
     783    long nof_processed_spots=0;
    784784    while (spotData.hasNext())
    785785    {
     
    791791          (nof_processed_spots%progress_spot_interval == 0))
    792792        {
    793           progress.display(100 * nof_processed_spots / nof_spots,
     793          progress.display((int)(100L * nof_processed_spots / nof_spots),
    794794                           "Exporting ..." + nof_processed_spots + " of " +
    795795                           nof_spots + " done.");
  • trunk/src/plugins/core/net/sf/basedb/plugins/IlluminaRawDataImporter.java

    r4093 r4095  
    8888import net.sf.basedb.util.parser.FlatFileParser.Data;
    8989import net.sf.basedb.util.parser.FlatFileParser.Line;
     90import net.sf.basedb.util.parser.FlatFileParser.LineType;
    9091
    9192/**
     
    165166        Arrays.asList(new String[] {"COORDINATE", "POSITION", "FEATURE_ID" } ))
    166167    );
    167 
    168168 
    169169  private static final PluginParameter<String> invalidColumnsErrorParameter = new PluginParameter<String>(
     
    290290        storeValue(job, request, fileParameter);
    291291        storeValue(job, request, ri.getParameter(CHARSET));
     292        storeValue(job, request, ri.getParameter(DECIMAL_SEPARATOR));
    292293       
    293294        // Associations
     
    343344    Create a FlatFileParser that can parse Illumina data files:
    344345    <ul>
    345     <li>Data splitter: ,
     346    <li>Data splitter: (,|\t)
    346347    <li>Header regexp: (.+)=(.*?),*
    347     <li>Data header: TargetId,.*
     348    <li>Data header: TargetID(,|\t).*
    348349    </ul>
     350    NOTE! To begin with we support both comma and tab as column splitter but
     351    later on (in {@link #isImportable(FlatFileParser)}) when we know which one is actually
     352    used, we change this in the parser. We need to do this since numbers may
     353    use comma as decimal separator.
    349354  */
    350355  @Override
     
    352357    throws BaseException
    353358  {
     359    String separator = "(,|\\t)";
    354360    FlatFileParser ffp = new FlatFileParser();
    355     ffp.setDataSplitterRegexp(Pattern.compile(","));
    356     ffp.setDataHeaderRegexp(Pattern.compile("TargetID,.*"));
     361    ffp.setDataSplitterRegexp(Pattern.compile(separator));
     362    ffp.setDataHeaderRegexp(Pattern.compile("TargetID"+separator + ".*"));
    357363    ffp.setHeaderRegexp(Pattern.compile("(.+)=(.*?),*"));
    358364    return ffp;
    359365  }
    360366  /**
    361     @return Always "dot"
     367    @return As specified by job parameter or "dot" if not
    362368  */
    363369  @Override
    364370  protected String getDecimalSeparator()
    365371  {
    366     return "dot";
     372    String separator = super.getDecimalSeparator();
     373    if (separator == null) separator = "dot";
     374    return separator;
    367375  }
    368376
     
    376384  {
    377385    String firstLine = ffp.getLineCount() >= 1 ? ffp.getLine(0).line() : null;
    378     return firstLine != null && firstLine.contains("Illumina") ;
     386    boolean isIllumina = firstLine != null && firstLine.contains("Illumina");
     387    if (isIllumina)
     388    {
     389      String separator = ",";
     390      FlatFileParser.Line lastLine = ffp.getLine(ffp.getLineCount()-1);
     391      if (lastLine.type() == LineType.DATA_HEADER)
     392      {
     393        int firstTab = lastLine.line().indexOf("\t");
     394        if (firstTab > 0 && firstTab < lastLine.line().indexOf(","))
     395        {
     396          separator = "\\t";
     397        }
     398        ffp.setDataSplitterRegexp(Pattern.compile(separator));
     399      }
     400    }
     401    return isIllumina;
    379402  }
    380403 
     
    649672        parameters.add(fileParameter);
    650673        parameters.add(getCharsetParameter(null, null, null));
     674        parameters.add(getDecimalSeparatorParameter(null, null, (String)job.getValue(DECIMAL_SEPARATOR)));
    651675 
    652676        // parameters for scan, protocol, software and array design
  • trunk/src/plugins/core/net/sf/basedb/plugins/LowessNormalization.java

    r4093 r4095  
    408408    query.restrict(intensityRestriction);
    409409    long numSpots = query.count(dc);
    410     int normalizedSpots = 0;
     410    long normalizedSpots = 0;
    411411    if (progress != null) progress.display((int)(normalizedSpots / numSpots * 100), normalizedSpots + " spots normalized");
    412412   
     
    504504            }
    505505            normalizedSpots += smoothCurve.size();
    506             if (progress != null) progress.display((int)((normalizedSpots * 100) / numSpots), normalizedSpots + " spots normalized");
     506            if (progress != null) progress.display((int)((normalizedSpots * 100L) / numSpots), normalizedSpots + " spots normalized");
    507507          }
    508508          fromBlock = toBlock + 1;
  • trunk/src/plugins/core/net/sf/basedb/plugins/MedianRatioNormalization.java

    r4093 r4095  
    349349    query.restrict(intensityRestriction);
    350350    long numSpots = query.count(dc);
    351     int normalizedSpots = 0;
     351    long normalizedSpots = 0;
    352352    if (progress != null) progress.display((int)(normalizedSpots / numSpots * 100), normalizedSpots + " spots normalized");
    353353   
     
    441441            }
    442442            normalizedSpots += toIndex - fromIndex;
    443             if (progress != null) progress.display((int)((normalizedSpots * 100) / numSpots), normalizedSpots + " spots normalized");
     443            if (progress != null) progress.display((int)((normalizedSpots * 100L) / numSpots), normalizedSpots + " spots normalized");
    444444          }
    445445          fromBlock = toBlock + 1;
  • trunk/src/plugins/core/net/sf/basedb/plugins/PackedFileExporter.java

    r4093 r4095  
    356356    // Get parameters
    357357    Directory rootDir = (Directory)job.getValue("root");
     358    rootDir = Directory.getById(dc, rootDir.getId());
    358359    List<Integer> files = (List<Integer>)job.getValues("files");       
    359360    List<Integer> directories = (List<Integer>)job.getValues("directories");
  • trunk/src/plugins/core/net/sf/basedb/plugins/TarFileUnpacker.java

    r4093 r4095  
    2424package net.sf.basedb.plugins;
    2525
     26import java.io.BufferedInputStream;
    2627import java.io.IOException;
    2728import java.io.InputStream;
     
    5354import net.sf.basedb.util.Values;
    5455import net.sf.basedb.util.zip.AbstractFileUnpacker;
     56import net.sf.basedb.util.zip.TarUtil;
    5557
    5658/**
     
    138140    if (isGzip)
    139141    {
    140       tarStream = new TarInputStream(new GZIPInputStream(pin));
     142      tarStream = new TarInputStream(new GZIPInputStream(new BufferedInputStream(pin)));
    141143    }
    142144    else if (isBzip)
     
    145147      pin.read();
    146148      pin.read();
    147       tarStream = new TarInputStream(new CBZip2InputStream(pin));
     149      tarStream = new TarInputStream(new CBZip2InputStream(new BufferedInputStream(pin)));
    148150    }
    149151    else
     
    160162    long totalUnpacked = 0;
    161163    int numFiles = 0;
    162    
    163     while ((entry = tarStream.getNextEntry()) != null)
     164    while ((entry = TarUtil.getNextEntry(tarStream)) != null)
    164165    {
    165166      String subPath = entry.getName();
  • trunk/src/test/net/sf/basedb/test/FileUtil.java

    r4093 r4095  
    2727
    2828import org.apache.tools.bzip2.CBZip2InputStream;
     29
     30import com.ice.tar.TarInputStream;
    2931
    3032import net.sf.basedb.core.DbControl;
     
    6668   
    6769    boolean isBzip = false;
     70    boolean isTar = false;
    6871    if (filename.endsWith(".bz2"))
    6972    {
    7073      isBzip = true;
    7174      filename = filename.substring(0, filename.length()-4);
     75    }
     76    if (filename.endsWith(".tar"))
     77    {
     78      isTar = true;
     79      filename = filename.substring(0, filename.length() - 4);
    7280    }
    7381 
     
    96104          toUpload = new CBZip2InputStream(toUpload);
    97105        }
     106        if (isTar)
     107        {
     108          // Assume that the TAR only contains a single file
     109          TarInputStream tar = new TarInputStream(toUpload);
     110          tar.getNextEntry();
     111          toUpload = tar;
     112        }
    98113        file.upload(toUpload, false, true);
    99114      }
  • trunk/src/test/net/sf/basedb/test/roles/AdminTest.java

    r4093 r4095  
    120120      dc = TestUtil.getDbControl();
    121121      File reporters = FileUtil.uploadFile(dc, "/mouse", "plates_and_reporters.mouse.v4.37k.txt", FileType.PLATE);
    122       File affyReporters = FileUtil.uploadFile(dc, "/affymetrix/annotations", "MG_U74Av2_annot.csv.bz2", FileType.REPORTER);
     122      File affyReporters = FileUtil.uploadFile(dc, "/affymetrix/annotations", "MG_U74Av2_annot.csv.tar.bz2", FileType.REPORTER);
    123123      dc.commit();
    124124     
  • trunk/src/test/net/sf/basedb/test/roles/PowerUserTest.java

    r4093 r4095  
    161161      File plates = FileUtil.uploadFile(dc, "/mouse", "plates_and_reporters.mouse.v4.37k.txt", FileType.PLATE);     
    162162      File printMap = FileUtil.uploadFile(dc, "/mouse", "printmap.mouse.v4.37k.tam", FileType.PRINT_MAP);
    163       File cdfFile = FileUtil.uploadFile(dc, "/affymetrix/cdf", "MG_U74Av2.cdf.bz2", FileType.REPORTER_MAP);
     163      File cdfFile = FileUtil.uploadFile(dc, "/affymetrix/cdf", "MG_U74Av2.cdf.tar.bz2", FileType.REPORTER_MAP);
    164164      dc.commit();
    165165     
  • trunk/src/test/net/sf/basedb/test/roles/UserTest.java

    r4093 r4095  
    142142      File rawData2DyeSwap = FileUtil.uploadFile(dc, "/mouse", "genepix.mouse.v4.37k.24h.dyeswap.gpr", FileType.RAW_DATA);
    143143     
    144       File affy1 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1761.cel.bz2", FileType.RAW_DATA);
    145       File affy2 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1762.cel.bz2", FileType.RAW_DATA);
    146       File affy3 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1763.cel.bz2", FileType.RAW_DATA);
     144      File affy1 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1761.cel.tar.bz2", FileType.RAW_DATA);
     145      File affy2 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1762.cel.tar.bz2", FileType.RAW_DATA);
     146      File affy3 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1763.cel.tar.bz2", FileType.RAW_DATA);
    147147      dc.commit();
    148148     
  • trunk/www/common/annotations/list_annotations.jsp

    r4093 r4095  
    389389      }
    390390      %>
    391       </div>
    392391
    393392  </base:body>
  • trunk/www/views/experiments/bioassaysets/view_bioassayset.jsp

    r4093 r4095  
    174174      }
    175175    }
    176     function changeImage(imageId, url)
    177     {
     176    function runItemPlugin(cmd)
     177    {
     178      Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&experiment_id=<%=experimentId%>&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540);
     179    }
     180    var imageQueue = new Array();
     181    var nextImage = 0;
     182    function addImage(imageId, url)
     183    {
     184      imageQueue[imageQueue.length] = imageId;
    178185      var img = document.getElementById(imageId);
    179       img.src = url;
    180     }
    181     function runItemPlugin(cmd)
    182     {
    183       Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&experiment_id=<%=experimentId%>&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540);
     186      img.realSrc = url;
     187    }
     188    function imageLoaded()
     189    {
     190      nextImage++;
     191      prepareNextImage();
     192    }
     193    function prepareNextImage()
     194    {
     195      if (imageQueue.length > nextImage)
     196      {
     197        var imageId = imageQueue[nextImage];
     198        var img = document.getElementById(imageId);
     199        img.src = '../../../images/plot_generating_400x300.gif';
     200        setTimeout('loadNextImage()', 100);
     201      }
     202    }
     203    function loadNextImage()
     204    {
     205      if (imageQueue.length > nextImage)
     206      {
     207        var imageId = imageQueue[nextImage];
     208        var img = document.getElementById(imageId);
     209        img.onload = imageLoaded;
     210        img.src = img.realSrc;
     211      }
    184212    }
    185213    </script>
     214    <style>
     215    .plot {
     216      border: 1px solid #666666;
     217      background-image: url('../../../images/plot_empty_400x300.png');
     218    }
     219    </style>
    186220  </base:head>
    187   <base:body>
     221  <base:body onload="loadNextImage()">
    188222    <p>
    189223    <p:path>
     
    481515        ItemQuery<BioAssay> bioAssayQuery = bioAssaySet.getBioAssays();
    482516        bioAssayQuery.order(Orders.asc(Hql.property("name")));
     517        StringBuilder script = new StringBuilder();
    483518        for (BioAssay bioAssay : bioAssayQuery.list(dc))
    484519        {
     
    488523          url += "&filter="+filter;
    489524          url += "&title="+HTML.urlEncode(bioAssay.getName());
     525          script.append("addImage('MA").append(bioAssay.getId()).append("','").
     526              append(url).append("');\n");
    490527          %>
    491528          <img id="MA<%=bioAssay.getId()%>"
    492             src="../../../images/plot_generating_400x300.gif"
    493             width="400" height="300" 
     529            src="../../../images/transparent_pixel.gif"
     530            width="400" height="300"
    494531            alt="MA-plot for bioassay <%=HTML.encodeTags(bioAssay.getName())%>"
    495             style="border: 1px solid #666666;">
    496           <script language="JavaScript">
    497           setTimeout("changeImage('MA<%=bioAssay.getId()%>', '<%=url%>')", 100);
    498           </script>
     532            class="plot"
     533            >
    499534          <%
    500535        }
     536        %>
     537        <script language="JavaScript">
     538        <%=script%>
     539        </script>
     540        <%
    501541      }
    502542      %>
     
    513553        String xLabel = HTML.urlEncode("A, log10(ch1 * ch2) / 2");
    514554        String yLabel = HTML.urlEncode("M, log2(ch1 / ch2)");
     555        StringBuilder script = new StringBuilder();
    515556        for (BioAssay bioAssay : bioAssayQuery.list(dc))
    516557        {
     
    519560          url += "&xLabel="+xLabel+"&yLabel="+yLabel;
    520561          url += "&title="+HTML.urlEncode(bioAssay.getName());
     562          script.append("addImage('CF").append(bioAssay.getId()).append("','").
     563          append(url).append("');\n");
    521564          %>
    522565          <img id="CF<%=bioAssay.getId()%>"
    523             src="../../../images/plot_generating_400x300.gif"
    524             width="400" height="300" 
     566            src="../../../images/transparent_pixel.gif"
     567            width="400" height="300"
    525568            alt="Correction factor plot for bioassay <%=HTML.encodeTags(bioAssay.getName())%>"
    526             style="border: 1px solid #666666;">
    527           <script language="JavaScript">
    528           setTimeout("changeImage('CF<%=bioAssay.getId()%>', '<%=url%>')", 100);
    529           </script>
     569            class="plot"
     570            >
    530571          <%
    531572        }
     573        %>
     574        <script language="JavaScript">
     575        <%=script%>
     576        </script>
     577        <%
    532578      }
    533579      %>
Note: See TracChangeset for help on using the changeset viewer.