RE: Shoutbox Portlet Action doesn't work

2004-06-22 Thread Floßmann Christoph
Now I tried to reduce my code to a minimum.
Maybe someone tries it and tells me what's wrong.

=
Entry in portlets.xreg
=


Action
Simple Test





=
The java source (be sure to put it in src/java/de/volke/jetspeed/modules/actions
=
package de.volke.jetspeed.modules.actions;

import org.apache.jetspeed.modules.actions.portlets.JspPortletAction;
import org.apache.jetspeed.portal.Portlet;
import org.apache.turbine.util.RunData;

public class ActionTest  extends JspPortletAction {

protected void buildNormalContext(Portlet portlet, RunData rundata) throws 
Exception {
  System.out.println("Built ActionTest Portlet!");
}

public void doSomething(){
  System.out.println("Action");
}
}
=
The jsp page in WEB-INF/templates/jsp/portlets/html
=
<%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld' prefix='jetspeed' %>


<%
String jspeid = (String) request.getAttribute("js_peid");
%>







=
Now the message in the buildNormalContext method is displayed in the tomcat shell. But 
the doSomething method isn't working.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Shoutbox Portlet Action doesn't work

2004-06-21 Thread Stijn de Witt
- Original Message - 
From: "Floßmann Christoph" <[EMAIL PROTECTED]>
To: "Jetspeed Users List" <[EMAIL PROTECTED]>
Sent: Monday, June 21, 2004 4:09 PM
Subject: RE: Shoutbox Portlet Action doesn't work


> Yes I can add my portlet with the costumizer. And finds the class.
Otherwise where should the results of my query come form (I created some
shoutings in the database which are displayed in the portlet)

Ok

>
> This is what I get from the logging after pushing the submit button but I
don't know what I can do now:
>
> =
>
> 2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCPortlet -
GenericMVCPortlet: Executing action [portlets.ShoutBox] for portlet
[Shoutbox]

Ok, this line clearly indicates that your portlet is succesfully found.

> 2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCAction -
Action: try executing events

GenericMVCAction is now executing it's perform() method. It is looking for
all parameters that were send with the request to find one that starts with
'eventSubmit_'. If it finds one, it takes the piece of the name after the
underscore, does some conversion on it and then uses that as the name of the
method to call. If your function is called doSubmit, you should have a
parameter in the quest named 'eventSubmit_doSubmit' with as value the
caption of your button...

> 2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCAction -
Action: calling doPerform

This indicates that GenericMVCAction could not find a parameter with the
correct name, or that calling the method failed for some reason.
Are you building jetspeed from the source? In that case, I would advise you
to put some logging in GenericMVCAction, to find out just what happens
between the 'try executing events' and the 'calling doPerform'. My bet is
that it is something really little, and you'll be saying 'was that all?!!'.
I have had that A LOT with Jetspeed.

Hope it helps, and let me know if it did!  :)
-Stijn

