You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-user@portals.apache.org by Mehmet Baris KARAKAYA <mb...@gmail.com> on 2005/03/04 08:34:05 UTC

JSF Portlet works well!

Hi all,

I have newly downloaded JSF Portlet sample project from the URL
https://javaserverfaces.dev.java.net/servlets/ProjectDocumentView?documentID=9399&showInfo=true
and from the lib directory in this project, I copied the
jsf-portlet.jar for use in my project. Changes  can be viewed from the
configuration files like web.xml, faces config.xml and portlet.xml in
this sample project. But mainly, the change in web.xml is
portlet-class. portlet-class is generic which is obtained from
jsf-portlet.jar.

   <servlet>
        <servlet-name>NotDefteriPortlet</servlet-name>
        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
        <init-param>
            <param-name>portlet-class</param-name>
            <param-value>com.sun.faces.portlet.FacesPortlet</param-value>
        </init-param>
        <init-param>
            <param-name>portlet-guid</param-name>
            <param-value>bilisimPortal.NotDefteri</param-value>
        </init-param>
    </servlet>

Also in portlet.xml file,  the portlet class is of faces. Notice that
there is a parameter for view mode of portlet is given like below.
com.sun.faces.portlet.INIT_VIEW is set to
/altsistemPYS/portlet/sy_NotDefteri.jsp
JSF file.

<portlet>
       <portlet-name>NotDefteri</portlet-name>
       <description>Not Defteri Portleti</description>
       <display-name>Not Defteri</display-name>
       <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>	
       <init-param> 
	<description>Portlet init page</description>
               <name>com.sun.faces.portlet.INIT_VIEW</name>
			<value>/altsistemPYS/portlet/sy_NotDefteri.jsp</value>
        </init-param>
     	<supports>
        	<mime-type>text/html</mime-type>
	        <portlet-mode>VIEW</portlet-mode>
	        <portlet-mode>CONFIG</portlet-mode>
	        <portlet-mode>EDIT</portlet-mode>
	        <portlet-mode>HELP</portlet-mode>	        
        </supports>		
        <portlet-info>
        	<title>Not Defteri Portleti</title>
         	<keywords>Not Defteri</keywords>
        </portlet-info>		
</portlet>	

I have downloaded and make necessary configuration. Finally, I
achieved to run jsf in portlet. Hope, this helps you.

warm regards...

--baris

Re: JSF Portlet works well!

Posted by Ate Douma <at...@douma.nu>.

niksa_os wrote:
> Thanks!
> 
> Did you, or anyone, try this with other portal servers?
> Does it work elsewhere?
Its working in Jetspeed-2 without the need to change anything at all. Just drop
the war file in the Jetspeed-2 deploy folder and define a portlet entity in a psml
file and you are done.
We also have a MyFaces demo of the numberGuess game too.

Ate

