Changeset 7595
- Timestamp:
- Feb 22, 2019, 8:21:20 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/Base.java
r7548 r7595 1723 1723 @since 2.5 1724 1724 */ 1725 @SuppressWarnings("deprecation")1726 1725 public static String getFileLinks(String ID, File file, String root) 1727 1726 { … … 1732 1731 { 1733 1732 link += " [offline]"; 1734 }1735 else if (l == Location.SECONDARY)1736 {1737 link += " [secondary]";1738 1733 } 1739 1734 else if (l.isDownloadable()) -
trunk/src/core/net/sf/basedb/core/DbControl.java
r7551 r7595 596 596 throw new InvalidDataException("QuotaType.TOTAL is not a valid quota type for item " + item + "."); 597 597 } 598 if (location == Location.SECONDARY && !quotaType.getSecondaryLocation())599 {600 throw new InvalidDataException(quotaType.getName()+" cannot use the secondary location");601 }602 598 603 599 // Ignore quota check for some locations -
trunk/src/core/net/sf/basedb/core/Location.java
r7548 r7595 44 44 */ 45 45 PRIMARY(1, "Primary", true, true), 46 /**47 The item is stored in secondary storage. Note! This type48 of storage may not be available on all servers.49 @deprecated In 3.14, no replacement50 */51 @Deprecated52 SECONDARY(2, "Secondary", false, true),53 46 /** 54 47 The item is stored externally. Some information like -
trunk/src/core/net/sf/basedb/core/Quota.java
r7548 r7595 379 379 @throws PermissionDeniedException If the user has no write permissions. 380 380 */ 381 @SuppressWarnings("deprecation")382 381 public void setQuotaValue(QuotaType quotaType, Location location, long bytes) 383 382 throws InvalidDataException, PermissionDeniedException … … 392 391 throw new InvalidUseOfNullException("A quota must have a location"); 393 392 } 394 else if ( location == Location.SECONDARY && !quotaType.hasSecondaryLocation())395 { 396 throw new InvalidDataException("Quota for the secondarylocation cannot be set for "+quotaType.getName());393 else if (!location.isQuotaLimited()) 394 { 395 throw new InvalidDataException("Quota for '" + location + "' location cannot be set for "+quotaType.getName()); 397 396 } 398 397 if ((bytes < 0) && (bytes != UNLIMITED) && (bytes != UNDEFINED)) -
trunk/src/core/net/sf/basedb/core/Update.java
r7573 r7595 2079 2079 all files with location=2 (secondary), remove the 'action' 2080 2080 column and all stored contexts using the 'action' column. 2081 Update the QuotaValues table by removing all entries with 2082 location=2 2081 2083 @return The new schema version (=144) 2082 2084 */ … … 2102 2104 query.executeUpdate(); 2103 2105 2106 // Remove rows in QuotaValues with location=2 2107 query = HibernateUtil.createSqlQuery(session, 2108 "DELETE FROM [QuotaValues] WHERE [location]=2"); 2109 query.executeUpdate(); 2110 2104 2111 // Remove table filters, etc. that use the 'action' property 2105 2112 cleanContextFromProperty(session, Item.FILE, "action", null, true); -
trunk/www/admin/diskusage/details/view_details.jsp
r6834 r7595 263 263 <th style="width: 12em;">Total</td> 264 264 <th style="width: 12em;">Primary</td> 265 <th style="width: 12em;"> Secondary</td>265 <th style="width: 12em;">External</td> 266 266 <th style="width: 12em;">Offline</td> 267 <th style="width: 12em;">External</td>268 267 </tr> 269 268 <tr style="border-top-width: 1px;" class="highlight"> … … 271 270 <td><%=Values.formatBytes(summary.getTotal())%></td> 272 271 <td><%=Values.formatBytes(summary.getTotal(Location.PRIMARY))%></td> 273 <td><%=Values.formatBytes(summary.getTotal(Location. SECONDARY))%></td>272 <td><%=Values.formatBytes(summary.getTotal(Location.EXTERNAL))%></td> 274 273 <td><%=Values.formatBytes(summary.getTotal(Location.OFFLINE))%></td> 275 <td><%=Values.formatBytes(summary.getTotal(Location.EXTERNAL))%></td>276 274 </tr> 277 275 <% … … 283 281 <td><%=Values.formatBytes(summary.getTotal(qt))%></td> 284 282 <td><%=Values.formatBytes(summary.getTotal(qt, Location.PRIMARY))%></td> 285 <td><%=qt. hasSecondaryLocation() ? Values.formatBytes(summary.getTotal(qt, Location.SECONDARY)) : "n/a"%></td>283 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.EXTERNAL)) : "n/a"%></td> 286 284 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.OFFLINE)) : "n/a"%></td> 287 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.EXTERNAL)) : "n/a"%></td>288 285 </tr> 289 286 <% -
trunk/www/admin/diskusage/list_groups.jsp
r6834 r7595 79 79 final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); 80 80 final boolean writePermission = sc.hasPermission(Permission.WRITE, Item.GROUP); 81 final String showStatistics = Values.getString(cc.getSetting("showStatistics"), 82 Application.hasSecondaryStorage() ? "full" : "quotaType"); 81 final String showStatistics = Values.getString(cc.getSetting("showStatistics"), "full"); 83 82 84 83 final boolean hasLocation = "location".equals(showStatistics) || "full".equals(showStatistics); … … 375 374 <th>Total</th> 376 375 <td>Primary</td> 377 <td> Secondary</td>376 <td>External</td> 378 377 <td>Offline</td> 379 <td>External</td>380 378 </tr> 381 379 <% … … 397 395 %> 398 396 <td><%=Values.formatBytes(summary.getTotal(Location.PRIMARY))%></td> 399 <td><%=Values.formatBytes(summary.getTotal(Location. SECONDARY))%></td>397 <td><%=Values.formatBytes(summary.getTotal(Location.EXTERNAL))%></td> 400 398 <td><%=Values.formatBytes(summary.getTotal(Location.OFFLINE))%></td> 401 <td><%=Values.formatBytes(summary.getTotal(Location.EXTERNAL))%></td>402 399 <% 403 400 } … … 418 415 %> 419 416 <td><%=Values.formatBytes(summary.getTotal(qt, Location.PRIMARY))%></td> 420 <td><%=qt. hasSecondaryLocation() ? Values.formatBytes(summary.getTotal(qt, Location.SECONDARY)) : "n/a"%></td>417 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.EXTERNAL)) : "n/a"%></td> 421 418 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.OFFLINE)) : "n/a"%></td> 422 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.EXTERNAL)) : "n/a"%></td>423 419 <% 424 420 } -
trunk/www/admin/diskusage/list_users.jsp
r6834 r7595 82 82 final boolean impersonatePermission = sc.hasSystemPermission(Permission.ACT_AS_ANOTHER_USER); 83 83 final boolean writePermission = sc.hasPermission(Permission.WRITE, Item.USER); 84 final String showStatistics = Values.getString(cc.getSetting("showStatistics"), 85 Application.hasSecondaryStorage() ? "full" : "quotaType"); 84 final String showStatistics = Values.getString(cc.getSetting("showStatistics"), "full"); 86 85 87 86 final boolean hasLocation = "location".equals(showStatistics) || "full".equals(showStatistics); … … 511 510 <th>Total</th> 512 511 <td>Primary</td> 513 <td> Secondary</td>512 <td>External</td> 514 513 <td>Offline</td> 515 <td>External</td>516 514 </tr> 517 515 <% … … 533 531 %> 534 532 <td><%=Values.formatBytes(summary.getTotal(Location.PRIMARY))%></td> 535 <td><%=Values.formatBytes(summary.getTotal(Location. SECONDARY))%></td>533 <td><%=Values.formatBytes(summary.getTotal(Location.EXTERNAL))%></td> 536 534 <td><%=Values.formatBytes(summary.getTotal(Location.OFFLINE))%></td> 537 <td><%=Values.formatBytes(summary.getTotal(Location.EXTERNAL))%></td>538 535 <% 539 536 } … … 554 551 %> 555 552 <td><%=Values.formatBytes(summary.getTotal(qt, Location.PRIMARY))%></td> 556 <td><%=qt. hasSecondaryLocation() ? Values.formatBytes(summary.getTotal(qt, Location.SECONDARY)) : "n/a"%></td>553 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.EXTERNAL)) : "n/a"%></td> 557 554 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.OFFLINE)) : "n/a"%></td> 558 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.EXTERNAL)) : "n/a"%></td>559 555 <% 560 556 } -
trunk/www/admin/diskusage/overview.jsp
r6621 r7595 101 101 <th style="width: 12em;">Total</th> 102 102 <th style="width: 12em;">Primary</th> 103 <th style="width: 12em;"> Secondary</th>103 <th style="width: 12em;">External</th> 104 104 <th style="width: 12em;">Offline</th> 105 <th style="width: 12em;">External</th>106 105 </tr> 107 106 <tr style="border-top-width: 1px;" class="highlight"> … … 109 108 <td><%=Values.formatBytes(summary.getTotal())%></td> 110 109 <td><%=Values.formatBytes(summary.getTotal(Location.PRIMARY))%></td> 111 <td><%=Values.formatBytes(summary.getTotal(Location. SECONDARY))%></td>110 <td><%=Values.formatBytes(summary.getTotal(Location.EXTERNAL))%></td> 112 111 <td><%=Values.formatBytes(summary.getTotal(Location.OFFLINE))%></td> 113 <td><%=Values.formatBytes(summary.getTotal(Location.EXTERNAL))%></td>114 112 </tr> 115 113 <% … … 121 119 <td><%=Values.formatBytes(summary.getTotal(qt))%></td> 122 120 <td><%=Values.formatBytes(summary.getTotal(qt, Location.PRIMARY))%></td> 123 <td><%=qt. hasSecondaryLocation() ? Values.formatBytes(summary.getTotal(qt, Location.SECONDARY)) : "n/a"%></td>121 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.EXTERNAL)) : "n/a"%></td> 124 122 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.OFFLINE)) : "n/a"%></td> 125 <td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.EXTERNAL)) : "n/a"%></td>126 123 </tr> 127 124 <% -
trunk/www/admin/quota/edit_quota.jsp
r6621 r7595 57 57 private String getQuotaInput(Quota quota, QuotaType type, Location location) 58 58 { 59 if (location == Location.SECONDARY && !type.hasSecondaryLocation()) return "N/A";60 59 long bytes = quota == null ? Quota.UNDEFINED : quota.getQuotaValue(type, location); 61 60 String fBytes = ""; … … 159 158 <th></th> 160 159 <td><b>Primary location</b></td> 161 <td><b>Secondary location</b></td>162 160 <td></td> 163 161 </tr> … … 165 163 <th>Total quota</th> 166 164 <td><%=getQuotaInput(quota, total, Location.PRIMARY)%></td> 167 <td><%=getQuotaInput(quota, total, Location.SECONDARY)%></td>168 165 <td></td> 169 166 </tr> … … 176 173 <th class="subprompt"><%=HTML.encodeTags(current.getName())%></th> 177 174 <td><%=getQuotaInput(quota, current, Location.PRIMARY)%></td> 178 <td><%=getQuotaInput(quota, current, Location.SECONDARY)%></td>179 175 <td></td> 180 176 </tr> -
trunk/www/admin/quota/index.jsp
r6305 r7595 160 160 for (Location location : Location.values()) 161 161 { 162 if ( !(location == Location.SECONDARY && !type.hasSecondaryLocation()))162 if (location.isQuotaLimited()) 163 163 { 164 164 long bytes = Quota.UNDEFINED; -
trunk/www/admin/quota/view_quota.jsp
r6621 r7595 64 64 private String displayQuota(Quota quota, QuotaType type, Location location) 65 65 { 66 if (location == Location.SECONDARY && !type.hasSecondaryLocation()) return "N/A";67 66 long bytes = quota.getQuotaValue(type, location); 68 67 String fBytes = ""; … … 245 244 <th style="width: 10em;"></th> 246 245 <th style="width: 12em;">Primary location</th> 247 <th style="width: 12em;">Secondary location</th>248 246 </tr> 249 247 <tr class="bottomborder"> 250 248 <th><%=Base.getLinkedName(ID, total, false, true)%></th> 251 249 <td><%=displayQuota(quota, total, Location.PRIMARY)%></td> 252 <td><%=displayQuota(quota, total, Location.SECONDARY)%></td>253 250 </tr> 254 251 <% … … 256 253 for (QuotaType current : quotaTypes) 257 254 { 258 long primaryBytes = quota.getQuotaValue(current, Location.PRIMARY);259 long secondaryBytes = quota.getQuotaValue(current, Location.SECONDARY);260 255 %> 261 256 <tr> 262 257 <th><%=Base.getLinkedName(ID, current, false, true)%></th> 263 258 <td><%=displayQuota(quota, current, Location.PRIMARY)%></td> 264 <td><%=displayQuota(quota, current, Location.SECONDARY)%></td>265 259 </tr> 266 260 <%
Note: See TracChangeset
for help on using the changeset viewer.