Changeset 7773
- Timestamp:
- Feb 17, 2020, 11:10:58 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/list/ParentItemColumn.java
r7770 r7773 55 55 col.setTooltip(subtype.getName() + " › "+at.getName()); 56 56 col.setValueType(at.getValueType()); 57 col.setClazz("parentitemcol"); 57 58 col.setExportFormatter(FormatterFactory.getTypeFormatter(dc.getSessionControl(), at.getValueType())); 58 59 if (!helper.lazy) col.setFormatter(new CollectionFormatter(col.getExportFormatter())); … … 78 79 } 79 80 col.setValueType(Type.STRING); 81 col.setClazz("parentitemcol"); 80 82 if (property == null || property.getHibernateType().isEntityType()) 81 83 { -
trunk/src/clients/web/web-extensions.xml
r7764 r7773 296 296 297 297 <extension 298 id="parent-item-columns" 299 extends="net.sf.basedb.clients.web.listcolumn.rawbioassay"> 300 <index>2</index> 298 id="parent-item-columns"> 299 <extends> 300 <ref index="2">net.sf.basedb.clients.web.listcolumn.rawbioassay</ref> 301 <ref index="2">net.sf.basedb.clients.web.listcolumn.derivedbioassay</ref> 302 <ref index="2">net.sf.basedb.clients.web.listcolumn.physicalbioassay</ref> 303 <ref index="2">net.sf.basedb.clients.web.listcolumn.extract</ref> 304 <ref index="2">net.sf.basedb.clients.web.listcolumn.sample</ref> 305 </extends> 301 306 <about> 302 307 <name>Parent item data</name> -
trunk/www/biomaterials/extracts/list_extracts.jsp
r7605 r7773 233 233 subclass="fulltable" 234 234 data-inherited-annotations="true" 235 data-parent-columns="true" 235 236 > 236 237 <tbl:hidden -
trunk/www/biomaterials/samples/list_samples.jsp
r7605 r7773 208 208 subclass="fulltable" 209 209 data-inherited-annotations="true" 210 data-parent-columns="true" 210 211 > 211 212 <tbl:hidden -
trunk/www/common/columns/ajax.jsp
r7768 r7773 34 34 import="net.sf.basedb.util.error.ThrowableUtil" 35 35 import="net.sf.basedb.util.extensions.ExtensionsInvoker" 36 import="net.sf.basedb.core.query.Restrictions" 37 import="net.sf.basedb.core.query.Expressions" 38 import="net.sf.basedb.core.query.Hql" 36 39 import="net.sf.basedb.clients.web.AnnotationUtil" 37 40 import="net.sf.basedb.clients.web.Base" … … 87 90 88 91 } 92 else if ("GetAnnotationTypesForCategory".equals(cmd)) 93 { 94 dc = sc.newDbControl(); 95 String category = Values.getStringOrNull(request.getParameter("category")); 96 JSONArray jsonAnnotationTypes = new JSONArray(); 97 if (category != null) 98 { 99 ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); 100 annotationTypeQuery.join(Hql.innerJoin("categories", "c")); 101 annotationTypeQuery.restrict(Restrictions.eq(Hql.property("c", "name"), Expressions.string(category))); 102 for (AnnotationType at : annotationTypeQuery.list(dc)) 103 { 104 JSONObject jsonAt = new JSONObject(); 105 jsonAt.put("id", at.getId()); 106 jsonAt.put("name", at.getName()); 107 jsonAnnotationTypes.add(jsonAt); 108 } 109 } 110 json.put("annotationTypesCategory", jsonAnnotationTypes); 111 } 89 112 else if ("GetLazyParentColumns".equals(cmd)) 90 113 { -
trunk/www/common/columns/configure.js
r7604 r7773 54 54 Buttons.addClickHandler('selectAnnotationTypes', configure.selectAnnotationTypes); 55 55 Events.addEventHandler('selectAnnotationTypes', 'base-selected', configure.annotationTypeSelected); 56 } 57 if (Doc.element('selectParentItemColumn')) 58 { 59 Buttons.addClickHandler('selectParentItemColumn', configure.selectParentItemColumn); 60 Events.addEventHandler('selectParentItemColumn', 'base-selected', configure.parentItemColumnSelected); 56 61 } 57 62 … … 212 217 } 213 218 219 220 configure.selectParentItemColumn = function(event) 221 { 222 var frm = document.forms['columns']; 223 var url = 'add_parent_column.jsp?ID='+App.getSessionId(); 224 url += '&item_type='+Data.get('page-data', 'item-type'); 225 Dialogs.openPopup(url, 'SelectParentItemColumn', 600, 400); 226 } 227 228 configure.parentItemColumnSelected = function(event) 229 { 230 var frm = document.forms['columns']; 231 var data = event.detail; 232 // Do not add duplicates 233 for (var i = 0; i < frm.visible.length; i++) 234 { 235 if (frm.visible[i].value == data.property) return; 236 } 237 238 frm.visible[frm.visible.length] = new Option(data.title, data.property); 239 } 240 214 241 /** 215 242 Save the current selection and close the dialog. -
trunk/www/common/columns/configure.jsp
r7605 r7773 54 54 final String tableId = request.getParameter("table_id"); 55 55 final boolean enableInheritedAnnotations = Values.getBoolean(request.getParameter("enableInheritedAnnotations")); 56 final boolean enableParentColumns = Values.getBoolean(request.getParameter("enableParentColumns")); 56 57 final ItemContext cc = sc.getCurrentContext(itemType, subContext); 57 58 … … 76 77 <table style="width: 100%; height: 100%;"> 77 78 <% 78 if (enableInheritedAnnotations )79 if (enableInheritedAnnotations || enableParentColumns) 79 80 { 80 81 %> … … 87 88 title="Add inherited annotations…" 88 89 tooltip="Add columns for inherited annotations" 90 visible="<%=enableInheritedAnnotations %>" 91 /> 92 <tbl:button 93 id="selectParentItemColumn" 94 image="add.png" 95 title="Add parent item columns…" 96 tooltip="Add columns from parent items" 97 visible="<%=enableParentColumns %>" 89 98 /> 90 99 </tbl:toolbar> -
trunk/www/include/scripts/table.js
r7419 r7773 884 884 var subContext = Data.get(tableDiv, 'subcontext', ''); 885 885 var enableInheritedAnnotations = Data.get(tableDiv, 'inherited-annotations'); 886 var enableParentColumns = Data.get(tableDiv, 'parent-columns'); 886 887 887 888 var url = App.getRoot()+'common/columns/configure.jsp?ID='+App.getSessionId(); … … 890 891 { 891 892 url += '&enableInheritedAnnotations='+encodeURIComponent(enableInheritedAnnotations); 893 } 894 if (enableParentColumns) 895 { 896 url += '&enableParentColumns='+encodeURIComponent(enableParentColumns); 892 897 } 893 898 if (settingName) url += '&settingName='+settingName; -
trunk/www/views/derivedbioassays/list_bioassays.jsp
r7605 r7773 185 185 subclass="fulltable" 186 186 data-inherited-annotations="true" 187 data-parent-columns="true" 187 188 > 188 189 <tbl:hidden -
trunk/www/views/physicalbioassays/list_bioassays.jsp
r7605 r7773 175 175 subclass="fulltable" 176 176 data-inherited-annotations="true" 177 data-parent-columns="true" 177 178 > 178 179 <tbl:hidden -
trunk/www/views/rawbioassays/list_rawbioassays.jsp
r7605 r7773 188 188 filterrows="<%=cc.getFilterRows()%>" 189 189 data-inherited-annotations="true" 190 data-parent-columns="true" 190 191 > 191 192 <tbl:hidden
Note: See TracChangeset
for help on using the changeset viewer.