This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
It would be useful if it was possible to plug-in some custom code which would be able to adjust/process the settings import. For more information please read issue 218976#c7 which is about renaming some folders during the import. As for the concrete issue it would be enough to extend the syntax of the imports file so you could add a rule like: config/Editors/text/x-css=>config/Editors/text/css
Created attachment 130488 [details] a patch Created a patch that introduces a new way to hook into the import process to rename some folders. It shows how the new "translate" attribute can be used. Something like: <folder name="OptionsExport"> <attr name="translate" stringvalue="config/Editors/text/x-css=>config/Editors/text/css"/> </folder> would be enough. Of course you can register more translations at once by using the "|" operator like this: <folder name="OptionsExport"> <attr name="translate" stringvalue="config/Editors/text/x-css=>config/Editors/text/css|config/Editors/text/x-css2=>config/Editors/text/css2"/> </folder> I am not sure if this is a common case though. Any first comments before I move this to api review? Thank you
Created a wiki page with more info. The patch introduces a new way to hook into the import process to rename some folders. It shows how the new "translate" attribute can be used. Please review. Thank you
The proposal looks good to me. I assume that if the source file/folder doesn't exist the process will just ignore it silently. This is required as the rename process is not bound to any particular ide version.
(In reply to comment #3) > The proposal looks good to me. I assume that if the source file/folder doesn't > exist the process will just ignore it silently. This is required as the rename > process is not bound to any particular ide version. Thank you for the comments. Currently every file in the userdir is copied or not if it matches the import/export patterns. After the patch gets integrated, if a user tries to import settings from older version into dev build or next final release the translation will happen. I am not sure if that is what you meant though.
The point was that since the translation doesn't specify what IDE version it is meant to import from then it can happen that the source file specified in the translation simply won't exist. In such case the "rule" simply need to do nothing.
(In reply to comment #5) > The point was that since the translation doesn't specify what IDE version it is > meant to import from then it can happen that the source file specified in the > translation simply won't exist. In such case the "rule" simply need to do > nothing. I think that this is how it is implemented in the CopyFiles file. Thanks
If there are no objections, I plan to integrate the change tomorrow. Thank you
Y01 No test. Y02 The new 'translate' attribute should be documented in o.n.upgrader/arch.xml
Created attachment 131303 [details] a patch Updated the patch based on comments Y01 and Y02. Planning to integrate tomorrow. Thank you
Changeset: f11aa5279062 Author: Theofanis Oikonomou <theofanis@netbeans.org> Date: 2013-02-13 12:09 Message: Issue #224370 - Support for hooking into the import process
Integrated into 'main-golden', will be available in build *201302132300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f11aa5279062 User: Theofanis Oikonomou <theofanis@netbeans.org> Log: Issue #224370 - Support for hooking into the import process