Changeset 5689
- Timestamp:
- Aug 11, 2011, 11:09:06 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 92 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/src/docbook/developerdoc/core_ref.xml
r5675 r5689 529 529 If more extensive commenting is needed - use Javadoc. 530 530 </listitem> 531 <listitem> 532 Avoid using semicolon (;) as part of inline comments. Searching for all 533 comments containing a semicolon is used to find commented out code blocks. 534 </listitem> 531 535 </itemizedlist> 532 536 … … 535 539 536 540 <varlistentry> 541 <term>Commented out code</term> 542 <listitem> 543 <para> 544 Avoid leaving code that is commented out. It is a distraction when 545 maintaining the code. Sometimes, for example during a big refactoring, 546 it is not possible to fix everything at once. In this case it is allowed 547 to comment out code, but it is recommended that a <emphasis>TODO</emphasis> 548 marker (see below) is added to make it easier to find places that 549 need to be fixed later. 550 </para> 551 </listitem> 552 </varlistentry> 553 554 <varlistentry> 537 555 <term>Todo comments</term> 538 556 <listitem> … … 540 558 If there are parts of the code that cannot be completed at the time the majority of the code 541 559 is written, place a comment starting with TODO (in capital letters), followed with a 542 description of what needs to be done. Example: 560 description of what needs to be done. If there is a ticket in the Trac server, use the 561 ticket number in the comment. Example: 543 562 </para> 544 563 <programlisting language="java"> … … 546 565 { 547 566 return value == null ? null : new Date(value.getTime()); 548 // TODO : check if there is a better way to copy567 // TODO (#1234): check if there is a better way to copy 549 568 } 550 569 </programlisting> -
trunk/src/clients/jobagent/net/sf/basedb/clients/jobagent/Agent.java
r5447 r5689 730 730 closeServer(); 731 731 if (sc != null) sc.logout(); 732 //Application.stop();733 732 } 734 733 -
trunk/src/clients/web/net/sf/basedb/clients/web/Base.java
r5643 r5689 807 807 try 808 808 { 809 // Dates are stored as long time values ; reformat according to date formatter809 // Dates are stored as long time values. Reformat according to date formatter 810 810 // or as yyyy-MM-dd if no formatter is specified 811 811 if (!op.isListOperator()) -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/InstallFilter.java
r5616 r5689 1 /** 2 $Id $ 3 4 Copyright (C) 2011 Nicklas Nordborg 5 6 This file is part of BASE - BioArray Software Environment. 7 Available at http://base.thep.lu.se/ 8 9 BASE is free software; you can redistribute it and/or 10 modify it under the terms of the GNU General Public License 11 as published by the Free Software Foundation; either version 3 12 of the License, or (at your option) any later version. 13 14 BASE is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with BASE. If not, see <http://www.gnu.org/licenses/>. 21 */ 1 22 package net.sf.basedb.clients.web.extensions; 2 23 … … 7 28 import net.sf.basedb.util.filter.Filter; 8 29 30 /** 31 Filter implementation that selects only those extensions that 32 was selected by the user in the gui. Eg. if the request 33 parameter <i>filename</i>.install is set. 34 @author Nicklas 35 @since 3.0 36 @base.modified $Date $ 37 */ 9 38 public class InstallFilter 10 39 implements Filter<ExtensionsFile> … … 23 52 if (!xtFile.isValid() || (xtFile.hasError())) 24 53 { 25 // log.info("File has errors (skipping): " + xtFile);54 // Do not install files with errors 26 55 return false; 27 56 } -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/JspContext.java
r5601 r5689 146 146 public String getHome(Extension extension) 147 147 { 148 // TODO (#1593) 148 149 //ExtensionsFile file = directory.getFileByExtensionId(extension.getId()); 149 150 //return file == null ? null : directory.getResourcesUrl(file); -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/ServletLoader.java
r4512 r5689 233 233 if (className == null) throw new NullPointerException("servlet-class[servlet-name=" + servletName + "]"); 234 234 235 // Load the servlet class ;make sure it implements the Servlet interface235 // Load the servlet class and make sure it implements the Servlet interface 236 236 Class<? extends Servlet> servletClass = loadServletClass(className, classLoader); 237 237 ServletWrapper wrapper = new ServletWrapper(servletClass, servletName); -
trunk/src/clients/web/net/sf/basedb/clients/web/servlet/Download.java
r5582 r5689 94 94 String pathInfo = usePathInfo ? request.getPathInfo() : 95 95 URLDecoder.decode(request.getRequestURI(), "UTF-8").replace(contextPath+servletPath, ""); 96 // System.out.println("URI=" + pathInfo+"; servletPath="+servletPath+"; contextPath="+contextPath);97 96 /* 98 97 The pathInfo is expected to be like: -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Button.java
r5663 r5689 315 315 { 316 316 sb.append(" class=\"").append(getClazz()).append(isDisabled() ? "_disabled" : "").append("\""); 317 if (!isDisabled())318 {319 //sb.append(" onmouseover=\"this.className='").append(getClazz()).append("_hover';\"");320 //sb.append(" onmouseout=\"this.className='").append(getClazz()).append("';\"");321 }322 317 } 323 318 if (getStyle() != null) sb.append(" style=\"").append(getStyle()).append("\""); -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Select.java
r5687 r5689 646 646 if (!disabled) 647 647 { 648 //sb.append(" onmouseover=\"this.className='buttonclass_hover';\" onmouseout=\"this.className='buttonclass';\"");649 648 sb.append(" onclick=\"").append(getOnselect()).append("\""); 650 649 } -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/ColumnDef.java
r5674 r5689 634 634 sb.append(HTML.javaScriptEncode(getSortproperty())).append("', '").append(direction.name()).append("')\" title=\""); 635 635 sb.append(theTooltip).append("\">").append(getTitle()).append("</span>").append(image); 636 637 /*638 sb.append("<a href=\"javascript:Table.setSortOrder('").append(table.getId()).append("', '");639 sb.append(getSortproperty()).append("', '").append(direction.name()).append("')\" title=\"");640 sb.append(theTooltip).append("\">").append(getTitle()).append("</a>").append(image);641 */642 636 } 643 637 sb.append("</td>\n"); … … 746 740 addOptions.append("]);\n"); 747 741 table.addScript(addOptions.toString()); 748 749 /*750 sb.append("<select name=\"").append(inputName).append("\"");751 sb.append(" onchange=\"Forms.submit(event);\">\n");752 sb.append("<option value=\"\">");753 Enumeration<String, String> enumeration = getEnumeration();754 for (int i = 0; i < enumeration.size(); ++i)755 {756 String selected = filterValue.equals(enumeration.getKey(i).trim()) ? " selected" : "";757 sb.append("<option value=\"").append(enumeration.getKey(i)).append("\"").append(selected);758 sb.append(">").append(enumeration.getValue(i)).append("\n");759 }760 sb.append("</select>");761 */762 742 } 763 743 } -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Toolbar.java
r4889 r5689 201 201 throws JspException 202 202 { 203 //if (!(getParent() instanceof Table)) throw new JspTagException("Tag <tbl:toolbar> must be inside a <tbl:table> tag");204 203 table = (Table)findAncestorWithClass(this, Table.class); 205 204 if (!isVisible()) return SKIP_BODY; -
trunk/src/clients/web/net/sf/basedb/clients/web/util/HTML.java
r5442 r5689 271 271 } 272 272 273 /* 273 /** 274 274 Scans a string for HTML tags and replaces all < and > for tags 275 275 not found in the <code>safeTags</code> pattern with &lt; and &gt; … … 291 291 } 292 292 293 /* 293 /** 294 294 Scans a string for HTML tags and replaces all < and > for tags 295 295 not found matching the <code>safeTags</code> pattern with &lt; and &gt; -
trunk/src/core/net/sf/basedb/core/AbstractSqlQuery.java
r5564 r5689 353 353 ps.setInt(index, id); 354 354 } 355 /*356 else if (parameterValue instanceof Date)357 {358 // Postgres drives doesn't recognize dates in the 2-argument form359 if (debugParamEnabled) logParam.debug("Binding '"+parameterValue+"' to parameter index: "+index);360 ps.setObject(index, parameterValue, Types.DATE);361 }362 */363 355 else 364 356 { -
trunk/src/core/net/sf/basedb/core/AnyToAny.java
r5590 r5689 376 376 List<Integer> itemTypes = HibernateUtil.loadList(Integer.class, query, null); 377 377 378 // For each item type ;find and delete non-existing items378 // For each item type: find and delete non-existing items 379 379 int index = 0; 380 380 int numItemTypes = itemTypes.size(); -
trunk/src/core/net/sf/basedb/core/BasicItem.java
r5648 r5689 249 249 @see #addUsingItems(Set, Item, org.hibernate.Query) 250 250 */ 251 // public abstract Set<ItemProxy> getUsingItems()252 // throws BaseException;253 254 251 public Set<ItemProxy> getUsingItems() 255 252 throws BaseException -
trunk/src/core/net/sf/basedb/core/BioAssaySet.java
r5319 r5689 712 712 BioAssay ba = BioAssay.getNew(getDbControl(), this, getDataCube().newColumn()); 713 713 714 // Add rawParents to the new BioAssay ;check that the are part of the transformation714 // Add rawParents to the new BioAssay. check that the are part of the transformation 715 715 Set<RawBioAssayData> rawBioAssays = ba.getData().getRawParents(); 716 716 Set<RawBioAssayData> transformationRawSources = getData().getTransformation().getRawSources(); -
trunk/src/core/net/sf/basedb/core/ChangeHistory.java
r5345 r5689 190 190 List<Integer> itemTypes = HibernateUtil.loadList(Integer.class, query, null); 191 191 192 // For each item type ;find and delete entries which reference non-existing items192 // For each item type: find and delete entries which reference non-existing items 193 193 int index = 0; 194 194 int numItemTypes = itemTypes.size(); -
trunk/src/core/net/sf/basedb/core/DataCube.java
r5319 r5689 662 662 if (mappingBatcher == null || mappingBatcher.getTotalInsertCount() == 0) 663 663 { 664 // No mappings to raw data has been inserted ; return 0 since the mapping665 // may not exists ; see ticket #475664 // No mappings to raw data has been inserted. Return 0 since the mapping 665 // may not exists. See ticket #475 666 666 return 0; 667 667 } -
trunk/src/core/net/sf/basedb/core/DataFileType.java
r5652 r5689 452 452 453 453 /** 454 Register/unregister extension points when the data file type is created455 or deleted.456 */457 @Override458 void onAfterCommit(Action action)459 {460 super.onAfterCommit(action);461 if (action == Action.CREATE)462 {463 //register(Application.getExtensionsManager().getRegistry(), getData());464 }465 else if (action == Action.DELETE)466 {467 //unregister(Application.getExtensionsManager().getRegistry(), getData());468 }469 }470 471 /**472 454 @since 2.5 473 455 */ -
trunk/src/core/net/sf/basedb/core/DbControl.java
r5590 r5689 1157 1157 calledFrom 1158 1158 ); 1159 //log.warn("Stacktrace of code that created this DbControl. Please fix the " +1160 // "code to make sure the DbControl is always closed.", calledFrom);1161 1159 close(); 1162 1160 } -
trunk/src/core/net/sf/basedb/core/DerivedBioAssay.java
r5685 r5689 172 172 { 173 173 Set<ItemProxy> using = super.getUsingItems(); 174 // TODO 174 // TODO - part of #1153 175 175 return using; 176 176 } … … 183 183 throws BaseException 184 184 { 185 // TODO 185 // TODO - part of #1153 186 186 return super.isUsed(); 187 187 } … … 347 347 { 348 348 Collection<FileSet> parents = null; 349 // TODO 349 // TODO - part of #1153 350 350 return parents; 351 351 } -
trunk/src/core/net/sf/basedb/core/DynamicSpotQuery.java
r5319 r5689 291 291 if (extraValue == null) throw new InvalidUseOfNullException("extraValue"); 292 292 if (joinType == null) throw new InvalidUseOfNullException("joinType"); 293 /*if (extraValue.getCoordinateType() != ExtraValue.CoordinateType.SPOT)294 {295 throw new InvalidDataException("Extra value "+ extraValue+296 " is not attached to spots: "+extraValue.getCoordinateType());297 }*/298 293 if (!getDataCube().equals(extraValue.getDataCubeExtraValue().getDataCube())) 299 294 { -
trunk/src/core/net/sf/basedb/core/FileSet.java
r5630 r5689 593 593 } 594 594 } 595 596 597 598 599 /**600 Wraps a {@link DataFileValidator}. This class takes care of calling the validator601 to validate, extract metadata and set validation status and error messages on the602 associated file set members.603 */604 /*605 private static class DataFileHandlerWrapper606 {607 private final DataFileValidator validator;608 private final FileStoreEnabled item;609 private final List<FileSetMember> files;610 611 DataFileHandlerWrapper(DataFileValidator validator, FileStoreEnabled item)612 {613 this.validator = validator;614 this.item = item;615 this.validator.setItem(item);616 this.files = new ArrayList<FileSetMember>();617 }618 619 void setFile(FileSetMember member)620 {621 validator.setFile(member);622 this.files.add(member);623 }624 625 void validate(DbControl dc)626 {627 validator.validate(dc);628 }629 630 void extractMetadata(DbControl dc)631 {632 validator.extractMetadata(dc);633 }634 635 void resetMetadata(DbControl dc)636 {637 validator.resetMetadata(dc);638 }639 640 void setValid(Boolean isValid, String errorMessage)641 {642 for (FileSetMember member : files)643 {644 member.getData().setValid(isValid);645 member.getData().setErrorMessage(errorMessage);646 }647 }648 649 }650 */651 652 653 595 654 596 } -
trunk/src/core/net/sf/basedb/core/FilterBatcher.java
r4992 r5689 316 316 String insertSql = buildInsertSelectSql(selectSql); 317 317 318 //System.out.println("INSERT: " + insertSql);319 318 int rowsInserted = 0; 320 319 try -
trunk/src/core/net/sf/basedb/core/HibernateUtil.java
r5621 r5689 983 983 user. The following command can fix it: 984 984 985 session.connection().rollback() ;985 session.connection().rollback() 986 986 ================================================================== 987 987 BUT!!! TRY TO FIND THE PLACE WHERE THE TRANSACTION IS LEFT OPEN!!! -
trunk/src/core/net/sf/basedb/core/Install.java
r5685 r5689 161 161 throws BaseException 162 162 { 163 final int totalProgressSteps = 2 4;163 final int totalProgressSteps = 23; 164 164 final float progress_factor = 100 / totalProgressSteps; 165 165 int progressStep = 0; … … 213 213 "activate it and set a password before it can be used.", 214 214 roleJobAgent, quota0, true, true); 215 // createUser(0, "demo", "demo", "Demo", "This account can be used for demonstration purposes.", Role.GUEST);216 // createUser(0, "power", "power", "Power user", "This account has power user privileges.", Role.POWER_USER);217 215 218 216 // Now that we have a root user let's create a session … … 249 247 administrators_read.put(roleSuper, PERMISSION_READ); 250 248 251 // Power users -> CREATE ;Administrators -> ALL249 // Power users -> CREATE, Administrators -> ALL 252 250 HashMap<RoleData, Integer> power_users_create = new HashMap<RoleData, Integer>(); 253 251 power_users_create.put(roleAdmin, PERMISSION_ALL); … … 255 253 power_users_create.put(roleSuper, PERMISSION_READ); 256 254 257 // Power users & Users -> CREATE ;Administrators -> ALL255 // Power users & Users -> CREATE, Administrators -> ALL 258 256 HashMap<RoleData, Integer> users_create = new HashMap<RoleData, Integer>(); 259 257 users_create.put(roleAdmin, PERMISSION_ALL); … … 262 260 users_create.put(roleSuper, PERMISSION_READ); 263 261 264 // Power users & Users & Guests -> CREATE ;Administrators -> ALL262 // Power users & Users & Guests -> CREATE, Administrators -> ALL 265 263 HashMap<RoleData, Integer> guests_create = new HashMap<RoleData, Integer>(); 266 264 guests_create.put(roleAdmin, PERMISSION_ALL); … … 270 268 guests_create.put(roleSuper, PERMISSION_READ); 271 269 272 // All -> CREATE ;Administrators -> ALL270 // All -> CREATE, Administrators -> ALL 273 271 HashMap<RoleData, Integer> all_create = new HashMap<RoleData, Integer>(); 274 272 all_create.put(roleAdmin, PERMISSION_ALL); … … 278 276 all_create.put(roleSuper, PERMISSION_CREATE); 279 277 280 // All -> READ ;Administrators --> WRITE278 // All -> READ, Administrators --> WRITE 281 279 HashMap<RoleData, Integer> all_use_administrators_write = new HashMap<RoleData, Integer>(); 282 280 all_use_administrators_write.put(roleAdmin, PERMISSION_WRITE); … … 286 284 all_use_administrators_write.put(roleSuper, PERMISSION_USE); 287 285 288 // Users & Guests & Powers users -> USE ;Administrators -> ALL286 // Users & Guests & Powers users -> USE, Administrators -> ALL 289 287 HashMap<RoleData, Integer> guests_use_administrators_all = new HashMap<RoleData, Integer>(); 290 288 guests_use_administrators_all.put(roleAdmin, PERMISSION_ALL); … … 294 292 guests_use_administrators_all.put(roleSuper, PERMISSION_READ); 295 293 296 // Users & Guests -> USE ;Powers users & Administrators -> ALL294 // Users & Guests -> USE, Powers users & Administrators -> ALL 297 295 HashMap<RoleData, Integer> guests_use_power_users_all = new HashMap<RoleData, Integer>(); 298 296 guests_use_power_users_all.put(roleAdmin, PERMISSION_ALL); … … 537 535 createSoftware("TopHat", null, null, alignmentSoftware, rootUser, keyEveryoneUse); 538 536 539 // Item subtypes540 progressStep++;541 if (progress != null) progress.display((int)(progressStep*progress_factor), "--Creating item subtypes...");542 //createItemSubtype(systemId, itemType, name, description, protocolType, hardwareType, softwareType);543 544 537 // Directory 545 538 progressStep++; … … 2288 2281 2289 2282 } 2290 /** 2291 Create a {@link PluginDefinition}. 2292 */ 2293 /* 2294 private static PluginDefinition createPluginDefinition(String className, String jarPath, 2295 ItemKeyData shareTo, boolean trusted, Long maxMemory, boolean allowImmediateExecution) 2296 throws BaseException 2297 { 2298 PluginDefinition pd = null; 2299 DbControl dc = null; 2300 try 2301 { 2302 dc = sessionControl.newDbControl(); 2303 2304 try 2305 { 2306 pd = PluginDefinition.getByClassName(dc, className); 2307 } 2308 catch (ItemNotFoundException ex) 2309 {} 2310 2311 if (pd != null) 2312 { 2313 pd.loadPluginInformation(jarPath, className, true); 2314 dc.commit(); 2315 log.info("createPluginDefinition: UPDATED [className="+className+"; jarPath="+jarPath+"]"); 2316 } 2317 else 2318 { 2319 pd = PluginDefinition.getNew(dc, className, jarPath, true); 2320 pd.setTrusted(trusted); 2321 pd.setMaxMemory(maxMemory); 2322 pd.setAllowImmediateExecution(allowImmediateExecution); 2323 pd.getData().setItemKey(shareTo); 2324 dc.saveItem(pd); 2325 dc.commit(); 2326 log.info("createPluginDefinition: OK [className="+className+"; jarPath="+jarPath+"]"); 2327 } 2328 } 2329 catch (BaseException ex) 2330 { 2331 log.error("createPluginDefinition: FAILED [className="+className+"; jarPath="+jarPath+"]", ex); 2332 throw ex; 2333 } 2334 finally 2335 { 2336 if (dc != null) dc.close(); 2337 } 2338 return pd; 2339 } 2340 */ 2283 2341 2284 2342 2285 /** -
trunk/src/core/net/sf/basedb/core/InternalStorageController.java
r5453 r5689 265 265 file.setLocation(Location.PRIMARY); 266 266 file.setAction(File.Action.NOTHING); 267 /*268 Message message = Message.getNew(dc, file.getOwner(), "InternalStorageController", null, null);269 message.setName("File '" + file + "' moved to primary storage.");270 dc.saveItem(message);271 */272 267 dc.commit(); 273 268 // Remove file from secondary storage … … 299 294 file.setLocation(Location.SECONDARY); 300 295 file.setAction(File.Action.NOTHING); 301 /*302 Message message = Message.getNew(dc, file.getOwner(), "InternalStorageController", null, null);303 message.setName("File '" + file + "' moved to secondary storage.");304 dc.saveItem(message);305 */306 296 dc.commit(); 307 297 } -
trunk/src/core/net/sf/basedb/core/ItemContext.java
r5686 r5689 1278 1278 } 1279 1279 } 1280 /*1281 int dotIndex = filterProperty == null ? -1 : filterProperty.lastIndexOf(".");1282 if (dotIndex >= 0)1283 {1284 // Get rid of the part after the last dot1285 filterProperty = filterProperty.substring(0, dotIndex);1286 if (filterProperty.startsWith("$"))1287 {1288 // If it is an aliased property we need at least one more dot1289 1290 }1291 else if (!filterProperty.startsWith("£") && !filterProperty.startsWith("&"))1292 {1293 leftJoins.add(filterProperty);1294 }1295 }1296 */1297 1280 } 1298 1281 } -
trunk/src/core/net/sf/basedb/core/Metadata.java
r5630 r5689 337 337 { 338 338 pathSoFar.append(".").append(property); 339 //System.out.println(pathSoFar.toString());340 341 339 if (nextType.isEntityType()) 342 340 { … … 381 379 // Post-conversion 382 380 Class returnClass = nextType.getReturnedClass(); 383 //System.out.println(pathSoFar.toString() + ": " + returnClass);384 381 if (BatchableData.class.isAssignableFrom(returnClass)) 385 382 { -
trunk/src/core/net/sf/basedb/core/MultiPermissions.java
r5370 r5689 113 113 for (SharedItem item : itemsToShare) 114 114 { 115 //item.checkPermission(Permission.SET_PERMISSION);116 115 if (items.add(item)) 117 116 { -
trunk/src/core/net/sf/basedb/core/Project.java
r5687 r5689 544 544 if (include.contains(Include.MINE) && include.contains(Include.OTHERS)) 545 545 { 546 // Do nothing ;all items are included546 // Do nothing, all items are included 547 547 } 548 548 else if (include.contains(Include.MINE)) … … 1046 1046 } 1047 1047 1048 /*1049 public enum Default1050 {1051 SOFTWARE("default_software", "Software", Item.SOFTWARE, Software.FEATURE_EXTRACTION, Item.RAWBIOASSAY),1052 ARRAYDESIGN("default_arraydesign", "Array design", Item.ARRAYDESIGN, null, null),1053 HYBRIDIZATION_HARDWARE("default_hybridization_hardware", "Hybridization station", Item.HARDWARE, Hardware.HYBRIDIZATION_STATION, Item.PHYSICALBIOASSAY),1054 SCANNER_HARDWARE("default_scanner_hardware", "Scanner", Item.HARDWARE, Hardware.SCANNER, Item.SCAN),1055 PRINTROBOT_HARDWARE("default_print_robot_hardware", "Print robot", Item.HARDWARE, Hardware.PRINT_ROBOT, Item.ARRAYBATCH),1056 SCANNING_PROTOCOL("default_scanning_protocol", "Scanning protocol", Item.PROTOCOL, Protocol.SCANNING, Item.SCAN),1057 SAMPLING_PROTOCOL("default_sampling_protocol", "Sampling protocol", Item.PROTOCOL, Protocol.SAMPLING, Item.SAMPLE),1058 EXTRACTING_PROTOCOL("default_extracting_protocol", "Extracting protocol", Item.PROTOCOL, Protocol.EXTRACTION, Item.EXTRACT),1059 HYBRIDIZATION_PROTOCOL("default_hybridization_protocol", "Hybridization protocol", Item.PROTOCOL, Protocol.HYBRIDIZATION, Item.PHYSICALBIOASSAY),1060 FEATURE_EXTRACTION_PROTOCOL("default_feature_extraction_protocol", "Feat. extraction protocol", Item.PROTOCOL, Protocol.FEATURE_EXTRACTION, Item.RAWBIOASSAY),1061 POOLING_PROTOCOL("default_pooling_protocol", "Pooling protocol", Item.PROTOCOL, Protocol.POOLING, null),1062 PRINTING_PROTOCOL("default_printing_protocol", "Printing protocol", Item.PROTOCOL, Protocol.PRINTING, Item.ARRAYBATCH),1063 RAW_DATA_TYPE("default_raw_data_type", "Raw data type", null, null, null),1064 PLATFORM("default_platform", "Platform", Item.PLATFORM, null, null),1065 PLATFORM_VARIANT("default_variant", "Variant", Item.PLATFORMVARIANT, null, null);1066 1067 private String name;1068 private String shortName;1069 private Item itemType;1070 private String type;1071 private Item attachesToItemType;1072 1073 private Default(String name, String shortName, Item itemType, String type, Item attachesToItemType)1074 {1075 this.name = name;1076 this.shortName = shortName;1077 this.itemType = itemType;1078 this.type = type;1079 this.attachesToItemType = attachesToItemType;1080 }1081 1082 public String getName()1083 {1084 return name;1085 }1086 1087 public String getShortName()1088 {1089 return shortName;1090 }1091 1092 public Item getItemType()1093 {1094 return itemType;1095 }1096 1097 public String getType()1098 {1099 return type;1100 }1101 */1102 /**1103 The item type an entry of this default type is usually attached to.1104 For example a {@link Default#SAMPLING_PROTOCOL} attaches to a1105 {@link Item#SAMPLE}.1106 @return An item object or null if it is not relevant1107 @since 2.101108 */1109 /*1110 public Item getAttachesToItemType()1111 {1112 return attachesToItemType;1113 }1114 }1115 */1116 1117 1048 } 1118 1049 -
trunk/src/core/net/sf/basedb/core/QueryExecutor.java
r5605 r5689 170 170 { 171 171 // We wait about half the time of the timeout before updating the session control 172 // sessionCacheTimeout() is in minutes ;our timeout is in seconds172 // sessionCacheTimeout() is in minutes, but our timeout is in seconds 173 173 int timeout = Application.sessionCacheTimeout() * 30; 174 174 if (timeout <= 0) timeout = 30; -
trunk/src/core/net/sf/basedb/core/SessionControl.java
r5409 r5689 1647 1647 1648 1648 ContextData cd = HibernateUtil.loadData(ContextData.class, query); 1649 /*1650 UserData userData = HibernateUtil.loadData(session, UserData.class, loginInfo.userId);1651 ClientData clientData = HibernateUtil.loadData(session, ClientData.class, getClientId());1652 ContextData cd = userData.getContexts().get(new ContextIndex(clientData, item.getValue(), subContext, name));1653 */1654 1649 if (cd != null) 1655 1650 { -
trunk/src/core/net/sf/basedb/core/Transformation.java
r4889 r5689 397 397 Transformation t = ... 398 398 399 // Use same data cube, but a new layer ; automatically create child bioassays399 // Use same data cube, but a new layer. Automatically create child bioassays 400 400 BioAssaySet bas = t.newProduct(null, "new", true); 401 401 402 // Use same data cube and layer ; automatically create child bioassays402 // Use same data cube and layer. Automatically create child bioassays 403 403 BioAssaySet filtered = t.newProduct(null, null, true); 404 404 405 // Use new data cube and layer ; automatic creation of405 // Use new data cube and layer. Automatic creation of 406 406 // child bioassays is not supported 407 407 BioAsssySet merged = t.newProduct("new", "new", false); -
trunk/src/core/net/sf/basedb/core/Unit.java
r5518 r5689 490 490 2. Annotation with a different unit that has an annotation type with 491 491 this unit as default unit. 492 aFactor = oldFactor / newFactor ;492 aFactor = oldFactor / newFactor 493 493 anOffset = (oldOffset - newOffset) / newFactor 494 494 We need to execute all SQL:s on all numerical value -
trunk/src/core/net/sf/basedb/core/VirtualDb.java
r4889 r5689 431 431 { 432 432 int rowsDeleted = 0; 433 //Connection c = HibernateUtil.getConnection(getDbControl().getHibernateSession());434 433 if (HibernateUtil.virtualTableExists(this, extraTable)) 435 434 { -
trunk/src/core/net/sf/basedb/core/log/db/AnnotationSetLogger.java
r5068 r5689 62 62 public void logChanges(LogManager logManager, EntityDetails details) 63 63 { 64 // We are only logging update events ;CREATE and DELETE events are64 // We are only logging update events. CREATE and DELETE events are 65 65 // usually also catched by other loggers 66 66 if (details.getChangeType() != ChangeType.UPDATE) return; -
trunk/src/core/net/sf/basedb/core/query/HqlInnerJoin.java
r5320 r5689 71 71 if (query.getQueryType() == QueryType.HQL) 72 72 { 73 // Count queries can't use the fetch parameter ;they are not selecting the root item73 // Count queries can't use the fetch parameter, they are not selecting the root item 74 74 return "INNER JOIN " + (fetch && !query.isCounting() ? "FETCH " : "") + 75 75 (alias == null ? query.getRootAlias() : alias) + "." + property.replace("#", ".") + " " + joinedAlias + -
trunk/src/core/net/sf/basedb/core/signal/ProgressReporterSignalHandler.java
r4516 r5689 50 50 private String progressMessage; 51 51 52 // Set up signal handling ;ABORT is the only supported signal52 // Set up signal handling. ABORT is the only supported signal 53 53 private ProgressReporterSignalHandler signalHandler; 54 54 public SignalHandler getSignalHandler() -
trunk/src/core/net/sf/basedb/util/AnnotationUtil.java
r5685 r5689 119 119 if (item instanceof RawBioAssay) 120 120 { 121 // TODO - part of #1153 121 122 //return ((RawBioAssay)item).getArrayNum(); 122 123 return arrayNum; -
trunk/src/core/net/sf/basedb/util/IntensityCalculatorUtil.java
r5228 r5689 335 335 } 336 336 337 /*338 long total = -System.nanoTime();339 long calc = 0;340 long data = 0;341 long cnew = 0;342 long chit = 0;343 long batt = 0;344 long brep = 0;345 long braw = 0;346 */347 348 337 for (RawBioAssay rba : rawBioAssays) 349 338 { … … 360 349 DataResultIterator<RawData> rawData = rawQuery.iterate(dc); 361 350 ThreadSignalHandler.checkInterrupted(); 362 //data -= System.nanoTime();363 351 while (rawData.hasNext()) 364 352 { … … 368 356 ReporterData reporter = rd.getReporter(); 369 357 FeatureData feature = rd.getFeature(); 370 //data += System.nanoTime();371 358 372 359 // Calculate intensities 373 //calc -= System.nanoTime();374 360 float[] intensities = iCalc.calculateIntensities(rd); 375 //calc += System.nanoTime();376 361 377 362 if (intensities != null) … … 387 372 else 388 373 { 389 // We have no feature or the fea utre has no position;390 // check if the position has same reporter374 // We have no feature or the feature has no position. 375 // Check if the position has same reporter 391 376 if (positionCache.containsKey(position)) 392 377 { … … 433 418 } 434 419 435 //braw -= System.nanoTime();436 420 // Insert mapping to raw data spot 437 421 rawBatcher.insert(column, position, rd); 438 //braw += System.nanoTime();439 422 // Insert intensities 440 //batt -= System.nanoTime();441 423 spotBatcher.insert(column, position, intensities); 442 //batt += System.nanoTime();443 424 } 444 425 if (progress != null) … … 451 432 } 452 433 } 453 //data -= System.nanoTime(); 454 } 455 //data += System.nanoTime(); 434 } 456 435 } 457 436 if (progress != null) progress.display(100, "Calculating spot intensities ("+totalSpots+" done)...\n"); 458 459 //total += System.nanoTime(); 460 461 /* 462 System.out.println("Total time: " + (total / 1000000) + " ms"); 463 System.out.println("Intensity : " + (calc / 1000000) + " ms"); 464 System.out.println("Load data : " + (data / 1000000) + " ms"); 465 System.out.println("New pos : " + (cnew / 1000000) + " ms"); 466 System.out.println("Cached pos: " + (chit / 1000000) + " ms"); 467 System.out.println("Batch data: " + (batt / 1000000) + " ms"); 468 System.out.println("Batch rep : " + (brep / 1000000) + " ms"); 469 System.out.println("Batch raw : " + (braw / 1000000) + " ms"); 470 */ 471 437 472 438 // Close batchers and clean up 473 439 positionCache.clear(); -
trunk/src/core/net/sf/basedb/util/Values.java
r5590 r5689 417 417 s = formatter.format(value); 418 418 } 419 /*420 else if (value instanceof Date)421 {422 s = formatDate((Date)value);423 }424 */425 419 else 426 420 { -
trunk/src/core/net/sf/basedb/util/affymetrix/CelValidationAction.java
r5623 r5689 84 84 validator.copyMetadata(celData, rba); 85 85 86 // Check if the CEL matches the CDF on the ArrayDesign; a failure will result in InvalidRelationException 86 // Check if the CEL matches the CDF on the ArrayDesign. 87 // A failure will result in InvalidRelationException 87 88 try 88 89 { -
trunk/src/core/net/sf/basedb/util/biomaterial/ChildrenTransformer.java
r5663 r5689 96 96 query.setParameter("sources", sourceIds, Type.INT); 97 97 List<I> children = query.list(dc); 98 // Add the children to the destination ; if they all already exists we break to98 // Add the children to the destination. If they all already exists we break to 99 99 // loop (to avoid problematic circular references) 100 100 if (!destination.addAll(children)) break; -
trunk/src/core/net/sf/basedb/util/biomaterial/ParentsTransformer.java
r5663 r5689 95 95 query.setParameter("sources", sourceIds, Type.INT); 96 96 List<I> parents = query.list(dc); 97 // Add the parents to the destination ; if they all already exists we break to97 // Add the parents to the destination. If they all already exists we break to 98 98 // loop (to avoid problematic circular references) 99 99 if (!destination.addAll(parents)) break; -
trunk/src/core/net/sf/basedb/util/export/spotdata/MatrixBaseFileExporter.java
r5373 r5689 89 89 DbControl dc = getDbControl(); 90 90 91 // Count the spots in this section ; delegate output to superclass91 // Count the spots in this section. Delegate output to superclass 92 92 setProgress(10, "Counting number of spots..."); 93 93 spotCount = countQuery.count(dc); -
trunk/src/core/net/sf/basedb/util/export/spotdata/SerialBaseFileExporter.java
r5405 r5689 100 100 "' (" + (nextBioAssay+1)+" of " + bioAssays.size() + ")"); 101 101 102 // Count the spots in this section ; delegate output to superclass102 // Count the spots in this section. Delegate output to superclass 103 103 long count = countQuery.count(dc); 104 104 spotCount += count; -
trunk/src/core/net/sf/basedb/util/extensions/debug/BeanActionFactory.java
r5384 r5689 173 173 String value = entry.getValue(); 174 174 175 // Find a setParam() method ; ignore parameter if not found175 // Find a setParam() method. Ignore parameter if not found 176 176 Method setter = findSetterMethod(name, bean.getClass()); 177 177 if (setter == null) -
trunk/src/core/net/sf/basedb/util/importer/spotdata/BaseFileImporter.java
r5661 r5689 270 270 BaseFileInfo info = new BaseFileInfo(srcFile); 271 271 272 // First parser pass ;progress=0--30%272 // First parser pass: progress=0--30% 273 273 SectionAssaysParser assaysParser = new SectionAssaysParser(dc, info); 274 274 FirstPassSectionSpotsParser spotParser = new FirstPassSectionSpotsParser(dc, info, parent); … … 310 310 } 311 311 312 // Second parser pass ;progress=50-100%312 // Second parser pass: progress=50-100% 313 313 SecondPassSectionSpotsParser spotParser2 = 314 314 new SecondPassSectionSpotsParser(dc, info, child, totalLines); -
trunk/src/core/net/sf/basedb/util/importer/spotdata/BaseFileInfo.java
r5590 r5689 67 67 private boolean parentHasNullReporter; 68 68 private boolean parentHasZeroReporter; 69 // Position/reporter mapping ;key = position, value=reporter id69 // Position/reporter mapping: key = position, value=reporter id 70 70 private Map<Integer, Integer> parentReporterPositions; 71 71 private Map<Short, List<Short>> parentChildColumnMapping; … … 77 77 // Information about child spotdata 78 78 private boolean childHasDifferentReporterPositionMapping; 79 // Position/reporter mapping ;key = position, value=reporter id79 // Position/reporter mapping: key = position, value=reporter id 80 80 private Map<Integer, Integer> childReporterPositions; 81 81 -
trunk/src/core/net/sf/basedb/util/jep/FunctionSafeJep.java
r5384 r5689 105 105 { 106 106 boolean exists = super.containsKey(key); 107 //System.out.println("containsKey: " + key + "=" + exists +";nextToken="+nextToken((String)key));108 107 if (!exists && key instanceof String) 109 108 { -
trunk/src/core/net/sf/basedb/util/jep/Jep.java
r5384 r5689 136 136 } 137 137 } 138 // Other standard functions that we always add ; see newJep() method138 // Other standard functions that we always add. See newJep() method 139 139 functions.add("log2", "2-based logarithm"); 140 140 functions.sortKeys(); -
trunk/src/core/net/sf/basedb/util/overview/OverviewUtil.java
r5685 r5689 352 352 // index = rba.getArrayNum() 353 353 /* 354 TODO (#1153) 354 355 if (root instanceof RawBioAssay) 355 356 { -
trunk/src/core/net/sf/basedb/util/overview/loader/DerivedBioAssayLoader.java
r5685 r5689 77 77 78 78 /* 79 TODO (#1153) 79 80 NodeFactory<DerivedBioAssaySet> nf = getNodeFactory(dc, context); 80 81 Node folderNode = null; … … 96 97 */ 97 98 /* 99 TODO (#1153) 98 100 ItemResultIterator<DerivedBioAssay> it = bioAssayQuery.iterate(dc); 99 101 while (it.hasNext()) … … 129 131 130 132 /* 133 TODO (#1153) 131 134 NodeFactory<DerivedBioAssay> nf = getNodeFactory(dc, context); 132 135 DerivedBioAssay bioAssay = null; -
trunk/src/core/net/sf/basedb/util/overview/loader/ExtractLoader.java
r5685 r5689 274 274 try 275 275 { 276 //TODO (#1153) 276 277 //extract = bioAssay.getExtract(); 277 278 } -
trunk/src/core/net/sf/basedb/util/overview/validator/ArrayDesignValidator.java
r5652 r5689 90 90 { 91 91 /* 92 TODO - part of #1153 92 93 Scan scan = rba.getScan(); 93 94 if (scan != null) -
trunk/src/core/net/sf/basedb/util/overview/validator/BasicItemNodeValidatorFactory.java
r5685 r5689 198 198 registerCheckedNodeValidator(Item.ARRAYSLIDE, ArraySlideValidator.class); 199 199 registerCheckedNodeValidator(Item.PHYSICALBIOASSAY, PhysicalBioAssayValidator.class); 200 // TODO - part of #1153 200 201 // registerCheckedNodeValidator(Item.DERIVEDBIOASSAY, DerivedBioAssayValidator.class); 201 202 registerCheckedNodeValidator(Item.RAWBIOASSAY, RawBioAssayValidator.class); 202 203 registerCheckedNodeValidator(Item.EXPERIMENT, ExperimentValidator.class); 203 //204 //// Property node validators204 205 // Property node validators 205 206 registerCheckedNodeValidator(Item.PROTOCOL, ProtocolValidator.class); 206 207 registerCheckedNodeValidator(Item.TAG, TagValidator.class); -
trunk/src/core/net/sf/basedb/util/overview/validator/BioSourceValidator.java
r5651 r5689 59 59 super.postValidate(dc, context, node, parentNode); 60 60 61 // If parent node contains a sample ;check the subtypes61 // If parent node contains a sample, check the subtypes 62 62 if (parentNode != null && parentNode.getItemType() == Item.SAMPLE) 63 63 { -
trunk/src/core/net/sf/basedb/util/overview/validator/RawBioAssayValidator.java
r5685 r5689 100 100 } 101 101 /* 102 TODO (#1153) 102 103 String key = parent.getId() + ":" + arrayIndex; 103 104 if (used.containsKey(key)) … … 119 120 */ 120 121 /* 122 TODO (#1153) 121 123 PhysicalBioAssay pba = parent.getBioAssaySet().getPhysicalBioAssay(); 122 124 if (arrayIndex > pba.getSize() || arrayIndex < 1) -
trunk/src/core/net/sf/basedb/util/parser/FlatFileParser.java
r5590 r5689 1068 1068 } 1069 1069 } 1070 //if (nullIfException) mapper = new NullIfExceptionMapper(mapper);1071 1070 return mapper; 1072 1071 } -
trunk/src/core/net/sf/basedb/util/ssl/SSLUtil.java
r5362 r5689 40 40 import javax.net.ssl.KeyManagerFactory; 41 41 import javax.net.ssl.SSLContext; 42 //import javax.net.ssl.SSLSocketFactory;43 42 import javax.net.ssl.TrustManager; 44 43 import javax.net.ssl.TrustManagerFactory; -
trunk/src/plugins/core/net/sf/basedb/plugins/AnnotationFlatFileImporter.java
r5612 r5689 752 752 { 753 753 754 // Find the item(s) to annotate ; mapper gives us name OR external ID754 // Find the item(s) to annotate. Mapper gives us name OR external ID 755 755 String nameOrId = itemMapper.getValue(data); 756 756 // 1. check the cache -
trunk/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java
r5629 r5689 285 285 try 286 286 { 287 dc = sc.newDbControl(); 288 //getManualConfigureParameters(); 289 287 dc = sc.newDbControl(); 290 288 // Check number of channels 291 289 int channels = bas.getRawDataType().getChannels(); -
trunk/src/plugins/core/net/sf/basedb/plugins/IlluminaRawDataImporter.java
r5657 r5689 671 671 RawBioAssay rba = RawBioAssay.getNew(dc, generic, illumina); 672 672 rba.setName(arrayName); 673 // TODO (#1153) 673 674 //rba.setArrayNum(arrayNum); 674 675 if (design != null) rba.setArrayDesign(design); -
trunk/src/plugins/core/net/sf/basedb/plugins/LowessNormalization.java
r5612 r5689 859 859 if (toBlock > maxBlock) toBlock = maxBlock; 860 860 fromIndex = toIndex; 861 // Data is sorted by block ; find index of last spot with: block <= toBlock861 // Data is sorted by block. Find index of last spot with: block <= toBlock 862 862 // spot given by toIndex should not be included 863 863 while (toIndex < dataSize && data.get(toIndex).block <= toBlock) -
trunk/src/plugins/core/net/sf/basedb/plugins/MedianRatioNormalization.java
r5612 r5689 606 606 if (toBlock < fromBlock) toBlock = fromBlock; 607 607 fromIndex = toIndex; 608 // Data is sorted by block ; find index of last spot with: block <= toBlock608 // Data is sorted by block. Find index of last spot with: block <= toBlock 609 609 // spot given by toIndex should not be included 610 610 while (toIndex < dataSize && data.get(toIndex).block <= toBlock) -
trunk/src/plugins/core/net/sf/basedb/plugins/ReporterFlatFileImporter.java
r5630 r5689 628 628 Float score = scoreMapper == null ? 629 629 reporterList.getScore(reporter) : scoreMapper.getFloat(data); 630 // (Float)Type.FLOAT.parseString(scoreMapper.getValue(data), numberFormat);631 630 if (currentId == 0) 632 631 { -
trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java
r5688 r5689 611 611 throws BaseException 612 612 { 613 // Find the item(s) to update ; mapper gives us name, internal ID, or some other identifer613 // Find the item(s) to update. Mapper gives us name, internal ID, or some other identifer 614 614 String identifier = idMapper.getValue(data); 615 615 String cacheKey = itemQuery.getItemType().name() + ":" + identifier; … … 934 934 <pre class="code"> 935 935 BioSource bs = BioSource.getNew(dc); 936 // Set properties ; see example on updateItem method936 // Set properties. See example on updateItem method 937 937 return bs; 938 938 </pre> -
trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/ScanImporter.java
r5688 r5689 291 291 protected void updateMultiLineItem(DbControl dc, DerivedBioAssay scan, FlatFileParser.Data data, int multiLineNum) 292 292 { 293 // TODO (#1153) 293 294 // Image image = null; 294 295 File imageFile = null; … … 310 311 } 311 312 /* 313 TODO (#1153) 312 314 else if (image != null) 313 315 { 314 316 imageName = image.getName(); 315 317 } 316 */317 /*318 318 if (image != null) 319 319 { -
trunk/src/plugins/core/net/sf/basedb/plugins/executor/BaseFileExporterSupport.java
r5612 r5689 116 116 checkUniqueFields((String)request.getParameterValue("spotFields"), "spot fields"); 117 117 checkUniqueFields((String)request.getParameterValue("reporterFields"), "reporter fields"); 118 //checkUniqueFields((String)request.getParameterValue("assayFields"), "assay fields");119 118 } 120 119 catch (InvalidDataException ex) -
trunk/src/plugins/core/net/sf/basedb/plugins/executor/BfsExporterSupport.java
r5612 r5689 292 292 293 293 // Reporter fields 294 //ExportableFieldConverter fieldConverter = new StandardFieldConverter(dc, source);295 294 ExportableFieldConverter fieldConverter = new AdvancedFieldConverter(dc, source); 296 295 List<DynamicField> reporterFields = new ArrayList<DynamicField>(); -
trunk/src/plugins/core/net/sf/basedb/plugins/executor/ExternalProgramExecutor.java
r5612 r5689 693 693 if (cmdLine != null) 694 694 { 695 // Split on whitespace but not inside quotes ; quotes are removed695 // Split on whitespace but not inside quotes. Quotes are removed after the split 696 696 String[] options = StringUtil.tokenize(cmdLine, "\\s+", true, true); 697 697 if (options != null) -
trunk/src/plugins/core/net/sf/basedb/plugins/executor/FileOnlyImporterSupport.java
r5612 r5689 91 91 if (command.equals(IOSupport.COMMAND_CONFIGURE_IO_PLUGIN)) 92 92 { 93 /* 94 RequestInformation ri = getConfigureExecutorParameters(command); 95 List<Throwable> errors = validateRequestParameters(ri.getParameters(), request); 96 if (errors != null) 97 { 98 response.setError(errors.size()+" invalid parameter(s) were found " + 99 "in the request", errors); 100 return; 101 } 102 */ 103 104 // Import options 105 //storeValue(configuration, request, ri.getParameter("datafile")); 106 //storeValue(configuration, request, ri.getParameter("extraFiles")); 107 93 // No parameters 108 94 response.setDone("File-only importer configuration complete"); 109 95 } -
trunk/src/test/Base1NullPlugin.java
r4537 r5689 35 35 public static void main(String[] args) throws IOException 36 36 { 37 // System.out.println("BASEfile");38 // System.out.println("section\tassays");39 // System.out.println("annotationColumns");40 // System.out.println("columns\tid\tname");41 // System.out.println("count\t1");42 // System.out.println("%");43 // System.out.println("1074793\tCa71_1_a");44 // System.out.println();45 // System.out.println("section\tspots");46 // System.out.println("channels\t2");47 // System.out.println("assayFields\tintensity1\tintensity2");48 // System.out.println("columns\tposition\treporter\tassayData");49 // System.out.println("assays\t1074793");50 // System.out.println("count\t1");51 // System.out.println("%");52 // System.out.println("22134\t81431\t51.1538\t239.982");53 // System.out.println();54 // System.out.println("section\tspots");55 // System.out.println("channels\t2");56 // System.out.println("assayFields\tintensity1\tintensity2");57 // System.out.println("columns\tposition\treporter\tassayData");58 // System.out.println("assays\t1074793");59 // System.out.println("count\t1");60 // System.out.println("%");61 // System.out.println("22165\t81431\t151.1538\t39.982");62 // System.out.println();63 64 37 PrintWriter log = new PrintWriter("base1nullplugin.log"); 65 38 log.println("base1nullplugin started"); -
trunk/src/test/Base1TestPlugin.java
r4720 r5689 56 56 ffp.parseHeaders(); 57 57 58 //System.out.println("section:::" + section.name());59 58 if ("settings".equals(section.name())) 60 59 { … … 63 62 reporterList = Values.getBoolean(ffp.getHeader("reporterList")); 64 63 createSubdir = Values.getBoolean(ffp.getHeader("createSubdir")); 65 //System.out.println("merge: " + mergeAssays + "; offset: " + offsetPositions);66 //System.out.println("createSubdir: " + createSubdir);67 64 } 68 65 else if ("assays".equals(section.name()) && !reporterList) … … 145 142 File tmpDir = new File(System.getProperty("java.io.tmpdir")); 146 143 File subdir = new File(tmpDir, "subdir"); 147 //System.out.println("Creating subdir: " + subdir + "(" + subdir.getAbsolutePath() + ")");148 144 subdir.mkdirs(); 149 145 File subFile = new File(subdir, "file.txt"); 150 //System.out.println("Creating file: " + subFile + "(" + subFile.getAbsolutePath() + ")");151 146 subFile.createNewFile(); 152 147 } -
trunk/src/test/TestBase1PluginExecuter.java
r5444 r5689 107 107 ok &= TestJob.test_execute(jobId, false); 108 108 109 // Copy input to output - serial format ;remove stdin and stdout109 // Copy input to output - serial format, remove stdin and stdout 110 110 int jobIdCleanStd = test_create_job(cloneSerialCleanStdId, experimentId, 111 111 cloneId, directoryId, "Clone serial (remove std*.txt)"); -
trunk/src/test/TestBioPlateEvent.java
r5688 r5689 105 105 test_delete(id3); 106 106 107 // Delete the plates and the biomaterial on them 107 108 TestBioPlate.test_delete_contents(extractPlateId); 108 109 TestBioPlate.test_delete_contents(storagePlateId); 109 110 TestBioPlate.test_delete_contents(samplePlateId); 110 111 //TestSample.test_delete(sampleId1);112 //TestSample.test_delete(sampleId2);113 //TestSample.test_delete(sampleId3);114 111 115 112 TestHardware.test_delete(hardwareId); … … 210 207 } 211 208 } 212 213 /*214 static int test_create(String name, int protocolId, int hardwareId, boolean setAll, Item bioMaterialType, int... bioMaterialIds)215 {216 if (!TestUtil.hasPermission(Permission.CREATE, Item.BIOPLATEEVENT))217 {218 return 0;219 }220 int id = 0;221 DbControl dc = null;222 try223 {224 dc = TestUtil.getDbControl();225 226 BioPlateEvent event = BioPlateEvent.getNew(dc);227 event.setName(name);228 if (protocolId != 0) event.setProtocol(Protocol.getById(dc, protocolId));229 if (hardwareId != 0) event.setHardware(Hardware.getById(dc, hardwareId));230 if (setAll)231 {232 event.setEventDate(new Date());233 event.setDescription("Added at " + new Date());234 }235 236 dc.saveItem(event);237 if (bioMaterialType != null && bioMaterialIds != null)238 {239 for (int bmId : bioMaterialIds)240 {241 MeasuredBioMaterial bm = (MeasuredBioMaterial)bioMaterialType.getById(dc, bmId);242 BioMaterialEvent bmEvent = BioMaterialEvent.getNew(dc, bm, event);243 dc.saveItem(bmEvent);244 }245 }246 dc.commit();247 id = event.getId();248 dc = TestUtil.getDbControl();249 dc.reattachItem(event, false);250 write_item(0, event);251 write("--Create bioplate event OK");252 }253 catch (Throwable ex)254 {255 write("--Create bioplate event FAIILED");256 ex.printStackTrace();257 ok = false;258 }259 finally260 {261 if (dc != null) dc.close();262 }263 return id;264 }265 */266 209 267 210 static void test_delete_all() -
trunk/src/test/TestFlatFileParser.java
r4925 r5689 105 105 } 106 106 if (!TestUtil.getSilent()) write("--Column headers: " + ffp.getColumnHeaders()); 107 // write("--Last line: "+types[last_line_type]);108 107 if ((last_line_type == FlatFileParser.LineType.DATA_HEADER) || (last_line_type == FlatFileParser.LineType.DATA)) 109 108 { -
trunk/src/test/TestGenericOverview.java
r5685 r5689 131 131 SystemItems.getId(DerivedBioAssay.SCAN), scanningProtocol, scanner, 0); 132 132 TestAnnotation.test_annotatate(Item.DERIVEDBIOASSAY, scan, scanPower, 0, 15.0f); 133 // TODO (#1153) 133 134 // int scannedAssayId1 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract1, "Scanned GO #1"); 134 135 // int scannedAssayId2 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract2, "Scanned GO #2"); -
trunk/src/test/TestHelp.java
r5340 r5689 55 55 56 56 // Extra tests: 57 //if (id != 0) test_load_external_id(clientId, "help.text");57 if (id != 0) test_load_external_id(clientId, "help.text"); 58 58 59 59 test_import("net.sf.basedb.clients.web", "../../data/helptexts.xml"); … … 208 208 } 209 209 210 /*211 210 static void test_load_external_id(int clientId, String externalId) 212 211 { … … 216 215 dc = TestUtil.getDbControl(); 217 216 Client client = Client.getById(dc, clientId); 218 Help h = Help.getByExternalId(dc, client, externalId);217 Help h = client.getHelpByExternalId(dc, externalId, false); 219 218 write_item(0, h); 220 219 write("--Load help by external ID OK"); … … 231 230 } 232 231 } 233 */234 232 235 233 static void test_import(String clientId, String filename) -
trunk/src/test/TestIlluminaImporter.java
r5653 r5689 44 44 int fileId = TestFile.test_create("data/test.illumina.rawdata.txt", false, false); 45 45 int hybId = TestPhysicalBioAssay.test_create(0, "Test hyb", 0, 1); 46 // TODO (#1153) 46 47 //int scanId = TestScan.test_create(hybId, 0, 0, false); 47 48 int scanId = 0; … … 73 74 TestJob.test_delete(jobId); 74 75 76 // TODO (#1153) 75 77 //TestScan.test_delete(scanId); 76 78 TestSoftware.test_delete(softwareId); … … 108 110 } 109 111 /* 112 TODO (#1153) 110 113 if (scanId != 0) 111 114 { -
trunk/src/test/TestItemImporter.java
r5688 r5689 256 256 // Step 1 - file and parser regular expressions 257 257 PluginConfigurationRequest request = j.configure(new GuiContext(itemType, GuiContext.Type.LIST)); 258 //write_request_information(request.getRequestInformation());259 258 request.getRequestInformation(); 260 259 File file = File.getById(dc, fileId); … … 420 419 request.setParameterValue("numberFormatError", "skip"); 421 420 request.setParameterValue("numberOutOfRangeError", "skip"); 422 423 if (itemType == Item.SAMPLE) 424 { 425 //request.setParameterValue("dryRun", true); 426 } 421 427 422 request.setParameterValue("logFile", "/" + itemType.name() + ".log"); 428 423 } -
trunk/src/test/TestProjectKey.java
r5368 r5689 62 62 ok = ok && (id != id3); 63 63 64 // Extra test: add another project -> id3 != id65 // int projectId2 = TestProject.test_create();66 // int id3 = test_addproject(id, project2_id);67 // write("--id!=id3 "+(id != id3 ? "OK" : "FAILED id="+id+"; id3="+id3));68 // ok = ok && (id != id3);69 //70 // test_listprojects(id);71 // test_listprojects(id3);72 //73 // // Extra test: remove the project again -> id4 == id74 // int id4 = test_removeproject(id3, project2_id);75 // write("--id==id4 "+(id==id4 ? "OK" : "FAILED id="+id+"; id4="+id4));76 // ok = ok && (id == id4);77 78 64 if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); 79 65 80 66 // Standard test: Delete 81 // test_delete(id);82 // test_delete(id3);83 84 67 TestProject.test_delete(projectId); 85 // TestProject.test_delete(projectId2);86 87 68 test_delete_unused(2); 88 69 … … 191 172 } 192 173 193 /*194 static int test_addproject(int id, int projectId)195 {196 if (id == 0 || project_id == 0) return 0;197 int new_id = 0;198 BaseControl bc = null;199 try200 {201 bc = TestUtil.getBaseControl();202 ProjectKey pk = ProjectKey.getById(bc, id);203 Project p = Project.getById(bc, project_id);204 pk.setPermission(p, PERMISSION.ALL);205 pk.save();206 bc.commit();207 new_id = pk.getId();208 write("--Add project to project key OK");209 }210 catch (Throwable ex)211 {212 write("--Add project to project key FAILED");213 ex.printStackTrace();214 ok = false;215 }216 finally217 {218 if (bc != null) bc.close();219 }220 return new_id;221 }222 223 static int test_removeproject(int id, int project_id)224 {225 if (id == 0 || project_id == 0) return 0;226 int new_id = 0;227 BaseControl bc = null;228 try229 {230 bc = TestUtil.getBaseControl();231 ProjectKey pk = ProjectKey.getById(bc, id);232 Project p = Project.getById(bc, project_id);233 pk.setPermission(p, PERMISSION.DENIED);234 pk.save();235 bc.commit();236 new_id = pk.getId();237 write("--Remove project from project key OK");238 }239 catch (Throwable ex)240 {241 write("--Remove project from project key FAILED");242 ex.printStackTrace();243 ok = false;244 }245 finally246 {247 if (bc != null) bc.close();248 }249 return new_id;250 }251 252 static void test_listprojects(int id)253 {254 if (id == 0) return;255 BaseControl bc = null;256 try257 {258 bc = TestUtil.getBaseControl();259 ProjectKey pk = ProjectKey.getById(bc, id);260 // List l = Project.find(bc, null);261 List l = pk.getProjectList(null);262 for (int i = 0; i<l.size(); i++)263 {264 Project p = (Project)l.get(i);265 write_item(i, p, pk.getPermission(p));266 }267 write("--List projects in project key OK ("+l.size()+")");268 }269 catch (Throwable ex)270 {271 write("--List projects in project key FAILED");272 ex.printStackTrace();273 ok = false;274 }275 finally276 {277 if (bc != null) bc.close();278 }279 }280 */281 174 } 282 175 -
trunk/src/test/TestRawBioAssay.java
r5688 r5689 380 380 value = "ABCDEF"; 381 381 } 382 //System.out.println("Add value: "+p.getName()+": "+t+": "+value);383 // rd.setExtended(p.getName(), value);384 382 extra.put(p.getName(), value); 385 383 } -
trunk/src/test/TestRawDataFlatFileImporter.java
r5657 r5689 140 140 request.setParameterValue("propertyMapping.bgPixels", "\\34\\"); 141 141 request.setParameterValue("propertyMapping.flags", "\\46\\"); 142 //request.setParameterValue("minDataColumns", 48);143 //request.setParameterValue("maxDataColumns", 48);144 142 145 143 response = request.invoke(); -
trunk/src/test/TestReporterFlatFileImporter.java
r5319 r5689 76 76 ok &= TestJob.test_execute(jobId2, false); 77 77 78 // TestReporter.test_delete();79 80 78 TestJob.test_delete(jobId); 81 79 TestJob.test_delete(jobId2); -
trunk/src/test/TestRoleKey.java
r4889 r5689 141 141 dc = TestUtil.getDbControl(); 142 142 RoleKey rk = RoleKey.getById(dc, id); 143 // List l = Role.find(bc, null);144 143 List<Role> l = Role.getQuery().list(dc); 145 144 for (int i=0; i<l.size(); i++) -
trunk/src/test/TestSpotImages.java
r5657 r5689 29 29 import net.sf.basedb.core.query.Hql; 30 30 31 // import java.util.Date;32 31 import java.util.List; 33 32 import java.util.ArrayList; 34 33 import java.util.LinkedList; 35 // import java.util.Iterator;36 //37 34 import javax.media.jai.JAI; 38 35 import com.sun.media.jai.widget.DisplayJAI; … … 75 72 positions.add(519); 76 73 test_multi_fetch_spot(rawBioAssayId, positions); 77 78 // int zipfile_id = test_disconnect_spotimagesfile( rawbioassay_id );79 // TestFile.test_delete(zipfile_id);80 74 81 75 if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); … … 236 230 } 237 231 } 238 // 239 // 240 // static int test_disconnect_spotimagesfile( int rawbioassay_id ) 241 // { 242 // BaseControl bc = null; 243 // int id = 0; 244 // try 245 // { 246 // bc = TestUtil.getBaseControl(); 247 // 248 // RawBioAssay rba = RawBioAssay.getById( bc, rawbioassay_id ); 249 // SpotImages si = rba.getSpotImages(); 250 // File spotFile = si.getSpotImagesFile(); 251 // si.disconnectSpotImages(); 252 // si.save(); 253 // bc.commit(); 254 // if( spotFile != null ) 255 // { 256 // id = spotFile.getId(); 257 // write("--Disconnect spotimages OK"); 258 // } 259 // else 260 // { 261 // write("--Disconnect spotimages FAILED"); 262 // } 263 // } 264 // catch (Exception ex) 265 // { 266 // write("--Disconnect spotimages FAILED"); 267 // ex.printStackTrace(); 268 // ok = false; 269 // } 270 // finally 271 // { 272 // if (bc != null) bc.close(); 273 // } 274 // return id; 275 // } 232 276 233 277 234 static void write(String message) … … 289 246 290 247 public void append(String message) 291 { 292 //System.out.println("--"+message); 293 } 248 {} 294 249 } 295 250 } -
trunk/src/test/TestUser.java
r5368 r5689 86 86 87 87 // Extra test: create an item and change the owner 88 // TODO (#1153) 88 89 // int label_id = TestLabel.test_create(); 89 90 // test_set_owner(id, label_id); … … 444 445 445 446 /* 447 TODO (#1153) 446 448 static void test_set_owner(int id, int label_id) 447 449 { -
trunk/src/test/TestUtil.java
r5608 r5689 119 119 } 120 120 121 //private static DbControl dc = null;122 121 private static SessionControl sc = null; 123 122 -
trunk/src/test/net/sf/basedb/test/MouseData.java
r4514 r5689 101 101 parameters.put("headerRegexp", "\"(.+)=(.*)\""); 102 102 parameters.put("dataSplitterRegexp", "\\t"); 103 //parameters.put("ignoreRegexp", ".*(NoOligoInfo|no clone).*");104 103 if (dyeSwap) 105 104 { -
trunk/src/test/net/sf/basedb/test/roles/UserTest.java
r5685 r5689 120 120 if (useBatchImporters) 121 121 { 122 // Preparation ;uploading files and find plugins122 // Preparation: uploading files and find plugins 123 123 dc = TestUtil.getDbControl(); 124 124 bioSourceBatchImporter = PluginDefinition.getByClassName(dc, "net.sf.basedb.plugins.batchimport.BioSourceImporter"); … … 218 218 Extract leRefDyeSwap = createLabeledExtract(dc, "Labeled extract A.ref (dye-swap)", eRef, cy3); 219 219 leRefDyeSwap.setBioWell(bioPlate.getBioWell(3, 2)); 220 // dc.commit();221 220 222 221 // Hybridizations, etc. 223 // dc = TestUtil.getDbControl();224 222 PhysicalBioAssay h1 = createHybridization(dc, "Hybridization A.00h", "Array slide A.1", le1, leRef); 225 223 PhysicalBioAssay h2 = createHybridization(dc, "Hybridization A.24h", "Array slide A.2", le2, leRef); … … 486 484 RawBioAssay rba = RawBioAssay.getNew(dc, platform, rawDataType); 487 485 rba.setName(name); 486 // TODO (#1153) 488 487 //rba.setScan(scan); 489 488 rba.setProtocol(Util.findProtocol(dc, "Feature extraction A"));
Note: See TracChangeset
for help on using the changeset viewer.