Changeset 3783
- Timestamp:
- Sep 25, 2007, 2:30:55 PM (16 years ago)
- Location:
- branches/filedb
- Files:
-
- 7 added
- 1 deleted
- 72 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/filedb/build.xml
r3738 r3783 605 605 jarfile="${jar}/ExamplePlugins.jar" 606 606 manifest="${exampledir}/MANIFEST.MF" 607 /> 607 > 608 <metainf file="${exampledir}/base-plugins.xml"></metainf> 609 <metainf file="${exampledir}/base-configurations.xml"></metainf> 610 </jar> 608 611 </target> 609 612 -
branches/filedb/config/dist/base.config
r3719 r3783 138 138 139 139 # The path to the directory where external plugins are installed 140 plugin .dir=/usr/local/base2/plugins140 plugins.dir=/usr/local/base2/plugins 141 141 142 142 # Number of minutes to keep permission information for the logged -
branches/filedb/doc/src/docbook/admindoc/installation_upgrade.xml
r3725 r3783 343 343 </listitem> 344 344 </varlistentry> 345 <varlistentry >346 <term id="installation_upgrade.jobagent.user_account">Enable the job agent user account</term>345 <varlistentry id="installation_upgrade.jobagent.user_account"> 346 <term>Enable the job agent user account</term> 347 347 <listitem> 348 348 <para> … … 367 367 <para> 368 368 <variablelist> 369 <varlistentry >370 <term id="installation_upgrade.jobagent.database">Create a user account on the database</term>369 <varlistentry id="installation_upgrade.jobagent.database"> 370 <term>Create a user account on the database</term> 371 371 <listitem> 372 372 <para> … … 413 413 </listitem> 414 414 </varlistentry> 415 <varlistentry >416 <term id="installation_upgrade.jobagent.client.config">Edit the <filename>base.config</filename> file</term>415 <varlistentry id="installation_upgrade.jobagent.client.config"> 416 <term>Edit the <filename>base.config</filename> file</term> 417 417 <listitem> 418 418 <para> … … 462 462 </listitem> 463 463 </varlistentry> 464 <varlistentry >465 <term id="installation_upgrade.jobagent.client.properties">Edit464 <varlistentry id="installation_upgrade.jobagent.client.properties"> 465 <term>Edit 466 466 the <filename>jobagent.properties</filename> file</term> 467 467 <listitem> … … 744 744 </varlistentry> 745 745 746 <varlistentry >747 <term id="installation_upgrade.installation.database">BASE (database engine)</term>746 <varlistentry id="installation_upgrade.installation.database"> 747 <term>BASE (database engine)</term> 748 748 <listitem> 749 749 <para> … … 841 841 </varlistentry> 842 842 843 <varlistentry >844 <term id="installation_upgrade.installation.configuration">BASE (configuration)</term>843 <varlistentry id="installation_upgrade.installation.configuration"> 844 <term>BASE (configuration)</term> 845 845 <listitem> 846 846 <para> -
branches/filedb/doc/src/docbook/admindoc/plugin_installation.xml
r3755 r3783 85 85 and click on the &gbNew; button. The pop-up window that appears looks different 86 86 depending on if 87 <property>plugin .dir</property>87 <property>plugins.dir</property> 88 88 in 89 89 <filename>base.config</filename> -
branches/filedb/doc/src/docbook/appendix/base.config.xml
r3753 r3783 601 601 </varlistentry> 602 602 <varlistentry> 603 <term><property>plugin .dir</property></term>603 <term><property>plugins.dir</property></term> 604 604 <listitem> 605 605 <para> -
branches/filedb/doc/src/docbook/developerdoc/api_overview.xml
r3757 r3783 649 649 <sect2 id="data_api.files"> 650 650 <title>Files and directories</title> 651 652 <para> 653 This section covers the details of the BASE file 654 system. 655 </para> 656 657 <sect3 id="data_api.files.uml"> 658 <title>UML diagram</title> 659 660 <figure id="data_api.figures.files"> 661 <title>Files and directories</title> 662 <screenshot> 663 <mediaobject> 664 <imageobject> 665 <imagedata 666 fileref="figures/uml/datalayer.files.png" format="PNG" /> 667 </imageobject> 668 </mediaobject> 669 </screenshot> 670 </figure> 671 </sect3> 672 673 <sect3 id="data_api.files.description"> 674 <title>Description</title> 675 676 <para> 677 The <classname>DirectoryData</classname> class holds 678 information about directories. Directories are organised in the 679 ususal way as as tree structure. All directories must have 680 a parent directory, except the system-defined root directory. 681 </para> 682 683 <para> 684 The <classname>FileData</classname> class holds information about 685 a file. The actual file contents is stored on disk in the directory 686 specified by the <varname>userfiles</varname> setting in 687 <filename>base.config</filename>. The <varname>internalName</varname> 688 property is the name of the file on disk, but this is never exposed to 689 client applications. The filenames and directories 690 on the disk doesn't correspond to the the filenames and directories in 691 BASE. 692 </para> 693 694 <para> 695 The <varname>location</varname> property can take three values: 696 </para> 697 698 <itemizedlist> 699 <listitem> 700 <para> 701 0 = The file is offline, ie. there is no file on the disk 702 </para> 703 </listitem> 704 <listitem> 705 <para> 706 1 = The file is in primary storage, ie. it is located on the disk 707 and can be used by BASE 708 </para> 709 </listitem> 710 <listitem> 711 <para> 712 2 = The file is in secondary storage, ie. it has been moved to some 713 other place and can't be used by BASE immediately. 714 </para> 715 </listitem> 716 </itemizedlist> 717 718 <para> 719 The <varname>action</varname> property controls how a file is 720 moved between primary and seconday storage. It can have the following 721 values: 722 </para> 723 724 <itemizedlist> 725 <listitem> 726 <para> 727 0 = Do nothing 728 </para> 729 </listitem> 730 <listitem> 731 <para> 732 1 = If the file is in secondary storage, move it back to the primary storage 733 </para> 734 </listitem> 735 <listitem> 736 <para> 737 2 = If the file is in primary storage, move it to the secondary storage 738 </para> 739 </listitem> 740 </itemizedlist> 741 742 <para> 743 The actual moving between primary and secondary storage is done by an 744 external program. See 745 <xref linkend="appendix.base.config.secondary" /> and 746 <xref linkend="plugin_developer.other.secondary" /> for more information. 747 </para> 748 749 <para> 750 The <varname>md5</varname> property can be used to check for file 751 corruption when it is moved between primary and secondary storage or 752 when a user re-uploads a file that has been offline. 753 </para> 754 755 <para> 756 BASE can store files in a compressed format. This is handled internally 757 and is not visible to client applications. The <varname>compressed</varname> 758 and <varname>diskSize</varname> properties are used to store information 759 about this. A file may always be compressed if the users says so, but 760 BASE can also do this automatically if the file is uploaded 761 to a directory with the <varname>autoCompress</varname> flag set 762 or if the file has MIME type with the <varname>autoCompress</varname> 763 flag set. 764 </para> 765 766 <para> 767 The <classname>FileTypeData</classname> class holds information about 768 file types. It is used only to make it easier for users to organise 769 their files. 770 </para> 771 772 <para> 773 The <classname>MimeTypeData</classname> is used to register mime types and 774 map them to file extensions. The information is only used to lookup values 775 when needed. Given the filename we can set the <varname>File.mimeType</varname> 776 and <varname>File.fileType</varname> properties. The MIME type is also 777 used to decide if a file should be stored in a compressed format or not. 778 The extension of a MIME type must be unique. Extensions should be registered 779 without a dot, ie <emphasis>html</emphasis>, not <emphasis>.html</emphasis>. 780 </para> 781 782 </sect3> 783 784 651 785 </sect2> 652 786 -
branches/filedb/doc/src/docbook/developerdoc/plugin_developer.xml
r3755 r3783 117 117 manifest="MANIFEST.MF" 118 118 > 119 <!--Include this to add required files for auto registration wizard--> 120 <metainf file="./base-plugins.xml"></metainf> 121 <metainf file="./base-configurations.xml"></metainf> 119 122 </jar> 120 123 … … 133 136 Class-Path: OtherJar.jar ASecondJar.jar</programlisting> 134 137 </para> 138 <para> 139 If your plugin should support registration with the auto-installation-wizzard it 140 could be a good idea to add the 141 <sgmltag class="element">metainf</sgmltag> 142 tags. By doing this you don't have to insert any files to the plugin-jar file 143 after it had been created. Place the 144 <filename>base-plugins.xml</filename> 145 and 146 <filename>base-configurations.xml</filename> 147 (if any configurations are shipped with the plugin) in the project root 148 directory before you compile. The files will end up in the jar-file's 149 <filename class="directory">META-INF</filename> 150 . Go to 151 <xref linkend="plugin_developer.organize.autoinstallcompatible" /> 152 to get more information how to create this files. 153 </para> 135 154 </sect3> 136 155 … … 156 175 <title>With Eclipse</title> 157 176 <para> 158 If somebody is willing to add information to this 159 chapter please send us a note or some written text to put here. 160 Otherwise, this chapter will be removed. 177 If somebody is willing to add information to this chapter please send us a note or 178 some written text to put here. Otherwise, this chapter will be removed. 161 179 </para> 162 180 </sect2> 163 181 164 182 <sect2 id="plugin_developer.organize.autoinstallcompatible"> 165 183 <title>To be installed with auto install</title> 166 184 <para> 167 185 A jar-file with plugins needs to have a specific XML-file in it's 186 <filename>META-INF</filename> 187 folder if the plugins should be possible to use with the auto installation in BASE. 188 The XML-file should have the name 189 <filename>base-plugins.xml</filename> 190 and be in the format described below. 191 </para> 192 <programlisting><?xml version="1.0" encoding="UTF-8"?> 193 <!DOCTYPE plugins SYSTEM "base-plugins.dtd" > 194 <plugins jarname="<filename>jarfile.jar</filename>"> 195 <pluginclass classname="<classname>se.lu.thep.PluginClass</classname>"> 196 <minbaseversion>2.4</minbaseversion> 197 <hasconfigurations/> 198 </pluginclass> 199 . 200 . 201 . 202 </plugins></programlisting> 203 <para> 204 The first two lines should be the same in all base-plugins.xml, rest of the tags are 205 described in following list. 206 <variablelist> 207 <varlistentry> 208 <term><sgmltag class="element">plugins</sgmltag></term> 209 <listitem> 210 <para> 211 This is the root element in the XML-file and must have the 212 attribute 213 <sgmltag class="attribute">jarname</sgmltag> 214 set. The attribute should hold the name of the jar-file the XML-file 215 is in. 216 </para> 217 </listitem> 218 </varlistentry> 219 <varlistentry> 220 <term> 221 <sgmltag class="element">pluginclass</sgmltag> 222 </term> 223 <listitem> 224 <para> 225 This tag defines information about each plugin in the jar-file. The 226 <sgmltag class="attribute">classname</sgmltag> 227 attribute needs to have the full classname of the plugin's main 228 class. There can be one or several of this element inside the 229 <sgmltag>plugins</sgmltag> 230 tag, which means that there should be one pluginclass-element for 231 each plugin in the jar. 232 </para> 233 </listitem> 234 </varlistentry> 235 <varlistentry> 236 <term> 237 <sgmltag class="element">minbaseversion</sgmltag> 238 </term> 239 <listitem> 240 <para> 241 A required child element in 242 <sgmltag class="element">pluginclass</sgmltag> 243 . This defines from which version of BASE the plugin can be used. 244 The plugin will not be included in auto installer if the 245 BASE-version is lower then the value of this tag. Format of the 246 value in this tag should be 247 <emphasis>majorversion</emphasis>.<emphasis>minorversion</emphasis> 248 </para> 249 </listitem> 250 </varlistentry> 251 <varlistentry> 252 <term> 253 <sgmltag class="element">hasconfigurations</sgmltag> 254 </term> 255 <listitem> 256 <para> 257 A required child element in 258 <sgmltag class="element">pluginclass</sgmltag> 259 . This should tell if there are plugin configurations 260 shipped with the plugin. Setting the value to 261 <emphasis>yes</emphasis> 262 will indicate that there are available configurations in the 263 jar-file. This can be left as an empty tag if no 264 configurations are available for import. 265 </para> 266 <para> 267 Configurations shipped with a jar-file should be exported with the 268 plugin configuration exporter in BASE. The exported file must have 269 the name 270 <filename>base-configurations.xml</filename> 271 . This file has to be put in the jar-file's 272 <filename class="directory">META-INF</filename> 273 folder together with 274 <filename>base-plugins.xml</filename>. 275 </para> 276 </listitem> 277 </varlistentry> 278 </variablelist> 168 279 </para> 169 280 </sect2> -
branches/filedb/doc/src/docbook/overviewdoc/resources.xml
r3699 r3783 222 222 <title>Demo server</title> 223 223 <para> 224 There is a demo server available for anyone to use and to225 explore BASE without having to install anything. Follow the link226 from BASE web site to the demo server or go directlyto224 There is a demo server up running for anyone who wants to explore BASE 2 without having 225 to install it. Follow the link on BASE 2's home page to the demo server or go directly 226 to 227 227 <ulink url="http://base2.thep.lu.se/demo/"> 228 228 http://base2.thep.lu.se/demo/ … … 285 285 </important> 286 286 </sect1> 287 288 <sect1 id="resources.basehacks"> 289 <title>BASE-hacks</title> 290 <para> 291 There is a trac/subversion server keeping track of changes made 292 to third party projects that are changed to make them work with 293 BASE. Open source project usually have a requirement that 294 changes are made public. On 295 the <ulink 296 url='http://trac.thep.lu.se/trac/basehacks'>BASE-hacks web 297 site</ulink> you will find a list of modified packages and 298 information about the changes performed. 299 </para> 300 </sect1> 301 287 302 </chapter> -
branches/filedb/doc/src/docbook/userdoc/analyse_mev.xml
r3679 r3783 29 29 <sect1 id="experiments_analysis.mev"> 30 30 <title>Analysing data with Multiexperiment Viewer (MeV)</title> 31 <para>TODO</para> 31 <para> 32 MeV is a versatile microarray data analysis tool, incorporating 33 sophisticated algorithms for clustering, visualization, 34 classification, statistical analysis and biological theme 35 discovery, <ulink 36 url='http://www.tm4.org'>http://www.tm4.org</ulink>. We use a 37 modified version of MeV and provide information about the changes 38 at 39 the <ulink url='http://trac.thep.lu.se/trac/basehacks'>BASE-hacks 40 web site</ulink>. 41 </para> 32 42 </sect1> -
branches/filedb/doc/src/docbook/userdoc/index.xml
r3675 r3783 29 29 <?dbhtml dir="userdoc"?> 30 30 <title>User documentation</title> 31 <include file=" about.xml"/>31 <include file="userdoc_overview.xml"/> 32 32 <include file="webclient.xml"/> 33 33 <include file="project_permission.xml"/> -
branches/filedb/src/clients/migrate/net/sf/basedb/clients/migrate/QuotaTransfer.java
r3725 r3783 97 97 quotas.put(totalQuota, quota); 98 98 } 99 else 99 else if (quota.isInDatabase()) 100 100 { 101 101 quota = Quota.getById(dc, quota.getId()); -
branches/filedb/src/clients/web/net/sf/basedb/clients/web/Base.java
r3679 r3783 511 511 if (value != null) 512 512 { 513 boolean hasWildcard = value.indexOf('%') >= 0; 513 514 Type valueType = Type.valueOf(name.substring(7, colonIndex)); 514 515 … … 517 518 filter.setValueType(valueType); 518 519 519 Operator op = Operator.EQ;520 Operator op = hasWildcard ? Operator.LIKE : Operator.EQ; 520 521 if (value.startsWith("<>") || value.startsWith("!=")) 521 522 { 522 op = Operator.NEQ;523 op = hasWildcard ? Operator.NOTLIKE : Operator.NEQ; 523 524 value = value.substring(2); 524 525 } … … 545 546 else if (value.startsWith("=")) 546 547 { 547 op = Operator.EQ;548 op = hasWildcard ? Operator.LIKE : Operator.EQ; 548 549 value = value.substring(1); 549 }550 else if (value.indexOf('%') >= 0)551 {552 op = Operator.LIKE;553 550 } 554 551 if ("".equals(value)) value = null; … … 669 666 {} 670 667 } 671 if (op == Operator.EQ && (value == null || (value != null && value.indexOf('%') >= 0)))668 if (op == Operator.EQ && value == null) 672 669 { 673 670 result = "="; 674 671 } 675 else if (op == Operator.NEQ )672 else if (op == Operator.NEQ || op == Operator.NOTLIKE) 676 673 { 677 674 result = "<>"; -
branches/filedb/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java
r3679 r3783 227 227 String whichItems = (String)job.getValue(WHICH_ITEMS); 228 228 String format = (String)job.getValue(FORMAT); 229 List<Integer> selectedItems = (List<Integer>)job.getValues("item");230 229 List<String> columns = (List<String>)job.getValues(WHICH_PROPERTIES); 231 230 … … 265 264 QueryWrapper queryWrapper = null; 266 265 ResultIterator result = null; 266 Set<Integer>selectedItems = cc.getSelected(); 267 267 268 268 // The query wrapper allows us to get results from the query in a simplier way -
branches/filedb/src/clients/web/net/sf/basedb/clients/web/taglib/table/Navigator.java
r3679 r3783 337 337 sb.append(" (").append(totalRows).append(totalRows == 1 ? " hit" : " hits"); 338 338 sb.append(", <input name=\"rowsperpage\" class=\"text\" type=\"text\" value=\"").append(rowsPerPage).append("\""); 339 sb.append(" size=\" 2\" maxlength=\"2\" onkeypress=\"return Numbers.integerOnly(event, true);\"> per page");339 sb.append(" size=\"3\" maxlength=\"3\" onkeypress=\"return Numbers.integerOnly(event, true);\"> per page"); 340 340 sb.append(")</td></tr>\n"); 341 341 try -
branches/filedb/src/core/net/sf/basedb/core/AbstractBatcher.java
r3679 r3783 75 75 76 76 /** 77 Constructor that initiate everything. 78 79 @param dc The <code>DbControl</code> to get database access 77 Constructor for a batcher. 80 78 @throws BaseException If there is an error 81 79 */ 82 AbstractBatcher(DbControl dc) 83 { 84 assert dc != null : "dc == null"; 85 this.dc = new WeakReference<DbControl>(dc); 86 this.sc = dc.getSessionControl(); 80 AbstractBatcher() 81 { 87 82 this.batchSize = Config.getInt("db.batch-size", 50); 88 dc.addBatcher(this);89 83 } 90 84 … … 133 127 { 134 128 sc.updateLastAccess(); 129 } 130 131 /** 132 Set the DbControl that is controlling this batcher. This 133 method MUST be called by all subclasses after successful construction 134 of a batcher. This method also registers the batcher with the DbControl 135 using {@link DbControl#addBatcher(Batcher)} 136 @since 2.4.2 137 */ 138 protected final void setDbControl(DbControl dc) 139 { 140 assert dc != null : "dc == null"; 141 this.dc = new WeakReference<DbControl>(dc); 142 this.sc = dc.getSessionControl(); 143 dc.addBatcher(this); 135 144 } 136 145 -
branches/filedb/src/core/net/sf/basedb/core/Application.java
r3719 r3783 408 408 log.info("plugins.autounload = " + autoUnloadPlugins); 409 409 410 String plugin Dir = Config.getString("plugin.dir");411 nonCorePluginDirectory = plugin Dir != null ? new java.io.File(pluginDir) : null;410 String pluginsDir = Config.getString("plugins.dir"); 411 nonCorePluginDirectory = pluginsDir != null ? new java.io.File(pluginsDir) : null; 412 412 log.info("plugins.dir = " + nonCorePluginDirectory); 413 413 -
branches/filedb/src/core/net/sf/basedb/core/ArrayDesign.java
r3741 r3783 59 59 public class ArrayDesign 60 60 extends AnnotatedItem<ArrayDesignData> 61 implements FileStoreEnabled 61 62 { 62 63 … … 78 79 @return The new <code>ArrayDesign</code> item 79 80 @throws BaseException If there is an error 81 @deprecated Use {@link #getNew(DbControl, Platform)} instead 80 82 */ 81 83 public static ArrayDesign getNew(DbControl dc, boolean affyChip) 82 84 throws BaseException 83 85 { 86 Platform platform = Platform.getById(dc, 87 SystemItems.getId(affyChip ? Platform.AFFYMETRIX : Platform.GENERIC)); 88 return getNew(dc, platform); 89 } 90 91 public static ArrayDesign getNew(DbControl dc, Platform platform) 92 { 84 93 ArrayDesign ad = dc.newItem(ArrayDesign.class); 85 94 ad.setName("New array design"); 86 ad. getData().setAffyChip(affyChip);95 ad.setPlatform(platform); 87 96 return ad; 88 } 89 97 98 } 99 90 100 /** 91 101 Get an <code>ArrayDesign</code> item when you know the ID. … … 154 164 } 155 165 // ------------------------------------------- 156 166 /* 167 From the FileStoreEnabled interface 168 ------------------------------------------- 169 */ 170 public FileSet getFileSet() 171 { 172 DbControl dc = getDbControl(); 173 FileSet fs = dc.getItem(FileSet.class, getData().getFileSet(), this); 174 if (fs == null) 175 { 176 fs = FileSet.getNew(dc, this); 177 getData().setFileSet(fs.getData()); 178 dc.saveItemIf(this, fs, false); 179 } 180 return fs; 181 } 182 public boolean hasFileSet() 183 { 184 return getData().getFileSet() != null; 185 } 186 public Platform getPlatform() 187 { 188 return getDbControl().getItem(Platform.class, getData().getPlatform()); 189 } 190 public PlatformVariant getVariant() 191 { 192 return getDbControl().getItem(PlatformVariant.class, getData().getVariant()); 193 } 194 // ------------------------------------------- 157 195 /* 158 196 From the BasicItem class … … 227 265 // ------------------------------------------- 228 266 229 /** 230 @return TRUE if this is an AffyChip, FALSE otherwise. 267 private void setPlatform(Platform platform) 268 { 269 if (platform == null) throw new InvalidUseOfNullException("platform"); 270 getData().setPlatform(platform.getData()); 271 } 272 273 private void setVariant(PlatformVariant variant) 274 { 275 if (variant == null) throw new InvalidUseOfNullException("variant"); 276 getData().setVariant(variant.getData()); 277 } 278 279 /** 280 @return TRUE if this is an AffyChip, FALSE otherwise. 281 @deprecated Use {@link #getPlatform()} instead and compare the 282 system ID with {@link Platform#AFFYMETRIX} 231 283 */ 232 284 public boolean isAffyChip() 233 285 { 234 return getData().isAffyChip();286 return Platform.AFFYMETRIX.equals(getData().getPlatform().getSystemId()); 235 287 } 236 288 -
branches/filedb/src/core/net/sf/basedb/core/BasicBatcher.java
r3679 r3783 131 131 Constructor that initiate everything. 132 132 133 @param dc DbControl to get database access134 133 @param dataClass The class of the data objects that are accepted by this batcher 135 134 @param entityName The entity name of the data as known by Hibernate, use null … … 137 136 @throws BaseException If there is an error 138 137 */ 139 BasicBatcher( DbControl dc, Class<D> dataClass, String entityName)140 throws BaseException 141 { 142 super( dc);138 BasicBatcher(org.hibernate.Session session, Class<D> dataClass, String entityName) 139 throws BaseException 140 { 141 super(); 143 142 assert dataClass != null : "dataClass == null"; 144 143 … … 159 158 try 160 159 { 161 java.sql.Connection c = HibernateUtil.getConnection( dc.getHibernateSession());160 java.sql.Connection c = HibernateUtil.getConnection(session); 162 161 insertStatement = c.prepareStatement(insertSql); 163 162 updateStatement = c.prepareStatement(updateSql); -
branches/filedb/src/core/net/sf/basedb/core/DbControl.java
r3679 r3783 269 269 batcher.close(); 270 270 } 271 catch ( BaseExceptionex)271 catch (Throwable ex) 272 272 { 273 273 log.warn("Exception during rollback in batcher.close()", ex); … … 281 281 if (hStatelessSession != null) HibernateUtil.close(hStatelessSession); 282 282 } 283 catch ( BaseExceptionex)283 catch (Throwable ex) 284 284 { 285 285 log.warn("Exception during rollback in Hibernate", ex); -
branches/filedb/src/core/net/sf/basedb/core/FeatureBatcher.java
r3679 r3783 91 91 throws BaseException 92 92 { 93 super(dc , FeatureData.class, null);93 super(dc.getHibernateSession(), FeatureData.class, null); 94 94 this.arrayDesign = arrayDesign; 95 95 this.arrayDesignData = arrayDesign.getData(); 96 96 this.isAffy = arrayDesign.isAffyChip(); 97 setDbControl(dc); 97 98 } 98 99 -
branches/filedb/src/core/net/sf/basedb/core/FilterBatcher.java
r3679 r3783 142 142 FilterBatcher(DbControl dc, BioAssaySet bioAssaySet) 143 143 { 144 super( dc);144 super(); 145 145 this.bioAssaySet = bioAssaySet; 146 146 this.bytesPerRow = VirtualTable.FILTER.getBytesPerRow(bioAssaySet.getRawDataType()); 147 setDbControl(dc); 147 148 } 148 149 -
branches/filedb/src/core/net/sf/basedb/core/Install.java
r3764 r3783 679 679 if (progress != null) progress.display((int)(25*progress_factor), "--Creating data file types..."); 680 680 FileSetMemberTypeData celFile = createFileSetMemberType( 681 "affymetri c.cel", "CEL file", "Affymetrix CEL file",681 "affymetrix.cel", "CEL file", "Affymetrix CEL file", 682 682 Item.RAWBIOASSAY, "cel", rawDataType, true, 683 683 "todo", "todo"); 684 684 FileSetMemberTypeData cdfFile = createFileSetMemberType( 685 "affymetri c.cdf", "CDF file", "Affymetrix CDF file",685 "affymetrix.cdf", "CDF file", "Affymetrix CDF file", 686 686 Item.ARRAYDESIGN, "cdf", reporterMapType, true, 687 687 "todo", "todo"); … … 2238 2238 2239 2239 HibernateUtil.commit(tx); 2240 if (systemId != null) SystemItems.add(platform); 2240 2241 log.info("createPlatform: OK [systemId="+systemId+"]"); 2241 2242 } … … 2293 2294 HibernateUtil.saveData(session, fileType); 2294 2295 HibernateUtil.commit(tx); 2296 if (systemId != null) SystemItems.add(fileType); 2295 2297 log.info("createFileSetMemberType: OK [systemId="+systemId+"]"); 2296 2298 } -
branches/filedb/src/core/net/sf/basedb/core/Item.java
r3764 r3783 513 513 The item is a {@link PlatformFileType} 514 514 */ 515 PLATFORMFILETYPE(352, "Platform file type", "pft", null, PlatformFileTypeData.class, null,515 PLATFORMFILETYPE(352, "Platform file type", "pft", PlatformFileType.class, PlatformFileTypeData.class, null, 516 516 960), 517 517 … … 519 519 The item is a {@link FileSet} 520 520 */ 521 FILESET(353, "File set", "fs", null, FileSetData.class, null,521 FILESET(353, "File set", "fs", FileSet.class, FileSetData.class, null, 522 522 950), 523 523 … … 525 525 The item is a {@link FileSetMember} 526 526 */ 527 FILESETMEMBER(354, "File set member", "fsm", null, FileSetMemberData.class, null,527 FILESETMEMBER(354, "File set member", "fsm", FileSetMember.class, FileSetMemberData.class, null, 528 528 955), 529 529 … … 531 531 The item is a {@link FileSetMemberType} 532 532 */ 533 FILESETMEMBERTYPE(355, "File set member type", "fsmt", null, FileSetMemberTypeData.class, null,534 980) ,533 FILESETMEMBERTYPE(355, "File set member type", "fsmt", FileSetMemberType.class, FileSetMemberTypeData.class, null, 534 980) 535 535 536 536 ; -
branches/filedb/src/core/net/sf/basedb/core/MappingBatcher.java
r3679 r3783 106 106 MappingBatcher(DbControl dc, DataCube dataCube) 107 107 { 108 super( dc);108 super(); 109 109 this.dataCube = dataCube; 110 110 this.noRawMapping = dataCube.isInDatabase(); 111 111 this.bytesPerRow = VirtualTable.RAWPARENTS.getBytesPerRow(dataCube.getRawDataType()); 112 setDbControl(dc); 112 113 } 113 114 -
branches/filedb/src/core/net/sf/basedb/core/Operator.java
r3679 r3783 126 126 return Restrictions.like(lvalue, rvalue); 127 127 } 128 }, 129 130 NOTLIKE(11, "NOT LIKE", "NOT LIKE", true) 131 { 132 public Restriction getRestriction(Expression lvalue, Expression rvalue) 133 throws InvalidDataException 134 { 135 return Restrictions.not(Restrictions.like(lvalue, rvalue)); 136 } 128 137 }; 129 138 -
branches/filedb/src/core/net/sf/basedb/core/Platform.java
r3764 r3783 26 26 import java.util.Set; 27 27 28 import net.sf.basedb.core.data.FileTypeIndex; 28 29 import net.sf.basedb.core.data.PlatformData; 30 import net.sf.basedb.core.data.PlatformFileTypeData; 29 31 import net.sf.basedb.core.query.Hql; 30 32 import net.sf.basedb.core.query.Restrictions; … … 334 336 if (isFileOnly()) 335 337 { 336 // TODO - autogenerate a raw data type 338 // TODO - autogenerate a raw data type in a proper way 339 rdt = new RawDataType(getSystemId(), getName(), getDescription(), getData().getChannels(), 340 "file", null, null, null); 337 341 } 338 342 else … … 369 373 return PlatformVariant.getNew(getDbControl(), this, systemId); 370 374 } 375 376 /** 377 @see PlatformFileType#getQuery(Platform, PlatformVariant, boolean) 378 */ 379 public ItemQuery<PlatformFileType> getFileTypes(PlatformVariant variant, boolean restrict) 380 { 381 return PlatformFileType.getQuery(this, variant, restrict); 382 } 383 384 /** 385 Add a file type to this platform/variant. If the file type has 386 already been registered this method does nothing. 387 @param type The file type 388 @param variant An optional variant 389 @throws PermissionDeniedException If the logged in user doesn't 390 have write permission 391 @throws InvalidUseOfNullException If type is null 392 */ 393 public void addFileType(FileSetMemberType type, PlatformVariant variant) 394 { 395 checkPermission(Permission.WRITE); 396 if (type == null) throw new InvalidUseOfNullException("type"); 397 FileTypeIndex index = new FileTypeIndex(variant == null ? null : variant.getData(), type.getData()); 398 if (!getData().getFileTypes().containsKey(index)) 399 { 400 PlatformFileType platformFileType = 401 PlatformFileType.getNew(getDbControl(), this, variant, type); 402 getData().getFileTypes().put(index, platformFileType.getData()); 403 getDbControl().saveItemIf(this, platformFileType, false); 404 } 405 } 406 407 /** 408 Remove a file type from this platform/variant. If the file 409 type isn't registered this method does nothing. If a variant is given 410 the file type is only removed from that variant. If no variant 411 is given the file type is only removed from the platform, not 412 from other variants that have registered with the file type. 413 414 @param type The file type to remove 415 @param variant An optional variant 416 @throws PermissionDeniedException If the logged in user doesn't 417 have write permission 418 @throws InvalidUseOfNullException If type is null 419 */ 420 public void removeFileType(FileSetMemberType type, PlatformVariant variant) 421 { 422 checkPermission(Permission.WRITE); 423 if (type == null) throw new InvalidUseOfNullException("type"); 424 FileTypeIndex index = new FileTypeIndex(variant == null ? null : variant.getData(), type.getData()); 425 if (getData().getFileTypes().containsKey(index)) 426 { 427 PlatformFileTypeData pfData = getData().getFileTypes().remove(type.getData()); 428 if (pfData != null) 429 { 430 DbControl dc = getDbControl(); 431 PlatformFileType pf = dc.getItem(PlatformFileType.class, pfData); 432 dc.deleteItem(pf); 433 } 434 } 435 } 436 371 437 } -
branches/filedb/src/core/net/sf/basedb/core/PlatformVariant.java
r3764 r3783 367 367 return rdt; 368 368 } 369 370 369 370 /** 371 Get a query returning file types registered with this platform 372 variant. 373 @param restrict If TRUE the query will only return file types that 374 has been directly registered with this variant, if FALSE the 375 query will also return file types that have been registered 376 with the platform 377 @see PlatformFileType#getQuery(Platform, PlatformVariant, boolean) 378 */ 379 public ItemQuery<PlatformFileType> getFileTypes(boolean restrict) 380 { 381 return PlatformFileType.getQuery(getPlatform(), this, restrict); 382 } 383 384 /** 385 Add a file type to this platform variant. If the file type has 386 already been registered this method does nothing. 387 @param type The file type 388 @throws PermissionDeniedException If the logged in user doesn't 389 have write permission to the platform 390 @throws InvalidUseOfNullException If type is null 391 @see Platform#addFileType(FileSetMemberType, PlatformVariant) 392 */ 393 public void addFileType(FileSetMemberType type) 394 { 395 getPlatform().addFileType(type, this); 396 } 397 398 /** 399 Remove a file type from this platform variant. If the file 400 type isn't registered this method does nothing. 401 402 @param type The file type to remove 403 @throws PermissionDeniedException If the logged in user doesn't 404 have write permission to the platform 405 @throws InvalidUseOfNullException If type is null 406 @see Platform#removeFileType(FileSetMemberType, PlatformVariant) 407 */ 408 public void removeFileType(FileSetMemberType type) 409 { 410 getPlatform().removeFileType(type, this); 411 } 371 412 } -
branches/filedb/src/core/net/sf/basedb/core/PluginConfiguration.java
r3679 r3783 467 467 468 468 int newVersion = getNewParameterVersion(); 469 int copyFromVersion = copyFrom.getParameterVersion(); 469 470 try 470 471 { 471 472 for (Map.Entry<VersionedParameter, ParameterValueData<?>> fromEntry : from.entrySet()) 472 473 { 473 VersionedParameter toName = new VersionedParameter(fromEntry.getKey().getName(), newVersion); 474 ParameterValueData<?> fromParameter = fromEntry.getValue(); 475 Class<? extends ParameterValueData> dataClass = fromParameter.getClass(); 476 if (org.hibernate.proxy.HibernateProxy.class.isAssignableFrom(dataClass)) 474 VersionedParameter fromName = fromEntry.getKey(); 475 if (copyFromVersion == fromName.getVersion()) 477 476 { 478 // The 'fromParameter' is a proxy, we need the real data class 479 dataClass = 480 (Class<? extends ParameterValueData>)org.hibernate.Hibernate.getClass(fromParameter); 477 VersionedParameter toName = new VersionedParameter(fromName.getName(), newVersion); 478 ParameterValueData<?> fromParameter = fromEntry.getValue(); 479 Class<? extends ParameterValueData> dataClass = fromParameter.getClass(); 480 if (org.hibernate.proxy.HibernateProxy.class.isAssignableFrom(dataClass)) 481 { 482 // The 'fromParameter' is a proxy, we need the real data class 483 dataClass = 484 (Class<? extends ParameterValueData>)org.hibernate.Hibernate.getClass(fromParameter); 485 } 486 ParameterValueData<?> toParameter = dataClass.newInstance(); 487 toParameter.setLabel(fromParameter.getLabel()); 488 toParameter.setDescription(fromParameter.getDescription()); 489 toParameter.replaceValues(fromParameter.getValues()); 490 to.put(toName, toParameter); 481 491 } 482 ParameterValueData<?> toParameter = dataClass.newInstance();483 toParameter.setLabel(fromParameter.getLabel());484 toParameter.setDescription(fromParameter.getDescription());485 toParameter.replaceValues(fromParameter.getValues());486 to.put(toName, toParameter);487 492 } 488 493 } -
branches/filedb/src/core/net/sf/basedb/core/PositionBatcher.java
r3679 r3783 106 106 PositionBatcher(DbControl dc, DataCube dataCube) 107 107 { 108 super( dc);108 super(); 109 109 this.dataCube = dataCube; 110 110 this.bytesPerRow = VirtualTable.POSITION.getBytesPerRow(dataCube.getRawDataType()); 111 setDbControl(dc); 111 112 } 112 113 -
branches/filedb/src/core/net/sf/basedb/core/PositionExtraValueBatcher.java
r3679 r3783 154 154 PositionExtraValueBatcher(DbControl dc, ExtraValue extraValue) 155 155 { 156 super( dc);156 super(); 157 157 this.extraValue = extraValue; 158 158 this.bytesPerRow = extraValue.getVirtualTable().getBytesPerRow(extraValue.getRawDataType()); 159 159 this.valueType = extraValue.getExtraValueType().getValueType(); 160 160 this.sqlType = valueType.getSQLType(); 161 setDbControl(dc); 161 162 } 162 163 -
branches/filedb/src/core/net/sf/basedb/core/RawBioAssay.java
r3679 r3783 62 62 public class RawBioAssay 63 63 extends AnnotatedItem<RawBioAssayData> 64 implements DiskConsumable 64 implements DiskConsumable, FileStoreEnabled 65 65 { 66 66 /** … … 95 95 @return The new <code>RawBioAssay</code> item 96 96 @throws BaseException If there is an error 97 @deprecated Use {@link #getNew(DbControl, Platform, RawDataType)} or 98 {@link #getNew(DbControl, PlatformVariant, RawDataType)} instead. 99 This method will set the platform to {@link Platform#GENERIC}. 97 100 */ 98 101 public static RawBioAssay getNew(DbControl dc, RawDataType rawDataType) 99 102 throws BaseException 100 103 { 104 Platform generic = Platform.getById(dc, SystemItems.getId(Platform.GENERIC)); 105 return getNew(dc, generic, rawDataType); 106 } 107 108 public static RawBioAssay getNew(DbControl dc, Platform platform, RawDataType rawDataType) 109 { 101 110 RawBioAssay rba = dc.newItem(RawBioAssay.class); 102 rba.setRawDataType(rawDataType); 111 rba.setPlatform(platform); 112 RawDataType platformRdt = platform.getRawDataType(); 113 rba.setRawDataType(platformRdt != null ? platformRdt : rawDataType); 103 114 rba.setName("New raw bioassay"); 104 115 return rba; 105 116 } 117 118 /* 119 public static RawBioAssay getNew(DbControl dc, PlatformVariant variant, RawDataType rawDataType) 120 { 121 122 } 123 */ 106 124 107 125 /** … … 202 220 {} 203 221 return annotatable; 222 } 223 // ------------------------------------------- 224 /* 225 From the FileStoreEnabled interface 226 ------------------------------------------- 227 */ 228 public FileSet getFileSet() 229 { 230 DbControl dc = getDbControl(); 231 FileSet fs = dc.getItem(FileSet.class, getData().getFileSet(), this); 232 if (fs == null) 233 { 234 fs = FileSet.getNew(dc, this); 235 getData().setFileSet(fs.getData()); 236 dc.saveItemIf(this, fs, false); 237 } 238 return fs; 239 } 240 public boolean hasFileSet() 241 { 242 return getData().getFileSet() != null; 243 } 244 public Platform getPlatform() 245 { 246 return getDbControl().getItem(Platform.class, getData().getPlatform()); 247 } 248 public PlatformVariant getVariant() 249 { 250 return getDbControl().getItem(PlatformVariant.class, getData().getVariant()); 204 251 } 205 252 // ------------------------------------------- … … 291 338 { 292 339 super.onBeforeCommit(action); 293 if (action == Transactional.Action.DELETE && getSpots() > 0) 294 { 295 RawDataBatcher rdb = RawDataBatcher.getNew(getDbControl(), this); 296 rdb.deleteAll(); 340 if (action == Transactional.Action.DELETE) 341 { 342 if (getRawDataType().isStoredInDb() && getSpots() > 0) 343 { 344 RawDataBatcher rdb = RawDataBatcher.getNew(getDbControl(), this); 345 rdb.deleteAll(); 346 } 297 347 } 298 348 } 299 349 // ------------------------------------------- 300 350 351 private void setPlatform(Platform platform) 352 { 353 if (platform == null) throw new InvalidUseOfNullException("platform"); 354 getData().setPlatform(platform.getData()); 355 } 356 357 private void setVariant(PlatformVariant variant) 358 { 359 if (variant == null) throw new InvalidUseOfNullException("variant"); 360 getData().setVariant(variant.getData()); 361 } 362 301 363 /** 302 364 Get the raw data type this raw bioassay uses for the raw data. -
branches/filedb/src/core/net/sf/basedb/core/RawDataBatcher.java
r3679 r3783 161 161 throws BaseException 162 162 { 163 super(dc , RawData.class, rawBioAssay.getRawDataType().getEntityName());163 super(dc.getHibernateSession(), RawData.class, rawBioAssay.getRawDataType().getEntityName()); 164 164 this.rawBioAssay = rawBioAssay; 165 165 this.rawBioAssayData = rawBioAssay.getData(); … … 205 205 this.preloaded = null; 206 206 } 207 setDbControl(dc); 207 208 } 208 209 -
branches/filedb/src/core/net/sf/basedb/core/RawDataType.java
r3679 r3783 77 77 this.isStoredInDb = "database".equals(storage); 78 78 this.table = isStoredInDb ? table : null; 79 this.properties = Collections.unmodifiableList(properties);79 this.properties = properties == null ? null : Collections.unmodifiableList(properties); 80 80 this.formulas = formulas; 81 81 this.realTable = isStoredInDb ? new RealTable(table, "raw") : null; … … 89 89 } 90 90 91 this.namedProperties = new HashMap<String, RawDataProperty>(properties.size()); 92 for (RawDataProperty property : properties) 93 { 94 if (namedProperties.put(property.getName(), property) != null) 91 this.namedProperties = new HashMap<String, RawDataProperty>( 92 properties == null ? 0 : properties.size()); 93 if (properties != null) 94 { 95 for (RawDataProperty property : properties) 95 96 { 96 throw new BaseException("RawDataProperty[name="+property.getName()+"] is already defined for raw data type: "+name); 97 if (namedProperties.put(property.getName(), property) != null) 98 { 99 throw new BaseException("RawDataProperty[name="+property.getName()+"] is already defined for raw data type: "+name); 100 } 97 101 } 98 102 } 99 this.namedFormulas = new HashMap<String, IntensityFormula>(formulas.size()); 100 for (IntensityFormula formula : formulas) 101 { 102 if (namedFormulas.put(formula.getName(), formula) != null) 103 104 this.namedFormulas = new HashMap<String, IntensityFormula>( 105 formulas == null ? 0 : formulas.size()); 106 if (formulas != null) 107 { 108 for (IntensityFormula formula : formulas) 103 109 { 104 throw new BaseException("IntensityFormula[name="+formula.getName()+"] is already defined for raw data type: "+name); 110 if (namedFormulas.put(formula.getName(), formula) != null) 111 { 112 throw new BaseException("IntensityFormula[name="+formula.getName()+"] is already defined for raw data type: "+name); 113 } 105 114 } 106 115 } 107 108 116 } 109 117 -
branches/filedb/src/core/net/sf/basedb/core/ReporterBatcher.java
r3679 r3783 77 77 throws BaseException 78 78 { 79 super(dc , ReporterData.class, null);79 super(dc.getHibernateSession(), ReporterData.class, null); 80 80 extendedProperties = ExtendedProperties.getProperties("ReporterData"); 81 81 batchedExternalIds = HibernateUtil.getDbEngine().caseInsensitiveComparison() ? 82 82 new TreeSet<String>(String.CASE_INSENSITIVE_ORDER) : new HashSet<String>(); 83 setDbControl(dc); 83 84 } 84 85 -
branches/filedb/src/core/net/sf/basedb/core/SpotBatcher.java
r3679 r3783 141 141 SpotBatcher(DbControl dc, BioAssaySet bioAssaySet) 142 142 { 143 super( dc);143 super(); 144 144 this.bioAssaySet = bioAssaySet; 145 145 this.numChannels = bioAssaySet.getRawDataType().getChannels(); 146 146 this.bytesPerRow = VirtualTable.SPOT.getBytesPerRow(bioAssaySet.getRawDataType()); 147 setDbControl(dc); 147 148 } 148 149 -
branches/filedb/src/core/net/sf/basedb/core/SpotExtraValueBatcher.java
r3679 r3783 144 144 SpotExtraValueBatcher(DbControl dc, ExtraValue extraValue) 145 145 { 146 super( dc);146 super(); 147 147 this.extraValue = extraValue; 148 148 this.bytesPerRow = extraValue.getVirtualTable().getBytesPerRow(extraValue.getRawDataType()); 149 149 this.valueType = extraValue.getExtraValueType().getValueType(); 150 150 this.sqlType = valueType.getSQLType(); 151 setDbControl(dc); 151 152 } 152 153 -
branches/filedb/src/core/net/sf/basedb/core/data/FileSetData.java
r3764 r3783 24 24 package net.sf.basedb.core.data; 25 25 26 import java.util.Set; 26 import java.util.HashMap; 27 import java.util.Map; 27 28 28 29 /** … … 55 56 } 56 57 57 private Set<FileSetMemberData> members;58 private Map<FileSetMemberTypeData, FileSetMemberData> members; 58 59 /** 59 60 The members of this file set. This is the inverse end. 60 61 @see FileSetMemberData#getFileSet() 61 @hibernate. setlazy="true" cascade="delete" inverse="true"62 @hibernate.map lazy="true" cascade="delete" inverse="true" 62 63 @hibernate.collection-key column="`fileset_id`" 64 @hibernate.index-many-to-many column="`filesetmembertype_id`" class="net.sf.basedb.core.data.FileSetMemberTypeData" 63 65 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.FileSetMemberData" 64 66 */ 65 Set<FileSetMemberData> getMembers()67 public Map<FileSetMemberTypeData, FileSetMemberData> getMembers() 66 68 { 69 if (members == null) 70 { 71 members = new HashMap<FileSetMemberTypeData, FileSetMemberData>(); 72 } 67 73 return members; 68 74 } 69 void setMembers( Set<FileSetMemberData> members)75 void setMembers(Map<FileSetMemberTypeData, FileSetMemberData> members) 70 76 { 71 77 this.members = members; -
branches/filedb/src/core/net/sf/basedb/core/data/FileSetMemberData.java
r3764 r3783 72 72 /** 73 73 Get the file. 74 @hibernate.many-to-one outer-join="false" update="false"74 @hibernate.many-to-one outer-join="false" 75 75 @hibernate.column name="`file_id`" not-null="true" 76 76 */ -
branches/filedb/src/core/net/sf/basedb/core/data/FileStoreEnabledData.java
r3764 r3783 58 58 { 59 59 /** 60 Get the file set attached to this item 60 Get the file set attached to this item. 61 61 @return A {@link FileSetData} object or null if no files are attached 62 62 @hibernate.many-to-one column="`fileset_id`" not-null="false" outer-join="false" 63 unique="true" cascade="delete" 63 64 */ 64 65 public FileSetData getFileSet(); -
branches/filedb/src/core/net/sf/basedb/core/data/PlatformData.java
r3764 r3783 24 24 package net.sf.basedb.core.data; 25 25 26 import java.util.HashMap; 27 import java.util.Map; 26 28 import java.util.Set; 27 29 … … 141 143 } 142 144 143 private Set<PlatformFileTypeData> fileTypes;145 private Map<FileTypeIndex, PlatformFileTypeData> fileTypes; 144 146 /** 145 147 The file types that can be used on this platform. This is 146 148 the inverse end. 147 149 @see PlatformFileTypeData#getPlatform() 148 @hibernate. setlazy="true" cascade="delete" inverse="true"150 @hibernate.map lazy="true" cascade="delete" inverse="true" 149 151 @hibernate.collection-key column="`platform_id`" 152 @hibernate.collection-composite-index class="net.sf.basedb.core.data.FileTypeIndex" 150 153 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.PlatformFileTypeData" 151 154 */ 152 Set<PlatformFileTypeData> getFileTypes()155 public Map<FileTypeIndex, PlatformFileTypeData> getFileTypes() 153 156 { 157 if (fileTypes == null) 158 { 159 fileTypes = new HashMap<FileTypeIndex, PlatformFileTypeData>(); 160 } 154 161 return fileTypes; 155 162 } 156 void setFileTypes( Set<PlatformFileTypeData> fileTypes)163 void setFileTypes(Map<FileTypeIndex, PlatformFileTypeData> fileTypes) 157 164 { 158 165 this.fileTypes = fileTypes; -
branches/filedb/src/core/net/sf/basedb/core/data/PlatformFileTypeData.java
r3764 r3783 32 32 @see net.sf.basedb.core.PlatformFileType 33 33 @base.modified $Date$ 34 @hibernate.class table="`Platform sFileTypes`" lazy="true"34 @hibernate.class table="`PlatformFileTypes`" lazy="true" 35 35 */ 36 36 public class PlatformFileTypeData -
branches/filedb/src/core/net/sf/basedb/core/data/PlatformVariantData.java
r3764 r3783 33 33 @see net.sf.basedb.core.PlatformVariant 34 34 @base.modified $Date$ 35 @hibernate.class table="`Platform sVariants`" lazy="false"35 @hibernate.class table="`PlatformVariants`" lazy="false" 36 36 */ 37 37 public class PlatformVariantData … … 115 115 The raw data type this platform variant is locked to, or null. 116 116 Only used if fileOnly=false 117 @hibernate.property column="`rawdatatype`" type="string" length="255" not-null=" true"117 @hibernate.property column="`rawdatatype`" type="string" length="255" not-null="false" 118 118 */ 119 119 public String getRawDataType() -
branches/filedb/src/core/net/sf/basedb/core/data/RawBioAssayData.java
r3764 r3783 81 81 private PlatformData platform; 82 82 /** 83 Get the platform this raw bioassay uses 83 Get the platform this raw bioassay uses. 84 84 @since 2.5 85 85 @hibernate.many-to-one outer-join="false" update="false" -
branches/filedb/src/core/net/sf/basedb/util/JarClassLoader.java
r3679 r3783 121 121 } 122 122 return cl; 123 } 124 125 126 /** 127 Get a new class loader for the specified jar file. 128 @param jarPath The path to the jar file 129 @return A class loader object 130 @throws IOException If the jar file can't be loaded 131 */ 132 public static final ClassLoader newInstance(String jarPath) 133 throws IOException 134 { 135 return new JarClassLoader(jarPath); 123 136 } 124 137 -
branches/filedb/src/core/net/sf/basedb/util/PluginInfo.java
r3733 r3783 139 139 Element rootElement = XMLUtil.getValidatedXML(is , installDtdURL, null).getRootElement(); 140 140 String jarname = rootElement.getAttributeValue("jarname"); 141 JarReader jarReader = JarReader.getNewInstance(jar);141 ClassLoader jarLoader = JarClassLoader.newInstance(jarFile.getPath()); 142 142 if (!jarname.equalsIgnoreCase(jarFile.getName())) 143 143 { … … 156 156 boolean hasConfigs = (configElement != null) && configElement.equals(hasConfigsValue); 157 157 158 Class c = jar Reader.loadClass(classname);158 Class c = jarLoader.loadClass(classname); 159 159 if (versionCompatible(baseVersion) && Plugin.class.isAssignableFrom(c)) 160 160 { … … 272 272 return majorCompatible && minorCompatible; 273 273 } 274 275 /**276 A private class to get information about plugin classes277 inside a jar file.278 @author Martin279 @version 2.5280 */281 private static class JarReader282 extends ClassLoader283 {284 /**285 The jar file for this reader.286 */287 private JarFile jar;288 289 /**290 @param jar The jar file that should be read291 */292 private JarReader(JarFile jar)293 {294 super(Thread.currentThread().getContextClassLoader());295 this.jar = jar;296 }297 298 private static JarReader getNewInstance (JarFile jarFile)299 {300 return new JarReader(jarFile);301 }302 303 /*304 (non-Javadoc)305 @see java.lang.ClassLoader#findClass(java.lang.String)306 */307 protected Class<?> findClass(String name)308 throws ClassNotFoundException309 {310 byte[] b;311 try312 {313 InputStream in = null;314 JarEntry jarEntry = jar.getJarEntry(classNameToPath(name));315 if (jarEntry == null)316 {317 throw new ClassNotFoundException(name+" in file "+jar.getName());318 }319 in = jar.getInputStream(jarEntry);320 b = new byte[(int)jarEntry.getSize()];321 in.read(b, 0, b.length);322 }323 catch(IOException ex)324 {325 throw new ClassNotFoundException(name, ex);326 }327 return defineClass(name, b, 0, b.length);328 }329 330 /**331 Convert a class name to a file path. Ie. replace dots with slahses and add .class332 to the end: net.sf.basedb.util.JarClassLoader -> net/sf/basedb/util/JarClassLoader.class333 */334 private String classNameToPath(String className)335 {336 return className.replaceAll("\\.", "/")+".class";337 }338 }339 274 } -
branches/filedb/src/examples/plugins/build.xml
r2155 r3783 35 35 manifest="MANIFEST.MF" 36 36 > 37 <metainf file="./base-plugins.xml"></metainf> 38 <metainf file="./base-configurations.xml"></metainf> 37 39 </jar> 38 40 </target> -
branches/filedb/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java
r3725 r3783 44 44 import net.sf.basedb.core.Include; 45 45 import net.sf.basedb.core.IntegerParameterType; 46 import net.sf.basedb.core.InvalidDataException;47 46 import net.sf.basedb.core.Item; 48 47 import net.sf.basedb.core.ItemNotFoundException; … … 56 55 import net.sf.basedb.core.PositionBatcher; 57 56 import net.sf.basedb.core.ProgressReporter; 57 import net.sf.basedb.core.Reporter; 58 58 import net.sf.basedb.core.RequestInformation; 59 59 import net.sf.basedb.core.SpotBatcher; … … 63 63 import net.sf.basedb.core.Type; 64 64 import net.sf.basedb.core.User; 65 import net.sf.basedb.core.data.ReporterData; 65 66 import net.sf.basedb.core.plugin.About; 66 67 import net.sf.basedb.core.plugin.AboutImpl; … … 109 110 import java.util.Set; 110 111 import java.util.TreeMap; 111 import java.util.regex.Matcher;112 112 import java.util.regex.Pattern; 113 113 … … 138 138 139 139 /** 140 The plug-in gpermissions.140 The plug-in permissions. 141 141 */ 142 142 private static final Set<Permissions> permissions = new HashSet<Permissions>(); … … 207 207 208 208 /** 209 The reporter fields that should be exported as a tab separ eated string209 The reporter fields that should be exported as a tab separated string 210 210 of column headers. 211 211 */ … … 214 214 /** 215 215 The spot fields that should be exported as a tab separated string of 216 column head res.216 column headers. 217 217 */ 218 218 private PluginParameter<String> usedFieldsParameter; … … 265 265 private int pluginDirectoryId = -1; 266 266 267 /* From InteractivePlugin i terface*/267 /* From InteractivePlugin interface*/ 268 268 269 269 /** … … 273 273 @param context The context from where the plugin is invoked. 274 274 @param item The item that should be checked if it is in context. 275 @return null if the the item is in context, otherwise an error mess ge.275 @return null if the the item is in context, otherwise an error message. 276 276 @see net.sf.basedb.core.plugin.AbstractAnalysisPlugin#isInContext(net.sf.basedb.core.plugin.GuiContext, java.lang.Object) 277 277 */ … … 407 407 storeValue(configuration, request, usedFieldsParameter); 408 408 storeValue(configuration, request, jobParametersParameter); 409 // test the xml in the jobParameters parame res409 // test the xml in the jobParameters parameters 410 410 try 411 411 { … … 448 448 449 449 /** 450 Copies the content from a File to a directory on the file system.450 Copies the content from a File to a directory on the file system. 451 451 452 452 @param f The file to be copied. … … 483 483 // Load existing... 484 484 jobDirectory = Directory.getByPath(dc, path); 485 // ...and remove files and sub directories in it485 // ...and remove files and sub directories in it 486 486 emptyDir(dc, path); 487 487 } … … 503 503 504 504 /** 505 Deletes all files and sub directories under dir.505 Deletes all files and sub directories under dir. 506 506 507 507 @param dir 508 @return Returnes true if all deletions were succssful508 @return true if all deletions were successful 509 509 */ 510 510 private boolean deleteDir(java.io.File dir) … … 527 527 528 528 /** 529 Deletes all files and sub directories under dir. The directory given529 Deletes all files and sub directories under dir. The directory given 530 530 itself is not deleted. 531 531 532 532 @param dc 533 533 @param dir 534 @return Returnes true if all deletions were succssful534 @return true if all deletions were successful 535 535 */ 536 536 private boolean emptyDir(DbControl dc, Path dir) … … 567 567 permissions.add(new Permissions(Item.PLUGINCONFIGURATION, EnumSet.of(Permission.WRITE), null)); 568 568 permissions.add(new Permissions(Item.RAWBIOASSAY, null, EnumSet.of(Permission.READ))); 569 permissions.add(new Permissions(Item.EXTRAVALUETYPE, null, EnumSet.of(Permission.READ))); 569 permissions.add(new Permissions(Item.REPORTER, null, EnumSet.of(Permission.READ))); 570 permissions.add(new Permissions(Item.EXTRAVALUETYPE, null, EnumSet.of(Permission.CREATE, Permission.USE))); 570 571 permissions.add(new Permissions(Item.USER, null, EnumSet.of(Permission.READ))); 571 572 permissions.add(new Permissions(Item.JOB, null, EnumSet.of(Permission.READ))); … … 605 606 { 606 607 DbControl dc = null; 608 File stdin = null; 609 File stdout = null; 610 Transformation trans = null; 607 611 try 608 612 { … … 611 615 getConfigureJobParameters(); 612 616 613 Transformation trans = null;614 File stdin = null;615 617 616 618 //Export … … 653 655 int exitValue = p.waitFor(); 654 656 657 progress.display(50, "Reading from error stream."); 655 658 for(int i = 0; errorStream.isAlive(); ++i) 656 659 { … … 681 684 { 682 685 //Copy files 683 dc.deleteItem(stdin);686 progress.display(60, "Copying files to server."); 684 687 importFiles(dc, trans); 685 688 if (!deleteDir(getExecDirectory())) … … 687 690 response.setError("Could not remove execution directory: "+getExecDirectory().getAbsolutePath(), null); 688 691 } 689 } 690 692 stdout = File.getFile(dc, getPluginDirectory(dc), "stdout.txt", true); 693 } 694 691 695 //Import data 692 696 try 693 697 { 694 698 progress.display(70, "Importing data from plugin."); 695 importData(dc, trans);699 importData(dc, stdout, trans); 696 700 response.setDone(msg); 697 701 } … … 700 704 response.setError(ex.getMessage(), Arrays.asList(ex)); 701 705 return; 706 } 707 } 708 finally 709 { 710 if (dc != null) 711 { 712 dc.commit(); 713 dc.close(); 714 } 715 } 716 717 //Clean up 718 try 719 { 720 dc = sc.newDbControl(); 721 if (!Values.getBoolean(String.valueOf(configuration.getValue(leaveStdinParameter.getName())))) 722 { 723 if (stdin != null) 724 { 725 stdin = File.getById(dc, stdin.getId()); 726 if (trans != null) 727 { 728 trans = Transformation.getById(dc, trans.getId()); 729 AnyToAny ata = AnyToAny.getByName(dc, trans, stdin.getPath().toString()); 730 dc.deleteItem(ata); 731 } 732 dc.deleteItem(stdin); 733 } 734 } 735 if (!Values.getBoolean(String.valueOf(configuration.getValue(leaveStdoutParameter.getName())))) 736 { 737 if (stdout != null) 738 { 739 stdout = File.getById(dc, stdout.getId()); 740 if (trans != null) 741 { 742 trans = Transformation.getById(dc, trans.getId()); 743 AnyToAny ata = AnyToAny.getByName(dc, trans, stdout.getPath().toString()); 744 dc.deleteItem(ata); 745 } 746 dc.deleteItem(stdout); 747 } 702 748 } 703 749 } … … 801 847 Map<String, String> names = new HashMap<String, String>(); 802 848 803 names.put("reporter", "rep.id");804 names.put("reporterId", "rep.externalId");805 806 849 ItemQuery<Formula> queryFormula = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION, 807 850 bas.getRawDataType()); … … 812 855 names.put(f.getName(), "frm."+f.getId()); 813 856 } 857 858 names.put("lastUpdate", "rep.lastUpdate"); 859 names.put("geneName", "rep.name"); 860 names.put("position", "rep.position"); 861 names.put("reporter", "rep.id"); 862 names.put("reporterId", "rep.externalId"); 863 names.put("geneSymbol", "rep.symbol"); 864 865 names.put("rawPosition", "raw.position"); 866 names.put("block", "raw.block"); 867 names.put("numCol", "raw.col"); 868 names.put("numRow", "raw.row"); 869 names.put("x", "raw.x"); 870 names.put("y", "raw.y"); 814 871 815 872 for (ExtraValue ev : bas.getExtraValues().list(dc)) … … 1119 1176 1120 1177 /** 1121 Get the exec directory as a java.io.File. The exec directory is a su directory in1178 Get the exec directory as a java.io.File. The exec directory is a sub directory in 1122 1179 "java.io.tmpdir". 1123 1180 … … 1245 1302 1246 1303 @return The id of the transformation the data is connected to. 1247 @throws IOException if there is any error reading from stdou .txt1248 */ 1249 private int importData(DbControl dc, Transformation t)1304 @throws IOException if there is any error reading from stdout.txt 1305 */ 1306 private int importData(DbControl dc, File stdout, Transformation t) 1250 1307 throws IOException 1251 1308 { 1252 1309 BioAssaySet bas = null; 1253 1310 SpotBatcher spotBatcher = null; 1254 PositionBatcher posBatcher = null;1255 1311 1256 1312 HashMap<String, BioAssay> idMap = new HashMap<String, BioAssay>(); 1257 HashMap<Integer, Integer> posMap = new HashMap<Integer, Integer>();1313 HashMap<Integer, ReporterData> posRepMap = new HashMap<Integer, ReporterData>(); 1258 1314 HashMap<String, ExtraValueType> evtMap = new HashMap<String, ExtraValueType>(); 1259 1315 1260 File stdout = File.getFile(dc, getPluginDirectory(dc), "stdout.txt", true);1261 1316 FlatFileParser ffp = getInitializedFlatFileParser(stdout.getDownloadStream(0)); 1262 1317 … … 1325 1380 } 1326 1381 spotBatcher = bas.getSpotBatcher(); 1327 // posBatcher = bas.getPositionBatcher();1328 1382 1329 1383 for (String assayId : assays) … … 1453 1507 spotBatcher.insert(ba.getDataCubeColumnNo(), position, intensities); 1454 1508 1455 // if (posMap.containsKey(position)) 1456 // { 1457 // if (!posMap.get(position).equals(reporter)) 1458 // throw new BaseException("Invalid data. Position, "+position+", occures twice with different reporter data."); 1459 // 1460 // } 1461 // else 1462 // { 1463 // posMap.put(position, reporter); 1464 // posBatcher.insert(position, Reporter.getById(dc, reporter)); 1465 // } 1509 if (posRepMap.containsKey(position)) 1510 { 1511 if (!reporter.equals(posRepMap.get(position).getId())) 1512 throw new BaseException("Invalid data. Position, "+position+", occurs twice with different reporter data."); 1513 } 1514 else 1515 { 1516 posRepMap.put(position, Reporter.getById(dc, reporter)); 1517 } 1518 1466 1519 for (int i = 0; i < evBatcher.size(); i++) 1467 1520 { … … 1482 1535 } 1483 1536 } 1537 1538 //Batch reporters 1539 if (bas != null) 1540 { 1541 PositionBatcher posBatcher = bas.getPositionBatcher(); 1542 for (Integer position : posRepMap.keySet()) 1543 { 1544 posBatcher.insert(position, posRepMap.get(position)); 1545 } 1546 } 1547 1484 1548 // save bas 1485 1549 if (bas != null) … … 1562 1626 1563 1627 /** 1564 This thread read everything from one input strea tant writes everything to an output stream.1628 This thread read everything from one input stream ant writes everything to an output stream. 1565 1629 1566 1630 @author Johan Enell … … 1580 1644 1581 1645 /** 1582 Creates a steam handler connected to the specifi vstreams.1646 Creates a steam handler connected to the specific streams. 1583 1647 1584 1648 @param is The stream to read from. -
branches/filedb/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java
r3705 r3783 858 858 ExtraValueType evt = ev.getExtraValueType(); 859 859 items.add(new QueryItem("xtra."+evt.getExternalId(), "[Extra] "+evt.getName(), 860 evt.getName(), "xtra('" + evt.getExternalId() + "')", evt.getAverageMethod()));860 "_xc_"+evt.getName(), "xtra('" + evt.getExternalId() + "')", evt.getAverageMethod())); 861 861 } 862 862 Collections.sort(items, new QueryItemTitleComparator()); … … 895 895 { 896 896 List<QueryItem> items = new ArrayList<QueryItem>(); 897 items.add(new QueryItem("raw.position", "[Raw] Position", " position", "raw('position')", Formula.AverageMethod.NONE));897 items.add(new QueryItem("raw.position", "[Raw] Position", "rawPosition", "raw('position')", Formula.AverageMethod.NONE)); 898 898 items.add(new QueryItem("raw.block", "[Raw] Array block", "block", "raw('block')", Formula.AverageMethod.NONE)); 899 899 items.add(new QueryItem("raw.metaGridX", "[Raw] Meta grid X", "metaGridX", "raw('metaGridX')", Formula.AverageMethod.NONE)); … … 918 918 items.add(new QueryItem("rep.position", "Position", "position", "pos()", Formula.AverageMethod.NONE)); 919 919 items.add(new QueryItem("rep.name", "Reporter Name", "name", "rep('name')", Formula.AverageMethod.MAX)); 920 items.add(new QueryItem("rep.externalId", "Reporter ID", " externalId", "rep('externalId')", Formula.AverageMethod.MAX));920 items.add(new QueryItem("rep.externalId", "Reporter ID", "reporterId", "rep('externalId')", Formula.AverageMethod.MAX)); 921 921 items.add(new QueryItem("rep.symbol", "Gene symbol", "symbol", "rep('symbol')", Formula.AverageMethod.MAX)); 922 922 items.add(new QueryItem("rep.description", "Description", "description", "rep('description')", Formula.AverageMethod.MAX)); -
branches/filedb/src/plugins/core/net/sf/basedb/plugins/FormulaFilter.java
r3679 r3783 123 123 } 124 124 /** 125 Request use access to Experiment:s and read access to Job:s .125 Request use access to Experiment:s and read access to Job:s and ReporterLists. 126 126 */ 127 127 public Collection<Permissions> getPermissions() … … 131 131 permissions.add(new Permissions(Item.EXPERIMENT, null, EnumSet.of(Permission.USE))); 132 132 permissions.add(new Permissions(Item.JOB, null, EnumSet.of(Permission.READ))); 133 permissions.add(new Permissions(Item.REPORTERLIST, null, EnumSet.of(Permission.READ))); 133 134 } 134 135 return permissions; -
branches/filedb/src/test/TestAnalyzePluginUtil.java
r3679 r3783 31 31 import net.sf.basedb.core.Item; 32 32 import net.sf.basedb.core.Permission; 33 import net.sf.basedb.core.Platform; 33 34 import net.sf.basedb.core.RawBioAssay; 34 35 import net.sf.basedb.core.RawDataBatcher; … … 59 60 for (int i = 0; i < rawBioAssays; i++) 60 61 { 61 int rawBioAssayId = TestRawBioAssay.test_create( "genepix", 0, 0, 0, 0, false);62 int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", 0, 0, 0, 0, false); 62 63 63 64 FlatFileParser parser = new FlatFileParser(); -
branches/filedb/src/test/TestAnnotation.java
r3679 r3783 59 59 int booleanId = TestAnnotationType.test_create(null, Type.BOOLEAN, true, null, Item.ARRAYDESIGN, 1, null, true); 60 60 int enumId = TestAnnotationType.test_create(null, Type.INT, 3, null, Item.ARRAYDESIGN, 1, new Object[] { 1, 2, 3, 4, 5 }, false); 61 int arrayDesignId = TestArrayDesign.test_create( true, false);61 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, true); 62 62 63 63 // Annotate the array design and list the annotations … … 74 74 75 75 // Test: inherit annotations 76 int rawBioAssayId = TestRawBioAssay.test_create( "genepix", 0, 0, 0, arrayDesignId, false);76 int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", 0, 0, 0, arrayDesignId, false); 77 77 test_inherit_annotation(rawBioAssayId, intAnnotationId); 78 78 test_inherit_annotation(rawBioAssayId, stringAnnotationId); -
branches/filedb/src/test/TestArrayBatch.java
r3679 r3783 34 34 import net.sf.basedb.core.ItemQuery; 35 35 import net.sf.basedb.core.ItemResultList; 36 import net.sf.basedb.core.Platform; 36 37 37 38 public class TestArrayBatch … … 52 53 write_header(); 53 54 // Standard tests: create, load, list 54 int arraydesign_id = TestArrayDesign.test_create( false, false);55 int arraydesign_id = TestArrayDesign.test_create(Platform.GENERIC, false); 55 56 int id = test_create(arraydesign_id, true); 56 57 int id2 = test_create(arraydesign_id, false); -
branches/filedb/src/test/TestArrayDesign.java
r3679 r3783 31 31 import net.sf.basedb.core.Feature; 32 32 import net.sf.basedb.core.FeatureBatcher; 33 import net.sf.basedb.core.File; 34 import net.sf.basedb.core.FileSetMember; 35 import net.sf.basedb.core.FileSetMemberType; 33 36 import net.sf.basedb.core.Item; 34 37 import net.sf.basedb.core.Permission; … … 36 39 import net.sf.basedb.core.DataResultIterator; 37 40 import net.sf.basedb.core.Plate; 41 import net.sf.basedb.core.Platform; 38 42 import net.sf.basedb.core.Reporter; 39 43 import net.sf.basedb.core.ReporterBatcher; 40 44 import net.sf.basedb.core.ItemResultList; 45 import net.sf.basedb.core.SystemItems; 41 46 import net.sf.basedb.core.Well; 42 47 import net.sf.basedb.core.data.FeatureData; … … 66 71 write_header(); 67 72 // Standard tests: create, load, list 68 int id = test_create( true, false);69 int id2 = test_create( false, false);70 int id3 = test_create( true, true);71 int id4 = test_create( false, true);73 int id = test_create(Platform.GENERIC, true); 74 int id2 = test_create(Platform.GENERIC, false); 75 int id3 = test_create(Platform.AFFYMETRIX, true); 76 int id4 = test_create(Platform.AFFYMETRIX, false); 72 77 test_load(id); 73 78 test_list(-1); … … 90 95 int[] plateIds = TestPlate.test_import_from_file("data/test.plate96.import.txt", 91 96 "Plate\\tRow\\tColumn\\tCluster ID\\tClone ID\\tGene Symbol\\tBarcode", plateType, 0, 1, 2, 4); 92 int id5 = test_create( false, false);97 int id5 = test_create(Platform.GENERIC, false); 93 98 test_add_plates(id5, plateIds); 94 99 … … 98 103 test_add_features_from_wells(id5, plateIds, 10); 99 104 105 // Array designs with data in files 106 int cdfId = TestFile.test_create("data/test.affymetrix.cdf", false, false); 107 test_set_file(id3, "affymetrix.cdf", cdfId); 108 test_list_files(id3, 1); 109 100 110 if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); 101 111 // Standard test: Delete … … 116 126 } 117 127 118 static int test_create( boolean setAll, boolean affyChip)128 static int test_create(String platformId, boolean setAll) 119 129 { 120 130 if (!TestUtil.hasPermission(Permission.CREATE, Item.ARRAYDESIGN)) return 0; … … 124 134 { 125 135 dc = TestUtil.getDbControl(); 126 ArrayDesign ad = ArrayDesign.getNew(dc, affyChip); 136 Platform platform = Platform.getById(dc, SystemItems.getId(platformId)); 137 ArrayDesign ad = ArrayDesign.getNew(dc, platform); 127 138 if (setAll) 128 139 { … … 133 144 dc.commit(); 134 145 id = ad.getId(); 146 dc = TestUtil.getDbControl(); 147 dc.reattachItem(ad); 135 148 write_item(0, ad); 136 149 write("--Create array design OK"); … … 260 273 if (!TestUtil.getSilent()) 261 274 { 262 write(i+":\t"+ad.getId()+"\t"+ad.getName()+"\t"+ad.getDescription()+"\t"+ad.isAnnotated()+"\t"+ad. isAffyChip());275 write(i+":\t"+ad.getId()+"\t"+ad.getName()+"\t"+ad.getDescription()+"\t"+ad.isAnnotated()+"\t"+ad.getPlatform()); 263 276 } 264 277 } … … 282 295 } 283 296 297 static void write_item(int i, FileSetMember member) 298 throws BaseException 299 { 300 if (!TestUtil.getSilent()) 301 { 302 System.out.println(i+":\t"+member.getId()+"\t"+member.getFile().getName()+"\t"+ 303 member.getMemberType().getName()); 304 } 305 } 306 284 307 static void write(String message) 285 308 { … … 363 386 dc = TestUtil.getDbControl(); 364 387 ArrayDesign ad = ArrayDesign.getById(dc, arrayDesignId); 365 if ( ad.isAffyChip())388 if (Platform.AFFYMETRIX.equals(ad.getPlatform().getSystemId())) 366 389 { 367 390 throw new BaseException("Cannot add features from wells on an affy arraydesign"); … … 434 457 } 435 458 dc.commit(); 436 write_item(0, ad);437 459 write("--Add plates to array design OK"); 438 460 } … … 574 596 } 575 597 598 static void test_set_file(int arrayDesignId, String fileType, int fileId) 599 { 600 if (arrayDesignId == 0 || fileId == 0) return; 601 DbControl dc = null; 602 try 603 { 604 dc = TestUtil.getDbControl(); 605 ArrayDesign ad = ArrayDesign.getById(dc, arrayDesignId); 606 FileSetMemberType type = FileSetMemberType.getById(dc, SystemItems.getId(fileType)); 607 File file = File.getById(dc, fileId); 608 ad.getFileSet().setMember(file, type); 609 dc.commit(); 610 write("--Set file OK ("+fileType+")"); 611 } 612 catch (Throwable ex) 613 { 614 write("--Set file FAILED ("+fileType+")"); 615 ex.printStackTrace(); 616 ok = false; 617 } 618 finally 619 { 620 if (dc != null) dc.close(); 621 } 622 } 623 624 static void test_list_files(int arrayDesignId, int expectedResults) 625 { 626 if (arrayDesignId == 0) return; 627 DbControl dc = null; 628 try 629 { 630 dc = TestUtil.getDbControl(); 631 ArrayDesign ad = ArrayDesign.getById(dc, arrayDesignId); 632 ItemResultList<FileSetMember> l = ad.getFileSet().getMembers().list(dc); 633 for (int i = 0; i<l.size(); i++) 634 { 635 write_item(i, l.get(i)); 636 } 637 if (expectedResults >= 0 && expectedResults != l.size()) 638 { 639 throw new BaseException("Expected "+expectedResults+" results, not "+l.size()); 640 } 641 write("--List files OK ("+l.size()+")"); 642 } 643 catch (Throwable ex) 644 { 645 write("--List files FAILED"); 646 ex.printStackTrace(); 647 ok = false; 648 } 649 finally 650 { 651 if (dc != null) dc.close(); 652 } 653 } 576 654 } 577 655 -
branches/filedb/src/test/TestArrayDesignBlock.java
r3679 r3783 30 30 import net.sf.basedb.core.DbControl; 31 31 import net.sf.basedb.core.ItemResultList; 32 import net.sf.basedb.core.Platform; 32 33 33 34 … … 55 56 write("++Testing array design block"); 56 57 write_header(); 57 int arrayDesignId = TestArrayDesign.test_create( false, false);58 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false); 58 59 // Standard tests: create, load, list 59 60 int nbr = 10; -
branches/filedb/src/test/TestArraySlide.java
r3679 r3783 9 9 import net.sf.basedb.core.ItemQuery; 10 10 import net.sf.basedb.core.ItemResultList; 11 import net.sf.basedb.core.Platform; 11 12 12 13 /* … … 50 51 write_header(); 51 52 // Standard tests: create, load, list 52 int arraydesign_id = TestArrayDesign.test_create( true, false);53 int arraydesign_id = TestArrayDesign.test_create(Platform.GENERIC, true); 53 54 int arraybatch_id = TestArrayBatch.test_create(arraydesign_id, false); 54 55 int id = test_create(arraybatch_id, true); -
branches/filedb/src/test/TestDirty.java
r3719 r3783 73 73 74 74 // Test import raw data 75 int arrayDesignId = TestArrayDesign.test_create( false, false);75 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false); 76 76 TestArrayDesign.test_import_from_file(arrayDesignId, "data/test.import.dirty.txt", 77 77 "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", 0, 2, 1, 4); 78 78 79 int rawBioAssayId = TestRawBioAssay.test_create( "genepix", 0, 0, 0, arrayDesignId, false);79 int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", 0, 0, 0, arrayDesignId, false); 80 80 int fileId = TestFile.test_create("data/test.import.dirty.txt", false, false); 81 81 -
branches/filedb/src/test/TestExperiment.java
r3679 r3783 78 78 "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", "\\t", 4, 3); 79 79 80 int arrayDesignId = TestArrayDesign.test_create( false, false);80 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false); 81 81 TestArrayDesign.test_import_from_file(arrayDesignId, "data/test.rawdata.import.txt", 82 82 "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", 0, 2, 1, 4); 83 83 84 int rbaId1 = TestRawBioAssay.test_create( "genepix", 0, 0, 0, arrayDesignId, false);85 int rbaId2 = TestRawBioAssay.test_create( "genepix", 0, 0, 0, arrayDesignId, false);84 int rbaId1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", 0, 0, 0, arrayDesignId, false); 85 int rbaId2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", 0, 0, 0, arrayDesignId, false); 86 86 TestRawBioAssay.test_import_from_file(rbaId1, "data/test.rawdata.import.txt"); 87 87 TestRawBioAssay.test_import_from_file(rbaId2, "data/test.rawdata.import.txt"); -
branches/filedb/src/test/TestExternalPluginInstaller.java
r3704 r3783 55 55 56 56 /** 57 Test to find jar-files in directory specified in plugin .dir57 Test to find jar-files in directory specified in plugins.dir 58 58 @return List with files 59 59 */ … … 63 63 if (pluginDir == null || !pluginDir.exists()) 64 64 { 65 write("--'plugin .dir' has not been set properbly in base.config");65 write("--'plugins.dir' has not been set properbly in base.config"); 66 66 ok = false; 67 67 return null; -
branches/filedb/src/test/TestHybridization.java
r3679 r3783 48 48 test_load(id); 49 49 50 int arrayDesignId = TestArrayDesign.test_create( false, false);50 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false); 51 51 int arrayBatchId = TestArrayBatch.test_create(arrayDesignId, false); 52 52 int arraySlideId = TestArraySlide.test_create(arrayBatchId, false); -
branches/filedb/src/test/TestPlatform.java
r3764 r3783 25 25 import net.sf.basedb.core.BaseException; 26 26 import net.sf.basedb.core.DbControl; 27 import net.sf.basedb.core.FileSetMemberType; 27 28 import net.sf.basedb.core.Item; 28 29 import net.sf.basedb.core.ItemResultList; 29 30 import net.sf.basedb.core.Permission; 30 31 import net.sf.basedb.core.Platform; 32 import net.sf.basedb.core.PlatformFileType; 33 import net.sf.basedb.core.PlatformVariant; 31 34 import net.sf.basedb.core.RawDataTypes; 32 35 import net.sf.basedb.core.SystemItems; … … 57 60 test_list(); 58 61 62 // Variants 63 int idVariant1 = test_create_variant(id1, "Variant of db and file", "test.db.and.file.v1", null, 0, null); 64 int idVariant2 = test_create_variant(id2, "Variant file-only", "test.file.only.v1", null, 0, null); 65 int idVariant3 = test_create_variant(id3, "Locked to agilent", "test.locked.agilent", false, 0, "agilent"); 66 test_list_variants(id1, 1); 67 68 // File types 69 test_add_filetype(id2, 0, SystemItems.getId("affymetrix.cel")); 70 test_add_filetype(id2, idVariant2, SystemItems.getId("affymetrix.cdf")); 71 test_list_filetypes(id2, 0, 1); 72 59 73 // Standard test: Delete 60 74 if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); 75 test_delete_variant(idVariant1); 61 76 test_delete(id1); 62 77 test_delete(id2); … … 192 207 } 193 208 209 static void write_item(int i, PlatformVariant v) 210 throws BaseException 211 { 212 if (!TestUtil.getSilent()) 213 { 214 System.out.println(i+":\t"+v.getId()+"\t"+v.getName()+"\t"+ 215 v.getDescription() + "\t" + v.getSystemId() + "\t" + v.isFileOnly() + "\t" + 216 v.getRawDataType() + "\t" + v.getPlatform()); 217 } 218 } 219 194 220 static void write(String message) 195 221 { 196 222 System.out.println(message); 197 223 } 224 225 static int test_create_variant(int platformId, String name, String systemId, Boolean fileOnly, int channels, String rawDataType) 226 { 227 if (platformId == 0 || !TestUtil.hasPermission(Permission.CREATE, Item.PLATFORMVARIANT)) return 0; 228 int id = 0; 229 DbControl dc = null; 230 try 231 { 232 dc = TestUtil.getDbControl(); 233 234 Platform p = Platform.getById(dc, platformId); 235 236 PlatformVariant v = null; 237 if (fileOnly == null) 238 { 239 v = PlatformVariant.getNew(dc, p, systemId); 240 } 241 else if (fileOnly == true) 242 { 243 v = PlatformVariant.getNew(dc, p, systemId, channels); 244 } 245 else 246 { 247 v = PlatformVariant.getNew(dc, p, systemId, RawDataTypes.getRawDataType(rawDataType)); 248 } 249 v.setName(name); 250 dc.saveItem(v); 251 dc.commit(); 252 id = v.getId(); 253 dc = TestUtil.getDbControl(); 254 dc.reattachItem(v); 255 write_item(0, v); 256 write("--Create platform variant OK"); 257 } 258 catch (Throwable ex) 259 { 260 write("--Create platform variant FAILED"); 261 ex.printStackTrace(); 262 ok = false; 263 } 264 finally 265 { 266 if (dc != null) dc.close(); 267 } 268 return id; 269 } 270 271 static void test_list_variants(int platformId, int expectedResults) 272 { 273 if (platformId == 0) return; 274 DbControl dc = null; 275 try 276 { 277 dc = TestUtil.getDbControl(); 278 Platform p = Platform.getById(dc, platformId); 279 ItemResultList<PlatformVariant> l = p.getVariants().list(dc); 280 for (int i = 0; i<l.size(); i++) 281 { 282 write_item(i, l.get(i)); 283 } 284 if (expectedResults >= 0 && expectedResults != l.size()) 285 { 286 throw new BaseException("Expected "+expectedResults+" results, not "+l.size()); 287 } 288 write("--List platform variants OK ("+l.size()+")"); 289 } 290 catch (Throwable ex) 291 { 292 write("--List platform variants FAILED"); 293 ex.printStackTrace(); 294 ok = false; 295 } 296 finally 297 { 298 if (dc != null) dc.close(); 299 } 300 } 301 302 static void test_delete_variant(int variantId) 303 { 304 if (variantId == 0) return; 305 DbControl dc = null; 306 try 307 { 308 dc = TestUtil.getDbControl(); 309 PlatformVariant v = PlatformVariant.getById(dc, variantId); 310 dc.deleteItem(v); 311 dc.commit(); 312 write("--Delete platform variant OK"); 313 } 314 catch (Throwable ex) 315 { 316 write("--Delete platform variant FAILED"); 317 ex.printStackTrace(); 318 ok = false; 319 } 320 finally 321 { 322 if (dc != null) dc.close(); 323 } 324 } 325 326 static void test_add_filetype(int platformId, int variantId, int fileTypeId) 327 { 328 if (platformId == 0 || fileTypeId == 0) return; 329 DbControl dc = null; 330 try 331 { 332 dc = TestUtil.getDbControl(); 333 334 Platform p = Platform.getById(dc, platformId); 335 PlatformVariant v = variantId == 0 ? null : PlatformVariant.getById(dc, variantId); 336 FileSetMemberType fileType = FileSetMemberType.getById(dc, fileTypeId); 337 338 p.addFileType(fileType, v); 339 340 dc.commit(); 341 write("--Add file type OK"); 342 } 343 catch (Throwable ex) 344 { 345 write("--Add file type FAILED"); 346 ex.printStackTrace(); 347 ok = false; 348 } 349 finally 350 { 351 if (dc != null) dc.close(); 352 } 353 } 354 355 static void test_list_filetypes(int platformId, int variantId, int expectedResults) 356 { 357 if (platformId == 0) return; 358 DbControl dc = null; 359 try 360 { 361 dc = TestUtil.getDbControl(); 362 Platform p = Platform.getById(dc, platformId); 363 PlatformVariant v = variantId == 0 ? null : PlatformVariant.getById(dc, variantId); 364 ItemResultList<PlatformFileType> l = p.getFileTypes(v, false).list(dc); 365 for (int i = 0; i<l.size(); i++) 366 { 367 write_item(i, l.get(i)); 368 } 369 if (expectedResults >= 0 && expectedResults != l.size()) 370 { 371 throw new BaseException("Expected "+expectedResults+" results, not "+l.size()); 372 } 373 write("--List platform file types OK ("+l.size()+")"); 374 } 375 catch (Throwable ex) 376 { 377 write("--List platform file types FAILED"); 378 ex.printStackTrace(); 379 ok = false; 380 } 381 finally 382 { 383 if (dc != null) dc.close(); 384 } 385 } 386 387 198 388 } -
branches/filedb/src/test/TestPrintMapFlatFileImporter.java
r3719 r3783 9 9 import net.sf.basedb.core.ParameterType; 10 10 import net.sf.basedb.core.Permission; 11 import net.sf.basedb.core.Platform; 11 12 import net.sf.basedb.core.PluginConfigurationRequest; 12 13 import net.sf.basedb.core.PluginDefinition; … … 63 64 64 65 // Create ArrayDesign needed for print map import 65 int arrayDesignId = TestArrayDesign.test_create( false, false);66 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false); 66 67 int plateGeometryId = TestPlateGeometry.test_create(16, 24, false); 67 68 int plateTypeId = TestPlateType.test_create(plateGeometryId, false); -
branches/filedb/src/test/TestProject.java
r3679 r3783 100 100 { 101 101 dc = TestUtil.getDbControl(); 102 int adId = TestArrayDesign.test_create( false, false);102 int adId = TestArrayDesign.test_create(Platform.GENERIC, false); 103 103 ArrayDesign ad = ArrayDesign.getById(dc, adId); 104 104 Project p = Project.getById(dc, id); -
branches/filedb/src/test/TestRawBioAssay.java
r3679 r3783 53 53 int hybridizationId = TestHybridization.test_create(0, false); 54 54 int scanId = TestScan.test_create(hybridizationId, 0, 0, false); 55 int arrayDesignId = TestArrayDesign.test_create( false, false);55 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false); 56 56 TestReporter.test_import_from_file("data/test.rawdata.import.txt", 57 57 "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", "\\t", 4, 3); … … 62 62 63 63 // Standard tests: create, load, list 64 int id = test_create("genepix", scanId, softwareId, protocolId, arrayDesignId, true); 65 int id2 = test_create("genepix", 0, 0, 0, 0, false); 64 int id = test_create(Platform.GENERIC, "genepix", scanId, softwareId, protocolId, arrayDesignId, true); 65 int id2 = test_create(Platform.GENERIC, "genepix", 0, 0, 0, 0, false); 66 int id3 = test_create(Platform.AFFYMETRIX, null, 0, 0, 0, 0, false); 66 67 67 68 test_load(id); 68 69 69 // Test adding raw data 70 70 // Test adding raw data -- stored in database 71 71 test_add_rawdata(id2, 10); 72 72 test_import_from_file(id, "data/test.rawdata.import.txt"); 73 74 73 test_load(id); 75 76 74 test_list(-1); 77 75 write_raw_data_header(); 78 76 test_list_raw_data(id, 10, 5, 0, true); 79 77 78 // Test adding raw data -- stored in files 79 int celId = TestFile.test_create("data/test.affymetrix.cel", false, false); 80 test_set_file(id3, "affymetrix.cel", celId); 81 test_list_files(id3, 1); 82 80 83 if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); 81 84 test_delete_raw_data(id); … … 84 87 test_delete(id); 85 88 test_delete(id2); 86 89 test_delete(id3); 90 91 TestFile.test_delete(celId); 87 92 TestScan.test_delete(scanId); 88 93 TestHybridization.test_delete(hybridizationId); … … 95 100 } 96 101 97 static int test_create(String rawDataType, int scanId, int softwareId, int protocolId, int arrayDesignId, boolean setAll)102 static int test_create(String platformId, String rawDataType, int scanId, int softwareId, int protocolId, int arrayDesignId, boolean setAll) 98 103 { 99 104 if (!TestUtil.hasPermission(Permission.CREATE, Item.RAWBIOASSAY)) return 0; … … 103 108 { 104 109 dc = TestUtil.getDbControl(); 105 RawBioAssay rba = RawBioAssay.getNew(dc, RawDataTypes.getRawDataType(rawDataType)); 110 Platform platform = Platform.getById(dc, SystemItems.getId(platformId)); 111 RawBioAssay rba = RawBioAssay.getNew(dc, platform, RawDataTypes.getRawDataType(rawDataType)); 106 112 if (setAll) 107 113 { … … 268 274 } 269 275 } 276 277 static void write_item(int i, FileSetMember member) 278 throws BaseException 279 { 280 if (!TestUtil.getSilent()) 281 { 282 System.out.println(i+":\t"+member.getId()+"\t"+member.getFile().getName()+"\t"+ 283 member.getMemberType().getName()); 284 } 285 } 286 270 287 271 288 static void write(String message) … … 500 517 } 501 518 519 static void test_set_file(int rawBioAssayId, String fileType, int fileId) 520 { 521 if (rawBioAssayId == 0 || fileId == 0) return; 522 DbControl dc = null; 523 try 524 { 525 dc = TestUtil.getDbControl(); 526 RawBioAssay rba = RawBioAssay.getById(dc, rawBioAssayId); 527 FileSetMemberType type = FileSetMemberType.getById(dc, SystemItems.getId(fileType)); 528 File file = File.getById(dc, fileId); 529 rba.getFileSet().setMember(file, type); 530 dc.commit(); 531 write("--Set file OK ("+fileType+")"); 532 } 533 catch (Throwable ex) 534 { 535 write("--Set file FAILED ("+fileType+")"); 536 ex.printStackTrace(); 537 ok = false; 538 } 539 finally 540 { 541 if (dc != null) dc.close(); 542 } 543 } 544 545 static void test_list_files(int rawBioAssayId, int expectedResults) 546 { 547 if (rawBioAssayId == 0) return; 548 DbControl dc = null; 549 try 550 { 551 dc = TestUtil.getDbControl(); 552 RawBioAssay rba = RawBioAssay.getById(dc, rawBioAssayId); 553 ItemResultList<FileSetMember> l = rba.getFileSet().getMembers().list(dc); 554 for (int i = 0; i<l.size(); i++) 555 { 556 write_item(i, l.get(i)); 557 } 558 if (expectedResults >= 0 && expectedResults != l.size()) 559 { 560 throw new BaseException("Expected "+expectedResults+" results, not "+l.size()); 561 } 562 write("--List files OK ("+l.size()+")"); 563 } 564 catch (Throwable ex) 565 { 566 write("--List files FAILED"); 567 ex.printStackTrace(); 568 ok = false; 569 } 570 finally 571 { 572 if (dc != null) dc.close(); 573 } 574 } 502 575 } -
branches/filedb/src/test/TestRawDataFlatFileImporter.java
r3719 r3783 45 45 TestReporter.test_import_from_file("data/test.rawdata.import.txt", "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", "\\t", 4, 3); 46 46 int fileId = TestFile.test_create("data/test.rawdata.import.txt", false, false); 47 int arrayDesignId = TestArrayDesign.test_create( false, false);47 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false); 48 48 TestArrayDesign.test_import_from_file(arrayDesignId, "data/test.rawdata.import.txt", "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", 0, 2, 1, 4); 49 int rawBioAssayId = TestRawBioAssay.test_create( "genepix", 0, 0, 0, arrayDesignId, true);49 int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", 0, 0, 0, arrayDesignId, true); 50 50 51 51 // Create plugin configuration and job -
branches/filedb/src/test/TestReporterMapFlatFileImporter.java
r3719 r3783 32 32 import net.sf.basedb.core.ParameterType; 33 33 import net.sf.basedb.core.Permission; 34 import net.sf.basedb.core.Platform; 34 35 import net.sf.basedb.core.PluginConfiguration; 35 36 import net.sf.basedb.core.PluginDefinition; … … 61 62 // Create reporter type and upload file 62 63 int reporterTypeId = TestReporterType.test_create(); 63 int arrayDesignId = TestArrayDesign.test_create( false, false);64 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false); 64 65 int fileId = TestFile.test_create("data/test.reportermap.import.txt", false, false); 65 66 -
branches/filedb/src/test/TestSpotImages.java
r3719 r3783 61 61 write("++Testing spot images import"); 62 62 63 int rawBioAssayId = TestRawBioAssay.test_create( "genepix", 0, 0, 0, 0, false);63 int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", 0, 0, 0, 0, false); 64 64 TestReporter.test_import_from_file("data/test.rawdata.import.txt", "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", "\\t", 4, 3); 65 65 TestRawBioAssay.test_import_from_file(rawBioAssayId, "data/test.rawdata.import.txt"); -
branches/filedb/www/admin/jobagents/view_agent.jsp
r3675 r3783 341 341 { 342 342 PluginDefinition plugin = null; 343 NameablePluginAdaptor nameableProxy = null; 343 344 boolean readPlugin = true; 344 345 try 345 346 { 346 347 plugin = settings.getPluginDefinition(); 348 nameableProxy = new NameablePluginAdaptor(plugin); 347 349 } 348 350 catch (PermissionDeniedException ex) … … 354 356 %> 355 357 <tbl:row> 356 <tbl:cell column="plugin"><%=Base.getLinkedName(ID, n ew NameablePluginAdaptor(plugin), !readPlugin, true)%></tbl:cell>358 <tbl:cell column="plugin"><%=Base.getLinkedName(ID, nameableProxy, !readPlugin, true)%></tbl:cell> 357 359 <tbl:cell column="jarPath"><%=jarPath == null ? "<i>- internal -</i>" : HTML.encodeTags(jarPath)%></tbl:cell> 358 360 <tbl:cell column="trusted"><%=settings.isEffectivelyTrusted()%></tbl:cell> -
branches/filedb/www/admin/pluginconfigurations/list_configurations.jsp
r3679 r3783 429 429 PluginConfiguration item = configurations.next(); 430 430 PluginDefinition plugin = null; 431 Nameable nameableProxy = null; 431 432 contexts.clear(); 432 433 try 433 434 { 434 435 plugin = item.getPluginDefinition(); 436 nameableProxy = new NameablePluginAdaptor(plugin); 435 437 contexts.addAll(plugin.getGuiContexts()); 436 438 } … … 490 492 <tbl:cell column="pluginType"><%=plugin == null ? "<i>- denied -</i>" : plugin.getMainType().toString()%></tbl:cell> 491 493 <tbl:cell column="contexts"><%=plugin == null ? "<i>- denied -</i>" : (contexts.isEmpty() ? "<i>- none -</i>" : Values.getString(contexts, ", ", true))%></tbl:cell> 492 <tbl:cell column="pluginDefinition"><%=mode.hasPropertyLink() ? Base.getLinkedName(ID, n ew NameablePluginAdaptor(plugin), plugin == null, mode.hasEditLink()): Base.getEncodedName(new NameablePluginAdaptor(plugin), plugin == null)%></a></tbl:cell>494 <tbl:cell column="pluginDefinition"><%=mode.hasPropertyLink() ? Base.getLinkedName(ID, nameableProxy, plugin == null, mode.hasEditLink()): Base.getEncodedName(nameableProxy, plugin == null)%></a></tbl:cell> 493 495 <tbl:cell column="owner" 494 496 ><base:propertyvalue -
branches/filedb/www/admin/pluginconfigurations/view_configuration.jsp
r3679 r3783 97 97 final Set<GuiContext> contexts = new TreeSet<GuiContext>(new ToStringComparator<GuiContext>(false)); 98 98 PluginDefinition plugin = null; 99 Nameable nameableProxy = null; 99 100 boolean readPlugin = true; 100 101 boolean configurable = false; … … 102 103 { 103 104 plugin = configuration.getPluginDefinition(); 105 nameableProxy = new NameablePluginAdaptor(plugin); 104 106 contexts.addAll(plugin.getGuiContexts()); 105 107 configurable = plugin.isInteractive() && plugin.supportsConfigurations(); … … 265 267 <td class="prompt">Plugin</td> 266 268 <td> 267 <%=Base.getLinkedName(ID, n ew NameablePluginAdaptor(plugin), plugin == null, true)%>269 <%=Base.getLinkedName(ID, nameableProxy, plugin == null, true)%> 268 270 </td> 269 271 </tr> -
branches/filedb/www/common/import/no_fileformat.jsp
r3675 r3783 71 71 "mainType", Operator.EQ, String.valueOf(Plugin.MainType.IMPORT.getValue()), Type.INT)); 72 72 pluginContext.setPropertyFilter(new PropertyFilter( 73 " guiContexts.itemType", Operator.EQ, String.valueOf(itemType.getValue()), Type.INT));73 "$ctx.itemType", Operator.EQ, String.valueOf(itemType.getValue()), Type.INT)); 74 74 try 75 75 { -
branches/filedb/www/exception/exception.jsp
r3725 r3783 204 204 StackTraceElement[] st = ex.getStackTrace(); 205 205 out.println("<pre>"); 206 out.println(exceptionClassName); 206 207 int i = 0; 207 208 for (i=0; i < st.length && i < 8; i++) 208 209 { 209 210 out.print("...at "); 210 out.println( st[i].toString().replaceAll("net.sf.basedb.core.", ""));211 out.println(HTML.encodeTags(st[i].toString().replaceAll("net.sf.basedb.core.", ""))); 211 212 } 212 213 out.println("</pre>"); … … 219 220 { 220 221 out.print("...at "); 221 out.println( st[j].toString().replaceAll("net.sf.basedb.core.", ""));222 out.println(HTML.encodeTags(st[j].toString().replaceAll("net.sf.basedb.core.", ""))); 222 223 } 223 224 ex = ex.getCause(); -
branches/filedb/www/lims/arraydesigns/features/index.jsp
r3679 r3783 35 35 import="net.sf.basedb.core.Permission" 36 36 import="net.sf.basedb.core.PermissionDeniedException" 37 import="net.sf.basedb.core.ArrayDesign" 38 import="net.sf.basedb.core.data.FeatureData" 37 39 import="net.sf.basedb.clients.web.Base" 38 40 import="net.sf.basedb.clients.web.WebException" … … 89 91 forward = viewPage; 90 92 } 93 else if ("ExportItems".equals(cmd)) 94 { 95 // Run an export plugin in a list context 96 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 97 dc = sc.newDbControl(); 98 final ArrayDesign arrayDesign = ArrayDesign.getById(dc, arrayDesignId); 99 final DataQuery<FeatureData> query = arrayDesign.getFeatures(); 100 cc.configureQuery(query, true); 101 cc.setQuery(query); 102 redirect = "../../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+features+of+array+design"; 103 } 91 104 else 92 105 {
Note: See TracChangeset
for help on using the changeset viewer.