Changeset 8107
- Timestamp:
- Jan 23, 2023, 8:27:43 AM (8 months ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 23 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3.19-stable merged: 8093,8095-8104 /tags/3.19.6 (added) merged: 8105
- Property svn:mergeinfo changed
-
trunk/.classpath
r8094 r8107 26 26 <classpathentry kind="lib" path="lib/dist/json-simple-1.1.1-1.jar"/> 27 27 <classpathentry kind="lib" path="lib/dist/utf8-with-fallback-1.1.0.jar"/> 28 <classpathentry kind="lib" path="lib/dist/postgresql-42.2.20.jar"/>29 28 <classpathentry kind="lib" path="lib/dist/httpclient-4.5.13.jar"/> 30 29 <classpathentry kind="lib" path="lib/dist/httpcore-4.4.14.jar"/> … … 35 34 <classpathentry kind="lib" path="lib/dist/poi-ooxml-5.0.0.jar"/> 36 35 <classpathentry kind="lib" path="lib/dist/hibernate-core-5.5.6.Final.jar"/> 36 <classpathentry kind="lib" path="lib/dist/postgresql-42.5.1.jar"/> 37 37 <classpathentry kind="lib" path="lib/dist/zip4j-2.11.2.jar"/> 38 38 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"> -
trunk/doc/3rd-party-components.txt
r8094 r8107 118 118 119 119 More info : http://jdbc.postgresql.org/ 120 Version : 42. 2.20120 Version : 42.5.1 121 121 License : BSD License (postgres.license.txt) 122 Jar files : postgresql-42. 2.20.jar122 Jar files : postgresql-42.5.1.jar 123 123 124 124 -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/ColumnDef.java
r8083 r8107 935 935 if (isFilterable && hasFilter) 936 936 { 937 table.addFilteredColumn(get Filterproperty(), isVisible);937 table.addFilteredColumn(getId(), getFilterproperty(), isVisible); 938 938 } 939 939 } -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/PresetSelector.java
r8083 r8107 319 319 if (value.startsWith("/")) 320 320 { 321 if (value.endsWith("/name") || value.endsWith(".name"))321 if (value.endsWith("/name")) 322 322 { 323 323 value = value.replace("/name", "/."); -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Table.java
r8083 r8107 565 565 columnFilter.put(columnId+"@"+row, filterHtml); 566 566 } 567 void addFilteredColumn(String columnId, boolean visible)567 void addFilteredColumn(String columnId, String filterProperty, boolean visible) 568 568 { 569 569 numFilteredColumns++; 570 if (visible) hiddenFilteredColumns.remove(columnId); 570 // Swap the filter property with column id if needed 571 hiddenFilteredColumns.remove(filterProperty); 572 if (!visible) hiddenFilteredColumns.add(columnId); 571 573 } 572 574 Set<String> getHiddenFilteredColumns() -
trunk/src/core/common-queries.xml
r8083 r8107 1856 1856 ) 1857 1857 AND plg.disabled = false 1858 AND (cfg.id IS NULL OR cfg.disabled = false) 1858 1859 GROUP BY plg.mainType 1859 1860 </sql> -
trunk/src/core/net/sf/basedb/core/Install.java
r7963 r8107 119 119 method. 120 120 */ 121 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(15 1).intValue();121 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(152).intValue(); 122 122 123 123 public static synchronized int createTables(SchemaGenerator.Mode mode, ProgressReporter progress, -
trunk/src/core/net/sf/basedb/core/Job.java
r7962 r8107 128 128 { 129 129 throw new InvalidDataException("Plugin " + plugin.getName() + " requires a configuration"); 130 } 131 132 if (plugin.isDisabled()) 133 { 134 throw new PermissionDeniedException("The plugin is disabled: " + plugin.getName()); 135 } 136 if (config != null && config.isDisabled()) 137 { 138 throw new PermissionDeniedException("The plugin configuration is disabled: " + config.getName()); 130 139 } 131 140 -
trunk/src/core/net/sf/basedb/core/PluginConfiguration.java
r7513 r8107 364 364 getData().setPluginDefinition(pd.getData()); 365 365 } 366 367 /** 368 Checks if this plugin configuration is disabled or not. A disabled configuration 369 can't be used. 370 @since 3.19.6 371 */ 372 public boolean isDisabled() 373 { 374 return getData().isDisabled(); 375 } 376 377 /** 378 Disabled or enable this plugin configuration. 379 @since 3.19.6 380 */ 381 public void setDisabled(boolean disabled) 382 { 383 checkPermission(Permission.WRITE); 384 getData().setDisabled(disabled); 385 } 366 386 367 387 /** -
trunk/src/core/net/sf/basedb/core/PluginDefinition.java
r7513 r8107 303 303 ) 304 304 AND plg.disabled = false 305 AND (cfg.id IS NULL OR cfg.disabled = false) 305 306 GROUP BY plg.mainType 306 307 */ -
trunk/src/core/net/sf/basedb/core/PropertyFilter.java
r8094 r8107 907 907 ItemContext targetItemContext = new ItemContext(targetType, pp); 908 908 targetItemContext.configureQuery(dc, subquery, subContext, true); 909 subquery.setIncludes(Include.ALL); 909 910 if (context != null && targetItemContext.getException() != null) 910 911 { -
trunk/src/core/net/sf/basedb/core/Update.java
r8026 r8107 467 467 </td> 468 468 </tr> 469 <tr> 470 <td>152</td> 471 <td> 472 Added {@link PluginConfiguration#isDisabled()}. The update will set the value to FALSE 473 for all existing configurations. 474 </td> 475 </tr> 469 476 </table> 470 477 … … 767 774 if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 151..."); 768 775 schemaVersion = updateToSchemaVersion151(session, schemaVersion, progress); 776 progress_current += progress_step; 777 } 778 779 if (schemaVersion < 152) 780 { 781 if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 150..."); 782 schemaVersion = setSchemaVersionInTransaction(session, 152); 769 783 progress_current += progress_step; 770 784 } -
trunk/src/core/net/sf/basedb/core/data/PluginConfigurationData.java
r6127 r8107 58 58 } 59 59 // ------------------------------------------- 60 private boolean disabled; 61 /** 62 If the plugin is enabled or disabled. 63 // Mapped in hibernate-properties-PluginConfigurationData.xml since annotation doesn't support a default value 64 @since 3.19.6 65 */ 66 public boolean isDisabled() 67 { 68 return disabled; 69 } 70 public void setDisabled(boolean disabled) 71 { 72 this.disabled = disabled; 73 } 60 74 61 75 private PluginDefinitionData pluginDefinition; -
trunk/src/core/net/sf/basedb/core/dtd/raw-data-types.dtd
r5679 r8107 20 20 along with BASE. If not, see <http://www.gnu.org/licenses/>. 21 21 --> 22 <!ELEMENT raw-data-types (raw-data-type +) >22 <!ELEMENT raw-data-types (raw-data-type*) > 23 23 24 24 <!ELEMENT raw-data-type (property*,intensity-formula*) > -
trunk/src/core/net/sf/basedb/util/AutoDetectFileFormat.java
r6127 r8107 130 130 ItemQuery<PluginConfiguration> configQuery = plugin.getPluginConfigurations(); 131 131 configQuery.restrict(Restrictions.gt(Hql.property("parameterVersion"), Expressions.integer(0))); 132 configQuery.restrict(Restrictions.eq(Hql.property("disabled"), Expressions.parameter("isDisabled", false))); 132 133 configQuery.order(Orders.asc(Hql.property("name"))); 133 134 configQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS); -
trunk/src/core/net/sf/basedb/util/extensions/manager/Settings.java
r7231 r8107 32 32 import java.util.List; 33 33 34 import net.sf.basedb.core.Config; 34 35 import net.sf.basedb.core.Presets; 35 36 import net.sf.basedb.core.Presets.Preset; … … 70 71 private final File file; 71 72 private final ExtensionsManager manager; 73 private final String pluginsDir; 74 private final String userFilesDir; 72 75 private boolean hasChanged; 73 76 private Presets presets; … … 89 92 this.manager = manager; 90 93 this.file = file; 94 this.pluginsDir = new File(Config.getString("plugins.dir")).getAbsolutePath(); 95 this.userFilesDir = new File(Config.getString("userfiles")).getAbsolutePath(); 91 96 this.presets = new Presets(); 92 97 if (file != null && file.isFile()) … … 104 109 } 105 110 this.settings = presets.getDefault(); 106 this.installedFiles = presets.getPreset("installed-files");107 this.ignoredFiles = presets.getPreset("ignored-files");111 this.installedFiles = fixPaths(presets.getPreset("installed-files")); 112 this.ignoredFiles = fixPaths(presets.getPreset("ignored-files")); 108 113 this.disabledExtensionPoints = presets.getPreset("disabled-extension-points"); 109 114 this.disabledExtensions = presets.getPreset("disabled-extensions"); … … 200 205 201 206 /** 207 A file is typically stored under the absolute path, but 208 if it matches the plug-ins directory we replace it with {plugins.dir}. 209 @since 3.19.6 210 */ 211 private String toKey(File file) 212 { 213 String key = file.getAbsolutePath(); 214 if (pluginsDir != null) key = key.replace(pluginsDir, "{plugins.dir}"); 215 if (userFilesDir != null) key = key.replace(userFilesDir, "{userfiles.dir}"); 216 return key; 217 } 218 219 /** 220 A file is typically stored under the absolute path, but 221 if it matches the plug-ins directory we replace it with {plugins.dir}. 222 @since 3.19.6 223 */ 224 private File toFile(String key) 225 { 226 if (pluginsDir != null) key = key.replace("{plugins.dir}", pluginsDir); 227 if (userFilesDir != null) key = key.replace("{userfiles.dir}", userFilesDir); 228 return new File(key); 229 } 230 231 /** 232 Fix paths in older config files. This code can be removed some time in the future when 233 we are sure that everyone has upgraded. Eg. in BASE 3.21 since we must allow upgrades 234 between BASE 3.19.x and BASE 3.20.x. 235 */ 236 private Preset fixPaths(Preset preset) 237 { 238 for (String key : preset.getKeys()) 239 { 240 if (key.contains(pluginsDir)) 241 { 242 preset.setSetting(key.replace(pluginsDir, "{plugins.dir}"), preset.getSetting(key)); 243 preset.setSetting(key, null); 244 hasChanged = true; 245 } 246 else if (key.contains(userFilesDir)) 247 { 248 preset.setSetting(key.replace(userFilesDir, "{userfiles.dir}"), preset.getSetting(key)); 249 preset.setSetting(key, null); 250 hasChanged = true; 251 } 252 } 253 return preset; 254 } 255 256 /** 202 257 Check if the given file is marked as installed. 203 258 @since 3.0 … … 205 260 public boolean isInstalledFile(File file) 206 261 { 207 return Values.getBoolean(installedFiles.getSetting(file.getAbsolutePath())); 262 String key = toKey(file); 263 return Values.getBoolean(installedFiles.getSetting(key)); 208 264 } 209 265 … … 216 272 if (file == null) return; 217 273 hasChanged = true; 218 installedFiles.setSetting( file.getAbsolutePath(), "1");274 installedFiles.setSetting(toKey(file), "1"); 219 275 } 220 276 … … 227 283 if (file == null) return; 228 284 hasChanged = true; 229 installedFiles.setSetting( file.getAbsolutePath(), null);285 installedFiles.setSetting(toKey(file), null); 230 286 } 231 287 … … 236 292 public List<File> getInstalledFiles() 237 293 { 238 List<String> paths = installedFiles.getKeys();239 List<File> files = new ArrayList<File>( paths.size());240 for (String path : paths)241 { 242 files.add( new File(path));294 List<String> keys = installedFiles.getKeys(); 295 List<File> files = new ArrayList<File>(keys.size()); 296 for (String key : keys) 297 { 298 files.add(toFile(key)); 243 299 } 244 300 return files; … … 252 308 public boolean isIgnoredFile(File file) 253 309 { 254 return Values.getBoolean(ignoredFiles.getSetting( file.getAbsolutePath()));310 return Values.getBoolean(ignoredFiles.getSetting(toKey(file))); 255 311 } 256 312 … … 263 319 if (file == null) return; 264 320 hasChanged = true; 265 ignoredFiles.setSetting( file.getAbsolutePath(), ignore ? "1" : null);321 ignoredFiles.setSetting(toKey(file), ignore ? "1" : null); 266 322 } 267 323 … … 272 328 public List<File> getIgnoredFiles() 273 329 { 274 List<String> paths = ignoredFiles.getKeys();275 List<File> files = new ArrayList<File>( paths.size());276 for (String path : paths)277 { 278 files.add( new File(path));330 List<String> keys = ignoredFiles.getKeys(); 331 List<File> files = new ArrayList<File>(keys.size()); 332 for (String key : keys) 333 { 334 files.add(toFile(key)); 279 335 } 280 336 return files; -
trunk/www/admin/pluginconfigurations/edit_configuration.jsp
r7954 r8107 71 71 String name = null; 72 72 String description = null; 73 boolean isDisabled = false; 73 74 74 75 // Load recently used items … … 105 106 name = "Copy of " + originalConfiguration.getName(); 106 107 description = originalConfiguration.getDescription(); 108 isDisabled = originalConfiguration.isDisabled(); 107 109 try 108 110 { … … 122 124 name = configuration.getName(); 123 125 description = configuration.getDescription(); 126 isDisabled = configuration.isDisabled(); 124 127 try 125 128 { … … 193 196 <td></td> 194 197 </tr> 198 <tr> 199 <th>Disabled</th> 200 <td> 201 <input type="radio" name="disabled" id="disabledNo" value="0" 202 <%=!isDisabled ? "checked" : ""%>><label for="disabledNo">no</label> 203 <input type="radio" name="disabled" id="disabledYes" value="1" 204 <%=isDisabled ? "checked" : ""%>><label for="disabledYes">yes</label> 205 </td> 206 <td></td> 207 </tr> 195 208 <tr class="dynamic"> 196 209 <th>Description</th> -
trunk/www/admin/pluginconfigurations/index.jsp
r7954 r8107 174 174 configuration.setName(Values.getStringOrNull(request.getParameter("name"))); 175 175 configuration.setDescription(Values.getStringOrNull(request.getParameter("description"))); 176 configuration.setDisabled(Values.getBoolean(request.getParameter("disabled"))); 176 177 // Annotations tab 177 178 Base.updateAnnotations(dc, configuration, configuration, request); -
trunk/www/admin/pluginconfigurations/list_configurations.jsp
r7982 r8107 211 211 datatype="string" 212 212 title="Plugin definition" 213 sortable="true" 214 filterable="true" 215 exportable="true" 216 /> 217 <tbl:columndef 218 id="disabled" 219 property="disabled" 220 datatype="boolean" 221 title="Disabled" 213 222 sortable="true" 214 223 filterable="true" … … 472 481 <tbl:cell column="contexts"><%=plugin == null ? "<i>- denied -</i>" : (contexts.isEmpty() ? "<i>- none -</i>" : Values.getString(contexts, ", ", true))%></tbl:cell> 473 482 <tbl:cell column="pluginDefinition"><%=mode.hasPropertyLink() ? Base.getLinkedName(ID, plugin, plugin == null, mode.hasEditLink()): Base.getEncodedName(nameableProxy, plugin == null)%></tbl:cell> 483 <tbl:cell column="disabled"><%=item.isDisabled()%></tbl:cell> 474 484 <tbl:cell column="owner" 475 485 ><base:propertyvalue -
trunk/www/admin/pluginconfigurations/view_configuration.jsp
r7954 r8107 260 260 <th>Registered</th> 261 261 <td><%=dateFormatter.format(configuration.getEntryDate())%></td> 262 </tr> 263 <tr> 264 <th>Disabled</th> 265 <td><%=configuration.isDisabled() ? "Yes" : "No"%></td> 262 266 </tr> 263 267 <tr> -
trunk/www/common/import/index.jsp
r7954 r8107 107 107 ) 108 108 ); 109 configQuery.restrict(Restrictions.eq(Hql.property("disabled"), Expressions.parameter("isDisabled", false))); 109 110 configQuery.order(Orders.asc(Hql.property("name"))); 110 111 configQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS); -
trunk/www/common/plugin/index.jsp
r7954 r8107 180 180 ); 181 181 configQuery.restrict(Restrictions.gt(Hql.property("parameterVersion"), Expressions.integer(0))); 182 configQuery.restrict(Restrictions.eq(Hql.property("disabled"), Expressions.parameter("isDisabled", false))); 182 183 configQuery.order(Orders.asc(Hql.property("name"))); 183 184 configQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
Note: See TracChangeset
for help on using the changeset viewer.