You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Bhaskar K <bh...@yahoo.com> on 2005/09/08 17:13:22 UTC

new to jetspeed

Hi All,
 
I'm new to Jetspeed, I was able to download the Jetspeed-2 & view the samples provided by jetspeed. But having problem in writting my own sample, as per the instructions in jetspeed -> getting started document it suggests we should use maven... but that did not work for me as I got some error while deploying the same application that was created.
 
I would like to know if we have any instructions that explains how to create a new portlets without using the maven plug-in that explains all the steps?
 
Thanks in advance.
Bhaskar

		
---------------------------------
How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos. Get Yahoo! Photos

Re: Removing a Portlet Application - JS1.6 with Fusion

Posted by David Sean Taylor <da...@bluesunrise.com>.
Travis Ward wrote:
> Questions about JSR-168 portlets - running
> Jetspeed-1.6 with Fusion.
> 
> Question 1: How are you suppose to remove a deployed
> portlet application?
> 
> First I drop a JSR-168 application like demo.war into
> /WEB-INF/deploy and the application is deployed
> successfully.
> 
> Now I want to remove this deployed JSR-168 application
> - what is the proper way of doing this?
> 
> The JS2 notes state that I should be able to just
> delete the deployed demo.jar and that a listener will
> detech the change and undeploy the app - this does not
> seem to be the case for JS1.6??
> 
> I've also tried deploying the Portlet Application
> Lifecycle Manager (PALM), which is the JSR-168
> application in JS2 for stoping, starting, undeploying
> and deleting applications.  When I undeploy/delete the
> application through this portlet the
> PersistenceBrokerPortletRegistry is called which
> updates the database with the changes, but does not
> update the PSML fragments.  The local-portlets.xreg
> still contain entries for the deleted portlet
> application.
> 
The FusionPAM has a method to cleanup its ref integrity from portlet to 
entities:

     private void removePSML(String name)

This used to be hooked into the old PAM lifecycle, but some refactoring 
of J2 obsoleted its entry point. Maybe you should add it as admin 
utility: clean up orphaned PSML entries.

So its sort of incomplete right now, sorry

> Looks like the FusionPAM class is has methods to take
> care of this and it is just not being called?

yup

> 
> Question 2: All deployed JSR-168 portlets seem to pick
> up the categorization from its parent PSML fragment. 
> I am aware that you can use the administrative portlet
> to modify these categories after deployment, but is
> there any other way to configure what category these
> portlets should be deployed with?
Yes, two choices:

1) edit the fusion.xreg, add more categories:

     <portlet-entry name="JSR168Portlet" hidden="true" type="abstract" 
application="false">
         <meta-info>
             <title>JSR168 Portlet</title>
             <description>JSR168 portlet</description>
         </meta-info>
 
<classname>org.apache.jetspeed.fusion.portal.portlets.JetspeedFusionPortlet</classname>
         <category group="Jetspeed">JSR168</category>
         <category>Portlet API</category>
         <media-type ref="html"/>
         <media-type ref="wml"/>
     </portlet-entry>


use another parent portlet configured in the FusionPAM.properties:

fusion.jsr168.parent = JSR168Portlet

> 
> Question 3: How best to provide a default security
> role to JSR-168 portlets?  I realize that I can use
> the adminstrative portlet to update the security role
> for each deployed portlet, but is there any other way
> to provide a default security role for JSR-168
> deployed portlets?
> 
Well, could try adding a security constraint to the portlet-entry above, 
but it appears I didn't complete the cloning.

Best to complete this bit of code and send patch:
         //TODO:  figure out security

Regards,

-- 
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194

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


Re: Dynamic Images and HttpServletRequest [J2]

Posted by David Sean Taylor <da...@bluesunrise.com>.
Frank Villarreal wrote:
> Hello all.
> 
> Couple of questions.
> 
> Q#1: I've been browsing the mail archives to no avail and finding I'm not
> alone in the need to serve up dynamic images through the portal ... which
> happens to be a two-request process (1-generate image and html, 2-pull the
> image down).  Also haven't seen any concrete way to accomplish it.  So, can
> someone please tell me how to reference the raw HttpServletRequest object
> from within a doRender response of a portlet?  I have a servlet that
> generates an image file and I'd like to "write" that file to some directory
> in my portlet directory and then create a link to it from an <img> tag in my
> view page.  The HttpServletRequest object supports the "getRealPath" method
> which can tell me where to output my image file to ... but first I need to
> get a handle on the underlying Request.  Help please!

