portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marek Nowak" <mareknow_...@op.pl>
Subject Re: jetspeed API
Date Wed, 26 Jan 2005 14:31:31 GMT
Thank you. Do you have any piece of code of application that communicates 
with any portlet? For example using "PortletEntityAccessComponent"?

Marek


----- Original Message ----- 
From: "David Sean Taylor" <david@bluesunrise.com>
To: "Jetspeed Developers List" <jetspeed-dev@jakarta.apache.org>
Sent: Wednesday, January 26, 2005 1:04 PM
Subject: Re: jetspeed API


> 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
>
> Yes.
> 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:
>
> jetspeed-spring.xml:
>   <!-- Portlet Services  -->
>   <bean id="PortalServices"
>      class="org.apache.jetspeed.services.JetspeedPortletServices" >
>      <constructor-arg>
>      <map>
>        <entry key="PortletRegistryComponent">
>        <ref 
> bean="org.apache.jetspeed.components.portletregistry.PortletRegistry" />
>        </entry>
>        <entry key="SearchComponent">
>        <ref bean="org.apache.jetspeed.search.SearchEngine"/>
>        </entry>
>        <entry key="PAM">
>        <ref bean="PAM" />
>        </entry> <entry key="UserManager">
>          <ref bean="org.apache.jetspeed.security.UserManager"/>
>        </entry>
>        <entry key="PageManager">
>          <ref bean="org.apache.jetspeed.page.PageManager"/>
>        </entry>
>        <entry key="RoleManager">
>          <ref bean="org.apache.jetspeed.security.RoleManager"/>
>        </entry>
>        <entry key="GroupManager">
>          <ref bean="org.apache.jetspeed.security.GroupManager"/>
>        </entry>  <entry key="Profiler">
>        <ref bean="org.apache.jetspeed.profiler.Profiler"/>
>        </entry>   <entry key="SSO">
>        <ref bean="org.apache.jetspeed.sso.SSOProvider"/>
>        </entry>   <entry key="EntityAccessor">
>        <ref 
> bean='org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent'/>
>        </entry>
>      </map>
>      </constructor-arg>
>   </bean>
>
> example jetspeed-portlet.xml:
>
>   <js:services>
>     <js:service name='UserManager'/>
>     <js:service name='RoleManager'/>
>     <js:service name='GroupManager'/>
>     <js:service name="Profiler" />
>     <js:service name="SSO" />
>   </js:services>
>
> init() of portlet:
>
>     public void init(PortletConfig config)
>     throws PortletException
>     {
>         super.init(config);
>         userManager = 
> (UserManager)getPortletContext().getAttribute(SecurityResources.CPS_USER_MANAGER_COMPONENT);
>         if (null == userManager)
>         {
>             throw new PortletException("Failed to find the User Manager on 
> portlet initialization");
>         }
>         roleManager = 
> (RoleManager)getPortletContext().getAttribute(SecurityResources.CPS_ROLE_MANAGER_COMPONENT);
>         if (null == roleManager)
>         {
>             throw new PortletException("Failed to find the Role Manager on 
> portlet initialization");
>         }
>         groupManager = 
> (GroupManager)getPortletContext().getAttribute(SecurityResources.CPS_GROUP_MANAGER_COMPONENT);
>         if (null == groupManager)
>         {
>             throw new PortletException("Failed to find the Group Manager 
> on portlet initialization");
>         }
>         profiler = 
> (Profiler)getPortletContext().getAttribute(SecurityResources.CPS_PROFILER_COMPONENT);
>         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
> 



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


Mime
View raw message