Ticket #1310: patch-4934.diff
File patch-4934.diff, 9.2 KB (added by , 15 years ago) |
---|
-
www/include/scripts/main.js
456 456 this.controllers['PLUGINDEFINITION'] = { url:'admin/plugindefinitions/index.jsp', width:800, height:500 }; 457 457 this.controllers['PLUGINTYPE'] = { url:'admin/plugintypes/index.jsp', width:700, height:400 }; 458 458 this.controllers['JOBAGENT'] = { url:'admin/jobagents/index.jsp', width:700, height:400 }; 459 this.controllers['PROTOCOL'] = { url:'admin/protocols/index.jsp', width: 500, height:340 };459 this.controllers['PROTOCOL'] = { url:'admin/protocols/index.jsp', width:800, height:500 }; 460 460 this.controllers['PROTOCOLTYPE'] = { url:'admin/protocoltypes/index.jsp', width:500, height:340 }; 461 461 this.controllers['QUOTA'] = { url:'admin/quota/index.jsp', width:600, height:440 }; 462 462 this.controllers['QUOTATYPE'] = { url:'admin/quotatypes/index.jsp', width:500, height:340 }; -
www/admin/protocols/edit_protocol.jsp
121 121 %> 122 122 123 123 <base:page type="popup" title="<%=title%>"> 124 <base:head scripts="tabcontrol.js, linkitems.js" styles="tabcontrol.css">124 <base:head scripts="tabcontrol.js,annotations.js,linkitems.js" styles="tabcontrol.css"> 125 125 <script language="JavaScript"> 126 126 // Validate the "Protocol" tab 127 127 function validateProtocol() … … 147 147 var frm = document.forms['protocol']; 148 148 if (TabControl.validateActiveTab('settings')) 149 149 { 150 if (annotationsLoaded) 151 { 152 Annotations.addModifiedAnnotationsToForm(frames.annotations, frm); 153 } 150 154 frm.addedAnnotationTypes.value = Link.getActionIds(1, 'A').join(','); 151 155 frm.removedAnnotationTypes.value = Link.getActionIds(-1, 'A').join(','); 152 156 frm.submit(); 153 157 } 154 158 } 155 159 160 var annotationsLoaded = false; 161 function switchTab(tabControlId, tabId) 162 { 163 if (TabControl.setActiveTab(tabControlId, tabId)) 164 { 165 if (tabId == 'annotations' && !annotationsLoaded) 166 { 167 Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 168 annotationsLoaded = true; 169 } 170 } 171 } 172 156 173 function browseOnClick() 157 174 { 158 175 var frm = document.forms['protocol']; … … 234 251 <input type="hidden" name="cmd" value="UpdateItem"> 235 252 236 253 <h3 class="docked"><%=title%> <base:help tabcontrol="settings" /></h3> 237 <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale* 220)+"px;"%>"238 position="bottom" remember="<%=protocol != null%>" >254 <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale*370)+"px;"%>" 255 position="bottom" remember="<%=protocol != null%>" switch="switchTab"> 239 256 <t:tab id="info" title="Protocol" validate="validateProtocol()" helpid="protocol.edit"> 240 257 <table class="form" cellspacing=0> 241 258 <tr> … … 305 322 <t:tab id="parameters" title="Parameters" 306 323 validate="validateParameters()" helpid="protocol.edit.parameters"> 307 324 <table class="form" cellspacing=0> 308 325 309 326 <tr valign="top"> 310 327 <td><b>Annotation types</b> 311 328 <table border="0" cellspacing="0" cellpadding="0"> … … 336 353 </tr> 337 354 </table> 338 355 </t:tab> 356 357 <t:tab id="annotations" title="Annotations" 358 helpid="annotations.edit" tooltip="Enter values for annotations"> 359 <iframe name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp" 360 width="100%" height="<%=(int)(scale*370)%>" frameborder=0 vspace=0 hspace=0 361 marginwidth=0 marginheight=0 scrolling="auto" style="overflow: visible"></iframe> 362 </t:tab> 363 339 364 </t:tabcontrol> 340 365 341 366 <table align="center"> -
www/admin/protocols/index.jsp
172 172 if (annotationTypeId != -1) protocol.addParameter(AnnotationType.getById(dc, annotationTypeId)); 173 173 } 174 174 175 // Annotations tab 176 Base.updateAnnotations(dc, protocol, protocol, request); 177 175 178 dc.commit(); 176 179 cc.removeObject("item"); 177 180 } -
www/admin/protocols/view_protocol.jsp
436 436 } 437 437 %> 438 438 </div> 439 </t:tab> 440 </t:tabcontrol> 439 </t:tab> 440 441 <t:tab id="annotations" title="Annotations" 442 tooltip="View annotation values"> 443 <div class="boxed"> 444 <jsp:include page="../../common/annotations/list_annotations.jsp"> 445 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 446 <jsp:param name="item_id" value="<%=itemId%>" /> 447 <jsp:param name="ID" value="<%=ID%>" /> 448 </jsp:include> 449 </div> 450 </t:tab> 451 452 </t:tabcontrol> 441 453 442 454 </base:body> 443 455 </base:page> -
www/admin/protocols/list_protocol.jsp
29 29 import="net.sf.basedb.core.Item" 30 30 import="net.sf.basedb.core.Protocol" 31 31 import="net.sf.basedb.core.ProtocolType" 32 import="net.sf.basedb.core.Annotation" 33 import="net.sf.basedb.core.AnnotationType" 34 import="net.sf.basedb.core.AnnotationSet" 32 35 import="net.sf.basedb.core.ItemQuery" 33 36 import="net.sf.basedb.core.Include" 34 37 import="net.sf.basedb.core.ItemResultIterator" … … 78 81 final String title = mode.generateTitle("protocol", "protocols"); 79 82 final DbControl dc = sc.newDbControl(); 80 83 ItemResultIterator<Protocol> protocols = null; 84 ItemResultList<AnnotationType> annotationTypes = null; 81 85 try 82 86 { 87 final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); 88 annotationTypes = annotationTypeQuery.list(dc); 89 83 90 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 84 91 final ItemQuery<Protocol> query = Base.getConfiguredQuery(cc, true, Protocol.getQuery(), mode); 85 92 … … 289 296 filterable="true" 290 297 exportable="true" 291 298 /> 299 <% 300 for (AnnotationType at : annotationTypes) 301 { 302 Enumeration<String, String> annotationEnum = null; 303 Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); 304 if (at.isEnumeration()) 305 { 306 annotationEnum = new Enumeration<String, String>(); 307 List<?> values = at.getValues(); 308 for (Object value : values) 309 { 310 String encoded = formatter.format(value); 311 annotationEnum.add(encoded, encoded); 312 } 313 } 314 %> 315 <tbl:columndef 316 id="<%="at"+at.getId()%>" 317 title="<%=HTML.encodeTags(at.getName())+" [A]"%>" 318 property="<%="#"+at.getId()%>" 319 annotation="true" 320 datatype="<%=at.getValueType().getStringValue()%>" 321 enumeration="<%=annotationEnum%>" 322 sortable="false" 323 filterable="true" 324 exportable="true" 325 formatter="<%=formatter%>" 326 unit="<%=at.getDefaultUnit()%>" 327 /> 328 <% 329 } 330 %> 292 331 <tbl:columndef 293 332 id="permission" 294 333 title="Permission" … … 485 524 enablePropertyLink="<%=mode.hasPropertyLink()%>" 486 525 /></tbl:cell> 487 526 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 527 <% 528 AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null; 529 if (as != null) 530 { 531 for (AnnotationType at : annotationTypes) 532 { 533 if (as.hasAnnotation(at)) 534 { 535 Annotation a = as.getAnnotation(at); 536 String suffix = a.getUnitSymbol(null); 537 if (suffix != null) suffix = " " + suffix; 538 %> 539 <tbl:cell 540 column="<%="at"+at.getId()%>" 541 ><tbl:cellvalue 542 list="<%=a.getValues(null)%>" 543 suffix="<%=suffix%>" 544 /></tbl:cell> 545 <% 546 } 547 } 548 } 549 %> 550 551 552 488 553 <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> 489 554 <tbl:cell column="sharedTo"> 490 555 <% -
src/core/net/sf/basedb/core/Protocol.java
37 37 @version 2.0 38 38 */ 39 39 public class Protocol 40 extends CommonItem<ProtocolData>40 extends AnnotatedItem<ProtocolData> 41 41 implements FileAttachable, Registered 42 42 { 43 43 /** … … 433 433 ); 434 434 return query; 435 435 } 436 437 /** 438 @return Always null 439 @since 440 */ 441 public Set<Annotatable> getAnnotatableParents() 442 { 443 return null; 444 } 436 445 } -
src/core/net/sf/basedb/core/data/ProtocolData.java
34 34 @hibernate.class table="`Protocols`" lazy="true" 35 35 */ 36 36 public class ProtocolData 37 extends CommonData37 extends AnnotatedData 38 38 implements FileAttachableData, RegisteredData 39 39 { 40 40