Changeset 6600
- Timestamp:
- Nov 17, 2014, 8:41:18 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3.3-stable merged: 6575,6577-6586,6588,6592-6594,6597 /tags/3.3.3 (added) merged: 6598
- Property svn:mergeinfo changed
-
trunk/config/dist/base.config
r6468 r6600 41 41 #db.driver = org.postgresql.Driver 42 42 #db.url = jdbc:postgresql:base2 43 #db.dynamic.catalog = base244 43 #db.dynamic.schema = dynamic 45 44 #db.queries = /postgres-queries.xml -
trunk/credits.txt
r6576 r6600 1 1 $Id$ 2 2 3 The current BASE team is (at BASE 3.3. 2release)3 The current BASE team is (at BASE 3.3.3 release) 4 4 {{{ 5 5 Jari Häkkinen -
trunk/doc/src/docbook/appendix/update_warnings.xml
r6479 r6600 61 61 since the <classname>org.hibernate.dialect.PostgreSQLDialect</classname> has 62 62 been deprecated. 63 </para> 64 65 </sect1> 66 67 <sect1 id="appendix.update_warnings.3.3.3"> 68 <title>BASE 3.3.3</title> 69 70 <bridgehead>Remaining quantity</bridgehead> 71 <para> 72 A bug that affected remaining quantity calculations for 73 biomaterial item has been fixed. Existing items may have been 74 saved with incorrect remaining quantity and must be fixed. 75 After installing the BASE 3.3.3 update, the existing 76 remaining quantity values are fix by running a special script. 77 Change directory to <filename class="directory"><base-dir>/bin/</filename> 78 and issue 79 <programlisting> 80 ./onetimefix.sh remaining_quantity -u <root login> -p <root pwd> 81 </programlisting> 63 82 </para> 64 83 -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/ExtensionsControl.java
r6520 r6600 804 804 { 805 805 ExtensionPoint<?> ep = getExtensionPoint(ex.getExtends()); 806 if (ep == null) return false; 806 807 // The extension point cant violoate the policy 807 808 if (!ep.getActionClass().isAnnotationPresent(UnsafeScriptable.class)) return false; -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/path/Path.java
r6127 r6600 146 146 sb.append("<h1"); 147 147 addIdAndStyles(sb); 148 addDynamicAttributes(sb); 148 149 sb.append(">"); 149 150 -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/path/PathElement.java
r6127 r6600 225 225 sb.append("<span"); 226 226 addIdAndStyles(sb); 227 addDynamicAttributes(sb); 227 228 sb.append(">"); 228 229 if (getHref() != null && isEnabled()) -
trunk/src/core/net/sf/basedb/core/BioMaterialEvent.java
r6268 r6600 26 26 import net.sf.basedb.core.query.Restrictions; 27 27 import net.sf.basedb.core.query.Hql; 28 29 28 import net.sf.basedb.core.data.BioMaterialData; 30 29 import net.sf.basedb.core.data.BioMaterialEventData; … … 719 718 checkPermission(Permission.RESTRICTED_WRITE); 720 719 if (bioMaterial == null) throw new InvalidUseOfNullException("bioMaterial"); 721 BioMaterialData data = (BioMaterialData) bioMaterial.getData();720 BioMaterialData data = (BioMaterialData)HibernateUtil.unwrapIfProxy(getDbControl().getHibernateSession(), bioMaterial.getData()); 722 721 Map<BioMaterialData, BioMaterialEventSourceData> sources = getData().getSources(); 723 722 BioMaterialEventSourceData src = sources.remove(data); … … 858 857 Map<BioMaterialData, BioMaterialEventSourceData> sources = getData().getSources(); 859 858 int parentId = parent == null ? 0 : parent.getId(); 860 859 861 860 Iterator<Map.Entry<BioMaterialData, BioMaterialEventSourceData>> it = sources.entrySet().iterator(); 862 861 while (it.hasNext()) … … 865 864 866 865 BioMaterialEventSourceData src = entry.getValue(); 867 BioMaterialData bioMaterial = entry.getKey();866 BioMaterialData bioMaterial = (BioMaterialData)HibernateUtil.unwrapIfProxy(dc.getHibernateSession(), entry.getKey()); 868 867 869 868 if (bioMaterial.getId() != parentId) -
trunk/src/core/net/sf/basedb/core/BioMaterialEventSource.java
r5963 r6600 25 25 import java.util.Set; 26 26 27 import net.sf.basedb.core.data.BioMaterialData; 27 28 import net.sf.basedb.core.data.BioMaterialEventSourceData; 28 29 import net.sf.basedb.core.data.MeasuredBioMaterialData; … … 167 168 { 168 169 checkPermission(Permission.RESTRICTED_WRITE); 169 if (data.getBioMaterial() instanceof MeasuredBioMaterialData) 170 { 171 MeasuredBioMaterialData mbData = (MeasuredBioMaterialData)data.getBioMaterial(); 170 BioMaterialData bm = (BioMaterialData)HibernateUtil.unwrapIfProxy(dc.getHibernateSession(), data.getBioMaterial()); 171 if (bm instanceof MeasuredBioMaterialData) 172 { 173 MeasuredBioMaterialData mbData = (MeasuredBioMaterialData)bm; 172 174 Float delta = 0.0f; 173 175 if (data.getUsedQuantity() != null) -
trunk/src/core/net/sf/basedb/core/HibernateUtil.java
r6542 r6600 1453 1453 throw new BaseException(ex); 1454 1454 } 1455 } 1456 1457 /** 1458 If the given data object is a proxy, load the real data object instead. 1459 @since 3.3.3 1460 */ 1461 static BasicData unwrapIfProxy(Session session, BasicData data) 1462 { 1463 if (data instanceof org.hibernate.proxy.HibernateProxy) 1464 { 1465 org.hibernate.proxy.HibernateProxy proxy = (org.hibernate.proxy.HibernateProxy)data; 1466 org.hibernate.proxy.LazyInitializer li = proxy.getHibernateLazyInitializer(); 1467 if (li.isUninitialized()) 1468 { 1469 if (session instanceof SessionWrapper) 1470 { 1471 session = ((SessionWrapper)session).getParentSession(); 1472 } 1473 li.setSession((org.hibernate.internal.SessionImpl)session); 1474 } 1475 data = (BasicData)li.getImplementation(); 1476 } 1477 1478 return data; 1455 1479 } 1456 1480 -
trunk/src/core/net/sf/basedb/core/RawDataBatcher.java
r6468 r6600 39 39 import java.util.Set; 40 40 import java.sql.SQLException; 41 41 42 42 43 /** … … 161 162 @see FeatureIdentificationMethod 162 163 */ 163 private final Map<Object, FeatureData> preloaded; 164 private Map<Object, FeatureInfo> preloaded; 165 166 private ReporterProxy reporterProxy; 167 private FeatureProxy featureProxy; 164 168 165 169 /** … … 230 234 } 231 235 232 // Preload features233 if (arrayDesign != null && arrayDesign.getHasFeatures() && rawBioAssay.getNumDbSpots() == 0)234 {235 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(dc.getStatelessSession(), "COUNT_FEATURES_FOR_ARRAYDESIGN");236 /*237 SELECT count(*)238 FROM FeatureData f239 WHERE f.arrayDesignBlock.arrayDesign = :arrayDesign240 */241 query.setInteger("arrayDesign", arrayDesign.getId());242 int numFeatures = HibernateUtil.loadData(Long.class, query).intValue();243 preloaded = new HashMap<Object, FeatureData>(numFeatures);244 query = HibernateUtil.getPredefinedQuery(dc.getStatelessSession(), "PRELOAD_FEATURES");245 /*246 SELECT f247 FROM FeatureData f248 JOIN FETCH f.arrayDesignBlock b249 LEFT JOIN FETCH f.reporter250 WHERE b.arrayDesign = :arrayDesign251 */252 query.setInteger("arrayDesign", arrayDesign.getId());253 ScrollIterator<FeatureData> si = null;254 try255 {256 si = QueryExecutor.loadIterator(FeatureData.class, query,257 dc.getStatelessSession(), dc.getSessionControl());258 }259 catch (InterruptedException ex)260 {261 throw new SignalException("Aborted by user", ex);262 }263 while (si.hasNext())264 {265 ThreadSignalHandler.checkInterrupted();266 FeatureData feature = si.next();267 Object featureId = fiMethod.getIdentifier(feature);268 if (preloaded.put(featureId, feature) != null)269 {270 throw new InvalidDataException("Can't identify features with " + fiMethod +271 ". Found duplicate feature: " + featureId);272 }273 }274 si.close();275 }276 else277 {278 this.preloaded = null;279 }280 this.usedFeatures = new HashSet<Object>(preloaded == null ? 100 : preloaded.size());281 236 setDbControl(dc); 282 237 } … … 529 484 throws BaseException 530 485 { 486 if (usedFeatures == null) preloadFeatures(); 531 487 if (externalReporterId != null) externalReporterId = externalReporterId.trim(); 532 488 if (preloaded == null) … … 571 527 "] has already been used by another spot."); 572 528 } 573 Feature Datafeature = preloaded.get(featureId);529 FeatureInfo feature = preloaded.get(featureId); 574 530 if (feature == null) 575 531 { … … 579 535 "=" + featureId + "] doesn't exist on array design"); 580 536 } 581 ReporterData reporterOnFeature = feature.getReporter( );537 ReporterData reporterOnFeature = feature.getReporter(reporterProxy); 582 538 if (reporterOnFeature == null && acceptInsertIfNullReporterOnFeature) 583 539 { … … 595 551 } 596 552 data.setPosition(feature.getPosition()); 597 setPropertyValue(data, "feature", feature );553 setPropertyValue(data, "feature", feature.getFeature(featureProxy)); 598 554 data.setReporter(reporterOnFeature); 599 555 } 600 556 super.insert(data); 557 } 558 559 private void preloadFeatures() 560 { 561 // Preload features 562 if (arrayDesign != null && arrayDesign.getHasFeatures() && rawBioAssay.getNumDbSpots() == 0) 563 { 564 DbControl dc = getDbControl(); 565 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(dc.getStatelessSession(), "COUNT_FEATURES_FOR_ARRAYDESIGN"); 566 /* 567 SELECT count(*) 568 FROM FeatureData f 569 WHERE f.arrayDesignBlock.arrayDesign = :arrayDesign 570 */ 571 query.setInteger("arrayDesign", arrayDesign.getId()); 572 int numFeatures = HibernateUtil.loadData(Long.class, query).intValue(); 573 preloaded = new HashMap<Object, FeatureInfo>(numFeatures); 574 reporterProxy = new ReporterProxy(); 575 featureProxy = new FeatureProxy(); 576 query = HibernateUtil.getPredefinedQuery(dc.getStatelessSession(), "PRELOAD_FEATURES"); 577 /* 578 SELECT f 579 FROM FeatureData f 580 JOIN FETCH f.arrayDesignBlock b 581 LEFT JOIN FETCH f.reporter 582 WHERE b.arrayDesign = :arrayDesign 583 */ 584 query.setInteger("arrayDesign", arrayDesign.getId()); 585 ScrollIterator<FeatureData> si = null; 586 try 587 { 588 si = QueryExecutor.loadIterator(FeatureData.class, query, 589 dc.getStatelessSession(), dc.getSessionControl()); 590 } 591 catch (InterruptedException ex) 592 { 593 throw new SignalException("Aborted by user", ex); 594 } 595 while (si.hasNext()) 596 { 597 ThreadSignalHandler.checkInterrupted(); 598 FeatureData feature = si.next(); 599 Object featureId = fiMethod.getIdentifier(feature); 600 if (preloaded.put(featureId, new FeatureInfo(feature)) != null) 601 { 602 throw new InvalidDataException("Can't identify features with " + fiMethod + 603 ". Found duplicate feature: " + featureId); 604 } 605 } 606 si.close(); 607 } 608 else 609 { 610 this.preloaded = null; 611 } 612 this.usedFeatures = new HashSet<Object>(preloaded == null ? 100 : preloaded.size()); 601 613 } 602 614 … … 646 658 } 647 659 660 661 static class FeatureInfo 662 { 663 private final int featureId; 664 private final int position; 665 private final int reporterId; 666 private final String externalReporterId; 667 668 FeatureInfo(FeatureData feature) 669 { 670 featureId = feature.getId(); 671 position = feature.getPosition(); 672 ReporterData reporter = feature.getReporter(); 673 if (reporter != null) 674 { 675 reporterId = reporter.getId(); 676 externalReporterId = reporter.getExternalId(); 677 } 678 else 679 { 680 reporterId = 0; 681 externalReporterId = null; 682 } 683 } 684 685 int getPosition() 686 { 687 return position; 688 } 689 690 ReporterData getReporter(ReporterProxy proxy) 691 { 692 return reporterId == 0 ? null : proxy.setTheId(reporterId, externalReporterId); 693 } 694 695 FeatureData getFeature(FeatureProxy proxy) 696 { 697 return proxy.setTheId(featureId); 698 } 699 700 } 701 702 static class ReporterProxy 703 extends ReporterData 704 { 705 private int id; 706 private String externalId; 707 708 ReporterProxy() 709 {} 710 711 ReporterProxy setTheId(int id, String externalId) 712 { 713 this.id = id; 714 this.externalId = externalId; 715 return this; 716 } 717 @Override 718 public int getId() 719 { 720 return id; 721 } 722 723 @Override 724 public String getExternalId() 725 { 726 return externalId; 727 } 728 } 729 730 static class FeatureProxy 731 extends FeatureData 732 { 733 private int id; 734 735 FeatureProxy() 736 { 737 super(null, (ReporterData)null); 738 } 739 740 FeatureProxy setTheId(int id) 741 { 742 this.id = id; 743 return this; 744 } 745 @Override 746 public int getId() 747 { 748 return id; 749 } 750 } 751 648 752 } -
trunk/src/core/net/sf/basedb/core/Update.java
r6520 r6600 26 26 import java.util.ArrayList; 27 27 import java.util.Arrays; 28 import java.util.HashMap; 28 29 import java.util.HashSet; 29 30 import java.util.Iterator; … … 49 50 import net.sf.basedb.core.data.ItemSubtypeData; 50 51 import net.sf.basedb.core.data.JobData; 52 import net.sf.basedb.core.data.MeasuredBioMaterialData; 51 53 import net.sf.basedb.core.data.PropertyFilterData; 52 54 import net.sf.basedb.core.data.ReporterCloneTemplateData; … … 930 932 } 931 933 934 /** 935 Vefify and update the remaining quantity of all biomaterials. 936 @return The number of biomaterial fixed 937 */ 938 public static int recalculateRemainingQuantity(ProgressReporter progress) 939 throws BaseException 940 { 941 org.hibernate.Session session = null; 942 org.hibernate.Transaction tx = null; 943 int numUpdated = 0; 944 try 945 { 946 session = HibernateUtil.newSession(); 947 tx = HibernateUtil.newTransaction(session); 948 949 // For temporary storing the new remaining quantities 950 Map<Integer, Double> remaining = new HashMap<Integer, Double>(); 951 952 // Load used quantity for all events 953 org.hibernate.Query eventQuery = HibernateUtil.createQuery(session, 954 "SELECT evt.bioMaterial.id, evt.usedQuantity FROM BioMaterialEventData evt WHERE NOT evt.usedQuantity IS NULL"); 955 956 // Load used quantity for sources to all events 957 org.hibernate.Query sourcesQuery = HibernateUtil.createQuery(session, 958 "SELECT src.bioMaterial.id, src.usedQuantity FROM BioMaterialEventSourceData src WHERE NOT src.usedQuantity IS NULL"); 959 960 progress.display(10, "Loading biomaterial items...\n"); 961 962 List<Object[]> events = HibernateUtil.loadList(Object[].class, eventQuery, null); 963 events.addAll(HibernateUtil.loadList(Object[].class, sourcesQuery, null)); 964 965 // Calculate the remaining quantity for each biomaterial 966 // o[0] = biomaterial id, o[1] = used quantity 967 for (Object[] o : events) 968 { 969 Integer id = (Integer)o[0]; 970 Float usedQuantity = (Float)o[1]; 971 Double currentRemaining = remaining.get(id); 972 if (currentRemaining == null) currentRemaining = 0.0; 973 currentRemaining = currentRemaining - usedQuantity.doubleValue(); 974 remaining.put(id, currentRemaining); 975 } 976 progress.display(30, "Found "+ remaining.size() + " items. Checking remaining quantity...\n"); 977 978 // Update the remaining quantity 979 org.hibernate.Query updateQuery = HibernateUtil.createQuery(session, 980 "UPDATE MeasuredBioMaterialData mbm " + 981 "SET mbm.remainingQuantity = :remain "+ 982 "WHERE mbm = :bioMaterial"); 983 int numProcessed = 0; 984 for (Map.Entry<Integer, Double> entry : remaining.entrySet()) 985 { 986 MeasuredBioMaterialData bioMaterial = HibernateUtil.loadData(session, MeasuredBioMaterialData.class, entry.getKey()); 987 Double remainingQuantity = entry.getValue(); 988 Float currentRemaining = bioMaterial.getRemainingQuantity(); 989 if (currentRemaining == null || Math.abs(currentRemaining-remainingQuantity) > Math.abs(currentRemaining / 10000)) 990 { 991 updateQuery.setEntity("bioMaterial", bioMaterial); 992 updateQuery.setFloat("remain", remainingQuantity.floatValue()); 993 updateQuery.executeUpdate(); 994 numUpdated++; 995 } 996 numProcessed++; 997 if (numProcessed % 100 == 0) 998 { 999 progress.display(30 + numProcessed * 60 / remaining.size(), "Processed " + numProcessed + " biomaterial items... "); 1000 } 1001 } 1002 progress.append("\n"); 1003 if (numUpdated == 0) 1004 { 1005 progress.display(100, "Found " + numUpdated + " items to fix\n"); 1006 } 1007 else 1008 { 1009 progress.display(95, "Found " + numUpdated + " items to fix. Comitting transaction...\n"); 1010 // Commit the changes 1011 HibernateUtil.commit(tx); 1012 progress.display(100, "Completeted update of " + numUpdated + " items\n"); 1013 } 1014 } 1015 catch (BaseException ex) 1016 { 1017 if (tx != null) HibernateUtil.rollback(tx); 1018 throw ex; 1019 } 1020 return numUpdated; 1021 } 1022 932 1023 933 1024 -
trunk/src/install/net/sf/basedb/install/OneTimeFix.java
r5735 r6600 31 31 32 32 33 34 35 36 33 37 import net.sf.basedb.core.Application; 34 38 import net.sf.basedb.core.Config; 35 39 import net.sf.basedb.core.ProgressReporter; 40 import net.sf.basedb.core.SessionControl; 41 import net.sf.basedb.core.Update; 42 import net.sf.basedb.core.authentication.LoginRequest; 43 import net.sf.basedb.util.ConsoleProgressReporter; 36 44 37 45 /** … … 55 63 try 56 64 { 57 String cmd = args[0]; 58 if (" foo".equals(cmd))65 String cmd = args[0]; 66 if ("remaining_quantity".equals(cmd)) 59 67 { 60 showUsage(); 68 String login = getOption(args, "-u", "root"); 69 String pwd = getOption(args, "-p", "root"); 70 71 String msg = 72 "-------------------------------------------------------------------\n" + 73 "This script re-calculates the remaining quantity of all biomaterial\n" + 74 "items since it may have become incorrect due to a bug.\n" + 75 "For more information see: http://base.thep.lu.se/ticket/1873\n\n" + 76 "Press ENTER to continue or CTRL+C to abort\n" + 77 "-------------------------------------------------------------------"; 78 System.out.println(msg); 79 waitForEnter(); 80 showDbInfo(null); 81 System.out.println("Starting BASE. Please wait..."); 82 Application.start(false); 83 SessionControl sc = Application.newSessionControl(null, null, null); 84 sc.login(new LoginRequest(login, pwd)); 85 int numModified = Update.recalculateRemainingQuantity(new ConsoleProgressReporter(false)); 86 sc.logout(); 87 sc.close(); 88 Application.stop(); 61 89 } 62 90 else -
trunk/src/test/TestChangeHistory.java
r6430 r6600 95 95 TestExtract.test_delete(extractId); 96 96 97 // 1 CREATE event only 97 98 test_list_by_item(Item.BIOSOURCE, bioSourceId, 1); 98 test_list_by_item(Item.SAMPLE, sampleId, 7); 99 100 /* 101 1 CREATE 102 2 UPDATE (name and externalId) 103 3 ADD+UPDATE+REMOVE ('change' annotation) 104 2 UPDATE (remainingQuantity when creating/deleting extract) 105 */ 106 test_list_by_item(Item.SAMPLE, sampleId, 8); 99 107 /* 100 108 Total change log events: 101 5 CREATE (biosource, sample, annotationtype, extract, annotation) 102 4 UPDATE (when updating and removing the annotation from the sample) 103 2 DELETE (extract, annotation) 109 4 CREATE (biosource, sample, annotationtype, extract) 110 1 ADD (annotation) 111 5 UPDATE (when updating the sample, it's annotation and child extract) 112 1 REMOVE (annotation) 113 1 DELETE (extract) 104 114 */ 105 test_list_by_user(TestUtil.getSessionControl().getLoggedInUserId(), since, 1 1);115 test_list_by_user(TestUtil.getSessionControl().getLoggedInUserId(), since, 12); 106 116 107 117 if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); … … 110 120 TestBioSource.test_delete(bioSourceId); 111 121 TestAnnotationType.test_delete(annotationTypeId); 112 // 1 4 = The original 11create+update + 3 delete113 test_delete_stray(1 4);122 // 15 = The original 12 create+update + 3 delete 123 test_delete_stray(15); 114 124 115 125 xtRegistry.unregisterExtension("test.db-logger"); -
trunk/www/WEB-INF/path.tld
r6154 r6600 45 45 </attribute> 46 46 <attribute> 47 <name>subclass</name> 48 <rtexprvalue>true</rtexprvalue> 49 </attribute> 50 <attribute> 47 51 <name>style</name> 48 52 <rtexprvalue>true</rtexprvalue> 49 53 </attribute> 54 <dynamic-attributes>true</dynamic-attributes> 50 55 </tag> 51 56 … … 60 65 <attribute> 61 66 <name>clazz</name> 67 <rtexprvalue>true</rtexprvalue> 68 </attribute> 69 <attribute> 70 <name>subclass</name> 62 71 <rtexprvalue>true</rtexprvalue> 63 72 </attribute> … … 87 96 <rtexprvalue>true</rtexprvalue> 88 97 </attribute> 98 <dynamic-attributes>true</dynamic-attributes> 89 99 </tag> 90 100 </taglib> -
trunk/www/admin/pluginconfigurations/configurations.js
r6400 r6600 69 69 Buttons.addClickHandler('btnConfigure', configurations.configurePlugin, attributes); 70 70 71 if (Doc.element('main.annotations')) 72 { 73 TabControl.addTabActivateListener('main.annotations', AnnotationsList.loadOnce); 74 } 71 75 TabControl.addTabActivateListener('main.history', History.loadOnce); 72 76 } -
trunk/www/admin/pluginconfigurations/view_configuration.jsp
r6311 r6600 404 404 <t:tab id="annotations" title="Annotations" 405 405 tooltip="View annotation values" clazz="white" 406 visible="<%=plugin != null && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin") %>" 407 activate="AnnotationsList.loadOnce()"> 406 visible="<%=plugin != null && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin") %>"> 408 407 <jsp:include page="../../common/annotations/list_frameset.jsp"> 409 408 <jsp:param name="item_type" value="<%=itemType.name()%>" /> -
trunk/www/admin/plugindefinitions/plugins.js
r6400 r6600 118 118 Buttons.addClickHandler('btnUnload', plugins.unloadPlugin, attributes); 119 119 Buttons.addClickHandler('btnToggleDisabled', plugins.toggleDisabled); 120 120 121 if (Doc.element('main.annotations')) 122 { 123 TabControl.addTabActivateListener('main.annotations', AnnotationsList.loadOnce); 124 } 121 125 TabControl.addTabActivateListener('main.history', History.loadOnce); 122 126 } -
trunk/www/admin/plugindefinitions/view_plugin.jsp
r6381 r6600 675 675 <t:tab id="annotations" title="Annotations" 676 676 tooltip="View annotation values" clazz="white" 677 visible="<%=!plugin.requiresConfiguration() && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin") %>" 678 activate="AnnotationsList.loadOnce()"> 677 visible="<%=!plugin.requiresConfiguration() && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin") %>"> 679 678 <jsp:include page="../../common/annotations/list_frameset.jsp"> 680 679 <jsp:param name="item_type" value="<%=itemType.name()%>" /> -
trunk/www/common/annotations/list.js
r6568 r6600 71 71 url += '&item_type='+Data.get('annotate-data', 'item-type'); 72 72 url += '&item_id='+Data.get('annotate-data', 'item-id'); 73 frames['annotations'].location. href = url;73 frames['annotations'].location.replace(url); 74 74 loaded = true; 75 75 } -
trunk/www/common/history/history.js
r6307 r6600 60 60 url += '&source_type='+Data.get('history-data', 'source-type'); 61 61 url += '&source_id='+Data.get('history-data', 'source-id'); 62 frames['history-frame'].location. href = url;62 frames['history-frame'].location.replace(url); 63 63 loaded = true; 64 64 } -
trunk/www/common/overview/overview.js
r6242 r6600 41 41 url += '&item_type='+Data.get('overview-data', 'item-type'); 42 42 url += '&item_id='+Data.get('overview-data', 'item-id'); 43 frames['overview'].location. href = url;43 frames['overview'].location.replace(url); 44 44 loaded = true; 45 45 } … … 51 51 url += '&item_type='+Data.get('overview-data', 'item-type'); 52 52 url += '&item_id='+Data.get('overview-data', 'item-id'); 53 frames['overview'].location. href = url;53 frames['overview'].location.replace(url); 54 54 } 55 55 … … 60 60 url += '&item_type='+Data.get('overview-data', 'item-type'); 61 61 url += '&item_id='+Data.get('overview-data', 'item-id'); 62 frames['overview'].location. href = url;62 frames['overview'].location.replace(url); 63 63 } 64 64 -
trunk/www/common/plugin/parse_file.jsp
r6540 r6600 197 197 id="parsedFile" 198 198 subclass="absolutefull dialogtabcontrol" 199 position="top" 199 position="top" active="filedata" 200 200 > 201 201 <t:tab -
trunk/www/views/jobs/index.jsp
r6447 r6600 58 58 import="java.util.List" 59 59 import="java.util.ArrayList" 60 import="java.util.Collection" 60 61 import="java.util.Collections" 61 62 %> … … 278 279 redirect = viewPage; 279 280 } 281 else if ("AbortJobs".equals(cmd)) 282 { 283 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 284 dc = sc.newDbControl(); 285 int numAborted = 0; 286 int numSelected = 0; 287 for (int jobId : cc.getSelected()) 288 { 289 numSelected++; 290 Job job = Job.getById(dc, jobId); 291 SignalTransporter signalTransporter = job.getSignalTransporter(); 292 if (signalTransporter == null) 293 { 294 if (job.getStatus() == Job.Status.WAITING) 295 { 296 job.doneError("Aborted by user"); 297 numAborted++; 298 } 299 } 300 else 301 { 302 Collection<Signal> supportedSignals = signalTransporter.getSupportedSignals(); 303 if (supportedSignals == null || supportedSignals.contains(Signal.ABORT)) 304 { 305 signalTransporter.send(Signal.ABORT); 306 numAborted++; 307 } 308 } 309 } 310 dc.commit(); 311 312 message = numAborted + " of " + numSelected + " jobs have been aborted "; 313 Thread.sleep(500); 314 redirect = listPage; 315 } 280 316 else if ("AbortJob".equals(cmd)) 281 317 { -
trunk/www/views/jobs/jobs.js
r6342 r6600 62 62 Buttons.addClickHandler('btnDeleteItems', Buttons.deleteItems, tableAttributes); 63 63 Buttons.addClickHandler('btnRestoreItems', Buttons.restoreItems, tableAttributes); 64 Buttons.addClickHandler('btnAbort', jobs.abortJobs, tableAttributes); 64 65 Buttons.addClickHandler('btnShareItems', Buttons.shareItems, tableAttributes); 65 66 Buttons.addClickHandler('btnSetOwner', Buttons.setOwnerOfItems, tableAttributes); … … 80 81 } 81 82 83 84 jobs.abortJobs = function() 85 { 86 var frm = document.forms['jobs']; 87 var numSelected = Table.checkIfSelected('jobs'); 88 if (numSelected == 0) return; 89 if (!confirm('You are about to abort '+numSelected+' jobs. This can\'t be undone. Continue?')) 90 { 91 return; 92 } 93 frm.cmd.value = 'AbortJobs'; 94 frm.submit(); 95 } 82 96 83 97 jobs.abortJob = function() -
trunk/www/views/jobs/list_jobs.jsp
r6447 r6600 413 413 title="Restore" 414 414 tooltip="Restore the selected (deleted) items" 415 /> 416 <tbl:button 417 id="btnAbort" 418 image="abort.png" 419 title="Abort…" 420 tooltip="Abort the selected items" 415 421 /> 416 422 <tbl:button -
trunk/www/views/rawbioassays/index.jsp
r6413 r6600 347 347 { 348 348 ad = arrayDesignId == 0 ? null : ArrayDesign.getById(dc, arrayDesignId); 349 if (!rba.isSameArrayDesign(ad) )349 if (!rba.isSameArrayDesign(ad) || !rba.isInDatabase()) 350 350 { 351 351 if (rba.hasData())
Note: See TracChangeset
for help on using the changeset viewer.