Changeset 5265
- Timestamp:
- Mar 11, 2010, 9:51:50 AM (13 years ago)
- Location:
- branches/2.15-stable
- Files:
-
- 10 added
- 1 deleted
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2.15-stable/src/core/net/sf/basedb/core/Formula.java
r5208 r5265 129 129 130 130 @param type The type of formula to return, or null to return any type 131 @param rawDataType The raw data type the formula should be useful for 131 @param rawDataType The raw data type the formula should be useful for, 132 or null to not filter on the raw data type 132 133 @param source Source data intensity transformation that the formula 133 134 should be useful for. This includes all formulas that has specified … … 152 153 Expressions.integer(type.getValue()))); 153 154 } 154 Expression rdtExpression = Hql.property("rawDataType"); 155 query.restrictPermanent( 156 Restrictions.or( 157 Restrictions.eq(rdtExpression, Expressions.parameter("rawDataType", rawDataType.getId())), 158 Restrictions.and( 159 Restrictions.eq(rdtExpression, null), 160 Restrictions.eq(Hql.property("channels"), Expressions.integer(rawDataType.getChannels())) 155 if (rawDataType != null) 156 { 157 Expression rdtExpression = Hql.property("rawDataType"); 158 query.restrictPermanent( 159 Restrictions.or( 160 Restrictions.eq(rdtExpression, Expressions.parameter("rawDataType", rawDataType.getId())), 161 Restrictions.and( 162 Restrictions.eq(rdtExpression, null), 163 Restrictions.eq(Hql.property("channels"), Expressions.integer(rawDataType.getChannels())) 164 ) 161 165 ) 162 ) 163 );166 ); 167 } 164 168 if (source != null) 165 169 { -
branches/2.15-stable/src/core/net/sf/basedb/core/Install.java
r5248 r5265 627 627 "itself.", 628 628 "net.sf.basedb.core.plugin.AnnotationSetterPlugin", null); 629 createPluginType("External executor IO support", 630 "This is a tagging interface that should be implemented by import and export plug-ins " + 631 "that wants to cooperate with the External Executor plug-in in either the export or import " + 632 "step. This interface doesn't define any methods but requires that implementing classes " + 633 "implement other methods (eg. configure(), run(), etc) in a special way. Consult the " + 634 "API documentation for more details.", 635 "net.sf.basedb.plugins.executor.IOSupport", null); 629 636 630 637 createPluginDefinition("net.sf.basedb.plugins.Base1PluginExecuter", null, null, true, null, false); … … 674 681 createPluginDefinition("net.sf.basedb.plugins.batchimport.ArrayBatchImporter", null, null, true, null, false); 675 682 createPluginDefinition("net.sf.basedb.plugins.batchimport.ArraySlideImporter", null, null, true, null, false); 683 createPluginDefinition("net.sf.basedb.plugins.executor.ExternalProgramExecutor", null, keyEveryoneUse, true, null, false); 684 createPluginDefinition("net.sf.basedb.plugins.executor.BfsExporterSupport", null, keyEveryoneUse, true, null, false); 685 createPluginDefinition("net.sf.basedb.plugins.executor.BfsImporterSupport", null, keyEveryoneUse, true, null, false); 676 686 677 687 // Plugin configurations -
branches/2.15-stable/src/core/net/sf/basedb/core/PluginDefinition.java
r5038 r5265 1116 1116 1117 1117 /** 1118 Get an instance of the plugin.1118 Get an unitialized instance of the plugin. 1119 1119 @throws PermissionDeniedException If the logged in user doesn't have 1120 1120 {@link Permission#USE} permission to the items. 1121 1121 @throws BaseException If there is a problem creating an instance. 1122 1122 */ 1123 Plugin newInstance()1123 public Plugin newInstance() 1124 1124 throws PermissionDeniedException, BaseException 1125 1125 { … … 1136 1136 1137 1137 /** 1138 Get an instance of the plugin implementation. 1138 Get an unitialized instance of the plugin implementation. 1139 @param <P> The kind of returned object that extends Plugin. 1140 @param clazz The class of the plugin which must be a subclass of <code>Plugin</code> 1141 @param jarPath Overrides the default JAR path for a plugin, null to use the default 1142 JAR path 1143 @return An uninitialised plugin instance 1144 @throws PermissionDeniedException 1145 @throws BaseException 1146 */ 1147 public <P extends Plugin> P newInstance(Class<P> clazz, String jarPath) 1148 throws PermissionDeniedException, BaseException 1149 { 1150 Plugin p = newInstance(jarPath); 1151 if (!clazz.isInstance(p)) 1152 { 1153 throw new InvalidDataException("Plugin does not implement "+clazz.getName()+": "+toString()); 1154 } 1155 return clazz.cast(p); 1156 } 1157 1158 1159 /** 1160 Get an initialized instance of the plugin implementation. 1139 1161 @param <P> The kind of returned object that extends Plugin. 1140 1162 @param clazz The class of the plugin which must be a subclass of <code>Plugin</code> … … 1153 1175 throws PermissionDeniedException, BaseException 1154 1176 { 1155 Plugin p = newInstance(jarPath); 1156 if (!clazz.isInstance(p)) 1157 { 1158 throw new InvalidDataException("Plugin does not implement "+clazz.getName()+": "+toString()); 1159 } 1177 P p = newInstance(clazz, jarPath); 1160 1178 if (sc == null) sc = getSessionControl(); 1161 1179 p.init(sc.getPluginSessionControl(this, job), -
branches/2.15-stable/src/core/net/sf/basedb/util/FileUtil.java
r5219 r5265 612 612 */ 613 613 public static int deleteTempDirectory(File root) 614 throws IOException615 614 { 616 615 int numDeleted = 0; -
branches/2.15-stable/src/core/net/sf/basedb/util/export/spotdata/MatrixBfsExporter.java
r5213 r5265 42 42 extends BfsExporter 43 43 { 44 45 public static final String SUBTYPE = "matrix"; 44 46 45 47 /** … … 59 61 public String getBFSSubtype() 60 62 { 61 return "matrix";63 return SUBTYPE; 62 64 } 63 65 -
branches/2.15-stable/src/core/net/sf/basedb/util/export/spotdata/SerialBfsExporter.java
r5213 r5265 44 44 extends BfsExporter 45 45 { 46 47 public static final String SUBTYPE = "serial"; 48 46 49 /** 47 50 Create a new serial BFS exporter. … … 61 64 public String getBFSSubtype() 62 65 { 63 return "serial";66 return SUBTYPE; 64 67 } 65 68 -
branches/2.15-stable/src/plugins/core/net/sf/basedb/plugins/BfsExporterPlugin.java
r5258 r5265 121 121 Collections.singleton(GuiContext.item(Item.BIOASSAYSET)); 122 122 123 private static final String FORMAT_BFS_SERIAL = "serial";124 private static final String FORMAT_BFS_MATRIX = "matrix";125 126 127 123 private ThreadSignalHandler signalHandler; 128 124 private RequestInformation configureJob; … … 226 222 227 223 // Export options 228 storeValue(job, request, ri.getParameter( "fileformat"));229 storeValue(job, request, ri.getParameter( "filenamegenerator"));224 storeValue(job, request, ri.getParameter(PARAMETER_FILEFORMAT)); 225 storeValue(job, request, ri.getParameter(PARAMETER_FILENAMEGENERATOR)); 230 226 storeValues(job, request, ri.getParameter("spotFields")); 231 227 storeValues(job, request, ri.getParameter("reporterFields")); … … 329 325 } 330 326 331 String format = (String)job.getValue( "fileformat");332 String filenameGen = (String)job.getValue( "filenamegenerator");327 String format = (String)job.getValue(PARAMETER_FILEFORMAT); 328 String filenameGen = (String)job.getValue(PARAMETER_FILENAMEGENERATOR); 333 329 List<String> reporterFields = (List<String>)job.getValues("reporterFields"); 334 330 List<String> spotFields = (List<String>)job.getValues("spotFields"); … … 342 338 if (progress != null) progress.display(0, "Exporting ..."); 343 339 BfsExporter exporter = null; 344 if ( FORMAT_BFS_SERIAL.equals(format))340 if (SerialBfsExporter.SUBTYPE.equals(format)) 345 341 { 346 342 exporter = new SerialBfsExporter(); 347 343 } 348 else if ( FORMAT_BFS_MATRIX.equals(format))344 else if (MatrixBfsExporter.SUBTYPE.equals(format)) 349 345 { 350 346 exporter = new MatrixBfsExporter(); … … 489 485 )); 490 486 491 // Export File format 492 Enumeration<String, String> formats = new Enumeration<String, String>(); 493 formats.add(FORMAT_BFS_SERIAL, "Serial BFS"); 494 formats.add(FORMAT_BFS_MATRIX, "Matrix BFS"); 495 parameters.add(new PluginParameter<String>( 496 "fileformat", 497 "File format", 498 "Please specify if you want to export a serial or matrix BFS. " + 499 "The serial format has one data file for each assay, and the matrix format " + 500 "has one data file for each selected spot field. In both cases, " + 501 "reporter fields and assay fields are exported in two separate files.", 502 new StringParameterType(255, null, true, 1, 0, 0, formats) 503 )); 504 505 Enumeration<String, String> filenameGen = new Enumeration<String, String>(); 506 filenameGen.add("names", "Assay/formula names"); 507 filenameGen.add("sequence", "Sequence"); 508 parameters.add(new PluginParameter<String>( 509 "filenamegenerator", 510 "File name strategy", 511 "Please select a data file name generation strategy.\n\n" + 512 "Assay formula/names = file names are created based on the " + 513 "names of assays or selected spot fields\n" + 514 "Sequence = file names follows a strict sequnce, sdata-1.txt, " + 515 "sdata-2.txt, etc.", 516 new StringParameterType(255, null, true, 1, 0, 0, filenameGen) 517 )); 487 // File format parameter 488 parameters.add(getFileFormatParameter()); 489 // File name generation strategy parameter 490 parameters.add(getFileNameGeneratorParameter()); 518 491 519 492 // Save to directory options … … 746 719 } 747 720 721 public final static String PARAMETER_FILEFORMAT = "fileformat"; 722 723 /** 724 Create a plug-in parameter that asks for the BFS subtype to use in 725 the export. 726 */ 727 public static PluginParameter<String> getFileFormatParameter() 728 { 729 Enumeration<String, String> formats = new Enumeration<String, String>(); 730 formats.add(SerialBfsExporter.SUBTYPE, "Serial BFS"); 731 formats.add(MatrixBfsExporter.SUBTYPE, "Matrix BFS"); 732 return new PluginParameter<String>( 733 PARAMETER_FILEFORMAT, 734 "File format", 735 "Please specify if you want to export a serial or matrix BFS. " + 736 "The serial format has one data file for each assay, and the matrix format " + 737 "has one data file for each selected spot field. In both cases, " + 738 "reporter fields and assay fields are exported in two separate files.", 739 new StringParameterType(255, null, true, 1, 0, 0, formats) 740 ); 741 } 742 743 public final static String PARAMETER_FILENAMEGENERATOR = "filenamegenerator"; 744 745 /** 746 Create a plug-in parameter that asks for the file name generation strategy. 747 */ 748 public static PluginParameter<String> getFileNameGeneratorParameter() 749 { 750 Enumeration<String, String> filenameGen = new Enumeration<String, String>(); 751 filenameGen.add("names", "Assay/formula names"); 752 filenameGen.add("sequence", "Sequence"); 753 return new PluginParameter<String>( 754 PARAMETER_FILENAMEGENERATOR, 755 "File name strategy", 756 "Please select a data file name generation strategy.\n\n" + 757 "Assay formula/names = file names are created based on the " + 758 "names of assays or selected spot fields\n" + 759 "Sequence = file names follows a strict sequnce, sdata-1.txt, " + 760 "sdata-2.txt, etc.", 761 new StringParameterType(255, null, true, 1, 0, 0, filenameGen) 762 ); 763 } 764 748 765 public static class ExtendedExportableField 749 766 { -
branches/2.15-stable/www/plugins/net/sf/basedb/plugins/executor/external_plugin_parameters.jsp
r5259 r5265 38 38 import="net.sf.basedb.clients.web.WebException" 39 39 import="net.sf.basedb.clients.web.util.HTML" 40 import="net.sf.basedb.plugins. ExternalPluginExecutor"40 import="net.sf.basedb.plugins.executor.ExternalProgramExecutor" 41 41 import="net.sf.basedb.util.Values" 42 42 import="java.util.ArrayList" … … 136 136 for (Object value : values) 137 137 { 138 Iterator<Element> it = ExternalP luginExecutor.getParameterElementsFromXml(value.toString());138 Iterator<Element> it = ExternalProgramExecutor.getParameterElementsFromXml(value.toString()); 139 139 while(it.hasNext()) 140 140 {
Note: See TracChangeset
for help on using the changeset viewer.