Well the 2 phase sounds like a job for action/render phases of portlet 
api. But beware, you can't dispatch to servlets during the action 
(first) phase. So you may want to move your logic to generate the image 
into your portlet's action and out of the servlet. Then in the second 
phase, you can use something as simple as the FilePortlet (a servlet 
portlet) to display the image relative to your context.

As for "reference the raw HttpServletRequest object", just dispatch to 
it from your portlet.
Something like:

String path = "/raisons.jsp?orderno=5";
PortletRequestDispatcher rd = context.getRequestDispatcher(path);
rd.include(renderRequest, renderResponse);


> 
> Q#2: Apparently, the mail archive at marcaimsgroup is no longer archiving
> recent Jetspeed emails.  Does anyone know of a current and searchable
> archive for the jetspeed-user and jetspeed-dev mailing lists?
> 
We have mail archives at Apache

http://mail-archives.apache.org/mod_mbox/

-- 
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194

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


Dynamic Images and HttpServletRequest [J2]

Posted by Frank Villarreal <f_...@tetco.com>.
Hello all.

Couple of questions.

Q#1: I've been browsing the mail archives to no avail and finding I'm not
alone in the need to serve up dynamic images through the portal ... which
happens to be a two-request process (1-generate image and html, 2-pull the
image down).  Also haven't seen any concrete way to accomplish it.  So, can
someone please tell me how to reference the raw HttpServletRequest object
from within a doRender response of a portlet?  I have a servlet that
generates an image file and I'd like to "write" that file to some directory
in my portlet directory and then create a link to it from an <img> tag in my
view page.  The HttpServletRequest object supports the "getRealPath" method
which can tell me where to output my image file to ... but first I need to
get a handle on the underlying Request.  Help please!

Q#2: Apparently, the mail archive at marcaimsgroup is no longer archiving
recent Jetspeed emails.  Does anyone know of a current and searchable
archive for the jetspeed-user and jetspeed-dev mailing lists?

- Frank


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


Removing a Portlet Application - JS1.6 with Fusion

Posted by Travis Ward <tr...@yahoo.com>.
Questions about JSR-168 portlets - running
Jetspeed-1.6 with Fusion.

Question 1: How are you suppose to remove a deployed
portlet application?

First I drop a JSR-168 application like demo.war into
/WEB-INF/deploy and the application is deployed
successfully.

Now I want to remove this deployed JSR-168 application
- what is the proper way of doing this?

The JS2 notes state that I should be able to just
delete the deployed demo.jar and that a listener will
detech the change and undeploy the app - this does not
seem to be the case for JS1.6??

I've also tried deploying the Portlet Application
Lifecycle Manager (PALM), which is the JSR-168
application in JS2 for stoping, starting, undeploying
and deleting applications.  When I undeploy/delete the
application through this portlet the
PersistenceBrokerPortletRegistry is called which
updates the database with the changes, but does not
update the PSML fragments.  The local-portlets.xreg
still contain entries for the deleted portlet
application.

Looks like the FusionPAM class is has methods to take
care of this and it is just not being called?

Question 2: All deployed JSR-168 portlets seem to pick
up the categorization from its parent PSML fragment. 
I am aware that you can use the administrative portlet
to modify these categories after deployment, but is
there any other way to configure what category these
portlets should be deployed with?

Question 3: How best to provide a default security
role to JSR-168 portlets?  I realize that I can use
the adminstrative portlet to update the security role
for each deployed portlet, but is there any other way
to provide a default security role for JSR-168
deployed portlets?

Any help would be greatly appreciated!

Travis


	
		
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/

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


Re: new to jetspeed

Posted by Stefano Bianchi <st...@softeco.it>.
Sorry, I hope not to be misleading...
I usually include portlets using admin tools rather than modifing directly 
psml.
Furthemore (this is ok for J1.6), you should define your portlet in a xreg 
file (the portlet definition).
But maybe you are using J2 and everything is different, if so, sorry.
Cheers
Stefano


----- Original Message ----- 
From: "Bhaskar K" <bh...@yahoo.com>
To: "Jetspeed Users List" <je...@portals.apache.org>; 
<je...@jakarta.apache.org>
Sent: Friday, September 09, 2005 1:38 PM
Subject: Re: new to jetspeed


