Changeset 7857
- Timestamp:
- Oct 20, 2020, 8:20:12 AM (3 years ago)
- Location:
- trunk/www/filemanager/files
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/filemanager/files/edit_file.jsp
r7605 r7857 133 133 %> 134 134 <base:page type="popup" title="<%=title%>" id="edit-page"> 135 <base:head scripts="tabcontrol-2.js, ~files.js" styles="tabcontrol.css">135 <base:head scripts="tabcontrol-2.js,subtypes.js,~files.js" styles="tabcontrol.css"> 136 136 <ext:scripts context="<%=jspContext%>" /> 137 137 <ext:stylesheets context="<%=jspContext%>" /> … … 300 300 </table> 301 301 </t:tab> 302 <t:tab id="annotations" title="Annotations" helpid="annotations.edit"> 303 <jsp:include page="../../common/annotations/annotate_frameset.jsp"> 304 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 305 <jsp:param name="item_id" value="<%=itemId%>" /> 306 <jsp:param name="ID" value="<%=ID%>" /> 307 </jsp:include> 308 </t:tab> 302 309 </t:tabcontrol> 303 310 </form> -
trunk/www/filemanager/files/files.js
r7703 r7857 43 43 // Tab validation 44 44 TabControl.addTabValidator('settings.info', fileManager.validateFile); 45 TabControl.addTabActivateListener('settings.annotations', fileManager.loadAnnotationsFrame); 45 46 46 47 // MIME type … … 79 80 Buttons.addClickHandler('moveOffline', fileManager.moveToLocation); 80 81 82 TabControl.addTabActivateListener('main.annotations', AnnotationsList.loadOnce); 81 83 TabControl.addTabActivateListener('main.history', History.loadOnce); 82 84 } … … 387 389 if (TabControl.validateActiveTab('settings')) 388 390 { 391 Annotations.saveModifiedAnnotationsToForm(frm); 389 392 frm.submit(); 390 393 } … … 428 431 } 429 432 } 433 434 fileManager.loadAnnotationsFrame = function() 435 { 436 Annotations.autoLoadEditFrame(null, ItemSubtype.getSubtypeId('subtype_id'), null); 437 } 438 430 439 431 440 return fileManager; -
trunk/www/filemanager/files/index.jsp
r7703 r7857 236 236 } 237 237 238 // Annotations tab 239 Base.updateAnnotations(dc, file, file, request); 240 238 241 // OnSave extensions 239 242 invoker.render(OnSaveRenderer.ON_SAVE); -
trunk/www/filemanager/files/list_files.jsp
r7855 r7857 35 35 import="net.sf.basedb.core.Directory" 36 36 import="net.sf.basedb.core.ItemSubtype" 37 import="net.sf.basedb.core.AnnotationType" 37 38 import="net.sf.basedb.core.ItemQuery" 38 39 import="net.sf.basedb.core.ItemResultIterator" … … 54 55 import="net.sf.basedb.core.plugin.GuiContext" 55 56 import="net.sf.basedb.core.plugin.Plugin" 57 import="net.sf.basedb.core.snapshot.AnnotationLoaderUtil" 58 import="net.sf.basedb.core.snapshot.AnnotationTypeFilter" 59 import="net.sf.basedb.core.snapshot.AnnotationSnapshot" 60 import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot" 61 import="net.sf.basedb.core.snapshot.SnapshotManager" 56 62 import="net.sf.basedb.util.Enumeration" 57 63 import="net.sf.basedb.util.ShareableUtil" … … 74 80 import="net.sf.basedb.clients.web.extensions.fileviewer.FileViewerUtil" 75 81 import="net.sf.basedb.clients.web.extensions.fileviewer.FileViewerContext" 82 import="net.sf.basedb.clients.web.util.ProjectSpecificInfoFilter" 76 83 import="net.sf.basedb.util.extensions.ExtensionsInvoker" 77 84 import="java.util.Iterator" … … 104 111 ItemResultIterator<File> files = null; 105 112 ItemResultIterator<Directory> directories = null; 113 List<AnnotationLoaderUtil> annotationLoaders = new ArrayList<AnnotationLoaderUtil>(); 106 114 try 107 115 { … … 113 121 Unit bytes = UnitUtil.getUnit(dc, Quantity.STORAGE_SIZE, "B"); 114 122 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 123 124 ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); 125 SnapshotManager manager = new SnapshotManager(); 126 ProjectSpecificInfoFilter psInfo = new ProjectSpecificInfoFilter(); 127 for (AnnotationType at : annotationTypeQuery.list(dc)) 128 { 129 annotationLoaders.add(new AnnotationLoaderUtil(dc, manager, at)); 130 } 115 131 116 132 // Get all file types … … 512 528 datatype="string" 513 529 /> 530 <% 531 for (AnnotationLoaderUtil loader : annotationLoaders) 532 { 533 AnnotationType at = loader.getAnnotationType(); 534 Formatter<Object> formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); 535 Enumeration<String, String> annotationEnum = null; 536 if (at.isEnumeration()) 537 { 538 annotationEnum = new Enumeration<String, String>(); 539 if (!at.getDisplayAsList()) annotationEnum.add("", "-none-"); 540 List<?> values = at.getValues(); 541 for (Object value : values) 542 { 543 String encoded = HTML.encodeTags(value.toString()); 544 annotationEnum.add(encoded, encoded); 545 } 546 } 547 %> 548 <tbl:columndef 549 id="<%=(loader.isSearchingInheritedAnnotations() ? "ia" : "at")+at.getId()%>" 550 title="<%=HTML.encodeTags(at.getName())+(loader.isSearchingInheritedAnnotations() ? " [I]" : " [A]")%>" 551 property="<%=(loader.isSearchingInheritedAnnotations() ? "##" : "#")+at.getId()%>" 552 annotation="true" 553 datatype="<%=at.getValueType().getStringValue()%>" 554 enumeration="<%=annotationEnum%>" 555 smartenum="<%=at.getDisplayAsList() %>" 556 sortable="<%=at.getMultiplicity() == 1 && !loader.isSearchingInheritedAnnotations()%>" 557 filterable="true" 558 exportable="true" 559 formatter="<%=formatter%>" 560 unit="<%=at.getDefaultUnit()%>" 561 /> 562 <% 563 } 564 %> 514 565 <tbl:columndef 515 566 id="xt-columns" … … 1002 1053 %> 1003 1054 </tbl:cell> 1055 <% 1056 if (item.isAnnotated()) 1057 { 1058 AnnotationSetSnapshot snapshot = manager.getSnapshot(dc, item.getAnnotationSet().getId()); 1059 for (AnnotationLoaderUtil loader : annotationLoaders) 1060 { 1061 %> 1062 <tbl:cell 1063 column="<%=(loader.isSearchingInheritedAnnotations() ? "ia" : "at")+loader.getId()%>" 1064 ><% 1065 if (loader.find(snapshot, psInfo.reset())) 1066 { 1067 %><tbl:cellvalue 1068 list="<%=loader.getValues()%>" 1069 suffix="<%=loader.getUnitSymbol()%>" 1070 clazz="<%=psInfo.overridesDefaultAnnotation() ? "ps-annotation" : null%>" 1071 /><% 1072 } 1073 %></tbl:cell> 1074 <% 1075 } 1076 } 1077 %> 1004 1078 <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> 1005 1079 <tbl:cell column="xt-columns" /> -
trunk/www/filemanager/files/view_file.jsp
r7855 r7857 350 350 </jsp:include> 351 351 </t:tab> 352 <t:tab id="annotations" title="Annotations" 353 tooltip="View annotation values" clazz="white"> 354 <jsp:include page="../../common/annotations/list_frameset.jsp"> 355 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 356 <jsp:param name="item_id" value="<%=itemId%>" /> 357 <jsp:param name="ID" value="<%=ID%>" /> 358 </jsp:include> 359 </t:tab> 360 352 361 <t:tab id="history" title="History" 353 362 tooltip="Displays a log with the history of this item"
Note: See TracChangeset
for help on using the changeset viewer.