Changeset 3835
- Timestamp:
- Oct 15, 2007, 2:26:21 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/config/dist/ehcache.xml
r3675 r3835 57 57 /> 58 58 <cache 59 name="net.sf.basedb.core.data.DataFileTypeData" 60 maxElementsInMemory="100" 61 eternal="false" 62 timeToIdleSeconds="3600" 63 timeToLiveSeconds="3600" 64 overflowToDisk="false" 65 /> 66 <cache 59 67 name="net.sf.basedb.core.data.DirectoryData" 60 68 maxElementsInMemory="100" … … 185 193 /> 186 194 <cache 195 name="net.sf.basedb.core.data.PlatformData" 196 maxElementsInMemory="100" 197 eternal="false" 198 timeToIdleSeconds="3600" 199 timeToLiveSeconds="3600" 200 overflowToDisk="false" 201 /> 202 <cache 203 name="net.sf.basedb.core.data.PlatformVariantData" 204 maxElementsInMemory="100" 205 eternal="false" 206 timeToIdleSeconds="3600" 207 timeToLiveSeconds="3600" 208 overflowToDisk="false" 209 /> 210 <cache 187 211 name="net.sf.basedb.core.data.PluginConfigurationData" 188 212 maxElementsInMemory="100" -
trunk/config/dist/hibernate.cfg.xml
r3675 r3835 61 61 /> 62 62 <class-cache 63 class="net.sf.basedb.core.data.DataFileTypeData" 64 usage="nonstrict-read-write" 65 /> 66 <class-cache 63 67 class="net.sf.basedb.core.data.DirectoryData" 64 68 usage="nonstrict-read-write" … … 125 129 /> 126 130 <class-cache 131 class="net.sf.basedb.core.data.PlatformData" 132 usage="nonstrict-read-write" 133 /> 134 <class-cache 135 class="net.sf.basedb.core.data.PlatformVariantData" 136 usage="nonstrict-read-write" 137 /> 138 <class-cache 127 139 class="net.sf.basedb.core.data.PluginConfigurationData" 128 140 usage="nonstrict-read-write" -
trunk/doc/src/docbook/appendix/incompatible.xml
r3675 r3835 45 45 </para> 46 46 </note> 47 48 <sect1 id="appendix.incompatible.2.5"> 49 <title>BASE 2.5 release</title> 50 51 <bridgehead>Raw data types</bridgehead> 52 <para> 53 The <sgmltag class="attribute">storage</sgmltag> attribute of the 54 <sgmltag class="starttag">raw-data-type</sgmltag> has been deprecated 55 for the <filename>raw-data-types.xml</filename> file. BASE will refuse 56 to start if it finds this attribute. Raw data types which doesn't use 57 the database for storing data should be registered as <classname>Platform</classname>:s 58 instead. 59 </para> 60 61 <para> 62 Applications or plug-ins that filters on the <property>rawDataType</property> 63 property for <classname>RawBioAssay</classname> or <classname>Experiment</classname> 64 may need to change. The ID given to raw data types that doesn't use the 65 database for storing data are prefixed with the <constant>platform.</constant>. 66 The ID for the Affymetrix platform has changed from <constant>affymetrix</constant> 67 to <constant>platform.affymetrix</constant>. 68 </para> 69 70 <bridgehead>Raw bioassays</bridgehead> 71 <para> 72 The property <property>spots</property> which used to hold the number 73 of spots in the database OR in the file(s) has been split into two 74 properties: 75 </para> 76 <itemizedlist> 77 <listitem> 78 <para> 79 <property>spots</property>: Now only holds the number of database spots 80 </para> 81 </listitem> 82 <listitem> 83 <para> 84 <property>numFileSpots</property>: Holds the number of spots that are stored in files 85 </para> 86 </listitem> 87 </itemizedlist> 88 89 <para> 90 Applications or plug-ins that filters on the <property>spots</property> property 91 may no longer work as expected for file-only platforms, since this value is now 92 always 0. They should use the <property>numFileSpots</property> property instead. 93 </para> 94 95 <bridgehead>Array designs</bridgehead> 96 <para> 97 The <methodname>ArrayDesign.isAffyChip()</methodname> method has 98 been deprecated. Applications or plug-ins that filter on the <property>affyChip</property> 99 property may no longer work as expected. The applications should 100 instead filter on the <property>platform.externalId</property> and 101 look for the value given by the constant <constant>Platform.AFFYMETRIX</constant>. 102 </para> 103 104 <programlisting> 105 // This may no longer work 106 query.restrict( 107 Restrictions.eq( 108 Hql.property("affyChip"), 109 Expressions.parameter("affyChip", true, Type.BOOLEAN) 110 ) 111 ); 112 113 // Use this instead 114 query.restrict( 115 Restrictions.eq( 116 Hql.property("platform.externalId"), 117 Expressions.string(Platform.AFFYMETRIX) 118 ) 119 ); 120 </programlisting> 121 122 123 </sect1> 47 124 48 125 <sect1 id="appendix.incompatible.2.4"> -
trunk/doc/src/docbook/appendix/raw_data_types.xml
r3757 r3835 40 40 41 41 <sect1 id="appendix.rawdatatypes.platforms"> 42 <title>Default platforms installed with BASE</title> 43 44 <note> 45 <title>THIS IS A DRAFT!</title> 46 <para> 47 This document is a draft currently beeing worked on! 48 Changes are expected before the design is finalized. 49 </para> 50 </note> 42 <title>Default platforms/variants installed with BASE</title> 51 43 52 44 <informaltable> … … 63 55 <entry namest="platform.name" nameend="platform.id">Platform</entry> 64 56 <entry namest="variant.name" nameend="variant.id">Variants</entry> 65 <entry namest="filetype.item" nameend="filetype.id"> File types</entry>57 <entry namest="filetype.item" nameend="filetype.id">Data file types</entry> 66 58 </row> 67 59 <row> … … 79 71 <entry morerows="2">Generic</entry> 80 72 <entry morerows="2">generic</entry> 81 <entry morerows="2"> </entry>82 <entry morerows="2"> </entry>73 <entry morerows="2">-</entry> 74 <entry morerows="2">-</entry> 83 75 84 76 <entry morerows="1">Array design</entry> … … 92 84 <row> 93 85 <entry>Raw bioassay</entry> 94 <entry> Raw data</entry>86 <entry>Generic raw data</entry> 95 87 <entry>generic.rawdata</entry> 96 88 </row> 97 89 <row> 98 <entry morerows=" 2">Affymetrix</entry>99 <entry morerows=" 2">affymetrix</entry>100 <entry morerows="1"> Expression</entry>101 <entry morerows="1"> affymetrix.expression</entry>90 <entry morerows="1">Affymetrix</entry> 91 <entry morerows="1">affymetrix</entry> 92 <entry morerows="1">-</entry> 93 <entry morerows="1">-</entry> 102 94 <entry>Array design</entry> 103 <entry>CDF </entry>95 <entry>CDF file</entry> 104 96 <entry>affymetrix.cdf</entry> 105 97 </row> 106 98 <row> 107 99 <entry>Raw bioassay</entry> 108 <entry>CEL </entry>100 <entry>CEL file</entry> 109 101 <entry>affymetrix.cel</entry> 110 </row>111 <row>112 <entry>Snip</entry>113 <entry>affymetrix.snip</entry>114 <entry>??</entry>115 </row>116 <row>117 <entry>Illumina</entry>118 <entry>illumina</entry>119 <entry></entry>120 <entry></entry>121 <entry>??</entry>122 </row>123 <row>124 <entry namest="platform.name" nameend="filetype.id">More???</entry>125 102 </row> 126 103 </tbody> -
trunk/doc/src/docbook/developerdoc/api_overview.xml
r3795 r3835 794 794 </para> 795 795 796 <note> 797 <title>THIS IS A DRAFT!</title> 798 <para> 799 This document is a draft currently beeing worked on! 800 Changes are expected before the design is finalized. 801 </para> 802 </note> 803 796 <itemizedlist> 797 <title>See also</title> 798 <listitem><xref linkend="core_api.data_in_files" /></listitem> 799 <listitem><xref linkend="appendix.rawdatatypes.platforms" /></listitem> 800 </itemizedlist> 801 804 802 <sect3 id="data_api.platforms.uml"> 805 803 <title>UML diagram</title> … … 867 865 868 866 <sect3 id="data_api.platforms.files"> 869 <title> Data files</title>867 <title>FileStoreEnabled items and data files</title> 870 868 871 869 <para> … … 873 871 interface to be able to store data in files instead of in the database. 874 872 The interface creates a link to a <classname>FileSetData</classname> object, 875 which is can hold several <classname>FileSetMemberData</clas name> items.873 which is can hold several <classname>FileSetMemberData</classname> items. 876 874 Each member points to specific <classname>FileData</classname> item. 877 A file set can only store one file of each type.875 A file set can only store one file of each <classname>DataFileTypeData</classname>. 878 876 </para> 879 877 … … 932 930 <sect2 id="core_api.data_in_files"> 933 931 <title>Using files to store data</title> 934 <note>935 <title>THIS IS A DRAFT!</title>936 <para>937 This document is a draft currently beeing worked on!938 Changes are expected before the design is finalized.939 </para>940 </note>941 932 942 933 <para> 943 934 This section is about how BASE can use files to store data instead 944 of importing it into the database. See <xref linkend="data_api.platforms" /> 945 for an overview of the database schema for this feature. Files can be attached 935 of importing it into the database. Files can be attached 946 936 to any item that implements the <interfacename>FileStoreEnabled</interfacename> 947 interface. Currently this is <classname>RawBioAssay</classname> , <classname>ArrayDesign</classname>,948 <classname>BioAssaySet</classname> and <classname>BioAssay</classname>. The937 interface. Currently this is <classname>RawBioAssay</classname> 938 and <classname>ArrayDesign</classname>. The 949 939 ability to store data in files is not a replacement for storing data in the 950 940 database. It is possible (for some platforms/raw data types) to have data in … … 975 965 Not all three cases are supported for all types of data. This is controlled 976 966 by the <classname>Platform</classname> class, which may disallow 977 that data is stored in the database. To check this call 978 <methodname>getRawDataType()</methodname> which may return: 967 that data is stored in the database. To check this call 968 <methodname>Platform.isFileOnly()</methodname> and/or 969 <methodname>Platform.getRawDataType()</methodname>. If the <methodname>isFileOnly()</methodname> 970 method returns <constant>true</constant>, the platform can't store data in 971 the database. If the value is <constant>false</constant> more information 972 can be obtained by calling <methodname>getRawDataType()</methodname>, 973 which may return: 979 974 </para> 980 975 … … 1005 1000 has changed. The <filename>raw-data-types.xml</filename> file should 1006 1001 only be used for raw data types that are stored in the database. The 1007 <sgmltag>storage</sgmltag> tag has been deprecated and BASE will ignore 1008 any raw data type definitions with <code>storage="file"</code>. 1009 To replace this, each <classname>Platform</classname> that 1010 can only store data in files also defines a "virtual" raw data type. 1002 <sgmltag>storage</sgmltag> tag has been deprecated and BASE will refuse 1003 to start if it finds a raw data type definitions with <code>storage="file"</code>. 1011 1004 </para> 1005 1006 <para> 1007 For backwards compatibility reasons, each <classname>Platform</classname> 1008 that can only store data in files will create "virtual" raw data type 1009 objects internally. These raw data types all return <constant>false</constant> 1010 from if the method <methodname>RawDataType.isStoredInDb()</methodname> 1011 is called. They also have a back-link to the platform/variant that 1012 created it: <methodname>RawDataType.getPlatform()</methodname> 1013 and <methodname>RawDataType.getVariant()</methodname>. Theese two methods 1014 will always return null when called on a raw data type that can be 1015 stored in the database. 1016 </para> 1017 1018 <itemizedlist> 1019 <title>See also</title> 1020 <listitem><xref linkend="data_api.platforms" /></listitem> 1021 <listitem><xref linkend="appendix.rawdatatypes.platforms" /></listitem> 1022 <listitem> 1023 <xref linkend="appendix.incompatible.2.5" xrefstyle=""/> in 1024 <xref linkend="appendix.incompatible" /> 1025 </listitem> 1026 </itemizedlist> 1012 1027 1013 1028 <sect3 id="core_api.data_in_files.diagram"> … … 1037 1052 <para> 1038 1053 Given that we have a <interfacename>FileStoreEnabled</interfacename> 1039 item we use the <methodname>DataFileType.getQuery()</methodname> 1040 method to find which file types that can be used for that 1041 item. Internally, the <methodname>getQuery()</methodname> 1042 method uses the <methodname>FileStoreEnabled.getPlatform()</methodname> 1054 item we want to find out which <classname>DataFileType</classname> 1055 items that can be used for that item. The 1056 <methodname>DataFileType.getQuery(FileStoreEnabled)</methodname> 1057 can be used for this. Internally, the method uses the result from 1058 <methodname>FileStoreEnabled.getPlatform()</methodname> 1043 1059 and <methodname>FileStoreEnabled.getVariant()</methodname> 1044 1060 methods to restrict the query to only return file types for 1045 1061 a given platform and/or variant. If the item doesn't have 1046 a platform or variant the query will only return file types 1047 that are associated with the given item type, but not with any specific 1048 platform. In any case, we get a list of <classname>DataFileType</classname> 1049 items, each one representing a specific file type that 1050 we should ask the user about. Examples: 1062 a platform or variant the query will return all file types 1063 that are associated with the given item type. In any case, we get a list 1064 of <classname>DataFileType</classname> items, each one representing a 1065 specific file type that we should ask the user about. Examples: 1051 1066 </para> 1052 1067 … … 1055 1070 <para> 1056 1071 The <constant>Affymetrix</constant> platform defines <constant>CEL</constant> 1057 for <constant>FileType.RAW_DATA</constant> 1058 and <constant>CDF</constant> for <constant>FileType.REPORTER_MAP</constant>. 1059 respectively. If we have a 1060 <classname>RawBioAssay</classname> the query will only return 1072 as a raw data file and <constant>CDF</constant> as an array design (feature) 1073 file. If we have a <classname>RawBioAssay</classname> the query will only return 1061 1074 the CEL file type and the client can ask the user for a CEL file. 1062 1075 </para> … … 1064 1077 <listitem> 1065 1078 <para> 1066 More examples.... ??? 1079 The <constant>Generic</constant> platform defines <constant>PRINT_MAP</constant> 1080 and <constant>REPORTER_MAP</constant> for array designs. If we have 1081 an <classname>ArrayDesign</classname> the query will return those two 1082 items. 1067 1083 </para> 1068 1084 </listitem> … … 1070 1086 1071 1087 <para> 1072 Here is a simple code template that might be useful. 1073 </para> 1074 1088 It might also be interesting to know the currently selected file 1089 for each file type and if the platform has set the <varname>required</varname> 1090 flag for a particular file type. Here is a simple code example 1091 that may be useful to start from: 1092 </para> 1093 1075 1094 <programlisting> 1076 1095 DbControl dc = ... 1077 1096 FileStoreEnabled item = ... 1097 Platform platform = item.getPlatform(); 1098 PlatformVariant variant = item.getVariant(); 1099 1100 // Get list of DataFileTypes used by the platform 1078 1101 ItemQuery<DataFileType> query = 1079 DataFileType.getQuery(item);1102 FileStoreUtil.getQuery(item); 1080 1103 List<DataFileType> types = query.list(dc); 1081 // We now have a list of file types... 1082 // ... ask the user to select a file for each one of them 1104 1105 // Always check hasFileSet() method first to avoid 1106 // creating the file set if it doesn't exists 1107 FileSet fileSet = item.hasFileSet() ? 1108 null : item.getFileSet(); 1109 1110 for (DataFileType type : types) 1111 { 1112 // Get the current file, if any 1113 FileSetMember member = fileSet == null || !fileSet.hasMember(type) ? 1114 null : fileSet.getMember(type); 1115 File current = member == null ? 1116 null : member.getFile(); 1117 1118 // Check if a file is required by the platform 1119 PlatformFileType pft = platform == null ? 1120 null : platform.getFileType(type, variant); 1121 boolean isRequired = pft == null ? 1122 false : pft.isRequired(); 1123 1124 // Now we can do something with this information to 1125 // let the user select a file ... 1126 } 1083 1127 </programlisting> 1084 1128 1129 <note> 1130 <title>Also remember to catch PermissionDeniedException</title> 1131 <para> 1132 The above code may look complicated, but this is mostly because 1133 of all checks for <constant>null</constant> values. Remember 1134 that many things are optional and may return <constant>null</constant>. 1135 Another thing to look out for is 1136 <exceptionname>PermissionDeniedException</exceptionname>:s. The logged in 1137 user may not have access to all items. The above example doesn't include 1138 any code for this since it would have made it too complex. 1139 </para> 1140 </note> 1085 1141 </sect3> 1086 1142 1087 1143 <sect3 id="core_api.data_in_files.link"> 1088 <title>Link tothe selected files</title>1144 <title>Link, validate and extract metadata from the selected files</title> 1089 1145 <para> 1090 1146 When the user has selected the file(s) we must store the links … … 1094 1150 Call <methodname>FileSet.setMember()</methodname> to store 1095 1151 a file in the set. If a file already exists for the given file type 1096 it is replaced, otherwise a new entry is created. 1097 </para> 1152 it is replaced, otherwise a new entry is created. The following 1153 program example assumes that we have a map where <classname>File</classname>:s 1154 are related to <classname>DataFileType</classname>:s 1155 1156 </para> 1157 1158 <programlisting> 1159 DbControl dc = ... 1160 FileStoreEnabled item = ... 1161 Map<DataFileType, File> files = ... 1162 1163 // Store the selected files in the fileset 1164 FileSet fileSet = item.getFileSet(); 1165 for (Map.Entry<DataFileType, File> entry : files) 1166 { 1167 DataFileType type = entry.getKey(); 1168 File file = entry.getValue(); 1169 fileSet.setMember(type, file); 1170 } 1171 1172 // Validate the files and extract metadata 1173 fileSet.validate(dc, true); 1174 </programlisting> 1098 1175 </sect3> 1099 1176 1100 1177 <sect3 id="core_api.data_in_files.validate"> 1101 <title> Validate the file and extractmetadata</title>1178 <title>How the core validate the files and extracts metadata</title> 1102 1179 1103 1180 <para> 1104 1181 Validation and extraction of metadata is important since we want 1105 1182 data in files to be equivalent to data in the database. The validation 1106 and metadata extraction is automatically done by the core when a 1107 file is added to a file set. The process is partly pluggable 1108 since each <classname>DataFileType</classname> can name a class 1109 that should do the validation and/or metadata extraction. 1110 Here is the general outline: 1111 </para> 1112 1113 <programlisting> 1114 FileStoreEnabled item = ... 1115 DataFileType type = ... 1116 File file = ... 1117 FileSetMember member = new FileSetMember(file, type); 1118 1119 DataFileValidator validator = type.getValidator(); 1120 DataFileMetadataReader metadata = type.getMetadataReader(); 1121 validator.setFile(member); 1122 validator.setItem(item); 1123 // Repeat for 'metadata' if not same as 'validator' 1124 1125 validator.validate(); 1126 metadata.extractMetadata(); 1127 </programlisting> 1128 1183 and metadata extraction is done by the core when the 1184 <methodname>FileSet.validate()</methodname>. 1185 The process is partly pluggable since each <classname>DataFileType</classname> 1186 can name a class that should do the validation and/or metadata extraction. 1187 Here is the general outline of what is going on: 1188 </para> 1189 1190 1191 <orderedlist> 1192 <listitem> 1193 <para> 1194 The core checks the <classname>DataFileType</classname> of all 1195 members in the file set and create <classname>DataFileValidator</classname> 1196 and <classname>DataFileMetadataReader</classname> objects. Only one instance 1197 of each class is created. If the file set contains members which has the 1198 same validator or metadata reader, they will all share the same instance. 1199 </para> 1200 </listitem> 1201 1202 <listitem> 1203 <para> 1204 Each validator/metadata reader class is initialised with calls to 1205 <methodname>DataFileHandler.setItem()</methodname> and 1206 <methodname>DataFileHandler.setFile()</methodname>. 1207 </para> 1208 </listitem> 1209 1210 <listitem> 1211 <para> 1212 Each validator is called. The result of the validation is saved for each 1213 file and can be retreieved by <methodname>FileSetMember.isValid()</methodname> 1214 and <methodname>FileSetMember.getErrorMessage()</methodname>. 1215 </para> 1216 </listitem> 1217 1218 <listitem> 1219 <para> 1220 Each metadata reader is called, unless the metadata reader is the same class 1221 as the validator and the validation failed. If the metadata reader is a 1222 different class, it is called even if the validation failed. 1223 </para> 1224 </listitem> 1225 </orderedlist> 1226 1129 1227 <note> 1130 1228 <title>Only one instance of each validator class is created</title> … … 1161 1259 1162 1260 <programlisting> 1163 File defaultFile = null; 1164 RawBioAssay rba = ...; 1165 if (rba.hasFileSet()) 1166 { 1167 FileSet fileSet = rba.getFileSet(); 1168 List<FileSetMember> members = 1169 fileSet.getMembers(FileType.RAW_DATA); 1170 if (members.size() > 0) 1171 { 1172 defaultFile = members.get(0).getFile(); 1173 } 1174 } 1261 RawBioAssay rba = ... 1262 DbControl dc = ... 1263 1264 // Get the current raw data file, if any 1265 List<File> rawDataFiles = FileStoreUtil.getGenericDataFiles(dc, rba, FileType.RAW_DATA); 1266 File defaultFile = rawDataFiles.size() > 0 ? 1267 rawDataFiles.get(0) : null; 1268 1269 // Create parameter asking for input file - use current as default 1270 PluginParameter<File> fileParameter = new PluginParameter<File>( 1271 "file", 1272 "Raw data file", 1273 "The file that contains the raw data that you want to import", 1274 new FileParameterType(defaultFile, true, 1) 1275 ); 1175 1276 </programlisting> 1277 1278 <para> 1279 An import plug-in should also save the file that was used to the file set: 1280 </para> 1281 1282 <programlisting> 1283 RawBioassay rba = ... 1284 // The file the user selected to import from 1285 File rawDataFile = (File)job.getValue("file"); 1286 1287 // Save the file to the fileset. The method will check which file 1288 // type the platform uses as the raw data type. As a fallback the 1289 // GENERIC_RAW_DATA type is used 1290 FileStoreUtil.setGenericDataFile(dc, rba, FileType.RAW_DATA, 1291 DataFileType.GENERIC_RAW_DATA, rawDataFile); 1292 </programlisting> 1293 1176 1294 </sect3> 1177 1295 … … 1210 1328 <programlisting> 1211 1329 Experiment e = ... 1330 DbControl dc = ... 1212 1331 RawDataType rdt = e.getRawDataType(); 1213 1332 if (!rdt.isStoredInDb()) 1214 1333 { 1215 Platform p = rdt.getPlatform( );1216 PlatformVariant v = rdt.getVariant( );1334 Platform p = rdt.getPlatform(dc); 1335 PlatformVariant v = rdt.getVariant(dc); 1217 1336 // Check that platform/variant is supported 1218 1337 // ... run plug-in code ... -
trunk/src/core/net/sf/basedb/core/DataFileType.java
r3820 r3835 29 29 import net.sf.basedb.core.filehandler.DataFileMetadataReader; 30 30 import net.sf.basedb.core.filehandler.DataFileValidator; 31 import net.sf.basedb.core.query.Expressions; 31 32 import net.sf.basedb.core.query.Hql; 32 33 import net.sf.basedb.core.query.Restrictions; … … 177 178 { 178 179 return new ItemQuery<DataFileType>(DataFileType.class); 180 } 181 182 /** 183 Get a query configured to retrieve <code>DataFileType</code>:s 184 that can be used on a given item. This method will check the 185 {@link FileStoreEnabled#getPlatform()} and {@link FileStoreEnabled#getVariant()} 186 values and restrict the query to only return items that can be used for 187 that platform. If the item isn't attached to any platform or variant 188 all data file types for the {@link Identifiable#getType()} are returned. 189 190 @param item The item to get data file types for, or null 191 to return all data file types 192 @return An {@link ItemQuery} object 193 */ 194 public static ItemQuery<DataFileType> getQuery(FileStoreEnabled item) 195 { 196 ItemQuery<DataFileType> query = new ItemQuery<DataFileType>(DataFileType.class); 197 if (item != null) 198 { 199 // Restrict on itemType 200 Item itemType = item.getType(); 201 query.restrictPermanent( 202 Restrictions.eq( 203 Hql.property("itemType"), 204 Expressions.integer(itemType.getValue()) 205 ) 206 ); 207 208 // Restrict on platform / variant 209 PlatformVariant variant = item.getVariant(); 210 Platform platform = variant != null ? variant.getPlatform() : item.getPlatform(); 211 if (platform != null) 212 { 213 query.join(Hql.innerJoin("platforms", "pft")); 214 query.restrict(Restrictions.eq(Hql.property("pft", "platform"), Hql.entity(platform))); 215 if (variant != null) 216 { 217 query.restrict(Restrictions.or( 218 Restrictions.eq(Hql.property("pft", "variant"), null), 219 Restrictions.eq(Hql.property("pft", "variant"), Hql.entity(variant)) 220 )); 221 } 222 else 223 { 224 query.restrict(Restrictions.eq(Hql.property("pft", "variant"), null)); 225 } 226 } 227 } 228 return query; 179 229 } 180 230 -
trunk/src/core/net/sf/basedb/core/FileSetMember.java
r3820 r3835 195 195 } 196 196 197 /** 198 Set the validation status of this member. 199 @param valid If the member file is valid or not, use null to 200 indicate that no validation has been performed 201 @param errorMessage The error message if the validation failes 202 */ 197 203 public void setValid(Boolean valid, String errorMessage) 198 204 { -
trunk/src/core/net/sf/basedb/core/data/DataFileTypeData.java
r3820 r3835 216 216 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.FileSetMemberData" 217 217 */ 218 Set<FileSetMemberData> get Members()218 Set<FileSetMemberData> getFileSetMembers() 219 219 { 220 220 return members; 221 221 } 222 void set Members(Set<FileSetMemberData> members)222 void setFileSetMembers(Set<FileSetMemberData> members) 223 223 { 224 224 this.members = members; -
trunk/src/core/net/sf/basedb/core/data/PlatformData.java
r3820 r3835 108 108 /** 109 109 If this platform can only be used with files. 110 @hibernate.property column="`file_only`" type="boolean" not-null="true" 110 @hibernate.property column="`file_only`" type="boolean" not-null="true" update="false" 111 111 */ 112 112 public boolean isFileOnly() … … 123 123 The raw data type this platform is locked to, or null. 124 124 Only used if fileOnly=false 125 @hibernate.property column="`rawdatatype`" type="string" length="255" not-null="false" 125 @hibernate.property column="`rawdatatype`" type="string" length="255" 126 not-null="false" update="false" 126 127 */ 127 128 public String getRawDataType() … … 138 139 The number of channels this platform uses. Only used 139 140 if fileOnly=true 140 @hibernate.property column="`channels`" type="int" not-null="true" 141 @hibernate.property column="`channels`" type="int" not-null="true" update="false" 141 142 */ 142 143 public int getChannels() -
trunk/src/core/net/sf/basedb/core/data/PlatformVariantData.java
r3820 r3835 106 106 /** 107 107 If this platform variant can only be used with files. 108 @hibernate.property column="`file_only`" type="boolean" not-null="true" 108 @hibernate.property column="`file_only`" type="boolean" not-null="true" update="false" 109 109 */ 110 110 public boolean isFileOnly() … … 121 121 The raw data type this platform variant is locked to, or null. 122 122 Only used if fileOnly=false 123 @hibernate.property column="`rawdatatype`" type="string" length="255" not-null="false" 123 @hibernate.property column="`rawdatatype`" type="string" length="255" 124 not-null="false" update="false" 124 125 */ 125 126 public String getRawDataType() … … 136 137 The number of channels this platform variant uses. Only used 137 138 if fileOnly=true 138 @hibernate.property column="`channels`" type="int" not-null="true" 139 @hibernate.property column="`channels`" type="int" not-null="true" update="false" 139 140 */ 140 141 public int getChannels() -
trunk/src/core/net/sf/basedb/core/filehandler/AbstractDataFileHandler.java
r3820 r3835 1 1 /* 2 $Id $2 $Id:AbstractDataFileHandler.java 3820 2007-10-12 10:03:18Z nicklas $ 3 3 4 4 Copyright (C) 2007 Nicklas Nordborg … … 43 43 @author Nicklas 44 44 @version 2.5 45 @base.modified $Date $45 @base.modified $Date:2007-10-12 12:03:18 +0200 (Fri, 12 Oct 2007) $ 46 46 */ 47 47 public abstract class AbstractDataFileHandler … … 82 82 /** 83 83 Get the file set member of a specific {@link DataFileType}. 84 @param dataFileType The external ID of the data file type .84 @param dataFileType The external ID of the data file type 85 85 @return The file set member or null if no member of 86 86 that type is found
Note: See TracChangeset
for help on using the changeset viewer.