Changeset 6315
- Timestamp:
- Sep 6, 2013, 1:55:09 PM (9 years ago)
- Location:
- trunk/www
- Files:
-
- 16 added
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/admin/users/index.jsp
r6291 r6315 263 263 String name = ep.getName(); 264 264 Formatter formatter = FormatterFactory.getExtendedPropertyFormatter(sc, ep); 265 Object value = formatter.parseString(Values.getStringOrNull(request.getParameter( name)));265 Object value = formatter.parseString(Values.getStringOrNull(request.getParameter("ep."+name))); 266 266 user.setExtended(name, value); 267 267 } -
trunk/www/admin/users/users.js
r6291 r6315 26 26 { 27 27 var users = {}; 28 var extendedProperties; 28 29 29 30 /** … … 44 45 45 46 // Extended properties 46 var pageData = document.getElementById('page-data'); 47 extendedProperties = Data.json(pageData, 'extended-properties'); 47 extendedProperties = Data.json('page-data', 'extended-properties'); 48 48 for (var i = 0; i < extendedProperties.length; i++) 49 49 { … … 147 147 { 148 148 var frm = document.forms['user']; 149 var pageData = document.getElementById('page-data'); 150 var dateFormat = Data.get(pageData, 'date-format'); 151 var dateTimeFormat = Data.get(pageData, 'datetime-format'); 149 var dateFormat = Data.get('page-data', 'date-format'); 150 var dateTimeFormat = Data.get('page-data', 'datetime-format'); 152 151 153 152 for (var i = 0; i < extendedProperties.length; i++) -
trunk/www/filemanager/index.jsp
r6308 r6315 95 95 else if ("ShareItem".equals(cmd)) 96 96 { 97 redirect = "files 2/index.jsp?ID="+ID+"&cmd=ShareItem&item_id="+request.getParameter("item_id");97 redirect = "files/index.jsp?ID="+ID+"&cmd=ShareItem&item_id="+request.getParameter("item_id"); 98 98 } 99 99 else if ("ViewFile".equals(cmd)) -
trunk/www/include/scripts/main-2.js
r6314 r6315 885 885 plug-in type to select should be specified by the 886 886 'data-plugin-type' attribute. Valid values are 'IMPORT' 887 'EXPORT' and 'OTHER'. Usually attached to a button887 'EXPORT', 'ANALYZE' and 'OTHER'. Usually attached to a button 888 888 on a single-item page. 889 889 */ … … 894 894 var itemId = Data.int(target, 'item-id'); 895 895 var pluginType = Data.get(target, 'plugin-type'); 896 Items.runPlugin(itemType, itemId, pluginType); 896 var extraUrl = Data.get(target, 'extra-url'); 897 var cmd = Data.get(target, 'cmd'); 898 Items.runPlugin(itemType, itemId, pluginType, extraUrl, cmd); 897 899 } 898 900 … … 902 904 'data-table-id' attribute. The plug-in type to select 903 905 should be specified by the 'data-plugin-type' attribute. 904 Valid values are 'IMPORT' 'EXPORT' and 'OTHER'. Usually905 attached to a button on a list page.906 Valid values are 'IMPORT' 'EXPORT', 'ANALYZE' and 'OTHER'. 907 Usually attached to a button on a list page. 906 908 */ 907 909 buttons.runListPlugin = function(event) … … 910 912 var tableId = Data.get(target, 'table-id'); 911 913 var pluginType = Data.get(target, 'plugin-type'); 912 Table.runPlugin(tableId, pluginType); 914 var cmd = Data.get(target, 'cmd'); 915 Table.runPlugin(tableId, pluginType, cmd); 913 916 } 914 917 … … 923 926 var target = event.currentTarget; 924 927 var tableId = Data.get(target, 'table-id'); 925 Table.configureColumns(tableId); 928 var settings = Data.get(target, 'settings'); 929 Table.configureColumns(tableId, settings); 926 930 } 927 931 … … 1155 1159 dialogs.selectItem = function(itemType, callback, multiple, extraUrl) 1156 1160 { 1161 var width = 1050; 1162 var height = 700; 1157 1163 var controller = Main.getController(itemType); 1158 1164 var url = App.getRoot() + controller.url; … … 1162 1168 url += '&cmd=' + (multiple ? 'SelectMultiple' : 'SelectOne'); 1163 1169 } 1170 else if (itemType == 'DIRECTORY') 1171 { 1172 url += '&mode=' + (multiple ? 'selectmultipledirectory' : 'selectonedirectory'); 1173 width = 350; 1174 height = 500; 1175 } 1164 1176 else 1165 1177 { … … 1175 1187 if (extraUrl) url += extraUrl; 1176 1188 1177 dialogs.openPopup(url, 'Select'+itemType, 1050, 700);1189 dialogs.openPopup(url, 'Select'+itemType, width, height); 1178 1190 } 1179 1191 … … 1384 1396 @param itemType The current item type 1385 1397 @param itemId The id of the current item 1386 @param pluginType One of: IMPORT, EXPORT or OTHER (default) 1387 */ 1388 items.runPlugin = function(itemType, itemId, pluginType, extraUrl) 1389 { 1390 var cmd = 'RunPlugin'; 1391 if (pluginType == 'EXPORT') 1392 { 1393 cmd = 'ExportItem'; 1394 } 1395 else if (pluginType == 'IMPORT') 1396 { 1397 cmd = 'ImportItem'; 1398 @param pluginType One of: IMPORT, EXPORT, ANALYZE or OTHER (default) 1399 */ 1400 items.runPlugin = function(itemType, itemId, pluginType, extraUrl, cmd) 1401 { 1402 if (!cmd) 1403 { 1404 if (pluginType == 'EXPORT') 1405 { 1406 cmd = 'ExportItem'; 1407 } 1408 else if (pluginType == 'IMPORT') 1409 { 1410 cmd = 'ImportItem'; 1411 } 1412 else if (pluginType == 'ANALYZE') 1413 { 1414 cmd = 'RunAnalysisPlugin'; 1415 } 1416 else 1417 { 1418 cmd = 'RunPlugin'; 1419 } 1398 1420 } 1399 1421 internal.itemCommand(cmd, itemType, itemId, extraUrl, {width: 750, height: 500}); -
trunk/www/include/scripts/main.js
r6308 r6315 489 489 this.controllers['ARRAYSLIDE'] = { url:'lims/arrayslides/index.jsp', width:750, height:500 }; 490 490 this.controllers['BIOASSAY'] = { url:'views/experiments/bioassays/index.jsp', width:600, height:400, noAnyToAny:true }; 491 this.controllers['BIOASSAYSET'] = { url:'views/experiments/bioassaysets/index.jsp', width: 600, height:400, noAnyToAny:true };491 this.controllers['BIOASSAYSET'] = { url:'views/experiments/bioassaysets/index.jsp', width:750, height:500, noAnyToAny:true }; 492 492 this.controllers['BIOMATERIALEVENT'] = { url:'biomaterials/events/index.jsp', width:600, height:400, noAnyToAny:true }; 493 493 this.controllers['BIOMATERIALLIST'] = { url:'biomaterials/lists/index.jsp', width:600, height:400 }; -
trunk/www/include/scripts/tabcontrol-2.js
r6261 r6315 45 45 if (!switchFunction || !switchFunction.call) return; // 'switchFunction' is not a function 46 46 tabControl = Doc.element(tabControl); 47 if (!tabControl) return; 47 48 tabControl.switchFunction = switchFunction; 48 49 } … … 59 60 switch, form submission, etc) is cancelled. 60 61 */ 61 tc.addTabValidator = function(tab, validator )62 tc.addTabValidator = function(tab, validator, attributes) 62 63 { 63 64 if (!validator || !validator.call) return; // 'validator' is not a function 64 65 tab = Doc.element(tab); 66 if (!tab) return; 67 if (attributes) Data.define(tab, attributes); 65 68 tab.addEventListener('base-validate', 66 69 function(event) … … 77 80 has been activated. 78 81 */ 79 tc.addTabActivateListener = function(tab, listener )82 tc.addTabActivateListener = function(tab, listener, attributes) 80 83 { 81 84 if (!listener || !listener.call) return; // 'listener' is not a function 82 85 tab = Doc.element(tab); 86 if (!tab) return; 87 if (attributes) Data.define(tab, attributes); 83 88 tab.addEventListener('base-activate', listener, false); 84 89 } … … 96 101 { 97 102 tab = Doc.element(tab); 103 if (!tab) return; 98 104 var tabControl = internal.tabControl(tab); 99 105 -
trunk/www/include/scripts/table.js
r6308 r6315 605 605 current list context 606 606 @param tableDiv The ID or main table element 607 @param pluginType One of: IMPORT, EXPORT or OTHER (default) 608 */ 609 table.runPlugin = function(tableDiv, pluginType) 610 { 611 var cmd = 'RunListPlugin'; 612 if (pluginType == 'EXPORT') 613 { 614 cmd = 'ExportItems'; 615 } 616 else if (pluginType == 'IMPORT') 617 { 618 cmd = 'ImportItems'; 607 @param pluginType One of: IMPORT, EXPORT, ANALYZE or OTHER (default) 608 @param cmd Override the default command for running the plugin 609 */ 610 table.runPlugin = function(tableDiv, pluginType, cmd) 611 { 612 if (!cmd) 613 { 614 if (pluginType == 'EXPORT') 615 { 616 cmd = 'ExportItems'; 617 } 618 else if (pluginType == 'IMPORT') 619 { 620 cmd = 'ImportItems'; 621 } 622 else if (pluginType == 'ANALYZE') 623 { 624 cmd = 'RunListAnalysisPlugin'; 625 } 626 else 627 { 628 cmd = 'RunListPlugin'; 629 } 619 630 } 620 631 table.submitToPopup(tableDiv, cmd, 750, 500); -
trunk/www/views/derivedbioassays/view_bioassay.jsp
r6311 r6315 265 265 id="btnRunAnalysisPlugin" 266 266 image="runplugin.png" 267 data-plugin-type="ANALY SIS"267 data-plugin-type="ANALYZE" 268 268 title="Run analysis…" 269 269 tooltip="Run an analysis plugin with data from this bioassay" -
trunk/www/views/experiments/bioassays/edit_bioassay.jsp
r6254 r6315 58 58 { 59 59 BioAssay bioAssay = BioAssay.getById(dc, itemId); 60 60 bioAssay.checkPermission(Permission.WRITE); 61 61 62 cc.setObject("item", bioAssay); 62 63 String title = "Edit bioassay -- " + HTML.encodeTags(bioAssay.getName()); 63 if (bioAssay != null) bioAssay.checkPermission(Permission.WRITE);64 65 64 66 65 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), bioAssay); 67 66 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 68 67 %> 69 <base:page type="popup" title="<%=title%>" >70 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">68 <base:page type="popup" title="<%=title%>" id="edit-page"> 69 <base:head scripts="tabcontrol-2.js,~bioassays.js" styles="tabcontrol.css"> 71 70 <ext:scripts context="<%=jspContext%>" /> 72 71 <ext:stylesheets context="<%=jspContext%>" /> 73 <script>74 // Validate the "BioAssay" tab75 function validateBioAssay()76 {77 var frm = document.forms['bioAssay'];78 if (Main.trimString(frm.name.value) == '')79 {80 Forms.showNotification(frm.name, 'You must enter a name');81 return false;82 }83 return true;84 }85 86 // Submit the form87 function saveSettings()88 {89 var frm = document.forms['bioAssay'];90 if (TabControl.validateActiveTab('settings'))91 {92 Annotations.saveModifiedAnnotationsToForm(frm);93 Annotations.saveInheritedAnnotationsToForm(frm);94 frm.submit();95 }96 }97 98 function loadAnnotationsFrame()99 {100 Annotations.autoLoadEditFrame();101 }102 103 function loadInheritedAnnotationsFrame()104 {105 Annotations.autoLoadInheritFrame();106 }107 function init()108 {109 var frm = document.forms['bioAssay'];110 <%111 if (bioAssay == null)112 {113 %>114 frm.name.focus();115 frm.name.select();116 <%117 }118 %>119 }120 </script>121 72 </base:head> 122 <base:body onload="init()">73 <base:body> 123 74 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 124 75 <form action="index.jsp?ID=<%=ID%>" method="post" name="bioAssay"> … … 129 80 position="bottom" remember="<%=bioAssay != null%>" 130 81 extensions="<%=invoker%>"> 131 <t:tab id="info" title="Bioassay" validate="validateBioAssay()"helpid="bioassay.edit">82 <t:tab id="info" title="Bioassay" helpid="bioassay.edit"> 132 83 <table class="fullform input100"> 133 84 <tr> 134 85 <th>Name</th> 135 <td><input class="text required" type="text" name="name" 136 value="<%=HTML.encodeTags(bioAssay == null ? Values.getString(cc.getPropertyValue("name"), "New bioassay") : bioAssay.getName())%>" 86 <td><input class="text required auto-init" data-auto-init="focus" 87 type="text" name="name" 88 value="<%=HTML.encodeTags(bioAssay.getName())%>" 137 89 maxlength="<%=BioAssay.MAX_NAME_LENGTH%>"></td> 138 90 <td></td> … … 142 94 <td> 143 95 <textarea class="text" rows="6" name="description" id="description" 144 ><%=HTML.encodeTags(bioAssay == null ? cc.getPropertyValue("description") : bioAssay.getDescription())%></textarea>96 ><%=HTML.encodeTags(bioAssay.getDescription())%></textarea> 145 97 </td> 146 98 <td style="width: 20px;"> … … 150 102 </table> 151 103 </t:tab> 152 <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">104 <t:tab id="annotations" title="Annotations" helpid="annotations.edit"> 153 105 <jsp:include page="../../../common/annotations/annotate_frameset.jsp"> 154 106 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 159 111 160 112 <t:tab id="inheritedAnnotations" title="Inherited annotations" 161 helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">113 helpid="annotations.edit.inherited"> 162 114 <jsp:include page="../../../common/annotations/inherit_frameset.jsp"> 163 115 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 174 126 175 127 <base:buttongroup subclass="dialogbuttons"> 176 <base:button onclick="saveSettings()" title="Save" />177 <base:button onclick="window.close()" title="Cancel" />128 <base:button id="btnSave" title="Save" /> 129 <base:button id="close" title="Cancel" /> 178 130 </base:buttongroup> 179 131 </base:body> -
trunk/www/views/experiments/bioassays/list_bioassays.jsp
r6221 r6315 140 140 "net.sf.basedb.clients.web.bioassayset.overviewplots"); 141 141 %> 142 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" >143 <base:head scripts="table.js,tabcontrol .js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">142 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" id="list-page"> 143 <base:head scripts="table.js,tabcontrol-2.js,~bioassays.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 144 144 <ext:scripts context="<%=jspContext%>" /> 145 145 <ext:stylesheets context="<%=jspContext%>" /> 146 <script>147 var submitPage = 'index.jsp';148 var formId = 'bioAssaySets';149 function editItem(itemId)150 {151 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);152 }153 function viewItem(itemId)154 {155 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);156 }157 function itemOnClick(evt, itemId)158 {159 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);160 }161 function configureColumns()162 {163 Table.configureColumns(formId);164 }165 function runPlugin(cmd)166 {167 Table.submitToPopup(formId, cmd, 750, 500);168 }169 function returnSelected()170 {171 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);172 window.close();173 }174 function switchTab(tabControlId, tabId)175 {176 if (tabId == 'properties' || tabId == 'overviewplots' || tabId == 'annotations')177 {178 location.href = '../bioassaysets/index.jsp?ID=<%=ID%>&cmd=ViewItem&experiment_id=<%=experiment.getId()%>&item_id=<%=bioAssaySetId%>&tab='+tabId;179 }180 else if (tabId == 'spotdata')181 {182 location.href = '../spotdata/index.jsp?ID=<%=ID%>&experiment_id=<%=experimentId%>&bioassayset_id=<%=bioAssaySetId%>';183 }184 else185 {186 TabControl.setActiveTab(tabControlId, tabId);187 }188 }189 function openPlotTool(bioAssayId)190 {191 Main.openPopup('../plotter/index.jsp?ID=<%=ID%>&bioassay_id='+bioAssayId, 'Plotter', 1050, 700);192 }193 function viewSpotData(bioAssayId)194 {195 location.href = '../spotdata/index.jsp?ID=<%=ID%>&bioassay_id='+bioAssayId;196 }197 </script>198 146 </base:head> 199 200 147 <base:body> 201 148 <% … … 221 168 id="main" 222 169 subclass="mastertabcontrol content" 223 active="bioassays" switch="switchTab">224 <t:tab id=" properties" title="Properties" />170 active="bioassays" notabs="<%=mode.isSelectionMode() %>"> 171 <t:tab id="bioassayset.properties" title="Properties" /> 225 172 226 <t:tab id=" annotations" title="Annotations"173 <t:tab id="bioassayset.annotations" title="Annotations" 227 174 tooltip="View annotation values" /> 228 175 229 176 <t:tab id="bioassays" title="Bioassays"> 230 177 <tbl:table 231 id="bio AssaySets"178 id="bioassays" 232 179 columns="<%=cc.getSetting("columns")%>" 233 180 sortby="<%=cc.getSortProperty()%>" … … 378 325 > 379 326 <tbl:button 327 id="btnColumns" 380 328 image="columns.png" 381 onclick="configureColumns()"382 329 title="Columns…" 383 330 tooltip="Show, hide and re-order columns" 384 331 /> 385 332 <tbl:button 333 id="btnImport" 334 data-plugin-type="IMPORT" 386 335 image="import.png" 387 onclick="runPlugin('ImportItems')"388 336 title="Import…" 389 337 tooltip="Import data" … … 391 339 /> 392 340 <tbl:button 341 id="btnExport" 342 data-plugin-type="EXPORT" 393 343 image="export.png" 394 onclick="runPlugin('ExportItems')"395 344 title="Export…" 396 345 tooltip="Export data" … … 398 347 /> 399 348 <tbl:button 349 id="btnFilter" 350 data-plugin-type="ANALYZE" 351 data-cmd="NewFilteredBioAssaySet" 400 352 disabled="<%=!createPermission%>" 401 353 image="filter.png" 402 onclick="<%="runPlugin('NewFilteredBioAssaySet')"%>"403 354 title="Filter bioassay set…" 404 355 tooltip="<%=createPermission ? … … 408 359 /> 409 360 <tbl:button 361 id="btnRunPlugin" 362 data-plugin-type="OTHER" 410 363 image="runplugin.png" 411 onclick="runPlugin('RunListPlugin')"412 364 title="Run plugin…" 413 365 tooltip="Run a plugin" … … 415 367 /> 416 368 <tbl:button 369 id="btnAnalyze" 370 data-plugin-type="ANALYZE" 417 371 disabled="<%=!createPermission%>" 418 372 image="runplugin.png" 419 onclick="<%="runPlugin('RunListAnalysisPlugin')"%>"420 373 title="Run analysis…" 421 374 tooltip="<%=createPermission ? "Run an analysis plugin" : … … 518 471 visible="<%=mode.hasIcons()%>" 519 472 > </tbl:header> 520 <tbl:cell column="name"><div class="link" 521 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 473 <tbl:cell column="name"><div 474 class="link table-item" 475 data-item-id="<%=itemId%>" 476 data-no-edit="<%=writePermission ? 0 : 1 %>" 477 tabindex="0" 522 478 title="<%=tooltip%>"><%=name%></div></tbl:cell> 523 479 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 590 546 { 591 547 %> 592 <base:icon image="plotter.png" 593 onclick="<%="openPlotTool("+itemId+")" %>" 548 <base:icon 549 subclass="link auto-init" 550 data-auto-init="plotter" 551 data-item-id="<%=itemId %>" 552 image="plotter.png" 594 553 tooltip="A simple plot tool" 595 554 /> 596 <base:icon image="table.png" 597 onclick="<%="viewSpotData("+itemId+")" %>" 555 <base:icon 556 subclass="link auto-init" 557 data-auto-init="spotdata" 558 data-item-id="<%=itemId %>" 559 image="table.png" 598 560 tooltip="View spot data as a table" 599 561 /> … … 624 586 <t:tab id="spotdata" title="Spot data" visible="<%=hasDbSpots%>" /> 625 587 626 <t:tab id=" overviewplots" title="Overview plots"588 <t:tab id="bioassayset.overviewplots" title="Overview plots" 627 589 visible="<%=overviewPlotInvoker.getNumExtensions() > 0%>" /> 628 590 </t:tabcontrol> 629 591 630 592 <base:buttongroup subclass="dialogbuttons"> 631 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />632 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />633 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />593 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 594 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 595 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 634 596 </base:buttongroup> 635 597 -
trunk/www/views/experiments/bioassays/view_bioassay.jsp
r6255 r6315 93 93 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); 94 94 %> 95 <base:page title="<%=title%>" >96 <base:head scripts="table.js,tabcontrol .js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">95 <base:page title="<%=title%>" id="view-page"> 96 <base:head scripts="table.js,tabcontrol-2.js,~bioassays.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 97 97 <ext:scripts context="<%=jspContext%>" /> 98 98 <ext:stylesheets context="<%=jspContext%>" /> 99 <script>100 function editItem()101 {102 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);103 }104 function runPlugin(cmd)105 {106 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 750, 500);107 }108 function switchTab(tabControlId, tabId)109 {110 if (tabId == 'spotdata')111 {112 location.href = "../spotdata/index.jsp?ID=<%=ID%>&bioassay_id=<%=itemId%>";113 }114 else115 {116 TabControl.setActiveTab(tabControlId, tabId);117 }118 }119 function openPlotTool()120 {121 Main.openPopup('../plotter/index.jsp?ID=<%=ID%>&bioassay_id=<%=itemId%>', 'Plotter', 1050, 700);122 }123 </script>124 99 </base:head> 125 100 <base:body> … … 132 107 /><p:pathelement title="<%=HTML.encodeTags(bioAssay.getName())%>" 133 108 /></p:path> 109 <div id="page-data" data-item-id="<%=itemId%>"></div> 134 110 135 111 <t:tabcontrol 136 112 id="main" 137 113 subclass="content mastertabcontrol" 138 active="<%=tabId%>" switch="switchTab">114 active="<%=tabId%>"> 139 115 <t:tab id="properties" title="Properties"> 140 116 <div> … … 146 122 <tbl:toolbar subclass="bottomborder"> 147 123 <tbl:button 124 id="btnEdit" 148 125 disabled="<%=!writePermission%>" 149 126 image="edit.png" 150 onclick="editItem()"151 127 title="Edit…" 152 128 tooltip="<%=writePermission ? "Edit this bioassay" : "You do not have permission to edit this bioassay"%>" 153 129 /> 154 130 <tbl:button 131 id="btnImport" 155 132 image="import.png" 156 onclick="runPlugin('ImportItem')"133 data-plugin-type="IMPORT" 157 134 title="Import…" 158 135 tooltip="Import data" … … 160 137 /> 161 138 <tbl:button 162 image="export.png" 163 onclick="runPlugin('ExportItem')" 139 id="btnExport" 140 image="export.png" 141 data-plugin-type="EXPORT" 164 142 title="Export…" 165 143 tooltip="Export data" … … 167 145 /> 168 146 <tbl:button 169 image="runplugin.png" 170 onclick="runPlugin('RunPlugin')" 147 id="btnRunPlugin" 148 image="runplugin.png" 149 data-plugin-type="OTHER" 171 150 title="Run plugin…" 172 151 tooltip="Run a plugin" … … 174 153 /> 175 154 <tbl:button 155 id="btnPlotter" 176 156 image="plotter.png" 177 onclick="openPlotTool()"178 157 title="Plot tool…" 179 158 tooltip="A simple tool for generating plots" … … 184 163 <tbl:button 185 164 image="help.png" 186 onclick="<%="Main.openHelp('" + ID +"', 'bioassay.view.properties')"%>" 165 subclass="auto-init" 166 data-auto-init="help" 167 data-help-id="bioassay.view.properties" 187 168 title="Help…" 188 169 tooltip="Get help about this page" … … 356 337 357 338 <t:tab id="annotations" title="Annotations" 358 tooltip="View annotation values" clazz="white" 359 activate="AnnotationsList.loadOnce()"> 339 tooltip="View annotation values" clazz="white"> 360 340 <jsp:include page="../../../common/annotations/list_frameset.jsp"> 361 341 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 365 345 </t:tab> 366 346 367 <t:tab id="spotdata" title="Spot data" visible="<%=hasDbSpots%>" /> 347 <t:tab id="spotdata" title="Spot data" visible="<%=hasDbSpots%>"> 348 <div class="filled absolutefull"> 349 <table style="margin: auto; height: 100%;"><tr><td> 350 <b>Please wait. The spot data is loading...</b> 351 </td></tr></table> 352 </div> 353 </t:tab> 368 354 </t:tabcontrol> 369 355 -
trunk/www/views/experiments/bioassaysets/analysis_tree.jsp
r6221 r6315 292 292 <ext:scripts context="<%=jspContext%>" /> 293 293 <ext:stylesheets context="<%=jspContext%>" /> 294 <script type="text/javascript" charset="UTF-8" src="<%=rootPath%>views/experiments/bioassaysets/analysis_tree.js"></script> 295 <div id="tree-data" class="datacontainer" 296 data-experiment-id="<%=experimentId%>" 297 data-bioassayset-id="<%=bioAssaySetId%>" 298 data-transformation-id="<%=transformationId %>" 299 ></div> 294 300 <script> 295 301 var submitPage = '<%=transformationId != 0 ? "../bioassaysets/index.jsp" : "index.jsp"%>'; 296 302 var formId = 'bioAssaySets'; 297 function newItem() 298 { 299 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=NewItem&experiment_id=<%=experimentId%>', 'NewBioAssaySet', 750, 500); 300 } 301 function editBioAssaySet(itemId) 302 { 303 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true); 304 } 305 function viewBioAssaySet(itemId) 306 { 307 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false); 308 } 309 function bioAssaySetOnClick(evt, itemId) 310 { 311 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewBioAssaySet, editBioAssaySet, returnSelected); 312 } 313 function viewTransformation(itemId) 314 { 315 Main.viewOrEditItem('<%=ID%>', 'TRANSFORMATION', itemId, false); 316 } 317 function editTransformation(itemId) 318 { 319 Main.viewOrEditItem('<%=ID%>', 'TRANSFORMATION', itemId, true); 320 } 321 function transformationOnClick(evt, itemId) 322 { 323 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewTransformation, editTransformation, returnSelected); 324 } 325 function viewExtraValue(itemId) 326 { 327 Main.viewOrEditItem('<%=ID%>', 'EXTRAVALUE', itemId, false); 328 } 329 function editExtraValue(itemId) 330 { 331 Main.viewOrEditItem('<%=ID%>', 'EXTRAVALUE', itemId, true); 332 } 333 function extraValueOnClick(evt, itemId) 334 { 335 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewExtraValue, editExtraValue, returnSelected); 336 } 337 function deleteItems() 338 { 339 var frm = document.forms[formId]; 340 if (Forms.numChecked(frm) == 0) 341 { 342 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left'); 343 return; 344 } 345 if (Forms.numChecked(frm, /^X:/) > 0) 346 { 347 if (!confirm('Extra values are deleted immediately and cannot be restored. Do you want to continue?')) 348 { 349 return; 350 } 351 } 352 frm.action = submitPage; 353 frm.cmd.value = 'DeleteItems'; 354 frm.submit(); 355 } 356 function restoreItems() 357 { 358 var frm = document.forms[formId]; 359 if (Forms.numChecked(frm) == 0) 360 { 361 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left'); 362 return; 363 } 364 frm.action = submitPage; 365 frm.cmd.value = 'RestoreItems'; 366 frm.submit(); 367 } 368 function deleteItemPermanently(itemType, itemId) 369 { 370 Main.deleteItemPermanently('<%=ID%>', true, itemType, itemId); 371 } 372 function configureColumns() 373 { 374 Table.configureColumns(formId); 375 } 376 function runPlugin(cmd) 377 { 378 Table.submitToPopup(formId, cmd, 750, 500); 379 } 380 function filter(itemId) 381 { 382 Main.openPopup('../bioassaysets/index.jsp?ID=<%=ID%>&cmd=NewFilteredBioAssaySet&experiment_id=<%=experimentId%>&item_id='+itemId, 'FilterBioAssaySet', 750, 500); 383 } 384 function openPlotTool(itemId) 385 { 386 Main.openPopup('../plotter/index.jsp?ID=<%=ID%>&bioassayset_id='+itemId, 'Plotter', 1050, 700); 387 } 388 function openExperimentExplorer(itemId) 389 { 390 location.href = '../explorer/view/index.jsp?ID=<%=ID%>&bioassayset_id='+itemId; 391 } 392 function runAnalysisPlugin(itemId) 393 { 394 Main.openPopup('../bioassaysets/index.jsp?ID=<%=ID%>&cmd=RunAnalysisPlugin&experiment_id=<%=experimentId%>&item_id='+itemId, 'RunPlugin', 750, 500); 395 } 396 function runExportPlugin(itemId) 397 { 398 Main.openPopup('../bioassaysets/index.jsp?ID=<%=ID%>&cmd=ExportItem&experiment_id=<%=experimentId%>&item_id='+itemId, 'Export', 750, 500); 399 } 400 function copyJob(jobId) 401 { 402 var url = '../../../common/plugin/index.jsp?ID=<%=ID%>'; 403 url += '&cmd=CopyJob&job_id='+jobId; 404 url += '&item_type=BIOASSAYSET&context_type=LIST' 405 Main.openPopup(url, 'CopyJob', 750, 500); 406 } 407 function returnSelected() 408 { 409 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>); 410 window.close(); 411 } 412 303 413 304 function sendClosedWithAjax() 414 305 { … … 685 576 > 686 577 <tbl:button 578 id="btnNewRootBioAssaySet" 687 579 disabled="<%=!createPermission%>" 688 580 image="new.png" 689 onclick="newItem()"690 581 title="New root bioassay set…" 691 582 tooltip="<%=createPermission ? "Create a new root bioassay set" : "You do not have permission to create bioassay sets"%>" … … 693 584 /> 694 585 <tbl:button 586 id="btnDeleteTreeItems" 695 587 disabled="<%=!deletePermission%>" 696 588 image="delete.png" 697 589 title="Delete" 698 onclick="deleteItems()"699 590 tooltip="<%=deletePermission ? "Delete the selected items" : "You do not have permission to delete items"%>" 700 591 /> 701 592 <tbl:button 593 id="btnRestoreTreeItems" 702 594 disabled="<%=!writePermission%>" 703 595 image="restore.png" 704 onclick="restoreItems()"705 596 title="Restore" 706 597 tooltip="<%=writePermission ? "Restore the selected (deleted) items" : "You do not have permission to restore items"%>" 707 598 /> 708 599 <tbl:button 600 id="btnTreeColumns" 709 601 image="columns.png" 710 onclick="configureColumns()"711 602 title="Columns…" 712 603 tooltip="Show, hide and re-order columns" 713 604 /> 714 605 <tbl:button 606 id="btnTreeImport" 607 data-plugin-type="IMPORT" 715 608 image="import.png" 716 onclick="runPlugin('ImportItems')"717 609 title="Import…" 718 610 tooltip="Import data" … … 720 612 /> 721 613 <tbl:button 614 id="btnTreeExport" 615 data-plugin-type="EXPORT" 722 616 image="export.png" 723 onclick="runPlugin('ExportItems')"724 617 title="Export…" 725 618 tooltip="Export data" … … 727 620 /> 728 621 <tbl:button 622 id="btnTreeRunPlugin" 623 data-plugin-type="OTHER" 729 624 image="runplugin.png" 730 onclick="runPlugin('RunListPlugin')"731 625 title="Run plugin…" 732 626 tooltip="Run a plugin" … … 798 692 String tooltip = mode.isSelectionMode() ? 799 693 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 800 String deletePermanently = "deleteItemPermanently('" + item.getType().name() + "', "+itemId+")";801 694 boolean removed = false; 802 695 Transformation t = null; … … 807 700 String prefix = ""; 808 701 ItemContext ccc = null; 809 String view = "";810 String onClick = "";811 702 Item itemType = item.getType(); 812 703 if (itemType == Item.TRANSFORMATION) … … 816 707 prefix = "T:"; 817 708 ccc = tc; 818 onClick = "transformationOnClick";819 709 name = HTML.encodeTags(t.getName()); 820 710 description = HTML.encodeTags(t.getDescription()); … … 832 722 removed = bas.isRemoved(); 833 723 ccc = cc; 834 onClick = "bioAssaySetOnClick";835 724 name = HTML.encodeTags(bas.getName()); 836 725 description = HTML.encodeTags(bas.getDescription()); … … 842 731 removed = false; 843 732 ccc = xvc; 844 onClick = "extraValueOnClick";845 733 try 846 734 { … … 899 787 image="deleted.png" 900 788 id="<%="delete."+itemId %>" 901 subclass="<%=deletePermission ? "table-delete-item" : null %>" 902 data-item-id="<%=itemId%>" 789 subclass="<%=deletePermission ? "table-delete-item" : null %>" 790 data-item-type="<%=itemType.name() %>" 791 data-item-id="<%=itemId%>" 792 data-notify="reloadOnNotify" 903 793 tooltip="This item has been scheduled for deletion" 904 794 visible="<%=removed%>" … … 906 796 907 797 <tbl:cell clazz="cell joustcell" column="name"> 908 <div id="tree.<%=joustId%>" class="link" 909 onclick="<%=onClick%>(<%=writePermission ? "event" : null%>, <%=itemId%>)" 798 <div id="tree.<%=joustId%>" class="link auto-init" 799 data-auto-init="item-link" 800 data-item-type="<%=itemType.name() %>" 801 data-item-id="<%=itemId %>" 802 data-no-edit="<%=writePermission ? 0 : 1 %>" 803 tabindex="0" 910 804 title="<%=tooltip%>"><%=name%> 911 805 </div> … … 924 818 { 925 819 %> 926 <base:icon image="copy.png" 927 onclick="<%="copyJob(" + job.getId()+")" %>" 820 <base:icon 821 subclass="link auto-init" 822 data-auto-init="copy-job" 823 data-job-id="<%=job.getId() %>" 824 image="copy.png" 928 825 tooltip="Copy this transformation" 929 826 /> … … 972 869 { 973 870 %> 974 <base:icon image="plotter.png" 975 onclick="<%="openPlotTool("+itemId+")" %>" 871 <base:icon 872 subclass="link auto-init" 873 data-auto-init="bioassayset-plotter" 874 data-item-id="<%=itemId %>" 875 image="plotter.png" 976 876 tooltip="A simple plot tool" 977 877 /> 978 <base:icon image="explorer.png" 979 onclick="<%="openExperimentExplorer("+itemId+")" %>" 878 <base:icon 879 subclass="link auto-init" 880 data-auto-init="experiment-explorer" 881 data-item-id="<%=itemId %>" 882 image="explorer.png" 980 883 tooltip="Experiment explorer" 981 884 /> … … 983 886 } 984 887 %> 985 <base:icon image="export.png" 986 onclick="<%="runExportPlugin("+itemId+")" %>" 888 <base:icon 889 subclass="link auto-init" 890 data-auto-init="bioassayset-plugin" 891 data-plugin-type="EXPORT" 892 data-item-id="<%=itemId %>" 893 image="export.png" 987 894 tooltip="Export data" 988 895 /> … … 991 898 { 992 899 %> 993 <base:icon image="filter.png" 994 onclick="<%="filter("+itemId+")" %>" 900 <base:icon 901 subclass="link auto-init" 902 data-auto-init="bioassayset-plugin" 903 data-plugin-type="ANALYZE" 904 data-cmd="NewFilteredBioAssaySet" 905 data-item-id="<%=itemId %>" 906 image="filter.png" 995 907 tooltip="Create a filtered bioassay set" 996 908 /> 997 <base:icon image="runplugin.png" 998 onclick="<%="runAnalysisPlugin("+itemId+")" %>" 909 <base:icon 910 subclass="link auto-init" 911 data-auto-init="bioassayset-plugin" 912 data-plugin-type="ANALYZE" 913 data-item-id="<%=itemId %>" 914 image="runplugin.png" 999 915 tooltip="Run an analysis plugin" 1000 916 /> … … 1018 934 { 1019 935 %> 1020 <base:icon image="copy.png" 1021 onclick="<%="copyJob(" + job.getId()+")" %>" 936 <base:icon 937 subclass="link auto-init" 938 data-auto-init="copy-job" 939 data-job-id="<%=job.getId() %>" 940 image="copy.png" 1022 941 tooltip="Copy this extra value" 1023 942 /> … … 1059 978 initTree(); 1060 979 </script> 980 <div id="reloadOnNotify"></div> 1061 981 </base:body> 1062 982 </base:page> -
trunk/www/views/experiments/bioassaysets/edit_bioassayset.jsp
r6254 r6315 65 65 { 66 66 BioAssaySet bioAssaySet = BioAssaySet.getById(dc, itemId); 67 67 bioAssaySet.checkPermission(Permission.WRITE); 68 68 69 cc.setObject("item", bioAssaySet); 69 70 String title = "Edit bioassay set -- " + HTML.encodeTags(bioAssaySet.getName()); 70 if (bioAssaySet != null)71 {72 bioAssaySet.checkPermission(Permission.WRITE);73 }74 75 71 76 72 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), bioAssaySet); 77 73 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 78 74 %> 79 <base:page type="popup" title="<%=title%>" >80 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">75 <base:page type="popup" title="<%=title%>" id="edit-page"> 76 <base:head scripts="tabcontrol-2.js,~bioassaysets.js" styles="tabcontrol.css"> 81 77 <ext:scripts context="<%=jspContext%>" /> 82 78 <ext:stylesheets context="<%=jspContext%>" /> 83 <script>84 // Validate the "BioAssaySet" tab85 function validateBioAssaySet()86 {87 var frm = document.forms['bioAssaySet'];88 if (Main.trimString(frm.name.value) == '')89 {90 Forms.showNotification(frm.name, 'You must enter a name');91 return false;92 }93 return true;94 }95 96 // Submit the form97 function saveSettings()98 {99 var frm = document.forms['bioAssaySet'];100 if (TabControl.validateActiveTab('settings'))101 {102 Annotations.saveModifiedAnnotationsToForm(frm);103 Annotations.saveInheritedAnnotationsToForm(frm);104 frm.submit();105 }106 }107 108 function loadAnnotationsFrame()109 {110 Annotations.autoLoadEditFrame();111 }112 113 function loadInheritedAnnotationsFrame()114 {115 Annotations.autoLoadInheritFrame();116 }117 118 function init()119 {120 var frm = document.forms['bioAssaySet'];121 <%122 if (bioAssaySet == null)123 {124 %>125 frm.name.focus();126 frm.name.select();127 <%128 }129 %>130 }131 </script>132 79 </base:head> 133 <base:body onload="init()">80 <base:body> 134 81 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 135 82 <form action="index.jsp?ID=<%=ID%>" method="post" name="bioAssaySet"> … … 140 87 position="bottom" remember="<%=bioAssaySet != null%>" 141 88 extensions="<%=invoker%>"> 142 <t:tab id="info" title="Bioassay set" validate="validateBioAssaySet()"helpid="bioassayset.edit">89 <t:tab id="info" title="Bioassay set" helpid="bioassayset.edit"> 143 90 <table class="fullform input100"> 144 91 <tr> 145 92 <th>Name</th> 146 <td><input class="text required" type="text" name="name" 147 value="<%=HTML.encodeTags(bioAssaySet == null ? Values.getString(cc.getPropertyValue("name"), "New bioassay set") : bioAssaySet.getName())%>" 93 <td><input class="text required auto-init" 94 data-auto-init="focus" 95 type="text" name="name" 96 value="<%=HTML.encodeTags(bioAssaySet.getName())%>" 148 97 maxlength="<%=BioAssaySet.MAX_NAME_LENGTH%>"></td> 149 98 <td></td> … … 179 128 </table> 180 129 </t:tab> 181 <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">130 <t:tab id="annotations" title="Annotations" helpid="annotations.edit"> 182 131 <jsp:include page="../../../common/annotations/annotate_frameset.jsp"> 183 132 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 188 137 189 138 <t:tab id="inheritedAnnotations" title="Inherited annotations" 190 helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">139 helpid="annotations.edit.inherited"> 191 140 <jsp:include page="../../../common/annotations/inherit_frameset.jsp"> 192 141 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 203 152 204 153 <base:buttongroup subclass="dialogbuttons"> 205 <base:button onclick="saveSettings()" title="Save" />206 <base:button onclick="window.close()" title="Cancel" />154 <base:button id="btnSave" title="Save" /> 155 <base:button id="close" title="Cancel" /> 207 156 </base:buttongroup> 208 157 </base:body> -
trunk/www/views/experiments/bioassaysets/list_bioassaysets.jsp
r6136 r6315 201 201 int numListed = 0; 202 202 %> 203 <base:page title="<%=title%>" type="<%=mode.getPageType()%>"> 204 <base:head scripts="table.js,tabcontrol.js,newjoust.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css"> 205 <script> 206 function switchTab(tabControlId, tabId) 207 { 208 if (tabId == 'properties' || tabId == 'overview' || tabId == 'history' || tabId == 'annotations') 209 { 210 location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=experimentId%>&tab='+tabId; 211 } 212 else if (tabId == 'clonedreporters') 213 { 214 viewClonedReporters(); 215 } 216 else 217 { 218 TabControl.setActiveTab(tabControlId, tabId); 219 } 220 } 221 function viewClonedReporters() 222 { 223 location.href = '../reporters/index.jsp?ID=<%=ID%>&experiment_id=<%=experimentId%>'; 224 } 225 </script> 226 </base:head> 203 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" id="list-page"> 204 <base:head scripts="table.js,tabcontrol-2.js,newjoust.js,~bioassaysets.js" 205 styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css" /> 227 206 228 207 <base:body > … … 235 214 id="main" 236 215 subclass="mastertabcontrol content" 237 active="bioassaysets" switch="switchTab">216 active="bioassaysets"> 238 217 <t:tab id="properties" title="Properties" /> 239 218 <t:tab id="annotations" title="Annotations" … … 258 237 259 238 <base:buttongroup> 260 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />261 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />262 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />239 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 240 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 241 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 263 242 </base:buttongroup> 264 243 -
trunk/www/views/experiments/bioassaysets/view_bioassayset.jsp
r6255 r6315 150 150 "net.sf.basedb.clients.web.bioassayset.overviewplots"); 151 151 %> 152 <base:page title="<%=title%>" >153 <base:head scripts="table.js,tabcontrol .js,newjoust.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css">152 <base:page title="<%=title%>" id="view-page"> 153 <base:head scripts="table.js,tabcontrol-2.js,newjoust.js,~bioassaysets.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css"> 154 154 <ext:scripts context="<%=jspContext%>" /> 155 155 <ext:stylesheets context="<%=jspContext%>" /> 156 <script>157 function editItem()158 {159 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);160 }161 function deleteItem()162 {163 location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&experiment_id=<%=experimentId%>&item_id=<%=itemId%>');164 }165 function restoreItem()166 {167 location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&experiment_id=<%=experimentId%>&item_id=<%=itemId%>');168 }169 function switchTab(tabControlId, tabId)170 {171 if (TabControl.isActive(tabControlId, tabId)) return;172 if (tabId == 'bioassays')173 {174 location.href = '../bioassays/index.jsp?ID=<%=ID%>&experiment_id=<%=experimentId%>&bioassayset_id=<%=itemId%>&tab='+tabId;175 }176 else if (tabId == 'spotdata')177 {178 location.href = '../spotdata/index.jsp?ID=<%=ID%>&experiment_id=<%=experimentId%>&bioassayset_id=<%=itemId%>';179 }180 else if ((tabId == 'overviewplots' || tabId == 'cfplots') && tabId != '<%=tabId%>')181 {182 location.href = 'index.jsp?ID=<%=ID%>&cmd=ViewItem&experiment_id=<%=experimentId%>&bioassayset_id=<%=itemId%>&tab='+tabId;183 }184 else185 {186 TabControl.setActiveTab(tabControlId, tabId);187 }188 }189 function runItemPlugin(cmd)190 {191 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&experiment_id=<%=experimentId%>&item_id=<%=itemId%>', 'RunPlugin'+cmd, 750, 500);192 }193 194 function ImageQueue(baseId)195 {196 this.images = new Array();197 this.nextImage = 0;198 199 this.addImage = function(imageId, url)200 {201 this.images[this.images.length] = imageId;202 var img = document.getElementById(imageId);203 img.realSrc = url;204 }205 206 this.loadNextImage = function()207 {208 if (this.images.length <= this.nextImage) return;209 var imageId = this.images[this.nextImage];210 var img = document.getElementById(imageId);211 img.src = '../../../images/plot_generating_400x300.gif';212 img.realImg = new Image();213 img.realImg.onload = function()214 {215 img.src = img.realImg.src;216 img.style.background = 'transparent';217 setTimeout('loadNextImage()', 100);218 };219 img.realImg.src = img.realSrc;220 this.nextImage++;221 }222 }223 224 var plotQueue = new Array();225 var currentQueue = null;226 function registerImage(baseId, plotId, url)227 {228 if (!currentQueue) currentQueue = baseId;229 var imageQueue = plotQueue[baseId];230 if (!imageQueue)231 {232 imageQueue = new ImageQueue(baseId);233 plotQueue[baseId] = imageQueue;234 }235 var imageId = baseId + '.' + plotId;236 imageQueue.addImage(imageId, url);237 }238 function switchOverview(tabControlId, tabId)239 {240 currentQueue = tabId;241 TabControl.setActiveTab(tabControlId, tabId);242 loadNextImage();243 }244 function loadNextImage()245 {246 var imageQueue = plotQueue[currentQueue];247 if (imageQueue) imageQueue.loadNextImage();248 }249 </script>250 156 <style> 251 157 .plot 252 158 { 159 margin: 0.5em; 160 } 161 .plot.empty 162 { 253 163 background-image: url('../../../images/plot_empty_400x300.png'); 254 margin: 0.5em;255 164 } 256 165 </style> 257 166 </base:head> 258 <base:body onload="loadNextImage()">167 <base:body> 259 168 <p:path><p:pathelement 260 169 title="Experiments" href="<%="../index.jsp?ID="+ID%>" … … 263 172 /><p:pathelement title="<%=HTML.encodeTags(bioAssaySet.getName())%>" 264 173 /></p:path> 174 175 <div id="page-data" 176 data-item-id="<%=itemId%>" 177 data-experiment-id="<%=experimentId%>" 178 ></div> 265 179 266 180 <t:tabcontrol 267 181 id="view" 268 182 subclass="content mastertabcontrol" 269 active="<%=tabId%>" switch="switchTab"remember="false">183 active="<%=tabId%>" remember="false"> 270 184 <t:tab id="properties" title="Properties"> 271 185 <div> … … 274 188 <th class="itemstatus"> 275 189 <base:icon 190 id="btnDeletePermanently" 276 191 image="deleted.png" 277 onclick="deleteItemPermanently()"278 192 tooltip="This item has been flagged for deletion. Click to delete it now." 279 193 enabled="<%=deletePermission %>" … … 284 198 <tbl:toolbar subclass="bottomborder"> 285 199 <tbl:button 200 id="btnEdit" 286 201 disabled="<%=!writePermission%>" 287 202 image="edit.png" 288 onclick="editItem()"289 203 title="Edit…" 290 204 tooltip="<%=writePermission ? "Edit this bioassay set" : "You do not have permission to edit this bioassay set"%>" 291 205 /> 292 206 <tbl:button 207 id="btnDelete" 293 208 disabled="<%=!deletePermission%>" 294 209 image="delete.png" 295 onclick="deleteItem()"296 210 title="Delete" 297 211 visible="<%=!bioAssaySet.isRemoved()%>" … … 299 213 /> 300 214 <tbl:button 215 id="btnRestore" 301 216 disabled="<%=!writePermission%>" 302 217 image="restore.png" 303 onclick="restoreItem()"304 218 title="Restore" 305 219 visible="<%=bioAssaySet.isRemoved()%>" … … 307 221 /> 308 222 <tbl:button 223 id="btnImport" 309 224 image="import.png" 310 onclick="runItemPlugin('ImportItem')"225 data-plugin-type="IMPORT" 311 226 title="Import…" 312 227 tooltip="Import data" … … 314 229 /> 315 230 <tbl:button 316 image="export.png" 317 onclick="runItemPlugin('ExportItem')" 231 id="btnExport" 232 image="export.png" 233 data-plugin-type="EXPORT" 318 234 title="Export…" 319 235 tooltip="Export data" … … 321 237 /> 322 238 <tbl:button 239 id="btnPlot" 323 240 image="plotter.png" 324 onclick="<%="openPlotTool(" + itemId + ")"%>"325 241 title="Plot tool…" 326 242 tooltip="A simple tool for generating plots" … … 335 251 /> 336 252 <tbl:button 253 id="btnFilter" 254 data-plugin-type="ANALYZE" 255 data-cmd="NewFilteredBioAssaySet" 337 256 disabled="<%=!createPermission%>" 338 257 image="filter.png" 339 onclick="<%="filter(" + itemId +")"%>"340 258 title="Filter bioassay set…" 341 259 tooltip="<%=createPermission ? … … 345 263 /> 346 264 <tbl:button 347 image="runplugin.png" 348 onclick="runItemPlugin('RunPlugin')" 265 id="btnRunPlugin" 266 image="runplugin.png" 267 data-plugin-type="OTHER" 349 268 title="Run plugin…" 350 269 tooltip="Run a plugin" … … 352 271 /> 353 272 <tbl:button 273 id="btnAnalyze" 274 data-plugin-type="ANALYZE" 354 275 disabled="<%=!createPermission%>" 355 276 image="runplugin.png" 356 onclick="<%="runAnalysisPlugin(" + itemId + ")"%>"357 277 title="Run analysis…" 358 278 tooltip="<%=createPermission ? "Run an analysis plugin" : … … 364 284 <tbl:button 365 285 image="help.png" 366 onclick="<%="Main.openHelp('" + ID +"', 'bioassayset.view.properties')"%>" 286 subclass="auto-init" 287 data-auto-init="help" 288 data-help-id="bioassayset.view.properties" 367 289 title="Help…" 368 290 tooltip="Get help about this page" … … 555 477 556 478 <t:tab id="annotations" title="Annotations" 557 tooltip="View annotation values" clazz="white" 558 activate="AnnotationsList.loadOnce()"> 479 tooltip="View annotation values" clazz="white"> 559 480 <jsp:include page="../../../common/annotations/list_frameset.jsp"> 560 481 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 566 487 <t:tab id="bioassays" title="Bioassays" /> 567 488 568 <t:tab id="spotdata" title="Spot data" 569 visible="<%=hasDbSpots%>" /> 489 <t:tab id="spotdata" title="Spot data" visible="<%=hasDbSpots%>"> 490 <div class="filled absolutefull"> 491 <table style="margin: auto; height: 100%;"><tr><td> 492 <b>Please wait. The spot data is loading...</b> 493 </td></tr></table> 494 </div> 495 </t:tab> 570 496 571 497 <t:tab id="overviewplots" title="Overview plots" … … 576 502 { 577 503 ActionIterator<OverviewPlotAction> plots = overviewPlotInvoker.iterate(); 578 StringBuilder script = new StringBuilder();579 504 %> 580 <t:tabcontrol id="overviewplots" s witch="switchOverview" style="padding-top: 1em; border: 0px;">505 <t:tabcontrol id="overviewplots" style="padding-top: 1em; border: 0px;"> 581 506 <% 582 507 while (plots.hasNext()) … … 595 520 { 596 521 String plotId = generator.getId(); 597 script.append("registerImage('").append(baseId).append("','")598 .append(plotId).append("','")599 .append(HTML.javaScriptEncode(generator.getUrl())).append("');\n");600 %><img id="<%=baseId + "." + plotId%>"601 class="plot"522 %><img 523 id="<%=baseId + "." + plotId%>" 524 class="plot empty" 525 data-plot-group="<%=baseId%>" 526 data-plot-url="<%=HTML.encodeTags(generator.getUrl()) %>" 602 527 src="../../../images/transparent_pixel.gif" 603 528 width="<%=generator.getWidth()%>" … … 612 537 %> 613 538 </t:tabcontrol> 614 <script>615 <%=script%>616 </script>617 539 <% 618 540 } -
trunk/www/views/experiments/clone_reporters.jsp
r6217 r6315 77 77 78 78 List<ReporterCloneTemplate> recentTemplates = (List<ReporterCloneTemplate>)cc.getRecent(dc, Item.REPORTERCLONETEMPLATE); 79 80 81 82 79 %> 83 80 <base:page type="popup" title="<%=title%>"> 84 <base:head scripts="tabcontrol.js" styles="tabcontrol.css"> 85 <script> 86 // Validate the "Experiment" tab 87 function validateExperiment() 88 { 89 var frm = document.forms['clone']; 90 91 if (frm.reporterclonetemplate_id.selectedIndex < 0) 92 { 93 Forms.showNotification('reporterclonetemplate_id.select', 'A template must be selected'); 94 return false; 95 } 96 97 return true; 98 } 99 100 // Submit the form 101 function saveSettings() 102 { 103 var frm = document.forms['clone']; 104 if (validateExperiment()) 105 { 106 frm.submit(); 107 } 108 } 109 110 function selectTemplateOnClick() 111 { 112 var frm = document.forms['clone']; 113 var url = '../../admin/reporterclonetemplates/index.jsp?ID=<%=ID%>&mode=selectone&callback=setTemplateCallback'; 114 if (frm.reporterclonetemplate_id.length > 1) 115 { 116 var id = Math.abs(parseInt(frm.reporterclonetemplate_id[0].value)); 117 url += '&item_id='+id; 118 } 119 Main.openPopup(url, 'SelectReporterCloneTemplate', 1050, 700); 120 } 121 function setTemplateCallback(id, name) 122 { 123 var frm = document.forms['clone']; 124 var list = frm.reporterclonetemplate_id; 125 if (list.length < 2 || list[1].value == '0') // > 126 { 127 Forms.addListOption(list, 1, new Option()); 128 } 129 list[1].value = id; 130 list[1].text = name; 131 list.selectedIndex = 1; 132 } 133 134 function init() 135 { 136 var frm = document.forms['clone']; 137 } 138 </script> 139 </base:head> 140 <base:body onload="init()"> 81 <base:head scripts="~clone_reporters.js" /> 82 <base:body> 141 83 <h1><%=title%> <base:help helpid="experiment.clonereporters" /></h1> 142 84 <form action="index.jsp?ID=<%=ID%>" method="post" name="clone"> … … 158 100 newitem="<%=false%>" 159 101 unselectedtext="- all properties -" 160 onselect="selectTemplateOnClick()"161 102 /> 162 103 </td> … … 205 146 </form> 206 147 <base:buttongroup subclass="dialogbuttons"> 207 <base:button onclick="saveSettings()" title="Next" />208 <base:button onclick="window.close()" title="Cancel" />148 <base:button id="btnSave" title="Next" /> 149 <base:button id="close" title="Cancel" /> 209 150 </base:buttongroup> 210 151 -
trunk/www/views/experiments/edit_experiment.jsp
r6311 r6315 61 61 import="net.sf.basedb.clients.web.extensions.edit.EditUtil" 62 62 import="net.sf.basedb.util.extensions.ExtensionsInvoker" 63 import="net.sf.basedb.util.json.JsonUtil" 64 import="net.sf.basedb.util.json.JsonConverter" 65 import="net.sf.basedb.util.json.NameableConverter" 63 66 import="java.util.Arrays" 64 67 import="java.util.Date" 65 68 import="java.util.List" 69 import="org.json.simple.JSONArray" 70 import="org.json.simple.JSONObject" 66 71 %> 67 72 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> … … 105 110 currentRawDataType = RawDataTypes.getRawDataType(cc.getRecent("RawDataType", 0)); 106 111 } 112 if (currentRawDataType == null) 113 { 114 currentRawDataType = defaultRawDataType; 115 } 116 107 117 if (cc.getPropertyFilter("directory.name") != null) 108 118 { … … 121 131 { 122 132 experiment = Experiment.getById(dc, itemId); 133 experiment.checkPermission(Permission.WRITE); 123 134 rbaQuery = experiment.getRawBioAssays(); 124 135 efQuery = experiment.getExperimentalFactors(); … … 140 151 } 141 152 } 142 if (experiment != null) experiment.checkPermission(Permission.WRITE);143 153 154 // Load rawbioassays as JSON objects 155 JSONObject jsonRawBioAssays = new JSONObject(); 156 jsonRawBioAssays.put("itemType", "RAWBIOASSAY"); 157 if (rbaQuery != null) 158 { 159 rbaQuery.include(Include.ALL); 160 rbaQuery.order(Orders.asc(Hql.property("name"))); 161 List<RawBioAssay> rawBioAssays = rbaQuery.list(dc); 162 163 if (rawBioAssays.size() > 0 && experiment == null) 164 { 165 // Nullify so we can get raw data type from the raw bioassays 166 currentRawDataType = null; 167 168 for (RawBioAssay rba : rawBioAssays) 169 { 170 try 171 { 172 RawDataType rbaDataType = rba.getRawDataType(); 173 if (currentRawDataType == null) 174 { 175 currentRawDataType = rbaDataType; 176 } 177 else if (rbaDataType != currentRawDataType) 178 { 179 throw new WebException("popup", "Raw data types doesn't match", 180 "The raw data type of the selected raw bioassays are not the same. " + 181 "It is not possible to mix raw data types in an experiment."); 182 } 183 } 184 catch (RuntimeException t) 185 {} 186 } 187 } 188 189 jsonRawBioAssays.put("items", JsonUtil.toArray(rawBioAssays, new NameableConverter())); 190 } 144 191 192 // Load experimental factors as JSON objects 193 JSONObject jsonAnnotationTypes = new JSONObject(); 194 jsonAnnotationTypes.put("itemType", "ANNOTATIONTYPE"); 195 if (efQuery != null) 196 { 197 efQuery.include(Include.ALL); 198 efQuery.order(Orders.asc(Hql.property("name"))); 199 jsonAnnotationTypes.put("items", JsonUtil.toArray(efQuery.iterate(dc), new NameableConverter())); 200 } 145 201 146 202 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); … … 151 207 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 152 208 %> 153 <base:page type="popup" title="<%=title%>" >154 <base:head scripts="tabcontrol .js,linkitems.js" styles="tabcontrol.css">209 <base:page type="popup" title="<%=title%>" id="edit-page"> 210 <base:head scripts="tabcontrol-2.js,linkitems-2.js,~experiments.js" styles="tabcontrol.css"> 155 211 <ext:scripts context="<%=jspContext%>" /> 156 212 <ext:stylesheets context="<%=jspContext%>" /> 157 <script>158 // Validate the "Experiment" tab159 function validateExperiment()160 {161 var frm = document.forms['experiment'];162 if (Main.trimString(frm.name.value) == '')163 {164 Forms.showNotification(frm.name, 'You must enter a name');165 return false;166 }167 if (frm.rawdatatype)168 {169 if (frm.rawdatatype[frm.rawdatatype.selectedIndex].value == '')170 {171 Forms.showNotification(frm.rawdatatype, 'You must select a raw data type');172 return false;173 }174 }175 return true;176 }177 178 // Validate the "Experimental factors" tab179 function validateExperimentalFactors()180 {181 return true;182 }183 184 // Submit the form185 function saveSettings()186 {187 var frm = document.forms['experiment'];188 if (TabControl.validateActiveTab('settings'))189 {190 Annotations.saveModifiedAnnotationsToForm(frm);191 192 frm.addedRawBioAssays.value = Link.getActionIds(1, 'R').join(',');193 frm.removedRawBioAssays.value = Link.getActionIds(-1, 'R').join(',');194 195 frm.addedAnnotationTypes.value = Link.getActionIds(1, 'A').join(',');196 frm.removedAnnotationTypes.value = Link.getActionIds(-1, 'A').join(',');197 198 frm.submit();199 }200 }201 202 function loadAnnotationsFrame()203 {204 Annotations.autoLoadEditFrame();205 }206 207 function addRawBioAssaysOnClick()208 {209 var frm = document.forms['experiment'];210 var ids = Link.getListIds(frm.rawBioAssays, 'R');211 var excludes = ids.join(',');212 var rawDataType = <%=currentRawDataType == null ? "frm.rawdatatype[frm.rawdatatype.selectedIndex].value" : "'"+currentRawDataType.getId()+"'"%>;213 var url = '../rawbioassays/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectmultiple&callback=addRawBioAssayCallback';214 url += "&exclude="+excludes;215 url += '&resetTemporary=1&tmpfilter:STRING:rawDataType='+rawDataType;216 Main.openPopup(url, 'AddRawBioAssays', 1050, 700);217 }218 function addRawBioAssayCallback(rawBioAssayId, name)219 {220 var item = Link.getItem('R', rawBioAssayId);221 if (!item) item = new Item('R', rawBioAssayId, name);222 Link.addItem(document.forms['experiment'].rawBioAssays, item);223 }224 function removeRawBioAssaysOnClick()225 {226 Link.removeSelected(document.forms['experiment'].rawBioAssays);227 }228 229 function addAnnotationTypesOnClick()230 {231 var frm = document.forms['experiment'];232 var ids = Link.getListIds(frm.annotationTypes, 'A');233 var excludes = ids.join(',');234 var url = '../../admin/annotationtypes/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectmultiple&callback=addAnnotationTypeCallback';235 url += "&exclude="+excludes;236 Main.openPopup(url, 'AddAnnotationTypes', 1050, 700);237 }238 function addAnnotationTypeCallback(annotationTypeId, name)239 {240 var item = Link.getItem('A', annotationTypeId);241 if (!item) item = new Item('A', annotationTypeId, name);242 Link.addItem(document.forms['experiment'].annotationTypes, item);243 }244 function removeAnnotationTypesOnClick()245 {246 Link.removeSelected(document.forms['experiment'].annotationTypes);247 }248 function selectDirectoryOnClick()249 {250 var frm = document.forms['experiment'];251 var url = '../../filemanager/directories/index.jsp?ID=<%=ID%>&mode=selectonedirectory&callback=setDirectoryCallback';252 if (frm.directory_id.length > 1)253 {254 var id = Math.abs(parseInt(frm.directory_id[1].value));255 url += '&directory_id='+id;256 }257 Main.openPopup(url, 'SelectDirectory', 350, 500);258 }259 function setDirectoryCallback(id, name)260 {261 var frm = document.forms['experiment'];262 var list = frm.directory_id;263 if (list.length < 2 || list[1].value == '0') // >264 {265 Forms.addListOption(list, 1, new Option());266 }267 list[1].value = id;268 list[1].text = name;269 list.selectedIndex = 1;270 }271 272 function init()273 {274 var frm = document.forms['experiment'];275 <%276 if (experiment == null)277 {278 %>279 frm.name.focus();280 frm.name.select();281 <%282 }283 if (rbaQuery != null)284 {285 %>286 var rawBioAssays = frm.rawBioAssays;287 <%288 rbaQuery.include(Include.ALL);289 rbaQuery.order(Orders.asc(Hql.property("name")));290 ItemResultList<RawBioAssay> rawBioAssays = rbaQuery.list(dc);291 if (rawBioAssays.size() > 0 && experiment == null) currentRawDataType = null;292 for (RawBioAssay rba : rawBioAssays)293 {294 RawDataType rbaDataType = null;295 try296 {297 rbaDataType = rba.getRawDataType();298 }299 catch (Throwable t)300 {}301 if (currentRawDataType == null)302 {303 currentRawDataType = rbaDataType;304 }305 String linkMethod = "addNewItem";306 if (experiment == null)307 {308 linkMethod = "addItem";309 // Checks for new experiment310 if (rbaDataType != currentRawDataType)311 {312 throw new WebException("popup", "Raw data types doesn't match",313 "The raw data type of the selected raw bioassays are not the same. " +314 "It is not possible to mix raw data types in an experiment.");315 }316 }317 %>318 Link.<%=linkMethod%>(rawBioAssays, new Item('R', <%=rba.getId()%>, '<%=HTML.javaScriptEncode(rba.getName())%>'));319 <%320 }321 }322 if (efQuery != null)323 {324 %>325 var annotationTypes = frm.annotationTypes;326 <%327 efQuery.include(Include.ALL);328 efQuery.order(Orders.asc(Hql.property("name")));329 ItemResultList<AnnotationType> experimentalFactors = efQuery.list(dc);330 for (AnnotationType at : experimentalFactors)331 {332 %>333 Link.addNewItem(annotationTypes, new Item('A', <%=at.getId()%>, '<%=HTML.javaScriptEncode(at.getName())%>'));334 <%335 }336 }337 %>338 }339 </script>340 213 </base:head> 341 <base:body onload="init()">214 <base:body> 342 215 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 216 217 <div id="page-data" class="data-container" 218 data-current-raw-data-type="<%=currentRawDataType != null && experiment != null ? currentRawDataType.getId() : "" %>" 219 ></div> 220 343 221 <form action="index.jsp?ID=<%=ID%>" method="post" name="experiment"> 344 222 <input type="hidden" name="cmd" value="UpdateItem"> … … 348 226 position="bottom" remember="<%=tabId == null && experiment != null%>" 349 227 extensions="<%=invoker%>"> 350 <t:tab id="info" title="Experiment" validate="validateExperiment()"helpid="experiment.edit">228 <t:tab id="info" title="Experiment" helpid="experiment.edit"> 351 229 <table class="fullform input100"> 352 230 <tr> 353 231 <th>Name</th> 354 <td><input class="text required" type="text" name="name" 232 <td><input class="text required auto-init" data-auto-init="<%=experiment == null ? "focus-select" : "focus" %>" 233 type="text" name="name" 355 234 value="<%=HTML.encodeTags(experiment == null ? Values.getString(cc.getPropertyValue("name"), "New experiment") : experiment.getName())%>" 356 235 maxlength="<%=Experiment.MAX_NAME_LENGTH%>"></td> … … 408 287 recent="<%=recentDirectories%>" 409 288 newitem="<%=experiment == null%>" 410 onselect="selectDirectoryOnClick()"411 289 /> 412 290 </td> … … 420 298 <tr> 421 299 <td> 422 <select name="rawBioAssays" size="5" multiple> 300 <select name="rawBioAssays" id="rawBioAssays" 301 class="auto-init" 302 data-auto-init="link-container" 303 data-initial-items="[<%=HTML.encodeTags(jsonRawBioAssays.toJSONString()) %>]" 304 data-initial-action="<%=itemId == 0 ? 1 : 0 %>" 305 size="5" multiple> 423 306 </select> 424 307 </td> … … 426 309 <base:buttongroup vertical="true"> 427 310 <base:button 311 id="btnAddRawBioAssays" 428 312 subclass="leftaligned" 429 313 style="width: 14em;" 430 onclick="addRawBioAssaysOnClick()"431 314 title="Add raw bioassays…" 432 315 tooltip="Add raw bioassays" 433 316 /> 434 317 <base:button 435 subclass="leftaligned" 318 id="btnRemoveRawBioAssays" 319 subclass="leftaligned auto-init" 320 data-auto-init="remove-link" 321 data-list-id="rawBioAssays" 436 322 style="width: 14em;" 437 onclick="removeRawBioAssaysOnClick()"438 323 title="Remove" 439 324 tooltip="Remove the selected raw bioassays" 440 325 /> 441 326 </base:buttongroup> 442 <input type="hidden" name="addedRawBioAssays" value="">443 <input type="hidden" name="removedRawBioAssays" value="">444 327 </td> 445 328 </tr> … … 564 447 </t:tab> 565 448 566 <t:tab id="experimentalFactors" title="Experimental factors" 567 validate="validateExperimentalFactors()" helpid="experiment.edit.factors"> 449 <t:tab id="experimentalFactors" title="Experimental factors" helpid="experiment.edit.factors"> 568 450 <table class="fullform input100"> 569 451 <tr class="big"> … … 575 457 <tr> 576 458 <td> 577 <select name="annotationTypes" size="20" multiple> 459 <select name="annotationTypes" id="annotationTypes" 460 class="auto-init" 461 data-auto-init="link-container" 462 data-initial-items="[<%=HTML.encodeTags(jsonAnnotationTypes.toJSONString()) %>]" 463 size="20" multiple> 578 464 </select> 579 465 </td> … … 581 467 <base:buttongroup vertical="true"> 582 468 <base:button 583 subclass="leftaligned" 469 id="btnAddAnnotationTypes" 470 subclass="leftaligned auto-init" 471 data-auto-init="add-link" 472 data-list-id="annotationTypes" 473 data-item-type="ANNOTATIONTYPE" 584 474 style="width: 14em;" 585 onclick="addAnnotationTypesOnClick()"586 475 title="Add annotation types…" 587 476 tooltip="Add annotation types" 588 477 /> 589 478 <base:button 590 subclass="leftaligned" 479 id="btnRemoveAnnotationTypes" 480 subclass="leftaligned auto-init" 481 data-auto-init="remove-link" 482 data-list-id="annotationTypes" 591 483 style="width: 14em;" 592 onclick="removeAnnotationTypesOnClick()"593 484 title="Remove" 594 485 tooltip="Remove the selected annotation types" 595 486 /> 596 487 </base:buttongroup> 597 <input type="hidden" name="addedAnnotationTypes" value="">598 <input type="hidden" name="removedAnnotationTypes" value="">599 488 </td> 600 489 </tr> … … 610 499 </t:tab> 611 500 612 <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">501 <t:tab id="annotations" title="Annotations" helpid="annotations.edit"> 613 502 <jsp:include page="../../common/annotations/annotate_frameset.jsp"> 614 503 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 629 518 630 519 <base:buttongroup subclass="dialogbuttons"> 631 <base:button onclick="saveSettings()" title="Save" />632 <base:button onclick="window.close()" title="Cancel" />520 <base:button id="btnSave" title="Save" /> 521 <base:button id="close" title="Cancel" /> 633 522 </base:buttongroup> 634 523 </base:body> -
trunk/www/views/experiments/explorer/search/list.jsp
r6182 r6315 109 109 int numListed = 0; 110 110 %> 111 112 111 <base:page title="<%=title%>"> 113 <base:head scripts="table.js,tabcontrol.js,newjoust.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css"> 114 <script> 115 var submitPage = 'index.jsp'; 116 var formId = 'reporters'; 117 function editItem(itemId) 118 { 119 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true); 120 } 121 function viewItem(itemId) 122 { 123 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false); 124 } 125 function itemOnClick(evt, itemId) 126 { 127 Table.itemOnClick(formId, evt, itemId, 'DEFAULT', viewItem, editItem, null); 128 } 129 function configureColumns() 130 { 131 Table.configureColumns(formId); 132 } 133 function viewReporter(index) 134 { 135 var url = '../view/index.jsp?ID=<%=ID%>&bioassayset_id=<%=bioAssaySetId%>'; 136 if (index >= 0) 137 { 138 url += '&cmd=SetReporterIndex&reporterIndex='+index; 139 } 140 location.href = url; 141 } 142 143 function switchTab(tabControlId, tabId) 144 { 145 if (tabId == 'view') 146 { 147 viewReporter(-1); 148 } 149 else 150 { 151 TabControl.setActiveTab(tabControlId, tabId); 152 } 153 } 154 function newReporterList() 155 { 156 Table.submitToPopup(formId, 'CreateReporterList', 600, 400); 157 } 158 </script> 159 </base:head> 112 <base:head scripts="table.js,tabcontrol-2.js,~list.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css" /> 160 113 <base:body> 161 114 <p:path><p:pathelement … … 169 122 id="explorer" 170 123 subclass="mastertabcontrol content" 171 switch="switchTab"remember="false" active="search">124 remember="false" active="search"> 172 125 <t:tab id="search" title="Reporter search"> 173 126 <tbl:table … … 218 171 <tbl:toolbar subclass="bottomborder"> 219 172 <tbl:button 173 id="btnColumns" 220 174 image="columns.png" 221 onclick="configureColumns()"222 175 title="Columns…" 223 176 tooltip="Show, hide and re-order columns" 224 177 /> 225 178 <tbl:button 179 id="btnNewReporterList" 226 180 image="add.png" 227 onclick="newReporterList()"228 181 title="New reporter list…" 229 182 tooltip="Create a new reporter list from matching reporters" … … 265 218 if (reporters != null) 266 219 { 220 boolean writeReporterPermission = sc.hasPermission(Permission.WRITE, Item.REPORTER); 221 String tooltip = "View this item" + (writeReporterPermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 267 222 while (reporters.hasNext()) 268 223 { … … 275 230 <tbl:header 276 231 clazz="icons" 277 ><a href="javascript:viewReporter(<%=rowIndex-1%>)"><%=rowIndex%></a></tbl:header> 232 style="padding-right: 3px;" 233 ><span class="link auto-init" 234 data-auto-init="view-reporter" 235 data-index="<%=rowIndex-1%>"><%=rowIndex%></span></tbl:header> 278 236 <% 279 237 int colIndex = 2; … … 284 242 { 285 243 %> 286 <tbl:cell column="externalId"><div class="link" onclick="itemOnClick(event, <%=itemId%>)" 287 title="View this item (use CTRL, ALT or SHIFT to edit)"><%=HTML.encodeTags(item.getString(colIndex))%></div></tbl:cell> 244 <tbl:cell column="externalId"><div 245 class="link table-item" 246 data-item-id="<%=itemId%>" 247 data-no-edit="<%=writeReporterPermission ? 0 : 1%>" 248 tabindex="0" 249 title="<%=tooltip%>"><%=HTML.encodeTags(item.getString(colIndex))%></div></tbl:cell> 288 250 <% 289 251 } -
trunk/www/views/experiments/explorer/view/plotter.jsp
r6176 r6315 58 58 <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> 59 59 <%! 60 private static void addFormulaOption(StringBuilder options, String formula, String title, String description )60 private static void addFormulaOption(StringBuilder options, String formula, String title, String description, Formula.AverageMethod avgMethod) 61 61 { 62 62 options.append("<option value=\"").append(HTML.encodeTags(formula)).append("\""); 63 63 options.append(" title=\"").append(HTML.encodeTags(description)).append("\""); 64 options.append(" data-average-method=\"").append(avgMethod.name()).append("\""); 64 65 options.append(">").append(HTML.encodeTags(title)).append("\n"); 65 66 } … … 106 107 { 107 108 String jepExpression = tc.getJepExpression(); 108 addFormulaOption(formulaOptions, jepExpression, tc.getTitle(), tc.getDescription() );109 addFormulaOption(formulaOptions, jepExpression, tc.getTitle(), tc.getDescription(), tc.getAverageMethod()); 109 110 } 110 111 } … … 115 116 %> 116 117 <base:page type="popup" title="<%=title%>"> 117 <base:head styles="tabcontrol.css" scripts="tabcontrol.js"> 118 <script> 119 120 var averageMethods = new Array(); 121 <% 122 for (TableColumn tc : formulas) 123 { 124 if (tc.getJepExpression() != null && tc.getDatatype().isNumerical()) 125 { 126 if (!needAverageMethod || tc.getAverageMethod() != Formula.AverageMethod.NONE) 127 { 128 %> 129 averageMethods[averageMethods.length] = '<%=tc.getAverageMethod().name()%>'; 130 <% 131 } 132 } 133 } 134 %> 135 136 function validate() 137 { 138 var frm = document.forms['plot']; 139 if (Main.trimString(frm.yFormula.value) == '') 140 { 141 Forms.showNotification(frm.yFormula, 'You must enter an expression for the Y axis'); 142 return false; 143 } 144 return true; 145 } 146 147 function getPlotType() 148 { 149 var frm = document.forms['plot']; 150 return Forms.getCheckedRadio(frm.plotType).value; 151 } 152 153 function plotTypeOnChange() 154 { 155 var plotType = getPlotType(); 156 var frm = document.forms['plot']; 157 var isAssayPlot = plotType == 'assay'; 158 frm.annotationTypeId.disabled = isAssayPlot; 159 frm.subtype.disabled = !isAssayPlot; 160 } 161 162 function presetOnChange(list, formula, label) 163 { 164 var index = list.selectedIndex; 165 var frm = list.form; 166 if (frm.averageMethod) 167 { 168 var avgMethod = averageMethods[index-1]; 169 Forms.selectListOption(frm.averageMethod, avgMethod); 170 } 171 formula.value = list[index].value; 172 if (label && list[index].value != '') label.value = list[index].text; 173 list.selectedIndex = 0; 174 } 175 176 function generatePlotUrl(fullSize) 177 { 178 if (validate()) 179 { 180 var frm = document.forms['plot']; 181 var url = getRoot() + 'views/experiments/explorer/plot'; 182 url += '?ID=<%=ID%>&bioAssaySetId=<%=bioAssaySetId%>'; 183 url += '&reporterIndex=<%=reporterIndex%>&positionIndex=<%=positionIndex%>'; 184 url += '&title='+Main.encodeURI(frm.title.value); 185 url += '&subTitle='+Main.encodeURI(frm.subTitle.value); 186 if (fullSize) 187 { 188 url += '&width='+frm.width.value; 189 url += '&height='+frm.height.value; 190 } 191 192 url += '&y='+Main.encodeURI(frm.yFormula.value); 193 url += '&yLog='+(frm.yLog.checked ? 1 : 0); 194 url += '&yLabel='+Main.encodeURI(frm.yLabel.value); 195 196 var plotType = getPlotType(); 197 url += '&type='+plotType; 198 url += '&showXLabels='+(frm.hideXLabels.checked ? 0 : 1); 199 200 if (plotType == 'assay') 201 { 202 url += '&subtype=' + frm.subtype[frm.subtype.selectedIndex].value; 203 if (frm.averageMethod) 204 { 205 url += '&averageMethod=' + frm.averageMethod[frm.averageMethod.selectedIndex].value; 206 } 207 } 208 else if (plotType == 'annotation') 209 { 210 url += '&annotationTypeId=' + frm.annotationTypeId[frm.annotationTypeId.selectedIndex].value; 211 } 212 url += '&' + new Date().getTime(); 213 return url; 214 } 215 } 216 217 function openExpressionBuilder(title, frmName, inputName, formulaType) 218 { 219 if (!document.forms[frmName][inputName].disabled) 220 { 221 var restrictions = formulaType == '<%=Formula.Type.COLUMN_RESTRICTION.name()%>'; 222 Main.expressionBuilder('<%=ID%>', title, frmName, inputName, formulaType, '<%=rdt.getId()%>', <%=rdt.getChannels()%>, restrictions, <%=bas.getId()%>); 223 } 224 } 225 226 function previewPlot() 227 { 228 var url = generatePlotUrl(false); 229 if (url) 230 { 231 url += '&width=540&height=360'; 232 233 var overlayImg = document.getElementById('overlay'); 234 overlayImg.src = getRoot()+'images/plot_generating.gif'; 235 236 var previewImg = document.getElementById('preview'); 237 previewImg.realImg = new Image(); 238 previewImg.realImg.onload = changePreviewImage; 239 previewImg.realImg.src = url; 240 } 241 } 242 243 function changePreviewImage() 244 { 245 var previewImg = document.getElementById('preview'); 246 previewImg.src = previewImg.realImg.src; 247 previewImg.realImg = null; 248 var overlayImg = document.getElementById('overlay'); 249 overlayImg.src = getRoot() + 'images/blankbutton.gif'; 250 } 251 252 function viewPlot() 253 { 254 var url = generatePlotUrl(true); 255 if (url) 256 { 257 var frm = document.forms['plot']; 258 var width = parseInt(frm.width.value); 259 var height = parseInt(frm.height.value); 260 if (!width || width < 600) width = 600; 261 if (!height || height < 400) height = 400; 262 Main.openPopup('../../plotter/view.jsp?ID=<%=ID%>&title='+Main.encodeURI(frm.title.value), 'ViewPlot', width+150, height+100); 263 } 264 } 265 266 function downloadPlot() 267 { 268 var url = generatePlotUrl(true); 269 if (url) 270 { 271 Main.openPopup('../../plotter/download.jsp?ID=<%=ID%>', 'DownloadPlot', 300, 200); 272 } 273 } 274 275 function savePlotAs() 276 { 277 var url = generatePlotUrl(true); 278 if (url) 279 { 280 Main.openPopup('../../plotter/save_as.jsp?ID=<%=ID%>', 'SavePlotAs', 450, 300); 281 } 282 } 283 284 function init() 285 { 286 plotTypeOnChange(); 287 } 288 </script> 289 </base:head> 290 <base:body onload="init()"> 118 <base:head scripts="tabcontrol-2.js,~plotter.js" styles="tabcontrol.css" /> 119 <base:body> 291 120 <h1><%=title%> <base:help helpid="explorer.plotter" /></h1> 121 <div id="page-data" class="datacontainer" 122 data-bioassayset="<%=bioAssaySetId %>" 123 data-reporter-index="<%=reporterIndex %>" 124 data-position-index="<%=positionIndex %>" 125 ></div> 292 126 <form name="plot"> 293 127 <div class="content bottomborder"> … … 308 142 <tr> 309 143 <th>Width</th> 310 <td colspan="2"><input type="text" class="text" style="width: 10em;" maxlength="10" name="width" 311 value="900" onkeypress="return Numbers.integerOnly(event)"> (not used by preview)</td> 144 <td colspan="2"><input type="text" class="text" 145 name="width" id="width" 146 style="width: 10em;" maxlength="10" value="900" 147 > (not used by preview)</td> 312 148 </tr> 313 149 <tr> 314 150 <th>Height</th> 315 <td colspan="2"><input type="text" class="text" style="width: 10em;" maxlength="10" name="height" 316 value="600" onkeypress="return Numbers.integerOnly(event)"></td> 151 <td colspan="2"><input type="text" class="text" 152 name="height" id="height" 153 style="width: 10em;" maxlength="10" value="600"></td> 317 154 </tr> 318 155 <tr> … … 326 163 <th>Y-axis</th> 327 164 <td> 328 <select name="yPresets" style="width: 25em;" 329 onchange="presetOnChange(this, this.form.yFormula, this.form.yLabel)" 165 <select name="yPresets" id="yPresets" style="width: 25em;" 166 data-formula-id="yFormula" 167 data-label-id="yLabel" 330 168 > 331 169 <option value="">- select from list or enter formula below - … … 337 175 <tr> 338 176 <th class="subprompt">Expression</th> 339 <td><input type="text" class="text required" maxlength="255" name="yFormula" ></td>177 <td><input type="text" class="text required" maxlength="255" name="yFormula" id="yFormula"></td> 340 178 <td> 341 179 <base:icon 180 id="btnExpressionBuilderY" 181 data-formula-id="yFormula" 182 data-title="Y-axis expression" 183 data-formula-type="COLUMN_EXPRESSION" 184 data-raw-data-type="<%=rdt.getId() %>" 185 data-channels="<%=rdt.getChannels() %>" 186 data-bioassayset="<%=bioAssaySetId %>" 342 187 image="expression_builder.png" 343 188 tooltip="Use the Expression builder" 344 onclick="openExpressionBuilder('Y-axis expression', 'plot', 'yFormula', 'COLUMN_EXPRESSION')"345 189 /> 346 190 </td> … … 348 192 <tr> 349 193 <th class="subprompt">Label</th> 350 <td><input type="text" class="text" maxlength="255" name="yLabel" ></td>194 <td><input type="text" class="text" maxlength="255" name="yLabel" id="yLabel"></td> 351 195 <td></td> 352 196 </tr> … … 385 229 <th>X-axis</th> 386 230 <td> 387 <input type="radio" name="plotType" value="assay" onchange="plotTypeOnChange()"231 <input type="radio" name="plotType" value="assay" 388 232 id="plotTypeAssay" <%=plotType.equals("assay") ? "checked" : ""%> 389 233 ><label for="plotTypeAssay" 390 234 title="Creates a line/bar plot with bioassays along the x axis">Bioassays</label> 391 <input type="radio" name="plotType" value="annotation" onchange="plotTypeOnChange()"235 <input type="radio" name="plotType" value="annotation" 392 236 id="plotTypeAnnotation" <%=plotType.equals("annotation") ? "checked" : ""%> 393 237 ><label for="plotTypeAnnotation" … … 447 291 448 292 <base:buttongroup subclass="dialogbuttons"> 449 <base:button title="Preview" onclick="previewPlot()" 450 image="plotter_preview.png" tooltip="Generate a preview of the plot" 293 <base:button 294 id="btnPreviewPlot" 295 title="Preview" 296 image="plotter_preview.png" 297 tooltip="Generate a preview of the plot" 451 298 /> 452 <base:button title="View…" onclick="viewPlot()" 453 image="plotter.png" tooltip="View a fullsized version of the plot (in a popup)" 299 <base:button 300 id="btnViewPlot" 301 title="View…" 302 image="plotter.png" 303 tooltip="View a fullsized version of the plot (in a popup)" 454 304 /> 455 <base:button title="Download…" onclick="downloadPlot()" 305 <base:button 306 id="btnDownloadPlot" 307 title="Download…" 456 308 image="download.png" 457 309 tooltip="Downlad a fullsized version of the plot to your computer" 458 310 /> 459 <base:button title="Save as…" onclick="savePlotAs()" 311 <base:button 312 id="btnSavePlot" 313 title="Save as…" 460 314 image="saveas.png" 461 315 disabled="<%=!hasCreateFilePermission%>" … … 464 318 "You don't have permission to create files" %>" 465 319 /> 466 <base:button onclick="window.close()" title="Close" />320 <base:button id="close" title="Close" /> 467 321 </base:buttongroup> 468 322 -
trunk/www/views/experiments/explorer/view/view.jsp
r6185 r6315 207 207 %> 208 208 <base:page title="<%=title%>"> 209 <base:head scripts="table.js,tabcontrol.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,explorer.css"> 210 <script> 211 var submitPage = 'index.jsp'; 212 var formId = 'spotdata'; 213 function configureColumns() 214 { 215 Table.configureColumns(formId); 216 } 217 function configureReporterColumns() 218 { 219 var frm = document.forms['reporter']; 220 frm.cmd.value = 'SetReporterColumns'; 221 Table.configureColumns('reporter', 'reporter-columns'); 222 } 223 function validateReporterIndex() 224 { 225 var frm = document.forms['reporterIndex']; 226 var reporterIndex = parseInt(frm.newReporterIndex.value); 227 var maxIndex = <%=matchingReporters%>; 228 if (reporterIndex < 1 || reporterIndex > maxIndex) 229 { 230 Forms.showNotification(frm.newReporterIndex, 'The reporter index must be between 1 and ' + maxIndex); 231 return false; 232 } 233 frm.cmd.value = 'SetReporterIndex'; 234 Forms.createHidden(frm, 'reporterIndex', reporterIndex-1); 235 return true; 236 } 237 function validateSpotIndex() 238 { 239 var frm = document.forms['spotIndex']; 240 var spotIndex = parseInt(frm.newSpotIndex.value); 241 var maxIndex = <%=matchingPositions%>; 242 if (spotIndex < 1 || spotIndex > maxIndex) 243 { 244 Forms.showNotification(frm.newSpotIndex, 'The spot index must be between 1 and ' + maxIndex); 245 return false; 246 } 247 frm.cmd.value = 'SetSpotIndex'; 248 Forms.createHidden(frm, 'spotIndex', spotIndex-1); 249 return true; 250 } 251 function annotationTypeOnChange() 252 { 253 var frm = document.forms['explorer']; 254 frm.cmd.value = 'SetAnnotationType'; 255 frm.submit(); 256 } 257 function viewSearch() 258 { 259 location.href = '../search/index.jsp?ID=<%=ID%>&bioassayset_id=<%=bioAssaySetId%>'; 260 } 261 function switchTab(tabControlId, tabId) 262 { 263 if (tabId == 'search') 264 { 265 viewSearch(); 266 } 267 else 268 { 269 TabControl.setActiveTab(tabControlId, tabId); 270 } 271 } 272 function assayPlot() 273 { 274 var url = 'plotter.jsp?ID=<%=ID%>&type=assay'; 275 url += '&bioAssaySetId=<%=bioAssaySetId%>'; 276 url += '&reporterIndex=<%=reporterIndex%>'; 277 url += '&positionIndex=<%=positionIndex%>'; 278 Main.openPopup(url, 'AssayPlot', 1050, 700); 279 } 280 function annotationPlot(annotationType) 281 { 282 var url = 'plotter.jsp?ID=<%=ID%>&type=annotation'; 283 url += '&bioAssaySetId=<%=bioAssaySetId%>'; 284 url += '&reporterIndex=<%=reporterIndex%>'; 285 url += '&positionIndex=<%=positionIndex%>'; 286 url += '&annotationTypeId=' + annotationType; 287 Main.openPopup(url, 'AnnotationPlot', 1050, 700); 288 } 289 </script> 209 <base:head scripts="table.js,tabcontrol-2.js,~view.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,explorer.css"> 290 210 <style> 291 211 .special td.cell:first-of-type … … 306 226 id="explorer" 307 227 subclass="content mastertabcontrol" 308 switch="switchTab"309 228 remember="false" active="view"> 310 229 <t:tab id="search" title="Reporter search" /> … … 344 263 <tbl:label style="padding: 0px 2px 0px 6px;"> 345 264 Current reporter 346 <input name="newReporterIndex" type="text" class="text" value="<%=reporterIndex+1%>" 347 onkeypress="return Numbers.integerOnly(event, true, validateReporterIndex)" 265 <input name="newReporterIndex" id="newReporterIndex" 266 type="text" class="text" 267 value="<%=reporterIndex+1%>" data-max-index="<%=matchingReporters%>" 348 268 style="width: 6em;" maxlength="8" title="Enter a number between 1 and <%=matchingReporters%>"> 349 269 of <%=matchingReporters %> … … 387 307 </tbl:label> 388 308 <tbl:button 309 id="btnReporterColumns" 389 310 image="columns.png" 390 onclick="configureReporterColumns()"391 311 title="Columns…" 392 312 tooltip="Show, hide and re-order reporter columns" … … 486 406 <td class="summaryheader"><%=Base.getLinkedName(ID, at, false, true)%></td> 487 407 <td class="plotheader"><base:icon 408 subclass="link auto-init" 409 data-auto-init="annotation-plot" 410 data-annotation-type="<%=at.getId()%>" 488 411 image="plotter.png" 489 onclick="<%="annotationPlot(" + at.getId() + ")"%>"490 412 tooltip="Box plot for selected spot data per annotation group" 491 413 /></td> … … 567 489 </form> 568 490 </base:section> 569 570 491 <% 571 492 if (cc.getMessage() != null) … … 577 498 } 578 499 %> 579 580 500 <% 581 501 if (spotData != null) … … 590 510 <tbl:label style="padding: 0px 2px 0px 6px;"> 591 511 Current spot 592 <input name="newSpotIndex" type="text" class="text" value="<%=positionIndex == -1 ? "all" : positionIndex == -2 ? "avg" : String.valueOf(positionIndex+1)%>" 593 onkeypress="return Numbers.integerOnly(event, true, validateSpotIndex)" 512 <input name="newSpotIndex" id="newSpotIndex" 513 data-max-index="<%=matchingPositions%>" 514 type="text" class="text" value="<%=positionIndex == -1 ? "all" : positionIndex == -2 ? "avg" : String.valueOf(positionIndex+1)%>" 594 515 size="6" maxlength="8" title="Enter a number between 1 and <%=matchingPositions%>"> 595 516 of <%=matchingPositions%> 596 597 <% 598 if (positionIndex <= 0) 517 <% 518 if (positionIndex == 0) 599 519 { 600 520 %> 601 521 <base:icon image="first.png" enabled="false" /> 602 <base:icon image="previous.png" enabled="false" />603 522 <% 604 523 } … … 608 527 <a href="index.jsp?ID=<%=ID%>&cmd=SetSpotIndex&bioassayset_id=<%=bioAssaySetId%>&spotIndex=0" 609 528 title="Go the first position"><base:icon image="first.png" /></a> 529 <% 530 } 531 if (positionIndex <= 0) 532 { 533 %> 534 <base:icon image="previous.png" enabled="false" /> 535 <% 536 } 537 else 538 { 539 %> 610 540 <a href="index.jsp?ID=<%=ID%>&cmd=SetSpotIndex&bioassayset_id=<%=bioAssaySetId%>&spotIndex=<%=positionIndex-1%>" 611 541 title="Go the previous position"><base:icon image="previous.png" /></a> … … 649 579 </tbl:label> 650 580 <tbl:button 581 id="btnSpotColumns" 651 582 image="columns.png" 652 onclick="configureColumns()"653 583 title="Columns…" 654 584 tooltip="Show, hide and re-order columns" 655 585 /> 656 586 <tbl:button 587 id="btnAssayPlot" 657 588 image="plotter.png" 658 onclick="assayPlot()"659 589 title="Plot…" 660 590 tooltip="Plot selected data from this table" … … 675 605 name="bioassayset_id" 676 606 value="<%=String.valueOf(bioAssaySetId)%>" 607 /> 608 <tbl:hidden 609 name="reporter_index" 610 value="<%=String.valueOf(reporterIndex)%>" 611 /> 612 <tbl:hidden 613 name="position_index" 614 value="<%=String.valueOf(positionIndex)%>" 677 615 /> 678 616 <% … … 817 755 } 818 756 %> 819 <script> 820 function init() 757 <% 758 JSONArray jsonAnnotationSummary = new JSONArray(); 759 for (Map.Entry<AnnotationType, AnnotationSummary> entry : selectedAnnotationTypes.entrySet()) 821 760 { 822 <% 823 for (Map.Entry<AnnotationType, AnnotationSummary> entry : selectedAnnotationTypes.entrySet()) 761 AnnotationType at = entry.getKey(); 762 AnnotationSummary summary = entry.getValue(); 763 if (summary != null) 824 764 { 825 AnnotationType at = entry.getKey(); 826 AnnotationSummary summary = entry.getValue(); 827 if (summary != null) 828 { 829 for (AnnotationGroup ag : summary.getAnnotationGroups()) 765 JSONObject jsonAnnotationType = new JSONObject(); 766 jsonAnnotationType.put("id", at.getId()); 767 jsonAnnotationSummary.add(jsonAnnotationType); 768 769 JSONArray jsonGroups = new JSONArray(); 770 jsonAnnotationType.put("groups", jsonGroups); 771 772 for (AnnotationGroup ag : summary.getAnnotationGroups()) 773 { 774 JSONObject jsonGroup = new JSONObject(); 775 jsonGroups.add(jsonGroup); 776 jsonGroup.put("id", ag.getId()); 777 jsonGroup.put("count", ag.getCount(1)); 778 779 JSONArray jsonCh = new JSONArray(); 780 jsonGroup.put("mean", jsonCh); 781 for (int ch = 1; ch <= channels; ++ch) 830 782 { 831 for (int ch = 1; ch <= channels; ++ch) 832 { 833 %> 834 var div = document.getElementById('mean.<%=at.getId()%>.<%=ag.getId()%>.ch<%=ch%>'); 835 div.innerHTML = '<%=Values.formatNumber(ag.getMean(ch), 2)%>'; 836 <% 837 } 838 %> 839 var div = document.getElementById('count.<%=at.getId()%>.<%=ag.getId()%>'); 840 div.innerHTML = '<%=ag.getCount(1)%>'; 841 <% 842 if (hasRatio) 843 { 844 float r = ag.getStatistics("logratio"); 845 int count = ag.getCount(1); 846 float gMean = count > 0 ? (float)Math.exp(r / count) : Float.NaN; 847 float sd = count > 1 ? 848 (float)Math.sqrt((ag.getStatistics("logratio2") - r * (r / count))/(count-1)) 849 : Float.NaN; 850 %> 851 var div = document.getElementById('gmean.<%=at.getId()%>.<%=ag.getId()%>'); 852 div.innerHTML = '<%=Values.formatNumber(gMean, 2)%>'; 853 var div = document.getElementById('sd.<%=at.getId()%>.<%=ag.getId()%>'); 854 div.innerHTML = '<%=Values.formatNumber(sd, 2)%>'; 855 <% 856 } 783 jsonCh.add(Values.formatNumber(ag.getMean(ch), 2)); 857 784 } 785 if (hasRatio) 786 { 787 float r = ag.getStatistics("logratio"); 788 int count = ag.getCount(1); 789 float gMean = count > 0 ? (float)Math.exp(r / count) : Float.NaN; 790 float sd = count > 1 ? 791 (float)Math.sqrt((ag.getStatistics("logratio2") - r * (r / count))/(count-1)) 792 : Float.NaN; 793 jsonGroup.put("gmean", Values.formatNumber(gMean, 2)); 794 jsonGroup.put("sd", Values.formatNumber(sd, 2)); 795 } 858 796 } 859 797 } 860 %>861 var options = new Array();862 <%863 if (annotationTypes != null)864 {865 for (AnnotationType at : annotationTypes)866 {867 String isSelected = selectedAnnotationTypes.containsKey(at) ? "true" : "false";868 %>869 options[options.length] = {key:'<%=at.getId()%>', value:'<%=HTML.javaScriptEncode(at.getName())%>', selected:<%=isSelected%>};870 <%871 }872 }873 %>874 798 } 875 Main.onLoad(init); 876 </script> 799 %> 800 <div id="annotation-summary" class="data-container" 801 data-channels="<%=channels%>" 802 data-summary="<%=HTML.encodeTags(jsonAnnotationSummary.toJSONString()) %>" 803 ></div> 877 804 <% 878 805 } -
trunk/www/views/experiments/extravalues/index.jsp
r6192 r6315 76 76 77 77 final String viewPage = "view_extravalue.jsp?ID="+ID+"&experiment_id="+experimentId; 78 sc.getCurrentContext(Item.EXPERIMENT).setId(experimentId);78 if (experimentId > 0) sc.getCurrentContext(Item.EXPERIMENT).setId(experimentId); 79 79 80 80 String forward = null; -
trunk/www/views/experiments/extravalues/view_extravalue.jsp
r6143 r6315 149 149 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); 150 150 %> 151 <base:page title="<%=title%>" >152 <base:head scripts="table.js,tabcontrol .js,newjoust.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css">151 <base:page title="<%=title%>" id="view-page"> 152 <base:head scripts="table.js,tabcontrol-2.js,~extravalues.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 153 153 <ext:scripts context="<%=jspContext%>" /> 154 154 <ext:stylesheets context="<%=jspContext%>" /> 155 <script>156 function editItem()157 {158 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);159 }160 function deleteItem()161 {162 if (confirm('Extra values are deleted immediately and cannot be restored. Do you want to continue?'))163 {164 location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&experiment_id=<%=experimentId%>&item_id=<%=itemId%>');165 }166 }167 function copyJob(jobId)168 {169 var url = '../../../common/plugin/index.jsp?ID=<%=ID%>';170 url += '&cmd=CopyJob&job_id='+jobId;171 url += '&item_type=BIOASSAYSET&context_type=LIST'172 Main.openPopup(url, 'CopyJob', 750, 500);173 }174 </script>175 155 </base:head> 176 156 <base:body> … … 183 163 /><p:pathelement title="<%=HTML.encodeTags(extraValueType == null ? extraValue.getValueType().toString() : extraValueType.getName()) %>" 184 164 /></p:path> 165 <div id="page-data" 166 data-item-id="<%=itemId%>" 167 data-job-id="<%=job != null ? job.getId() : ""%>" 168 ></div> 185 169 186 170 <t:tabcontrol … … 197 181 <tbl:toolbar subclass="bottomborder"> 198 182 <tbl:button 183 id="btnDelete" 199 184 disabled="<%=!deletePermission%>" 200 185 image="delete.png" 201 onclick="deleteItem()"202 186 title="Delete" 203 187 tooltip="<%=deletePermission ? "Delete this extra value" : "You do not have permission to delete this extra value"%>" 204 188 /> 205 189 <tbl:button 190 id="btnCopy" 206 191 disabled="<%=!writePermission%>" 207 192 image="copy.png" 208 onclick="<%=job == null ? "" : "copyJob('" + job.getId() + "')"%>"209 193 title="Copy…" 210 194 visible="<%=job != null && plugin != null && plugin.isInteractive() %>" … … 212 196 /> 213 197 <tbl:button 198 id="btnImport" 214 199 image="import.png" 215 onclick="<%="runPlugin(" + itemId + ", 'ImportItem')"%>"200 data-plugin-type="IMPORT" 216 201 title="Import…" 217 202 tooltip="Import data" … … 219 204 /> 220 205 <tbl:button 221 image="export.png" 222 onclick="<%="runPlugin(" + itemId + ", 'ExportItem')"%>" 206 id="btnExport" 207 image="export.png" 208 data-plugin-type="EXPORT" 223 209 title="Export…" 224 210 tooltip="Export data" … … 226 212 /> 227 213 <tbl:button 228 image="runplugin.png" 229 onclick="<%="runPlugin(" + itemId + ", 'RunPlugin')"%>" 214 id="btnRunPlugin" 215 image="runplugin.png" 216 data-plugin-type="OTHER" 230 217 title="Run plugin…" 231 218 tooltip="Run a plugin" … … 236 223 <tbl:button 237 224 image="help.png" 238 onclick="<%="Main.openHelp('" + ID +"', 'extravalue.view.properties')"%>" 225 subclass="auto-init" 226 data-auto-init="help" 227 data-help-id="extravalue.view.properties" 239 228 title="Help…" 240 229 tooltip="Get help about this page" -
trunk/www/views/experiments/index.jsp
r6192 r6315 194 194 } 195 195 196 String[] removeRawBioAssays = Values.getString(request.getParameter(" removedRawBioAssays")).split(",");196 String[] removeRawBioAssays = Values.getString(request.getParameter("-RAWBIOASSAY")).split(","); 197 197 for (int i = 0; i < removeRawBioAssays.length; ++i) 198 198 { … … 201 201 } 202 202 203 String[] addRawBioAssays = Values.getString(request.getParameter(" addedRawBioAssays")).split(",");203 String[] addRawBioAssays = Values.getString(request.getParameter("+RAWBIOASSAY")).split(","); 204 204 for (int i = 0; i < addRawBioAssays.length; ++i) 205 205 { … … 208 208 } 209 209 210 String[] removeAnnotationTypes = Values.getString(request.getParameter(" removedAnnotationTypes")).split(",");210 String[] removeAnnotationTypes = Values.getString(request.getParameter("-ANNOTATIONTYPE")).split(","); 211 211 for (int i = 0; i < removeAnnotationTypes.length; ++i) 212 212 { … … 215 215 } 216 216 217 String[] addAnnotationTypes = Values.getString(request.getParameter(" addedAnnotationTypes")).split(",");217 String[] addAnnotationTypes = Values.getString(request.getParameter("+ANNOTATIONTYPE")).split(","); 218 218 for (int i = 0; i < addAnnotationTypes.length; ++i) 219 219 { -
trunk/www/views/experiments/list_experiments.jsp
r6221 r6315 104 104 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 105 105 %> 106 <base:page title="<%=title==null ? "Experiments" : title%>" type="<%=mode.getPageType()%>" >107 <base:head scripts="table.js " styles="table.css,toolbar.css">106 <base:page title="<%=title==null ? "Experiments" : title%>" type="<%=mode.getPageType()%>" id="list-page"> 107 <base:head scripts="table.js,~experiments.js" styles="table.css,toolbar.css"> 108 108 <ext:scripts context="<%=jspContext%>" /> 109 109 <ext:stylesheets context="<%=jspContext%>" /> 110 <script>111 var submitPage = 'index.jsp';112 var formId = 'experiments';113 function newItem()114 {115 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true);116 }117 function editItem(itemId)118 {119 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);120 }121 function viewItem(itemId)122 {123 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);124 }125 function itemOnClick(evt, itemId)126 {127 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);128 }129 function deleteItems()130 {131 var frm = document.forms[formId];132 if (Forms.numChecked(frm) == 0)133 {134 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');135 return;136 }137 frm.action = submitPage;138 frm.cmd.value = 'DeleteItems';139 frm.submit();140 }141 function restoreItems()142 {143 var frm = document.forms[formId];144 if (Forms.numChecked(frm) == 0)145 {146 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');147 return;148 }149 frm.action = submitPage;150 frm.cmd.value = 'RestoreItems';151 frm.submit();152 }153 function setOwner()154 {155 Table.setOwnerOfItems(formId);156 }157 function shareItems()158 {159 Table.shareItems(formId);160 }161 function configureColumns()162 {163 Table.configureColumns(formId);164 }165 function runPlugin(cmd)166 {167 Table.submitToPopup(formId, cmd, 750, 500);168 }169 function returnSelected()170 {171 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);172 window.close();173 }174 </script>175 110 </base:head> 176 111 … … 399 334 > 400 335 <tbl:button 336 id="btnNewItem" 401 337 disabled="<%=!createPermission%>" 402 338 image="new.png" 403 onclick="newItem()"404 339 title="New…" 405 340 tooltip="<%=createPermission ? "Create new experiment" : "You do not have permission to create experiments"%>" 406 341 /> 407 342 <tbl:button 343 id="btnDeleteItems" 408 344 image="delete.png" 409 onclick="deleteItems()"410 345 title="Delete" 411 346 tooltip="Delete the selected items" 412 347 /> 413 348 <tbl:button 349 id="btnRestoreItems" 414 350 image="restore.png" 415 onclick="restoreItems()"416 351 title="Restore" 417 352 tooltip="Restore the selected (deleted) items" 418 353 /> 419 354 <tbl:button 355 id="btnShareItems" 420 356 image="share.png" 421 onclick="shareItems()"422 357 title="Share…" 423 358 tooltip="Share the selected items" 424 359 /> 425 360 <tbl:button 361 id="btnSetOwner" 426 362 image="take_ownership.png" 427 onclick="setOwner()"428 363 title="Set owner…" 429 364 tooltip="Change owner of the selected items" 430 365 /> 431 366 <tbl:button 367 id="btnColumns" 432 368 image="columns.png" 433 onclick="configureColumns()"434 369 title="Columns…" 435 370 tooltip="Show, hide and re-order columns" 436 371 /> 437 372 <tbl:button 373 id="btnImport" 374 data-plugin-type="IMPORT" 438 375 image="import.png" 439 onclick="runPlugin('ImportItems')"440 376 title="Import…" 441 377 tooltip="Import data" … … 443 379 /> 444 380 <tbl:button 381 id="btnExport" 382 data-plugin-type="EXPORT" 445 383 image="export.png" 446 onclick="runPlugin('ExportItems')"447 384 title="Export…" 448 385 tooltip="Export data" … … 450 387 /> 451 388 <tbl:button 389 id="btnRunPlugin" 390 data-plugin-type="OTHER" 452 391 image="runplugin.png" 453 onclick="runPlugin('RunListPlugin')"454 392 title="Run plugin…" 455 393 tooltip="Run a plugin" … … 569 507 visible="<%=item.isShared()%>" 570 508 /> </tbl:header> 571 <tbl:cell column="name"><div class="link" 572 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 509 <tbl:cell column="name"><div 510 class="link table-item" 511 data-item-id="<%=itemId%>" 512 data-no-edit="<%=writePermission ? 0 : 1 %>" 513 tabindex="0" 573 514 title="<%=tooltip%>"><%=name%></div></tbl:cell> 574 515 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 651 592 652 593 <base:buttongroup subclass="dialogbuttons"> 653 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />654 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />655 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />594 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 595 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 596 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 656 597 </base:buttongroup> 657 598 -
trunk/www/views/experiments/plotter/download.jsp
r6136 r6315 34 34 final SessionControl sc = Base.getExistingSessionControl(pageContext, true); 35 35 final String ID = sc.getId(); 36 final String plotUrl = request.getParameter("plot"); 36 37 %> 37 38 <base:page type="popup" title="Generating plot"> 38 <base:head> 39 <script> 40 function download() 41 { 42 var url = window.opener.generatePlotUrl(true); 43 url += '&download=1'; 44 location.href = url; 45 } 46 </script> 47 </base:head> 48 <base:body onload="download()"> 39 <base:head scripts="~download.js" /> 40 <base:body> 49 41 <h1>Generating plot...</h1> 50 42 <div id="page-data" class="datacontainer" 43 data-plot-url="<%=HTML.encodeTags(plotUrl) %>" 44 ></div> 51 45 <div class="content"> 52 46 <table class="fullcc"><tr><td> … … 56 50 57 51 <base:buttongroup subclass="dialogbuttons"> 58 <base:button onclick="window.close();" title="Close" />52 <base:button id="close" title="Close" /> 59 53 </base:buttongroup> 60 54 </base:body> -
trunk/www/views/experiments/plotter/index.jsp
r6176 r6315 136 136 %> 137 137 <base:page type="popup" title="<%=title%>"> 138 <base:head styles="tabcontrol.css" scripts="tabcontrol.js"> 139 <script> 140 141 function validate() 142 { 143 var plotType = getPlotType(); 144 if (plotType == 'scatter') 145 { 146 return validateScatterPlot(); 147 } 148 else if (plotType == 'histogram') 149 { 150 return validateHistogramPlot(); 151 } 152 return false; 153 } 154 function validateScatterPlot() 155 { 156 var frm = document.forms['plot']; 157 if (Main.trimString(frm.yFormulaScatter.value) == '') 158 { 159 Forms.showNotification(frm.yFormulaScatter, 'You must enter an expression for the Y axis'); 160 return false; 161 } 162 else if (Main.trimString(frm.xFormulaScatter.value) == '') 163 { 164 Forms.showNotification(frm.xFormulaScatter, 'You must enter an expression for the X axis'); 165 return false; 166 } 167 return true; 168 } 169 function validateHistogramPlot() 170 { 171 var frm = document.forms['plot']; 172 var yAggregate = Forms.getCheckedRadio(frm.yAggregate).value; 173 if (Main.trimString(frm.xFormulaHistogram.value) == '') 174 { 175 Forms.showNotification(frm.xFormulaHistogram, 'You must enter an expression for the X axis'); 176 return false; 177 } 178 else if (yAggregate != 'count' && Main.trimString(frm.yFormulaHistogram.value) == '') 179 { 180 Forms.showNotification(frm.yFormulaHistogram, 'You must enter an expression for the Y axis'); 181 return false; 182 } 183 return true; 184 } 185 186 function getPlotType() 187 { 188 var frm = document.forms['plot']; 189 return Forms.getCheckedRadio(frm.plotType).value; 190 } 191 192 function plotTypeOnChange() 193 { 194 var isScatter = getPlotType() == 'scatter'; 195 Main.showHide('scatterSection', isScatter); 196 Main.showHide('histogramSection', !isScatter); 197 } 198 199 function presetOnChange(list, formula, label) 200 { 201 var index = list.selectedIndex; 202 formula.value = list[index].value; 203 if (label && list[index].value != '') label.value = list[index].text; 204 list.selectedIndex = 0; 205 } 206 207 function aggregateOnChange() 208 { 209 var frm = document.forms['plot']; 210 var selected = Forms.getCheckedRadio(frm.yAggregate); 211 var isCount = selected.value == 'count'; 212 frm.yFormulaHistogram.disabled = isCount; 213 frm.yPresetsHistogram.disabled = isCount; 214 frm.yLogHistogram.disabled = isCount; 215 for (var i = 0; i < frm.hiloAggregate.length; i++) 216 { 217 frm.hiloAggregate[i].disabled = isCount; 218 } 219 if (isCount) 220 { 221 Main.removeClass(frm.yFormulaHistogram, 'required'); 222 frm.yLabelHistogram.value = 'Count'; 223 } 224 else 225 { 226 Main.addClass(frm.yFormulaHistogram, 'required'); 227 var yPreset = frm.yPresetsHistogram[frm.yPresetsHistogram.selectedIndex]; 228 if (yPreset.value != '') frm.yLabelHistogram.value = yPresetHistogram.text; 229 } 230 } 231 232 function annotationOnChange(list) 233 { 234 var frm = document.forms['plot']; 235 var selected = list[list.selectedIndex]; 236 var value = selected.value && selected.value != '$' ? selected.text : ''; 237 value = value.replace('\[A\] ', ''); 238 frm.subTitle.value = value; 239 240 if (selected.value.substring(0, 1) == '$') 241 { 242 frm.annotationExp.disabled = true; 243 } 244 else 245 { 246 if (selected.value) 247 { 248 frm.annotationExp.value = selected.value; 249 } 250 frm.annotationExp.disabled = false; 251 frm.annotationExp.focus(); 252 } 253 } 254 255 function annotationExpressionOnChange() 256 { 257 var frm = document.forms['plot']; 258 frm.annotationPresets.selectedIndex = annotationFrm.annotationPresets.length-1; 259 } 260 261 function generatePlotUrl(fullSize) 262 { 263 if (validate()) 264 { 265 var frm = document.forms['plot']; 266 var url = 'plot?ID=<%=ID%>&bioassayset_id=<%=bioAssaySetId%>&bioassay_id=<%=bioAssayId%>'; 267 url += '&title='+Main.encodeURI(frm.title.value); 268 url += '&subTitle='+Main.encodeURI(frm.subTitle.value); 269 if (fullSize) 270 { 271 url += '&width='+frm.width.value; 272 url += '&height='+frm.height.value; 273 } 274 275 if (frm.filter.value != '') 276 { 277 url += '&filter='+Main.encodeURI(frm.filter.value); 278 } 279 280 var annotation = ''; 281 if (!frm.annotationExp.disabled) 282 { 283 if (frm.annotationExp.value) 284 { 285 annotation = '=' + frm.annotationExp.value; 286 } 287 } 288 else 289 { 290 annotation = frm.annotationPresets[frm.annotationPresets.selectedIndex].value.substring(1); 291 } 292 if (annotation) 293 { 294 url += '&annotation='+Main.encodeURI(annotation); 295 } 296 297 var plotType = getPlotType(); 298 if (plotType == 'scatter') 299 { 300 url += '&type=scatter'; 301 url += '&x='+Main.encodeURI(frm.xFormulaScatter.value); 302 url += '&xLabel='+Main.encodeURI(frm.xLabelScatter.value); 303 url += '&xLog='+(frm.xLogScatter.checked ? 1 : 0); 304 url += '&y='+Main.encodeURI(frm.yFormulaScatter.value); 305 url += '&yLabel='+Main.encodeURI(frm.yLabelScatter.value); 306 url += '&yLog='+(frm.yLogScatter.checked ? 1 : 0); 307 } 308 else 309 { 310 var yAggregate = Forms.getCheckedRadio(frm.yAggregate).value; 311 url += '&type=histogram'; 312 url += '&x='+Main.encodeURI(frm.xFormulaHistogram.value); 313 url += '&xLabel='+Main.encodeURI(frm.xLabelHistogram.value); 314 url += '&xLog='+(frm.xLogHistogram.checked ? 1 : 0); 315 url += '&binSize='+Main.encodeURI(frm.binSize.value); 316 url += '&yAggregate='+yAggregate; 317 url += '&yLabel='+Main.encodeURI(frm.yLabelHistogram.value); 318 if (yAggregate != 'count') 319 { 320 url += '&y='+Main.encodeURI(frm.yFormulaHistogram.value); 321 url += '&yLog='+(frm.yLogHistogram.checked ? 1 : 0); 322 url += '&hiloAggregate='+Forms.getCheckedRadio(frm.hiloAggregate).value 323 } 324 } 325 return url; 326 } 327 } 328 329 function openExpressionBuilder(title, frmName, inputName, formulaType) 330 { 331 if (!document.forms[frmName][inputName].disabled) 332 { 333 var restrictions = formulaType == '<%=Formula.Type.COLUMN_RESTRICTION.name()%>'; 334 Main.expressionBuilder('<%=ID%>', title, frmName, inputName, formulaType, '<%=rdt.getId()%>', <%=rdt.getChannels()%>, restrictions, <%=bas.getId()%>); 335 } 336 } 337 338 function previewPlot() 339 { 340 var url = generatePlotUrl(false); 341 if (url) 342 { 343 url += '&width=540&height=360'; 344 345 var overlayImg = document.getElementById('overlay'); 346 overlayImg.src = getRoot()+'images/plot_generating.gif'; 347 348 var previewImg = document.getElementById('preview'); 349 previewImg.realImg = new Image(); 350 previewImg.realImg.onload = changePreviewImage; 351 previewImg.realImg.src = url; 352 } 353 } 354 355 function changePreviewImage() 356 { 357 var previewImg = document.getElementById('preview'); 358 previewImg.src = previewImg.realImg.src; 359 previewImg.realImg = null; 360 var overlayImg = document.getElementById('overlay'); 361 overlayImg.src = getRoot() + 'images/blankbutton.gif'; 362 } 363 364 function viewPlot() 365 { 366 var url = generatePlotUrl(true); 367 if (url) 368 { 369 var frm = document.forms['plot']; 370 var width = parseInt(frm.width.value); 371 var height = parseInt(frm.height.value); 372 if (!width || width < 600) width = 600; 373 if (!height || height < 400) height = 400; 374 Main.openPopup('view.jsp?ID=<%=ID%>&title='+Main.encodeURI(frm.title.value), 'ViewPlot', width+150, height+100); 375 } 376 } 377 378 function downloadPlot() 379 { 380 var url = generatePlotUrl(true); 381 if (url) 382 { 383 Main.openPopup('download.jsp?ID=<%=ID%>', 'DownloadPlot', 300, 200); 384 } 385 } 386 387 function savePlotAs() 388 { 389 var url = generatePlotUrl(true); 390 if (url) 391 { 392 Main.openPopup('save_as.jsp?ID=<%=ID%>', 'SavePlotAs', 450, 300); 393 } 394 } 395 396 function init() 397 { 398 } 399 </script> 400 </base:head> 401 <base:body onload="init()"> 138 <base:head scripts="~plotter.js" /> 139 <base:body> 402 140 <h1><%=title%> <base:help helpid="plotter" /></h1> 141 142 <div id="page-data" class="datacontainer" 143 data-bioassayset="<%=bioAssaySetId %>" 144 data-bioassay="<%=bioAssayId %>" 145 ></div> 146 403 147 <form name="plot"> 404 148 <div class="content bottomborder"> … … 418 162 <tr> 419 163 <th>Width</th> 420 <td colspan="2"><input type="text" class="text" style="width: 10em;" maxlength="10" name="width"421 value="900" onkeypress="return Numbers.integerOnly(event)"> (not used by preview)</td>164 <td colspan="2"><input type="text" class="text" name="width" id="width" 165 style="width: 10em;" maxlength="10" value="900"> (not used by preview)</td> 422 166 </tr> 423 167 <tr> 424 168 <th>Height</th> 425 <td colspan="2"><input type="text" class="text" style="width: 10em;" maxlength="10" name="height"426 value="600" onkeypress="return Numbers.integerOnly(event)"></td>169 <td colspan="2"><input type="text" class="text" name="height" id="height" 170 style="width: 10em;" maxlength="10" value="600"></td> 427 171 </tr> 428 172 <tr> … … 435 179 <th>Plot type</th> 436 180 <td colspan="2"> 437 <input type="radio" name="plotType" value="scatter" onchange="plotTypeOnChange()"181 <input type="radio" name="plotType" value="scatter" 438 182 id="plotTypeScatter" checked><label for="plotTypeScatter">Scatter</label> 439 <input type="radio" name="plotType" value="histogram" onchange="plotTypeOnChange()"183 <input type="radio" name="plotType" value="histogram" 440 184 id="plotTypeHistogram"><label for="plotTypeHistogram">Histogram</label> 441 185 </td> … … 446 190 <th>Y-axis</th> 447 191 <td> 448 <select name="yPresetsScatter" style="width: 25em;" 449 onchange="presetOnChange(this, this.form.yFormulaScatter, this.form.yLabelScatter)" 192 <select name="yPresetsScatter" id="yPresetsScatter" 193 class="auto-init" 194 data-auto-init="formula-presets" 195 data-formula-id="yFormulaScatter" 196 data-label-id="yLabelScatter" 197 style="width: 25em;" 450 198 > 451 199 <option value="">- select from list or enter formula below - … … 457 205 <tr> 458 206 <th class="subprompt">Expression</th> 459 <td><input type="text" class="text required" maxlength="255" name="yFormulaScatter" ></td>207 <td><input type="text" class="text required" maxlength="255" name="yFormulaScatter" id="yFormulaScatter"></td> 460 208 <td> 461 209 <base:icon 210 id="btnExpressionBuilderYScatter" 211 subclass="auto-init" 212 data-auto-init="expression-builder" 213 data-formula-id="yFormulaScatter" 214 data-title="Y-axis expression" 215 data-formula-type="COLUMN_EXPRESSION" 216 data-raw-data-type="<%=rdt.getId() %>" 217 data-channels="<%=rdt.getChannels() %>" 218 data-bioassayset="<%=bioAssaySetId %>" 462 219 image="expression_builder.png" 463 220 tooltip="Use the Expression builder" 464 onclick="openExpressionBuilder('Y-axis expression', 'plot', 'yFormulaScatter', 'COLUMN_EXPRESSION')"465 221 /> 466 222 </td> … … 468 224 <tr> 469 225 <th class="subprompt">Y label</th> 470 <td><input type="text" class="text" maxlength="255" name="yLabelScatter" value=""></td>226 <td><input type="text" class="text" maxlength="255" name="yLabelScatter" id="yLabelScatter" value=""></td> 471 227 <td></td> 472 228 </tr> … … 479 235 <th>X-axis</th> 480 236 <td> 481 <select name="xPresetsScatter" style="width: 25em;" 482 onchange="presetOnChange(this, this.form.xFormulaScatter, this.form.xLabelScatter)" 237 <select name="xPresetsScatter" id="xPresetsScatter" 238 class="auto-init" 239 data-auto-init="formula-presets" 240 data-formula-id="xFormulaScatter" 241 data-label-id="xLabelScatter" 242 style="width: 25em;" 483 243 > 484 244 <option value="">- select from list or enter formula below - … … 490 250 <tr> 491 251 <th class="subprompt">Expression</th> 492 <td><input type="text" class="text required" maxlength="255" name="xFormulaScatter" ></td>252 <td><input type="text" class="text required" maxlength="255" name="xFormulaScatter" id="xFormulaScatter"></td> 493 253 <td> 494 254 <base:icon 255 id="btnExpressionBuilderXScatter" 256 subclass="auto-init" 257 data-auto-init="expression-builder" 258 data-formula-id="xFormulaScatter" 259 data-title="X-axis expression" 260 data-formula-type="COLUMN_EXPRESSION" 261 data-raw-data-type="<%=rdt.getId() %>" 262 data-channels="<%=rdt.getChannels() %>" 263 data-bioassayset="<%=bioAssaySetId %>" 495 264 image="expression_builder.png" 496 265 tooltip="Use the Expression builder" 497 onclick="openExpressionBuilder('X-axis expression', 'plot', 'xFormulaScatter', 'COLUMN_EXPRESSION')"498 266 /> 499 267 </td> … … 501 269 <tr> 502 270 <th class="subprompt">X label</th> 503 <td><input type="text" class="text" maxlength="255" name="xLabelScatter" value=""></td>271 <td><input type="text" class="text" maxlength="255" name="xLabelScatter" id="xLabelScatter" value=""></td> 504 272 <td></td> 505 273 </tr> … … 516 284 <td> 517 285 <input type="radio" name="yAggregate" id="yAggregateCount" value="count" checked 518 onchange="aggregateOnChange()"><label for="yAggregateCount">Count</label>286 ><label for="yAggregateCount">Count</label> 519 287 <input type="radio" name="yAggregate" id="yAggregateMean" value="mean" 520 onchange="aggregateOnChange()"><label for="yAggregateMean">Mean</label>288 ><label for="yAggregateMean">Mean</label> 521 289 </td> 522 290 <td></td> … … 537 305 <th class="subprompt">Presets</th> 538 306 <td> 539 <select name="yPresetsHistogram" style="width: 25em;" 540 onchange="presetOnChange(this, this.form.yFormulaHistogram, this.form.yLabelHistogram)" 307 <select name="yPresetsHistogram" id="yPresetsHistogram" 308 class="auto-init" 309 data-auto-init="formula-presets" 310 data-formula-id="yFormulaHistogram" 311 data-label-id="yLabelHistogram" 312 style="width: 25em;" 541 313 disabled 542 314 > … … 549 321 <tr> 550 322 <th class="subprompt">Expression</th> 551 <td><input type="text" class="text" maxlength="255" name="yFormulaHistogram" disabled></td>323 <td><input type="text" class="text" maxlength="255" name="yFormulaHistogram" id="yFormulaHistogram" disabled></td> 552 324 <td> 553 325 <base:icon 326 id="btnExpressionBuilderYHistogram" 327 subclass="auto-init" 328 data-auto-init="expression-builder" 329 data-formula-id="yFormulaHistogram" 330 data-title="Y-axis expression" 331 data-formula-type="COLUMN_EXPRESSION" 332 data-raw-data-type="<%=rdt.getId() %>" 333 data-channels="<%=rdt.getChannels() %>" 334 data-bioassayset="<%=bioAssaySetId %>" 554 335 image="expression_builder.png" 555 336 tooltip="Use the Expression builder" 556 onclick="openExpressionBuilder('Y-axis expression', 'plot', 'yFormulaHistogram', 'COLUMN_EXPRESSION')"557 337 /> 558 338 </td> … … 560 340 <tr> 561 341 <th class="subprompt">Y label</th> 562 <td><input type="text" class="text" maxlength="255" name="yLabelHistogram" value="Count"></td>342 <td><input type="text" class="text" maxlength="255" name="yLabelHistogram" id="yLabelHistogram" value="Count"></td> 563 343 <td></td> 564 344 </tr> … … 571 351 <th>X-axis</th> 572 352 <td> 573 <select name="xPresetsHistogram" style="width: 25em;" 574 onchange="presetOnChange(this, this.form.xFormulaHistogram, this.form.xLabelHistogram)" 353 <select name="xPresetsHistogram" id="xPresetsHistogram" 354 class="auto-init" 355 data-auto-init="formula-presets" 356 data-formula-id="xFormulaHistogram" 357 data-label-id="xLabelHistogram" 358 style="width: 25em;" 575 359 > 576 360 <option value="">- select from list or enter formula below - … … 582 366 <tr> 583 367 <th class="subprompt">Expression</th> 584 <td><input type="text" class="text required" maxlength="255" name="xFormulaHistogram" ></td>368 <td><input type="text" class="text required" maxlength="255" name="xFormulaHistogram" id="xFormulaHistogram"></td> 585 369 <td> 586 370 <base:icon 371 id="btnExpressionBuilderXHistogram" 372 subclass="auto-init" 373 data-auto-init="expression-builder" 374 data-formula-id="xFormulaHistogram" 375 data-title="X-axis expression" 376 data-formula-type="COLUMN_EXPRESSION" 377 data-raw-data-type="<%=rdt.getId() %>" 378 data-channels="<%=rdt.getChannels() %>" 379 data-bioassayset="<%=bioAssaySetId %>" 587 380 image="expression_builder.png" 588 381 tooltip="Use the Expression builder" 589 onclick="openExpressionBuilder('X-axis expression', 'plot', 'xFormulaHistogram', 'COLUMN_EXPRESSION')"590 382 /> 591 383 </td> … … 593 385 <tr> 594 386 <th class="subprompt">X label</th> 595 <td><input type="text" class="text" maxlength="255" name="xLabelHistogram" value=""></td>387 <td><input type="text" class="text" maxlength="255" name="xLabelHistogram" id="xLabelHistogram" value=""></td> 596 388 <td></td> 597 389 </tr> … … 622 414 <th>Filter</th> 623 415 <td colspan="2"> 624 <select name="filterPresets" style="width: 25em;" 625 onchange="presetOnChange(this, this.form.filter, null)" 416 <select name="filterPresets" id="filterPresets" 417 class="auto-init" 418 data-auto-init="formula-presets" 419 data-formula-id="filter" 420 style="width: 25em;" 626 421 > 627 422 <option value="">- select from list or enter formula below - … … 632 427 <tr> 633 428 <th class="subprompt"></th> 634 <td><input type="text" class="text" maxlength="255" name="filter" placeholder="leave empty to plot all values"></td>429 <td><input type="text" class="text" maxlength="255" name="filter" id="filter" placeholder="leave empty to plot all values"></td> 635 430 <td> 636 431 <base:icon 432 id="btnExpressionBuilderFilter" 433 subclass="auto-init" 434 data-auto-init="expression-builder" 435 data-formula-id="filter" 436 data-title="Filter expression" 437 data-formula-type="COLUMN_RESTRICTION" 438 data-raw-data-type="<%=rdt.getId() %>" 439 data-channels="<%=rdt.getChannels() %>" 440 data-bioassayset="<%=bioAssaySetId %>" 637 441 image="expression_builder.png" 638 442 tooltip="Use the Expression builder" 639 onclick="openExpressionBuilder('Filter expression', 'plot', 'filter', 'COLUMN_RESTRICTION')"640 443 /> 641 444 </td> … … 644 447 <th>Annotation</th> 645 448 <td colspan="2"> 646 <select name="annotationPresets" onchange="annotationOnChange(this)" style="width: 25em;">449 <select name="annotationPresets" id="annotationPresets" style="width: 25em;"> 647 450 <option value="$">- none - 648 451 <% … … 677 480 <tr> 678 481 <th class="subprompt"></th> 679 <td><input type="text" class="text" maxlength="255" name="annotationExp" 680 onchange="annotationExpressionOnChange()" disabled></td> 482 <td><input type="text" class="text" maxlength="255" name="annotationExp" id="annotationExp" disabled></td> 681 483 <td> 682 484 <base:icon 485 id="btnExpressionBuilderAnnotation" 486 subclass="auto-init" 487 data-auto-init="expression-builder" 488 data-formula-id="annotationExp" 489 data-title="Annotation filter" 490 data-formula-type="COLUMN_RESTRICTION" 491 data-raw-data-type="<%=rdt.getId() %>" 492 data-channels="<%=rdt.getChannels() %>" 493 data-bioassayset="<%=bioAssaySetId %>" 683 494 image="expression_builder.png" 684 495 tooltip="Use the Expression builder" 685 onclick="openExpressionBuilder('Annotation filter', 'plot', 'annotationExp', 'COLUMN_RESTRICTION')"686 496 /> 687 497 </td> … … 706 516 707 517 <base:buttongroup subclass="dialogbuttons"> 708 <base:button title="Preview" onclick="previewPlot()" 709 image="plotter_preview.png" tooltip="Generate a preview of the plot" 518 <base:button 519 id="btnPreviewPlot" 520 title="Preview" 521 image="plotter_preview.png" 522 tooltip="Generate a preview of the plot" 710 523 /> 711 <base:button title="View…" onclick="viewPlot()" 712 image="plotter.png" tooltip="View a fullsized version of the plot (in a popup)" 524 <base:button 525 id="btnViewPlot" 526 title="View…" 527 image="plotter.png" 528 tooltip="View a fullsized version of the plot (in a popup)" 713 529 /> 714 <base:button title="Download…" onclick="downloadPlot()" 530 <base:button 531 id="btnDownloadPlot" 532 title="Download…" 715 533 image="download.png" 716 534 tooltip="Downlad a fullsized version of the plot to your computer" 717 535 /> 718 <base:button title="Save as…" onclick="savePlotAs()" 536 <base:button 537 id="btnSavePlot" 538 title="Save as…" 719 539 image="saveas.png" 720 540 disabled="<%=!hasCreateFilePermission%>" … … 723 543 "You don't have permission to create files" %>" 724 544 /> 725 <base:button onclick="window.close()" title="Close" />545 <base:button id="close" title="Close" /> 726 546 </base:buttongroup> 727 547 -
trunk/www/views/experiments/plotter/save_as.jsp
r6176 r6315 34 34 final SessionControl sc = Base.getExistingSessionControl(pageContext, true); 35 35 final String ID = sc.getId(); 36 final String plotUrl = request.getParameter("plot"); 36 37 %> 37 38 <base:page type="popup" title="Save as"> 38 <base:head> 39 <script> 40 // Initialise - set focus to filename field 41 function init() 42 { 43 var frm = document.forms['saveas']; 44 frm.path.value = window.opener.lastPath ? window.opener.lastPath : ''; 45 frm.path.focus(); 46 } 47 48 // Validate the form 49 function validateForm() 50 { 51 var frm = document.forms['saveas']; 52 if (Main.trimString(frm.path.value) == '') 53 { 54 Forms.showNotification(frm.path, 'Please enter a filename'); 55 return false; 56 } 57 return true; 58 } 39 <base:head scripts="~save_as.js" /> 40 <base:body> 41 <h1>Save plot</h1> 59 42 60 function browseOnClick() 61 { 62 Main.openPopup(getRoot()+'filemanager/save_as.jsp?ID=<%=ID%>&callback=setFileCallback', 'SaveAs', 1050, 700); 63 } 64 function setFileCallback(path) 65 { 66 var frm = document.forms['saveas']; 67 frm.path.value = path; 68 } 69 70 // Submit the form 71 function saveAs() 72 { 73 var frm = document.forms['saveas']; 74 if (validateForm()) 75 { 76 var url = window.opener.generatePlotUrl(true); 77 if (url) 78 { 79 window.opener.lastPath = frm.path.value; 80 url += '&saveAs=' + frm.path.value; 81 url += '&overwrite=' + (frm.overwrite.checked ? 1 : 0); 82 Main.hide('save'); 83 Main.hide('buttons'); 84 Main.show('generating'); 85 location.href = url; 86 } 87 } 88 } 89 </script> 90 </base:head> 91 <base:body onload="init()"> 92 <h1>Save plot</h1> 43 <div id="page-data" class="datacontainer" 44 data-plot-url="<%=HTML.encodeTags(plotUrl) %>" 45 ></div> 93 46 94 47 <form name="saveas"> … … 100 53 <table style="width: 100%;"> 101 54 <tr> 102 <td><input type="text" class="text required" name="path" value=""></td>55 <td><input type="text" class="text required" name="path" id="path" value=""></td> 103 56 <td style="width: 10em;"><base:button 104 57 id="btnBrowse" 105 58 title="Browse…" 106 onclick="browseOnClick()"107 59 /></td> 108 60 </tr> … … 124 76 125 77 <base:buttongroup subclass="dialogbuttons" id="buttons"> 126 <base:button onclick="saveAs();" title="Ok" />127 <base:button onclick="window.close();" title="Cancel" />78 <base:button id="btnSave" title="Ok" /> 79 <base:button id="close" title="Cancel" /> 128 80 </base:buttongroup> 129 81 -
trunk/www/views/experiments/plotter/view.jsp
r6143 r6315 35 35 final String ID = sc.getId(); 36 36 final String title = Values.getString(request.getParameter("title"), "View plot"); 37 final String plotUrl = request.getParameter("plot"); 37 38 %> 38 <base:page type="popup" title="<%=title%>"> 39 <base:head> 40 <script> 41 // Initialise - set focus to filename field 42 function view() 43 { 44 var url = window.opener.generatePlotUrl(true); 45 var img = document.getElementById('plot'); 46 img.realImg = new Image(); 47 img.realImg.onload = switchImage; 48 img.realImg.src = url; 49 } 50 function switchImage() 51 { 52 var img = document.getElementById('plot'); 53 img.src = img.realImg.src; 54 } 55 </script> 56 </base:head> 57 <base:body onload="view()"> 39 <base:page type="popup" title="<%=HTML.encodeTags(title)%>"> 40 <base:head scripts="~view.js" /> 41 <base:body> 58 42 <h1><%=title%></h1> 59 43 <div class="content"> 60 44 <table class="fullcc"><tr><td> 61 <img src="../../../images/plot_generating.gif" id="plot" alt="please wait..."> 45 <img 46 id="plot" alt="please wait..." 47 src="../../../images/plot_generating.gif" 48 data-plot-url="<%=HTML.encodeTags(plotUrl) %>" 49 > 62 50 </td></tr></table> 63 51 </div> 64 52 65 53 <base:buttongroup subclass="dialogbuttons"> 66 <base:button onclick="window.close();" title="Close" />54 <base:button id="close" title="Close" /> 67 55 </base:buttongroup> 68 56 -
trunk/www/views/experiments/reporters/list_reporters.jsp
r6182 r6315 127 127 %> 128 128 <base:page title="<%=title%>"> 129 <base:head scripts="table.js,tabcontrol.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 130 <script> 131 var submitPage = 'index.jsp'; 132 var formId = 'reporters'; 133 function editItem(itemId) 134 { 135 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true); 136 } 137 function viewItem(itemId) 138 { 139 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false); 140 } 141 function itemOnClick(evt, itemId) 142 { 143 Table.itemOnClick(formId, evt, itemId, 'DEFAULT', viewItem, editItem, null); 144 } 145 function configureColumns() 146 { 147 Table.configureColumns(formId); 148 } 149 function runPlugin(cmd) 150 { 151 Table.submitToPopup(formId, cmd, 750, 500); 152 } 153 function switchTab(tabControlId, tabId) 154 { 155 if (tabId == 'properties' || tabId == 'overview' || tabId == 'history' || tabId == 'annotations') 156 { 157 location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=experimentId%>&tab='+tabId; 158 } 159 else if (tabId == 'bioassaysets') 160 { 161 viewBioAssaySets(); 162 } 163 else 164 { 165 TabControl.setActiveTab(tabControlId, tabId); 166 } 167 } 168 function viewBioAssaySets() 169 { 170 location.href = '../bioassaysets/index.jsp?ID=<%=ID%>&experiment_id=<%=experimentId%>'; 171 } 172 function newReporterList() 173 { 174 Table.submitToPopup(formId, 'CreateReporterList', 600, 400); 175 } 176 function removeClonedReporters() 177 { 178 if (confirm('Are you sure that you want to remove all cloned reporter annotations?\nThis action can\'t be undone.')) 179 { 180 Main.openPopup('../index.jsp?ID=<%=ID%>&cmd=RemoveClonedReporters&item_id=<%=experimentId%>', 'RemoveClonedReporters', 450, 300); 181 } 182 } 183 function updateClonedReporters() 184 { 185 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=UpdateClonedReporters&experiment_id=<%=experimentId%>', 'UpdateClonedReporters', 600, 400); 186 } 187 </script> 188 </base:head> 129 <base:head scripts="table.js,tabcontrol-2.js,~reporters.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css" /> 189 130 <base:body> 190 131 <p:path><p:pathelement … … 196 137 id="main" 197 138 subclass="mastertabcontrol content" 198 active="clonedreporters" switch="switchTab">139 active="clonedreporters"> 199 140 <t:tab id="properties" title="Properties" /> 200 141 <t:tab id="annotations" title="Annotations" … … 271 212 > 272 213 <tbl:button 214 id="btnColumns" 273 215 image="columns.png" 274 onclick="configureColumns()"275 216 title="Columns…" 276 217 tooltip="Show, hide and re-order columns" 277 218 /> 278 219 <tbl:button 220 id="btnNewReporterList" 279 221 image="add.png" 280 onclick="newReporterList()"281 222 title="New reporter list…" 282 223 tooltip="Create a new reporter list from matching spots" … … 284 225 /> 285 226 <tbl:button 227 id="btnUpdateClonedReporters" 286 228 visible="<%=writePermission%>" 287 229 image="refresh.png" 288 onclick="updateClonedReporters()"289 230 title="Update cloned reporters…" 290 231 tooltip="Update all cloned reporter annotations with information from the master table" 291 232 /> 292 233 <tbl:button 234 id="btnRemoveClonedReporters" 293 235 visible="<%=writePermission%>" 294 236 image="delete_permanently.png" 295 onclick="removeClonedReporters()"296 237 title="Remove cloned reporters…" 297 238 tooltip="Remove all cloned reporter annotations" 298 239 /> 299 240 <tbl:button 241 id="btnExport" 242 data-plugin-type="EXPORT" 300 243 image="export.png" 301 onclick="runPlugin('ExportItems')"302 244 title="Export…" 303 245 tooltip="Export data" … … 318 260 <tbl:headers> 319 261 <tbl:headerrow> 320 <tbl:header 321 clazz="index" 322 colspan="2" 323 /> 262 <tbl:header colspan="2" /> 324 263 <tbl:columnheaders /> 325 264 </tbl:headerrow> 326 265 <tbl:headerrow> 266 <tbl:header subclass="index" /> 327 267 <tbl:header 328 clazz="index" 329 colspan="2" 330 /> 268 subclass="check" 269 visible="<%=mode.hasCheck()%>" 270 ><base:icon 271 id="check.uncheck" 272 image="check_uncheck.png" 273 tooltip="Check/uncheck all" 274 275 /></tbl:header> 331 276 <tbl:propertyfilter /> 332 277 </tbl:headerrow> … … 347 292 if (reporters != null) 348 293 { 294 boolean writeReporterPermission = sc.hasPermission(Permission.WRITE, Item.REPORTER); 295 String tooltip = "View this item" + (writeReporterPermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 296 int firstColumnIndex = hasUpToDateColumn ? 3 : 2; 297 int externalIdColumn = selected.selectedIds.indexOf("cln.externalId") + firstColumnIndex; 298 349 299 while (reporters.hasNext()) 350 300 { 351 301 SqlResult item = reporters.next(); 352 302 int itemId = item.getInt(1); 303 String name = HTML.encodeTags(item.getString(externalIdColumn)); 353 304 index++; 354 305 numListed++; … … 359 310 ><%=index%></tbl:header> 360 311 <tbl:header 361 clazz="icons" 362 visible="<%=mode.hasIcons()%>" 363 > </tbl:header> 364 <tbl:cell column="upToDate" visible="<%=hasUpToDateColumn %>"> 365 <%=item.getObject(2) %> 366 </tbl:cell> 312 clazz="check" 313 visible="<%=mode.hasCheck()%>" 314 ><input 315 type="checkbox" 316 name="<%=itemId%>" 317 value="<%=itemId%>" 318 title="<%=name%>" 319 <%=cc.getSelected().contains(itemId) ? "checked" : ""%> 320 ></tbl:header> 321 322 <tbl:cell column="upToDate" visible="<%=hasUpToDateColumn %>"> 323 <%=item.getObject(2) %> 324 </tbl:cell> 367 325 <% 368 int colIndex = hasUpToDateColumn ? 3 : 2;326 int colIndex = firstColumnIndex; 369 327 for (String columnId : selected.selectedIds) 370 328 { 371 if ( "cln.externalId".equals(columnId))329 if (colIndex == externalIdColumn) 372 330 { 373 331 %> 374 <tbl:cell column="cln.externalId"><div class="link" onclick="itemOnClick(event, <%=itemId%>)" 375 title="View this item (use CTRL, ALT or SHIFT to edit)"><%=HTML.encodeTags(item.getString(colIndex))%></div></tbl:cell> 332 <tbl:cell column="cln.externalId"><div 333 class="link table-item" 334 data-item-id="<%=itemId%>" 335 data-no-edit="<%=writeReporterPermission ? 0 : 1 %>" 336 tabindex="0" 337 title="<%=tooltip%>"><%=HTML.encodeTags(name)%></div></tbl:cell> 376 338 <% 377 339 } … … 413 375 414 376 <base:buttongroup> 415 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />416 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />417 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />377 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 378 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 379 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 418 380 </base:buttongroup> 419 381 -
trunk/www/views/experiments/spotdata/list_spotdata.jsp
r6182 r6315 110 110 DynamicUtil.addReporterColumns(columns, dc, experiment.getVirtualDb().getReporterCloneTemplate(), "rep.", "@", "[Rep] "); 111 111 DynamicUtil.SelectedInfo selected = DynamicUtil.getSelectedColumns(cc, columns, false); 112 113 int externalIdColumn = selected.selectedIds.indexOf("rep.externalId") + 1; 114 int reporterIdColumn = selected.selectedIds.indexOf("rep.id") + 1; 115 if (reporterIdColumn <= 0 && externalIdColumn > 0) 116 { 117 // Force selecting reporter id column if external id is selected 118 selected.selectedIds.add("rep.id"); 119 selected.selectedProperties.add("@id"); 120 reporterIdColumn = selected.selectedIds.size(); 121 } 112 122 if (bioAssay == null && cc.getSetting("columns").indexOf("COLUMN") >= 0) 113 123 { … … 136 146 %> 137 147 <base:page title="<%=title%>"> 138 <base:head scripts="table.js,tabcontrol .js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">148 <base:head scripts="table.js,tabcontrol-2.js,~spotdata.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 139 149 <ext:scripts context="<%=jspContext%>" /> 140 150 <ext:stylesheets context="<%=jspContext%>" /> 141 <script>142 var submitPage = 'index.jsp';143 var formId = 'spotdata';144 function configureColumns()145 {146 Table.configureColumns(formId);147 }148 function runPlugin(cmd)149 {150 Table.submitToPopup(formId, cmd, 750, 500);151 }152 function switchTab(tabControlId, tabId)153 {154 if (tabId == 'properties.bioassay')155 {156 location.href = '../bioassays/index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=bioAssayId%>&tab=properties';157 }158 else if (tabId == 'annotations.bioassay')159 {160 location.href = '../bioassays/index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=bioAssayId%>&tab=annotations';161 }162 else if (tabId == 'properties.bioassayset')163 {164 location.href = '../bioassaysets/index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=bioAssaySetId%>&tab=properties';165 }166 else if (tabId == 'annotations.bioassayset')167 {168 location.href = '../bioassaysets/index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=bioAssaySetId%>&tab=annotations';169 }170 else if (tabId == 'overviewplots')171 {172 location.href = '../bioassaysets/index.jsp?ID=<%=ID%>&cmd=ViewItem&experiment_id=<%=experimentId%>&item_id=<%=bioAssaySetId%>&tab='+tabId;173 }174 else if (tabId == 'bioassays')175 {176 location.href = '../bioassays/index.jsp?ID=<%=ID%>&experiment_id=<%=experimentId%>&bioassayset_id=<%=bioAssaySetId%>&tab='+tabId;177 }178 else179 {180 TabControl.setActiveTab(tabControlId, tabId);181 }182 }183 function newReporterList()184 {185 Table.submitToPopup(formId, 'CreateReporterList', 600, 400);186 }187 </script>188 151 </base:head> 189 152 <base:body> … … 211 174 id="main" 212 175 subclass="mastertabcontrol content" 213 active="spotdata" switch="switchTab"> 214 <t:tab id="properties.bioassay" title="Properties" visible="<%=bioAssay != null%>"/> 215 <t:tab id="properties.bioassayset" title="Properties" visible="<%=bioAssay == null%>"/> 216 217 <t:tab id="annotations.bioassay" title="Annotations" 176 active="spotdata"> 177 <t:tab id="bioassayset.properties" title="Properties" visible="<%=bioAssay == null%>"/> 178 <t:tab id="bioassay.properties" title="Properties" visible="<%=bioAssay != null%>"/> 179 180 <t:tab id="bioassayset.annotations" title="Annotations" 181 tooltip="View annotation values" visible="<%=bioAssay == null%>" /> 182 <t:tab id="bioassay.annotations" title="Annotations" 218 183 tooltip="View annotation values" visible="<%=bioAssay != null%>" /> 219 <t:tab id="annotations.bioassayset" title="Annotations"220 tooltip="View annotation values" visible="<%=bioAssay == null%>" />221 184 222 185 <t:tab id="bioassays" visible="<%=bioAssay == null%>" title="BioAssays" /> … … 313 276 > 314 277 <tbl:button 278 id="btnColumns" 315 279 image="columns.png" 316 onclick="configureColumns()"317 280 title="Columns…" 318 281 tooltip="Show, hide and re-order columns" 319 282 /> 320 283 <tbl:button 284 id="btnNewReporterList" 321 285 image="add.png" 322 onclick="newReporterList()"323 286 title="New reporter list…" 324 287 tooltip="Create a new reporter list from matching spots" … … 326 289 /> 327 290 <tbl:button 291 id="btnExport" 292 data-plugin-type="EXPORT" 328 293 image="export.png" 329 onclick="runPlugin('ExportItems')"330 294 title="Export…" 331 295 tooltip="Export data" … … 377 341 if (spotData != null) 378 342 { 343 boolean writeReporterPermission = sc.hasPermission(Permission.WRITE, Item.REPORTER); 344 String tooltip = "View this item" + (writeReporterPermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 379 345 while (spotData.hasNext()) 380 346 { … … 395 361 for (String columnId : selected.selectedIds) 396 362 { 397 %> 398 <tbl:cell column="<%=columnId%>" value="<%=item.getObject(i++)%>" /> 399 <% 363 if (i == externalIdColumn) 364 { 365 %> 366 <tbl:cell column="<%=columnId%>"><div 367 class="link auto-init" 368 data-auto-init="item-link" 369 data-item-id="<%=item.getInt(reporterIdColumn)%>" 370 data-item-type="REPORTER" 371 data-no-edit="<%=writeReporterPermission ? 0 : 1 %>" 372 tabindex="0" 373 title="<%=tooltip%>"><%=HTML.encodeTags(item.getString(i++))%></div></tbl:cell> 374 <% 375 } 376 else 377 { 378 %> 379 <tbl:cell column="<%=columnId%>" value="<%=item.getObject(i++)%>" /> 380 <% 381 } 400 382 } 401 383 %> … … 420 402 </t:tab> 421 403 422 <t:tab id=" overviewplots" title="Overview plots"404 <t:tab id="bioassayset.overviewplots" title="Overview plots" 423 405 visible="<%=overviewPlotInvoker != null && overviewPlotInvoker.getNumExtensions() > 0%>" 424 406 /> … … 426 408 427 409 <base:buttongroup> 428 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />429 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />430 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />410 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 411 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 412 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 431 413 </base:buttongroup> 432 414 -
trunk/www/views/experiments/transformations/edit_transformation.jsp
r6217 r6315 62 62 { 63 63 Transformation transformation = Transformation.getById(dc, itemId); 64 64 transformation.checkPermission(Permission.WRITE); 65 65 66 cc.setObject("item", transformation); 66 67 String title = "Edit transformation -- " + HTML.encodeTags(transformation.getName()); 67 if (transformation != null) transformation.checkPermission(Permission.WRITE);68 69 68 70 69 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), transformation); 71 70 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 72 71 %> 73 <base:page type="popup" title="<%=title%>" >74 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">72 <base:page type="popup" title="<%=title%>" id="edit-page"> 73 <base:head scripts="tabcontrol-2.js,~transformations.js" styles="tabcontrol.css"> 75 74 <ext:scripts context="<%=jspContext%>" /> 76 75 <ext:stylesheets context="<%=jspContext%>" /> 77 <script>78 // Validate the "Transformation" tab79 function validateTransformation()80 {81 var frm = document.forms['transformation'];82 if (frm.name.value == '')83 {84 Forms.showNotification(frm.name, 'You must enter a name');85 return false;86 }87 return true;88 }89 90 // Submit the form91 function saveSettings()92 {93 var frm = document.forms['transformation'];94 if (TabControl.validateActiveTab('settings'))95 {96 frm.submit();97 }98 }99 100 function init()101 {102 var frm = document.forms['transformation'];103 <%104 if (transformation == null)105 {106 %>107 frm.name.focus();108 frm.name.select();109 <%110 }111 %>112 }113 </script>114 76 </base:head> 115 <base:body onload="init()">77 <base:body> 116 78 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 117 79 <form action="index.jsp?ID=<%=ID%>" method="post" name="transformation"> … … 122 84 position="bottom" remember="<%=transformation != null%>" 123 85 extensions="<%=invoker%>"> 124 <t:tab id="info" title="Transformation" 125 validate="validateTransformation()" helpid="transformation.edit"> 86 <t:tab id="info" title="Transformation" helpid="transformation.edit"> 126 87 <table class="fullform input100 smaller"> 127 88 <tr> 128 89 <th>Name</th> 129 <td><input class="text required" type="text" name="name" 130 value="<%=HTML.encodeTags(transformation == null ? Values.getString(cc.getPropertyValue("name"), "New transformation") : transformation.getName())%>" 90 <td><input class="text required auto-init" data-auto-init="focus" 91 type="text" name="name" 92 value="<%=HTML.encodeTags(transformation.getName())%>" 131 93 maxlength="<%=Transformation.MAX_NAME_LENGTH%>"></td> 132 94 <td></td> … … 136 98 <td> 137 99 <textarea class="text" rows="6" name="description" id="description" 138 ><%=HTML.encodeTags(transformation == null ? cc.getPropertyValue("description") : transformation.getDescription())%></textarea>100 ><%=HTML.encodeTags(transformation.getDescription())%></textarea> 139 101 </td> 140 102 <td style="width: 20px;"> … … 152 114 153 115 <base:buttongroup subclass="dialogbuttons"> 154 <base:button onclick="saveSettings()" title="Save" />155 <base:button onclick="window.close()" title="Cancel" />116 <base:button id="btnSave" title="Save" /> 117 <base:button id="close" title="Cancel" /> 156 118 </base:buttongroup> 157 119 </base:body> -
trunk/www/views/experiments/transformations/index.jsp
r6192 r6315 96 96 try 97 97 { 98 if ("ViewItem".equals(cmd)) 98 if ("List".equals(cmd)) 99 { 100 redirect = "../bioassaysets/index.jsp?ID="+ID+"&experiment_id="+experimentId; 101 } 102 else if ("ViewItem".equals(cmd)) 99 103 { 100 104 // Display the view page for a single item -
trunk/www/views/experiments/transformations/view_transformation.jsp
r6143 r6315 140 140 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); 141 141 %> 142 <base:page title="<%=title%>" >143 <base:head scripts="table.js,tabcontrol .js,newjoust.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css">142 <base:page title="<%=title%>" id="view-page"> 143 <base:head scripts="table.js,tabcontrol-2.js,newjoust.js,~transformations.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css"> 144 144 <ext:scripts context="<%=jspContext%>" /> 145 145 <ext:stylesheets context="<%=jspContext%>" /> 146 <script>147 function editItem()148 {149 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);150 }151 function deleteItem()152 {153 location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&experiment_id=<%=experimentId%>&item_id=<%=itemId%>');154 }155 function restoreItem()156 {157 location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&experiment_id=<%=experimentId%>&item_id=<%=itemId%>');158 }159 function runItemPlugin(cmd)160 {161 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&experiment_id=<%=experimentId%>&item_id=<%=itemId%>', 'RunPlugin'+cmd, 750, 500);162 }163 </script>164 146 </base:head> 165 147 <base:body> … … 170 152 /><p:pathelement title="<%=HTML.encodeTags(transformation.getName())%>" 171 153 /></p:path> 154 <div id="page-data" 155 data-item-id="<%=itemId%>" 156 data-experiment-id="<%=experimentId%>" 157 data-job-id="<%=job != null ? job.getId() : ""%>" 158 ></div> 172 159 173 160 <t:tabcontrol 174 161 id="main" 175 162 subclass="content mastertabcontrol" 176 active="<%=tabId%>" switch="switchTab">163 active="<%=tabId%>"> 177 164 <t:tab id="properties" title="Properties"> 178 165 <div> … … 181 168 <th class="itemstatus"> 182 169 <base:icon 170 id="btnDeletePermanently" 183 171 image="deleted.png" 184 onclick="deleteItemPermanently()"185 172 tooltip="This item has been flagged for deletion. Click to delete it now." 186 173 enabled="<%=deletePermission %>" … … 191 178 <tbl:toolbar subclass="bottomborder"> 192 179 <tbl:button 180 id="btnEdit" 193 181 disabled="<%=!writePermission%>" 194 182 image="edit.png" 195 onclick="editItem()"196 183 title="Edit…" 197 184 tooltip="<%=writePermission ? "Edit this transformation" : "You do not have permission to edit this transformation"%>" 198 185 /> 199 186 <tbl:button 187 id="btnDelete" 200 188 disabled="<%=!deletePermission%>" 201 189 image="delete.png" 202 onclick="deleteItem()"203 190 title="Delete" 204 191 visible="<%=!transformation.isRemoved()%>" … … 206 193 /> 207 194 <tbl:button 195 id="btnRestore" 208 196 disabled="<%=!writePermission%>" 209 197 image="restore.png" 210 onclick="restoreItem()"211 198 title="Restore" 212 199 visible="<%=transformation.isRemoved()%>" … … 214 201 /> 215 202 <tbl:button 203 id="btnCopyJob" 216 204 disabled="<%=!writePermission%>" 217 205 image="copy.png" 218 onclick="<%=job == null ? "" : "copyJob('" + job.getId() + "')"%>"219 206 title="Copy…" 220 207 visible="<%=job != null && plugin != null && plugin.isInteractive() %>" … … 222 209 /> 223 210 <tbl:button 211 id="btnImport" 224 212 image="import.png" 225 onclick="runItemPlugin('ImportItem')"213 data-plugin-type="IMPORT" 226 214 title="Import…" 227 215 tooltip="Import data" … … 229 217 /> 230 218 <tbl:button 231 image="export.png" 232 onclick="runItemPlugin('ExportItem')" 219 id="btnExport" 220 image="export.png" 221 data-plugin-type="EXPORT" 233 222 title="Export…" 234 223 tooltip="Export data" … … 236 225 /> 237 226 <tbl:button 238 image="runplugin.png" 239 onclick="runItemPlugin('RunPlugin')" 227 id="btnRunPlugin" 228 image="runplugin.png" 229 data-plugin-type="OTHER" 240 230 title="Run plugin…" 241 231 tooltip="Run a plugin" … … 246 236 <tbl:button 247 237 image="help.png" 248 onclick="<%="Main.openHelp('" + ID +"', 'transformation.view.properties')"%>" 238 subclass="auto-init" 239 data-auto-init="help" 240 data-help-id="transformation.view.properties" 249 241 title="Help…" 250 242 tooltip="Get help about this page" -
trunk/www/views/experiments/view_experiment.jsp
r6255 r6315 24 24 @version 2.0 25 25 --%> 26 <%@page import="org.json.simple.JSONObject"%> 27 <%@page import="org.json.simple.JSONArray"%> 26 28 <%@ page pageEncoding="UTF-8" session="false" 27 29 import="net.sf.basedb.core.SessionControl" … … 122 124 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); 123 125 %> 124 <base:page title="<%=title%>" >125 <base:head scripts="table.js,tabcontrol .js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">126 <base:page title="<%=title%>" id="view-page"> 127 <base:head scripts="table.js,tabcontrol-2.js,~experiments.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 126 128 <ext:scripts context="<%=jspContext%>" /> 127 129 <ext:stylesheets context="<%=jspContext%>" /> 128 <script>129 function editItem()130 {131 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);132 }133 function shareItem()134 {135 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'ShareRawBioAssay', 600, 400);136 }137 function deleteItem()138 {139 location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&item_id=<%=itemId%>');140 }141 function restoreItem()142 {143 location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');144 }145 function deleteItemPermanently()146 {147 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');148 }149 function itemDeleted()150 {151 Main.listItems('<%=ID%>', '<%=itemType.name()%>');152 }153 function showUsingItems()154 {155 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);156 }157 function setOwner()158 {159 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 300);160 }161 function runPlugin(cmd)162 {163 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 750, 500);164 }165 function analyzeItem()166 {167 location.href = '<%=root%>/analyze/index.jsp?ID=<%=ID%>&experiment_id=<%=itemId%>';168 }169 function viewBioAssaySets()170 {171 location.href = 'bioassaysets/index.jsp?ID=<%=ID%>&experiment_id=<%=itemId%>';172 }173 function viewClonedReporters()174 {175 location.href = 'reporters/index.jsp?ID=<%=ID%>&experiment_id=<%=itemId%>';176 }177 function switchTab(tabControlId, tabId)178 {179 if (TabControl.isActive(tabControlId, tabId)) return;180 if (tabId == 'clonedreporters')181 {182 viewClonedReporters();183 }184 else if (tabId == 'bioassaysets')185 {186 viewBioAssaySets();187 }188 else189 {190 TabControl.setActiveTab(tabControlId, tabId);191 }192 }193 function editExperimentalFactor(itemType, itemId, annotationTypeId)194 {195 var url = getRoot() + 'common/annotations/annotate.jsp?ID=<%=ID%>';196 url += '&item_type='+itemType;197 url += '&item_id='+itemId;198 url += '&annotationtype_id='+annotationTypeId;199 url += '&standalone=1';200 Main.openPopup(url, 'EditAnnotation', 750, 500);201 }202 function setUsedFactorValue(annotationTypeId, values)203 {204 var div = document.getElementById('usedvalues.'+annotationTypeId);205 div.innerHTML = values;206 if (values && values.length > 50)207 {208 Main.addClass(div, 'constrained unchecked autoshow');209 if (TextOverflow.getOverflowMethod() == 'click')210 {211 TextOverflow.checkAndFixTag(div);212 }213 }214 }215 var hasMissingFactors = false;216 function showStatus(annotationTypeId, numTotal, numInherited)217 {218 var sss = document.getElementById('status.'+annotationTypeId);219 var html;220 if (numInherited >= numTotal)221 {222 html = '<img src="../../images/ok.png" alt="Ok" title="All ' + numTotal +223 ' raw bioassays have a value for this experimental factor">';224 }225 else226 {227 var numMissing = numTotal - numInherited;228 html = '<table><tr>';229 html += '<td><img src="../../images/warning.png" alt="!"';230 html += ' title="' + numMissing + ' raw bioassays are missing a value for this experimental factor"></td>';231 html += '<td style="text-align: center;">';232 html += '<input type="checkbox" name="autoinherit" id="autoinherit'+annotationTypeId+'" value="'+annotationTypeId+'" checked';233 html += ' title="Select to automatically inherit annotations from parents"></td>';234 html += '<td> <label for="autoinherit'+annotationTypeId+'">' + numMissing + ' missing</label></td>'235 html += '</tr></table>';236 if (!hasMissingFactors)237 {238 hasMissingFactors = true;239 var checkAll = '<table><tr>';240 checkAll += '<td></td>';241 checkAll += '<td style="text-align: center;">';242 checkAll += '<a id="check.uncheck" href="javascript:checkFactors()" title="Check/uncheck all">';243 checkAll += '<img src="../../images/check_uncheck.png" alt="x"></a></td>';244 checkAll += '<td><img src="../../images/bullet.png" alt="*"></td>';245 checkAll += '<td><a href="javascript:autoInherit()"';246 checkAll += ' title="Automatically try to inherit values for the selected experimental factors from parent items">';247 checkAll += 'Auto-inherit</a></td>'248 checkAll += '</tr></table>';249 document.getElementById('tbl.experimentalFactors.status').innerHTML = checkAll;250 Main.show('warning.missing');251 }252 }253 sss.innerHTML = html;254 }255 function checkFactors()256 {257 var frm = document.forms['tbl.experimentalFactors'];258 Forms.checkUncheck(frm, /autoinherit/);259 }260 function autoInherit()261 {262 var frm = document.forms['tbl.experimentalFactors'];263 if (Forms.numChecked(frm, /autoinherit/) == 0)264 {265 Forms.showNotification('check.uncheck', 'Please select at least on experimental factor', null, 'pointer-below');266 return;267 }268 Main.openPopup('../../common/progress_reporter.jsp?ID=<%=ID%>&progress=autoinherit&title=Inheriting experimental factors', 'Progress', 300, 200);269 frm.cmd.value = 'AutoInherit';270 frm.submit();271 }272 function cloneReporters()273 {274 Main.openPopup('clone_reporters.jsp?ID=<%=ID%>&item_id=<%=itemId%>', 'CloneReporters', 600, 400);275 }276 function removeClonedReporters()277 {278 if (confirm('Are you sure that you want to remove all cloned reporter annotations?\nThis action can\'t be undone.'))279 {280 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=RemoveClonedReporters&item_id=<%=itemId%>', 'RemoveClonedReporters', 450, 300);281 }282 }283 </script>284 130 </base:head> 285 <base:body onload="initUsedFactorValues()">131 <base:body> 286 132 <p:path><p:pathelement 287 133 title="Experiments" href="<%="index.jsp?ID="+ID%>" 288 134 /><p:pathelement title="<%=HTML.encodeTags(experiment.getName())%>" 289 135 /></p:path> 136 <div id="page-data" data-item-id="<%=itemId%>"></div> 290 137 291 138 <t:tabcontrol 292 139 id="main" 293 140 subclass="content mastertabcontrol" 294 active="<%=tab%>" switch="switchTab"remember="false">141 active="<%=tab%>" remember="false"> 295 142 <t:tab id="properties" title="Properties"> 296 143 <div> … … 304 151 /> 305 152 <base:icon 153 id="btnDeletePermanently" 306 154 image="deleted.png" 307 onclick="deleteItemPermanently()"308 155 tooltip="This item has been flagged for deletion. Click to delete it now." 309 156 enabled="<%=deletePermanentlyPermission %>" 310 157 visible="<%=isRemoved%>" 311 158 /> 312 <base:icon image="used.png" 313 onclick="showUsingItems()" 159 <base:icon 160 id="btnUsingItems" 161 image="used.png" 314 162 tooltip="This item is used by other items and can't be permanently deleted. Show the items that are using this one" 315 163 visible="<%=isRemoved && isUsed%>" /> … … 318 166 <tbl:toolbar subclass="bottomborder"> 319 167 <tbl:button 168 id="btnEdit" 320 169 disabled="<%=!writePermission%>" 321 170 image="edit.png" 322 onclick="editItem()"323 171 title="Edit…" 324 172 tooltip="<%=writePermission ? "Edit this experiment" : "You do not have permission to edit this experiment"%>" 325 173 /> 326 174 <tbl:button 175 id="btnDelete" 327 176 disabled="<%=!deletePermission%>" 328 177 image="delete.png" 329 onclick="deleteItem()"330 178 title="Delete" 331 179 visible="<%=!experiment.isRemoved()%>" … … 333 181 /> 334 182 <tbl:button 183 id="btnRestore" 335 184 disabled="<%=!writePermission%>" 336 185 image="restore.png" 337 onclick="restoreItem()"338 186 title="Restore" 339 187 visible="<%=experiment.isRemoved()%>" … … 341 189 /> 342 190 <tbl:button 191 id="btnShare" 343 192 disabled="<%=!sharePermission%>" 344 193 image="share.png" 345 onclick="shareItem()"346 194 title="Share…" 347 195 tooltip="<%=sharePermission ? "Share this experiment to other user, groups and projects" : "You do not have permission to share this experiment"%>" 348 196 /> 349 197 <tbl:button 198 id="btnSetOwner" 350 199 disabled="<%=!setOwnerPermission%>" 351 200 image="take_ownership.png" 352 onclick="setOwner()"353 201 title="Set owner…" 354 202 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 355 203 /> 356 204 <tbl:button 205 id="btnCloneReporters" 357 206 visible="<%=writePermission && (virtualDb.hasTable(VirtualTable.POSITION) || experiment.getRawDataType().isStoredInDb()) %>" 358 207 image="copy.png" 359 onclick="cloneReporters()"360 208 title="Clone reporters…" 361 209 tooltip="Clone reporter annotations for all reporters that are used in this experiment" 362 210 /> 363 211 <tbl:button 212 id="btnRemoveClonedReporters" 364 213 visible="<%=writePermission && virtualDb.hasClonedReporters() %>" 365 214 image="delete_permanently.png" 366 onclick="removeClonedReporters()"367 215 title="Remove cloned reporters…" 368 216 tooltip="Remove all cloned reporter annotations" 369 217 /> 370 218 <tbl:button 219 id="btnImport" 371 220 image="import.png" 372 onclick="runPlugin('ImportItem')"221 data-plugin-type="IMPORT" 373 222 title="Import…" 374 223 tooltip="Import data" … … 376 225 /> 377 226 <tbl:button 378 image="export.png" 379 onclick="runPlugin('ExportItem')" 227 id="btnExport" 228 image="export.png" 229 data-plugin-type="EXPORT" 380 230 title="Export…" 381 231 tooltip="Export data" … … 383 233 /> 384 234 <tbl:button 385 image="runplugin.png" 386 onclick="runPlugin('RunPlugin')" 235 id="btnRunPlugin" 236 image="runplugin.png" 237 data-plugin-type="OTHER" 387 238 title="Run plugin…" 388 239 tooltip="Run a plugin" … … 393 244 <tbl:button 394 245 image="help.png" 395 onclick="<%="Main.openHelp('" + ID +"', 'experiment.view.properties')"%>" 246 subclass="auto-init" 247 data-auto-init="help" 248 data-help-id="experiment.view.properties" 396 249 title="Help…" 397 250 tooltip="Get help about this page" … … 718 571 } 719 572 %> 720 <tbl:cell column="<%="at"+at.getId()%>" 721 > 573 <tbl:cell column="<%="at"+at.getId()%>"> 722 574 <% 723 575 for (Map.Entry<Annotatable, List> entry : factorValues.entrySet()) … … 730 582 if (aItem != null && aItem.hasPermission(Permission.WRITE)) 731 583 { 732 %>: <base:icon image="edit.png" 733 onclick="<%="editExperimentalFactor('"+aItem.getType().name()+"',"+aItem.getId()+","+at.getId()+")"%>" 734 tooltip="Modify the values of this experimental factor" /> 584 %>: <base:icon 585 subclass="link auto-init" 586 data-auto-init="edit-experimental-factor" 587 data-item-type="<%=aItem.getType().name()%>" 588 data-item-id="<%=aItem.getId() %>" 589 data-annotation-type="<%=at.getId() %>" 590 image="edit.png" 591 tooltip="Modify the values of this experimental factor" 592 /> 735 593 <% 736 594 } … … 765 623 </jsp:include> 766 624 767 <script> 768 function initUsedFactorValues() 769 { 770 <% 771 int numRawBioAssays = rawBioAssays.size(); 772 for (Map.Entry<AnnotationType, Set<Object>> entry : usedFactorValues.entrySet()) 773 { 774 AnnotationType at = entry.getKey(); 775 int numRawBioAssaysWithFactor = factorValuesCount.get(at); 776 Type valueType = at.getValueType(); 777 if (at.isEnumeration() || (valueType != Type.TEXT && valueType != Type.STRING)) 625 <% 626 JSONArray jsonFactorValues = new JSONArray(); 627 for (Map.Entry<AnnotationType, Set<Object>> entry : usedFactorValues.entrySet()) 778 628 { 779 Set<Object> values = entry.getValue(); 780 Formatter formatter = FormatterFactory.getTypeFormatter(sc, valueType); 781 Unit unit = at.getDefaultUnit(); 782 if (unit != null) formatter = unit.getFormatter(formatter); 783 String formattedValues = HTML.encodeTags(Values.getString(values, ", ", true, formatter)); 784 %> 785 setUsedFactorValue(<%=at.getId()%>, '<%=HTML.javaScriptEncode(formattedValues)%>'); 786 <% 629 AnnotationType at = entry.getKey(); 630 631 JSONObject jsonAt = new JSONObject(); 632 jsonAt.put("id", at.getId()); 633 jsonAt.put("numRawBioAssaysWithFactor", factorValuesCount.get(at)); 634 635 Type valueType = at.getValueType(); 636 if (at.isEnumeration() || (valueType != Type.TEXT && valueType != Type.STRING)) 637 { 638 Set<Object> values = entry.getValue(); 639 Formatter formatter = FormatterFactory.getTypeFormatter(sc, valueType); 640 Unit unit = at.getDefaultUnit(); 641 if (unit != null) formatter = unit.getFormatter(formatter); 642 String formattedValues = HTML.encodeTags(Values.getString(values, ", ", true, formatter)); 643 jsonAt.put("usedValues", formattedValues); 644 } 645 646 jsonFactorValues.add(jsonAt); 787 647 } 788 648 %> 789 showStatus(<%=at.getId()%>, <%=numRawBioAssays%>, <%=numRawBioAssaysWithFactor%>); 790 <% 791 } 792 %> 793 } 794 </script> 649 <div id="factor-values" class="data-container" 650 data-num-raw-bioassays="<%=rawBioAssays.size() %>" 651 data-factor-values="<%=HTML.encodeTags(jsonFactorValues.toJSONString()) %>" 652 ></div> 653 795 654 </t:tab> 796 655 <t:tab id="annotations" title="Annotations" 797 tooltip="View annotation values" clazz="white" 798 activate="AnnotationsList.loadOnce()"> 656 tooltip="View annotation values" clazz="white"> 799 657 <jsp:include page="../../common/annotations/list_frameset.jsp"> 800 658 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 811 669 /> 812 670 <t:tab id="overview" title="Overview" 813 tooltip="Display a tree overview of related items" 814 activate="Overview.loadOnce()"> 671 tooltip="Display a tree overview of related items"> 815 672 <jsp:include page="../../common/overview/overview.jsp"> 816 673 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 821 678 <t:tab id="history" title="Change history" 822 679 tooltip="Displays a log of all modifications made to this item" 823 visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>" 824 activate="History.loadOnce()"> 680 visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>"> 825 681 <jsp:include page="../../common/history/frameset.jsp"> 826 682 <jsp:param name="item_type" value="<%=itemType.name()%>" /> -
trunk/www/views/reporterlists/index.jsp
r6192 r6315 23 23 @version 2.0 24 24 --%> 25 <%@page import="net.sf.basedb.core.ClonableProperty"%> 26 <%@page import="net.sf.basedb.core.VirtualColumn"%> 27 <%@page import="net.sf.basedb.core.query.Dynamic"%> 25 28 <%@ page pageEncoding="UTF-8" session="false" 26 29 import="net.sf.basedb.core.SessionControl" … … 46 49 import="net.sf.basedb.core.query.Restrictions" 47 50 import="net.sf.basedb.core.query.Expressions" 51 import="net.sf.basedb.core.query.Expression" 48 52 import="net.sf.basedb.core.query.Hql" 49 53 import="net.sf.basedb.core.query.SqlResult" … … 173 177 query.setFirstResult(0); 174 178 query.setMaxResults(-1); 179 Expression idCol = query instanceof SqlQuery ? 180 Dynamic.column(VirtualColumn.clonableProperty(ClonableProperty.createFromRegular("id"))) 181 : 182 Hql.property("id"); 175 183 Integer[] itemIds = Values.getInt(request.getParameter("items").split(",")); 176 184 query.restrict( 177 Restrictions.in( 178 Hql.property("id"), 179 Expressions.parameter("_selected_") 180 ) 185 Restrictions.in(idCol, Expressions.parameter("_selected_")) 181 186 ); 182 187 query.setParameter("_selected_", Arrays.asList(itemIds), Type.INT); -
trunk/www/views/reporters/edit_reporter.jsp
r6217 r6315 46 46 import="net.sf.basedb.util.Values" 47 47 import="net.sf.basedb.util.formatter.Formatter" 48 import="net.sf.basedb.util.json.JsonUtil" 49 import="net.sf.basedb.util.json.JsonConverter" 48 50 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 49 51 import="net.sf.basedb.clients.web.formatter.FormatterSettings" … … 55 57 import="java.util.Date" 56 58 import="java.util.List" 59 import="org.json.simple.JSONArray" 60 import="org.json.simple.JSONObject" 57 61 %> 58 62 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> … … 71 75 { 72 76 List<ExtendedProperty> reporterProperties = ExtendedProperties.getProperties("ReporterData"); 77 JSONArray jsonReporterProperties = JsonUtil.toArray(reporterProperties, new JsonConverter<ExtendedProperty>() 78 { 79 public Object convert(ExtendedProperty ep) 80 { 81 JSONObject json = new JSONObject(); 82 json.put("name", ep.getName()); 83 json.put("valueType", ep.getType().name()); 84 json.put("title", ep.getTitle()); 85 json.put("nullable", ep.isNullable()); 86 return json; 87 } 88 }); 73 89 74 90 String title = null; … … 107 123 } 108 124 109 110 111 112 113 125 // Query to retrieve reporter types 114 126 final ItemQuery<ReporterType> reporterTypeQuery = ReporterType.getQuery(); … … 125 137 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 126 138 %> 127 <base:page type="popup" title="<%=title%>" >128 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">139 <base:page type="popup" title="<%=title%>" id="edit-page"> 140 <base:head scripts="tabcontrol-2.js,~reporters.js" styles="tabcontrol.css"> 129 141 <ext:scripts context="<%=jspContext%>" /> 130 142 <ext:stylesheets context="<%=jspContext%>" /> 131 <script>132 // Validate the "Reporter" tab133 function validateReporter()134 {135 var frm = document.forms['reporter'];136 if (Main.trimString(frm.name.value) == '')137 {138 Forms.showNotification(frm.name, 'You must enter a name for the reporter');139 return false;140 }141 else if (Main.trimString(frm.externalId.value) == '')142 {143 Forms.showNotification(frm.externalId, 'You must enter an external ID for the reporter');144 return false;145 }146 return true;147 }148 // Validate the "Extended properties" tab149 function validateExtendedProperties()150 {151 var frm = document.forms['reporter'];152 var field;153 <%154 if (reporterProperties != null)155 {156 for (ExtendedProperty ep : reporterProperties)157 {158 Type type = ep.getType();159 String name = ep.getName();160 %>161 field = frm['<%=name%>'];162 <%163 if (type == Type.DATE)164 {165 %>166 if (field.value != '' && !Dates.isDate(field.value, '<%=jsDateFormat%>'))167 {168 Forms.showNotification(field, "'"+field.value+"' is not a valid date");169 field.focus();170 return false;171 }172 <%173 }174 if (type == Type.TIMESTAMP)175 {176 %>177 if (field.value != '' && !Dates.isDate(field.value, '<%=jsDateTimeFormat%>'))178 {179 Forms.showNotification(field, "'"+field.value+"' is not a valid timestamp");180 return false;181 }182 <%183 }184 if (!ep.isNullable())185 {186 if (type == Type.BOOLEAN)187 {188 %>189 if (Forms.getCheckedRadio(field) == null)190 {191 Forms.showNotification(field, "You must select a value for '<%=HTML.javaScriptEncode(ep.getTitle())%>'");192 return false;193 }194 <%195 }196 else197 {198 %>199 if (Main.trimString(field.value) == '')200 {201 Forms.showNotification(field, "You must enter a value for '<%=HTML.javaScriptEncode(ep.getTitle())%>'.");202 return false;203 }204 <%205 }206 }207 }208 }209 %>210 return true;211 }212 // Submit the form213 function saveSettings()214 {215 var frm = document.forms['reporter'];216 if (TabControl.validateActiveTab('settings'))217 {218 frm.submit();219 }220 }221 </script>222 143 </base:head> 223 144 <base:body> 224 145 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 146 147 <div id="page-data" class="data-container" 148 data-date-format="<%=htmlDateFormat%>" 149 data-datetime-format="<%=htmlDateTimeFormat%>" 150 data-extended-properties="<%=HTML.encodeTags(jsonReporterProperties.toJSONString())%>" 151 ></div> 152 225 153 <form action="index.jsp?ID=<%=ID%>" method="post" name="reporter"> 226 154 <input type="hidden" name="cmd" value="UpdateItem"> … … 230 158 position="bottom" remember="<%=reporter != null%>" 231 159 extensions="<%=invoker%>"> 232 <t:tab id="info" title="Reporter" validate="validateReporter()"helpid="reporter.edit">160 <t:tab id="info" title="Reporter" helpid="reporter.edit"> 233 161 <table class="fullform input100"> 234 162 <tr> 235 163 <th>Name</th> 236 <td><input class="text required" type="text" name="name" 164 <td><input class="text required auto-init" data-auto-init="<%=reporter == null ? "focus-select" : "focus" %>" 165 type="text" name="name" 237 166 value="<%=HTML.encodeTags(reporter == null ? Values.getString(cc.getPropertyValue("name"), "New reporter") : reporter.getName())%>" 238 167 maxlength="<%=ReporterData.MAX_NAME_LENGTH%>"></td> … … 302 231 303 232 <t:tab id="extended" title="Extended properties" 304 validate="validateExtendedProperties()"helpid="reporter.edit.extended">233 helpid="reporter.edit.extended"> 305 234 <table class="fullform input100"> 306 235 <% … … 310 239 { 311 240 String name = ep.getName(); 241 String fieldName = "ep."+name; 312 242 Type type = ep.getType(); 313 243 boolean required = !ep.isNullable(); … … 323 253 { 324 254 %> 325 <input class="<%=theClazz%>" type="text" name="<%=name%>" 326 value="<%=value == null ? "" : value%>" style="width: 15em;" 327 maxlength="20" onkeypress="return Numbers.integerOnly(event)" 328 > 255 <input class="<%=theClazz%>" type="text" name="<%=fieldName%>" id="<%=fieldName%>" 256 value="<%=value == null ? "" : value%>" style="width: 15em;" maxlength="20"> 329 257 <% 330 258 } … … 332 260 { 333 261 %> 334 <input class="<%=theClazz%>" type="text" name="<%=name%>" 335 value="<%=value == null ? "" : value%>" style="width: 15em;" 336 maxlength="20" onkeypress="return Numbers.numberOnly(event)" 337 > 262 <input class="<%=theClazz%>" type="text" name="<%=fieldName%>" id="<%=fieldName%>" 263 value="<%=value == null ? "" : value%>" style="width: 15em;" maxlength="20"> 338 264 <% 339 265 } … … 341 267 { 342 268 %> 343 <input class="<%=theClazz%>" type="text" name="<%= name%>"269 <input class="<%=theClazz%>" type="text" name="<%=fieldName%>" id="<%=fieldName%>" 344 270 value="<%=HTML.encodeTags((String)value)%>" 345 271 maxlength="<%=ep.getLength()%>" … … 351 277 hasZoom = true; 352 278 %> 353 <textarea class="<%=theClazz%>" name="<%= name%>" id="<%=name%>" rows="6"279 <textarea class="<%=theClazz%>" name="<%=fieldName%>" id="<%=fieldName%>" rows="6" 354 280 ><%=HTML.encodeTags((String)value)%></textarea> 355 281 <% … … 361 287 { 362 288 %> 363 <input type="radio" name="<%= name%>" id="<%=name%>.null" value=""289 <input type="radio" name="<%=fieldName%>" id="<%=fieldName%>.null" value="" 364 290 <%=b == null ? "checked" : ""%> 365 ><label for="<%= name%>.null"><i>- not specified -</i></label><br>291 ><label for="<%=fieldName%>.null"><i>- not specified -</i></label><br> 366 292 <% 367 293 } 368 294 %> 369 <input type="radio" name="<%= name%>" id="<%=name%>.true" value="true"295 <input type="radio" name="<%=fieldName%>" id="<%=fieldName%>.true" value="true" 370 296 <%=b != null && b == true ? "checked" : ""%> 371 ><label for="<%= name%>.true">true</label><br>372 <input type="radio" name="<%= name%>" id="<%=name%>.false" value="false"297 ><label for="<%=fieldName%>.true">true</label><br> 298 <input type="radio" name="<%=fieldName%>" id="<%=fieldName%>.false" value="false" 373 299 <%=b != null && b == false ? "checked" : ""%> 374 ><label for="<%= name%>.false">false</label>300 ><label for="<