Changeset 441


Ignore:
Timestamp:
Oct 30, 2007, 2:05:17 PM (14 years ago)
Author:
dominic
Message:

added changed the ebi-utils- apis, readme.txt,changelog and dependent jars

Location:
trunk/uk/ac/ebi/AffyArrayDesignBatchImporter
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/ChangeLog.txt

    r363 r441  
    1 ,____First release
     1,____This file will contain information about changes iin subsequent releases.
    22
    3 This file will contain information about changes iin subsequent releases.
     3The ebi-utils-plugins.jar has been updated.
  • trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/README.txt

    r410 r441  
    2323  The new plugins appears under the name "Affymetrix Array Design Batch Importer" in the plugins list and is now ready for use.
    2424
    25   6. For other base users to use the plugin as detailed in the next section, please share them to the appropriate users by manually setting the permissions on the  plugin.
    26 
    2725  General Installation instruction is available at: 
    2826http://base.thep.lu.se/chrome/site/doc/html/admindoc/plugin_installation/plugins.installation.html#plugins.installation
  • trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/credit.txt

    r399 r441  
    1 At this release, Nutribase developement team is :
     1At this release, Nutribase developement team are :
    22
    3  - Dominic Oyeniran (oyeniran@ebi.ac.uk)
    4  - Philippe Rocca- Serra (rocca@ebi.ac.uk)
     3 - Dominic Oyeniran (oyeniran@ebi.ac.uk): Author
     4 - Philippe Rocca- Serra (rocca@ebi.ac.uk): Techinical Director
    55
    66both based at the European Bioinformatics Institute, Cambridge, UK
  • trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/src/uk/ac/ebi/nugo/common/Helper.java

    r421 r441  
    1111import net.sf.basedb.core.ArrayDesign;
    1212import net.sf.basedb.core.ArraySlide;
     13import net.sf.basedb.core.BaseException;
    1314import net.sf.basedb.core.BioSource;
    1415import net.sf.basedb.core.DbControl;
     16import net.sf.basedb.core.Directory;
    1517import net.sf.basedb.core.Extract;
    1618import net.sf.basedb.core.File;
     
    2325import net.sf.basedb.core.Path;
    2426import net.sf.basedb.core.Sample;
     27import net.sf.basedb.core.SessionControl;
    2528import net.sf.basedb.core.Type;
    2629import net.sf.basedb.core.User;
     
    3134/**
    3235  A plugin utils class for the tab2mage export and export. 
    33   [TODO] This class may be merged to other utils in the main base 2 source code
    34   @author Dominic Oyeniran
     36  @author Dominic Oyeniran
    3537  @version 1.0
    3638*/
     
    6870 
    6971   
     72   public static File processFilePath (User user,boolean overwrite, SessionControl sc, String pathString)
     73   {
     74    DbControl dc= null;
     75    File file =null;
     76     try
     77     {
     78      dc= sc.newDbControl();
     79      if (pathString.startsWith("~/"))
     80      {
     81       pathString = "~"+user.getLogin()+pathString.substring(1);
     82      }
     83      Path path = new Path(pathString, Path.Type.FILE);   
     84     
     85      file= File.getByPath(dc, path, true);
     86      file.setMimeType("text/plain"); //set the type of the file
     87      if (file.isInDatabase() && !overwrite && !file.isRemoved())
     88      {
     89        throw new ItemAlreadyExistsException("File[path="+path+"]");     
     90      }
     91      else if(!file.isInDatabase())
     92      {
     93        dc.saveItem(file);
     94      }
     95      dc.commit();
     96    }
     97    catch(Exception e)
     98    {
     99      dc.close();
     100    }
     101    finally
     102    {
     103      if (dc!=null)
     104        dc.close();
     105    }
     106     
     107    return file;
     108   }
    70109  /**
    71110    Displays the content of the map. Helps to check that the content displayed is correct.
     
    109148    of a tab2mage file
    110149    @param atName , annotation type name
    111     @return annotationTypes,  <code>AnnotationType</code>
     150    @return annotationType,  <code>AnnotationType</code>
    112151   */
    113152  public static AnnotationType getAnnotationTypeByName(String atName, DbControl dc)
     
    211250    return  ar;
    212251  }
    213   /**
    214     writes a string to standard output
    215       @param o
    216    */
    217   public static void write(String o)
    218   {
    219     System.out.println("&& DEBUG : "+o);
    220   }
    221  
     252
    222253 
    223254  /**
     
    311342      return le;   
    312343  }
     344 
     345
     346  /**
     347    gets the currently looged in user default directory
     348      @param sc, the seesion control
     349      @return path of the user directory as a string object
     350   */
     351  public static String getUserDefaultDirectory( SessionControl sc)
     352  {
     353    DbControl  dc = sc.newDbControl();
     354    String p ="";
     355    try
     356    {
     357      User user = User.getById(dc, sc.getLoggedInUserId());
     358      Directory dir= user.getHomeDirectory();
     359      Path path = dir.getPath();
     360      p=path.toString();
     361    }
     362    catch(Exception e)
     363    {
     364      new BaseException(e.getMessage());
     365    }
     366    finally
     367    {
     368      if (dc!=null) dc.close();
     369    }
     370    return p;
     371  }
    313372}
  • trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/src/uk/ac/ebi/nugo/common/Tab2MageConstants.java

    r394 r441  
    1 /**
    2  *
    3  */
     1/* $Id: Tab2MageConstants.java 2006-08-08 dominic $
     2
     3  This file is for NutriBASE - Nutrigenomics BioArray Software Environment.
     4  A customisation of the BASE SOFTWARE.
     5  Developed at the EBI , Cambridge.
     6  Author: Dominic Oyeniran: oyeniran@ebi.ac.uk
     7*/
    48package uk.ac.ebi.nugo.common;
    59
     
    1317  @author Dominic Oyeniran
    1418  @version 1.0
    15   @base.modified $Date
    1619 */
    1720public enum Tab2MageConstants
     
    193196    The parameter header
    194197   */
    195   parameter(49, "Parameter");
     198  parameter(49, "Parameter"),
     199 
     200  /**
     201    The protocol header
     202   */
     203  protocol(50, "Protocol"),
     204 
     205  /**
     206    nucleic acid extraction
     207   */
     208  nucleicacidextraction(51, "Nucleic_Acid_Extraction");
     209  ;
    196210 
    197211  /**
  • trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/src/uk/ac/ebi/nugo/common/ValueFormatter.java

    r391 r441  
    1616/**
    1717  A utility class containing static methods for formatting parameter values.
    18   [TODO] This class may be merged to util class in the main base 2 source code
    1918  @author Dominic Oyeniran
    2019  @email oyeniran@ebi.ac.uk
  • trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/src/uk/ac/ebi/nugo/common/ZipUnpacker.java

    r421 r441  
    1313import java.util.zip.ZipInputStream;
    1414
     15import net.sf.basedb.core.DatabaseException;
    1516import net.sf.basedb.core.DbControl;
    1617import net.sf.basedb.core.Directory;
     
    3132/**
    3233    This class unpacks zip file provided by users into the base file structure
    33     Note: Parts of the codes are authored by Misha Bayer - email: sbrn@scri.ac.uk,
     34    Note: Parts of the codes were authored by Misha Bayer - email: sbrn@scri.ac.uk,
    3435    @author Dominic Oyeniran
    3536    @email oyeniran@ebi.ac.uk
    36     @see BatchDataImport.java and BatchLoader plugin developed by Misha Bayer.
    37    
    3837   
    3938 */
     
    7574      {
    7675        createSubDirectory( file, user);
    77         // now call the mathod to unpack the zip files
     76        // now call the method to unpack the zip files
    7877        PluginDefinition zipFilePlugin = PluginDefinition.getByClassName(dc, "net.sf.basedb.plugins.ZipFileUnpacker");
    7978        FileUnpacker unpacker = zipFilePlugin.newInstance(net.sf.basedb.plugins.ZipFileUnpacker.class, null, dc.getSessionControl(), null, null);
     
    115114    //unlimited storage (e.g. for user root) will return -1
    116115    long quotaValue = quota.getQuotaValue(totalQuotaType, Location.PRIMARY);   
    117     //System.out.println("the quota value of the user: " + user.getName()+ " is: "+quotaValue );
     116    log.info("the quota value of the user: " + user.getName()+ " is: "+quotaValue );
    118117    long currentDiskUsage = user.getDiskUsage(totalQuotaType, Location.PRIMARY);
    119118      //check whether remaining disk space and zip file size are compatible
    120119    long remainingSpace = quotaValue - currentDiskUsage;
    121     //System.out.println("the remaining space for user: " + user.getName()+ " is: "+remainingSpace );
     120    log.info("the remaining space for user: " + user.getName()+ " is: "+remainingSpace );
    122121    if(remainingSpace < zipFileSize && quotaValue!=-1)
    123122    {
     
    172171      //get the parent directory
    173172      Directory zipFileDir = zipFile.getDirectory();
    174       //System.out.println("zipFile is located in dir " + zipFile.getPath());
     173      log.info("zipFile is located in dir " + zipFile.getPath());
    175174      Directory d = Directory.getById(dc, zipFileDir.getId());
    176175      Directory subDir = d.newSubDirectory();
    177       String fileName = zipFile.getName();
    178         String fileNameNoExt = fileName.substring(0, fileName.indexOf("."));
    179         subDir.setName(fileNameNoExt);
    180         subDir.setDescription("Unzippped directory created at "+new Date());
    181         dc.saveItem(subDir);
    182         dc.commit();
    183         //unzippedFilesDirectory = subDir;
     176      if (subDir.isInDatabase())
     177      {
     178        throw new DatabaseException("The Directory ["+ subDir.getPath().toString()+ "] already exists");
     179      }
     180      else if (!subDir.isInDatabase())
     181      {
     182        String fileName = zipFile.getName();
     183          String fileNameNoExt = fileName.substring(0, fileName.indexOf("."));
     184          subDir.setName(fileNameNoExt);
     185          subDir.setDescription("Unzippped directory created at "+new Date());
     186          dc.saveItem(subDir);
     187      }
     188      dc.commit();
    184189        setUnzippedFilesDirectory(subDir);
    185190    }
    186191    catch (Throwable ex)
    187192    {
    188       log.error("--Create subdirectory FAILED");
     193      log.error("--Create subdirectory FAILED", ex);
    189194    }
    190195    finally
  • trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/src/uk/ac/ebi/nugo/plugins/AffyArrayDesignBatchImporter.java

    r394 r441  
    4040import net.sf.basedb.core.plugin.Request;
    4141import net.sf.basedb.core.plugin.Response;
    42 import uk.ac.ebi.nugo.common.*;
     42import uk.ac.ebi.nugo.common.Helper;
     43import uk.ac.ebi.nugo.common.ZipUnpacker;
    4344import uk.ac.ebi.nugo.plugins.lims.AffymetrixFileFormatTypes;
    44 
    4545
    4646/**
     
    269269                 
    270270              //share the array design to everyone in based2 or admin does this on the GUI by selecting the plugin and using share button.
    271 
     271          // GroupPermissions groupPermission= new GroupPermissions();
     272           //String everyone= Group.EVERYONE;
     273           //int id = SystemItems.getId(Group.EVERYONE);
     274           //Group everyone = Group.getById(dc, id);
     275           //groupPermission.getPermissions(everyone)
     276           //ItemKey.getNewOrExisting(dc, null, groupPermissions);
    272277              }
    273278      }
Note: See TracChangeset for help on using the changeset viewer.