> Aaron,
>
> Thanks for your suggestions!
>
> I still have some issues in maven plugin to create a new portlet, hence 
> tried to create a new portlet by hand & followed below steps -
>
> 1. defined a new class HelloWorld as below -
>
> public class HelloWorld extends GenericPortlet
> {
> public void doView(RenderRequest request,RenderResponse response)
>     throws PortletException,IOException
>    {
>  response.setContentType(request.getResponseContentType());
>  PrintWriter writer = response.getWriter();
>  writer.write("Hello World!");
>    }
> }
>
> 2. defined the portlet in portlet.xml -
> <portlet-app id="myorg" 
> xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" 
> version="1.0">
>   <portlet id="HelloWorld">
>      <portlet-name>HelloWorld</portlet-name>
>      <portlet-class>com.myorg.portlet.HelloWorld</portlet-class>
>      <expiration-cache>0</expiration-cache>
>      <supports>
>         <mime-type>text/html</mime-type>
>         <portlet-mode>VIEW</portlet-mode>
>      </supports>
>      <supported-locale>en</supported-locale>
>      <portlet-info>
>         <title>HelloWorld</title>
>         <keywords>Hello, world, test</keywords>
>      </portlet-info>
>      <portlet-preferences>
>         <preference>
>            <name>displaytext</name>
>            <value>Hello, from your preferences</value>
>         </preference>
>      </portlet-preferences>
>   </portlet>
> </portlet-app>
>
> 3. placed all the required jetspeed jar files in my WEB-INF/lib directory
>
> 4. did a build to create myorg.war file and copied the same to 
> $TOMCAT_HOME/webapps folder
>
> 5. modified the default-page.psml file in jetspeed folder to as below -
>    <fragment id="dp-6" type="portlet" name="myorg::HelloWorld">
>      <property layout="TwoColumns" name="row" value="3" />
>      <property layout="TwoColumns" name="column" value="1" />
>    </fragment>
>
> 6. Tomcat starts up properly & myorg.war is deployed message appears, but 
> I do not see the message "JetspeedContainerServlet: starting 
> initialization of Portlet Application at: myorg" -- as it appears for the 
> other portlets installed ---- not sure what I'm missing here to make 
> tomcat to initialise my portlet
>
> 7. I think because of the above error, I get following error on my 
> webpage -
> Failed to retrieve Portlet Definition for 
> myorg::HelloWorldorg.apache.jetspeed.container.window.FailedToRetrievePortletWindow: 
> No PortletEntity exists for for id dp-6 removing window from cache.Failed 
> to retrieve Portlet Definition for myorg::HelloWorld
>
> Questions/Doubts I have are:
> 1. Is it required to register/have the new portlets developed in the 
> database?
> 2. What is the role of database in jetspeed application?
> 3. What is the configuration or files that I'm missing in my above new 
> portlet to deploy successfully?
>
> Thanks for your help in advance...
> Bhaskar
>
> Aaron Evans <aa...@yahoo.ca> wrote:
> Bhaskar K yahoo.com> writes:
>
>
>> I would like to know if we have any instructions that explains how to 
>> create a
> new portlets without using the
>> maven plug-in that explains all the steps?
>>
>
> Bhaskar,
> the easiest way to deploy new portlets is to get jetspeed up and running 
> and
> then drop the war file for your custom portlet in jetspeed's
> WEB-INF/deploy directory and it will take care of the rest after a few
> seconds.
>
> To view it, then just modify the psml of one of the pages (eg.
> WEB-INF/pages/default-page.psml) adding a reference to your portal.
>
> You can operate on the live version of jetspeed, or you can modify it 
> between
> the j2:portal.genapp and the war:install steps. Typically, I keep my
> jetspeed customizations in a separate directory of my project, run
> maven j2:portal.genapp to generate a portal and then use ant to apply my
> customizations to it.
>
> Then I just call
> maven war:install
> and
> maven j2:quickStart
>
> For subsequent changes, I edit my customizations run my ant build and then
> just do the war:install and j2:quickStart steps.
>
> Hope this helps.
>
> aaron
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
> ---------------------------------
> Yahoo! Messenger  NEW - crystal clear PC to PC calling worldwide with 
> voicemail 




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


Re: new to jetspeed

Posted by Bhaskar K <bh...@yahoo.com>.
Aaron, 
 
Thanks for your suggestions!
 
I still have some issues in maven plugin to create a new portlet, hence tried to create a new portlet by hand & followed below steps -
 
1. defined a new class HelloWorld as below -
 
public class HelloWorld extends GenericPortlet 
{
 public void doView(RenderRequest request,RenderResponse response) 
     throws PortletException,IOException 
    {
  response.setContentType(request.getResponseContentType()); 
  PrintWriter writer = response.getWriter(); 
  writer.write("Hello World!");
    }
}

