portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sean Taylor <da...@bluesunrise.com>
Subject Re: jetspeed API
Date Wed, 26 Jan 2005 12:04:12 GMT
Marek Nowak wrote:
> Hello
> Can anybody please tell if application that is deployed at the same server as JS2 is,
can ccommunicate with Jetspeed2? I mean, I want my web applicaion to manage some of the portlets
- create new portlet instances, manage their properties, etc.
> Marek

Examples of this in the PAM and Security portlet applications.
Basically you do this by exposing Jetspeed components in Spring, 
declaring requested services in the jetspeed-portlet.xml, and then 
getting the service in the portlet init:

   <!-- Portlet Services  -->
   <bean id="PortalServices"
   	   class="org.apache.jetspeed.services.JetspeedPortletServices" >
   	   	  <entry key="PortletRegistryComponent">
bean="org.apache.jetspeed.components.portletregistry.PortletRegistry" />
   	   	  <entry key="SearchComponent">
   	   	  	<ref bean="org.apache.jetspeed.search.SearchEngine"/>
   	   	  <entry key="PAM">
   	   	  	<ref bean="PAM" />
   	   	  <entry key="UserManager">
   	   	    <ref bean="org.apache.jetspeed.security.UserManager"/>
   	   	  <entry key="PageManager">
   	   	    <ref bean="org.apache.jetspeed.page.PageManager"/>
   	   	  <entry key="RoleManager">
   	   	    <ref bean="org.apache.jetspeed.security.RoleManager"/>
   	   	  <entry key="GroupManager">
   	   	    <ref bean="org.apache.jetspeed.security.GroupManager"/>
   	   	  <entry key="Profiler">
   	   	  	<ref bean="org.apache.jetspeed.profiler.Profiler"/>
   	   	  <entry key="SSO">
   	   	  	<ref bean="org.apache.jetspeed.sso.SSOProvider"/>
   	   	  <entry key="EntityAccessor">

example jetspeed-portlet.xml:

     <js:service name='UserManager'/>
     <js:service name='RoleManager'/>
     <js:service name='GroupManager'/>
     <js:service name="Profiler" />
     <js:service name="SSO" />

init() of portlet:

     public void init(PortletConfig config)
     throws PortletException
         userManager = 
         if (null == userManager)
             throw new PortletException("Failed to find the User Manager 
on portlet initialization");
         roleManager = 
         if (null == roleManager)
             throw new PortletException("Failed to find the Role Manager 
on portlet initialization");
         groupManager = 
         if (null == groupManager)
             throw new PortletException("Failed to find the Group 
Manager on portlet initialization");
         profiler = 
         if (null == profiler)
             throw new PortletException("Failed to find the Profiler on 
portlet initialization");

To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org

View raw message