Changeset 6319
- Timestamp:
- Sep 9, 2013, 9:56:59 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3.2-stable merged: 6267,6270-6276,6280,6283,6287,6298-6299,6301-6304,6316 /tags/3.2.3 (added) merged: 6317
- Property svn:mergeinfo changed
-
trunk/credits.txt
r6268 r6319 1 1 $Id$ 2 2 3 The current BASE team is (at BASE 3.2. 2release)3 The current BASE team is (at BASE 3.2.3 release) 4 4 {{{ 5 5 Jari Häkkinen -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/plot/MAPlotFactory.java
r5185 r6319 22 22 package net.sf.basedb.clients.web.extensions.plot; 23 23 24 import java.util.ArrayList; 24 25 import java.util.List; 25 26 … … 30 31 import net.sf.basedb.core.BioAssaySet; 31 32 import net.sf.basedb.core.DbControl; 33 import net.sf.basedb.core.ItemQuery; 34 import net.sf.basedb.core.query.Hql; 35 import net.sf.basedb.core.query.Orders; 32 36 import net.sf.basedb.util.Values; 33 37 import net.sf.basedb.util.extensions.InvokationContext; … … 86 90 DbControl dc = context.getClientContext().getDbControl(); 87 91 BioAssaySet source = (BioAssaySet)context.getClientContext().getCurrentItem(); 88 boolean hasCfPlot = source.getTransformation().getSource() != null; 89 List<BioAssay> bioAssays = source.getBioAssays().list(dc); 90 OverviewPlotAction[] actions = new OverviewPlotAction[hasCfPlot ? 2 : 1]; 92 BioAssaySet parent = source.getTransformation().getSource(); 93 boolean hasCfPlot = parent != null && parent.getDataCubeNo() == source.getDataCubeNo(); 94 ItemQuery<BioAssay> baQuery = source.getBioAssays(); 95 baQuery.order(Orders.asc(Hql.property("name"))); 96 List<BioAssay> bioAssays = baQuery.list(dc); 91 97 92 // MA plot 93 OverviewPlotBean maBean = new OverviewPlotBean(); 94 maBean.setTitle("MA plots"); 95 maBean.setDescription("MA plots for each bioassay in this bioassay set"); 96 maBean.setId("maplots"); 97 String M = HTML.urlEncode("log2(ch(1) / ch(2))"); 98 String A = HTML.urlEncode("log(ch(1) * ch(2)) / 2"); 99 String maFilter = HTML.urlEncode("ch(1) > 0 && ch(2) > 0"); 98 // Plot generators for each bioassay 100 99 PlotGenerator[] maGenerators = new PlotGenerator[bioAssays.size()]; 101 maBean.setPlotGenerators(maGenerators); 102 actions[0] = maBean; 103 104 // Correction factor plot 105 PlotGenerator[] cfGenerators = null; 106 if (hasCfPlot) 107 { 108 OverviewPlotBean cfBean = new OverviewPlotBean(); 109 cfBean.setTitle("Correction factor plots"); 110 cfBean.setDescription("MA-plot of the parent bioassays together " + 111 "with a correction factor for each spot in the current bioassayset."); 112 cfBean.setId("cfplots"); 113 cfGenerators = new PlotGenerator[bioAssays.size()]; 114 cfBean.setPlotGenerators(cfGenerators); 115 actions[1] = cfBean; 116 } 100 List<PlotGenerator> cfGenerators = hasCfPlot ? new ArrayList<PlotGenerator>(bioAssays.size()) : null; 117 101 118 102 // Generate plot url:s for each bioassay 119 103 String xLabel = HTML.urlEncode("A, log10(ch1 * ch2) / 2"); 120 104 String yLabel = HTML.urlEncode("M, log2(ch1 / ch2)"); 105 String M = HTML.urlEncode("log2(ch(1) / ch(2))"); 106 String A = HTML.urlEncode("log(ch(1) * ch(2)) / 2"); 107 String maFilter = HTML.urlEncode("ch(1) > 0 && ch(2) > 0"); 121 108 int index = 0; 122 109 for (BioAssay ba : bioAssays) … … 143 130 maGenerators[index] = maPlot; 144 131 // Correction factor plot 145 if (hasCfPlot )132 if (hasCfPlot && ba.getParents().count(dc) == 1) 146 133 { 147 134 PlotGeneratorBean cfPlot = new PlotGeneratorBean(); … … 159 146 "&title="+HTML.urlEncode(ba.getName()) 160 147 ); 161 cfGenerators [index] = cfPlot;148 cfGenerators.add(cfPlot); 162 149 } 163 150 ++index; 164 151 } 152 153 // Main plot actions 154 hasCfPlot = cfGenerators != null && cfGenerators.size() > 0; 155 OverviewPlotAction[] actions = new OverviewPlotAction[hasCfPlot ? 2 : 1]; 156 157 // MA plot 158 OverviewPlotBean maBean = new OverviewPlotBean(); 159 maBean.setTitle("MA plots"); 160 maBean.setDescription("MA plots for each bioassay in this bioassay set"); 161 maBean.setId("maplots"); 162 maBean.setPlotGenerators(maGenerators); 163 actions[0] = maBean; 164 165 if (hasCfPlot) 166 { 167 OverviewPlotBean cfBean = new OverviewPlotBean(); 168 cfBean.setTitle("Correction factor plots"); 169 cfBean.setDescription("MA-plot of the parent bioassays together " + 170 "with a correction factor for each spot in the current bioassayset."); 171 cfBean.setId("cfplots"); 172 cfBean.setPlotGenerators(cfGenerators.toArray(new PlotGenerator[cfGenerators.size()])); 173 actions[1] = cfBean; 174 } 175 165 176 return actions; 166 177 } -
trunk/src/clients/web/net/sf/basedb/clients/web/formatter/ColorFormatter.java
r6127 r6319 68 68 if (color != null) 69 69 { 70 sb.append("class=\"colorbox \" style=\"background: #");70 sb.append("class=\"colorbox inline\" style=\"background: #"); 71 71 sb.append(ColorGenerator.toHex(color)); 72 72 sb.append(";\""); … … 74 74 else 75 75 { 76 sb.append("class=\"colorbox nan\"");76 sb.append("class=\"colorbox inline nan\""); 77 77 } 78 sb.append("></div> ");78 sb.append("></div> "); 79 79 sb.append(numberFormatter.format(value)); 80 80 return sb.toString(); -
trunk/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java
r6127 r6319 627 627 if (progress != null) 628 628 { 629 int percent = (int)( 100L * numExported / totalItems);629 int percent = (int)(99L * numExported / totalItems); 630 630 progress.display(percent, numExported + " of " + totalItems + " done."); 631 631 } 632 } 633 634 if (progress != null) 635 { 636 progress.display(100, numExported + " of " + totalItems + " done."); 632 637 } 633 638 -
trunk/src/core/net/sf/basedb/core/AnnotationSet.java
r6127 r6319 399 399 { 400 400 super.onBeforeCommit(action); 401 if (action == Action.CREATE && item != null && item.getId() != 0) 402 { 403 getData().setItemId(item.getId()); 404 } 401 405 if ((snapshotIsInvalid && action == Action.UPDATE) || action == Action.DELETE) 402 406 { -
trunk/src/core/net/sf/basedb/core/log/EntityDetails.java
r6080 r6319 29 29 import org.hibernate.collection.PersistentCollection; 30 30 import org.hibernate.type.Type; 31 import org.hibernate.type.VersionType;32 31 33 32 /** … … 66 65 this.types = types; 67 66 this.dirty = new int[types.length]; // 0 = not known, -1 = not dirty, 1 = dirty 68 findDirtyCollections();67 initializeDirtynessForSomeProperties(); 69 68 } 70 69 … … 124 123 if (dirty[index] == 0) 125 124 { 125 Type t = types[index]; 126 126 Object c = state[index]; 127 127 Object o = previousState[index]; 128 dirty[index] = t ypes[index].isEqual(c, o, EntityMode.POJO) ? -1 : 1;128 dirty[index] = t.isEqual(c, o, EntityMode.POJO) ? -1 : 1; 129 129 } 130 130 return dirty[index]; … … 152 152 for (int i = 0; i < types.length; ++i) 153 153 { 154 if (dirty[i] == 0) 155 { 156 Type t = types[i]; 157 if (!t.isCollectionType() && !(t instanceof VersionType)) 158 { 159 Object c = state[i]; 160 Object o = previousState[i]; 161 dirty[i] = t.isEqual(c, o, EntityMode.POJO) ? -1 : 1; 162 } 163 } 164 if (dirty[i] == 1) 154 if (getDirty(i) == 1) 165 155 { 166 156 modified.append(s).append(properties[i]); … … 171 161 if (suffix != null) modified.append(suffix); 172 162 return numModified == 0 ? null : modified.toString(); 163 } 164 165 /** 166 Checks if the given property is the only modified property. 167 @param property 168 @return TRUE if the given property (but no other) is dirty, FALSE in 169 all other cases 170 @since 3.2.3 171 */ 172 public boolean isOnlyDirty(String property) 173 { 174 boolean propertyIsDirty = false; 175 for (int i = 0; i < types.length; ++i) 176 { 177 if (getDirty(i) == 1) 178 { 179 if (property.equals(properties[i])) 180 { 181 propertyIsDirty = true; 182 } 183 else 184 { 185 // Found another dirty property 186 return false; 187 } 188 } 189 } 190 return propertyIsDirty; 173 191 } 174 192 … … 211 229 212 230 /** 213 We must do this from the constructor since the "dirtyness" of a 231 We must initialize "dirtyness" for collections and some other 232 properties from the constructor. The "dirtyness" of a 214 233 collection is reset after flush the SQL to the database, which is 215 234 completed before the rest of the logging is done. 216 235 */ 217 private void findDirtyCollections()236 private void initializeDirtynessForSomeProperties() 218 237 { 219 238 for (int i = 0; i < types.length; ++i) … … 227 246 dirty[i] = ((PersistentCollection)c).isDirty() ? 1 : -1; 228 247 } 248 else 249 { 250 dirty[i] = -1; 251 } 252 } 253 else if ("version".equals(properties[i])) 254 { 255 // Always ignore changes to the "version" property 256 dirty[i] = -1; 229 257 } 230 258 } -
trunk/src/core/net/sf/basedb/core/log/LoggingInterceptor.java
r6079 r6319 149 149 public void afterTransactionCompletion(Transaction tx) 150 150 { 151 if (logHandlers == null)151 if (logHandlers != null) 152 152 { 153 153 boolean rollback = tx.wasRolledBack(); -
trunk/src/core/net/sf/basedb/core/log/db/AnnotationSetLogger.java
r6080 r6319 66 66 if (details.getChangeType() != ChangeType.UPDATE) return; 67 67 68 // If the only modified property is the 'itemId' value, do not log it as a change 69 if (details.isOnlyDirty("itemId")) return; 70 68 71 LogControl logControl = logManager.getLogControl(); 69 72 AnnotationSetData as = (AnnotationSetData)details.getEntity(); -
trunk/www/admin/itemsubtypes/index.jsp
r6300 r6319 68 68 private static final Item itemType = Item.ITEMSUBTYPE; 69 69 70 private static void registerExportUtils(ItemContext cc) 71 { 72 // Register formatters 73 cc.setObject("export.formatter.&fileTypes(dataFileType.name)", new NameableFormatter()); 74 75 // Register dataloaders 76 String subtypeParameter = "subtype"; 77 // File types 78 final ItemQuery<DataFileType> fileTypesQuery = DataFileType.getQuery(); 79 fileTypesQuery.include(cc.getInclude()); 80 fileTypesQuery.join(Hql.innerJoin("itemSubtypes", "ist")); 81 fileTypesQuery.join(Hql.innerJoin("ist", "itemSubtype", "ist2")); 82 fileTypesQuery.restrict(Restrictions.eq(Hql.alias("ist2"), Expressions.parameter("subtype"))); 83 fileTypesQuery.order(Orders.asc(Hql.property("name"))); 84 cc.setObject("export.dataloader.&fileTypes(dataFileType.name)", new ItemQueryLoader(fileTypesQuery, subtypeParameter)); 85 } 86 70 87 %> 71 88 <% … … 273 290 cc.configureQuery(dc, query, true); 274 291 cc.setQuery(query); 292 registerExportUtils(cc); 275 293 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.list(itemType), null); 276 294 ExtensionsInvoker listInvoker = ListColumnUtil.useExtensions(jspContext); … … 283 301 // Run an export plugin in single-item context 284 302 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 303 registerExportUtils(cc); 285 304 redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+item+subtype"; 286 305 } -
trunk/www/admin/itemsubtypes/list_subtypes.jsp
r6289 r6319 103 103 fileTypesQuery.include(cc.getInclude()); 104 104 fileTypesQuery.join(Hql.innerJoin("itemSubtypes", "ist")); 105 fileTypesQuery.restrict(Restrictions.eq(Hql.alias("ist"), Expressions.parameter("subtype"))); 105 fileTypesQuery.join(Hql.innerJoin("ist", "itemSubtype", "ist2")); 106 fileTypesQuery.restrict(Restrictions.eq(Hql.alias("ist2"), Expressions.parameter("subtype"))); 106 107 fileTypesQuery.order(Orders.asc(Hql.property("name"))); 107 108 … … 220 221 id="dataFileTypes" 221 222 title="File types" 222 property="& dataFileTypes(name)"223 property="&fileTypes(dataFileType.name)" 223 224 datatype="string" 224 225 filterable="true" -
trunk/www/biomaterials/extracts/list_extracts.jsp
r6307 r6319 720 720 %> 721 721 <base:propertyvalue item="<%=item%>" property="parent" /> 722 <%=usedQuantity != null ? "(" + usedQuantity+ "µg)" : ""%>722 <%=usedQuantity != null ? "(" + numericFormatter.format(usedQuantity) + "µg)" : ""%> 723 723 <% 724 724 } … … 741 741 if (usedQuantity != null) 742 742 { 743 out.write(" (" + usedQuantity+ "µg)");743 out.write(" (" + numericFormatter.format(usedQuantity) + "µg)"); 744 744 } 745 745 separator = ", "; -
trunk/www/biomaterials/samples/list_samples.jsp
r6268 r6319 720 720 %> 721 721 <base:propertyvalue item="<%=item%>" property="parent"/> 722 <%=usedQuantity != null ? "(" + usedQuantity+ "µg)" : ""%>722 <%=usedQuantity != null ? "(" + numericFormatter.format(usedQuantity) + "µg)" : ""%> 723 723 <% 724 724 } … … 741 741 if (usedQuantity != null) 742 742 { 743 out.write(" (" + usedQuantity+ "µg)");743 out.write(" (" + numericFormatter.format(usedQuantity) + "µg)"); 744 744 } 745 745 separator = ", "; -
trunk/www/common/annotations/annotate.jsp
r6246 r6319 39 39 import="net.sf.basedb.core.Subtypable" 40 40 import="net.sf.basedb.core.ItemSubtype" 41 import="net.sf.basedb.core.BioPlateType" 42 import="net.sf.basedb.core.BioPlate" 41 43 import="net.sf.basedb.core.AnnotationSet" 42 44 import="net.sf.basedb.core.Annotation" … … 142 144 { 143 145 ItemSubtype subtype = null; 144 if (subtypeId == -1 && item != null && item instanceof Subtypable) 146 if (subtypeId > 0) 147 { 148 subtype = ItemSubtype.getById(dc, subtypeId); 149 } 150 else if (item instanceof Subtypable) 145 151 { 146 152 subtype = ((Subtypable)item).getItemSubtype(); 147 153 } 148 else if (subtypeId > 0) 149 { 150 subtype = ItemSubtype.getById(dc, subtypeId); 154 else if (item instanceof BioPlate) 155 { 156 BioPlateType bpt = ((BioPlate)item).getBioPlateType(); 157 subtype = bpt.getItemSubtype(); 158 if (subtype == null) selectedCategoryName = bpt.getName(); 151 159 } 152 160 if (subtype != null) selectedCategoryName = subtype.getName(); -
trunk/www/common/plugin/index.jsp
r6192 r6319 589 589 else if ("ExportImmediately".equals(cmd)) 590 590 { 591 out.clearBuffer(); 591 592 PluginResponse pluginResponse = (PluginResponse)sc.getSessionSetting("plugin.configure.response"); 592 593 ExportOutputStream exportStream = new ServletExportOutputStream(response); -
trunk/www/filemanager/directories/list_directories.jsp
r6308 r6319 280 280 if (window.top.setSelected) 281 281 { 282 //window.top.setSelected('', path);282 window.top.setSelected('', path); 283 283 } 284 284 } -
trunk/www/include/styles/main.css
r6286 r6319 691 691 } 692 692 693 /* O tline for a colored box; background should be set on the element */693 /* Outline for a colored box; background should be set on the element */ 694 694 .colorbox 695 695 { … … 697 697 height: 1em; 698 698 border: 1px solid #A0A0A0; 699 } 700 701 /* Color box inline with other text */ 702 .colorbox.inline 703 { 704 display: inline-block; 699 705 } 700 706 -
trunk/www/plugins/net/sf/basedb/plugins/executor/external_plugin_parameters.jsp
r6217 r6319 81 81 { 82 82 externalParameters = ParameterDefinition.parseXml(xml, false); 83 if (true) throw new RuntimeException("fff");84 83 } 85 84 catch (Throwable ex) -
trunk/www/views/physicalbioassays/list_bioassays.jsp
r6311 r6319 131 131 int numListed = 0; 132 132 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 133 Formatter<Number> numericFormatter = FormatterFactory.getNumberFormatter(sc); 133 134 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null); 134 135 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); … … 571 572 if (usedQuantity != null) 572 573 { 573 out.write( usedQuantity+ "µg");574 out.write(numericFormatter.format(usedQuantity) + "µg"); 574 575 if (tag != null) out.write("; "); 575 576 }
Note: See TracChangeset
for help on using the changeset viewer.