> 
> 
>> Hi all,
>>
>> I have newly downloaded JSF Portlet sample project from the URL
>> https://javaserverfaces.dev.java.net/servlets/ProjectDocumentView?documentID=9399&showInfo=true 
>>
>> and from the lib directory in this project, I copied the
>> jsf-portlet.jar for use in my project. Changes  can be viewed from the
>> configuration files like web.xml, faces config.xml and portlet.xml in
>> this sample project. But mainly, the change in web.xml is
>> portlet-class. portlet-class is generic which is obtained from
>> jsf-portlet.jar.
>>
>>   <servlet>
>>        <servlet-name>NotDefteriPortlet</servlet-name>
>>        
>> <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
>>        <init-param>
>>            <param-name>portlet-class</param-name>
>>            <param-value>com.sun.faces.portlet.FacesPortlet</param-value>
>>        </init-param>
>>        <init-param>
>>            <param-name>portlet-guid</param-name>
>>            <param-value>bilisimPortal.NotDefteri</param-value>
>>        </init-param>
>>    </servlet>
>>
>> Also in portlet.xml file,  the portlet class is of faces. Notice that
>> there is a parameter for view mode of portlet is given like below.
>> com.sun.faces.portlet.INIT_VIEW is set to
>> /altsistemPYS/portlet/sy_NotDefteri.jsp
>> JSF file.
>>
>> <portlet>
>>       <portlet-name>NotDefteri</portlet-name>
>>       <description>Not Defteri Portleti</description>
>>       <display-name>Not Defteri</display-name>
>>       <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>
>>       <init-param>
>> <description>Portlet init page</description>
>>               <name>com.sun.faces.portlet.INIT_VIEW</name>
>> <value>/altsistemPYS/portlet/sy_NotDefteri.jsp</value>
>>        </init-param>
>>     <supports>
>>        <mime-type>text/html</mime-type>
>>         <portlet-mode>VIEW</portlet-mode>
>>         <portlet-mode>CONFIG</portlet-mode>
>>         <portlet-mode>EDIT</portlet-mode>
>>         <portlet-mode>HELP</portlet-mode>
>>        </supports>
>>        <portlet-info>
>>        <title>Not Defteri Portleti</title>
>>         <keywords>Not Defteri</keywords>
>>        </portlet-info>
>> </portlet>
>>
>> I have downloaded and make necessary configuration. Finally, I
>> achieved to run jsf in portlet. Hope, this helps you.
>>
>> warm regards...
>>
>> --baris
>>
> 
> 
> 
> 


Re: JSF Portlet works well!

Posted by niksa_os <ni...@hotmail.com>.
Thanks!

Did you, or anyone, try this with other portal servers?
Does it work elsewhere?


> Hi all,
>
> I have newly downloaded JSF Portlet sample project from the URL
> https://javaserverfaces.dev.java.net/servlets/ProjectDocumentView?documentID=9399&showInfo=true
> and from the lib directory in this project, I copied the
> jsf-portlet.jar for use in my project. Changes  can be viewed from the
> configuration files like web.xml, faces config.xml and portlet.xml in
> this sample project. But mainly, the change in web.xml is
> portlet-class. portlet-class is generic which is obtained from
> jsf-portlet.jar.
>
>   <servlet>
>        <servlet-name>NotDefteriPortlet</servlet-name>
>        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
>        <init-param>
>            <param-name>portlet-class</param-name>
>            <param-value>com.sun.faces.portlet.FacesPortlet</param-value>
>        </init-param>
>        <init-param>
>            <param-name>portlet-guid</param-name>
>            <param-value>bilisimPortal.NotDefteri</param-value>
>        </init-param>
>    </servlet>
>
> Also in portlet.xml file,  the portlet class is of faces. Notice that
> there is a parameter for view mode of portlet is given like below.
> com.sun.faces.portlet.INIT_VIEW is set to
> /altsistemPYS/portlet/sy_NotDefteri.jsp
> JSF file.
>
> <portlet>
>       <portlet-name>NotDefteri</portlet-name>
>       <description>Not Defteri Portleti</description>
>       <display-name>Not Defteri</display-name>
>       <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>
>       <init-param>
> <description>Portlet init page</description>
>               <name>com.sun.faces.portlet.INIT_VIEW</name>
> <value>/altsistemPYS/portlet/sy_NotDefteri.jsp</value>
>        </init-param>
>     <supports>
>        <mime-type>text/html</mime-type>
>         <portlet-mode>VIEW</portlet-mode>
>         <portlet-mode>CONFIG</portlet-mode>
>         <portlet-mode>EDIT</portlet-mode>
>         <portlet-mode>HELP</portlet-mode>
>        </supports>
>        <portlet-info>
>        <title>Not Defteri Portleti</title>
>         <keywords>Not Defteri</keywords>
>        </portlet-info>
> </portlet>
>
> I have downloaded and make necessary configuration. Finally, I
> achieved to run jsf in portlet. Hope, this helps you.
>
> warm regards...
>
> --baris
>