Changeset 7233
- Timestamp:
- Nov 17, 2016, 1:36:34 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/ExtensionsControl.java
r7232 r7233 213 213 int numUninstalled = 0; 214 214 int numIgnored = 0; 215 int numNotIgnored = 0; 215 216 216 217 // Extensions+extension points statistics … … 224 225 if (!initialScan) 225 226 { 227 // Checks if any of the ignored files have been selected for "Stop ignore" 228 for (File ignored : manager.getIgnoredFiles(true)) 229 { 230 boolean stopIgnore = Values.getBoolean(request.getParameter(ignored.getName()+".stopignore")); 231 boolean install = Values.getBoolean(request.getParameter(ignored.getName()+".install")); 232 233 if (stopIgnore) 234 { 235 if (ignored.isFile()) 236 { 237 ExtensionsFile xtFile = manager.addFile(ignored); 238 String status = "Not ignored"; 239 if (install && xtFile.hasError()) status = "Not installed"; 240 results.setStatus(xtFile, status); 241 } 242 else 243 { 244 manager.removeIgnore(ignored); 245 } 246 numNotIgnored++; 247 } 248 } 249 226 250 // 0. Collecting files to be ignored 227 251 IgnoreFilter ignoreFilter = new IgnoreFilter(request); … … 327 351 summary.append(numIgnored + " file(s) ignored\n"); 328 352 } 353 if (numNotIgnored > 0) 354 { 355 summary.append(numNotIgnored + " file(s) no longer ignored\n"); 356 } 329 357 if (results.getNumErrorFiles() > 0) 330 358 { -
trunk/src/core/net/sf/basedb/util/extensions/manager/ExtensionsFile.java
r7232 r7233 379 379 if (zipEntry == null) 380 380 { 381 throw new FileNotFoundException( "META-INF/extensions.xml");381 throw new FileNotFoundException(name+"!META-INF/extensions.xml"); 382 382 } 383 383 in = new CloseResourceInputStream(zipFile.getInputStream(zipEntry), zipFile); -
trunk/src/core/net/sf/basedb/util/extensions/manager/ExtensionsManager.java
r7232 r7233 225 225 ExtensionsFile xtFile = new ExtensionsFile(this, file); 226 226 addExtensionsFile(xtFile); 227 ignore.remove(file);227 removeIgnore(file); 228 228 return xtFile; 229 229 } -
trunk/src/core/net/sf/basedb/util/extensions/manager/ProcessResults.java
r6520 r7233 185 185 fileResults.put(xtFile, m); 186 186 oldFileResults.put(xtFile, m); 187 if (xtFile.hasError()) 188 { 189 hasError = true; 190 numErrorFiles++; 191 m.hasError = true; 192 } 187 193 } 188 194 m.status = status; -
trunk/src/core/net/sf/basedb/util/extensions/manager/processor/IgnoreFileProcessor.java
r7232 r7233 80 80 ExtensionsFile xtFile = wFile.getExtensionsFile(); 81 81 filesToIgnore.add(wFile); 82 results.forgetOldResults(xtFile); 82 83 numFiles++; 83 84 } … … 140 141 } 141 142 results.setStatus(xtFile, status); 142 results.forgetOldResults(xtFile);143 143 } 144 144 } -
trunk/www/admin/extensions/wizard.js
r7232 r7233 44 44 Events.addEventHandler(element, 'click', wizard.ignoreOnClick); 45 45 } 46 else if (autoInit == 'stop-ignore') 47 { 48 Events.addEventHandler(element, 'click', wizard.stopIgnoreOnClick); 49 } 46 50 } 47 51 Doc.addElementInitializer(wizard.initCheckBoxes); … … 64 68 var ignore = frm[install.name.replace(/\.install$/, '.ignore')]; 65 69 if (ignore) ignore.checked = false; 70 var stopIgnore = frm[install.name.replace(/\.install$/, '.stopignore')]; 71 if (stopIgnore) stopIgnore.checked = true; 66 72 } 67 73 } … … 75 81 var install = frm[uninstall.name.replace(/\.uninstall$/, '.install')]; 76 82 if (install) install.checked = false; 83 } 84 else 85 { 86 var ignore = frm[uninstall.name.replace(/\.uninstall$/, '.ignore')]; 87 if (ignore) ignore.checked = false; 77 88 } 78 89 } … … 91 102 } 92 103 104 wizard.stopIgnoreOnClick = function(event) 105 { 106 var frm = document.forms['scan']; 107 var stopIgnore = event.target; 108 if (!stopIgnore.checked) 109 { 110 var install = frm[stopIgnore.name.replace(/\.stopignore$/, '.install')]; 111 if (install) install.checked = false; 112 } 113 } 93 114 94 115 wizard.startManualScan = function() -
trunk/www/admin/extensions/wizard.jsp
r7232 r7233 36 36 import="net.sf.basedb.util.Values" 37 37 import="net.sf.basedb.clients.web.util.HTML" 38 import="net.sf.basedb.util.formatter.Formatter" 38 39 import="net.sf.basedb.util.extensions.ExtensionPoint" 39 40 import="net.sf.basedb.util.extensions.Extension" … … 43 44 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" 44 45 import="net.sf.basedb.clients.web.extensions.UnsafeScriptable" 46 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 45 47 import="net.sf.basedb.clients.web.servlet.ContentSecurityPolicyFilter" 46 48 import="java.util.List" 49 import="java.io.File" 50 import="java.util.Date" 47 51 %> 48 52 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> … … 55 59 try 56 60 { 61 Formatter<Date> dateFormatter = FormatterFactory.getDateTimeFormatter(sc); 62 57 63 dc = sc.newDbControl(); 58 64 ExtensionsControl ec = ExtensionsControl.get(dc); … … 60 66 ec.scanForChanges(); 61 67 List<ExtensionsFile> xtFiles = ec.getFiles(); 68 List<File> ignoredFiles = ec.getIgnoredFiles(); 62 69 %> 63 70 <base:page type="popup" title="Extensions and plug-ins installation wizard"> 64 <base:head scripts="table.js,~wizard.js" styles="table.css" /> 71 <base:head scripts="table.js,~wizard.js" styles="table.css"> 72 <style> 73 .ignored-header td 74 { 75 font-weight: bold; 76 border-top-style: solid; 77 border-bottom-style: solid; 78 border-top-width: 1px; 79 border-bottom-width: 1px; 80 padding: 1px 2px; 81 } 82 .ignored-file td 83 { 84 opacity: 0.5; 85 } 86 .ignored-file .input 87 { 88 opacity: 1; 89 } 90 </style> 91 </base:head> 65 92 <base:body> 66 93 <h1>Extensions and plug-ins installation wizard <base:help helpid="extensions.install-wizard" /></h1> … … 68 95 <tbl:table id="scan" subclass="fulltable" action="index.jsp" > 69 96 <tbl:columndef id="file" title="File" /> 70 <tbl:columndef id="status" title="Status" />71 <tbl:columndef id="install" title="Install" />72 <tbl:columndef id="uninstall" title="Uninstall" />73 <tbl:columndef id="ignore" title="Ignore" />97 <tbl:columndef id="status" title="Status" style="text-align: center;"/> 98 <tbl:columndef id="install" title="Install" style="text-align: center;"/> 99 <tbl:columndef id="uninstall" title="Uninstall" style="text-align: center;"/> 100 <tbl:columndef id="ignore" title="Ignore" style="text-align: center;" /> 74 101 <tbl:columndef id="about" title="About" /> 75 102 … … 148 175 <tbl:row> 149 176 <tbl:cell column="file" style="white-space: nowrap;"><%=name%></tbl:cell> 150 <tbl:cell column="status" ><%=status%></tbl:cell>151 <tbl:cell column="install" 177 <tbl:cell column="status" style="text-align: center; white-space: nowrap;"><%=status%></tbl:cell> 178 <tbl:cell column="install" style="text-align: center;"> 152 179 <% 153 180 if (allowInstall) … … 219 246 </tbl:row> 220 247 <% 248 } 249 if (ignoredFiles.size() > 0) 250 { 251 %> 252 <tr class="ignored-header bg-filled-100"> 253 <td colspan="2">Ignored files (<%=ignoredFiles.size() %>)</td> 254 <td class="cell" style="text-align: center;">Install</td> 255 <td class="cell" ></td> 256 <td class="cell" style="text-align: center;">Stop ignoring</td> 257 <td class="cell"></td> 258 </tr> 259 <% 260 for (File ignoredFile : ignoredFiles) 261 { 262 String name = ignoredFile.getName(); 263 String fileInfo = ""; 264 boolean checkStopIgnore = false; 265 boolean allowInstall = true; 266 if (ignoredFile.isFile()) 267 { 268 fileInfo = Values.formatBytes(ignoredFile.length()); 269 fileInfo += "; " + dateFormatter.format(new Date(ignoredFile.lastModified())); 270 } 271 else 272 { 273 fileInfo = "File does not exist."; 274 checkStopIgnore = true; 275 allowInstall = false; 276 } 277 %> 278 <tbl:row clazz="ignored-file"> 279 <tbl:cell column="file" style="white-space: nowrap;"><%=name%></tbl:cell> 280 <tbl:cell column="status" style="text-align: center; white-space: nowrap;">Ignored</tbl:cell> 281 <tbl:cell clazz="cell input" column="install" style="text-align: center;"> 282 <% 283 if (allowInstall) 284 { 285 %> 286 <input type="checkbox" class="auto-init" data-auto-init="install" 287 name="<%=name%>.install" value="1"> 288 <% 289 } 290 %> 291 </tbl:cell> 292 <tbl:cell clazz="cell input" column="ignore" style="text-align: center;"> 293 <input type="checkbox" class="auto-init" data-auto-init="stop-ignore" 294 name="<%=name%>.stopignore" value="1" <%=checkStopIgnore ? "checked" : "" %>> 295 </tbl:cell> 296 <tbl:cell column="about"><%=HTML.encodeTags(fileInfo) %></tbl:cell> 297 </tbl:row> 298 <% 299 } 221 300 } 222 301 %>
Note: See TracChangeset
for help on using the changeset viewer.