2. defined the portlet in portlet.xml -
<portlet-app id="myorg" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0"> 
   <portlet id="HelloWorld"> 
      <portlet-name>HelloWorld</portlet-name> 
      <portlet-class>com.myorg.portlet.HelloWorld</portlet-class> 
      <expiration-cache>0</expiration-cache> 
      <supports> 
         <mime-type>text/html</mime-type> 
         <portlet-mode>VIEW</portlet-mode> 
      </supports> 
      <supported-locale>en</supported-locale>
      <portlet-info> 
         <title>HelloWorld</title> 
         <keywords>Hello, world, test</keywords>
      </portlet-info>
      <portlet-preferences>
         <preference>
            <name>displaytext</name>
            <value>Hello, from your preferences</value>
         </preference>
      </portlet-preferences>
   </portlet>
</portlet-app>
 
3. placed all the required jetspeed jar files in my WEB-INF/lib directory
 
4. did a build to create myorg.war file and copied the same to $TOMCAT_HOME/webapps folder
 
5. modified the default-page.psml file in jetspeed folder to as below -
    <fragment id="dp-6" type="portlet" name="myorg::HelloWorld">
      <property layout="TwoColumns" name="row" value="3" />
      <property layout="TwoColumns" name="column" value="1" />
    </fragment>

6. Tomcat starts up properly & myorg.war is deployed message appears, but I do not see the message "JetspeedContainerServlet: starting initialization of Portlet Application at: myorg" -- as it appears for the other portlets installed ---- not sure what I'm missing here to make tomcat to initialise my portlet
 
7. I think because of the above error, I get following error on my webpage -
Failed to retrieve Portlet Definition for myorg::HelloWorldorg.apache.jetspeed.container.window.FailedToRetrievePortletWindow: No PortletEntity exists for for id dp-6 removing window from cache.Failed to retrieve Portlet Definition for myorg::HelloWorld
 
Questions/Doubts I have are:
1. Is it required to register/have the new portlets developed in the database?
2. What is the role of database in jetspeed application? 
3. What is the configuration or files that I'm missing in my above new portlet to deploy successfully?
 
Thanks for your help in advance...
 Bhaskar

Aaron Evans <aa...@yahoo.ca> wrote:
Bhaskar K yahoo.com> writes:


> I would like to know if we have any instructions that explains how to create a
new portlets without using the
> maven plug-in that explains all the steps?
> 

Bhaskar,
the easiest way to deploy new portlets is to get jetspeed up and running and 
then drop the war file for your custom portlet in jetspeed's 
WEB-INF/deploy directory and it will take care of the rest after a few 
seconds.

To view it, then just modify the psml of one of the pages (eg.
WEB-INF/pages/default-page.psml) adding a reference to your portal.

You can operate on the live version of jetspeed, or you can modify it between
the j2:portal.genapp and the war:install steps. Typically, I keep my
jetspeed customizations in a separate directory of my project, run
maven j2:portal.genapp to generate a portal and then use ant to apply my
customizations to it.

Then I just call
maven war:install
and 
maven j2:quickStart

For subsequent changes, I edit my customizations run my ant build and then
just do the war:install and j2:quickStart steps.

Hope this helps.

aaron





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


		
---------------------------------
Yahoo! Messenger  NEW - crystal clear PC to PC calling worldwide with voicemail 

Re: new to jetspeed

Posted by Aaron Evans <aa...@yahoo.ca>.
Bhaskar K <bhas4 <at> yahoo.com> writes:


> I would like to know if we have any instructions that explains how to create a
new portlets without using the
> maven plug-in that explains all the steps?
> 

Bhaskar,
the easiest way to deploy new portlets is to get jetspeed up and running and 
then drop the war file for your custom portlet in jetspeed's 
WEB-INF/deploy directory and it will take care of the rest after a few 
seconds.

To view it, then just modify the psml of one of the pages (eg.
WEB-INF/pages/default-page.psml) adding a reference to your portal.

You can operate on the live version of jetspeed, or you can modify it between
the j2:portal.genapp and the war:install steps.  Typically, I keep my
jetspeed customizations in a separate directory of my project, run
maven j2:portal.genapp to generate a portal and then use ant to apply my
customizations to it.

Then I just call
maven war:install
and 
maven j2:quickStart

For subsequent changes, I edit my customizations run my ant build and then
just do the war:install and j2:quickStart steps.

Hope this helps.

aaron





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