You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Punit Pandey <pa...@hotmail.com> on 2003/12/17 14:03:28 UTC

Portlets Framework

Hello,
We are in the process of developing one framework for portlets. The
objective is to apply all possible patterns and also try to simplify the
development process.

The biggest challenge for developing portlet-framework, seems to us, is
unavailability of controller servlet. In most of the JSP/Servlet-frameworks
(e.g struts) the request always goes through the controller servlet. But in
case of a portal, we do not have any such control. Can anyone tell me how to
do some sort of request-preprocessing for a portlet? For example if we want
to apply some simple filter on request, which is the best place (if any) do
to this? How to install common portlet filters?

Regards,

Punit Pandey

=================================================
http://portlets.blogspot.com - Portlets blog
http://groups.yahoo.com/group/portlets/ - Portlets Discussion Group





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


Re: [portlets] Portlets Framework

Posted by Mestrallet benjamin <be...@exoplatform.com>.
Here is a small part of an incoming article :


a.. Portlet filters : filters are on the list, in the suggestions chapter, for the next version of the portlet specifications. We have implemented this feature reproducing as well as possible the servlet filter's API. The interfaces used are very similar to the servlet ones. 

Figure 7. The Portlet Filters extension


The main difference is that filters are defined per portlet. To add a filter the portlet developer must define it in the portlet.xml file. 

	      
<portlet>
  <filter>
    <filter-name>LoggerFilter</filter-name>
    <filter-class>exo.services.portletcontainer.test.filter.LoggerFilter</filter-class>
    <init-param>
      <name>default-param</name>
      <value>default-param-value</value>
    </init-param>
  </filter>
  [...]
</portlet>
	      
            
For example, it is good practise to use such filters to log access to portlets with non intrusive code. The class would look like : 

	      
public class LoggerFilter implements PortletFilter{

  public void init(PortletFilterConfig portletFilterConfig) throws PortletException {
    if(!"default-param-value".equals(portletFilterConfig.getInitParameter("default-param")))
      throw new PortletException();
  }

  public void doFilter(PortletRequest portletRequest,
	               PortletResponse portletResponse,
		       PortletFilterChain filterChain)
	throws IOException, PortletException {		
    // do something before the portlet is reached
    filterChain.doFilter(portletRequest, portletResponse) ;	
    // do something after the portlet is reached
  }

  public void destroy() {    
  }  
}           
              
            

The filter chain is created from the list of filters defined in the portlet.xml file. The implementation is here also done using an AspectJ aspect. After any aspect has been proceeded, the filter aspect launches the portlet filter in a recurisve way. 

So it really looks and smell like servlet filters but it is not.

Also you are right, we support several MVC frameworks out of the box, it is up to the developer to choose the one he wants. And we also made our custom one, which we think is the more adapted for portlets.

IBM, Sun and now eXo have a bridge to integrate existing Struts applications into portlets.

Cheers,

