Joachim Müller <joachim <at> wemove.com> writes: > > Hi Frank, > > Thanks for your reply. This sounds quite complicated to me. There must > be an easier way. The Jetspeed Admin application uses quite some > PortalServices. I suspect that the following steps will be required > (please comment): > > 1.) Define the API of the service in a separate project and put it into > maven repo (for compiplation) and the tomcat/shared/lib (similar to the > jetspeed-api). Thus I can refernce the Service in every application this > api will be included. > > 2.) Define my service in the portlat.genapp portal container using the > 'normal' spring config approach. > > Question: > > How can I add a component to the PortalServices (normally defined in > jetspeed-services.xml) without copy and modify the jetspeed-services.xml > from the jetspeed distribution. > > 3.) Define the service in the jetspeed-portlet.xml of the application. > > 4.) Reference the service like this: > > service = (MyService)context.getAttribute(<name of service component>); > > Do I have any errors in reasoning? > > Thanks for any comment. > > Joachim
As Frank points out, I think the main challenge is with the class loader. Normally, if you instantiate an object within a servlet/portlet application, it is not available to other servlet/portlet applications because they use different class loaders. What Frank is suggesting is to use a facility provided in tomcat where you can configure objects that are instantiated and can be used globally, accross applications. I agree that this seems a little too complicated. I have not looked into it too much, but somehow the j2-admin application is using services that are configured within the main jetspeed application, so I would take a look at the source in that application to figure out how they have done it. I have been thinking about this problem myself lately as I would like to be able to get a handle to the jetpseed User Management components from within my custom portlet application. So if you find the solution, please post. aaron --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]