Changeset 3850
- Timestamp:
- Oct 17, 2007, 8:45:22 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/common-queries.xml
r3820 r3850 2943 2943 </query> 2944 2944 2945 <query id="GET_PROJECTS_WITH_DEFAULT" type="HQL"> 2946 <sql> 2947 SELECT prj 2948 FROM ProjectData prj 2949 WHERE prj.projectDefaults[:name] = :value 2950 </sql> 2951 <description> 2952 A HQL query that loads all projects which has a given default value 2953 for a setting. 2954 </description> 2955 </query> 2956 2945 2957 2946 2958 </predefined-queries> -
trunk/src/core/net/sf/basedb/core/Update.java
r3820 r3850 51 51 import net.sf.basedb.core.data.PluginConfigurationData; 52 52 import net.sf.basedb.core.data.PluginDefinitionData; 53 import net.sf.basedb.core.data.ProjectData; 53 54 import net.sf.basedb.core.data.RawBioAssayData; 54 55 import net.sf.basedb.core.data.SchemaVersionData; … … 1663 1664 <li>Set a platform for array designs and raw bioassays 1664 1665 <li>Change experiment raw data type if it is "affymetrix" to "platform.affymetrix" 1666 <li>Change project default raw data type if it is "affymetrix" to "platform.affymetrix" 1665 1667 <li>Move CEL and CDF files into FileSet:s 1666 1668 <li>Remove filters on ArrayDesign.isAffyChip property … … 1772 1774 query.setString("newRawDataType", affyRaw.getId()); 1773 1775 HibernateUtil.executeUpdate(query); 1774 1776 1777 // Change raw data type for 'affymetrix' projects to 'platform.affymetrix' 1778 query = HibernateUtil.getPredefinedQuery(session, 1779 "GET_PROJECTS_WITH_DEFAULT"); 1780 /** 1781 SELECT prj 1782 FROM ProjectData prj 1783 WHERE prj.projectDefaults[:name] = :value 1784 */ 1785 query.setString("name", "raw_data_type"); 1786 query.setString("value", "affymetrix"); 1787 List<ProjectData> projects = HibernateUtil.loadList(ProjectData.class, query); 1788 for (ProjectData project : projects) 1789 { 1790 Project p = dc.getItem(Project.class, project); 1791 p.setDefaultRawDataType(affyRaw); 1792 p.setDefaultItem(dc, affymetrix, Project.Default.PLATFORM); 1793 } 1794 1775 1795 // Update property filters on 'rawDataType=affymetrix' to 'platform.affymetrix' 1776 1796 query = HibernateUtil.getPredefinedSQLQuery(session, -
trunk/www/my_base/projects/edit_project.jsp
r3848 r3850 110 110 Platform currentPlatform = null; 111 111 PlatformVariant currentVariant = null; 112 RawDataType currentRawDataType = null; 112 113 113 114 if (itemId == 0) … … 121 122 cc.setObject("item", project); 122 123 title = "Edit project -- " + HTML.encodeTags(project.getName()); 124 currentRawDataType = project.getDefaultRawDataType(); 123 125 124 126 try … … 126 128 currentPlatform = (Platform)project.getDefaultItem(dc, Project.Default.PLATFORM); 127 129 currentVariant = (PlatformVariant)project.getDefaultItem(dc, Project.Default.PLATFORM_VARIANT); 130 if (currentRawDataType != null) 131 { 132 if (currentPlatform == null) currentPlatform = currentRawDataType.getPlatform(dc); 133 if (currentVariant == null) currentVariant = currentRawDataType.getVariant(dc); 134 } 128 135 } 129 136 catch (PermissionDeniedException ex) … … 131 138 deniedPlatform = true; 132 139 } 140 141 if (currentRawDataType == null && currentVariant != null) currentRawDataType = currentVariant.getRawDataType(); 142 if (currentRawDataType == null && currentPlatform != null) currentRawDataType = currentPlatform.getRawDataType(); 143 if (currentRawDataType == null) currentRawDataType = project.getDefaultRawDataType(); 133 144 134 145 groupQuery = project.getGroups(); … … 141 152 throw new PermissionDeniedException(Permission.WRITE, itemType.toString()); 142 153 } 143 RawDataType currentRawDataType = project != null ?144 project.getDefaultRawDataType() : null;145 154 146 155 ItemQuery<Platform> platformQuery = Platform.getQuery();
Note: See TracChangeset
for help on using the changeset viewer.