> 2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCAction -
GenericMVCAction: retrieved context:
[EMAIL PROTECTED]
> 2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCAction -
GenericMVCAction: retrieved portlet:
[EMAIL PROTECTED]
> 2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCAction -
GenericMVCAction: building normal
> 2004-06-21 16:04:55,444 [http8080-Processor25] INFO  GenericMVCPortlet -
GenericMVCPortlet - calling processView on processor
> 2004-06-21 16:04:55,444 [http8080-Processor25] INFO  JSPViewProcessor -
JSPViewProcessor - processing template ShoutBox.jsp
> 2004-06-21 16:04:55,444 [http8080-Processor25] INFO  JSPViewProcessor -
JSPViewProcessor - locating template -
[EMAIL PROTECTED] -
ShoutBox.jsp
> 2004-06-21 16:04:55,444 [http8080-Processor25] INFO  JSPViewProcessor -
JSPViewProcessor - located template: /portlets/html/ShoutBox.jsp
> 2004-06-21 16:04:55,444 [http8080-Processor25] INFO  ShoutBox - ShoutBox
Created.
>
> =====
>
> -Original Message-
> From: Stijn de Witt [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 21, 2004 4:02 PM
> To: Jetspeed Users List
> Subject: Re: Shoutbox Portlet Action doesn't work
>
>
> - Original Message ----- 
> From: "Floßmann Christoph" <[EMAIL PROTECTED]>
> To: "Jetspeed Users List" <[EMAIL PROTECTED]>
> Sent: Monday, June 21, 2004 3:06 PM
> Subject: RE: Shoutbox Portlet Action doesn't work
>
> > Where do I get BitSubmitCvPortletAction form?
>
> Sorry, that was a copy-paste error. My action is named
> BitSubmitCvPortletAction. You have to fill in the name of your action
here,
> so that's
>
> private static final JetspeedLogger logger = JetspeedLogFactoryService.
> getLogger(ShoutBox.class.getName());
>
> > I already tried the following things:
> > System.println.out("Hello world!");
> > in my doUpdate-Action, but nothing was shown after pushing the
> submitbutton.
> > I renamed the doUpdate-Action to something else, but no exception or
error
> occured.
>
> I am guessing that your whole action, so the whole ShoutBox class, cannot
be
> found by jetspeed. This happens because of various reasons. If your class
> cannot be found, then Jetspeed cannot call your doUpdate() function and
> instead the standard doPerform() of the standard action is called. This is
> most probably just some setting somewhere that prevents jetspeed from
> finding it.
>
> Can you add your portlet with the customizer? (If you 'customize page' and
> you click Add Portlet button, is your portlet available in the list?)
> If you cannot add it wit

RE: Shoutbox Portlet Action doesn't work

2004-06-21 Thread Floßmann Christoph
Yes I can add my portlet with the costumizer. And finds the class. Otherwise where 
should the results of my query come form (I created some shoutings in the database 
which are displayed in the portlet)

This is what I get from the logging after pushing the submit button but I don't know 
what I can do now:

=

2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCPortlet - 
GenericMVCPortlet: Executing action [portlets.ShoutBox] for portlet [Shoutbox]
2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCAction - Action: try 
executing events
2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCAction - Action: 
calling doPerform
2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCAction - 
GenericMVCAction: retrieved context: [EMAIL PROTECTED]
2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCAction - 
GenericMVCAction: retrieved portlet: [EMAIL PROTECTED]
2004-06-21 16:04:55,444 [http8080-Processor25] DEBUG GenericMVCAction - 
GenericMVCAction: building normal
2004-06-21 16:04:55,444 [http8080-Processor25] INFO  GenericMVCPortlet - 
GenericMVCPortlet - calling processView on processor
2004-06-21 16:04:55,444 [http8080-Processor25] INFO  JSPViewProcessor - 
JSPViewProcessor - processing template ShoutBox.jsp
2004-06-21 16:04:55,444 [http8080-Processor25] INFO  JSPViewProcessor - 
JSPViewProcessor - locating template - [EMAIL PROTECTED] - ShoutBox.jsp
2004-06-21 16:04:55,444 [http8080-Processor25] INFO  JSPViewProcessor - 
JSPViewProcessor - located template: /portlets/html/ShoutBox.jsp
2004-06-21 16:04:55,444 [http8080-Processor25] INFO  ShoutBox - ShoutBox Created.

=

-Original Message-
From: Stijn de Witt [mailto:[EMAIL PROTECTED]
Sent: Monday, June 21, 2004 4:02 PM
To: Jetspeed Users List
Subject: Re: Shoutbox Portlet Action doesn't work


- Original Message - 
From: "Floßmann Christoph" <[EMAIL PROTECTED]>
To: "Jetspeed Users List" <[EMAIL PROTECTED]>
Sent: Monday, June 21, 2004 3:06 PM
Subject: RE: Shoutbox Portlet Action doesn't work

> Where do I get BitSubmitCvPortletAction form?

Sorry, that was a copy-paste error. My action is named
BitSubmitCvPortletAction. You have to fill in the name of your action here,
so that's

private static final JetspeedLogger logger = JetspeedLogFactoryService.
getLogger(ShoutBox.class.getName());

> I already tried the following things:
> System.println.out("Hello world!");
> in my doUpdate-Action, but nothing was shown after pushing the
submitbutton.
> I renamed the doUpdate-Action to something else, but no exception or error
occured.

I am guessing that your whole action, so the whole ShoutBox class, cannot be
found by jetspeed. This happens because of various reasons. If your class
cannot be found, then Jetspeed cannot call your doUpdate() function and
instead the standard doPerform() of the standard action is called. This is
most probably just some setting somewhere that prevents jetspeed from
finding it.

Can you add your portlet with the customizer? (If you 'customize page' and
you click Add Portlet button, is your portlet available in the list?)
If you cannot add it with the customizer, you should try to fix that first.

-Stijn


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Shoutbox Portlet Action doesn't work

2004-06-21 Thread Stijn de Witt
- Original Message - 
From: "Floßmann Christoph" <[EMAIL PROTECTED]>
To: "Jetspeed Users List" <[EMAIL PROTECTED]>
Sent: Monday, June 21, 2004 3:06 PM
Subject: RE: Shoutbox Portlet Action doesn't work

> Where do I get BitSubmitCvPortletAction form?

Sorry, that was a copy-paste error. My action is named
BitSubmitCvPortletAction. You have to fill in the name of your action here,
so that's

private static final JetspeedLogger logger = JetspeedLogFactoryService.
getLogger(ShoutBox.class.getName());

> I already tried the following things:
> System.println.out("Hello world!");
> in my doUpdate-Action, but nothing was shown after pushing the
submitbutton.
> I renamed the doUpdate-Action to something else, but no exception or error
occured.

I am guessing that your whole action, so the whole ShoutBox class, cannot be
found by jetspeed. This happens because of various reasons. If your class
cannot be found, then Jetspeed cannot call your doUpdate() function and
instead the standard doPerform() of the standard action is called. This is
most probably just some setting somewhere that prevents jetspeed from
finding it.

Can you add your portlet with the customizer? (If you 'customize page' and
you click Add Portlet button, is your portlet available in the list?)
If you cannot add it with the customizer, you should try to fix that first.

-Stijn


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Shoutbox Portlet Action doesn't work

2004-06-21 Thread Floßmann Christoph


Where do I get BitSubmitCvPortletAction form?

I already tried the following things:
System.println.out("Hello world!"); 
in my doUpdate-Action, but nothing was shown after pushing the submitbutton.
I renamed the doUpdate-Action to something else, but no exception or error occured.

I'm using jetspeed 1.4 but I tried this stuff in jetspeed 1.5 also - no difference.

-Original Message-
From: Stijn de Witt [mailto:[EMAIL PROTECTED]
Sent: Monday, June 21, 2004 3:01 PM
To: Jetspeed Users List
Subject: Re: Shoutbox Portlet Action doesn't work



> I already wrote my xreg definition
> Here I copied it once again:
>

Sorry about that, I overlooked it.
Your .xreg looks fine. Can you select your portlet with Add Portlet in the
customizer?

Try adding some logging, it gives you a better view of what's going on.

Add the imports

import org.apache.jetspeed.services.logging.JetspeedLogFactoryService;
import org.apache.jetspeed.services.logging.JetspeedLogger;

and the private static class field logger:

private static final JetspeedLogger logger = JetspeedLogFactoryService.
getLogger(BitSubmitCvPortletAction.class.getName());

(right below public class ShoutBox extends JspPortletAction { )

And then create a constructor and log something:

public ShoutBox()
{
logger.info("ShoutBox Created.");
}

Your logging messages should appear in Jetspeed.log

If the message in the constructor does not appear, then your Action could
not be found. If it does appear, then it must be something else.

-Stijn




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Shoutbox Portlet Action doesn't work

2004-06-21 Thread Stijn de Witt
- Original Message - 
From: "Floßmann Christoph" <[EMAIL PROTECTED]>
To: "Jetspeed Users List" <[EMAIL PROTECTED]>
Sent: Monday, June 21, 2004 1:35 PM
Subject: RE: Shoutbox Portlet Action doesn't work


> I already wrote my xreg definition
> Here I copied it once again:
>

Sorry about that, I overlooked it.
Your .xreg looks fine. Can you select your portlet with Add Portlet in the
customizer?

Try adding some logging, it gives you a better view of what's going on.

Add the imports

import org.apache.jetspeed.services.logging.JetspeedLogFactoryService;
import org.apache.jetspeed.services.logging.JetspeedLogger;

and the private static class field logger:

private static final JetspeedLogger logger = JetspeedLogFactoryService.
getLogger(BitSubmitCvPortletAction.class.getName());

(right below public class ShoutBox extends JspPortletAction { )

And then create a constructor and log something:

public ShoutBox()
{
logger.info("ShoutBox Created.");
}

Your logging messages should appear in Jetspeed.log

If the message in the constructor does not appear, then your Action could
not be found. If it does appear, then it must be something else.

-Stijn




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Shoutbox Portlet Action doesn't work

2004-06-21 Thread Floßmann Christoph
I already wrote my xreg definition 
Here I copied it once again:

==

the portlets.xreg entry:

==


ShoutBox
Schrei was das Zeug hält!

 



==

> I have set the path correct already
> module.packages=org.apache.jetspeed.modules, de.volke.jetspeed.modules
> and I tried it without comma separation without success.

I think both ways work...

>
> Now I'm hanging in that logging file but there is no entry for a doUpdate
Action ):
>

Ok, that's because your action can't be found. Try looking for
GenericMVCPortlet , it is the base class that is responsible for delegating
the actions. Here is a snippet of my log file when it works how it should:

2004-06-21 13:09:26,953 [PoolThread-7] DEBUG PortletWrapper - checking for
Portlet permission: view for portlet: BitSubmitCvPortlet Owner = anon
2004-06-21 13:09:26,968 [PoolThread-7] DEBUG PortletWrapper - checking for
Portlet permission: view for portlet: BitSubmitCvPortlet Owner = anon
2004-06-21 13:09:26,984 [PoolThread-7] DEBUG GenericMVCPortlet -
GenericMVCPortlet: Executing action [BitSubmitCvPortletAction] for portlet
[BitSubmitCvPortlet]
2004-06-21 13:09:27,031 [PoolThread-7] INFO  BitFormPortletAction - Created
a BitFormPortletAction.

I am logging the message 'Created a BitFormPortletAction.' in my portlet
action's constructor. The three lines before that are from Jetspeed.

If you still can't find anything, you could just paste a (section of) the
logfile. Also, I am interested in seeing your .xreg where your portlet is
defined.

-Stijn


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Shoutbox Portlet Action doesn't work

2004-06-21 Thread Stijn de Witt
- Original Message - 
From: "Floßmann Christoph" <[EMAIL PROTECTED]>
To: "Jetspeed Users List" <[EMAIL PROTECTED]>
Sent: Monday, June 21, 2004 1:09 PM
Subject: RE: Shoutbox Portlet Action doesn't work


> I have set the path correct already
> module.packages=org.apache.jetspeed.modules, de.volke.jetspeed.modules
> and I tried it without comma separation without success.

I think both ways work...

>
> Now I'm hanging in that logging file but there is no entry for a doUpdate
Action ):
>

Ok, that's because your action can't be found. Try looking for
GenericMVCPortlet , it is the base class that is responsible for delegating
the actions. Here is a snippet of my log file when it works how it should:

2004-06-21 13:09:26,953 [PoolThread-7] DEBUG PortletWrapper - checking for
Portlet permission: view for portlet: BitSubmitCvPortlet Owner = anon
2004-06-21 13:09:26,968 [PoolThread-7] DEBUG PortletWrapper - checking for
Portlet permission: view for portlet: BitSubmitCvPortlet Owner = anon
2004-06-21 13:09:26,984 [PoolThread-7] DEBUG GenericMVCPortlet -
GenericMVCPortlet: Executing action [BitSubmitCvPortletAction] for portlet
[BitSubmitCvPortlet]
2004-06-21 13:09:27,031 [PoolThread-7] INFO  BitFormPortletAction - Created
a BitFormPortletAction.

I am logging the message 'Created a BitFormPortletAction.' in my portlet
action's constructor. The three lines before that are from Jetspeed.

If you still can't find anything, you could just paste a (section of) the
logfile. Also, I am interested in seeing your .xreg where your portlet is
defined.

-Stijn


>
> -Original Message-
>
> Have you set your module path in
> webapp/WEB-INF/conf/TurbineResources.properties?
> There are entries there like this:
>
> module.packages=org.apache.jetspeed.modules
> module.packages=org.apache.turbine.modules
>
>
> You have to add the root of your modules packages to this path:
>
> module.packages=de.volke.jetspeed.modules
>
> Not sure if that's it, but that caused trouble with me.
> Also, check the logs in tomcat/webaps/jetspeed/WEB-INF/log/Jetspeed.log
>
> Hope it helps,
> -Stijn
>
>
> - Original Message - 
> From: "Floßmann Christoph" <[EMAIL PROTECTED]>
> To: "Jetspeed Users List (E-Mail)" <[EMAIL PROTECTED]>
> Sent: Monday, June 21, 2004 11:40 AM
> Subject: Shoutbox Portlet Action doesn't work
>
>
> > Hi there,
> >
> > I tried to write a little ShoutBox jsp-Portlet. I don't know why, but it
> the Action doesn't work.
> >
> > Here my Portlet Code:
> >
> > ==
> > <%@ page import="java.sql.ResultSet"%>
> > <%@ page language="java" contentType="text/html; charset=iso-8859-1"
> session="true" %>
> >
> > <%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld'
prefix='jetspeed'
> %>
> >  class="de.volke.jetspeed.modules.actions.ShoutBox" scope="request" />
> > 
> >
> >
> > <%
> > String jspeid = (String) request.getAttribute("js_peid");
> > %>
> > 
> > 
> > 
> > 
> > Shout:
> > 
> > 
> > 
> >   
> > 
> > 
> >  style="width:60">
> > 
> > 
> > 
> > <%
> > //Show entries.
> > String text;
> > ResultSet rsshout = shoutBox.getShoutings();
> > while(rsshout.next()){
> > text = rsshout.getString("shouttext");
> > out.println("" + text +
"");
> > }
> >
> > try{
> > rsshout.close();
> > rsshout.getStatement().close();
> > rsshout.getStatement().getConnection().close();
> > }
> > catch(Exception e){
> > System.out.println("Schwerer Ausnahmefehler:");
> > System.out.println(e);
> > }
> > %>
> > 
> >
> > ==
> >
> > the portlets.xreg entry:
> >
> > ==
> >
> >  application="false">
> > 
> > ShoutBox
> > Schrei was das Zeug hält!
> > 
> > 
> >  cachedOnName="true" cachedOnValue="true"/>
> > 
> > 
> >
> > ==
> 

RE: Shoutbox Portlet Action doesn't work

2004-06-21 Thread Floßmann Christoph
I have set the path correct already
module.packages=org.apache.jetspeed.modules, de.volke.jetspeed.modules
and I tried it without comma separation without success.

Now I'm hanging in that logging file but there is no entry for a doUpdate Action ):


-Original Message-

Have you set your module path in
webapp/WEB-INF/conf/TurbineResources.properties?
There are entries there like this:

module.packages=org.apache.jetspeed.modules
module.packages=org.apache.turbine.modules


You have to add the root of your modules packages to this path:

module.packages=de.volke.jetspeed.modules

Not sure if that's it, but that caused trouble with me.
Also, check the logs in tomcat/webaps/jetspeed/WEB-INF/log/Jetspeed.log

Hope it helps,
-Stijn


- Original Message - 
From: "Floßmann Christoph" <[EMAIL PROTECTED]>
To: "Jetspeed Users List (E-Mail)" <[EMAIL PROTECTED]>
Sent: Monday, June 21, 2004 11:40 AM
Subject: Shoutbox Portlet Action doesn't work


> Hi there,
>
> I tried to write a little ShoutBox jsp-Portlet. I don't know why, but it
the Action doesn't work.
>
> Here my Portlet Code:
>
> ==
> <%@ page import="java.sql.ResultSet"%>
> <%@ page language="java" contentType="text/html; charset=iso-8859-1"
session="true" %>
>
> <%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld' prefix='jetspeed'
%>
> 
> 
>
>
> <%
> String jspeid = (String) request.getAttribute("js_peid");
> %>
> 
> 
> 
> 
> Shout:
> 
> 
> 
>   
> 
> 
> 
> 
> 
> 
> <%
> //Show entries.
> String text;
> ResultSet rsshout = shoutBox.getShoutings();
> while(rsshout.next()){
> text = rsshout.getString("shouttext");
> out.println("" + text + "");
> }
>
> try{
> rsshout.close();
> rsshout.getStatement().close();
> rsshout.getStatement().getConnection().close();
> }
> catch(Exception e){
> System.out.println("Schwerer Ausnahmefehler:");
> System.out.println(e);
> }
> %>
> 
>
> ==
>
> the portlets.xreg entry:
>
> ==
>
> 
> 
> ShoutBox
> Schrei was das Zeug hält!
> 
> 
> 
> 
> 
>
> ==
>
> and the class:
>
> ==
>
> package de.volke.jetspeed.modules.actions;
>
> import org.apache.jetspeed.modules.actions.portlets.JspPortletAction;
> import org.apache.jetspeed.portal.Portlet;
> import org.apache.turbine.util.RunData;
>
> import java.sql.ResultSet;
> import java.sql.Connection;
> import java.sql.Statement;
> import java.sql.DriverManager;
> import java.rmi.dgc.VMID;
>
> /**
>  * Created by Christoph Floßmann.
>  */
>
> public class ShoutBox extends JspPortletAction {
>
> String shout = "";
>
> public String getShout() {
> return shout;
> }
>
> public void setShout(String shout) {
> this.shout = shout;
> }
>
> public ResultSet getShoutings() throws Exception {
>
>  //--Database Connect--
> Connection conn = null;
> Statement stmt = null;
> ResultSet rs = null;
>
> Class.forName("org.postgresql.Driver");
>
> String dbsource = "jdbc:postgresql://xxx/yyy";
> String dbuser = "xxx";
> String dbpassword = "xxx"; //If you want to try yourself edit the xxx and
yyy entries
> conn = DriverManager.getConnection(dbsource, dbuser, dbpassword);
> stmt =  conn.createStatement();
>
> String sql = "SELECT " +
> "shouttext " +
> "FROM " +
> "portal.tbl_shoutbox " +
> "ORDER BY "+
> "date DESC, time DESC " +
>  "LIMIT 10";
>
> rs = stmt.executeQuery(sql);
> return rs;
> }
>
> protected void buildNormalContext(Portlet portlet, RunData rundata)
throws Exception {
>
> }
>
> public void doUpdate(RunData rundata, Portlet portlet) throws
Exception{
>
> System.out.println("Action is working!"); //just to test this
thing!
> }
> }
>
> ==
>
> Any suggestions?
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Shoutbox Portlet Action doesn't work

2004-06-21 Thread Stijn de Witt
Have you set your module path in
webapp/WEB-INF/conf/TurbineResources.properties?
There are entries there like this:

module.packages=org.apache.jetspeed.modules
module.packages=org.apache.turbine.modules


You have to add the root of your modules packages to this path:

module.packages=de.volke.jetspeed.modules

Not sure if that's it, but that caused trouble with me.
Also, check the logs in tomcat/webaps/jetspeed/WEB-INF/log/Jetspeed.log

Hope it helps,
-Stijn


- Original Message - 
From: "Floßmann Christoph" <[EMAIL PROTECTED]>
To: "Jetspeed Users List (E-Mail)" <[EMAIL PROTECTED]>
Sent: Monday, June 21, 2004 11:40 AM
Subject: Shoutbox Portlet Action doesn't work


> Hi there,
>
> I tried to write a little ShoutBox jsp-Portlet. I don't know why, but it
the Action doesn't work.
>
> Here my Portlet Code:
>
> ==
> <%@ page import="java.sql.ResultSet"%>
> <%@ page language="java" contentType="text/html; charset=iso-8859-1"
session="true" %>
>
> <%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld' prefix='jetspeed'
%>
> 
> 
>
>
> <%
> String jspeid = (String) request.getAttribute("js_peid");
> %>
> 
> 
> 
> 
> Shout:
> 
> 
> 
>   
> 
> 
> 
> 
> 
> 
> <%
> //Show entries.
> String text;
> ResultSet rsshout = shoutBox.getShoutings();
> while(rsshout.next()){
> text = rsshout.getString("shouttext");
> out.println("" + text + "");
> }
>
> try{
> rsshout.close();
> rsshout.getStatement().close();
> rsshout.getStatement().getConnection().close();
> }
> catch(Exception e){
> System.out.println("Schwerer Ausnahmefehler:");
> System.out.println(e);
> }
> %>
> 
>
> ==
>
> the portlets.xreg entry:
>
> ==
>
> 
> 
> ShoutBox
> Schrei was das Zeug hält!
> 
> 
> 
> 
> 
>
> ==
>
> and the class:
>
> ==
>
> package de.volke.jetspeed.modules.actions;
>
> import org.apache.jetspeed.modules.actions.portlets.JspPortletAction;
> import org.apache.jetspeed.portal.Portlet;
> import org.apache.turbine.util.RunData;
>
> import java.sql.ResultSet;
> import java.sql.Connection;
> import java.sql.Statement;
> import java.sql.DriverManager;
> import java.rmi.dgc.VMID;
>
> /**
>  * Created by Christoph Floßmann.
>  */
>
> public class ShoutBox extends JspPortletAction {
>
> String shout = "";
>
> public String getShout() {
> return shout;
> }
>
> public void setShout(String shout) {
> this.shout = shout;
> }
>
> public ResultSet getShoutings() throws Exception {
>
>  //--Database Connect--
> Connection conn = null;
> Statement stmt = null;
> ResultSet rs = null;
>
> Class.forName("org.postgresql.Driver");
>
> String dbsource = "jdbc:postgresql://xxx/yyy";
> String dbuser = "xxx";
> String dbpassword = "xxx"; //If you want to try yourself edit the xxx and
yyy entries
> conn = DriverManager.getConnection(dbsource, dbuser, dbpassword);
> stmt =  conn.createStatement();
>
> String sql = "SELECT " +
> "shouttext " +
> "FROM " +
> "portal.tbl_shoutbox " +
> "ORDER BY "+
> "date DESC, time DESC " +
>  "LIMIT 10";
>
> rs = stmt.executeQuery(sql);
> return rs;
> }
>
> protected void buildNormalContext(Portlet portlet, RunData rundata)
throws Exception {
>
> }
>
> public void doUpdate(RunData rundata, Portlet portlet) throws
Exception{
>
> System.out.println("Action is working!"); //just to test this
thing!
> }
> }
>
> ==
>
> Any suggestions?
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]