Changeset 441
- Timestamp:
- Oct 30, 2007, 2:05:17 PM (16 years ago)
- 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 release1 ,____This file will contain information about changes iin subsequent releases. 2 2 3 Th is file will contain information about changes iin subsequent releases.3 The ebi-utils-plugins.jar has been updated. -
trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/README.txt
r410 r441 23 23 The new plugins appears under the name "Affymetrix Array Design Batch Importer" in the plugins list and is now ready for use. 24 24 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 27 25 General Installation instruction is available at: 28 26 http://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:1 At this release, Nutribase developement team are : 2 2 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 5 5 6 6 both based at the European Bioinformatics Institute, Cambridge, UK -
trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/src/uk/ac/ebi/nugo/common/Helper.java
r421 r441 11 11 import net.sf.basedb.core.ArrayDesign; 12 12 import net.sf.basedb.core.ArraySlide; 13 import net.sf.basedb.core.BaseException; 13 14 import net.sf.basedb.core.BioSource; 14 15 import net.sf.basedb.core.DbControl; 16 import net.sf.basedb.core.Directory; 15 17 import net.sf.basedb.core.Extract; 16 18 import net.sf.basedb.core.File; … … 23 25 import net.sf.basedb.core.Path; 24 26 import net.sf.basedb.core.Sample; 27 import net.sf.basedb.core.SessionControl; 25 28 import net.sf.basedb.core.Type; 26 29 import net.sf.basedb.core.User; … … 31 34 /** 32 35 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 35 37 @version 1.0 36 38 */ … … 68 70 69 71 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 } 70 109 /** 71 110 Displays the content of the map. Helps to check that the content displayed is correct. … … 109 148 of a tab2mage file 110 149 @param atName , annotation type name 111 @return annotationType s, <code>AnnotationType</code>150 @return annotationType, <code>AnnotationType</code> 112 151 */ 113 152 public static AnnotationType getAnnotationTypeByName(String atName, DbControl dc) … … 211 250 return ar; 212 251 } 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 222 253 223 254 /** … … 311 342 return le; 312 343 } 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 } 313 372 } -
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 */ 4 8 package uk.ac.ebi.nugo.common; 5 9 … … 13 17 @author Dominic Oyeniran 14 18 @version 1.0 15 @base.modified $Date16 19 */ 17 20 public enum Tab2MageConstants … … 193 196 The parameter header 194 197 */ 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 ; 196 210 197 211 /** -
trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/src/uk/ac/ebi/nugo/common/ValueFormatter.java
r391 r441 16 16 /** 17 17 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 code19 18 @author Dominic Oyeniran 20 19 @email oyeniran@ebi.ac.uk -
trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/src/uk/ac/ebi/nugo/common/ZipUnpacker.java
r421 r441 13 13 import java.util.zip.ZipInputStream; 14 14 15 import net.sf.basedb.core.DatabaseException; 15 16 import net.sf.basedb.core.DbControl; 16 17 import net.sf.basedb.core.Directory; … … 31 32 /** 32 33 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, 34 35 @author Dominic Oyeniran 35 36 @email oyeniran@ebi.ac.uk 36 @see BatchDataImport.java and BatchLoader plugin developed by Misha Bayer.37 38 37 39 38 */ … … 75 74 { 76 75 createSubDirectory( file, user); 77 // now call the m athod to unpack the zip files76 // now call the method to unpack the zip files 78 77 PluginDefinition zipFilePlugin = PluginDefinition.getByClassName(dc, "net.sf.basedb.plugins.ZipFileUnpacker"); 79 78 FileUnpacker unpacker = zipFilePlugin.newInstance(net.sf.basedb.plugins.ZipFileUnpacker.class, null, dc.getSessionControl(), null, null); … … 115 114 //unlimited storage (e.g. for user root) will return -1 116 115 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 ); 118 117 long currentDiskUsage = user.getDiskUsage(totalQuotaType, Location.PRIMARY); 119 118 //check whether remaining disk space and zip file size are compatible 120 119 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 ); 122 121 if(remainingSpace < zipFileSize && quotaValue!=-1) 123 122 { … … 172 171 //get the parent directory 173 172 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()); 175 174 Directory d = Directory.getById(dc, zipFileDir.getId()); 176 175 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(); 184 189 setUnzippedFilesDirectory(subDir); 185 190 } 186 191 catch (Throwable ex) 187 192 { 188 log.error("--Create subdirectory FAILED" );193 log.error("--Create subdirectory FAILED", ex); 189 194 } 190 195 finally -
trunk/uk/ac/ebi/AffyArrayDesignBatchImporter/src/uk/ac/ebi/nugo/plugins/AffyArrayDesignBatchImporter.java
r394 r441 40 40 import net.sf.basedb.core.plugin.Request; 41 41 import net.sf.basedb.core.plugin.Response; 42 import uk.ac.ebi.nugo.common.*; 42 import uk.ac.ebi.nugo.common.Helper; 43 import uk.ac.ebi.nugo.common.ZipUnpacker; 43 44 import uk.ac.ebi.nugo.plugins.lims.AffymetrixFileFormatTypes; 44 45 45 46 46 /** … … 269 269 270 270 //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); 272 277 } 273 278 }
Note: See TracChangeset
for help on using the changeset viewer.