Benjamin Mestrallet
eXo platform® project leader
eXo platform SARL manager
  ----- Original Message ----- 
  From: Punit Pandey 
  To: portlets@yahoogroups.com ; lportal-development@lists.sourceforge.net ; exo-developers@lists.sourceforge.net ; jetspeed-dev@jakarta.apache.org 
  Sent: Wednesday, December 17, 2003 3:34 PM
  Subject: Re: [portlets] Portlets Framework


  Hello Benjamin,

  Nice to hear you after some time. 

  What I understood from you post is, eXo has in-built support for MVC framework. Am I right? Or we have to download it separately? I'll try to check that. As far as I know IBM has also succeed in using Struts with IBM portal but I haven't checked their implementation. 

  But what exactly I wanted to know is how to install request filters for JSR portlets? Any Idea? How you have done that?

  Regards,

  Punit Pandey


  =================================================
  http://portlets.blogspot.com - Portlets blog
  http://groups.yahoo.com/group/portlets/ - Portlets Discussion Group
    ----- Original Message ----- 
    From: Mestrallet benjamin 
    To: portlets@yahoogroups.com ; lportal-development@lists.sourceforge.net ; exo-developers@lists.sourceforge.net ; jetspeed-dev@jakarta.apache.org 
    Sent: Wednesday, December 17, 2003 7:20 PM
    Subject: Re: [portlets] Portlets Framework


    Hello Punit,

    We have developed a custom  portlet framework that uses a MVC paradigm where
    all portlet request go through a portlet controller.  It comes with per mode
    controllers, J2EE declarative security (not addressed in JSR 168) and full
    support of IoC type3.

    We also support Portlet filters but note that this is not a mandatory
    feature in JSR 168.

    Actually with the eXo platform you can also use several existing frameworks
    (because of bridges we developed). Therefore you can use existing Struts
    application, Java Server Faces application and Cocoon application as
    portlets.

    Benjamin Mestrallet
    eXo platform® project leader
    eXo platform SARL manager

    ----- Original Message -----
    From: "Punit Pandey" <pa...@hotmail.com>
    To: <lp...@lists.sourceforge.net>;
    <ex...@lists.sourceforge.net>; <je...@jakarta.apache.org>;
    "portlets" <po...@yahoogroups.com>
    Sent: Wednesday, December 17, 2003 2:03 PM
    Subject: [portlets] Portlets Framework


    > Hello,
    > We are in the process of developing one framework for portlets. The
    > objective is to apply all possible patterns and also try to simplify the
    > development process.
    >
    > The biggest challenge for developing portlet-framework, seems to us, is
    > unavailability of controller servlet. In most of the
    JSP/Servlet-frameworks
    > (e.g struts) the request always goes through the controller servlet. But
    in
    > case of a portal, we do not have any such control. Can anyone tell me how
    to
    > do some sort of request-preprocessing for a portlet? For example if we
    want
    > to apply some simple filter on request, which is the best place (if any)
    do
    > to this? How to install common portlet filters?
    >
    > Regards,
    >
    > Punit Pandey
    >
    > =================================================
    > http://portlets.blogspot.com - Portlets blog
    > http://groups.yahoo.com/group/portlets/ - Portlets Discussion Group
    >
    >
    >
    >
    >
    > To unsubscribe from this group, send an email to:
    > portlets-unsubscribe@yahoogroups.com
    >
    >
    >
    > Yahoo! Groups Links
    >
    > To visit your group on the web, go to:
    >  http://groups.yahoo.com/group/portlets/
    >
    > To unsubscribe from this group, send an email to:
    >  portlets-unsubscribe@yahoogroups.com
    >
    > Your use of Yahoo! Groups is subject to:
    >  http://docs.yahoo.com/info/terms/
    >
    >



    To unsubscribe from this group, send an email to:
    portlets-unsubscribe@yahoogroups.com





----------------------------------------------------------------------------
    Yahoo! Groups Links

      a.. To visit your group on the web, go to:
      http://groups.yahoo.com/group/portlets/
        
      b.. To unsubscribe from this group, send an email to:
      portlets-unsubscribe@yahoogroups.com
        
      c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 




  To unsubscribe from this group, send an email to:
  portlets-unsubscribe@yahoogroups.com




        Yahoo! Groups Sponsor 
              ADVERTISEMENT
             
       
       


------------------------------------------------------------------------------
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/portlets/
      
    b.. To unsubscribe from this group, send an email to:
    portlets-unsubscribe@yahoogroups.com
      
    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



Re: [portlets] Portlets Framework

Posted by Punit Pandey <pa...@hotmail.com>.
Hello Benjamin,

Nice to hear you after some time. 

What I understood from you post is, eXo has in-built support for MVC framework. Am I right? Or we have to download it separately? I'll try to check that. As far as I know IBM has also succeed in using Struts with IBM portal but I haven't checked their implementation. 

But what exactly I wanted to know is how to install request filters for JSR portlets? Any Idea? How you have done that?

Regards,

Punit Pandey


