Ticket #199 (closed enhancement: fixed)
Better usability for forced exports
| Reported by: | stephan | Owned by: | stephan |
|---|---|---|---|
| Priority: | major | Milestone: | OTDT_1.2.6 |
| Component: | otequinox | Version: | 1.2.5 |
| Keywords: | Cc: | Ruwen.Schwedewsky@… |
Description
Discussing the alternatives in #198 it appears that a more fundamental solution is desirable:
Files: Granting forced exports should happen through files in the workspace, not through the config.ini of the eclipse installation, specifically, some file(s) in ${workspace_loc}/.metadata/.plugins/org.objectteams.otequinox/
Confirmation: Should during launch some requested forced exports not be granted via the above file(s), permission may be asked from the user. For this purpose org.objectteams.otequinox should provide an extension point. An extension to this point will receive the forced exports request from the aspect plugin and should answer whether this request is granted. If neither file(s) nor extension confirm a forced exports request, an exception will prevent loading of the aspect bundle.
The above is the consensus between a proposal by ruwen and my current thinking, follow some open questions:
File(s)
File format:
- [ruwen]: use an xml file for the content and an .ini to refer to the .xml, example xml:
<forcedExports> <plugin name="de.nordakademie.." version="0.1"> <targetplugin name="org.eclipse.."> <package>org.eclipse..</package> <package>org.eclipse..</package> <package>org.eclipse..</package> </targetplugin> </plugin> <plugin name="de.nordakademie.." version="0.2"> <targetplugin name="org.eclipse.."> <package>org.eclipse..</package> <package>org.eclipse..</package> <package>org.eclipse..</package> </targetplugin> </plugin> </forcedExports> - [stephan]: use only one non-xml file, syntax in the vein of MANIFEST.MF, e.g.:
org.eclipse.jdt.core [ org.eclipse.jdt.internal.compiler.ast;x-friends:="de.nordakademie.aspectPlugin1", org.eclipse.jdt.internal.compiler.lookup;x-friends:="de.nordakademie.aspectPlugin1,fr.ordinateurs.octetsPlugin", ] de.nordakademie.aspectPlugin1 [ de.nordakademie.associations;x-friends:="org.objectteams.SuperPlug" ]
Actually, this is the current syntax (config.ini) plus allowing line breaks.
- Implications:
- File format can be optimized for tool-processing (XML) or readability by seasoned eclipse developers (plain text).
- Content can be ordered by aspect plugin (a) or by base plugin and package (b). (a) is closer to the forced export request, (b) is closer to what is affected.
- Fine print:
- Yes, it should always be possible to specify versions of all involved bundles.
Indirection: The actual file can be contained in the preferences directory or a .ini file can contain a link to a file referenced either locally or via arbitrary URL.
I prefer to have this information "manifest" in the workspace. Should fetching the content from some URL be desired, this could be the job of an extension while being asked for confirmation.
Through this file the user confirms the given requests. Pointing to a third-party location would say, I trust whatever they say. This would require some cryptographic protocal, which is not likely to be the job of the otequinox core. By contrast, a neutral extender plugin could inform the user:
"The request from plugin A conforms to what is posted on the trusted web-site AA (certificates have been checked). Do you accept?"
Confirmation
Howto handle multiple extensions to the new extension point?
One way would be to say that at most one extension is allowed per this point.
Otherwise, combination of several answers must be defined. I propose the common three-value logic for permissions: DENY, ALLOW, UNKNOWN:
- a single DENY suffices to prohibit loading of the requesting aspect plugin.
- a single ALLOW and no DENY suffices to allow loading of the requesting plugin.
- only UNKNOWN prohibits loading of the requesting aspect plugin (i.e., default is DENY).
config.ini
I currently think that the old way (config.ini) per eclipse installation plus its slight improvement from #198 should be kept so that granting forced exports can happen system wide (config.ini) or per user (workspace preferences).
Action upon denial
Not accepting a forced export could be "punished" at two levels:
- don't activate teams from the requesting plugin
- completely refuse to load the requesting plugin.
(Note, that a forced export can be utilized even without any team being activated by the framework).
Further wishes
- Yes, managing files (locations and content) through a preference page is desirable.
- The same extension point can in the future also ask for permission for regular aspect bindings w/o forced exports. This should then be configurable "Always allow", "always deny, "ask".
all news
RSS feed