Changeset 4093
- Timestamp:
- Jan 18, 2008, 4:05:29 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 90 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/config/dist/base.config
r4090 r4093 77 77 # If the internal job queue should be enabled or not 78 78 jobqueue.internal.enabled = true 79 80 # Signal receiver class for sending signals to running jobs (to abort them) 81 jobqueue.internal.signalreceiver.class = net.sf.basedb.core.signal.LocalSignalReceiver 82 jobqueue.internal.signalreceiver.init = jobqueue:0 79 83 80 84 # If plugins with useInteralJobQueue = false should be executed or not -
trunk/config/dist/log4j.properties
r4090 r4093 54 54 #log4j.logger.net.sf.basedb.core.storage=debug 55 55 56 ### Log Signal handling events 57 #log4j.logger.net.sf.basedb.core.signal=debug 58 59 56 60 # ----------------- 57 61 # Migration loggers -
trunk/doc/src/docbook/appendix/base.config.xml
r4090 r4093 379 379 380 380 <varlistentry> 381 <term><property>jobqueue.internal.signalreceiver.class</property></term> 382 <listitem> 383 <para> 384 A class implementing the <interfacename docapi="net.sf.basedb.core.signal" 385 >SignalReceiver</interfacename> 386 interface. The class must have a public no-argument constructor. If 387 no value is specified the default setting is: 388 <classname docapi="net.sf.basedb.core.signal" 389 >net.sf.basedb.core.signal.LocalSignalReceiver</classname>. 390 </para> 391 <para> 392 Change to <classname docapi="net.sf.basedb.core.signal" 393 >net.sf.basedb.core.signal.SocketSignalReceiver</classname> 394 if the internal job queue must be able to receive signals from outside 395 this JVM. 396 </para> 397 </listitem> 398 </varlistentry> 399 400 <varlistentry> 401 <term><property>jobqueue.internal.signalreceiver.init</property></term> 402 <listitem> 403 <para> 404 Initialisation string sent to <methodname>SignalReceiver.init()</methodname>. 405 The syntax and meaning of the string depends on the actual implementation 406 that is used. Please see the javadoc for more information. 407 </para> 408 </listitem> 409 </varlistentry> 410 411 <varlistentry> 381 412 <term><property>jobqueue.internal.checkinterval</property></term> 382 413 <listitem> -
trunk/doc/src/docbook/appendix/incompatible.xml
r4090 r4093 45 45 </para> 46 46 </note> 47 48 <sect1 id="appendix.incompatible.2.6"> 49 <title>BASE 2.6 release</title> 50 51 <bridgehead>Feature identification methods</bridgehead> 52 <para> 53 Array design features can now be identified by three different methods: 54 COORDINATES, POSITION and FEATURE_ID. The coordinates method was the 55 only one supported earlier. 56 </para> 57 58 <itemizedlist> 59 <listitem> 60 <para> 61 Client and plug-in code that depends on features having unique COORDINATES 62 may no longer work if used with an array design using a different identification method. 63 Code that is, directly or indirectly, using a 64 <classname docapi="net.sf.basedb.core">FeatureBatcher</classname> or 65 <classname docapi="net.sf.basedb.core">RawDataBatcher</classname> are 66 probably affected by this. For example, a raw data importer which 67 doesn't know how to set the position or the feature ID can't import data to 68 an array design that is using one of the new identification methods. 69 </para> 70 </listitem> 71 72 <listitem> 73 <para> 74 The POSITION identification method will require a unqiue position number. 75 This value used to be an auto-generated sequence starting at 1. The other 76 identification methods will still do that, but when using the POSITION identification 77 method the only requirement is that the position value is a unique positive integer. 78 Client or plug-in code that depends on the position beeing a number between 79 1 and the number of features may fail if used with an array design using 80 the POSITION identification method. 81 </para> 82 </listitem> 83 </itemizedlist> 84 85 </sect1> 47 86 48 87 <sect1 id="appendix.incompatible.2.5"> -
trunk/doc/src/docbook/developerdoc/api_overview.xml
r4090 r4093 730 730 731 731 <para> 732 The <property>lastUpdate</property> property holds the data and time 733 the reporter information was last updated. The value is managed automatically 734 by the <classname>ReporterBatcher</classname> class. 732 The 733 <property>lastUpdate</property> 734 property holds the data and time the reporter information was last updated. The 735 value is managed automatically by the 736 <classname>ReporterBatcher</classname> 737 class. That goes for 738 <property>lastSource</property> 739 property too, which holds information about where the last update comes from. By 740 default this is set to the name of the logged in user, but it can be changed by 741 calling 742 <methodname>ReporterBatcher.setUpdateSource(String source)</methodname> 743 before the batcher commits the updates to the database. The source-string 744 should have the format: <synopsis>[ITEM_TYPE]:[ITEM_NAME]</synopsis> where,in 745 the file-case, ITEM_TYPE is File and ITEM_NAME is the file's name. 735 746 </para> 736 747 </sect3> … … 1947 1958 from plates. In the first case the features on an array design 1948 1959 are described by a reporter map. A reporter map is a file 1949 that maps a coordinate on an array design to a reporter. 1960 that maps a coordinate (block, meta-grid, row, column), 1961 position or an external ID on an array design to a 1962 reporter. Which method to use is given by the 1963 <property>ArrayDesign.featureIdentificationMethod</property> property. 1950 1964 The coordinate system on an array design is divided into blocks. 1951 1965 Each block can be identified either by a <property>blockNumber</property> … … 1954 1968 contains several <classname docapi="net.sf.basedb.core.data">FeatureData</classname> items, each 1955 1969 one identified by a row and column coordinate. Platforms that doesn't 1956 divide the array design into block should create a single super-block1957 that holds all features.1970 divide the array design into blocks or doesn't use the coordinate system at all 1971 must still create a single super-block that holds all features. 1958 1972 </para> 1959 1973 … … 2795 2809 2796 2810 </sect2> 2811 2812 <sect2 id="core_api.signals"> 2813 <title>Sending signals (to plug-ins)</title> 2814 2815 <para> 2816 BASE has a simple system for sending signals between different parts of 2817 a system. This signalling system was initially developed to be able to 2818 kill plug-ins that a user for some reason wanted to abort. The signalling 2819 system as such is not limited to this and it can be used for other purposes 2820 as well. Signals can of course be handled internally in a single JVM but 2821 also sent externally to other JVM:s running on the same or a different 2822 computer. The transport mechanism for signals is decoupled from the actual 2823 handling of them. If you want to, you could implement a signal transporter 2824 that sends signal as emails and the target plug-in would never know. 2825 </para> 2826 2827 <para> 2828 The remainder of this section will focus mainly on the sending and 2829 transportation of signals. For more information about handling signals 2830 on the receiving end, see <xref linkend="plugin_developer.signals" />. 2831 </para> 2832 2833 <sect3 id="core_api.signals.diagram"> 2834 <title>Diagram of classes and methods</title> 2835 <figure id="core_api.figures.signals"> 2836 <title>The signalling system</title> 2837 <screenshot> 2838 <mediaobject> 2839 <imageobject> 2840 <imagedata 2841 align="center" 2842 scalefit="1" width="100%" 2843 fileref="figures/uml/corelayer.signals.png" format="PNG" /> 2844 </imageobject> 2845 </mediaobject> 2846 </screenshot> 2847 </figure> 2848 2849 <para> 2850 The signalling system is rather simple. An object that wish 2851 to receieve signals must implement the 2852 <interfacename docapi="net.sf.basedb.core.signal" 2853 >SignalTarget</interfacename>. It's only method 2854 is <methodname>getSignalHandler()</methodname>. A 2855 <interfacename docapi="net.sf.basedb.core.signal" 2856 >SignalHandler</interfacename> is an object that 2857 knows what to do when a signal is delivered to it. The target object 2858 may implement the <interfacename>SignalHandler</interfacename> itself 2859 or use one of the existing handlers. 2860 </para> 2861 2862 <para> 2863 The difficult part here is to be aware that a signal is usually 2864 delivered by a separate thread. The target object must be aware 2865 of this and know how to handle multiple threads. As an example we 2866 can use the <classname docapi="net.sf.basedb.core.signal" 2867 >ThreadSignalHandler</classname> which simply 2868 calls <code>Thread.interrupt()</code> to deliver a signal. The target 2869 object that uses this signal handler it must know that it should check 2870 <code>Thread.interrupted()</code> at regular intervals from the main 2871 thread. If that method returns true, it means that the <constant>ABORT</constant> 2872 signal has been delivered and the main thread should clean up and exit as 2873 soon as possible. 2874 </para> 2875 2876 <para> 2877 Even if a signal handler could be given directly to the party 2878 that may be interested in sending a signal to the target this 2879 is not recommended. This would only work when sending signals 2880 within the same virtual machine. The signalling system includes 2881 <interfacename docapi="net.sf.basedb.core.signal" 2882 >SignalTransporter</interfacename> and 2883 <interfacename docapi="net.sf.basedb.core.signal" 2884 >SignalReceiver</interfacename> objects that are used 2885 to decouple the sending of signals with the handling of signals. The 2886 implementation usually comes in pairs, for example 2887 <classname docapi="net.sf.basedb.core.signal" 2888 >SocketSignalTransporters</classname> and <classname 2889 docapi="net.sf.basedb.core.signal">SocketSignalReceiver</classname>. 2890 </para> 2891 2892 <para> 2893 Setting up the transport mechanism is usually a system responsibility. 2894 Only the system know what kind of transport that is appropriate for it's current 2895 setup. Ie. should signals be delievered by TCP/IP sockets, only internally, or 2896 should a delivery mechanism based on web services be implemented? 2897 If a system wants to receive signals it must create an appropriate 2898 <interfacename>SignalReceiver</interfacename> object. Within BASE the 2899 internal job queue set up it's own signalling system that can be used to 2900 send signals (eg. kill) running jobs. The job agents do the same but uses 2901 a different implementation. See <xref linkend="appendix.base.config.jobqueue" /> 2902 for more information about how to configure the internal job queue's 2903 signal receiver. In both cases, there is only one signal receiver instance 2904 active in the system. 2905 </para> 2906 2907 <para> 2908 Let's take the internal job queue as an example. Here is how it works: 2909 </para> 2910 2911 <itemizedlist> 2912 <listitem> 2913 <para> 2914 When the internal job queue is started, it will also create a signal 2915 receiver instance according to the settings in <filename>base.config</filename>. 2916 The default is to create <classname docapi="net.sf.basedb.core.signal" 2917 >LocalSignalReceiver</classname> 2918 which can only be used inside the same JVM. If needed, this can 2919 be changed to a <classname docapi="net.sf.basedb.core.signal" 2920 >SocketSignalReceiver</classname> or any other 2921 user-provided implementation. 2922 </para> 2923 </listitem> 2924 2925 <listitem> 2926 <para> 2927 When the job queue has found a plug-in to execute it will check if 2928 it also implements the <interfacename docapi="net.sf.basedb.core.signal" 2929 >SignalTarget</interfacename> 2930 interface. If it does, a signal handler is created and registered 2931 with the signal receiver. This is actually done by the BASE core 2932 by calling <methodname>PluginExecutionRequest.registerSignalReceiver()</methodname> 2933 which also makes sure that the the ID returned from the registration is 2934 stored in the database together with the job item representing the 2935 plug-in to execute. 2936 </para> 2937 </listitem> 2938 2939 <listitem> 2940 <para> 2941 Now, when the web client see's a running job which has a non-empty 2942 signal transporter property, the <guilabel>Abort</guilabel> 2943 button is activated. If the user clicks this button the BASE core 2944 uses the information in the database to create 2945 <interfacename docapi="net.sf.basedb.core.signal" 2946 >SignalTransporter</interfacename> object. This 2947 is simply done by calling <code>Job.getSignalTransporter()</code>. 2948 The created signal transporter knows how to send a signal 2949 to the signal receiver it was first registered with. When the 2950 signal arrives at the receiver it will find the handler for it 2951 and call <code>SignalHandler.handleSignal()</code>. This will in it's turn 2952 trigger some action in the signal target which soon will abort what 2953 it is doing and exit. 2954 </para> 2955 </listitem> 2956 </itemizedlist> 2957 2958 2959 </sect3> 2960 2961 </sect2> 2962 2797 2963 </sect1> 2798 2964 -
trunk/doc/src/docbook/developerdoc/plugin_developer.xml
r4090 r4093 4365 4365 </sect1> 4366 4366 4367 <sect1 id="plugin_developer.signals"> 4368 <title>Enable support for aborting a running a plug-in</title> 4369 4370 <para> 4371 BASE includes a simple signalling system that can be used to send 4372 signals to plug-ins. The system was primarly developed to allow a user 4373 to kill a plug-in when it is executing. Therfore, the focus of this chapter 4374 will be how to implement a plug-in to make it possible to kill it 4375 during it's execution. 4376 </para> 4377 4378 <para> 4379 Since we don't want to do this by brute force such as destroying the 4380 process or stopping thread the plug-in executes in, cooperation is needed 4381 by the plug-in. First, the plug-in must implement the 4382 <interfacename docapi="net.sf.basedb.core.signal">SignalTarget</interfacename> 4383 interface. From this, a <interfacename 4384 docapi="net.sf.basedb.core.signal">SignalHandler</interfacename> can be created. 4385 A plug-in may choose to implement it's own signal handler or use an existing 4386 implementation. BASE, for example, provides the <classname docapi="net.sf.basedb.core.signal" 4387 >ThreadSignalHandler</classname> implementation that supports the <constant>ABORT</constant> signal. 4388 This is a simple implementation that just calls <code>Thread.interrupt()</code> 4389 on the plug-in worker thread. This may cause two different effects: 4390 </para> 4391 4392 <itemizedlist> 4393 <listitem> 4394 <para> 4395 The <code>Thread.interrupted()</code> flag is set. The plug-in must check this 4396 at regular intervals and if the flag is set it must cleanup, rollback 4397 open transactions and exit as soon as possible. 4398 </para> 4399 </listitem> 4400 4401 <listitem> 4402 <para> 4403 If the plug-in is waiting in a blocking call that is interruptable, for 4404 example <code>Thread.sleep()</code>, an <classname>InterruptedException</classname> 4405 is thrown. This should cause the same actions as if the flag was set to happen. 4406 </para> 4407 4408 <warning> 4409 <title>Not all blocking calls are interruptable</title> 4410 <para> 4411 For example calling <code>InputStream.read()</code> may leave the 4412 plug-in waiting in a non-interruptable state. In this case there 4413 is nothing BASE can do to wake it up again. 4414 </para> 4415 </warning> 4416 </listitem> 4417 </itemizedlist> 4418 4419 <para> 4420 Here is a general outline for a plug-in that uses the 4421 <classname>ThreadSignalHandler</classname>. 4422 </para> 4423 <programlisting language="java"> 4424 <![CDATA[ 4425 private ThreadSignalHandler signalHandler; 4426 public SignalHandler getSignalHandler() 4427 { 4428 signalHandler = new ThreadSignalHandler(); 4429 return signalHandler; 4430 } 4431 4432 public void run(Request request, Response response, ProgressReporter progress) 4433 { 4434 if (signalHandler != null) signalHandler.setWorkerThread(null); 4435 beginTransaction(); 4436 boolean done = false; 4437 boolean interrupted = false; 4438 while (!done && !interrupted) 4439 { 4440 try 4441 { 4442 done = doSomeWork(); // NOTE! This must not take forever! 4443 interrupted = Thread.interrupted(); 4444 } 4445 catch (InterruptedException ex) 4446 { 4447 // NOTE! Try-catch is only needed if thread calls 4448 // a blocking method that is interruptable 4449 interrupted = true; 4450 } 4451 } 4452 if (interrupted) 4453 { 4454 rollbackTransaction(); 4455 response.setError("Aborted by user", null); 4456 } 4457 else 4458 { 4459 commitTransaction(); 4460 response.setDone("Done"); 4461 } 4462 } 4463 ]]> 4464 </programlisting> 4465 4466 <para> 4467 Another signal handler implementation is the 4468 <classname docapi="net.sf.basedb.core.signal">ProgressReporterSignalHandler</classname>. 4469 See that javadoc for information about how to use it. 4470 For more information about the signalling system as a whole, 4471 see <xref linkend="core_api.signals" />. 4472 </para> 4473 4474 </sect1> 4475 4367 4476 <sect1 id="plugin_developer.classload"> 4368 4477 <title>How BASE load plug-in classes</title> -
trunk/doc/src/docbook/userdoc/rawbioassays.xml
r4090 r4093 138 138 The array design can be changed after raw data has been 139 139 imported, but this triggers a new validation. If the raw data 140 is stored in the database, the position, coordinates and reporter of all features 141 on the new array design must exactly match the position, 142 coordinates and reporter of the raw data. For Affymetrix data, the 140 is stored in the database, the features on the new array design must 141 match the the raw data. The verification can use three different methods: 142 </para> 143 144 <itemizedlist> 145 <listitem> 146 <para> 147 Coordinates: Verify block, meta-grid, row and column coordinates. 148 </para> 149 </listitem> 150 <listitem> 151 <para>Position: Verify the position number.</para> 152 </listitem> 153 <listitem> 154 <para> 155 Feature ID: Verify the feature ID. This option can only be used 156 if the raw bioassay is currently connected to an array design that 157 has feature ID values already. 158 </para> 159 </listitem> 160 </itemizedlist> 161 <para> 162 In all three cases it is also verified that the reporter of the raw 163 data matches the reporter of the features. 164 </para> 165 166 <para> 167 For Affymetrix data, the 143 168 CEL file is validated against the CDF file of the new array design. 144 169 If the validation fails, the array design is not changed. -
trunk/doc/src/docbook/userdoc/webclient.xml
r4090 r4093 1539 1539 <informalexample>Experiment A, Experiment B, etc.</informalexample> 1540 1540 </para> 1541 1541 <para> 1542 If you want to filter on several values at the same time, separate the 1543 values in the filter input box with the <quote>|</quote> character. 1544 For example, a filter text like <informalexample>Experiment A|C%</informalexample> 1545 matches both <quote>Experiment A</quote> and values 1546 that begin with <quote>C</quote>. 1547 </para> 1542 1548 <para> 1543 1549 You can also use operators to find items which has a value that … … 1571 1577 <varlistentry> 1572 1578 <term><keycap>=</keycap></term> 1573 <listitem><simpara>Equal to (useful to find items with a null value)</simpara></listitem> 1579 <listitem> 1580 <simpara> 1581 Equal to (useful to find items with a null value). Supports 1582 filtering on more then one value. 1583 </simpara> 1584 </listitem> 1574 1585 </varlistentry> 1575 1586 <varlistentry> 1576 1587 <term><keycap><></keycap></term> 1577 1588 <term><keycap>!=</keycap></term> 1578 <listitem><simpara>Not equal to (useful to find items with a non-null value)</simpara></listitem> 1589 <listitem> 1590 <simpara> 1591 Not equal to (useful to find items with a non-null value). Supports 1592 filtering on more then one value. 1593 </simpara> 1594 </listitem> 1595 </varlistentry> 1596 <varlistentry> 1597 <term><keycap>==</keycap></term> 1598 <listitem> 1599 <simpara> 1600 Same as <keycap>=</keycap> but this will ignore <quote>|</quote> as a value separator. 1601 </simpara> 1602 </listitem> 1579 1603 </varlistentry> 1580 1604 </variablelist> -
trunk/src/clients/jobagent/net/sf/basedb/clients/jobagent/Agent.java
r4090 r4093 50 50 import net.sf.basedb.util.Values; 51 51 import net.sf.basedb.util.jobagent.JobAgentServerConnection; 52 import net.sf.basedb.util.jobagent.JobInfo; 52 53 import net.sf.basedb.util.jobagent.RequestHandler; 53 54 import net.sf.basedb.util.timer.Scheduler; … … 250 251 private JobAgentServerConnection server; 251 252 private RequestHandler requestHandler; 253 private AgentSignalReceiver signalReceiver; 252 254 private JobExecutor jobExecutor; 253 255 … … 273 275 private final Map<Job.ExecutionTime, Integer> priorities; 274 276 275 private final Set<Integer> activeJobs; 276 277 private final Set<JobInfo> activeJobs; 278 279 /** 280 Timeout to wait for jobs to act on the ABORT signal when stopping. 281 Default value is 20 seconds. 282 */ 283 private int closeTimeout = 20000; 284 277 285 /** 278 286 The group were all job runners are placed. … … 344 352 runnersGroup.setDaemon(false); 345 353 346 this.activeJobs = new HashSet< Integer>();354 this.activeJobs = new HashSet<JobInfo>(); 347 355 isRunning = false; 348 356 } … … 530 538 if (server == null) 531 539 { 540 this.signalReceiver = new AgentSignalReceiver(this); 541 this.signalReceiver.init(null); 532 542 this.requestHandler = requestHandler == null ? new DefaultRequestHandler(this) : requestHandler; 533 543 this.server = new JobAgentServerConnection(port, this.requestHandler, logServer); … … 634 644 Get a set containing the ID:s of the jobs that are currently 635 645 beeing executed by this job agent. 636 @return A set of integers 637 */ 638 public Set<Integer> getRunningJobs() 646 @return A set of JobInfo objects 647 @since 2.6 648 */ 649 public Set<JobInfo> getRunningJobs() 639 650 { 640 651 if (log.isDebugEnabled()) log.debug("Active jobs: " + activeJobs); … … 683 694 } 684 695 return allow; 696 } 697 698 /** 699 Get the signal receiver that is processing signal messages 700 on behalf of this job agent. 701 @since 2.6 702 */ 703 public AgentSignalReceiver getSignalReceiver() 704 { 705 return signalReceiver; 685 706 } 686 707 … … 793 814 slotToUse = slots[i]; 794 815 usedSlots.put(slotToUse, usedSlots.get(slotToUse) + 1); 795 activeJobs.add( job.getId());816 activeJobs.add(new JobInfo(job, slotToUse)); 796 817 log.debug("Slot: " + slotToUse + "; used: " + usedSlots.get(slotToUse) + "; max: " + maxSlots.get(slotToUse)); 797 818 break; … … 830 851 { 831 852 usedSlots.put(usedSlot, usedSlots.get(usedSlot) - 1); 832 activeJobs.remove( job.getId());853 activeJobs.remove(new JobInfo(job, usedSlot)); 833 854 } 834 855 … … 915 936 916 937 /** 917 Try to stop running jobs by interrupting the threads th aey are executing in.938 Try to stop running jobs by interrupting the threads they are executing in. 918 939 */ 919 940 private void maybeStopRunningJobs() 920 941 { 921 942 log.info("Stopping running jobs. " + activeJobs.size() + " job(s) still active."); 922 // Interrupt all threads. Hopefully they will do as we tell them. 923 runnersGroup.interrupt(); 943 944 // Send ABORT to all jobs, that support signals 945 signalReceiver.close(closeTimeout); 924 946 } 925 947 -
trunk/src/clients/jobagent/net/sf/basedb/clients/jobagent/executors/DummyJobExecutor.java
r4090 r4093 24 24 package net.sf.basedb.clients.jobagent.executors; 25 25 26 import java.util.Collections; 27 26 28 import net.sf.basedb.clients.jobagent.Agent; 27 29 import net.sf.basedb.clients.jobagent.JobExecutor; … … 30 32 import net.sf.basedb.core.JobAgentSettings; 31 33 import net.sf.basedb.core.SessionControl; 34 import net.sf.basedb.core.signal.SignalReceiver; 35 import net.sf.basedb.core.signal.ThreadSignalHandler; 32 36 import net.sf.basedb.util.Values; 33 37 … … 89 93 log.info("Executing job: " + job); 90 94 DbControl dc = null; 95 boolean aborted = false; 96 Throwable error = null; 91 97 try 92 98 { … … 96 102 if (wait > 0) 97 103 { 104 SignalReceiver signalReceiver = agent.getSignalReceiver(); 105 job.setSignalTransporter(signalReceiver.getSignalTransporterClass(), 106 signalReceiver.registerSignalHandler(new ThreadSignalHandler())); 98 107 job.setProgress(50, "Halfway; waiting " + wait + " seconds"); 99 108 dc.commit(); … … 105 114 } 106 115 } 116 catch (InterruptedException ex) 117 { 118 aborted = true; 119 } 107 120 catch (Throwable t) 108 121 { 109 122 log.error(t.getMessage(), t); 123 error = t; 110 124 } 111 125 dc = sc.newDbControl(); 112 126 dc.reattachItem(job); 113 127 } 114 job.doneOk("Not really, but used for testing job agent"); 128 if (aborted) 129 { 130 job.doneError("Aborted by user"); 131 } 132 else if (error != null) 133 { 134 job.doneError(error.getMessage(), Collections.singleton(error)); 135 } 136 else 137 { 138 job.doneOk("Not really, but used for testing job agent"); 139 } 115 140 dc.commit(); 116 141 log.info("Done executing: " + job); -
trunk/src/clients/jobagent/net/sf/basedb/clients/jobagent/executors/ProcessJobExecutor.java
r4090 r4093 42 42 import net.sf.basedb.core.PluginDefinition; 43 43 import net.sf.basedb.core.SessionControl; 44 import net.sf.basedb.core.signal.Signal; 45 import net.sf.basedb.core.signal.SignalHandler; 46 import net.sf.basedb.core.signal.SignalReceiver; 47 import net.sf.basedb.core.signal.SignalTransporter; 48 import net.sf.basedb.core.signal.ThreadSignalHandler; 44 49 import net.sf.basedb.util.Values; 45 50 … … 101 106 private String javaBin; 102 107 private String options; 108 private SignalReceiver signalReceiver; 109 private SignalHandler signalHandler; 103 110 104 111 public ProcessJobExecutor() … … 120 127 if (javaBin == null) javaBin = "java"; 121 128 options = Values.getString(agent.getProperty("agent.executor.process.options"), "-server"); 129 signalReceiver = agent.getSignalReceiver(); 122 130 } 123 131 … … 126 134 { 127 135 log.info("Executing job: " + job); 128 136 129 137 // Generate command for new process 130 138 List<String> cmd = new ArrayList<String>(10); … … 164 172 cmd.add("-t"); // Thread priority 165 173 cmd.add(Integer.toString(agent.getThreadPriority(job.getEstimatedExecutionTime()))); 174 cmd.add("-x"); // Port the job agent is listening on for remote control 175 cmd.add(Integer.toString(agent.getPort())); 166 176 167 177 Process process = null; … … 201 211 new InputStreamReader(process.getInputStream()), result)); 202 212 t.start(); 203 213 204 214 try 205 215 { 206 216 log.info("Waiting for process to end"); 217 signalHandler = new ThreadSignalHandler(); 218 signalReceiver.registerSignalHandler(signalHandler); 207 219 int exitCode = process.waitFor(); 208 220 if (exitCode != 0) … … 224 236 { 225 237 log.info("Job was interrupted: " + job, ex); 226 // Kill the process 227 process.destroy(); 238 // First, send ABORT to the job if it supports it 228 239 dc = sc.newDbControl(); 229 240 job = Job.getById(dc, job.getId()); 230 job.doneError(ex.getMessage(), Arrays.asList(ex)); 241 SignalTransporter signalTransporter = job.getSignalTransporter(); 242 if (signalTransporter != null) 243 { 244 signalTransporter.send(Signal.ABORT); 245 } 246 else 247 { 248 job.doneError("Aborted by user", Arrays.asList(ex)); 249 process.destroy(); 250 } 231 251 dc.commit(); 252 } 253 finally 254 { 255 signalReceiver.unregisterSignalHandler(signalHandler); 232 256 } 233 257 } -
trunk/src/clients/jobagent/net/sf/basedb/clients/jobagent/executors/ThreadJobExecutor.java
r4090 r4093 39 39 import net.sf.basedb.core.SessionControl; 40 40 import net.sf.basedb.core.plugin.Response; 41 import net.sf.basedb.core.signal.SignalReceiver; 42 import net.sf.basedb.core.signal.SocketSignalReceiver; 41 43 import net.sf.basedb.util.SocketUtil; 42 44 import net.sf.basedb.util.Values; … … 65 67 org.apache.log4j.LogManager.getLogger("net.sf.basedb.clients.jobagent.executors.ThreadJobExecutor"); 66 68 69 private SignalReceiver signalReceiver; 67 70 68 71 public ThreadJobExecutor() … … 74 77 */ 75 78 public void init(Agent agent) 76 {} 79 { 80 this.signalReceiver = agent == null ? null : agent.getSignalReceiver(); 81 } 77 82 78 83 public void executeJob(SessionControl sc, Agent agent, Job job, JobAgentSettings settings, … … 99 104 log.error("Error executing job: " + job, t); 100 105 } 106 exec.registerSignalReceiver(signalReceiver); 101 107 dc.commit(); 102 108 … … 130 136 // ------------------------------------------- 131 137 138 private void setSignalReceiver(SignalReceiver signalReceiver) 139 { 140 this.signalReceiver = signalReceiver; 141 } 142 132 143 public static void main(String[] args) 133 144 { … … 138 149 String login = cmdLine.getOption("-u"); 139 150 String password = cmdLine.getOption("-p"); 151 String proxyPort = cmdLine.getOption("-x"); 140 152 int threadPriority = Values.getInt(cmdLine.getOption("-t"), Thread.NORM_PRIORITY); 141 153 … … 152 164 ThreadJobExecutor executor = new ThreadJobExecutor(); 153 165 166 if (proxyPort != null) 167 { 168 SocketSignalReceiver signalReceiver = new SocketSignalReceiver(); 169 signalReceiver.init("proxy=" + Application.getHostName() + ":" + proxyPort); 170 executor.setSignalReceiver(signalReceiver); 171 Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownHook(signalReceiver))); 172 } 173 154 174 sc = Application.newSessionControl("net.sf.basedb.clients.jobagent", 155 175 SocketUtil.getLocalHost().toString(), null); … … 188 208 } 189 209 210 private static class ShutdownHook 211 implements Runnable 212 { 213 private SignalReceiver signalReceiver; 214 215 private ShutdownHook(SignalReceiver signalReceiver) 216 { 217 this.signalReceiver = signalReceiver; 218 } 219 public void run() 220 { 221 signalReceiver.close(5000); 222 } 223 } 190 224 } -
trunk/src/clients/jobagent/net/sf/basedb/clients/jobagent/handlers/DefaultRequestHandler.java
r4090 r4093 69 69 registerHandler(new StopRequestHandler(agent), "stop"); 70 70 registerHandler(new PauseRequestHandler(agent), "pause"); 71 if (agent.getSignalReceiver() != null) 72 { 73 registerHandler(new SignalRequestHandler(agent), "signal"); 74 } 71 75 } 72 76 … … 89 93 String answer = null; 90 94 RequestHandler handler = commandHandlers.get(cmd); 95 if (handler == null && cmd != null && cmd.startsWith("signal://")) 96 { 97 handler = commandHandlers.get("signal"); 98 } 91 99 if (!agent.isAllowedControl(remote, cmd)) 92 100 { -
trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ArrayBlockTransfer.java
r4090 r4093 33 33 import net.sf.basedb.core.DbControl; 34 34 import net.sf.basedb.core.FeatureBatcher; 35 import net.sf.basedb.core.FeatureIdentificationMethod; 35 36 import net.sf.basedb.core.ItemNotFoundException; 36 37 import net.sf.basedb.core.Plate; … … 113 114 ArrayDesign arrayDesign = ArrayDesign.getById(dc, base2Id); 114 115 PreparedStatement ps = prepareStatementFromFile("selectArrayBlocksByArrayType"); 115 FeatureBatcher featureBatcher = arrayDesign.getFeatureBatcher( );116 FeatureBatcher featureBatcher = arrayDesign.getFeatureBatcher(FeatureIdentificationMethod.COORDINATES); 116 117 log.debug("Setting batch size to: " + getBatchSize()); 117 118 featureBatcher.setBatchSize(getBatchSize()); -
trunk/src/clients/migrate/net/sf/basedb/clients/migrate/RawBioAssayDataTransfer.java
r4090 r4093 168 168 */ 169 169 cleanUpMemory(); 170 RawDataBatcher batcher = rawBioAssay.getRawDataBatcher( );170 RawDataBatcher batcher = rawBioAssay.getRawDataBatcher(null); 171 171 batcher.setBatchSize(getBatchSize()); 172 172 runRawBioAssay(rawBioAssay, batcher, hasArrayDesign, rawBioAssayId); -
trunk/src/clients/web/net/sf/basedb/clients/web/fileupload/FileUpload.java
r4090 r4093 774 774 throws IOException 775 775 { 776 if (status.eof || status.atBoundary) return -1; 777 int result = -1; 776 778 int available = end - start; 777 if (available == 0) 778 { 779 if (status.eof || status.atBoundary) return -1; 780 available = readMoreData(); 781 } 782 int result = -1; 779 if (available == 0) available = readMoreData(); 783 780 if (available > 0) 784 781 { 785 // Important! Mask with 0xff to get values in range (0,255), NOT (-128,127) 786 result = buffer[start] & 0xff; 782 result = buffer[start]; 787 783 start++; 788 784 } -
trunk/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java
r4090 r4093 468 468 template.writeHeaders(); 469 469 470 longnumExported = 0;470 int numExported = 0; 471 471 ResultIterator result = null; 472 472 try … … 506 506 if (progress != null) 507 507 { 508 int percent = (int)(100 L* numExported / totalItems);508 int percent = (int)(100f * numExported / totalItems); 509 509 progress.display(percent, numExported + " of " + totalItems + " done."); 510 510 } -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Head.java
r4090 r4093 90 90 91 91 /** 92 93 */ 94 private static final long serialVersionUID = 948719986796860767L; 95 96 /** 92 97 The parent <base:page> tag. 93 98 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/HideableSection.java
r4090 r4093 193 193 194 194 /** 195 196 */ 197 private static final long serialVersionUID = 4750788983708350436L; 198 199 /** 195 200 The parent <base:page> tag. 196 201 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Note.java
r4090 r4093 155 155 { 156 156 157 /** 158 159 */ 160 private static final long serialVersionUID = 7490498743887372136L; 161 157 162 private static final int NOTE_TYPE_ERROR = 1; 158 163 -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Page.java
r4090 r4093 278 278 throws JspException 279 279 { 280 if (type != PAGE_TYPE_INCLUDE) 281 { 282 StringBuilder sb = new StringBuilder(); 283 sb.append("</html>\n"); 284 try 285 { 286 pageContext.getOut().print(sb.toString()); 287 } 288 catch (Exception ex) 289 { 290 throw new JspTagException(ex.getMessage()); 291 } 280 StringBuilder sb = new StringBuilder(); 281 sb.append("</html>\n"); 282 try 283 { 284 pageContext.getOut().print(sb.toString()); 285 } 286 catch (Exception ex) 287 { 288 throw new JspTagException(ex.getMessage()); 292 289 } 293 290 return EVAL_PAGE; -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/PropertyValue.java
r4090 r4093 122 122 123 123 /** 124 125 */ 126 private static final long serialVersionUID = -92637960053523649L; 127 128 /** 124 129 The item. Should be BasicItem or BasicData. 125 130 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Select.java
r4090 r4093 228 228 229 229 230 /** 231 232 */ 233 private static final long serialVersionUID = -9096279950931870965L; 234 230 235 /** 231 236 Optional <code>class</code> attribute -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/menu/Menuitem.java
r4090 r4093 136 136 { 137 137 /** 138 139 */ 140 private static final long serialVersionUID = 1431778959423572670L; 141 142 /** 138 143 The parent Menu. 139 144 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/menu/Menuseparator.java
r4090 r4093 91 91 { 92 92 93 /** 94 95 */ 96 private static final long serialVersionUID = -1758168104130104042L; 97 93 98 private Menu menu; 94 99 -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/menu/Submenu.java
r4090 r4093 135 135 { 136 136 /** 137 138 */ 139 private static final long serialVersionUID = -9170636903520137656L; 140 141 /** 137 142 The parent Menu. 138 143 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/tab/Tab.java
r4090 r4093 127 127 128 128 /** 129 130 */ 131 private static final long serialVersionUID = -2308568821797105775L; 132 133 /** 129 134 The parent TabControl object. 130 135 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/tab/TabControl.java
r4090 r4093 157 157 { 158 158 /** 159 160 */ 161 private static final long serialVersionUID = 1898616270560551262L; 162 163 /** 159 164 Optional <code>style</code> attribute 160 165 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Button.java
r4090 r4093 167 167 168 168 /** 169 170 */ 171 private static final long serialVersionUID = -6294795199053088632L; 172 173 /** 169 174 The parent <tbl:table> tag. 170 175 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Cell.java
r4090 r4093 111 111 112 112 /** 113 114 */ 115 private static final long serialVersionUID = -1992298892993613884L; 116 117 /** 113 118 The parent <tbl:table> tag. 114 119 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/CellValue.java
r4090 r4093 23 23 */ 24 24 package net.sf.basedb.clients.web.taglib.table; 25 26 import java.util.List;27 25 28 26 import javax.servlet.jsp.JspException; … … 91 89 { 92 90 91 /** 92 93 */ 94 private static final long serialVersionUID = 4068184541728474047L; 95 93 96 private static final Formatter toStringFormatter = new ToStringFormatter(); 94 97 … … 97 100 */ 98 101 private Object value = null; 99 private List<?> list = null;102 private Iterable<?> list = null; 100 103 private String separator = "; "; 101 104 … … 113 116 } 114 117 115 public void setList( List<?> list)118 public void setList(Iterable<?> list) 116 119 { 117 120 this.list = list; 118 121 } 119 122 120 public List<?> getList()123 public Iterable<?> getList() 121 124 { 122 125 return list; … … 151 154 theSeparator = separator; 152 155 } 153 if (list != null && list.size() > 0)156 if (list != null) 154 157 { 155 158 for (Object o : list) -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/ColumnDef.java
r4090 r4093 253 253 extends TagSupport 254 254 { 255 256 /** 257 258 */ 259 private static final long serialVersionUID = -272408513116029365L; 255 260 256 261 /** -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Columns.java
r4090 r4093 54 54 { 55 55 56 /** 57 58 */ 59 private static final long serialVersionUID = 8857257637171219032L; 56 60 private Table table; 57 61 private Data data; -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Data.java
r4090 r4093 100 100 101 101 /** 102 103 */ 104 private static final long serialVersionUID = 6633768910320305875L; 105 106 /** 102 107 The parent <tbl:table> tag. 103 108 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Header.java
r4090 r4093 92 92 93 93 /** 94 95 */ 96 private static final long serialVersionUID = -7541520513764712983L; 97 98 /** 94 99 The parent <tbl:table> tag. 95 100 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Label.java
r4090 r4093 137 137 138 138 /** 139 140 */ 141 private static final long serialVersionUID = 5326481772609709567L; 142 143 /** 139 144 The parent <tbl:table> tag. 140 145 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Panel.java
r4090 r4093 107 107 108 108 /** 109 110 */ 111 private static final long serialVersionUID = 8435173953529878997L; 112 113 /** 109 114 The parent <tbl:table> tag. 110 115 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/PresetSelector.java
r4090 r4093 58 58 extends TagSupport 59 59 { 60 61 /** 62 63 */ 64 private static final long serialVersionUID = 6787200020881710014L; 60 65 61 66 /** -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Row.java
r4090 r4093 117 117 118 118 /** 119 120 */ 121 private static final long serialVersionUID = 1975591924471893645L; 122 123 /** 119 124 The parent <tbl:table> tag. 120 125 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Rows.java
r4090 r4093 54 54 { 55 55 56 /** 57 58 */ 59 private static final long serialVersionUID = 2099882746242865479L; 56 60 private Table table; 57 61 private Data data; -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Table.java
r4090 r4093 203 203 204 204 /** 205 206 */ 207 private static final long serialVersionUID = -6717117667917148241L; 208 209 /** 205 210 The parent <base:page> tag. 206 211 */ -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Toolbar.java
r4090 r4093 115 115 116 116 /** 117 118 */ 119 private static final long serialVersionUID = -8719987407920036604L; 120 121 /** 117 122 The parent <tbl:table> tag. 118 123 */ -
trunk/src/core/common-queries.xml
r4090 r4093 524 524 SELECT s 525 525 FROM net.sf.basedb.core.data.MimeTypeData s 526 WHERE LOWER(s.extension) = LOWER(:extension)526 WHERE s.extension = :extension 527 527 </sql> 528 528 <description> -
trunk/src/core/net/sf/basedb/core/Affymetrix.java
r4090 r4093 357 357 if (hasProgress && (index % progressInterval == 0)) 358 358 { 359 int percent = 5 + (int)(90L * (long)index / numProbesets);359 int percent = 5 + 90 * index / numProbesets; 360 360 int remain = numProbesets - index; 361 361 String created = create ? "; " + numCreated + " created" : ""; -
trunk/src/core/net/sf/basedb/core/Job.java
r4090 r4093 1279 1279 private long lastUpdate; 1280 1280 1281 private int lastValue;1282 private int offset;1283 1284 1281 ProgressReporterImpl(Job job, String server, ProgressReporter chained) 1285 1282 throws BaseException … … 1291 1288 this.chained = chained; 1292 1289 this.lastUpdate = 0; 1293 this.lastValue = 0;1294 this.offset = 0;1295 1290 } 1296 1291 … … 1304 1299 if (System.currentTimeMillis() - lastUpdate > UPDATE_INTERVAL || percent == 100) 1305 1300 { 1306 // If the percent is negative and less then the last value, an offset will be calculated.1307 // This will adjust the percent to a realistic value.1308 //Notice: It is only possible to give a value close to what expected.1309 if (percent < lastValue && percent < 0)1310 {1311 if (Math.abs(percent) < Math.abs(lastValue))1312 {1313 offset = offset + 2*Math.abs(lastValue);1314 }1315 else1316 {1317 offset = offset + 2*Math.abs(percent);1318 }1319 }1320 lastValue = percent;1321 percent = percent + offset;1322 1323 1301 lastUpdate = System.currentTimeMillis(); 1324 1302 DbControl dc = null; -
trunk/src/core/net/sf/basedb/core/RawBioAssay.java
r4090 r4093 1164 1164 1165 1165 DataResultIterator<RawData> result = rawQuery.iterate(dc); 1166 longnumValidated = 0;1166 int numValidated = 0; 1167 1167 int numTotal = getNumDbSpots(); 1168 1168 while (result.hasNext()) … … 1221 1221 if (progress != null && numValidated % 100 == 0) 1222 1222 { 1223 int percent = 10 + ( (int)(90L * numValidated) / numTotal);1223 int percent = 10 + (90 * numValidated) / numTotal; 1224 1224 progress.display(percent, "Validated " + numValidated + " of " + numTotal + " spots."); 1225 1225 } -
trunk/src/core/net/sf/basedb/core/SpotImages.java
r4090 r4093 472 472 if (progress != null) 473 473 { 474 longspotsDone = spotImagesPerImage*imageNumber;475 int percent = 10 + (int)(90L * spotsDone / totalSpots);474 int spotsDone = spotImagesPerImage*imageNumber; 475 int percent = 10 + 90 * spotsDone / totalSpots; 476 476 progress.display(percent, "Generating spot images ("+spotsDone+" done)..."); 477 477 } -
trunk/src/core/net/sf/basedb/util/BioAssaySetFilterUtil.java
r4090 r4093 123 123 } 124 124 125 longspotsDone = 0;125 int spotsDone = 0; 126 126 int spotsAfter = 0; 127 127 if (progress != null) progress.display(10, "Filtering spots (0 done; "+spotsTotal+" total)..."); … … 139 139 if (progress != null) 140 140 { 141 int percent = 10 + (int)(90L * spotsDone / spotsTotal);141 int percent = 10 + 90 * spotsDone / spotsTotal; 142 142 progress.display(percent, 143 143 "Filtering spot intensities ("+spotsDone+" done; "+spotsTotal+" total)..."); … … 205 205 // Prepare progress reporting 206 206 int interval = 10; // Update progress after this many spots >= 10 207 longspotsDone = 0;207 int spotsDone = 0; 208 208 int spotsAfter = 0; 209 209 if (progress != null) … … 236 236 if (spotsDone % interval == 0) 237 237 { 238 int percent = 10 + (int)(90L * spotsDone / spotsTotal);238 int percent = 10 + 90 * spotsDone / spotsTotal; 239 239 progress.display(percent, 240 240 "Filtering spot intensities ("+spotsDone+" done; "+spotsTotal+" total)..."); -
trunk/src/core/net/sf/basedb/util/IntensityCalculatorUtil.java
r4090 r4093 305 305 int maxPosition = 0; 306 306 307 longspotsDone = 0; // Number of calculated spots307 int spotsDone = 0; // Number of calculated spots 308 308 int totalSpots = 0; // Total number of spots 309 309 int interval = 0; // Interval between reporter to the progress reporter … … 426 426 if (spotsDone % interval == 0) 427 427 { 428 int percent = 10 + (int)((90L * spotsDone) / totalSpots);428 int percent = 10 + 90 * spotsDone / totalSpots; 429 429 progress.display(percent, "Calculating spot intensities ("+spotsDone+" done)..."); 430 430 } -
trunk/src/core/net/sf/basedb/util/parser/FlatFileParser.java
r4090 r4093 47 47 import net.sf.basedb.core.BaseException; 48 48 import net.sf.basedb.core.Config; 49 import net.sf.basedb.util.InputStreamTracker;50 49 51 50 /** … … 177 176 178 177 /** 179 For keeping track of the number of bytes parsed.180 */181 private InputStreamTracker tracker;182 183 /**184 178 The regular expression for matching a header line. 185 179 */ … … 528 522 { 529 523 Charset cs = Charset.forName(charsetName == null ? Config.getCharset() : charsetName); 530 this.tracker = new InputStreamTracker(in); 531 this.reader = new BufferedReader(new InputStreamReader(tracker, cs)); 524 this.reader = new BufferedReader(new InputStreamReader(in, cs)); 532 525 } 533 526 … … 1123 1116 correspond to the number of parsed bytes depending on the character 1124 1117 set of the file. 1125 @see #getParsedBytes()1126 1118 */ 1127 1119 public long getParsedCharacters() 1128 1120 { 1129 1121 return parsedCharacters; 1130 }1131 1132 /**1133 Get the number of parsed bytes so far. This value may or may not1134 correspond to the number of parsed characters depending on the character1135 set of the file.1136 @since 2.5.11137 @see #getParsedCharacters()1138 */1139 public long getParsedBytes()1140 {1141 return tracker == null ? 0 : tracker.getNumRead();1142 1122 } 1143 1123 -
trunk/src/core/net/sf/basedb/util/zip/TarFilePacker.java
r4090 r4093 97 97 if (lastModified > 0) entry.setModTime(lastModified); 98 98 entry.setSize(size); 99 TarUtil.putNextEntry(entry, tar);99 tar.putNextEntry(entry); 100 100 if (!isDirectory) FileUtil.copy(in, tar); 101 101 tar.closeEntry(); -
trunk/src/plugins/core/net/sf/basedb/plugins/AbstractFlatFileImporter.java
r4090 r4093 542 542 if (section != null && section.type() == FlatFileParser.LineType.SECTION) 543 543 { 544 if (progress != null) progress.display(getProgress(ffp ), "Parsing section "+section.name()+"...");544 if (progress != null) progress.display(getProgress(ffp.getParsedCharacters()), "Parsing section "+section.name()+"..."); 545 545 try 546 546 { … … 571 571 else 572 572 { 573 if (progress != null) progress.display(getProgress(ffp ), "Parsing headers...");573 if (progress != null) progress.display(getProgress(ffp.getParsedCharacters()), "Parsing headers..."); 574 574 } 575 575 FlatFileParser.LineType result = ffp.parseHeaders(); … … 609 609 " on line " + (line == null ? "-1" : line.lineNo() + ": " + StringUtil.trimString(line.line(), 20)), t); 610 610 } 611 if (progress != null) progress.display(getProgress(ffp ), "Parsing data...");611 if (progress != null) progress.display(getProgress(ffp.getParsedCharacters()), "Parsing data..."); 612 612 int progressLine = 0; 613 613 … … 640 640 if (progress != null) 641 641 { 642 progress.display(getProgress(ffp ), "Parsing data... (" + ffp.getParsedLines() + " lines so far)");642 progress.display(getProgress(ffp.getParsedCharacters()), "Parsing data... (" + ffp.getParsedLines() + " lines so far)"); 643 643 } 644 644 } … … 685 685 // ------------------------------------------- 686 686 687 private int getProgress( FlatFileParser ffp)688 { 689 return (int) (100 * ffp.getParsedBytes()/ fileSize);687 private int getProgress(long parsedCharacters) 688 { 689 return (int) (100 * parsedCharacters / fileSize); 690 690 } 691 691 -
trunk/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java
r4090 r4093 1806 1806 case STRING: 1807 1807 { 1808 StringParameterType t = new StringParameterType( 65535, defaultValue, false, 1, new Integer(options), 1);1808 StringParameterType t = new StringParameterType(255, defaultValue, false, 1, new Integer(options), 1); 1809 1809 parameter = new PluginParameter<String>(name, commonName, "", t); 1810 1810 break; … … 1827 1827 case HIDDEN_STRING: 1828 1828 { 1829 StringParameterType t = new StringParameterType( 65535, defaultValue, false, 1, 0, 1);1829 StringParameterType t = new StringParameterType(255, defaultValue, false, 1, 0, 1); 1830 1830 parameter = new PluginParameter<String>(name, null, "", t); 1831 1831 break; … … 1855 1855 enums.add(at.getName(), at.getName()); 1856 1856 } 1857 StringParameterType t = new StringParameterType( 65535, null, false, 1, Values.getInt(options, 30), 1, enums);1857 StringParameterType t = new StringParameterType(255, null, false, 1, Values.getInt(options, 30), 1, enums); 1858 1858 parameter = new PluginParameter<String>(name, commonName, "", t); 1859 1859 break; … … 1861 1861 case ENUMERATION: 1862 1862 { 1863 StringParameterType t = new StringParameterType( 65535, defaultValue, false, 1, Values.getInt(options, 30), 1, enumOptions);1863 StringParameterType t = new StringParameterType(255, defaultValue, false, 1, Values.getInt(options, 30), 1, enumOptions); 1864 1864 parameter = new PluginParameter<String>(name, commonName, "", t); 1865 1865 break; -
trunk/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java
r4090 r4093 685 685 int nof_reporters=bioassayset.getNumReporters(); 686 686 int progress_report_interval=nof_reporters/10; 687 longnof_processed_reporters=0;687 int nof_processed_reporters=0; 688 688 while (spotData.hasNext()) 689 689 { 690 690 if (progress != null && (nof_processed_reporters%progress_report_interval == 0)) 691 691 { 692 progress.display( (int)(100L * nof_processed_reporters / nof_reporters),692 progress.display(100 * nof_processed_reporters / nof_reporters, 693 693 "Exporting ... " + nof_processed_reporters + " of " + 694 694 nof_reporters + " done."); … … 781 781 int nof_spots=bioassayset.getNumSpots(); 782 782 int progress_spot_interval=nof_spots/10; 783 longnof_processed_spots=0;783 int nof_processed_spots=0; 784 784 while (spotData.hasNext()) 785 785 { … … 791 791 (nof_processed_spots%progress_spot_interval == 0)) 792 792 { 793 progress.display( (int)(100L * nof_processed_spots / nof_spots),793 progress.display(100 * nof_processed_spots / nof_spots, 794 794 "Exporting ..." + nof_processed_spots + " of " + 795 795 nof_spots + " done."); -
trunk/src/plugins/core/net/sf/basedb/plugins/IlluminaRawDataImporter.java
r4092 r4093 44 44 import net.sf.basedb.core.DbControl; 45 45 import net.sf.basedb.core.Experiment; 46 import net.sf.basedb.core.FeatureIdentificationMethod; 46 47 import net.sf.basedb.core.File; 47 48 import net.sf.basedb.core.Include; … … 87 88 import net.sf.basedb.util.parser.FlatFileParser.Data; 88 89 import net.sf.basedb.util.parser.FlatFileParser.Line; 89 import net.sf.basedb.util.parser.FlatFileParser.LineType;90 90 91 91 /** … … 167 167 168 168 169 170 169 private static final PluginParameter<String> invalidColumnsErrorParameter = new PluginParameter<String>( 171 170 "invalidColumnsError", … … 291 290 storeValue(job, request, fileParameter); 292 291 storeValue(job, request, ri.getParameter(CHARSET)); 293 storeValue(job, request, ri.getParameter(DECIMAL_SEPARATOR));294 292 295 293 // Associations … … 345 343 Create a FlatFileParser that can parse Illumina data files: 346 344 <ul> 347 <li>Data splitter: (,|\t)345 <li>Data splitter: , 348 346 <li>Header regexp: (.+)=(.*?),* 349 <li>Data header: TargetI D(,|\t).*347 <li>Data header: TargetId,.* 350 348 </ul> 351 NOTE! To begin with we support both comma and tab as column splitter but352 later on (in {@link #isImportable(FlatFileParser)}) when we know which one is actually353 used, we change this in the parser. We need to do this since numbers may354 use comma as decimal separator.355 349 */ 356 350 @Override … … 358 352 throws BaseException 359 353 { 360 String separator = "(,|\\t)";361 354 FlatFileParser ffp = new FlatFileParser(); 362 ffp.setDataSplitterRegexp(Pattern.compile( separator));363 ffp.setDataHeaderRegexp(Pattern.compile("TargetID "+separator + ".*"));355 ffp.setDataSplitterRegexp(Pattern.compile(",")); 356 ffp.setDataHeaderRegexp(Pattern.compile("TargetID,.*")); 364 357 ffp.setHeaderRegexp(Pattern.compile("(.+)=(.*?),*")); 365 358 return ffp; 366 359 } 367 360 /** 368 @return A s specified by job parameter or "dot" if not361 @return Always "dot" 369 362 */ 370 363 @Override 371 364 protected String getDecimalSeparator() 372 365 { 373 String separator = super.getDecimalSeparator(); 374 if (separator == null) separator = "dot"; 375 return separator; 366 return "dot"; 376 367 } 377 368 … … 385 376 { 386 377 String firstLine = ffp.getLineCount() >= 1 ? ffp.getLine(0).line() : null; 387 boolean isIllumina = firstLine != null && firstLine.contains("Illumina"); 388 if (isIllumina) 389 { 390 String separator = ","; 391 FlatFileParser.Line lastLine = ffp.getLine(ffp.getLineCount()-1); 392 if (lastLine.type() == LineType.DATA_HEADER) 393 { 394 int firstTab = lastLine.line().indexOf("\t"); 395 if (firstTab > 0 && firstTab < lastLine.line().indexOf(",")) 396 { 397 separator = "\\t"; 398 } 399 ffp.setDataSplitterRegexp(Pattern.compile(separator)); 400 } 401 } 402 return isIllumina; 378 return firstLine != null && firstLine.contains("Illumina") ; 403 379 } 404 380 … … 495 471 { 496 472 String externalId = reporterMapper.getValue(data); 473 int lineNo = data.dataLineNo(); 497 474 for (BatchAndMapHolder holder : holders) 498 475 { 499 476 RawData raw = holder.batcher.newRawData(); 477 raw.setPosition(lineNo); 500 478 raw.setBlock(1); 501 479 raw.setColumn(1); 502 raw.setRow( data.dataLineNo());480 raw.setRow(lineNo); 503 481 for (Map.Entry<RawDataProperty, Mapper> entry : holder.mappers.entrySet()) 504 482 { … … 507 485 raw.setExtended(ep.getName(), ep.parseString(m.getValue(data), numberFormat, nullIfException)); 508 486 } 509 holder.batcher.insert(raw, externalId );487 holder.batcher.insert(raw, externalId, externalId); 510 488 } 511 489 numInserted++; … … 671 649 parameters.add(fileParameter); 672 650 parameters.add(getCharsetParameter(null, null, null)); 673 parameters.add(getDecimalSeparatorParameter(null, null, (String)job.getValue(DECIMAL_SEPARATOR)));674 651 675 652 // parameters for scan, protocol, software and array design -
trunk/src/plugins/core/net/sf/basedb/plugins/LowessNormalization.java
r4090 r4093 408 408 query.restrict(intensityRestriction); 409 409 long numSpots = query.count(dc); 410 longnormalizedSpots = 0;410 int normalizedSpots = 0; 411 411 if (progress != null) progress.display((int)(normalizedSpots / numSpots * 100), normalizedSpots + " spots normalized"); 412 412 … … 504 504 } 505 505 normalizedSpots += smoothCurve.size(); 506 if (progress != null) progress.display((int)((normalizedSpots * 100 L) / numSpots), normalizedSpots + " spots normalized");506 if (progress != null) progress.display((int)((normalizedSpots * 100) / numSpots), normalizedSpots + " spots normalized"); 507 507 } 508 508 fromBlock = toBlock + 1; -
trunk/src/plugins/core/net/sf/basedb/plugins/MedianRatioNormalization.java
r4090 r4093 349 349 query.restrict(intensityRestriction); 350 350 long numSpots = query.count(dc); 351 longnormalizedSpots = 0;351 int normalizedSpots = 0; 352 352 if (progress != null) progress.display((int)(normalizedSpots / numSpots * 100), normalizedSpots + " spots normalized"); 353 353 … … 441 441 } 442 442 normalizedSpots += toIndex - fromIndex; 443 if (progress != null) progress.display((int)((normalizedSpots * 100 L) / numSpots), normalizedSpots + " spots normalized");443 if (progress != null) progress.display((int)((normalizedSpots * 100) / numSpots), normalizedSpots + " spots normalized"); 444 444 } 445 445 fromBlock = toBlock + 1; -
trunk/src/plugins/core/net/sf/basedb/plugins/PackedFileExporter.java
r4090 r4093 356 356 // Get parameters 357 357 Directory rootDir = (Directory)job.getValue("root"); 358 rootDir = Directory.getById(dc, rootDir.getId());359 358 List<Integer> files = (List<Integer>)job.getValues("files"); 360 359 List<Integer> directories = (List<Integer>)job.getValues("directories"); -
trunk/src/plugins/core/net/sf/basedb/plugins/TarFileUnpacker.java
r4090 r4093 24 24 package net.sf.basedb.plugins; 25 25 26 import java.io.BufferedInputStream;27 26 import java.io.IOException; 28 27 import java.io.InputStream; … … 54 53 import net.sf.basedb.util.Values; 55 54 import net.sf.basedb.util.zip.AbstractFileUnpacker; 56 import net.sf.basedb.util.zip.TarUtil;57 55 58 56 /** … … 140 138 if (isGzip) 141 139 { 142 tarStream = new TarInputStream(new GZIPInputStream( new BufferedInputStream(pin)));140 tarStream = new TarInputStream(new GZIPInputStream(pin)); 143 141 } 144 142 else if (isBzip) … … 147 145 pin.read(); 148 146 pin.read(); 149 tarStream = new TarInputStream(new CBZip2InputStream( new BufferedInputStream(pin)));147 tarStream = new TarInputStream(new CBZip2InputStream(pin)); 150 148 } 151 149 else … … 162 160 long totalUnpacked = 0; 163 161 int numFiles = 0; 164 while ((entry = TarUtil.getNextEntry(tarStream)) != null) 162 163 while ((entry = tarStream.getNextEntry()) != null) 165 164 { 166 165 String subPath = entry.getName(); -
trunk/src/test/TestAnalyzePluginUtil.java
r4090 r4093 72 72 rba.setName("TestAnalyzePluginUtil"+i); 73 73 rba.setDescription("RawBioAssay created by TestAnalyzePluginUtil. Number of spots should be "+spots); 74 RawDataBatcher rawDataBatcher = rba.getRawDataBatcher( );74 RawDataBatcher rawDataBatcher = rba.getRawDataBatcher(null); 75 75 for (int j = 0; parser.hasMoreData() && j < spots; j++) 76 76 { -
trunk/src/test/TestArrayDesign.java
r4090 r4093 31 31 import net.sf.basedb.core.Feature; 32 32 import net.sf.basedb.core.FeatureBatcher; 33 import net.sf.basedb.core.FeatureIdentificationMethod; 33 34 import net.sf.basedb.core.File; 34 35 import net.sf.basedb.core.FileSetMember; … … 74 75 int id3 = test_create(Platform.AFFYMETRIX, true); 75 76 int id4 = test_create(Platform.AFFYMETRIX, false); 77 int id6 = test_create(Platform.GENERIC, false); 76 78 test_load(id); 77 79 test_list(-1); … … 81 83 test_import_from_file(id2, "data/test.reportermap.import.txt", 82 84 "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"ID\"\\t\"Name\".*", 0, 2, 1, 3); 83 test_add_features(id, 10); 85 test_add_features(id, FeatureIdentificationMethod.COORDINATES, 10); 86 test_add_features(id6, FeatureIdentificationMethod.FEATURE_ID, 10); 84 87 85 88 write_feature_header(); … … 114 117 test_delete(id4); 115 118 test_delete(id5); 119 test_delete(id6); 116 120 117 121 TestPlate.test_delete_all(); … … 309 313 } 310 314 311 static void test_add_features(int arrayDesignId, int numFeatures)315 static void test_add_features(int arrayDesignId, FeatureIdentificationMethod fiMethod, int numFeatures) 312 316 { 313 317 if (arrayDesignId == 0) return; … … 328 332 } 329 333 330 FeatureBatcher batcher = ad.getFeatureBatcher( );334 FeatureBatcher batcher = ad.getFeatureBatcher(fiMethod); 331 335 int block = 1; 332 336 int row = 1; 333 337 int column = 1; 338 int position = 1; 334 339 ArrayDesignBlock adBlock = ad.addArrayDesignBlock(new BlockInfo(block, (int)Math.ceil(block/4F), ((block-1)%4)+1)); 335 340 time = System.currentTimeMillis(); … … 344 349 data.setRow(row); 345 350 data.setColumn(column); 351 data.setPosition(position); 352 data.setExternalId(reporter.getExternalId() + "." + position); 346 353 347 354 batcher.insert(data); 348 355 row++; 356 position++; 349 357 if (row == 11) 350 358 { … … 395 403 wells.addAll(plate.getWells().list(dc)); 396 404 } 397 FeatureBatcher batcher = ad.getFeatureBatcher( );405 FeatureBatcher batcher = ad.getFeatureBatcher(FeatureIdentificationMethod.COORDINATES); 398 406 int block = 1; 399 407 int row = 1; … … 549 557 dc = TestUtil.getDbControl(); 550 558 ArrayDesign ad = ArrayDesign.getById(dc, arrayDesignId); 551 FeatureBatcher featureBatcher = ad.getFeatureBatcher( );559 FeatureBatcher featureBatcher = ad.getFeatureBatcher(FeatureIdentificationMethod.COORDINATES); 552 560 ReporterBatcher reporterBatcher = ReporterBatcher.getNew(dc); 553 561 -
trunk/src/test/TestBioAsssaySetExporter.java
r4090 r4093 171 171 ReporterData r2 = Reporter.getById(dc, r2Id); 172 172 ReporterData r3 = Reporter.getById(dc, r3Id); 173 RawDataBatcher rdb = rba.getRawDataBatcher( );173 RawDataBatcher rdb = rba.getRawDataBatcher(null); 174 174 for (int i=0; i < 4; ++i) 175 175 { -
trunk/src/test/TestRawBioAssay.java
r4090 r4093 315 315 RawDataType rdt = rba.getRawDataType(); 316 316 List<RawDataProperty> extraProperties = rdt.getProperties(); 317 RawDataBatcher rdb = rba.getRawDataBatcher( );317 RawDataBatcher rdb = rba.getRawDataBatcher(null); 318 318 int block = 1; 319 319 int row = 1; … … 459 459 dc = TestUtil.getDbControl(); 460 460 RawBioAssay rba = RawBioAssay.getById(dc, rawBioAssayId); 461 RawDataBatcher rawDataBatcher = rba.getRawDataBatcher( );461 RawDataBatcher rawDataBatcher = rba.getRawDataBatcher(null); 462 462 ReporterBatcher reporterBatcher = ReporterBatcher.getNew(dc); 463 463 -
trunk/src/test/net/sf/basedb/test/FileUtil.java
r4090 r4093 27 27 28 28 import org.apache.tools.bzip2.CBZip2InputStream; 29 30 import com.ice.tar.TarInputStream;31 29 32 30 import net.sf.basedb.core.DbControl; … … 68 66 69 67 boolean isBzip = false; 70 boolean isTar = false;71 68 if (filename.endsWith(".bz2")) 72 69 { 73 70 isBzip = true; 74 71 filename = filename.substring(0, filename.length()-4); 75 }76 if (filename.endsWith(".tar"))77 {78 isTar = true;79 filename = filename.substring(0, filename.length() - 4);80 72 } 81 73 … … 104 96 toUpload = new CBZip2InputStream(toUpload); 105 97 } 106 if (isTar)107 {108 // Assume that the TAR only contains a single file109 TarInputStream tar = new TarInputStream(toUpload);110 tar.getNextEntry();111 toUpload = tar;112 }113 98 file.upload(toUpload, false, true); 114 99 } -
trunk/src/test/net/sf/basedb/test/merge/MergeTest.java
r4090 r4093 42 42 import net.sf.basedb.core.Experiment; 43 43 import net.sf.basedb.core.FeatureBatcher; 44 import net.sf.basedb.core.FeatureIdentificationMethod; 44 45 import net.sf.basedb.core.Formula; 45 46 import net.sf.basedb.core.ItemParameterType; … … 200 201 TestUtil.write("--Creating features for array design: " + design.getName() + "\n"); 201 202 dc.reattachItem(design); 202 FeatureBatcher batcher = design.getFeatureBatcher( );203 FeatureBatcher batcher = design.getFeatureBatcher(FeatureIdentificationMethod.COORDINATES); 203 204 ReporterBatcher reporterBatcher = ReporterBatcher.getNew(dc); 204 205 for (int block = 1; block <= 10; block++) … … 237 238 TestUtil.write("--Creating data for raw bioassay: " + rba.getName() + "\n"); 238 239 dc.reattachItem(rba); 239 RawDataBatcher batcher = rba.getRawDataBatcher( );240 RawDataBatcher batcher = rba.getRawDataBatcher(null); 240 241 for (int block = 1; block <= 10; block++) 241 242 { … … 252 253 rawData.setExtended("ch1FgMean", ch1 + noise); 253 254 rawData.setExtended("ch2FgMean", ch1 * ratio - noise); 254 batcher.insert(rawData, externalId );255 batcher.insert(rawData, externalId, null); 255 256 } 256 257 } -
trunk/src/test/net/sf/basedb/test/roles/AdminTest.java
r4090 r4093 120 120 dc = TestUtil.getDbControl(); 121 121 File reporters = FileUtil.uploadFile(dc, "/mouse", "plates_and_reporters.mouse.v4.37k.txt", FileType.PLATE); 122 File affyReporters = FileUtil.uploadFile(dc, "/affymetrix/annotations", "MG_U74Av2_annot.csv. tar.bz2", FileType.REPORTER);122 File affyReporters = FileUtil.uploadFile(dc, "/affymetrix/annotations", "MG_U74Av2_annot.csv.bz2", FileType.REPORTER); 123 123 dc.commit(); 124 124 -
trunk/src/test/net/sf/basedb/test/roles/PowerUserTest.java
r4090 r4093 161 161 File plates = FileUtil.uploadFile(dc, "/mouse", "plates_and_reporters.mouse.v4.37k.txt", FileType.PLATE); 162 162 File printMap = FileUtil.uploadFile(dc, "/mouse", "printmap.mouse.v4.37k.tam", FileType.PRINT_MAP); 163 File cdfFile = FileUtil.uploadFile(dc, "/affymetrix/cdf", "MG_U74Av2.cdf. tar.bz2", FileType.REPORTER_MAP);163 File cdfFile = FileUtil.uploadFile(dc, "/affymetrix/cdf", "MG_U74Av2.cdf.bz2", FileType.REPORTER_MAP); 164 164 dc.commit(); 165 165 -
trunk/src/test/net/sf/basedb/test/roles/UserTest.java
r4090 r4093 142 142 File rawData2DyeSwap = FileUtil.uploadFile(dc, "/mouse", "genepix.mouse.v4.37k.24h.dyeswap.gpr", FileType.RAW_DATA); 143 143 144 File affy1 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1761.cel. tar.bz2", FileType.RAW_DATA);145 File affy2 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1762.cel. tar.bz2", FileType.RAW_DATA);146 File affy3 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1763.cel. tar.bz2", FileType.RAW_DATA);144 File affy1 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1761.cel.bz2", FileType.RAW_DATA); 145 File affy2 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1762.cel.bz2", FileType.RAW_DATA); 146 File affy3 = FileUtil.uploadFile(dc, "/affymetrix/E-TEST-1.ebi.ac.uk", "jos1763.cel.bz2", FileType.RAW_DATA); 147 147 dc.commit(); 148 148 -
trunk/www/admin/jobagents/view_agent.jsp
r4090 r4093 38 38 import="net.sf.basedb.core.JobAgentSettings" 39 39 import="net.sf.basedb.util.jobagent.JobAgentInfo" 40 import="net.sf.basedb.util.jobagent.JobInfo" 40 41 import="net.sf.basedb.core.User" 41 42 import="net.sf.basedb.core.PermissionDeniedException" … … 413 414 414 415 <% 415 Set< Integer> jobs = agent.getInfo().getJobs();416 Set<JobInfo> jobs = agent.getInfo().getJobInfo(); 416 417 if (jobs == null || jobs.size() == 0) 417 418 { … … 450 451 /> 451 452 <tbl:columndef 453 id="slot" 454 title="Used slot" 455 /> 456 <tbl:columndef 452 457 id="started" 453 458 title="Started" … … 466 471 <tbl:rows> 467 472 <% 468 for ( int jobId: jobs)473 for (JobInfo jobInfo : jobs) 469 474 { 470 475 Job job = null; … … 472 477 try 473 478 { 474 job = Job.getById(dc, jobI d);479 job = Job.getById(dc, jobInfo.getJobId()); 475 480 } 476 481 catch (Throwable t) … … 483 488 <tbl:cell column="plugin"><base:propertyvalue item="<%=job%>" property="pluginDefinition"/></tbl:cell> 484 489 <tbl:cell column="started"><%=job == null ? "" : dateFormatter.format(job.getStarted())%></tbl:cell> 490 <tbl:cell column="slot"><%=jobInfo.getSlot() == null ? "" : jobInfo.getSlot().toString()%></tbl:cell> 485 491 <tbl:cell column="percentComplete"> 486 492 <% -
trunk/www/common/annotations/list_annotations.jsp
r4090 r4093 389 389 } 390 390 %> 391 </div> 391 392 392 393 </base:body> -
trunk/www/lims/arraydesigns/features/index.jsp
r4090 r4093 46 46 <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> 47 47 <%! 48 private static final ItemContext defaultContext = Base.createDefaultContext("position", "position,block,row,column,reporter.name,reporter.externalId"); 48 private static final ItemContext defaultContext = Base.createDefaultContext("position", 49 "position,externalId,block,row,column,reporter.name,reporter.externalId"); 49 50 private static final Item itemType = Item.FEATURE; 50 51 %> -
trunk/www/lims/arraydesigns/features/list_features.jsp
r4090 r4093 36 36 import="net.sf.basedb.core.ArrayDesignBlock" 37 37 import="net.sf.basedb.core.Feature" 38 import="net.sf.basedb.core.FeatureIdentificationMethod" 38 39 import="net.sf.basedb.core.ReporterType" 39 40 import="net.sf.basedb.core.Reporter" … … 88 89 final ArrayDesign design = ArrayDesign.getById(dc, arrayDesignId); 89 90 final boolean isAffy = design.isAffyChip(); 91 final FeatureIdentificationMethod fiMethod = design.getFeatureIdentificationMethod(); 90 92 Formatter<Date> dateFormatter = FormatterFactory.getDateTimeFormatter(sc); 91 93 … … 112 114 int numListed = 0; 113 115 %> 114 116 <base:page title="<%=title%>"> 115 117 <base:head scripts="table.js,tabcontrol.js" styles="table.css,headertabcontrol.css,path.css"> 116 118 <script language="JavaScript"> … … 210 212 filterable="true" 211 213 exportable="true" 212 show="always" 214 show="<%=fiMethod == FeatureIdentificationMethod.EXTERNAL_ID ? "auto" : "always"%>" 215 /> 216 <tbl:columndef 217 id="externalId" 218 property="externalId" 219 datatype="string" 220 title="Feature ID" 221 sortable="true" 222 filterable="true" 223 exportable="true" 224 show="<%=fiMethod == FeatureIdentificationMethod.EXTERNAL_ID ? "always" : "auto"%>" 213 225 /> 214 226 <tbl:columndef … … 540 552 <tbl:cell column="position"><div class="link" onclick="itemOnClick(event, <%=itemId%>)" 541 553 title="<%=tooltip%>"><%=item.getPosition()%></div></tbl:cell> 554 <tbl:cell column="externalId"><div class="link" onclick="itemOnClick(event, <%=itemId%>)" 555 title="<%=tooltip%>"><%=HTML.encodeTags(item.getExternalId())%></div></tbl:cell> 542 556 <tbl:cell column="block"><%=block.getBlockNumber()%></tbl:cell> 543 557 <tbl:cell column="row"><%=item.getRow()%></tbl:cell> -
trunk/www/lims/arraydesigns/features/view_feature.jsp
r4090 r4093 79 79 80 80 final ArrayDesign design = ArrayDesign.getById(dc, arrayDesignId); 81 81 82 final boolean isAffy = design.isAffyChip(); 82 83 FeatureData feature = design.getFeatureById(itemId); … … 107 108 </tr> 108 109 <tr> 109 <td class="prompt">Affy chip</td> 110 <td><%=isAffy ? " yes" : "no"%></td> 110 <td class="prompt">Platform / Variant</td> 111 <td><base:propertyvalue item="<%=design%>" property="platform" /> / <base:propertyvalue item="<%=design%>" property="variant" /></td> 112 </tr> 113 <tr> 114 <td class="prompt">Feature identification method</td> 115 <td><%=design.getFeatureIdentificationMethod()%></td> 111 116 </tr> 112 117 </table> … … 114 119 <h4>Feature / block</h4> 115 120 <table class="form" cellspacing=0> 121 <tr> 122 <td class="prompt">Feature ID</td> 123 <td colspan="7"><%=HTML.encodeTags(feature.getExternalId())%></td> 124 </tr> 116 125 <tr> 117 126 <td class="prompt">Position</td> -
trunk/www/lims/arraydesigns/list_designs.jsp
r4090 r4093 48 48 import="net.sf.basedb.core.PermissionDeniedException" 49 49 import="net.sf.basedb.core.PluginDefinition" 50 import="net.sf.basedb.core.FeatureIdentificationMethod" 50 51 import="net.sf.basedb.core.query.Hql" 51 52 import="net.sf.basedb.core.query.Restrictions" … … 72 73 private static final Item itemType = Item.ARRAYDESIGN; 73 74 private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); 75 private static final Enumeration<String, String> fiMethods = new Enumeration<String, String>(); 76 static 77 { 78 for (FeatureIdentificationMethod fim : FeatureIdentificationMethod.values()) 79 { 80 fiMethods.add(Integer.toString(fim.getValue()), fim.toString()); 81 } 82 fiMethods.lock(); 83 } 74 84 %> 75 85 <% … … 305 315 filterable="true" 306 316 exportable="true" 317 /> 318 <tbl:columndef 319 id="featureIdentificationMethod" 320 property="featureIdentificationMethod" 321 datatype="int" 322 title="Feature ID meth." 323 tooltip="Feature identification method" 324 sortable="true" 325 filterable="true" 326 exportable="true" 327 enumeration="<%=fiMethods%>" 307 328 /> 308 329 <tbl:columndef … … 547 568 <tbl:cell column="numDbFeatures"><%=item.getNumDbFeatures()%></tbl:cell> 548 569 <tbl:cell column="numFileFeatures"><%=item.getNumFileFeatures()%></tbl:cell> 570 <tbl:cell column="featureIdentificationMethod"><%=item.getFeatureIdentificationMethod()%></tbl:cell> 549 571 <tbl:cell column="batches"> 550 572 <% -
trunk/www/lims/arraydesigns/view_design.jsp
r4090 r4093 303 303 <td class="prompt">Features</td> 304 304 <td><%=design.hasFeatures() ? "yes (db: " + design.getNumDbFeatures() + "; file: " + design.getNumFileFeatures() + ")" : "no"%></td> 305 </tr> 306 <tr> 307 <td class="prompt">Feature identification method</td> 308 <td><%=design.getFeatureIdentificationMethod()%></td> 305 309 </tr> 306 310 <tr> -
trunk/www/views/experiments/bioassays/list_bioassays.jsp
r4090 r4093 88 88 ItemResultIterator<BioAssay> bioAssays = null; 89 89 ItemResultList<AnnotationType> annotationTypes = null; 90 ItemResultList<AnnotationType> experimentalFactors = null; 90 91 try 91 92 { … … 93 94 final BioAssaySet bioAssaySet = BioAssaySet.getById(dc, bioAssaySetId); 94 95 final Experiment experiment = bioAssaySet.getExperiment(); 96 final ItemQuery<AnnotationType> experimentalFactorQuery = experiment.getExperimentalFactors(); 97 experimentalFactorQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS); 95 98 final int experimentId = experiment.getId(); 96 99 final RawDataType rawDataType = experiment.getRawDataType(); … … 108 111 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 109 112 annotationTypes = annotationTypeQuery.list(dc); 113 experimentalFactors = experimentalFactorQuery.list(dc); 110 114 try 111 115 { 112 116 final ItemQuery<BioAssay> query = Base.getConfiguredQuery(cc, true, bioAssaySet.getBioAssays(), mode); 117 query.join(Hql.leftJoin("rawParents", "rba")); 113 118 bioAssays = query.iterate(dc); 114 119 } 115 120 catch (Throwable t) 116 121 { 122 t.printStackTrace(); 117 123 cc.setMessage(t.getMessage()); 118 124 } 119 125 int numListed = 0; 120 126 %> 121 <base:page title="<%=title%>" type="<%=mode.getPageType()%>"> 127 <%@page import="net.sf.basedb.util.BioAssaySetUtil"%> 128 <base:page title="<%=title%>" type="<%=mode.getPageType()%>"> 122 129 <base:head scripts="table.js,tabcontrol.js" styles="table.css,headertabcontrol.css,path.css"> 123 130 <script language="JavaScript"> … … 292 299 title="<%=HTML.encodeTags(at.getName())+" [A]"%>" 293 300 property="<%="#"+at.getId()%>" 301 annotation="true" 302 datatype="<%=at.getValueType().getStringValue()%>" 303 enumeration="<%=annotationEnum%>" 304 sortable="false" 305 filterable="true" 306 exportable="true" 307 formatter="<%=formatter%>" 308 /> 309 <% 310 } 311 %> 312 <% 313 for (AnnotationType at : experimentalFactors) 314 { 315 Enumeration<String, String> annotationEnum = null; 316 Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); 317 if (at.isEnumeration()) 318 { 319 annotationEnum = new Enumeration<String, String>(); 320 List<?> values = at.getValues(); 321 for (Object value : values) 322 { 323 String encoded = formatter.format(value); 324 annotationEnum.add(encoded, encoded); 325 } 326 } 327 %> 328 <tbl:columndef 329 id="<%="ef"+at.getId()%>" 330 title="<%=HTML.encodeTags(at.getName())+" [EF]"%>" 331 property="<%="$rba.##"+at.getId()%>" 294 332 annotation="true" 295 333 datatype="<%=at.getValueType().getStringValue()%>" … … 484 522 } 485 523 } 524 for (AnnotationType at : experimentalFactors) 525 { 526 %> 527 <tbl:cell column="<%="ef"+at.getId()%>" 528 ><tbl:cellvalue 529 list="<%=BioAssaySetUtil.getAnnotationValues(dc, item, at)%>" 530 /></tbl:cell> 531 <% 532 } 486 533 %> 487 534 <tbl:cell column="tools"> -
trunk/www/views/experiments/bioassays/view_bioassay.jsp
r4090 r4093 36 36 import="net.sf.basedb.core.BioAssay" 37 37 import="net.sf.basedb.core.RawBioAssay" 38 import="net.sf.basedb.core.Annotatable" 39 import="net.sf.basedb.core.AnnotationSet" 40 import="net.sf.basedb.core.AnnotationType" 41 import="net.sf.basedb.core.Annotation" 38 42 import="net.sf.basedb.core.ItemQuery" 39 43 import="net.sf.basedb.core.ItemResultList" … … 45 49 import="net.sf.basedb.core.query.Orders" 46 50 import="net.sf.basedb.core.query.Hql" 51 import="net.sf.basedb.util.formatter.Formatter" 52 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 47 53 import="net.sf.basedb.clients.web.Base" 48 54 import="net.sf.basedb.clients.web.PermissionUtil" … … 50 56 import="net.sf.basedb.util.Values" 51 57 import="java.util.Map" 58 import="java.util.List" 59 import="java.util.HashMap" 60 import="java.util.LinkedList" 52 61 %> 53 62 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> … … 214 223 title="Description" 215 224 /> 225 <% 226 ItemQuery<AnnotationType> efQuery = experiment.getExperimentalFactors(); 227 efQuery.include(Include.ALL); 228 efQuery.order(Orders.asc(Hql.property("name"))); 229 ItemResultList<AnnotationType> experimentalFactors = efQuery.list(dc); 230 for (AnnotationType at : experimentalFactors) 231 { 232 Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); 233 %> 234 <tbl:columndef 235 id="<%="at"+at.getId()%>" 236 title="<%=HTML.encodeTags(at.getName())%>" 237 formatter="<%=formatter%>" 238 /> 239 <% 240 } 241 %> 216 242 <tbl:data> 217 243 <tbl:columns> … … 226 252 <tbl:cell column="spots"><%=item.getSpots()%></tbl:cell> 227 253 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 254 <% 255 AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null; 256 for (AnnotationType at : experimentalFactors) 257 { 258 String value = "<i>- none -</i>"; 259 List<Annotation> all = as == null ? null : as.findAnnotations(dc, at, true); 260 Map<Annotatable, List> factorValues = new HashMap<Annotatable, List>(); 261 if (all != null && all.size() > 0) 262 { 263 for (Annotation a : all) 264 { 265 List values = a.getValues(); 266 Annotatable aItem = null; 267 try 268 { 269 aItem = a.getAnnotationSet().getItem(); 270 } 271 catch (Throwable t) 272 {} 273 List toAdd = factorValues.get(aItem); 274 if (toAdd == null) 275 { 276 toAdd = new LinkedList(); 277 factorValues.put(aItem, toAdd); 278 } 279 toAdd.addAll(values); 280 } 281 } 282 %> 283 <tbl:cell column="<%="at"+at.getId()%>" 284 > 285 <% 286 for (Map.Entry<Annotatable, List> entry : factorValues.entrySet()) 287 { 288 Annotatable aItem = entry.getKey(); 289 List values = entry.getValue(); 290 %> 291 <tbl:cellvalue list="<%=values%>" /> 292 <% 293 if (aItem != null && aItem.hasPermission(Permission.WRITE)) 294 { 295 %>: <base:icon image="edit.gif" 296 onclick="<%="editInheritedAnnotation('"+aItem.getType().name()+"',"+aItem.getId()+","+at.getId()+")"%>" 297 tooltip="Modify the values of this experimental factor" /> 298 <% 299 } 300 } 301 %> 302 </tbl:cell> 303 <% 304 } 305 %> 228 306 </tbl:row> 229 307 <% -
trunk/www/views/experiments/bioassaysets/view_bioassayset.jsp
r4090 r4093 174 174 } 175 175 } 176 function changeImage(imageId, url) 177 { 178 var img = document.getElementById(imageId); 179 img.src = url; 180 } 176 181 function runItemPlugin(cmd) 177 182 { 178 183 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&experiment_id=<%=experimentId%>&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540); 179 184 } 180 var imageQueue = new Array();181 var nextImage = 0;182 function addImage(imageId, url)183 {184 imageQueue[imageQueue.length] = imageId;185 var img = document.getElementById(imageId);186 img.realSrc = url;187 }188 function imageLoaded()189 {190 nextImage++;191 prepareNextImage();192 }193 function prepareNextImage()194 {195 if (imageQueue.length > nextImage)196 {197 var imageId = imageQueue[nextImage];198 var img = document.getElementById(imageId);199 img.src = '../../../images/plot_generating_400x300.gif';200 setTimeout('loadNextImage()', 100);201 }202 }203 function loadNextImage()204 {205 if (imageQueue.length > nextImage)206 {207 var imageId = imageQueue[nextImage];208 var img = document.getElementById(imageId);209 img.onload = imageLoaded;210 img.src = img.realSrc;211 }212 }213 185 </script> 214 <style>215 .plot {216 border: 1px solid #666666;217 background-image: url('../../../images/plot_empty_400x300.png');218 }219 </style>220 186 </base:head> 221 <base:body onload="loadNextImage()">187 <base:body> 222 188 <p> 223 189 <p:path> … … 515 481 ItemQuery<BioAssay> bioAssayQuery = bioAssaySet.getBioAssays(); 516 482 bioAssayQuery.order(Orders.asc(Hql.property("name"))); 517 StringBuilder script = new StringBuilder();518 483 for (BioAssay bioAssay : bioAssayQuery.list(dc)) 519 484 { … … 523 488 url += "&filter="+filter; 524 489 url += "&title="+HTML.urlEncode(bioAssay.getName()); 525 script.append("addImage('MA").append(bioAssay.getId()).append("','").526 append(url).append("');\n");527 490 %> 528 491 <img id="MA<%=bioAssay.getId()%>" 529 src="../../../images/ transparent_pixel.gif"530 width="400" height="300" 492 src="../../../images/plot_generating_400x300.gif" 493 width="400" height="300" 531 494 alt="MA-plot for bioassay <%=HTML.encodeTags(bioAssay.getName())%>" 532 class="plot" 533 > 495 style="border: 1px solid #666666;"> 496 <script language="JavaScript"> 497 setTimeout("changeImage('MA<%=bioAssay.getId()%>', '<%=url%>')", 100); 498 </script> 534 499 <% 535 500 } 536 %>537 <script language="JavaScript">538 <%=script%>539 </script>540 <%541 501 } 542 502 %> … … 553 513 String xLabel = HTML.urlEncode("A, log10(ch1 * ch2) / 2"); 554 514 String yLabel = HTML.urlEncode("M, log2(ch1 / ch2)"); 555 StringBuilder script = new StringBuilder();556 515 for (BioAssay bioAssay : bioAssayQuery.list(dc)) 557 516 { … … 560 519 url += "&xLabel="+xLabel+"&yLabel="+yLabel; 561 520 url += "&title="+HTML.urlEncode(bioAssay.getName()); 562 script.append("addImage('CF").append(bioAssay.getId()).append("','").563 append(url).append("');\n");564 521 %> 565 522 <img id="CF<%=bioAssay.getId()%>" 566 src="../../../images/ transparent_pixel.gif"567 width="400" height="300" 523 src="../../../images/plot_generating_400x300.gif" 524 width="400" height="300" 568 525 alt="Correction factor plot for bioassay <%=HTML.encodeTags(bioAssay.getName())%>" 569 class="plot" 570 > 526 style="border: 1px solid #666666;"> 527 <script language="JavaScript"> 528 setTimeout("changeImage('CF<%=bioAssay.getId()%>', '<%=url%>')", 100); 529 </script> 571 530 <% 572 531 } 573 %>574 <script language="JavaScript">575 <%=script%>576 </script>577 <%578 532 } 579 533 %> -
trunk/www/views/jobs/index.jsp
r4090 r4093 39 39 import="net.sf.basedb.core.PermissionDeniedException" 40 40 import="net.sf.basedb.core.ItemAlreadyExistsException" 41 import="net.sf.basedb.core.signal.SignalTransporter" 42 import="net.sf.basedb.core.signal.Signal" 41 43 import="net.sf.basedb.util.RemovableUtil" 42 44 import="net.sf.basedb.util.ShareableUtil" … … 238 240 redirect = viewPage; 239 241 } 242 else if ("AbortJob".equals(cmd)) 243 { 244 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 245 dc = sc.newDbControl(); 246 Job job = Job.getById(dc, cc.getId()); 247 if (job.getStatus() == Job.Status.WAITING) 248 { 249 job.doneError("Aborted by user"); 250 } 251 else 252 { 253 SignalTransporter signalTransporter = job.getSignalTransporter(); 254 if (signalTransporter != null) signalTransporter.send(Signal.ABORT); 255 } 256 dc.commit(); 257 Thread.sleep(500); 258 redirect = viewPage; 259 } 240 260 else 241 261 { -
trunk/www/views/jobs/view_job.jsp
r4090 r4093 47 47 import="net.sf.basedb.core.plugin.GuiContext" 48 48 import="net.sf.basedb.core.plugin.Plugin" 49 import="net.sf.basedb.core.signal.SignalTransporter" 50 import="net.sf.basedb.core.signal.Signal" 49 51 import="net.sf.basedb.clients.web.Base" 50 52 import="net.sf.basedb.clients.web.util.HTML" … … 57 59 import="java.util.List" 58 60 import="java.util.Collections" 61 import="java.util.Collection" 59 62 %> 60 63 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> … … 103 106 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 104 107 Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); 108 109 // Check if the plug-in supports the "Abort" signal 110 boolean supportsAbort = status == Job.Status.WAITING && writePermission; 111 if (status == Job.Status.EXECUTING && writePermission) 112 { 113 try 114 { 115 SignalTransporter signalTransporter = job.getSignalTransporter(); 116 Collection<Signal> supportedSignals = signalTransporter != null ? 117 signalTransporter.getSupportedSignals() : null; 118 supportsAbort = signalTransporter != null && 119 (supportedSignals == null || supportedSignals.contains(Signal.ABORT)); 120 } 121 catch (Exception ex) 122 {} 123 } 105 124 %> 106 125 … … 116 135 } 117 136 } 137 function abortJob() 138 { 139 if (confirm('Are you sure? This action may not be undone')) 140 { 141 location.href = 'index.jsp?ID=<%=ID%>&cmd=AbortJob&item_id=<%=itemId%>'; 142 } 143 } 118 144 function restartJob() 119 145 { … … 147 173 </base:head> 148 174 <base:body onload="autoUpdate()"> 149 150 175 <h3 class="docked"><%=title%> <base:help tabcontrol="main" /></h3> 151 176 <t:tabcontrol id="main" active="<%=tab%>" position="bottom" contentstyle="<%="height: "+(int)(scale*320)+"px;"%>"> … … 289 314 </table> 290 315 </t:tab> 291 292 316 <% 293 317 if (job.getStackTrace() != null) … … 474 498 %> 475 499 <% 500 if (supportsAbort) 501 { 502 %> 503 <base:button onclick="abortJob()" title="Abort…" image="abort.png" /> 504 <% 505 } 506 %> 507 <% 476 508 if (job.getStatus() == Job.Status.ERROR && job.getJobType() == Job.Type.RUN_PLUGIN) 477 509 { -
trunk/www/views/rawbioassays/edit_rawbioassay.jsp
r4090 r4093 509 509 { 510 510 parentsChanged = true; 511 <% 512 if (rawBioAssay != null && rawBioAssay.getNumDbSpots() > 0) 513 { 514 %> 515 var frm = document.forms['rawbioassay']; 516 var selectedId = frm.arraydesign_id[frm.arraydesign_id.selectedIndex].value; 517 var showFiMethod = (selectedId > 0 && selectedId != <%=currentArrayDesign == null ? 0 : currentArrayDesign.getId()%>); 518 if (showFiMethod) 519 { 520 Main.show('fiMethod'); 521 } 522 else 523 { 524 Main.hide('fiMethod'); 525 } 526 <% 527 } 528 %> 511 529 } 512 530 function selectArrayDesignOnClick() … … 535 553 list.selectedIndex = 1; 536 554 parentsChanged = true; 555 arrayDesignOnChange(); 537 556 } 538 557 … … 653 672 </td> 654 673 </tr> 655 674 <tr id="fiMethod" style="display: none;"> 675 <td></td> 676 <td> 677 <select name="fiMethod"> 678 <option value="">-auto- (array design decides) 679 <option value="COORDINATES">Coordinates 680 <option value="POSITION">Position 681 <option value="FEATURE_ID">Feature ID (*) 682 </select> 683 <br> 684 Select a method for feature identification. <br> 685 (*) The Feature ID method only works if the raw data is currently 686 connected to an array design which has Feature ID values. 687 </td> 688 </tr> 656 689 <tr> 657 690 <td class="prompt">Protocol</td> -
trunk/www/views/rawbioassays/index.jsp
r4090 r4093 1 <%@page import="net.sf.basedb.core.FeatureIdentificationMethod"%> 1 2 <%-- $Id$ 2 3 ------------------------------------------------------------------ … … 90 91 private final int arrayDesignId; 91 92 private final SessionControl sc; 92 93 private UpdateArrayDesign(Job job, RawBioAssay rba, ArrayDesign design) 93 private final FeatureIdentificationMethod fiMethod; 94 95 private UpdateArrayDesign(Job job, RawBioAssay rba, ArrayDesign design, FeatureIdentificationMethod fiMethod) 94 96 { 95 97 this.jobId = job.getId(); … … 97 99 this.arrayDesignId = design.getId(); 98 100 this.sc = job.getSessionControl(); 101 this.fiMethod = fiMethod; 99 102 } 100 103 … … 113 116 try 114 117 { 115 rba.updateArrayDesign(design, progress);118 rba.updateArrayDesign(design, fiMethod, progress); 116 119 progress.display(99, "Committing changes to database..."); 117 120 dc.commit(); … … 124 127 catch (Throwable t) 125 128 { 129 if (dc != null) dc.close(); 126 130 dc = sc.newDbControl(); 127 131 j = Job.getById(dc, jobId); … … 284 288 Job job = null; 285 289 ArrayDesign ad = null; 290 FeatureIdentificationMethod fiMethod = null; 286 291 int arrayDesignId = Values.getInt(request.getParameter("arraydesign_id"), -1); 287 292 if (arrayDesignId >= 0) // < 0 = denied or unchanged … … 290 295 if (rba.hasData()) 291 296 { 297 try 298 { 299 fiMethod = FeatureIdentificationMethod.valueOf(request.getParameter("fiMethod")); 300 } 301 catch (Exception ex) 302 {} 292 303 if (rba.getRawDataType().isStoredInDb() && ad != null && ad.hasFeatures()) 293 304 { … … 301 312 else 302 313 { 303 rba.updateArrayDesign(ad, null);314 rba.updateArrayDesign(ad, fiMethod, null); 304 315 } 305 316 } … … 323 334 { 324 335 redirect = "../jobs/index.jsp?ID="+ID+"&cmd=ViewItem&item_id="+job.getId(); 325 Thread updateThread = new Thread(new UpdateArrayDesign(job, rba, ad ));336 Thread updateThread = new Thread(new UpdateArrayDesign(job, rba, ad, fiMethod)); 326 337 updateThread.setPriority(Thread.currentThread().getPriority() - 1); 327 338 updateThread.start(); -
trunk/www/views/rawbioassays/rawdata/list_rawdata.jsp
r4090 r4093 95 95 96 96 final DataQuery<RawData> query = rawBioAssay.getRawData(); 97 query.join(Hql.leftJoin(null, "reporter", "r", null, true)); 98 query.join(Hql.leftJoin(null, "feature", "f", null, true)); 99 query.join(Hql.leftJoin("f", "arrayDesignBlock", "b", null, true)); 97 100 cc.configureQuery(query, true); 98 101 if (!"row".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("row"))); … … 397 400 datatype="int" 398 401 title="[Feat] Position" 402 sortable="true" 403 filterable="true" 404 exportable="true" 405 /> 406 <tbl:columndef 407 id="feature.externalId" 408 property="feature.externalId" 409 datatype="string" 410 title="[Feat] Feature ID" 399 411 sortable="true" 400 412 filterable="true" … … 704 716 %> 705 717 <tbl:cell column="feature.position"><i>- none -</i></tbl:cell> 718 <tbl:cell column="feature.externalId"><i>- none -</i></tbl:cell> 706 719 <tbl:cell column="feature.row"><i>- none -</i></tbl:cell> 707 720 <tbl:cell column="feature.column"><i>- none -</i></tbl:cell> … … 721 734 %> 722 735 <tbl:cell column="feature.position"><%=feature.getPosition()%></tbl:cell> 736 <tbl:cell column="feature.externalId"><%=HTML.encodeTags(feature.getExternalId())%></tbl:cell> 723 737 <tbl:cell column="feature.row"><%=feature.getRow()%></tbl:cell> 724 738 <tbl:cell column="feature.column"><%=feature.getColumn()%></tbl:cell> -
trunk/www/views/reporters/index.jsp
r4090 r4093 42 42 import="net.sf.basedb.core.PermissionDeniedException" 43 43 import="net.sf.basedb.core.BaseException" 44 import="net.sf.basedb.core.User" 44 45 import="net.sf.basedb.util.RemovableUtil" 45 46 import="net.sf.basedb.util.ShareableUtil" -
trunk/www/views/reporters/list_reporters.jsp
r4090 r4093 243 243 exportable="true" 244 244 formatter="<%=timeFormatter%>" 245 /> 246 <tbl:columndef 247 id="lastSource" 248 property="lastSource" 249 datatype="string" 250 title="Last source" 251 sortable="true" 252 filterable="true" 253 exportable="true" 245 254 /> 246 255 <% … … 424 433 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 425 434 <tbl:cell column="lastUpdate" value="<%=item.getLastUpdate()%>" /> 435 <tbl:cell column="lastSource"><%=HTML.encodeTags(item.getLastSource())%></tbl:cell> 426 436 <tbl:cell column="reporterType" 427 437 ><base:propertyvalue -
trunk/www/views/reporters/view_reporter.jsp
r4090 r4093 191 191 <td><%=dateFormatter.format(reporter.getLastUpdate())%></td> 192 192 </tr> 193 <tr> 194 <td class="prompt">Last source</td> 195 <td><%=HTML.niceFormat(reporter.getLastSource())%></td> 196 </tr> 193 197 </table> 194 198
Note: See TracChangeset
for help on using the changeset viewer.