Changeset 3775
- Timestamp:
- Sep 25, 2007, 11:12:36 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/src/docbook/admindoc/installation_upgrade.xml
r3725 r3775 343 343 </listitem> 344 344 </varlistentry> 345 <varlistentry >346 <term id="installation_upgrade.jobagent.user_account">Enable the job agent user account</term>345 <varlistentry id="installation_upgrade.jobagent.user_account"> 346 <term>Enable the job agent user account</term> 347 347 <listitem> 348 348 <para> … … 367 367 <para> 368 368 <variablelist> 369 <varlistentry >370 <term id="installation_upgrade.jobagent.database">Create a user account on the database</term>369 <varlistentry id="installation_upgrade.jobagent.database"> 370 <term>Create a user account on the database</term> 371 371 <listitem> 372 372 <para> … … 413 413 </listitem> 414 414 </varlistentry> 415 <varlistentry >416 <term id="installation_upgrade.jobagent.client.config">Edit the <filename>base.config</filename> file</term>415 <varlistentry id="installation_upgrade.jobagent.client.config"> 416 <term>Edit the <filename>base.config</filename> file</term> 417 417 <listitem> 418 418 <para> … … 462 462 </listitem> 463 463 </varlistentry> 464 <varlistentry >465 <term id="installation_upgrade.jobagent.client.properties">Edit464 <varlistentry id="installation_upgrade.jobagent.client.properties"> 465 <term>Edit 466 466 the <filename>jobagent.properties</filename> file</term> 467 467 <listitem> … … 744 744 </varlistentry> 745 745 746 <varlistentry >747 <term id="installation_upgrade.installation.database">BASE (database engine)</term>746 <varlistentry id="installation_upgrade.installation.database"> 747 <term>BASE (database engine)</term> 748 748 <listitem> 749 749 <para> … … 841 841 </varlistentry> 842 842 843 <varlistentry >844 <term id="installation_upgrade.installation.configuration">BASE (configuration)</term>843 <varlistentry id="installation_upgrade.installation.configuration"> 844 <term>BASE (configuration)</term> 845 845 <listitem> 846 846 <para> -
trunk/doc/src/docbook/overviewdoc/resources.xml
r3699 r3775 222 222 <title>Demo server</title> 223 223 <para> 224 There is a demo server available for anyone to use and to225 explore BASE without having to install anything. Follow the link226 from BASE web site to the demo server or go directlyto224 There is a demo server up running for anyone who wants to explore BASE 2 without having 225 to install it. Follow the link on BASE 2's home page to the demo server or go directly 226 to 227 227 <ulink url="http://base2.thep.lu.se/demo/"> 228 228 http://base2.thep.lu.se/demo/ … … 285 285 </important> 286 286 </sect1> 287 288 <sect1 id="resources.basehacks"> 289 <title>BASE-hacks</title> 290 <para> 291 There is a trac/subversion server keeping track of changes made 292 to third party projects that are changed to make them work with 293 BASE. Open source project usually have a requirement that 294 changes are made public. On 295 the <ulink 296 url='http://trac.thep.lu.se/trac/basehacks'>BASE-hacks web 297 site</ulink> you will find a list of modified packages and 298 information about the changes performed. 299 </para> 300 </sect1> 301 287 302 </chapter> -
trunk/doc/src/docbook/userdoc/analyse_mev.xml
r3679 r3775 29 29 <sect1 id="experiments_analysis.mev"> 30 30 <title>Analysing data with Multiexperiment Viewer (MeV)</title> 31 <para>TODO</para> 31 <para> 32 MeV is a versatile microarray data analysis tool, incorporating 33 sophisticated algorithms for clustering, visualization, 34 classification, statistical analysis and biological theme 35 discovery, <ulink 36 url='http://www.tm4.org'>http://www.tm4.org</ulink>. We use a 37 modified version of MeV and provide information about the changes 38 at 39 the <ulink url='http://trac.thep.lu.se/trac/basehacks'>BASE-hacks 40 web site</ulink>. 41 </para> 32 42 </sect1> -
trunk/src/clients/migrate/net/sf/basedb/clients/migrate/QuotaTransfer.java
r3725 r3775 97 97 quotas.put(totalQuota, quota); 98 98 } 99 else 99 else if (quota.isInDatabase()) 100 100 { 101 101 quota = Quota.getById(dc, quota.getId()); -
trunk/src/clients/web/net/sf/basedb/clients/web/Base.java
r3679 r3775 511 511 if (value != null) 512 512 { 513 boolean hasWildcard = value.indexOf('%') >= 0; 513 514 Type valueType = Type.valueOf(name.substring(7, colonIndex)); 514 515 … … 517 518 filter.setValueType(valueType); 518 519 519 Operator op = Operator.EQ;520 Operator op = hasWildcard ? Operator.LIKE : Operator.EQ; 520 521 if (value.startsWith("<>") || value.startsWith("!=")) 521 522 { 522 op = Operator.NEQ;523 op = hasWildcard ? Operator.NOTLIKE : Operator.NEQ; 523 524 value = value.substring(2); 524 525 } … … 545 546 else if (value.startsWith("=")) 546 547 { 547 op = Operator.EQ;548 op = hasWildcard ? Operator.LIKE : Operator.EQ; 548 549 value = value.substring(1); 549 }550 else if (value.indexOf('%') >= 0)551 {552 op = Operator.LIKE;553 550 } 554 551 if ("".equals(value)) value = null; … … 669 666 {} 670 667 } 671 if (op == Operator.EQ && (value == null || (value != null && value.indexOf('%') >= 0)))668 if (op == Operator.EQ && value == null) 672 669 { 673 670 result = "="; 674 671 } 675 else if (op == Operator.NEQ )672 else if (op == Operator.NEQ || op == Operator.NOTLIKE) 676 673 { 677 674 result = "<>"; -
trunk/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java
r3679 r3775 227 227 String whichItems = (String)job.getValue(WHICH_ITEMS); 228 228 String format = (String)job.getValue(FORMAT); 229 List<Integer> selectedItems = (List<Integer>)job.getValues("item");230 229 List<String> columns = (List<String>)job.getValues(WHICH_PROPERTIES); 231 230 … … 265 264 QueryWrapper queryWrapper = null; 266 265 ResultIterator result = null; 266 Set<Integer>selectedItems = cc.getSelected(); 267 267 268 268 // The query wrapper allows us to get results from the query in a simplier way -
trunk/src/core/net/sf/basedb/core/AbstractBatcher.java
r3679 r3775 75 75 76 76 /** 77 Constructor that initiate everything. 78 79 @param dc The <code>DbControl</code> to get database access 77 Constructor for a batcher. 80 78 @throws BaseException If there is an error 81 79 */ 82 AbstractBatcher(DbControl dc) 83 { 84 assert dc != null : "dc == null"; 85 this.dc = new WeakReference<DbControl>(dc); 86 this.sc = dc.getSessionControl(); 80 AbstractBatcher() 81 { 87 82 this.batchSize = Config.getInt("db.batch-size", 50); 88 dc.addBatcher(this);89 83 } 90 84 … … 133 127 { 134 128 sc.updateLastAccess(); 129 } 130 131 /** 132 Set the DbControl that is controlling this batcher. This 133 method MUST be called by all subclasses after successful construction 134 of a batcher. This method also registers the batcher with the DbControl 135 using {@link DbControl#addBatcher(Batcher)} 136 @since 2.4.2 137 */ 138 protected final void setDbControl(DbControl dc) 139 { 140 assert dc != null : "dc == null"; 141 this.dc = new WeakReference<DbControl>(dc); 142 this.sc = dc.getSessionControl(); 143 dc.addBatcher(this); 135 144 } 136 145 -
trunk/src/core/net/sf/basedb/core/BasicBatcher.java
r3679 r3775 131 131 Constructor that initiate everything. 132 132 133 @param dc DbControl to get database access134 133 @param dataClass The class of the data objects that are accepted by this batcher 135 134 @param entityName The entity name of the data as known by Hibernate, use null … … 137 136 @throws BaseException If there is an error 138 137 */ 139 BasicBatcher( DbControl dc, Class<D> dataClass, String entityName)140 throws BaseException 141 { 142 super( dc);138 BasicBatcher(org.hibernate.Session session, Class<D> dataClass, String entityName) 139 throws BaseException 140 { 141 super(); 143 142 assert dataClass != null : "dataClass == null"; 144 143 … … 159 158 try 160 159 { 161 java.sql.Connection c = HibernateUtil.getConnection( dc.getHibernateSession());160 java.sql.Connection c = HibernateUtil.getConnection(session); 162 161 insertStatement = c.prepareStatement(insertSql); 163 162 updateStatement = c.prepareStatement(updateSql); -
trunk/src/core/net/sf/basedb/core/DbControl.java
r3679 r3775 269 269 batcher.close(); 270 270 } 271 catch ( BaseExceptionex)271 catch (Throwable ex) 272 272 { 273 273 log.warn("Exception during rollback in batcher.close()", ex); … … 281 281 if (hStatelessSession != null) HibernateUtil.close(hStatelessSession); 282 282 } 283 catch ( BaseExceptionex)283 catch (Throwable ex) 284 284 { 285 285 log.warn("Exception during rollback in Hibernate", ex); -
trunk/src/core/net/sf/basedb/core/FeatureBatcher.java
r3679 r3775 91 91 throws BaseException 92 92 { 93 super(dc , FeatureData.class, null);93 super(dc.getHibernateSession(), FeatureData.class, null); 94 94 this.arrayDesign = arrayDesign; 95 95 this.arrayDesignData = arrayDesign.getData(); 96 96 this.isAffy = arrayDesign.isAffyChip(); 97 setDbControl(dc); 97 98 } 98 99 -
trunk/src/core/net/sf/basedb/core/FilterBatcher.java
r3679 r3775 142 142 FilterBatcher(DbControl dc, BioAssaySet bioAssaySet) 143 143 { 144 super( dc);144 super(); 145 145 this.bioAssaySet = bioAssaySet; 146 146 this.bytesPerRow = VirtualTable.FILTER.getBytesPerRow(bioAssaySet.getRawDataType()); 147 setDbControl(dc); 147 148 } 148 149 -
trunk/src/core/net/sf/basedb/core/MappingBatcher.java
r3679 r3775 106 106 MappingBatcher(DbControl dc, DataCube dataCube) 107 107 { 108 super( dc);108 super(); 109 109 this.dataCube = dataCube; 110 110 this.noRawMapping = dataCube.isInDatabase(); 111 111 this.bytesPerRow = VirtualTable.RAWPARENTS.getBytesPerRow(dataCube.getRawDataType()); 112 setDbControl(dc); 112 113 } 113 114 -
trunk/src/core/net/sf/basedb/core/Operator.java
r3679 r3775 126 126 return Restrictions.like(lvalue, rvalue); 127 127 } 128 }, 129 130 NOTLIKE(11, "NOT LIKE", "NOT LIKE", true) 131 { 132 public Restriction getRestriction(Expression lvalue, Expression rvalue) 133 throws InvalidDataException 134 { 135 return Restrictions.not(Restrictions.like(lvalue, rvalue)); 136 } 128 137 }; 129 138 -
trunk/src/core/net/sf/basedb/core/PluginConfiguration.java
r3679 r3775 467 467 468 468 int newVersion = getNewParameterVersion(); 469 int copyFromVersion = copyFrom.getParameterVersion(); 469 470 try 470 471 { 471 472 for (Map.Entry<VersionedParameter, ParameterValueData<?>> fromEntry : from.entrySet()) 472 473 { 473 VersionedParameter toName = new VersionedParameter(fromEntry.getKey().getName(), newVersion); 474 ParameterValueData<?> fromParameter = fromEntry.getValue(); 475 Class<? extends ParameterValueData> dataClass = fromParameter.getClass(); 476 if (org.hibernate.proxy.HibernateProxy.class.isAssignableFrom(dataClass)) 474 VersionedParameter fromName = fromEntry.getKey(); 475 if (copyFromVersion == fromName.getVersion()) 477 476 { 478 // The 'fromParameter' is a proxy, we need the real data class 479 dataClass = 480 (Class<? extends ParameterValueData>)org.hibernate.Hibernate.getClass(fromParameter); 477 VersionedParameter toName = new VersionedParameter(fromName.getName(), newVersion); 478 ParameterValueData<?> fromParameter = fromEntry.getValue(); 479 Class<? extends ParameterValueData> dataClass = fromParameter.getClass(); 480 if (org.hibernate.proxy.HibernateProxy.class.isAssignableFrom(dataClass)) 481 { 482 // The 'fromParameter' is a proxy, we need the real data class 483 dataClass = 484 (Class<? extends ParameterValueData>)org.hibernate.Hibernate.getClass(fromParameter); 485 } 486 ParameterValueData<?> toParameter = dataClass.newInstance(); 487 toParameter.setLabel(fromParameter.getLabel()); 488 toParameter.setDescription(fromParameter.getDescription()); 489 toParameter.replaceValues(fromParameter.getValues()); 490 to.put(toName, toParameter); 481 491 } 482 ParameterValueData<?> toParameter = dataClass.newInstance();483 toParameter.setLabel(fromParameter.getLabel());484 toParameter.setDescription(fromParameter.getDescription());485 toParameter.replaceValues(fromParameter.getValues());486 to.put(toName, toParameter);487 492 } 488 493 } -
trunk/src/core/net/sf/basedb/core/PositionBatcher.java
r3679 r3775 106 106 PositionBatcher(DbControl dc, DataCube dataCube) 107 107 { 108 super( dc);108 super(); 109 109 this.dataCube = dataCube; 110 110 this.bytesPerRow = VirtualTable.POSITION.getBytesPerRow(dataCube.getRawDataType()); 111 setDbControl(dc); 111 112 } 112 113 -
trunk/src/core/net/sf/basedb/core/PositionExtraValueBatcher.java
r3679 r3775 154 154 PositionExtraValueBatcher(DbControl dc, ExtraValue extraValue) 155 155 { 156 super( dc);156 super(); 157 157 this.extraValue = extraValue; 158 158 this.bytesPerRow = extraValue.getVirtualTable().getBytesPerRow(extraValue.getRawDataType()); 159 159 this.valueType = extraValue.getExtraValueType().getValueType(); 160 160 this.sqlType = valueType.getSQLType(); 161 setDbControl(dc); 161 162 } 162 163 -
trunk/src/core/net/sf/basedb/core/RawBioAssay.java
r3679 r3775 291 291 { 292 292 super.onBeforeCommit(action); 293 if (action == Transactional.Action.DELETE && getSpots() > 0) 294 { 295 RawDataBatcher rdb = RawDataBatcher.getNew(getDbControl(), this); 296 rdb.deleteAll(); 293 if (action == Transactional.Action.DELETE) 294 { 295 if (getRawDataType().isStoredInDb() && getSpots() > 0) 296 { 297 RawDataBatcher rdb = RawDataBatcher.getNew(getDbControl(), this); 298 rdb.deleteAll(); 299 } 297 300 } 298 301 } -
trunk/src/core/net/sf/basedb/core/RawDataBatcher.java
r3679 r3775 161 161 throws BaseException 162 162 { 163 super(dc , RawData.class, rawBioAssay.getRawDataType().getEntityName());163 super(dc.getHibernateSession(), RawData.class, rawBioAssay.getRawDataType().getEntityName()); 164 164 this.rawBioAssay = rawBioAssay; 165 165 this.rawBioAssayData = rawBioAssay.getData(); … … 205 205 this.preloaded = null; 206 206 } 207 setDbControl(dc); 207 208 } 208 209 -
trunk/src/core/net/sf/basedb/core/ReporterBatcher.java
r3679 r3775 77 77 throws BaseException 78 78 { 79 super(dc , ReporterData.class, null);79 super(dc.getHibernateSession(), ReporterData.class, null); 80 80 extendedProperties = ExtendedProperties.getProperties("ReporterData"); 81 81 batchedExternalIds = HibernateUtil.getDbEngine().caseInsensitiveComparison() ? 82 82 new TreeSet<String>(String.CASE_INSENSITIVE_ORDER) : new HashSet<String>(); 83 setDbControl(dc); 83 84 } 84 85 -
trunk/src/core/net/sf/basedb/core/SpotBatcher.java
r3679 r3775 141 141 SpotBatcher(DbControl dc, BioAssaySet bioAssaySet) 142 142 { 143 super( dc);143 super(); 144 144 this.bioAssaySet = bioAssaySet; 145 145 this.numChannels = bioAssaySet.getRawDataType().getChannels(); 146 146 this.bytesPerRow = VirtualTable.SPOT.getBytesPerRow(bioAssaySet.getRawDataType()); 147 setDbControl(dc); 147 148 } 148 149 -
trunk/src/core/net/sf/basedb/core/SpotExtraValueBatcher.java
r3679 r3775 144 144 SpotExtraValueBatcher(DbControl dc, ExtraValue extraValue) 145 145 { 146 super( dc);146 super(); 147 147 this.extraValue = extraValue; 148 148 this.bytesPerRow = extraValue.getVirtualTable().getBytesPerRow(extraValue.getRawDataType()); 149 149 this.valueType = extraValue.getExtraValueType().getValueType(); 150 150 this.sqlType = valueType.getSQLType(); 151 setDbControl(dc); 151 152 } 152 153 -
trunk/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java
r3725 r3775 44 44 import net.sf.basedb.core.Include; 45 45 import net.sf.basedb.core.IntegerParameterType; 46 import net.sf.basedb.core.InvalidDataException;47 46 import net.sf.basedb.core.Item; 48 47 import net.sf.basedb.core.ItemNotFoundException; … … 56 55 import net.sf.basedb.core.PositionBatcher; 57 56 import net.sf.basedb.core.ProgressReporter; 57 import net.sf.basedb.core.Reporter; 58 58 import net.sf.basedb.core.RequestInformation; 59 59 import net.sf.basedb.core.SpotBatcher; … … 63 63 import net.sf.basedb.core.Type; 64 64 import net.sf.basedb.core.User; 65 import net.sf.basedb.core.data.ReporterData; 65 66 import net.sf.basedb.core.plugin.About; 66 67 import net.sf.basedb.core.plugin.AboutImpl; … … 109 110 import java.util.Set; 110 111 import java.util.TreeMap; 111 import java.util.regex.Matcher;112 112 import java.util.regex.Pattern; 113 113 … … 138 138 139 139 /** 140 The plug-in gpermissions.140 The plug-in permissions. 141 141 */ 142 142 private static final Set<Permissions> permissions = new HashSet<Permissions>(); … … 207 207 208 208 /** 209 The reporter fields that should be exported as a tab separ eated string209 The reporter fields that should be exported as a tab separated string 210 210 of column headers. 211 211 */ … … 214 214 /** 215 215 The spot fields that should be exported as a tab separated string of 216 column head res.216 column headers. 217 217 */ 218 218 private PluginParameter<String> usedFieldsParameter; … … 265 265 private int pluginDirectoryId = -1; 266 266 267 /* From InteractivePlugin i terface*/267 /* From InteractivePlugin interface*/ 268 268 269 269 /** … … 273 273 @param context The context from where the plugin is invoked. 274 274 @param item The item that should be checked if it is in context. 275 @return null if the the item is in context, otherwise an error mess ge.275 @return null if the the item is in context, otherwise an error message. 276 276 @see net.sf.basedb.core.plugin.AbstractAnalysisPlugin#isInContext(net.sf.basedb.core.plugin.GuiContext, java.lang.Object) 277 277 */ … … 407 407 storeValue(configuration, request, usedFieldsParameter); 408 408 storeValue(configuration, request, jobParametersParameter); 409 // test the xml in the jobParameters parame res409 // test the xml in the jobParameters parameters 410 410 try 411 411 { … … 448 448 449 449 /** 450 Copies the content from a File to a directory on the file system.450 Copies the content from a File to a directory on the file system. 451 451 452 452 @param f The file to be copied. … … 483 483 // Load existing... 484 484 jobDirectory = Directory.getByPath(dc, path); 485 // ...and remove files and sub directories in it485 // ...and remove files and sub directories in it 486 486 emptyDir(dc, path); 487 487 } … … 503 503 504 504 /** 505 Deletes all files and sub directories under dir.505 Deletes all files and sub directories under dir. 506 506 507 507 @param dir 508 @return Returnes true if all deletions were succssful508 @return true if all deletions were successful 509 509 */ 510 510 private boolean deleteDir(java.io.File dir) … … 527 527 528 528 /** 529 Deletes all files and sub directories under dir. The directory given529 Deletes all files and sub directories under dir. The directory given 530 530 itself is not deleted. 531 531 532 532 @param dc 533 533 @param dir 534 @return Returnes true if all deletions were succssful534 @return true if all deletions were successful 535 535 */ 536 536 private boolean emptyDir(DbControl dc, Path dir) … … 567 567 permissions.add(new Permissions(Item.PLUGINCONFIGURATION, EnumSet.of(Permission.WRITE), null)); 568 568 permissions.add(new Permissions(Item.RAWBIOASSAY, null, EnumSet.of(Permission.READ))); 569 permissions.add(new Permissions(Item.EXTRAVALUETYPE, null, EnumSet.of(Permission.READ))); 569 permissions.add(new Permissions(Item.REPORTER, null, EnumSet.of(Permission.READ))); 570 permissions.add(new Permissions(Item.EXTRAVALUETYPE, null, EnumSet.of(Permission.CREATE, Permission.USE))); 570 571 permissions.add(new Permissions(Item.USER, null, EnumSet.of(Permission.READ))); 571 572 permissions.add(new Permissions(Item.JOB, null, EnumSet.of(Permission.READ))); … … 605 606 { 606 607 DbControl dc = null; 608 File stdin = null; 609 File stdout = null; 610 Transformation trans = null; 607 611 try 608 612 { … … 611 615 getConfigureJobParameters(); 612 616 613 Transformation trans = null;614 File stdin = null;615 617 616 618 //Export … … 653 655 int exitValue = p.waitFor(); 654 656 657 progress.display(50, "Reading from error stream."); 655 658 for(int i = 0; errorStream.isAlive(); ++i) 656 659 { … … 681 684 { 682 685 //Copy files 683 dc.deleteItem(stdin);686 progress.display(60, "Copying files to server."); 684 687 importFiles(dc, trans); 685 688 if (!deleteDir(getExecDirectory())) … … 687 690 response.setError("Could not remove execution directory: "+getExecDirectory().getAbsolutePath(), null); 688 691 } 689 } 690 692 stdout = File.getFile(dc, getPluginDirectory(dc), "stdout.txt", true); 693 } 694 691 695 //Import data 692 696 try 693 697 { 694 698 progress.display(70, "Importing data from plugin."); 695 importData(dc, trans);699 importData(dc, stdout, trans); 696 700 response.setDone(msg); 697 701 } … … 700 704 response.setError(ex.getMessage(), Arrays.asList(ex)); 701 705 return; 706 } 707 } 708 finally 709 { 710 if (dc != null) 711 { 712 dc.commit(); 713 dc.close(); 714 } 715 } 716 717 //Clean up 718 try 719 { 720 dc = sc.newDbControl(); 721 if (!Values.getBoolean(String.valueOf(configuration.getValue(leaveStdinParameter.getName())))) 722 { 723 if (stdin != null) 724 { 725 stdin = File.getById(dc, stdin.getId()); 726 if (trans != null) 727 { 728 trans = Transformation.getById(dc, trans.getId()); 729 AnyToAny ata = AnyToAny.getByName(dc, trans, stdin.getPath().toString()); 730 dc.deleteItem(ata); 731 } 732 dc.deleteItem(stdin); 733 } 734 } 735 if (!Values.getBoolean(String.valueOf(configuration.getValue(leaveStdoutParameter.getName())))) 736 { 737 if (stdout != null) 738 { 739 stdout = File.getById(dc, stdout.getId()); 740 if (trans != null) 741 { 742 trans = Transformation.getById(dc, trans.getId()); 743 AnyToAny ata = AnyToAny.getByName(dc, trans, stdout.getPath().toString()); 744 dc.deleteItem(ata); 745 } 746 dc.deleteItem(stdout); 747 } 702 748 } 703 749 } … … 801 847 Map<String, String> names = new HashMap<String, String>(); 802 848 803 names.put("reporter", "rep.id");804 names.put("reporterId", "rep.externalId");805 806 849 ItemQuery<Formula> queryFormula = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION, 807 850 bas.getRawDataType()); … … 812 855 names.put(f.getName(), "frm."+f.getId()); 813 856 } 857 858 names.put("lastUpdate", "rep.lastUpdate"); 859 names.put("geneName", "rep.name"); 860 names.put("position", "rep.position"); 861 names.put("reporter", "rep.id"); 862 names.put("reporterId", "rep.externalId"); 863 names.put("geneSymbol", "rep.symbol"); 864 865 names.put("rawPosition", "raw.position"); 866 names.put("block", "raw.block"); 867 names.put("numCol", "raw.col"); 868 names.put("numRow", "raw.row"); 869 names.put("x", "raw.x"); 870 names.put("y", "raw.y"); 814 871 815 872 for (ExtraValue ev : bas.getExtraValues().list(dc)) … … 1119 1176 1120 1177 /** 1121 Get the exec directory as a java.io.File. The exec directory is a su directory in1178 Get the exec directory as a java.io.File. The exec directory is a sub directory in 1122 1179 "java.io.tmpdir". 1123 1180 … … 1245 1302 1246 1303 @return The id of the transformation the data is connected to. 1247 @throws IOException if there is any error reading from stdou .txt1248 */ 1249 private int importData(DbControl dc, Transformation t)1304 @throws IOException if there is any error reading from stdout.txt 1305 */ 1306 private int importData(DbControl dc, File stdout, Transformation t) 1250 1307 throws IOException 1251 1308 { 1252 1309 BioAssaySet bas = null; 1253 1310 SpotBatcher spotBatcher = null; 1254 PositionBatcher posBatcher = null;1255 1311 1256 1312 HashMap<String, BioAssay> idMap = new HashMap<String, BioAssay>(); 1257 HashMap<Integer, Integer> posMap = new HashMap<Integer, Integer>();1313 HashMap<Integer, ReporterData> posRepMap = new HashMap<Integer, ReporterData>(); 1258 1314 HashMap<String, ExtraValueType> evtMap = new HashMap<String, ExtraValueType>(); 1259 1315 1260 File stdout = File.getFile(dc, getPluginDirectory(dc), "stdout.txt", true);1261 1316 FlatFileParser ffp = getInitializedFlatFileParser(stdout.getDownloadStream(0)); 1262 1317 … … 1325 1380 } 1326 1381 spotBatcher = bas.getSpotBatcher(); 1327 // posBatcher = bas.getPositionBatcher();1328 1382 1329 1383 for (String assayId : assays) … … 1453 1507 spotBatcher.insert(ba.getDataCubeColumnNo(), position, intensities); 1454 1508 1455 // if (posMap.containsKey(position)) 1456 // { 1457 // if (!posMap.get(position).equals(reporter)) 1458 // throw new BaseException("Invalid data. Position, "+position+", occures twice with different reporter data."); 1459 // 1460 // } 1461 // else 1462 // { 1463 // posMap.put(position, reporter); 1464 // posBatcher.insert(position, Reporter.getById(dc, reporter)); 1465 // } 1509 if (posRepMap.containsKey(position)) 1510 { 1511 if (!reporter.equals(posRepMap.get(position).getId())) 1512 throw new BaseException("Invalid data. Position, "+position+", occurs twice with different reporter data."); 1513 } 1514 else 1515 { 1516 posRepMap.put(position, Reporter.getById(dc, reporter)); 1517 } 1518 1466 1519 for (int i = 0; i < evBatcher.size(); i++) 1467 1520 { … … 1482 1535 } 1483 1536 } 1537 1538 //Batch reporters 1539 if (bas != null) 1540 { 1541 PositionBatcher posBatcher = bas.getPositionBatcher(); 1542 for (Integer position : posRepMap.keySet()) 1543 { 1544 posBatcher.insert(position, posRepMap.get(position)); 1545 } 1546 } 1547 1484 1548 // save bas 1485 1549 if (bas != null) … … 1562 1626 1563 1627 /** 1564 This thread read everything from one input strea tant writes everything to an output stream.1628 This thread read everything from one input stream ant writes everything to an output stream. 1565 1629 1566 1630 @author Johan Enell … … 1580 1644 1581 1645 /** 1582 Creates a steam handler connected to the specifi vstreams.1646 Creates a steam handler connected to the specific streams. 1583 1647 1584 1648 @param is The stream to read from. -
trunk/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java
r3705 r3775 858 858 ExtraValueType evt = ev.getExtraValueType(); 859 859 items.add(new QueryItem("xtra."+evt.getExternalId(), "[Extra] "+evt.getName(), 860 evt.getName(), "xtra('" + evt.getExternalId() + "')", evt.getAverageMethod()));860 "_xc_"+evt.getName(), "xtra('" + evt.getExternalId() + "')", evt.getAverageMethod())); 861 861 } 862 862 Collections.sort(items, new QueryItemTitleComparator()); … … 895 895 { 896 896 List<QueryItem> items = new ArrayList<QueryItem>(); 897 items.add(new QueryItem("raw.position", "[Raw] Position", " position", "raw('position')", Formula.AverageMethod.NONE));897 items.add(new QueryItem("raw.position", "[Raw] Position", "rawPosition", "raw('position')", Formula.AverageMethod.NONE)); 898 898 items.add(new QueryItem("raw.block", "[Raw] Array block", "block", "raw('block')", Formula.AverageMethod.NONE)); 899 899 items.add(new QueryItem("raw.metaGridX", "[Raw] Meta grid X", "metaGridX", "raw('metaGridX')", Formula.AverageMethod.NONE)); … … 918 918 items.add(new QueryItem("rep.position", "Position", "position", "pos()", Formula.AverageMethod.NONE)); 919 919 items.add(new QueryItem("rep.name", "Reporter Name", "name", "rep('name')", Formula.AverageMethod.MAX)); 920 items.add(new QueryItem("rep.externalId", "Reporter ID", " externalId", "rep('externalId')", Formula.AverageMethod.MAX));920 items.add(new QueryItem("rep.externalId", "Reporter ID", "reporterId", "rep('externalId')", Formula.AverageMethod.MAX)); 921 921 items.add(new QueryItem("rep.symbol", "Gene symbol", "symbol", "rep('symbol')", Formula.AverageMethod.MAX)); 922 922 items.add(new QueryItem("rep.description", "Description", "description", "rep('description')", Formula.AverageMethod.MAX)); -
trunk/src/plugins/core/net/sf/basedb/plugins/FormulaFilter.java
r3679 r3775 123 123 } 124 124 /** 125 Request use access to Experiment:s and read access to Job:s .125 Request use access to Experiment:s and read access to Job:s and ReporterLists. 126 126 */ 127 127 public Collection<Permissions> getPermissions() … … 131 131 permissions.add(new Permissions(Item.EXPERIMENT, null, EnumSet.of(Permission.USE))); 132 132 permissions.add(new Permissions(Item.JOB, null, EnumSet.of(Permission.READ))); 133 permissions.add(new Permissions(Item.REPORTERLIST, null, EnumSet.of(Permission.READ))); 133 134 } 134 135 return permissions; -
trunk/www/admin/jobagents/view_agent.jsp
r3675 r3775 341 341 { 342 342 PluginDefinition plugin = null; 343 NameablePluginAdaptor nameableProxy = null; 343 344 boolean readPlugin = true; 344 345 try 345 346 { 346 347 plugin = settings.getPluginDefinition(); 348 nameableProxy = new NameablePluginAdaptor(plugin); 347 349 } 348 350 catch (PermissionDeniedException ex) … … 354 356 %> 355 357 <tbl:row> 356 <tbl:cell column="plugin"><%=Base.getLinkedName(ID, n ew NameablePluginAdaptor(plugin), !readPlugin, true)%></tbl:cell>358 <tbl:cell column="plugin"><%=Base.getLinkedName(ID, nameableProxy, !readPlugin, true)%></tbl:cell> 357 359 <tbl:cell column="jarPath"><%=jarPath == null ? "<i>- internal -</i>" : HTML.encodeTags(jarPath)%></tbl:cell> 358 360 <tbl:cell column="trusted"><%=settings.isEffectivelyTrusted()%></tbl:cell> -
trunk/www/admin/pluginconfigurations/list_configurations.jsp
r3679 r3775 429 429 PluginConfiguration item = configurations.next(); 430 430 PluginDefinition plugin = null; 431 Nameable nameableProxy = null; 431 432 contexts.clear(); 432 433 try 433 434 { 434 435 plugin = item.getPluginDefinition(); 436 nameableProxy = new NameablePluginAdaptor(plugin); 435 437 contexts.addAll(plugin.getGuiContexts()); 436 438 } … … 490 492 <tbl:cell column="pluginType"><%=plugin == null ? "<i>- denied -</i>" : plugin.getMainType().toString()%></tbl:cell> 491 493 <tbl:cell column="contexts"><%=plugin == null ? "<i>- denied -</i>" : (contexts.isEmpty() ? "<i>- none -</i>" : Values.getString(contexts, ", ", true))%></tbl:cell> 492 <tbl:cell column="pluginDefinition"><%=mode.hasPropertyLink() ? Base.getLinkedName(ID, n ew NameablePluginAdaptor(plugin), plugin == null, mode.hasEditLink()): Base.getEncodedName(new NameablePluginAdaptor(plugin), plugin == null)%></a></tbl:cell>494 <tbl:cell column="pluginDefinition"><%=mode.hasPropertyLink() ? Base.getLinkedName(ID, nameableProxy, plugin == null, mode.hasEditLink()): Base.getEncodedName(nameableProxy, plugin == null)%></a></tbl:cell> 493 495 <tbl:cell column="owner" 494 496 ><base:propertyvalue -
trunk/www/admin/pluginconfigurations/view_configuration.jsp
r3679 r3775 97 97 final Set<GuiContext> contexts = new TreeSet<GuiContext>(new ToStringComparator<GuiContext>(false)); 98 98 PluginDefinition plugin = null; 99 Nameable nameableProxy = null; 99 100 boolean readPlugin = true; 100 101 boolean configurable = false; … … 102 103 { 103 104 plugin = configuration.getPluginDefinition(); 105 nameableProxy = new NameablePluginAdaptor(plugin); 104 106 contexts.addAll(plugin.getGuiContexts()); 105 107 configurable = plugin.isInteractive() && plugin.supportsConfigurations(); … … 265 267 <td class="prompt">Plugin</td> 266 268 <td> 267 <%=Base.getLinkedName(ID, n ew NameablePluginAdaptor(plugin), plugin == null, true)%>269 <%=Base.getLinkedName(ID, nameableProxy, plugin == null, true)%> 268 270 </td> 269 271 </tr> -
trunk/www/common/import/no_fileformat.jsp
r3675 r3775 71 71 "mainType", Operator.EQ, String.valueOf(Plugin.MainType.IMPORT.getValue()), Type.INT)); 72 72 pluginContext.setPropertyFilter(new PropertyFilter( 73 " guiContexts.itemType", Operator.EQ, String.valueOf(itemType.getValue()), Type.INT));73 "$ctx.itemType", Operator.EQ, String.valueOf(itemType.getValue()), Type.INT)); 74 74 try 75 75 { -
trunk/www/exception/exception.jsp
r3725 r3775 204 204 StackTraceElement[] st = ex.getStackTrace(); 205 205 out.println("<pre>"); 206 out.println(exceptionClassName); 206 207 int i = 0; 207 208 for (i=0; i < st.length && i < 8; i++) 208 209 { 209 210 out.print("...at "); 210 out.println( st[i].toString().replaceAll("net.sf.basedb.core.", ""));211 out.println(HTML.encodeTags(st[i].toString().replaceAll("net.sf.basedb.core.", ""))); 211 212 } 212 213 out.println("</pre>"); … … 219 220 { 220 221 out.print("...at "); 221 out.println( st[j].toString().replaceAll("net.sf.basedb.core.", ""));222 out.println(HTML.encodeTags(st[j].toString().replaceAll("net.sf.basedb.core.", ""))); 222 223 } 223 224 ex = ex.getCause(); -
trunk/www/lims/arraydesigns/features/index.jsp
r3679 r3775 35 35 import="net.sf.basedb.core.Permission" 36 36 import="net.sf.basedb.core.PermissionDeniedException" 37 import="net.sf.basedb.core.ArrayDesign" 38 import="net.sf.basedb.core.data.FeatureData" 37 39 import="net.sf.basedb.clients.web.Base" 38 40 import="net.sf.basedb.clients.web.WebException" … … 89 91 forward = viewPage; 90 92 } 93 else if ("ExportItems".equals(cmd)) 94 { 95 // Run an export plugin in a list context 96 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 97 dc = sc.newDbControl(); 98 final ArrayDesign arrayDesign = ArrayDesign.getById(dc, arrayDesignId); 99 final DataQuery<FeatureData> query = arrayDesign.getFeatures(); 100 cc.configureQuery(query, true); 101 cc.setQuery(query); 102 redirect = "../../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+features+of+array+design"; 103 } 91 104 else 92 105 {
Note: See TracChangeset
for help on using the changeset viewer.