Changeset 5689


Ignore:
Timestamp:
Aug 11, 2011, 11:09:06 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1612: Remove commented out code that is no longer in use

Added a rule to the coding guidelines to avoid keeping commented out code. If there is a reason for it the commented out part should be tagged with TODO.

The remaining code blocks are part of current tickets and have been tagged with TODO.

Location:
trunk
Files:
1 deleted
92 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/src/docbook/developerdoc/core_ref.xml

    r5675 r5689  
    529529                If more extensive commenting is needed - use Javadoc.
    530530              </listitem>
     531              <listitem>
     532                Avoid using semicolon (;) as part of inline comments. Searching for all
     533                comments containing a semicolon is used to find commented out code blocks.
     534              </listitem>
    531535            </itemizedlist>
    532536         
     
    535539       
    536540        <varlistentry>
     541          <term>Commented out code</term>
     542          <listitem>
     543            <para>
     544            Avoid leaving code that is commented out. It is a distraction when
     545            maintaining the code. Sometimes, for example during a big refactoring,
     546            it is not possible to fix everything at once. In this case it is allowed
     547            to comment out code, but it is recommended that a <emphasis>TODO</emphasis>
     548            marker (see below) is added to make it easier to find places that
     549            need to be fixed later.
     550            </para>
     551          </listitem>
     552        </varlistentry>
     553       
     554        <varlistentry>
    537555          <term>Todo comments</term>
    538556          <listitem>
     
    540558            If there are parts of the code that cannot be completed at the time the majority of the code
    541559            is written, place a comment starting with TODO (in capital letters), followed with a
    542             description of what needs to be done. Example:
     560            description of what needs to be done. If there is a ticket in the Trac server, use the
     561            ticket number in the comment. Example:
    543562            </para>
    544563            <programlisting language="java">
     
    546565{
    547566   return value == null ? null : new Date(value.getTime());
    548    // TODO: check if there is a better way to copy
     567   // TODO (#1234): check if there is a better way to copy
    549568}
    550569</programlisting>
  • trunk/src/clients/jobagent/net/sf/basedb/clients/jobagent/Agent.java

    r5447 r5689  
    730730    closeServer();
    731731    if (sc != null) sc.logout();
    732     //Application.stop();
    733732  }
    734733 
  • trunk/src/clients/web/net/sf/basedb/clients/web/Base.java

    r5643 r5689  
    807807        try
    808808        {
    809           // Dates are stored as long time values; reformat according to date formatter
     809          // Dates are stored as long time values. Reformat according to date formatter
    810810          // or as yyyy-MM-dd if no formatter is specified
    811811          if (!op.isListOperator())
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/InstallFilter.java

    r5616 r5689  
     1/**
     2  $Id $
     3
     4  Copyright (C) 2011 Nicklas Nordborg
     5
     6  This file is part of BASE - BioArray Software Environment.
     7  Available at http://base.thep.lu.se/
     8
     9  BASE is free software; you can redistribute it and/or
     10  modify it under the terms of the GNU General Public License
     11  as published by the Free Software Foundation; either version 3
     12  of the License, or (at your option) any later version.
     13
     14  BASE is distributed in the hope that it will be useful,
     15  but WITHOUT ANY WARRANTY; without even the implied warranty of
     16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17  GNU General Public License for more details.
     18
     19  You should have received a copy of the GNU General Public License
     20  along with BASE. If not, see <http://www.gnu.org/licenses/>.
     21*/
    122package net.sf.basedb.clients.web.extensions;
    223
     
    728import net.sf.basedb.util.filter.Filter;
    829
     30/**
     31  Filter implementation that selects only those extensions that
     32  was selected by the user in the gui. Eg. if the request
     33  parameter <i>filename</i>.install is set.
     34  @author Nicklas
     35  @since 3.0
     36  @base.modified $Date $
     37*/
    938public class InstallFilter
    1039  implements Filter<ExtensionsFile>
     
    2352    if (!xtFile.isValid() || (xtFile.hasError()))
    2453    {
    25       //log.info("File has errors (skipping): " + xtFile);
     54      // Do not install files with errors
    2655      return false;
    2756    }
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/JspContext.java

    r5601 r5689  
    146146  public String getHome(Extension extension)
    147147  {
     148    // TODO (#1593)
    148149    //ExtensionsFile file = directory.getFileByExtensionId(extension.getId());
    149150    //return file == null ? null : directory.getResourcesUrl(file);
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/ServletLoader.java

    r4512 r5689  
    233233      if (className == null) throw new NullPointerException("servlet-class[servlet-name=" + servletName + "]");
    234234     
    235       // Load the servlet class; make sure it implements the Servlet interface
     235      // Load the servlet class and make sure it implements the Servlet interface
    236236      Class<? extends Servlet> servletClass = loadServletClass(className, classLoader);
    237237      ServletWrapper wrapper = new ServletWrapper(servletClass, servletName);
  • trunk/src/clients/web/net/sf/basedb/clients/web/servlet/Download.java

    r5582 r5689  
    9494    String pathInfo = usePathInfo ? request.getPathInfo() :
    9595      URLDecoder.decode(request.getRequestURI(), "UTF-8").replace(contextPath+servletPath, "");
    96 //    System.out.println("URI=" + pathInfo+"; servletPath="+servletPath+"; contextPath="+contextPath);
    9796    /*
    9897      The pathInfo is expected to be like:
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Button.java

    r5663 r5689  
    315315    {
    316316      sb.append(" class=\"").append(getClazz()).append(isDisabled() ? "_disabled" : "").append("\"");
    317       if (!isDisabled())
    318       {
    319         //sb.append(" onmouseover=\"this.className='").append(getClazz()).append("_hover';\"");
    320         //sb.append(" onmouseout=\"this.className='").append(getClazz()).append("';\"");
    321       }
    322317    }
    323318    if (getStyle() != null) sb.append(" style=\"").append(getStyle()).append("\"");
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Select.java

    r5687 r5689  
    646646      if (!disabled)
    647647      {
    648         //sb.append(" onmouseover=\"this.className='buttonclass_hover';\" onmouseout=\"this.className='buttonclass';\"");
    649648        sb.append(" onclick=\"").append(getOnselect()).append("\"");
    650649      }
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/ColumnDef.java

    r5674 r5689  
    634634        sb.append(HTML.javaScriptEncode(getSortproperty())).append("', '").append(direction.name()).append("')\" title=\"");
    635635        sb.append(theTooltip).append("\">").append(getTitle()).append("</span>").append(image);
    636        
    637         /*
    638         sb.append("<a href=\"javascript:Table.setSortOrder('").append(table.getId()).append("', '");
    639         sb.append(getSortproperty()).append("', '").append(direction.name()).append("')\" title=\"");
    640         sb.append(theTooltip).append("\">").append(getTitle()).append("</a>").append(image);
    641         */
    642636      }
    643637      sb.append("</td>\n");
     
    746740            addOptions.append("]);\n");
    747741            table.addScript(addOptions.toString());
    748            
    749             /*
    750             sb.append("<select name=\"").append(inputName).append("\"");
    751             sb.append(" onchange=\"Forms.submit(event);\">\n");
    752             sb.append("<option value=\"\">");
    753             Enumeration<String, String> enumeration = getEnumeration();
    754             for (int i = 0; i < enumeration.size(); ++i)
    755             {
    756               String selected = filterValue.equals(enumeration.getKey(i).trim()) ? " selected" : "";
    757               sb.append("<option value=\"").append(enumeration.getKey(i)).append("\"").append(selected);
    758               sb.append(">").append(enumeration.getValue(i)).append("\n");
    759             }
    760             sb.append("</select>");
    761             */
    762742          }
    763743        }
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Toolbar.java

    r4889 r5689  
    201201    throws JspException
    202202  {
    203     //if (!(getParent() instanceof Table)) throw new JspTagException("Tag <tbl:toolbar> must be inside a <tbl:table> tag");
    204203    table = (Table)findAncestorWithClass(this, Table.class);
    205204    if (!isVisible()) return SKIP_BODY;
  • trunk/src/clients/web/net/sf/basedb/clients/web/util/HTML.java

    r5442 r5689  
    271271  }
    272272 
    273   /*
     273  /**
    274274    Scans a string for HTML tags and replaces all &lt; and &gt; for tags
    275275    not found in the <code>safeTags</code> pattern with &amp;lt; and &amp;gt;
     
    291291  }
    292292
    293   /*
     293  /**
    294294    Scans a string for HTML tags and replaces all &lt; and &gt; for tags
    295295    not found matching the <code>safeTags</code> pattern with &amp;lt; and &amp;gt;
  • trunk/src/core/net/sf/basedb/core/AbstractSqlQuery.java

    r5564 r5689  
    353353      ps.setInt(index, id);
    354354    }
    355     /*
    356     else if (parameterValue instanceof Date)
    357     {
    358       // Postgres drives doesn't recognize dates in the 2-argument form
    359       if (debugParamEnabled) logParam.debug("Binding '"+parameterValue+"' to parameter index: "+index);
    360       ps.setObject(index, parameterValue, Types.DATE);
    361     }
    362     */
    363355    else
    364356    {
  • trunk/src/core/net/sf/basedb/core/AnyToAny.java

    r5590 r5689  
    376376      List<Integer> itemTypes = HibernateUtil.loadList(Integer.class, query, null);
    377377     
    378       // For each item type; find and delete non-existing items
     378      // For each item type: find and delete non-existing items
    379379      int index = 0;
    380380      int numItemTypes = itemTypes.size();
  • trunk/src/core/net/sf/basedb/core/BasicItem.java

    r5648 r5689  
    249249    @see #addUsingItems(Set, Item, org.hibernate.Query)
    250250  */
    251 //  public abstract Set<ItemProxy> getUsingItems()
    252 //    throws BaseException;
    253 
    254251  public Set<ItemProxy> getUsingItems()
    255252    throws BaseException
  • trunk/src/core/net/sf/basedb/core/BioAssaySet.java

    r5319 r5689  
    712712    BioAssay ba = BioAssay.getNew(getDbControl(), this, getDataCube().newColumn());
    713713
    714     // Add rawParents to the new BioAssay; check that the are part of the transformation
     714    // Add rawParents to the new BioAssay. check that the are part of the transformation
    715715    Set<RawBioAssayData> rawBioAssays = ba.getData().getRawParents();
    716716    Set<RawBioAssayData> transformationRawSources = getData().getTransformation().getRawSources();
  • trunk/src/core/net/sf/basedb/core/ChangeHistory.java

    r5345 r5689  
    190190      List<Integer> itemTypes = HibernateUtil.loadList(Integer.class, query, null);
    191191     
    192       // For each item type; find and delete entries which reference non-existing items
     192      // For each item type: find and delete entries which reference non-existing items
    193193      int index = 0;
    194194      int numItemTypes = itemTypes.size();
  • trunk/src/core/net/sf/basedb/core/DataCube.java

    r5319 r5689  
    662662    if (mappingBatcher == null || mappingBatcher.getTotalInsertCount() == 0)
    663663    {
    664       // No mappings to raw data has been inserted; return 0 since the mapping
    665       // may not exists; see ticket #475
     664      // No mappings to raw data has been inserted. Return 0 since the mapping
     665      // may not exists. See ticket #475
    666666      return 0;
    667667    }
  • trunk/src/core/net/sf/basedb/core/DataFileType.java

    r5652 r5689  
    452452
    453453  /**
    454     Register/unregister extension points when the data file type is created
    455     or deleted.
    456   */
    457   @Override
    458   void onAfterCommit(Action action)
    459   {
    460     super.onAfterCommit(action);
    461     if (action == Action.CREATE)
    462     {
    463       //register(Application.getExtensionsManager().getRegistry(), getData());
    464     }
    465     else if (action == Action.DELETE)
    466     {
    467       //unregister(Application.getExtensionsManager().getRegistry(), getData());
    468     }
    469   }
    470 
    471   /**
    472454    @since 2.5
    473455   */
  • trunk/src/core/net/sf/basedb/core/DbControl.java

    r5590 r5689  
    11571157        calledFrom
    11581158      );
    1159       //log.warn("Stacktrace of code that created this DbControl. Please fix the " +
    1160       //  "code to make sure the DbControl is always closed.", calledFrom);
    11611159      close();
    11621160    }
  • trunk/src/core/net/sf/basedb/core/DerivedBioAssay.java

    r5685 r5689  
    172172  {
    173173    Set<ItemProxy> using = super.getUsingItems();
    174     // TODO
     174    // TODO - part of #1153
    175175    return using;
    176176  }
     
    183183    throws BaseException
    184184  {
    185     // TODO
     185    // TODO - part of #1153
    186186    return super.isUsed();
    187187  }
     
    347347  {
    348348    Collection<FileSet> parents = null;
    349     // TODO
     349    // TODO - part of #1153
    350350    return parents;
    351351  }
  • trunk/src/core/net/sf/basedb/core/DynamicSpotQuery.java

    r5319 r5689  
    291291    if (extraValue == null) throw new InvalidUseOfNullException("extraValue");
    292292    if (joinType == null) throw new InvalidUseOfNullException("joinType");
    293     /*if (extraValue.getCoordinateType() != ExtraValue.CoordinateType.SPOT)
    294     {
    295       throw new InvalidDataException("Extra value "+ extraValue+
    296         " is not attached to spots: "+extraValue.getCoordinateType());
    297     }*/
    298293    if (!getDataCube().equals(extraValue.getDataCubeExtraValue().getDataCube()))
    299294    {
  • trunk/src/core/net/sf/basedb/core/FileSet.java

    r5630 r5689  
    593593    }
    594594  }
    595  
    596  
    597  
    598  
    599   /**
    600     Wraps a {@link DataFileValidator}. This class takes care of calling the validator
    601     to validate, extract metadata and set validation status and error messages on the
    602     associated file set members.
    603   */
    604   /*
    605   private static class DataFileHandlerWrapper
    606   {
    607     private final DataFileValidator validator;
    608     private final FileStoreEnabled item;
    609     private final List<FileSetMember> files;
    610    
    611     DataFileHandlerWrapper(DataFileValidator validator, FileStoreEnabled item)
    612     {
    613       this.validator = validator;
    614       this.item = item;
    615       this.validator.setItem(item);
    616       this.files = new ArrayList<FileSetMember>();
    617     }
    618    
    619     void setFile(FileSetMember member)
    620     {
    621       validator.setFile(member);
    622       this.files.add(member);
    623     }
    624    
    625     void validate(DbControl dc)
    626     {
    627       validator.validate(dc);
    628     }
    629    
    630     void extractMetadata(DbControl dc)
    631     {
    632       validator.extractMetadata(dc);
    633     }
    634    
    635     void resetMetadata(DbControl dc)
    636     {
    637       validator.resetMetadata(dc);
    638     }
    639    
    640     void setValid(Boolean isValid, String errorMessage)
    641     {
    642       for (FileSetMember member : files)
    643       {
    644         member.getData().setValid(isValid);
    645         member.getData().setErrorMessage(errorMessage);
    646       }
    647     }
    648    
    649   }
    650   */
    651  
    652  
    653595
    654596}
  • trunk/src/core/net/sf/basedb/core/FilterBatcher.java

    r4992 r5689  
    316316    String insertSql = buildInsertSelectSql(selectSql);
    317317
    318     //System.out.println("INSERT: " + insertSql);
    319318    int rowsInserted = 0;
    320319    try
  • trunk/src/core/net/sf/basedb/core/HibernateUtil.java

    r5621 r5689  
    983983        user. The following command can fix it:
    984984       
    985         session.connection().rollback();
     985        session.connection().rollback()
    986986        ==================================================================
    987987        BUT!!! TRY TO FIND THE PLACE WHERE THE TRANSACTION IS LEFT OPEN!!!
  • trunk/src/core/net/sf/basedb/core/Install.java

    r5685 r5689  
    161161    throws BaseException
    162162  {
    163     final int totalProgressSteps = 24;
     163    final int totalProgressSteps = 23;
    164164    final float progress_factor = 100 / totalProgressSteps;
    165165    int progressStep = 0;
     
    213213        "activate it and set a password before it can be used.",
    214214        roleJobAgent, quota0, true, true);
    215       // createUser(0, "demo", "demo", "Demo", "This account can be used for demonstration purposes.", Role.GUEST);
    216       // createUser(0, "power", "power", "Power user", "This account has power user privileges.", Role.POWER_USER);
    217215 
    218216      // Now that we have a root user let's create a session
     
    249247      administrators_read.put(roleSuper, PERMISSION_READ);
    250248 
    251       // Power users -> CREATE; Administrators -> ALL
     249      // Power users -> CREATE, Administrators -> ALL
    252250      HashMap<RoleData, Integer> power_users_create = new HashMap<RoleData, Integer>();
    253251      power_users_create.put(roleAdmin, PERMISSION_ALL);
     
    255253      power_users_create.put(roleSuper, PERMISSION_READ);
    256254 
    257       // Power users & Users -> CREATE; Administrators -> ALL
     255      // Power users & Users -> CREATE, Administrators -> ALL
    258256      HashMap<RoleData, Integer> users_create = new HashMap<RoleData, Integer>();
    259257      users_create.put(roleAdmin, PERMISSION_ALL);
     
    262260      users_create.put(roleSuper, PERMISSION_READ);
    263261 
    264       // Power users & Users & Guests -> CREATE; Administrators -> ALL
     262      // Power users & Users & Guests -> CREATE, Administrators -> ALL
    265263      HashMap<RoleData, Integer> guests_create = new HashMap<RoleData, Integer>();
    266264      guests_create.put(roleAdmin, PERMISSION_ALL);
     
    270268      guests_create.put(roleSuper, PERMISSION_READ);
    271269 
    272       // All -> CREATE; Administrators -> ALL
     270      // All -> CREATE, Administrators -> ALL
    273271      HashMap<RoleData, Integer> all_create = new HashMap<RoleData, Integer>();
    274272      all_create.put(roleAdmin, PERMISSION_ALL);
     
    278276      all_create.put(roleSuper, PERMISSION_CREATE);
    279277     
    280       // All -> READ; Administrators --> WRITE
     278      // All -> READ, Administrators --> WRITE
    281279      HashMap<RoleData, Integer> all_use_administrators_write = new HashMap<RoleData, Integer>();
    282280      all_use_administrators_write.put(roleAdmin, PERMISSION_WRITE);
     
    286284      all_use_administrators_write.put(roleSuper, PERMISSION_USE);
    287285 
    288       // Users & Guests & Powers users -> USE; Administrators -> ALL
     286      // Users & Guests & Powers users -> USE, Administrators -> ALL
    289287      HashMap<RoleData, Integer> guests_use_administrators_all = new HashMap<RoleData, Integer>();
    290288      guests_use_administrators_all.put(roleAdmin, PERMISSION_ALL);
     
    294292      guests_use_administrators_all.put(roleSuper, PERMISSION_READ);
    295293 
    296       // Users & Guests -> USE; Powers users & Administrators -> ALL
     294      // Users & Guests -> USE, Powers users & Administrators -> ALL
    297295      HashMap<RoleData, Integer> guests_use_power_users_all = new HashMap<RoleData, Integer>();
    298296      guests_use_power_users_all.put(roleAdmin, PERMISSION_ALL);
     
    537535      createSoftware("TopHat", null, null, alignmentSoftware, rootUser, keyEveryoneUse);
    538536 
    539       // Item subtypes
    540       progressStep++;
    541       if (progress != null) progress.display((int)(progressStep*progress_factor), "--Creating item subtypes...");
    542       //createItemSubtype(systemId, itemType, name, description, protocolType, hardwareType, softwareType);
    543      
    544537      // Directory
    545538      progressStep++;
     
    22882281
    22892282  }
    2290   /**
    2291     Create a {@link PluginDefinition}.
    2292   */
    2293   /*
    2294   private static PluginDefinition createPluginDefinition(String className, String jarPath,
    2295     ItemKeyData shareTo, boolean trusted, Long maxMemory, boolean allowImmediateExecution)
    2296     throws BaseException
    2297   {
    2298     PluginDefinition pd = null;
    2299     DbControl dc = null;
    2300     try
    2301     {
    2302       dc = sessionControl.newDbControl();
    2303      
    2304       try
    2305       {
    2306         pd = PluginDefinition.getByClassName(dc, className);
    2307       }
    2308       catch (ItemNotFoundException ex)
    2309       {}
    2310      
    2311       if (pd != null)
    2312       {
    2313         pd.loadPluginInformation(jarPath, className, true);
    2314         dc.commit();
    2315         log.info("createPluginDefinition: UPDATED [className="+className+"; jarPath="+jarPath+"]");
    2316       }
    2317       else
    2318       {
    2319         pd = PluginDefinition.getNew(dc, className, jarPath, true);
    2320         pd.setTrusted(trusted);
    2321         pd.setMaxMemory(maxMemory);
    2322         pd.setAllowImmediateExecution(allowImmediateExecution);
    2323         pd.getData().setItemKey(shareTo);
    2324         dc.saveItem(pd);
    2325         dc.commit();
    2326         log.info("createPluginDefinition: OK [className="+className+"; jarPath="+jarPath+"]");
    2327       }
    2328     }
    2329     catch (BaseException ex)
    2330     {
    2331       log.error("createPluginDefinition: FAILED [className="+className+"; jarPath="+jarPath+"]", ex);
    2332       throw ex;
    2333     }
    2334     finally
    2335     {
    2336       if (dc != null) dc.close();
    2337     }
    2338     return pd;
    2339   }
    2340   */
     2283
    23412284 
    23422285  /**
  • trunk/src/core/net/sf/basedb/core/InternalStorageController.java

    r5453 r5689  
    265265      file.setLocation(Location.PRIMARY);
    266266      file.setAction(File.Action.NOTHING);
    267       /*
    268       Message message = Message.getNew(dc, file.getOwner(), "InternalStorageController", null, null);
    269       message.setName("File '" + file + "' moved to primary storage.");
    270       dc.saveItem(message);
    271       */
    272267      dc.commit();
    273268      // Remove file from secondary storage
     
    299294      file.setLocation(Location.SECONDARY);
    300295      file.setAction(File.Action.NOTHING);
    301       /*
    302       Message message = Message.getNew(dc, file.getOwner(), "InternalStorageController", null, null);
    303       message.setName("File '" + file + "' moved to secondary storage.");
    304       dc.saveItem(message);
    305       */
    306296      dc.commit();
    307297    }
  • trunk/src/core/net/sf/basedb/core/ItemContext.java

    r5686 r5689  
    12781278                }
    12791279              }
    1280               /*
    1281               int dotIndex = filterProperty == null ? -1 : filterProperty.lastIndexOf(".");
    1282               if (dotIndex >= 0)
    1283               {
    1284                 // Get rid of the part after the last dot
    1285                 filterProperty = filterProperty.substring(0, dotIndex);
    1286                 if (filterProperty.startsWith("$"))
    1287                 {
    1288                   // If it is an aliased property we need at least one more dot
    1289                  
    1290                 }
    1291                 else if (!filterProperty.startsWith("£") && !filterProperty.startsWith("&"))
    1292                 {
    1293                   leftJoins.add(filterProperty);
    1294                 }
    1295               }
    1296               */
    12971280            }
    12981281          }
  • trunk/src/core/net/sf/basedb/core/Metadata.java

    r5630 r5689  
    337337    {
    338338      pathSoFar.append(".").append(property);
    339       //System.out.println(pathSoFar.toString());
    340 
    341339      if (nextType.isEntityType())
    342340      {
     
    381379    // Post-conversion
    382380    Class returnClass = nextType.getReturnedClass();
    383     //System.out.println(pathSoFar.toString() + ": " + returnClass);
    384381    if (BatchableData.class.isAssignableFrom(returnClass))
    385382    {
  • trunk/src/core/net/sf/basedb/core/MultiPermissions.java

    r5370 r5689  
    113113    for (SharedItem item : itemsToShare)
    114114    {
    115       //item.checkPermission(Permission.SET_PERMISSION);
    116115      if (items.add(item))
    117116      {
  • trunk/src/core/net/sf/basedb/core/Project.java

    r5687 r5689  
    544544    if (include.contains(Include.MINE) && include.contains(Include.OTHERS))
    545545    {
    546       // Do nothing; all items are included
     546      // Do nothing, all items are included
    547547    }
    548548    else if (include.contains(Include.MINE))
     
    10461046  }
    10471047 
    1048   /*
    1049   public enum Default
    1050   {   
    1051     SOFTWARE("default_software", "Software", Item.SOFTWARE, Software.FEATURE_EXTRACTION, Item.RAWBIOASSAY),
    1052     ARRAYDESIGN("default_arraydesign", "Array design", Item.ARRAYDESIGN, null, null),
    1053     HYBRIDIZATION_HARDWARE("default_hybridization_hardware", "Hybridization station", Item.HARDWARE, Hardware.HYBRIDIZATION_STATION, Item.PHYSICALBIOASSAY),
    1054     SCANNER_HARDWARE("default_scanner_hardware", "Scanner", Item.HARDWARE, Hardware.SCANNER, Item.SCAN), 
    1055     PRINTROBOT_HARDWARE("default_print_robot_hardware", "Print robot", Item.HARDWARE, Hardware.PRINT_ROBOT, Item.ARRAYBATCH),
    1056     SCANNING_PROTOCOL("default_scanning_protocol", "Scanning protocol", Item.PROTOCOL, Protocol.SCANNING, Item.SCAN),
    1057     SAMPLING_PROTOCOL("default_sampling_protocol", "Sampling protocol", Item.PROTOCOL, Protocol.SAMPLING, Item.SAMPLE),
    1058     EXTRACTING_PROTOCOL("default_extracting_protocol", "Extracting protocol", Item.PROTOCOL, Protocol.EXTRACTION, Item.EXTRACT),   
    1059     HYBRIDIZATION_PROTOCOL("default_hybridization_protocol", "Hybridization protocol", Item.PROTOCOL, Protocol.HYBRIDIZATION, Item.PHYSICALBIOASSAY),
    1060     FEATURE_EXTRACTION_PROTOCOL("default_feature_extraction_protocol", "Feat. extraction protocol", Item.PROTOCOL, Protocol.FEATURE_EXTRACTION, Item.RAWBIOASSAY),
    1061     POOLING_PROTOCOL("default_pooling_protocol", "Pooling protocol", Item.PROTOCOL, Protocol.POOLING, null),
    1062     PRINTING_PROTOCOL("default_printing_protocol", "Printing protocol", Item.PROTOCOL, Protocol.PRINTING, Item.ARRAYBATCH),
    1063     RAW_DATA_TYPE("default_raw_data_type", "Raw data type", null, null, null),
    1064     PLATFORM("default_platform", "Platform", Item.PLATFORM, null, null),
    1065     PLATFORM_VARIANT("default_variant", "Variant", Item.PLATFORMVARIANT, null, null);
    1066    
    1067     private String name;
    1068     private String shortName;
    1069     private Item itemType;
    1070     private String type;
    1071     private Item attachesToItemType;
    1072    
    1073     private Default(String name, String shortName, Item itemType, String type, Item attachesToItemType)
    1074     {
    1075       this.name = name;
    1076       this.shortName = shortName;
    1077       this.itemType = itemType;
    1078       this.type = type;
    1079       this.attachesToItemType = attachesToItemType;
    1080     }
    1081    
    1082     public String getName()
    1083     {
    1084       return name;
    1085     }
    1086    
    1087     public String getShortName()
    1088     {
    1089       return shortName;
    1090     }
    1091    
    1092     public Item getItemType()
    1093     {
    1094       return itemType;
    1095     }
    1096    
    1097     public String getType()
    1098     {
    1099       return type;
    1100     }
    1101     */
    1102     /**
    1103       The item type an entry of this default type is usually attached to.
    1104       For example a {@link Default#SAMPLING_PROTOCOL} attaches to a
    1105       {@link Item#SAMPLE}.
    1106       @return An item object or null if it is not relevant
    1107       @since 2.10
    1108     */
    1109   /*
    1110     public Item getAttachesToItemType()
    1111     {
    1112       return attachesToItemType;
    1113     }
    1114   }
    1115   */
    1116  
    11171048}
    11181049
  • trunk/src/core/net/sf/basedb/core/QueryExecutor.java

    r5605 r5689  
    170170    {
    171171      // We wait about half the time of the timeout before updating the session control
    172       // sessionCacheTimeout() is in  minutes; our timeout is in seconds
     172      // sessionCacheTimeout() is in  minutes, but our timeout is in seconds
    173173      int timeout = Application.sessionCacheTimeout() * 30;
    174174      if (timeout <= 0) timeout = 30;
  • trunk/src/core/net/sf/basedb/core/SessionControl.java

    r5409 r5689  
    16471647     
    16481648      ContextData cd = HibernateUtil.loadData(ContextData.class, query);
    1649       /*
    1650       UserData userData = HibernateUtil.loadData(session, UserData.class, loginInfo.userId);
    1651       ClientData clientData = HibernateUtil.loadData(session, ClientData.class, getClientId());
    1652       ContextData cd = userData.getContexts().get(new ContextIndex(clientData, item.getValue(), subContext, name));
    1653       */
    16541649      if (cd != null)
    16551650      {
  • trunk/src/core/net/sf/basedb/core/Transformation.java

    r4889 r5689  
    397397Transformation t = ...
    398398
    399 // Use same data cube, but a new layer; automatically create child bioassays
     399// Use same data cube, but a new layer. Automatically create child bioassays
    400400BioAssaySet bas = t.newProduct(null, "new", true);
    401401
    402 // Use same data cube and layer; automatically create child bioassays
     402// Use same data cube and layer. Automatically create child bioassays
    403403BioAssaySet filtered = t.newProduct(null, null, true);
    404404
    405 // Use new data cube and layer; automatic creation of
     405// Use new data cube and layer. Automatic creation of
    406406// child bioassays is not supported
    407407BioAsssySet merged = t.newProduct("new", "new", false);
  • trunk/src/core/net/sf/basedb/core/Unit.java

    r5518 r5689  
    490490          2. Annotation with a different unit that has an annotation type with
    491491             this unit as default unit.
    492              aFactor = oldFactor / newFactor;
     492             aFactor = oldFactor / newFactor
    493493             anOffset = (oldOffset - newOffset) / newFactor
    494494          We need to execute all SQL:s on all numerical value
  • trunk/src/core/net/sf/basedb/core/VirtualDb.java

    r4889 r5689  
    431431  {
    432432    int rowsDeleted = 0;
    433     //Connection c = HibernateUtil.getConnection(getDbControl().getHibernateSession());
    434433    if (HibernateUtil.virtualTableExists(this, extraTable))
    435434    {
  • trunk/src/core/net/sf/basedb/core/log/db/AnnotationSetLogger.java

    r5068 r5689  
    6262  public void logChanges(LogManager logManager, EntityDetails details)
    6363  {
    64     // We are only logging update events; CREATE and DELETE events are
     64    // We are only logging update events. CREATE and DELETE events are
    6565    // usually also catched by other loggers
    6666    if (details.getChangeType() != ChangeType.UPDATE) return;
  • trunk/src/core/net/sf/basedb/core/query/HqlInnerJoin.java

    r5320 r5689  
    7171    if (query.getQueryType() == QueryType.HQL)
    7272    {
    73       // Count queries can't use the fetch parameter; they are not selecting the root item
     73      // Count queries can't use the fetch parameter, they are not selecting the root item
    7474      return "INNER JOIN " + (fetch && !query.isCounting() ? "FETCH " : "") +
    7575        (alias == null ? query.getRootAlias() : alias) + "." + property.replace("#", ".") + " " + joinedAlias +
  • trunk/src/core/net/sf/basedb/core/signal/ProgressReporterSignalHandler.java

    r4516 r5689  
    5050private String progressMessage;
    5151
    52 // Set up signal handling; ABORT is the only supported signal
     52// Set up signal handling. ABORT is the only supported signal
    5353private ProgressReporterSignalHandler signalHandler;
    5454public SignalHandler getSignalHandler()
  • trunk/src/core/net/sf/basedb/util/AnnotationUtil.java

    r5685 r5689  
    119119      if (item instanceof RawBioAssay)
    120120      {
     121//        TODO - part of #1153
    121122        //return ((RawBioAssay)item).getArrayNum();
    122123        return arrayNum;
  • trunk/src/core/net/sf/basedb/util/IntensityCalculatorUtil.java

    r5228 r5689  
    335335    }
    336336   
    337     /*
    338     long total = -System.nanoTime();
    339     long calc = 0;
    340     long data = 0;
    341     long cnew = 0;
    342     long chit = 0;
    343     long batt = 0;
    344     long brep = 0;
    345     long braw = 0;
    346     */
    347    
    348337    for (RawBioAssay rba : rawBioAssays)
    349338    {
     
    360349      DataResultIterator<RawData> rawData = rawQuery.iterate(dc);
    361350      ThreadSignalHandler.checkInterrupted();
    362       //data -= System.nanoTime();
    363351      while (rawData.hasNext())
    364352      {
     
    368356        ReporterData reporter = rd.getReporter();
    369357        FeatureData feature = rd.getFeature();
    370         //data += System.nanoTime();
    371358       
    372359        // Calculate intensities
    373         //calc -= System.nanoTime();
    374360        float[] intensities = iCalc.calculateIntensities(rd);
    375         //calc += System.nanoTime();
    376361       
    377362        if (intensities != null)
     
    387372          else
    388373          {
    389             // We have no feature or the feautre has no position;
    390             // check if the position has same reporter
     374            // We have no feature or the feature has no position.
     375            // Check if the position has same reporter
    391376            if (positionCache.containsKey(position))
    392377            {
     
    433418          }
    434419         
    435           //braw -= System.nanoTime();
    436420          // Insert mapping to raw data spot
    437421          rawBatcher.insert(column, position, rd);
    438           //braw += System.nanoTime();
    439422          // Insert intensities
    440           //batt -= System.nanoTime();
    441423          spotBatcher.insert(column, position, intensities);
    442           //batt += System.nanoTime();
    443424        }
    444425        if (progress != null)
     
    451432          }
    452433        }
    453         //data -= System.nanoTime();
    454       }
    455       //data += System.nanoTime();
     434      }
    456435    }
    457436    if (progress != null) progress.display(100, "Calculating spot intensities ("+totalSpots+" done)...\n");
    458 
    459     //total += System.nanoTime();
    460 
    461     /*
    462     System.out.println("Total time: " + (total / 1000000) + " ms");
    463     System.out.println("Intensity : " + (calc / 1000000) + " ms");
    464     System.out.println("Load data : " + (data / 1000000) + " ms");
    465     System.out.println("New pos   : " + (cnew / 1000000) + " ms");
    466     System.out.println("Cached pos: " + (chit / 1000000) + " ms");
    467     System.out.println("Batch data: " + (batt / 1000000) + " ms");
    468     System.out.println("Batch rep : " + (brep / 1000000) + " ms");
    469     System.out.println("Batch raw : " + (braw / 1000000) + " ms");
    470     */
    471    
     437 
    472438    // Close batchers and clean up
    473439    positionCache.clear();
  • trunk/src/core/net/sf/basedb/util/Values.java

    r5590 r5689  
    417417            s = formatter.format(value);
    418418          }
    419           /*
    420           else if (value instanceof Date)
    421           {
    422             s = formatDate((Date)value);
    423           }
    424           */
    425419          else
    426420          {
  • trunk/src/core/net/sf/basedb/util/affymetrix/CelValidationAction.java

    r5623 r5689  
    8484    validator.copyMetadata(celData, rba);
    8585   
    86     // Check if the CEL matches the CDF on the ArrayDesign; a failure will result in InvalidRelationException
     86    // Check if the CEL matches the CDF on the ArrayDesign.
     87    // A failure will result in InvalidRelationException
    8788    try
    8889    {
  • trunk/src/core/net/sf/basedb/util/biomaterial/ChildrenTransformer.java

    r5663 r5689  
    9696      query.setParameter("sources", sourceIds, Type.INT);
    9797      List<I> children = query.list(dc);
    98       // Add the children to the destination; if they all already exists we break to
     98      // Add the children to the destination. If they all already exists we break to
    9999      // loop (to avoid problematic circular references)
    100100      if (!destination.addAll(children)) break;
  • trunk/src/core/net/sf/basedb/util/biomaterial/ParentsTransformer.java

    r5663 r5689  
    9595      query.setParameter("sources", sourceIds, Type.INT);
    9696      List<I> parents = query.list(dc);
    97       // Add the parents to the destination; if they all already exists we break to
     97      // Add the parents to the destination. If they all already exists we break to
    9898      // loop (to avoid problematic circular references)
    9999      if (!destination.addAll(parents)) break;
  • trunk/src/core/net/sf/basedb/util/export/spotdata/MatrixBaseFileExporter.java

    r5373 r5689  
    8989    DbControl dc = getDbControl();
    9090   
    91     // Count the spots in this section; delegate output to superclass
     91    // Count the spots in this section. Delegate output to superclass
    9292    setProgress(10, "Counting number of spots...");
    9393    spotCount = countQuery.count(dc);
  • trunk/src/core/net/sf/basedb/util/export/spotdata/SerialBaseFileExporter.java

    r5405 r5689  
    100100      "' (" + (nextBioAssay+1)+" of " + bioAssays.size() + ")");
    101101
    102     // Count the spots in this section; delegate output to superclass
     102    // Count the spots in this section. Delegate output to superclass
    103103    long count = countQuery.count(dc);
    104104    spotCount += count;
  • trunk/src/core/net/sf/basedb/util/extensions/debug/BeanActionFactory.java

    r5384 r5689  
    173173        String value = entry.getValue();
    174174       
    175         // Find a setParam() method; ignore parameter if not found
     175        // Find a setParam() method. Ignore parameter if not found
    176176        Method setter = findSetterMethod(name, bean.getClass());           
    177177        if (setter == null)
  • trunk/src/core/net/sf/basedb/util/importer/spotdata/BaseFileImporter.java

    r5661 r5689  
    270270    BaseFileInfo info = new BaseFileInfo(srcFile);
    271271   
    272     // First parser pass; progress=0--30%
     272    // First parser pass: progress=0--30%
    273273    SectionAssaysParser assaysParser = new SectionAssaysParser(dc, info);
    274274    FirstPassSectionSpotsParser spotParser = new FirstPassSectionSpotsParser(dc, info, parent);
     
    310310    }
    311311   
    312     // Second parser pass; progress=50-100%
     312    // Second parser pass: progress=50-100%
    313313    SecondPassSectionSpotsParser spotParser2 =
    314314      new SecondPassSectionSpotsParser(dc, info, child, totalLines);
  • trunk/src/core/net/sf/basedb/util/importer/spotdata/BaseFileInfo.java

    r5590 r5689  
    6767  private boolean parentHasNullReporter;
    6868  private boolean parentHasZeroReporter;
    69   // Position/reporter mapping; key = position, value=reporter id
     69  // Position/reporter mapping: key = position, value=reporter id
    7070  private Map<Integer, Integer> parentReporterPositions;
    7171  private Map<Short, List<Short>> parentChildColumnMapping;
     
    7777  // Information about child spotdata
    7878  private boolean childHasDifferentReporterPositionMapping;
    79   // Position/reporter mapping; key = position, value=reporter id
     79  // Position/reporter mapping: key = position, value=reporter id
    8080  private Map<Integer, Integer> childReporterPositions;
    8181 
  • trunk/src/core/net/sf/basedb/util/jep/FunctionSafeJep.java

    r5384 r5689  
    105105    {
    106106      boolean exists = super.containsKey(key);
    107       //System.out.println("containsKey: " + key + "=" + exists +";nextToken="+nextToken((String)key));
    108107      if (!exists && key instanceof String)
    109108      {
  • trunk/src/core/net/sf/basedb/util/jep/Jep.java

    r5384 r5689  
    136136            }
    137137          }
    138           // Other standard functions that we always add; see newJep() method
     138          // Other standard functions that we always add. See newJep() method
    139139          functions.add("log2", "2-based logarithm");
    140140          functions.sortKeys();
  • trunk/src/core/net/sf/basedb/util/overview/OverviewUtil.java

    r5685 r5689  
    352352    // index = rba.getArrayNum()
    353353    /*
     354    TODO (#1153)
    354355    if (root instanceof RawBioAssay)
    355356    {
  • trunk/src/core/net/sf/basedb/util/overview/loader/DerivedBioAssayLoader.java

    r5685 r5689  
    7777   
    7878    /*
     79    TODO (#1153)
    7980    NodeFactory<DerivedBioAssaySet> nf = getNodeFactory(dc, context);
    8081    Node folderNode = null;
     
    9697    */
    9798  /*
     99    TODO (#1153)
    98100    ItemResultIterator<DerivedBioAssay> it = bioAssayQuery.iterate(dc);
    99101    while (it.hasNext())
     
    129131   
    130132    /*
     133    TODO (#1153)
    131134    NodeFactory<DerivedBioAssay> nf = getNodeFactory(dc, context);
    132135    DerivedBioAssay bioAssay = null;
  • trunk/src/core/net/sf/basedb/util/overview/loader/ExtractLoader.java

    r5685 r5689  
    274274    try
    275275    {
     276      //TODO (#1153)
    276277      //extract = bioAssay.getExtract();
    277278    }
  • trunk/src/core/net/sf/basedb/util/overview/validator/ArrayDesignValidator.java

    r5652 r5689  
    9090      {
    9191        /*
     92        TODO - part of #1153
    9293        Scan scan = rba.getScan();
    9394        if (scan != null)
  • trunk/src/core/net/sf/basedb/util/overview/validator/BasicItemNodeValidatorFactory.java

    r5685 r5689  
    198198    registerCheckedNodeValidator(Item.ARRAYSLIDE, ArraySlideValidator.class);
    199199    registerCheckedNodeValidator(Item.PHYSICALBIOASSAY, PhysicalBioAssayValidator.class);
     200//    TODO - part of #1153
    200201//    registerCheckedNodeValidator(Item.DERIVEDBIOASSAY, DerivedBioAssayValidator.class);
    201202    registerCheckedNodeValidator(Item.RAWBIOASSAY, RawBioAssayValidator.class);
    202203    registerCheckedNodeValidator(Item.EXPERIMENT, ExperimentValidator.class);
    203 //   
    204 //    // Property node validators
     204   
     205    // Property node validators
    205206    registerCheckedNodeValidator(Item.PROTOCOL, ProtocolValidator.class);
    206207    registerCheckedNodeValidator(Item.TAG, TagValidator.class);
  • trunk/src/core/net/sf/basedb/util/overview/validator/BioSourceValidator.java

    r5651 r5689  
    5959    super.postValidate(dc, context, node, parentNode);
    6060
    61     // If parent node contains a sample; check the subtypes
     61    // If parent node contains a sample, check the subtypes
    6262    if (parentNode != null && parentNode.getItemType() == Item.SAMPLE)
    6363    {
  • trunk/src/core/net/sf/basedb/util/overview/validator/RawBioAssayValidator.java

    r5685 r5689  
    100100      }
    101101      /*
     102      TODO (#1153)
    102103      String key = parent.getId() + ":" + arrayIndex;
    103104      if (used.containsKey(key))
     
    119120      */
    120121      /*
     122      TODO (#1153)
    121123      PhysicalBioAssay pba = parent.getBioAssaySet().getPhysicalBioAssay();
    122124      if (arrayIndex > pba.getSize() || arrayIndex < 1)
  • trunk/src/core/net/sf/basedb/util/parser/FlatFileParser.java

    r5590 r5689  
    10681068      }
    10691069    }
    1070     //if (nullIfException) mapper = new NullIfExceptionMapper(mapper);
    10711070    return mapper;
    10721071  }
  • trunk/src/core/net/sf/basedb/util/ssl/SSLUtil.java

    r5362 r5689  
    4040import javax.net.ssl.KeyManagerFactory;
    4141import javax.net.ssl.SSLContext;
    42 //import javax.net.ssl.SSLSocketFactory;
    4342import javax.net.ssl.TrustManager;
    4443import javax.net.ssl.TrustManagerFactory;
  • trunk/src/plugins/core/net/sf/basedb/plugins/AnnotationFlatFileImporter.java

    r5612 r5689  
    752752  {
    753753
    754     // Find the item(s) to annotate; mapper gives us name OR external ID
     754    // Find the item(s) to annotate. Mapper gives us name OR external ID
    755755    String nameOrId = itemMapper.getValue(data);
    756756    // 1. check the cache
  • trunk/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java

    r5629 r5689  
    285285        try
    286286        {
    287           dc = sc.newDbControl();
    288           //getManualConfigureParameters();
    289  
     287          dc = sc.newDbControl();
    290288          // Check number of channels
    291289          int channels = bas.getRawDataType().getChannels();
  • trunk/src/plugins/core/net/sf/basedb/plugins/IlluminaRawDataImporter.java

    r5657 r5689  
    671671            RawBioAssay rba = RawBioAssay.getNew(dc, generic, illumina);
    672672            rba.setName(arrayName);
     673//            TODO (#1153)
    673674            //rba.setArrayNum(arrayNum);
    674675            if (design != null) rba.setArrayDesign(design);
  • trunk/src/plugins/core/net/sf/basedb/plugins/LowessNormalization.java

    r5612 r5689  
    859859        if (toBlock > maxBlock) toBlock = maxBlock;
    860860        fromIndex = toIndex;
    861         // Data is sorted by block; find index of last spot with: block <= toBlock
     861        // Data is sorted by block. Find index of last spot with: block <= toBlock
    862862        // spot given by toIndex should not be included
    863863        while (toIndex < dataSize && data.get(toIndex).block <= toBlock)
  • trunk/src/plugins/core/net/sf/basedb/plugins/MedianRatioNormalization.java

    r5612 r5689  
    606606          if (toBlock < fromBlock) toBlock = fromBlock;
    607607          fromIndex = toIndex;
    608           // Data is sorted by block; find index of last spot with: block <= toBlock
     608          // Data is sorted by block. Find index of last spot with: block <= toBlock
    609609          // spot given by toIndex should not be included
    610610          while (toIndex < dataSize && data.get(toIndex).block <= toBlock)
  • trunk/src/plugins/core/net/sf/basedb/plugins/ReporterFlatFileImporter.java

    r5630 r5689  
    628628          Float score = scoreMapper == null ?
    629629              reporterList.getScore(reporter) : scoreMapper.getFloat(data);
    630   //            (Float)Type.FLOAT.parseString(scoreMapper.getValue(data), numberFormat);
    631630          if (currentId == 0)
    632631          {
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java

    r5688 r5689  
    611611    throws BaseException
    612612  {
    613     // Find the item(s) to update; mapper gives us name, internal ID, or some other identifer
     613    // Find the item(s) to update. Mapper gives us name, internal ID, or some other identifer
    614614    String identifier = idMapper.getValue(data);
    615615    String cacheKey = itemQuery.getItemType().name() + ":" + identifier;
     
    934934    <pre class="code">
    935935BioSource bs = BioSource.getNew(dc);
    936 // Set properties; see example on updateItem method
     936// Set properties. See example on updateItem method
    937937return bs;
    938938</pre>
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/ScanImporter.java

    r5688 r5689  
    291291  protected void updateMultiLineItem(DbControl dc, DerivedBioAssay scan, FlatFileParser.Data data, int multiLineNum)
    292292  {
     293//    TODO (#1153)
    293294  //  Image image = null;
    294295    File imageFile = null;
     
    310311    }
    311312    /*
     313    TODO (#1153)
    312314    else if (image != null)
    313315    {
    314316      imageName = image.getName();
    315317    }
    316     */
    317     /*
    318318    if (image != null)
    319319    {
  • trunk/src/plugins/core/net/sf/basedb/plugins/executor/BaseFileExporterSupport.java

    r5612 r5689  
    116116          checkUniqueFields((String)request.getParameterValue("spotFields"), "spot fields");
    117117          checkUniqueFields((String)request.getParameterValue("reporterFields"), "reporter fields");
    118           //checkUniqueFields((String)request.getParameterValue("assayFields"), "assay fields");
    119118        }
    120119        catch (InvalidDataException ex)
  • trunk/src/plugins/core/net/sf/basedb/plugins/executor/BfsExporterSupport.java

    r5612 r5689  
    292292   
    293293    // Reporter fields
    294     //ExportableFieldConverter fieldConverter = new StandardFieldConverter(dc, source);
    295294    ExportableFieldConverter fieldConverter = new AdvancedFieldConverter(dc, source);
    296295    List<DynamicField> reporterFields = new ArrayList<DynamicField>();
  • trunk/src/plugins/core/net/sf/basedb/plugins/executor/ExternalProgramExecutor.java

    r5612 r5689  
    693693    if (cmdLine != null)
    694694    {
    695       // Split on whitespace but not inside quotes; quotes are removed
     695      // Split on whitespace but not inside quotes. Quotes are removed after the split
    696696      String[] options = StringUtil.tokenize(cmdLine, "\\s+", true, true);
    697697      if (options != null)
  • trunk/src/plugins/core/net/sf/basedb/plugins/executor/FileOnlyImporterSupport.java

    r5612 r5689  
    9191      if (command.equals(IOSupport.COMMAND_CONFIGURE_IO_PLUGIN))
    9292      {
    93         /*
    94         RequestInformation ri = getConfigureExecutorParameters(command);
    95         List<Throwable> errors = validateRequestParameters(ri.getParameters(), request);
    96         if (errors != null)
    97         {
    98           response.setError(errors.size()+" invalid parameter(s) were found " +
    99                             "in the request", errors);
    100           return;
    101         }
    102         */
    103        
    104         // Import options
    105         //storeValue(configuration, request, ri.getParameter("datafile"));
    106         //storeValue(configuration, request, ri.getParameter("extraFiles"));
    107 
     93        // No parameters
    10894        response.setDone("File-only importer configuration complete");
    10995      }
  • trunk/src/test/Base1NullPlugin.java

    r4537 r5689  
    3535  public static void main(String[] args) throws IOException
    3636  {
    37 //    System.out.println("BASEfile");
    38 //    System.out.println("section\tassays");
    39 //    System.out.println("annotationColumns");
    40 //    System.out.println("columns\tid\tname");
    41 //    System.out.println("count\t1");
    42 //    System.out.println("%");
    43 //    System.out.println("1074793\tCa71_1_a");
    44 //    System.out.println();
    45 //    System.out.println("section\tspots");
    46 //    System.out.println("channels\t2");
    47 //    System.out.println("assayFields\tintensity1\tintensity2");
    48 //    System.out.println("columns\tposition\treporter\tassayData");
    49 //    System.out.println("assays\t1074793");
    50 //    System.out.println("count\t1");
    51 //    System.out.println("%");
    52 //    System.out.println("22134\t81431\t51.1538\t239.982");
    53 //    System.out.println();
    54 //    System.out.println("section\tspots");
    55 //    System.out.println("channels\t2");
    56 //    System.out.println("assayFields\tintensity1\tintensity2");
    57 //    System.out.println("columns\tposition\treporter\tassayData");
    58 //    System.out.println("assays\t1074793");
    59 //    System.out.println("count\t1");
    60 //    System.out.println("%");
    61 //    System.out.println("22165\t81431\t151.1538\t39.982");
    62 //    System.out.println();
    63    
    6437    PrintWriter log = new PrintWriter("base1nullplugin.log");
    6538    log.println("base1nullplugin started");
  • trunk/src/test/Base1TestPlugin.java

    r4720 r5689  
    5656      ffp.parseHeaders();
    5757     
    58       //System.out.println("section:::" + section.name());
    5958      if ("settings".equals(section.name()))
    6059      {
     
    6362        reporterList = Values.getBoolean(ffp.getHeader("reporterList"));
    6463        createSubdir = Values.getBoolean(ffp.getHeader("createSubdir"));
    65         //System.out.println("merge: " + mergeAssays + "; offset: " + offsetPositions);
    66         //System.out.println("createSubdir: " + createSubdir);
    6764      }
    6865      else if ("assays".equals(section.name()) && !reporterList)
     
    145142      File tmpDir = new File(System.getProperty("java.io.tmpdir"));
    146143      File subdir = new File(tmpDir, "subdir");
    147       //System.out.println("Creating subdir: " + subdir + "(" + subdir.getAbsolutePath() + ")");
    148144      subdir.mkdirs();
    149145      File subFile = new File(subdir, "file.txt");
    150       //System.out.println("Creating file: " + subFile + "(" + subFile.getAbsolutePath() + ")");
    151146      subFile.createNewFile();
    152147    }
  • trunk/src/test/TestBase1PluginExecuter.java

    r5444 r5689  
    107107      ok &= TestJob.test_execute(jobId, false);
    108108     
    109       // Copy input to output - serial format; remove stdin and stdout
     109      // Copy input to output - serial format, remove stdin and stdout
    110110      int jobIdCleanStd = test_create_job(cloneSerialCleanStdId, experimentId,
    111111          cloneId, directoryId, "Clone serial (remove std*.txt)");
  • trunk/src/test/TestBioPlateEvent.java

    r5688 r5689  
    105105    test_delete(id3);
    106106   
     107    // Delete the plates and the biomaterial on them
    107108    TestBioPlate.test_delete_contents(extractPlateId);
    108109    TestBioPlate.test_delete_contents(storagePlateId);
    109110    TestBioPlate.test_delete_contents(samplePlateId);
    110  
    111     //TestSample.test_delete(sampleId1);
    112     //TestSample.test_delete(sampleId2);
    113     //TestSample.test_delete(sampleId3);
    114111
    115112    TestHardware.test_delete(hardwareId);
     
    210207    }
    211208  }
    212 
    213   /*
    214   static int test_create(String name, int protocolId, int hardwareId, boolean setAll, Item bioMaterialType, int... bioMaterialIds)
    215   {
    216     if (!TestUtil.hasPermission(Permission.CREATE, Item.BIOPLATEEVENT))
    217     {
    218       return 0;
    219     }
    220     int id = 0;
    221     DbControl dc = null;
    222     try
    223     {
    224       dc = TestUtil.getDbControl();
    225      
    226       BioPlateEvent event = BioPlateEvent.getNew(dc);
    227       event.setName(name);
    228       if (protocolId != 0) event.setProtocol(Protocol.getById(dc, protocolId));
    229       if (hardwareId != 0) event.setHardware(Hardware.getById(dc, hardwareId));
    230       if (setAll)
    231       {
    232         event.setEventDate(new Date());
    233         event.setDescription("Added at " + new Date());
    234       }
    235      
    236       dc.saveItem(event);
    237       if (bioMaterialType != null && bioMaterialIds != null)
    238       {
    239         for (int bmId : bioMaterialIds)
    240         {
    241           MeasuredBioMaterial bm = (MeasuredBioMaterial)bioMaterialType.getById(dc, bmId);
    242           BioMaterialEvent bmEvent = BioMaterialEvent.getNew(dc, bm, event);
    243           dc.saveItem(bmEvent);
    244         }
    245       }
    246       dc.commit();
    247       id = event.getId();
    248       dc = TestUtil.getDbControl();
    249       dc.reattachItem(event, false);
    250       write_item(0, event);
    251       write("--Create bioplate event OK");
    252     }
    253     catch (Throwable ex)
    254     {
    255       write("--Create bioplate event FAIILED");
    256       ex.printStackTrace();
    257       ok = false;
    258     }
    259     finally
    260     {
    261       if (dc != null) dc.close();
    262     }
    263     return id;
    264   }
    265   */
    266209
    267210  static void test_delete_all()
  • trunk/src/test/TestFlatFileParser.java

    r4925 r5689  
    105105      }
    106106      if (!TestUtil.getSilent()) write("--Column headers: " + ffp.getColumnHeaders());
    107       // write("--Last line: "+types[last_line_type]);
    108107      if ((last_line_type == FlatFileParser.LineType.DATA_HEADER) || (last_line_type == FlatFileParser.LineType.DATA))
    109108      {
  • trunk/src/test/TestGenericOverview.java

    r5685 r5689  
    131131        SystemItems.getId(DerivedBioAssay.SCAN), scanningProtocol, scanner, 0);
    132132    TestAnnotation.test_annotatate(Item.DERIVEDBIOASSAY, scan, scanPower, 0, 15.0f);
     133//    TODO (#1153)
    133134//    int scannedAssayId1 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract1, "Scanned GO #1");
    134135//    int scannedAssayId2 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract2, "Scanned GO #2");
  • trunk/src/test/TestHelp.java

    r5340 r5689  
    5555
    5656    // Extra tests:
    57 //    if (id != 0) test_load_external_id(clientId, "help.text");
     57    if (id != 0) test_load_external_id(clientId, "help.text");
    5858
    5959    test_import("net.sf.basedb.clients.web", "../../data/helptexts.xml");
     
    208208  }
    209209
    210   /*
    211210  static void test_load_external_id(int clientId, String externalId)
    212211  {
     
    216215      dc = TestUtil.getDbControl();
    217216      Client client = Client.getById(dc, clientId);
    218       Help h = Help.getByExternalId(dc, client, externalId);
     217      Help h = client.getHelpByExternalId(dc, externalId, false);
    219218      write_item(0, h);
    220219      write("--Load help by external ID OK");
     
    231230    }
    232231  }
    233   */
    234232 
    235233  static void test_import(String clientId, String filename)
  • trunk/src/test/TestIlluminaImporter.java

    r5653 r5689  
    4444    int fileId = TestFile.test_create("data/test.illumina.rawdata.txt", false, false);
    4545    int hybId = TestPhysicalBioAssay.test_create(0, "Test hyb", 0, 1);
     46//    TODO (#1153)
    4647    //int scanId = TestScan.test_create(hybId, 0, 0, false);
    4748    int scanId = 0;
     
    7374    TestJob.test_delete(jobId);
    7475   
     76//    TODO (#1153)
    7577    //TestScan.test_delete(scanId);
    7678    TestSoftware.test_delete(softwareId);
     
    108110      }
    109111      /*
     112      TODO (#1153)
    110113      if (scanId != 0)
    111114      {
  • trunk/src/test/TestItemImporter.java

    r5688 r5689  
    256256      // Step 1 - file and parser regular expressions
    257257      PluginConfigurationRequest request = j.configure(new GuiContext(itemType, GuiContext.Type.LIST));
    258       //write_request_information(request.getRequestInformation());
    259258      request.getRequestInformation();
    260259      File file = File.getById(dc, fileId);
     
    420419    request.setParameterValue("numberFormatError", "skip");
    421420    request.setParameterValue("numberOutOfRangeError", "skip");
    422    
    423     if (itemType == Item.SAMPLE)
    424     {
    425       //request.setParameterValue("dryRun", true);
    426     }
     421
    427422    request.setParameterValue("logFile", "/" + itemType.name() + ".log");
    428423  }
  • trunk/src/test/TestProjectKey.java

    r5368 r5689  
    6262    ok = ok && (id != id3);
    6363
    64     // Extra test: add another project -> id3 != id
    65 //    int projectId2 = TestProject.test_create();
    66 //    int id3 = test_addproject(id, project2_id);
    67 //    write("--id!=id3 "+(id != id3 ? "OK" : "FAILED id="+id+"; id3="+id3));
    68 //    ok = ok && (id != id3);
    69 //
    70 //    test_listprojects(id);
    71 //    test_listprojects(id3);
    72 //
    73 //    // Extra test: remove the project again -> id4 == id
    74 //    int id4 = test_removeproject(id3, project2_id);
    75 //    write("--id==id4 "+(id==id4 ? "OK" : "FAILED id="+id+"; id4="+id4));
    76 //    ok = ok && (id == id4);
    77    
    7864    if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter();
    7965
    8066    // Standard test: Delete
    81 //    test_delete(id);
    82 //    test_delete(id3);
    83 
    8467    TestProject.test_delete(projectId);
    85 //    TestProject.test_delete(projectId2);
    86 
    8768    test_delete_unused(2);
    8869
     
    191172  }
    192173
    193   /*
    194   static int test_addproject(int id, int projectId)
    195   {
    196     if (id == 0 || project_id == 0) return 0;
    197     int new_id = 0;
    198     BaseControl bc = null;
    199     try
    200     {
    201       bc = TestUtil.getBaseControl();
    202       ProjectKey pk = ProjectKey.getById(bc, id);
    203       Project p = Project.getById(bc, project_id);
    204       pk.setPermission(p, PERMISSION.ALL);
    205       pk.save();
    206       bc.commit();
    207       new_id = pk.getId();
    208       write("--Add project to project key OK");
    209     }
    210     catch (Throwable ex)
    211     {
    212       write("--Add project to project key FAILED");
    213       ex.printStackTrace();
    214       ok = false;
    215     }
    216     finally
    217     {
    218       if (bc != null) bc.close();
    219     }
    220     return new_id;
    221   }
    222 
    223   static int test_removeproject(int id, int project_id)
    224   {
    225     if (id == 0 || project_id == 0) return 0;
    226     int new_id = 0;
    227     BaseControl bc = null;
    228     try
    229     {
    230       bc = TestUtil.getBaseControl();
    231       ProjectKey pk = ProjectKey.getById(bc, id);
    232       Project p = Project.getById(bc, project_id);
    233       pk.setPermission(p, PERMISSION.DENIED);
    234       pk.save();
    235       bc.commit();
    236       new_id = pk.getId();
    237       write("--Remove project from project key OK");
    238     }
    239     catch (Throwable ex)
    240     {
    241       write("--Remove project from project key FAILED");
    242       ex.printStackTrace();
    243       ok = false;
    244     }
    245     finally
    246     {
    247       if (bc != null) bc.close();
    248     }
    249     return new_id;
    250   }
    251 
    252   static void test_listprojects(int id)
    253   {
    254     if (id == 0) return;
    255     BaseControl bc = null;
    256     try
    257     {
    258       bc = TestUtil.getBaseControl();
    259       ProjectKey pk = ProjectKey.getById(bc, id);
    260 //      List l = Project.find(bc, null);
    261       List l = pk.getProjectList(null);
    262       for (int i = 0; i<l.size(); i++)
    263       {
    264         Project p = (Project)l.get(i);
    265         write_item(i, p, pk.getPermission(p));
    266       }
    267       write("--List projects in project key OK ("+l.size()+")");
    268     }
    269     catch (Throwable ex)
    270     {
    271       write("--List projects in project key FAILED");
    272       ex.printStackTrace();
    273       ok = false;
    274     }
    275     finally
    276     {
    277       if (bc != null) bc.close();
    278     }
    279   }
    280 */
    281174}
    282175
  • trunk/src/test/TestRawBioAssay.java

    r5688 r5689  
    380380            value =  "ABCDEF";
    381381          }
    382           //System.out.println("Add value: "+p.getName()+": "+t+": "+value);
    383 //          rd.setExtended(p.getName(), value);
    384382          extra.put(p.getName(), value);
    385383        }
  • trunk/src/test/TestRawDataFlatFileImporter.java

    r5657 r5689  
    140140      request.setParameterValue("propertyMapping.bgPixels", "\\34\\");
    141141      request.setParameterValue("propertyMapping.flags", "\\46\\");
    142       //request.setParameterValue("minDataColumns", 48);
    143       //request.setParameterValue("maxDataColumns", 48);
    144142
    145143      response = request.invoke();
  • trunk/src/test/TestReporterFlatFileImporter.java

    r5319 r5689  
    7676    ok &= TestJob.test_execute(jobId2, false);
    7777   
    78 //    TestReporter.test_delete();
    79 
    8078    TestJob.test_delete(jobId);
    8179    TestJob.test_delete(jobId2);
  • trunk/src/test/TestRoleKey.java

    r4889 r5689  
    141141      dc = TestUtil.getDbControl();
    142142      RoleKey rk = RoleKey.getById(dc, id);
    143       // List l = Role.find(bc, null);
    144143      List<Role> l = Role.getQuery().list(dc);
    145144      for (int i=0; i<l.size(); i++)
  • trunk/src/test/TestSpotImages.java

    r5657 r5689  
    2929import net.sf.basedb.core.query.Hql;
    3030
    31 // import java.util.Date;
    3231import java.util.List;
    3332import java.util.ArrayList;
    3433import java.util.LinkedList;
    35 // import java.util.Iterator;
    36 //
    3734import javax.media.jai.JAI;
    3835import com.sun.media.jai.widget.DisplayJAI;
     
    7572    positions.add(519);
    7673    test_multi_fetch_spot(rawBioAssayId, positions);
    77    
    78 //    int zipfile_id = test_disconnect_spotimagesfile( rawbioassay_id );
    79 //    TestFile.test_delete(zipfile_id);
    8074
    8175    if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter();
     
    236230    }
    237231  }
    238 // 
    239 // 
    240 //  static int test_disconnect_spotimagesfile( int rawbioassay_id )
    241 //  {
    242 //    BaseControl bc = null;
    243 //    int id = 0;
    244 //    try
    245 //    {
    246 //      bc = TestUtil.getBaseControl();
    247 //
    248 //      RawBioAssay rba = RawBioAssay.getById( bc, rawbioassay_id );
    249 //      SpotImages si = rba.getSpotImages();
    250 //      File spotFile = si.getSpotImagesFile();
    251 //      si.disconnectSpotImages();
    252 //      si.save();
    253 //      bc.commit();
    254 //      if( spotFile != null )
    255 //      {
    256 //        id = spotFile.getId();
    257 //        write("--Disconnect spotimages OK");
    258 //      }
    259 //      else
    260 //      {
    261 //        write("--Disconnect spotimages FAILED");
    262 //      }
    263 //    }
    264 //    catch (Exception ex)
    265 //    {
    266 //      write("--Disconnect spotimages FAILED");
    267 //      ex.printStackTrace();
    268 //      ok = false;
    269 //    }
    270 //    finally
    271 //    {
    272 //      if (bc != null) bc.close();
    273 //    }
    274 //    return id;
    275 //  }
     232
    276233 
    277234  static void write(String message)
     
    289246
    290247    public void append(String message)
    291     {
    292       //System.out.println("--"+message);
    293     }
     248    {}
    294249  }
    295250}
  • trunk/src/test/TestUser.java

    r5368 r5689  
    8686
    8787    // Extra test: create an item and change the owner
     88//    TODO (#1153)
    8889//    int label_id = TestLabel.test_create();
    8990//    test_set_owner(id, label_id);
     
    444445
    445446/*
     447  TODO (#1153)
    446448  static void test_set_owner(int id, int label_id)
    447449  {
  • trunk/src/test/TestUtil.java

    r5608 r5689  
    119119  }
    120120
    121   //private static DbControl dc = null;
    122121  private static SessionControl sc = null;
    123122
  • trunk/src/test/net/sf/basedb/test/MouseData.java

    r4514 r5689  
    101101    parameters.put("headerRegexp", "\"(.+)=(.*)\"");
    102102    parameters.put("dataSplitterRegexp", "\\t");
    103     //parameters.put("ignoreRegexp", ".*(NoOligoInfo|no clone).*");
    104103    if (dyeSwap)
    105104    {
  • trunk/src/test/net/sf/basedb/test/roles/UserTest.java

    r5685 r5689  
    120120      if (useBatchImporters)
    121121      {
    122         // Preparation; uploading files and find plugins
     122        // Preparation: uploading files and find plugins
    123123        dc = TestUtil.getDbControl();
    124124        bioSourceBatchImporter = PluginDefinition.getByClassName(dc, "net.sf.basedb.plugins.batchimport.BioSourceImporter");
     
    218218        Extract leRefDyeSwap = createLabeledExtract(dc, "Labeled extract A.ref (dye-swap)", eRef, cy3);
    219219        leRefDyeSwap.setBioWell(bioPlate.getBioWell(3, 2));
    220 //        dc.commit();
    221220       
    222221        // Hybridizations, etc.
    223 //        dc = TestUtil.getDbControl();
    224222        PhysicalBioAssay h1 = createHybridization(dc, "Hybridization A.00h", "Array slide A.1", le1, leRef);
    225223        PhysicalBioAssay h2 = createHybridization(dc, "Hybridization A.24h", "Array slide A.2", le2, leRef);
     
    486484    RawBioAssay rba = RawBioAssay.getNew(dc, platform, rawDataType);
    487485    rba.setName(name);
     486//    TODO (#1153)
    488487    //rba.setScan(scan);
    489488    rba.setProtocol(Util.findProtocol(dc, "Feature extraction A"));
Note: See TracChangeset for help on using the changeset viewer.