Changeset 8088 for branches/3.19-stable
- Timestamp:
- Oct 31, 2022, 9:57:24 AM (7 months ago)
- Location:
- branches/3.19-stable
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.19-stable/src/clients/web/net/sf/basedb/clients/web/extensions/list/RelatedItemColumn.java
r8086 r8088 189 189 190 190 /** 191 Get the specification for this column. 192 @since 3.19.5 193 */ 194 protected Specification getSpecification() 195 { 196 return spec; 197 } 198 199 /** 191 200 We finalize this implementation to make sure that the helper 192 201 implementation always get a chance to re-cycle transactions. … … 261 270 { 262 271 Set<Integer> sourceIds = Collections.singleton(item.getId()); 272 helper.transformContext.resetCollected(); 263 273 if (preTransform != null) 264 274 { 275 if (!spec.allowDoublingBack) helper.transformContext.setCollecting(); 265 276 sourceIds = preTransform.transform(helper.transformContext, sourceIds); 277 if (!spec.allowDoublingBack) helper.transformContext.setAvoiding(); 266 278 } 267 279 Set<Integer> relatedIds = transformer.transform(helper.transformContext, sourceIds); … … 309 321 baseIndex = 2; 310 322 spec.directionRaw = tmp[1]; 311 if ("CHILD".equals(spec.directionRaw)) spec.direction = SourceItemTransform.PARENT_TO_CHILD; 323 if (spec.directionRaw.endsWith("+")) spec.allowDoublingBack = true; 324 if (spec.directionRaw.startsWith("CHILD")) spec.direction = SourceItemTransform.PARENT_TO_CHILD; 312 325 } 313 326 spec.targetType = Item.valueOf(tmp[baseIndex]); … … 353 366 String directionRaw; 354 367 SourceItemTransform direction; 368 boolean allowDoublingBack; 355 369 Item sourceType; 356 370 Item targetType; … … 388 402 389 403 /** 404 Enabled on a multi-hop path if the path down to the related child from the 405 parent item is allowed to traverse the same items as the path up from 406 the source child item to the parent. 407 */ 408 public boolean isDoublingBackAllowed() 409 { 410 return allowDoublingBack; 411 } 412 413 /** 390 414 Get the source item type. This is not part of the expression, but 391 415 is taken from the current list. … … 474 498 result += direction == SourceItemTransform.CHILD_TO_PARENT ? "parentitem" : "childitem"; 475 499 if (multiHop) result += " multihop"; 500 if (allowDoublingBack) result += " doublingback"; 476 501 result += "\">"; 477 502 result += StringUtil.coalesce(subtypeName, targetType.name()); -
branches/3.19-stable/src/clients/web/net/sf/basedb/clients/web/extensions/list/RelatedItemMultiHopColumn.java
r8067 r8088 18 18 19 19 private final RelatedItemColumn nextHop; 20 private final Specification nextSpec; 21 20 22 RelatedItemMultiHopColumn(DbControl dc, int index, Specification spec, RelatedItemHelper helper, RelatedItemColumn nextHop) 21 23 { 22 24 super(dc, index, spec, helper); 23 25 this.nextHop = nextHop; 26 this.nextSpec = nextHop.getSpecification(); 24 27 25 28 setValueType(nextHop.getValueType()); … … 43 46 setTitle(spec.generateTitle(nextHop.getTitle())); 44 47 setSubtitle(nextHop.getSubtitle()); 45 setTooltip(spec.generateTooltip(StringUtil.coalesce(nextHop.getTooltip(), nextHop.getTitle()))); 48 setTooltip(spec.generateTooltip(StringUtil.coalesce(nextHop.getTooltip(), nextHop.getTitle())+ 49 (nextSpec.allowDoublingBack ? " (doubling back allowed)" : " (no doubling back)"))); 46 50 } 47 51 -
branches/3.19-stable/www/common/columns/add_relateditem_column.js
r8074 r8088 109 109 configure.clearList('childItemType'); 110 110 configure.clearList('childSubtype'); 111 Doc.element('allowDoublingBack').disabled = true; 111 112 112 113 var frm = document.forms['relatedItems']; … … 200 201 configure.clearColumns(); 201 202 configure.clearList('childSubtype'); 203 Doc.element('allowDoublingBack').disabled = true; 202 204 203 205 var frm = document.forms['relatedItems']; … … 267 269 frm.childSubtype.selectedIndex = 0; 268 270 frm.childSubtype.disabled = currentChildSubtypes.length == 0; 271 frm.allowDoublingBack.disabled = currentChildSubtypes.length == 0; 269 272 } 270 273 … … 371 374 data.childItemType = frm.childItemType.value; 372 375 data.childSubtype = frm.childSubtype.value; 376 data.allowDoublingBack = frm.allowDoublingBack.checked?1:0; 373 377 374 378 if (!data.targetItemType) … … 396 400 { 397 401 data.childSubtypeName = frm.childSubtype[frm.childSubtype.selectedIndex].text; 398 propertyPrefix += '/CHILD/'+data.childItemType+'/'+data.childSubtype+'/';402 propertyPrefix += (data.allowDoublingBack?'/CHILD+/':'/CHILD/')+data.childItemType+'/'+data.childSubtype+'/'; 399 403 titlePrefix += '.'+data.childSubtypeName; 400 404 } -
branches/3.19-stable/www/common/columns/add_relateditem_column.jsp
r8075 r8088 58 58 { 59 59 width: 100%; 60 position: absolute; 61 border-collapse: separate; 62 } 63 64 .columnstable thead 65 { 66 position: sticky; 67 top: 0; 60 68 } 61 69 … … 63 71 { 64 72 vertical-align: top; 73 } 74 75 .columnstable tr.bottomborder th 76 { 77 border-bottom-width: 1px; 78 } 79 80 .columnstable tr.topborder th 81 { 82 border-top-width: 1px; 65 83 } 66 84 … … 170 188 </td> 171 189 </tr> 190 <tr> 191 <th class="subprompt"></th> 192 <td> 193 <label><input type="checkbox" id="showAllAnnotationTypes" 194 name="showAllAnnotationTypes">Show annotations for all subtypes</label> 195 </td> 196 <td></td> 197 <td> 198 <label title="Normally, child items that was passed when going up to the parent are ignored when going down. Enable this option to include all child items." 199 ><input type="checkbox" id="allowDoublingBack" name="allowDoublingBack" disabled 200 >Allow doubling back</label> 201 </td> 202 </tr> 172 203 <tr class="dynamic"> 173 204 <th></th> 174 <td ></td>175 <td></td>176 < td></td>205 <td colspan="3" class="columnsFrom" style="padding-top: 2px;"> 206 <span id="targetPath"></span><span id="childPath" class="childitem" style="display: none;"></span> 207 </td> 177 208 </tr> 178 209 </table> 179 210 </div> 180 211 181 <div class="absolutefull" style="top: 4em; left: 10em;"> 182 <div class="columnsFrom" style="height: 1.5em; white-space: nowrap; overflow: hidden;"> 183 <span id="targetPath"></span><span id="childPath" class="childitem" style="display: none;"></span> 184 <label style="font-weight: normal;"><input type="checkbox" id="showAllAnnotationTypes" 185 name="showAllAnnotationTypes">Show annotations for all subtypes</label> 186 </div> 212 <div class="absolutefull" style="top: 6.75em; left: 10em;"> 187 213 <table id="columnstable" class="columnstable" style="width: 100%;"> 188 <thead class=" bg-filled-100 topborder bottomborder">189 <tr >214 <thead class=""> 215 <tr class="bg-filled-100 topborder bottomborder"> 190 216 <th style="width: 33%;">Columns</th> 191 217 <th style="width: 33%;">Annotations</th> -
branches/3.19-stable/www/include/styles/table.css
r8072 r8088 253 253 } 254 254 255 /* A column header defining a parent/child item value */256 .itemlist div.data th.relateditemcol::before257 {258 margin-right: 2px;259 float: left;260 }261 262 255 .itemlist div.data th.relateditemcol span.parentitem::before 263 256 { … … 274 267 } 275 268 276 277 /* This will make room for the '›' without causing the header to wrap */ 278 .itemlist div.data th.relateditemcol > span 279 { 280 display: inline-block; 281 max-width: calc(100% - 16px); 282 overflow: hidden; 283 } 269 .itemlist div.data th.relateditemcol span.childitem.doublingback::before 270 { 271 content: url('../../images/child-item-doubleback.png'); 272 } 273 284 274 285 275 /* A column header defining a linked item value */
Note: See TracChangeset
for help on using the changeset viewer.