Changeset 6334
- Timestamp:
- Oct 16, 2013, 4:39:55 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/DerivedBioAssay.java
r6328 r6334 368 368 if (getData().getExtract() != null) annotatable.add(getExtract()); 369 369 if (getData().getHardware() != null) annotatable.add(getHardware()); 370 if (getData().getSoftware() != null) annotatable.add(getSoftware()); 370 371 } 371 372 catch (PermissionDeniedException ex) -
trunk/src/core/net/sf/basedb/core/RawBioAssay.java
r6127 r6334 244 244 if (getData().getParentBioAssay() != null) annotatable.add(getParentBioAssay()); 245 245 if (getData().getParentExtract() != null) annotatable.add(getParentExtract()); 246 if (getData().getSoftware() != null) annotatable.add(getSoftware()); 246 247 } 247 248 catch (PermissionDeniedException ex) -
trunk/src/core/net/sf/basedb/core/Software.java
r6127 r6334 38 38 */ 39 39 public class Software 40 extends CommonItem<SoftwareData>40 extends AnnotatedItem<SoftwareData> 41 41 implements Registered, Subtypable 42 42 { … … 171 171 { 172 172 return DateUtil.copy(getData().getEntryDate()); 173 } 174 // ------------------------------------------- 175 /* 176 From the Annotatable interface 177 ------------------------------------------- 178 */ 179 /** 180 @return Always null 181 @since 3.3 182 */ 183 @Override 184 public Set<Annotatable> getAnnotatableParents() 185 { 186 return null; 173 187 } 174 188 // ------------------------------------------- -
trunk/src/core/net/sf/basedb/core/data/SoftwareData.java
r6127 r6334 36 36 */ 37 37 public class SoftwareData 38 extends CommonData38 extends AnnotatedData 39 39 implements RegisteredData, SubtypableData 40 40 { -
trunk/src/core/net/sf/basedb/util/overview/loader/SoftwareLoader.java
r5685 r6334 84 84 } 85 85 Node softwareNode = createItemNode(nf, software, software, denied, 86 parentNode, ChildNodeDirection. NONE);86 parentNode, ChildNodeDirection.PROPERTY); 87 87 return softwareNode; 88 88 } 89 89 // ----------------------------------- 90 90 /* 91 From the AbstractNodeLoader class 92 ---------------------------------- 93 */ 94 /** 95 Loads annotations and software parameters for the given software node. 96 @see RawBioAssayLoader#createForwardNode(DbControl, OverviewContext, Node) 97 */ 98 @Override 99 protected void loadPropertyChildNodes(DbControl dc, OverviewContext context, Node softwareNode) 100 { 101 getNodeLoader(context, Item.ANNOTATION).createPropertyNode(dc, context, softwareNode); 102 } 103 // ------------------------------------- 91 104 } -
trunk/www/admin/software/edit_software.jsp
r6222 r6334 26 26 --%> 27 27 <%@ page pageEncoding="UTF-8" session="false" 28 import="net.sf.basedb.core.AnnotationType" 28 29 import="net.sf.basedb.core.SessionControl" 29 30 import="net.sf.basedb.core.DbControl" … … 197 198 </table> 198 199 </t:tab> 200 <t:tab id="annotations" title="Annotations" helpid="annotations.edit"> 201 <jsp:include page="../../common/annotations/annotate_frameset.jsp"> 202 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 203 <jsp:param name="item_id" value="<%=itemId%>" /> 204 <jsp:param name="ID" value="<%=ID%>" /> 205 </jsp:include> 206 </t:tab> 199 207 </t:tabcontrol> 200 208 </form> -
trunk/www/admin/software/index.jsp
r6192 r6334 179 179 } 180 180 181 Base.updateAnnotations(dc, software, software, request); 181 182 // OnSave extensions 182 183 invoker.render(OnSaveRenderer.ON_SAVE); … … 215 216 message = (numRemoved == 0 ? "No" : "Only "+numRemoved+" of "+numTotal) + " items could be deleted, because you have no DELETE permission"; 216 217 } 217 redirect = listPage ;218 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 218 219 } 219 220 else if ("RestoreItem".equals(cmd)) … … 238 239 message = (numRemoved == 0 ? "No" : "Only "+numRemoved+" of "+numTotal) + " items could be restored, because you have no WRITE permission"; 239 240 } 240 redirect = listPage ;241 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 241 242 } 242 243 else if ("ShareItem".equals(cmd)) -
trunk/www/admin/software/list_software.jsp
r6222 r6334 30 30 import="net.sf.basedb.core.Software" 31 31 import="net.sf.basedb.core.ItemSubtype" 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" … … 80 83 final DbControl dc = sc.newDbControl(); 81 84 ItemResultIterator<Software> software = null; 85 ItemResultList<AnnotationType> annotationTypes = null; 82 86 try 83 87 { 84 88 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 85 89 final ItemQuery<ItemSubtype> subtypesQuery = Base.getSubtypesQuery(itemType); 90 final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); 91 annotationTypes = annotationTypeQuery.list(dc); 86 92 87 93 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); … … 197 203 exportable="true" 198 204 /> 205 <% 206 for (AnnotationType at : annotationTypes) 207 { 208 Enumeration<String, String> annotationEnum = null; 209 Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); 210 if (at.isEnumeration()) 211 { 212 annotationEnum = new Enumeration<String, String>(); 213 List<?> values = at.getValues(); 214 for (Object value : values) 215 { 216 String encoded = formatter.format(value); 217 annotationEnum.add(encoded, encoded); 218 } 219 } 220 %> 221 <tbl:columndef 222 id="<%="at"+at.getId()%>" 223 title="<%=HTML.encodeTags(at.getName())+" [A]"%>" 224 property="<%="#"+at.getId()%>" 225 annotation="true" 226 datatype="<%=at.getValueType().getStringValue()%>" 227 enumeration="<%=annotationEnum%>" 228 smartenum="<%=at.getDisplayAsList() %>" 229 sortable="<%=at.getMultiplicity() == 1%>" 230 filterable="true" 231 exportable="true" 232 formatter="<%=formatter%>" 233 unit="<%=at.getDefaultUnit()%>" 234 /> 235 <% 236 } 237 %> 199 238 <tbl:columndef 200 239 id="permission" … … 416 455 /></tbl:cell> 417 456 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 457 <% 458 AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null; 459 if (as != null) 460 { 461 for (AnnotationType at : annotationTypes) 462 { 463 if (as.hasAnnotation(at)) 464 { 465 Annotation a = as.getAnnotation(at); 466 String suffix = a.getUnitSymbol(null); 467 if (suffix != null) suffix = " " + suffix; 468 %> 469 <tbl:cell 470 column="<%="at"+at.getId()%>" 471 ><tbl:cellvalue 472 list="<%=a.getValues(null)%>" 473 suffix="<%=suffix%>" 474 /></tbl:cell> 475 <% 476 } 477 } 478 } 479 %> 418 480 <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> 419 481 <tbl:cell column="sharedTo"> -
trunk/www/admin/software/software.js
r6297 r6334 44 44 45 45 // Tab validation 46 TabControl.addTabActivateListener('settings.annotations', software.loadAnnotationsFrame); 46 47 TabControl.addTabValidator('settings.info', software.validateSoftware); 47 48 } … … 61 62 Buttons.addClickHandler('btnImport', Buttons.runPlugin, attributes); 62 63 Buttons.addClickHandler('btnRunPlugin', Buttons.runPlugin, attributes); 64 65 TabControl.addTabActivateListener('main.annotations', AnnotationsList.loadOnce); 63 66 } 64 67 else if (pageId == 'list-page') … … 99 102 if (TabControl.validateActiveTab('settings')) 100 103 { 104 Annotations.saveModifiedAnnotationsToForm(frm); 101 105 frm.submit(); 102 106 } 107 } 108 109 software.loadAnnotationsFrame = function() 110 { 111 Annotations.autoLoadEditFrame(null, ItemSubtype.getSubtypeId('subtype_id')); 103 112 } 104 113 -
trunk/www/admin/software/view_software.jsp
r6322 r6334 252 252 </jsp:include> 253 253 </t:tab> 254 <t:tab id="annotations" title="Annotations" 255 tooltip="View annotation values" clazz="white"> 256 <jsp:include page="../../common/annotations/list_frameset.jsp"> 257 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 258 <jsp:param name="item_id" value="<%=itemId%>" /> 259 <jsp:param name="ID" value="<%=ID%>" /> 260 </jsp:include> 261 </t:tab> 254 262 </t:tabcontrol> 255 263 </base:body> -
trunk/www/include/scripts/main.js
r6328 r6334 548 548 this.controllers['SAMPLE'] = { url:'biomaterials/samples/index.jsp', width:750, height:500 }; 549 549 this.controllers['SESSION'] = { url:'views/sessions/index.jsp', width:450, height:300, popup:true, edit:false, noAnyToAny:true }; 550 this.controllers['SOFTWARE'] = { url:'admin/software/index.jsp', width: 450, height:300 };550 this.controllers['SOFTWARE'] = { url:'admin/software/index.jsp', width:800, height:500 }; 551 551 this.controllers['TAG'] = { url:'biomaterials/tags/index.jsp', width:450, height:300 }; 552 552 this.controllers['TRANSFORMATION'] = { url:'views/experiments/transformations/index.jsp', width:450, height:300, noAnyToAny:true }; -
trunk/www/views/derivedbioassays/bioassays.js
r6328 r6334 240 240 var hardwareId = Math.abs(parseInt(frm.hardware_id.value)); 241 241 if (hardwareId > 0) parents[parents.length] = 'HARDWARE:'+hardwareId; 242 var softwareId = Math.abs(parseInt(frm.software_id.value)); 243 if (softwareId > 0) parents[parents.length] = 'SOFTWARE:'+softwareId; 242 244 return parents; 243 245 } -
trunk/www/views/rawbioassays/bioassays.js
r6314 r6334 199 199 var extractId = Math.abs(parseInt(frm.extract_id.value)); 200 200 if (extractId > 0) parents[parents.length] = 'EXTRACT:'+extractId; 201 var softwareId = Math.abs(parseInt(frm.software_id.value)); 202 if (softwareId > 0) parents[parents.length] = 'SOFTWARE:'+softwareId; 201 203 if (frm.arraydesign_id) 202 204 {
Note: See TracChangeset
for help on using the changeset viewer.