Changeset 3644
- Timestamp:
- Aug 8, 2007, 2:45:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/core/net/sf/basedb/plugins/PluginConfigurationImporter.java
r3617 r3644 112 112 "The XML-file to import the configuration parameters from", 113 113 new FileParameterType(null, true, 1)); 114 114 private static final PluginParameter<Boolean> setPermissionsParameter = 115 new PluginParameter<Boolean>( 116 "setPermissions", 117 "Inherit shared permissions", 118 "Select if the new configurations should be shared to the same users, " + 119 "groups and projects as the plug-in they belong to. If FALSE, the new configurations " + 120 "will not be shared.", 121 new BooleanParameterType(true, true) 122 ); 115 123 116 124 private RequestInformation configureJob; … … 118 126 // Variables to store the job parameters in. 119 127 private File xmlFile; 128 private boolean setPermissions; 120 129 121 130 /* … … 167 176 } 168 177 storeValue(job, request, xmlFileParameter); 178 storeValue(job, request, setPermissionsParameter); 169 179 response.setDone("The job configuration is complete"); 170 180 } … … 204 214 { 205 215 xmlFile = (File)job.getValue("xmlfile"); 216 setPermissions = Boolean.TRUE.equals(job.getValue("setPermissions")); 206 217 is = xmlFile.getDownloadStream(0); 207 218 boolean importable = isImportable(is); … … 308 319 String pluginClassName = configuration.getAttributeValue("pluginClassName"); 309 320 310 311 321 PluginDefinition pluginDefinition = PluginDefinition.getByClassName(dc, pluginClassName); 312 313 PluginConfiguration pluginConfig = PluginConfiguration.getNew(dc, pluginDefinition); 314 dc.saveItem(pluginConfig); 322 PluginConfiguration pluginConfig = PluginConfiguration.getNew(dc, pluginDefinition); 323 if (setPermissions) 324 { 325 pluginConfig.setItemKey(pluginDefinition.getItemKey()); 326 pluginConfig.setProjectKey(pluginDefinition.getProjectKey()); 327 } 315 328 pluginConfig.setName(name); 316 329 pluginConfig.setDescription(description); 330 dc.saveItem(pluginConfig); 317 331 318 332 List parameters = configuration.getChildren("parameter"); … … 345 359 346 360 parameters.add(xmlFileParameter); 361 parameters.add(setPermissionsParameter); 347 362 348 363 configureJob = new RequestInformation
Note: See TracChangeset
for help on using the changeset viewer.