-
1. Re: Transfer info from a plugin to a facet
lincolnthree May 17, 2013 12:54 AM (in response to thorman)I would just add a method on the facet and pass in what you need Is that helpful at all? If not, then I'm not really sure I understand what you are asking.
-
2. Re: Transfer info from a plugin to a facet
thorman May 17, 2013 1:06 AM (in response to lincolnthree)Today I create the facet like this:
event.fire(new InstallFacets(CamelRoutePrjFacet.class));
But there isn't any way to pass along any initial data here.
but I now see that the is a project.installFacet as well, maybe this should be used instead.
Or is best practice to create it with an event and then use the project.getFacet?
I now see that there are a lot of Facet functions in the project class, so I'll try this instead
project.getFacet(CamelRoutePrjFacet.class).setPrjDescription(prjDescription);
Thanks
// Mikael
-
3. Re: Transfer info from a plugin to a facet
lincolnthree May 17, 2013 11:28 AM (in response to thorman)You could also try using a @ProjectScoped context object to hold any transfer data that you need. But there may be a bug that prevents doing that in Facets, if I recall correctly. I would use the project.installFacet() methods, as you discovered. That's probably a safe route!