=================================================
http://portlets.blogspot.com - Portlets blog
http://groups.yahoo.com/group/portlets/ - Portlets Discussion Group
  ----- Original Message ----- 
  From: Mestrallet benjamin 
  To: portlets@yahoogroups.com ; lportal-development@lists.sourceforge.net ; exo-developers@lists.sourceforge.net ; jetspeed-dev@jakarta.apache.org 
  Sent: Wednesday, December 17, 2003 7:20 PM
  Subject: Re: [portlets] Portlets Framework


  Hello Punit,

  We have developed a custom  portlet framework that uses a MVC paradigm where
  all portlet request go through a portlet controller.  It comes with per mode
  controllers, J2EE declarative security (not addressed in JSR 168) and full
  support of IoC type3.

  We also support Portlet filters but note that this is not a mandatory
  feature in JSR 168.

  Actually with the eXo platform you can also use several existing frameworks
  (because of bridges we developed). Therefore you can use existing Struts
  application, Java Server Faces application and Cocoon application as
  portlets.

  Benjamin Mestrallet
  eXo platform® project leader
  eXo platform SARL manager

  ----- Original Message -----
  From: "Punit Pandey" <pa...@hotmail.com>
  To: <lp...@lists.sourceforge.net>;
  <ex...@lists.sourceforge.net>; <je...@jakarta.apache.org>;
  "portlets" <po...@yahoogroups.com>
  Sent: Wednesday, December 17, 2003 2:03 PM
  Subject: [portlets] Portlets Framework


  > Hello,
  > We are in the process of developing one framework for portlets. The
  > objective is to apply all possible patterns and also try to simplify the
  > development process.
  >
  > The biggest challenge for developing portlet-framework, seems to us, is
  > unavailability of controller servlet. In most of the
  JSP/Servlet-frameworks
  > (e.g struts) the request always goes through the controller servlet. But
  in
  > case of a portal, we do not have any such control. Can anyone tell me how
  to
  > do some sort of request-preprocessing for a portlet? For example if we
  want
  > to apply some simple filter on request, which is the best place (if any)
  do
  > to this? How to install common portlet filters?
  >
  > Regards,
  >
  > Punit Pandey
  >
  > =================================================
  > http://portlets.blogspot.com - Portlets blog
  > http://groups.yahoo.com/group/portlets/ - Portlets Discussion Group
  >
  >
  >
  >
  >
  > To unsubscribe from this group, send an email to:
  > portlets-unsubscribe@yahoogroups.com
  >
  >
  >
  > Yahoo! Groups Links
  >
  > To visit your group on the web, go to:
  >  http://groups.yahoo.com/group/portlets/
  >
  > To unsubscribe from this group, send an email to:
  >  portlets-unsubscribe@yahoogroups.com
  >
  > Your use of Yahoo! Groups is subject to:
  >  http://docs.yahoo.com/info/terms/
  >
  >



  To unsubscribe from this group, send an email to:
  portlets-unsubscribe@yahoogroups.com





------------------------------------------------------------------------------
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/portlets/
      
    b.. To unsubscribe from this group, send an email to:
    portlets-unsubscribe@yahoogroups.com
      
    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



Re: [portlets] Portlets Framework

Posted by Mestrallet benjamin <be...@exoplatform.com>.
Hello Punit,

We have developed a custom  portlet framework that uses a MVC paradigm where
all portlet request go through a portlet controller.  It comes with per mode
controllers, J2EE declarative security (not addressed in JSR 168) and full
support of IoC type3.

We also support Portlet filters but note that this is not a mandatory
feature in JSR 168.

Actually with the eXo platform you can also use several existing frameworks
(because of bridges we developed). Therefore you can use existing Struts
application, Java Server Faces application and Cocoon application as
portlets.

Benjamin Mestrallet
eXo platform® project leader
eXo platform SARL manager

----- Original Message -----
From: "Punit Pandey" <pa...@hotmail.com>
To: <lp...@lists.sourceforge.net>;
<ex...@lists.sourceforge.net>; <je...@jakarta.apache.org>;
"portlets" <po...@yahoogroups.com>
Sent: Wednesday, December 17, 2003 2:03 PM
Subject: [portlets] Portlets Framework


> Hello,
> We are in the process of developing one framework for portlets. The
> objective is to apply all possible patterns and also try to simplify the
> development process.
>
> The biggest challenge for developing portlet-framework, seems to us, is
> unavailability of controller servlet. In most of the
JSP/Servlet-frameworks
> (e.g struts) the request always goes through the controller servlet. But
in
> case of a portal, we do not have any such control. Can anyone tell me how
to
> do some sort of request-preprocessing for a portlet? For example if we
want
> to apply some simple filter on request, which is the best place (if any)
do
> to this? How to install common portlet filters?
>
> Regards,
>
> Punit Pandey
>
> =================================================
> http://portlets.blogspot.com - Portlets blog
> http://groups.yahoo.com/group/portlets/ - Portlets Discussion Group
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> portlets-unsubscribe@yahoogroups.com
>
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
>  http://groups.yahoo.com/group/portlets/
>
> To unsubscribe from this group, send an email to:
>  portlets-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
>  http://docs.yahoo.com/info/terms/
>
>


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