Suppose  that I create "MyHello.java", similar to "HelloAction.java", the only
difference is:
        package project.rql.modules.actions.portlets;

        import org.apache.jetspeed.modules.actions.portlets.VelocityPortletAction;
        import gr.forth.ics.rql.*;
        import java.io.*;"


and I create a method :

public void doMy(RunData data, Context context)
{

        String text = data.getParameters().getString("txt");
        RQLDatabaseConnection   dbc;
        int result;

        if (text!=null)
        {
            VelocityPortlet portlet = (VelocityPortlet)context.get("portlet");
            portlet.setAttribute("txt",text,data);
            context.put("txt",text);
                try
                {
                        RQLLibrary.initialize();
                }
                catch (Exception x)
                {
                        x.printStackTrace();
                        return;
                }

                dbc = new PostgresRQLDatabaseConnection("repository");
                result = RQLLibrary.query(text, dbc, "/tmp/result");
                context.put("msg", "(OK) etre3e to doUpdate me arg: "+ text);
        }
        else
        {
            context.put("msg", "You must specify a new text");
        }

                dbc = null;
    }

------------------------------------------------
my CLASSPATH contains  CLASSPATH=/PATH/classes
where there is a directory "project/rql/modules/actions/portlets/MyHello.class"
------------------------------------------------

TurbineResources.properties contains:
        "module.packages=project.rql.modules.actions"

------------------------------------------------
the registry:

<?xml version="1.0" encoding="UTF-8"?>
<registry>
    <portlet-entry name="ServletInput" hidden="false" type="ref"
        parent="CustomizerVelocity" application="false">
        <meta-info>
            <title>ServletInput</title>
            <description>Simple ServletInput Portlet Example</description>
        </meta-info>

        
<classname>org.apache.jetspeed.portal.portlets.CustomizerVelocityPortlet</classname>
        <parameter name="template" value="MyHello" hidden="false"
            cachedOnName="true" cachedOnValue="true"/>
        <parameter name="action" value="portlets.MyHello"
            hidden="false" cachedOnName="true" cachedOnValue="true"/>
        <media-type ref="html"/>
        <url cachedOnURL="true"/>
    </portlet-entry>
</registry>
------------------------------------------------

and finally the MyHello.vm:

#if ( !$txt )
#set ( $txt = "PLEASE RUN I'M GOING BANANAS!!!" )
#end
<form action="$jslink.Template" method="post">
  <font color="$!{skin.Color}">
    <h2>${txt}</h2>
#if ($msg)
    <b>${msg}</b>
    <br>
#end
    <p>
      <br>
      <input name="txt" value="$txt" size="30">
      <input type="submit" name="eventSubmit_doMy" value="My">
    </p>
  </font>
</form>


-------------------------------------

and here is the log:


[23:37:59,956 DEBUG] checking for Portlet permission: customize for portlet:
ServletInput
[23:37:59,956 DEBUG] checking for Portlet permission: close for portlet:
ServletInput
[23:37:59,956 DEBUG] checking for Portlet permission: view for portlet:
ServletInput
[23:37:59,958 DEBUG] checking for Portlet permission: minimize for portlet:
ServletInput
[23:37:59,959 DEBUG] checking for Portlet permission: maximize for portlet:
ServletInput
[23:37:59,996 DEBUG] template exists:
/spare/pacos/jakarta-tomcat-4.1.7/webapps/jetspeed/WEB-INF/templates/vm/controls/html/jetspeed.vm
returning /html/jetspeed.vm
[23:38:00,085 DEBUG] checking for Portlet permission: view for portlet:
ServletInput
[23:38:00,087 DEBUG] checking for Portlet permission: view for portlet:
ServletInput
[23:38:00,087 DEBUG] checking for Portlet permission: view for portlet:
ServletInput
[23:38:00,087 DEBUG] VelocityPortlet::getVelocityContent
[23:38:00,088 DEBUG] VelocityPortlet found action portlets.MyHello context
org.apache.velocity.VelocityContext@484a8a
[23:38:00,105 ERROR]
java.lang.ClassNotFoundException:

        Requested Action not found: portlets.MyHello
        Turbine looked in the following modules.packages path:
        [org.apache.jetspeed.modules, org.apache.turbine.modules,
project.rql.modules.actions]

        at
org.apache.turbine.modules.ActionLoader.getInstance(ActionLoader.java:174)
        at org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
        at
org.apache.jetspeed.portal.portlets.VelocityPortlet.getVelocityContent(VelocityPortlet.java:192)
        at
org.apache.jetspeed.portal.portlets.VelocityPortlet.getContent(VelocityPortlet.java:129)
        at
org.apache.jetspeed.portal.security.portlets.PortletWrapper.getContent(PortletWrapper.java:142)
        at sun.reflect.GeneratedMethodAccessor179.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:259)
        at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:207)
        at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:250)
        at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
        at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:109)
        at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
        at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:109)
        at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:271)
        at org.apache.velocity.Template.merge(Template.java:296)
        at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:492)
        at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:461)
        at
org.apache.turbine.services.velocity.TurbineVelocityService.decodeRequest(TurbineVelocityService.java:485)
        at
org.apache.turbine.services.velocity.TurbineVelocityService.handleRequest(TurbineVelocityService.java:327)
        at
org.apache.turbine.services.velocity.TurbineVelocity.handleRequest(TurbineVelocity.java:146)
        at
org.apache.jetspeed.portal.controls.VelocityPortletControl.getContent(VelocityPortletControl.java:162)
        at sun.reflect.GeneratedMethodAccessor174.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:259)
        at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:207)
        at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:250)
        at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)




On Thu, 25 Jul 2002, Ramiro Rinaudo wrote:

> Def, what changes have you made to your HelloAction?, just modify a method calling 
>your own classes?
> was the portlet working before your changes?, If so, check if your java editor have 
>changed the package of your class. Second were did you put your own classes?
>
> Hope it helps and good luck.
> Ramiro Rinaudo
>
>
> -----Original Message-----
> From: 'def'
> Sent: Thursday, July 25, 2002 3:02 PM
> To:   'Jetspeed Users List'
> Subject:      RE: Jetspeed version 1.4b1  - Problem while making my own Actions
>
>
>
> unfortunately, it didn't work out.
> I can't find a solution for days
>
> On Thu, 25 Jul 2002, Dealy, Brian wrote:
>
> > not sure if this is important but in my directory structure I see:
> > \org\apache\jetspeed\modules\actions\portlets\HelloAction.class
> >
> > your error seems to indicate that Turbine is looking for
> > portlets.HelloAction in
> >     Turbine looked in the following modules.packages path:
> >     [org.apache.jetspeed.modules, org.apache.turbine.modules]
> >
> > seems like it should need to look in org.apache.jetspeed.modules.actions for
> > portlets.HelloAction
> > but I am not sure... hope this helps...
> > brian
> >
> > -----Original Message-----
> > From: def [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, July 25, 2002 10:32 AM
> > To: [EMAIL PROTECTED]
> > Subject: Jetspeed version 1.4b1 - Problem while making my own Actions
> >
> >
> >
> >
> >
> > When I change the
> > $JETSPEED_HOME/src/java/org/apache/jetspeed/modules/actions/portlets/HelloAc
> > tion.java
> > file and add some new functionality to the 'doUpdate' method (I have
> > imported one of my own packages and tried to call one the methods), jetspeed
> > cannot find the action. Sorry for sending the mail twice, but I'm pulling my
> > hair! Here's the log:
> >
> >
> >
> > [21:21:38,029 DEBUG] checking for Portlet permission: view for portlet:
> > HelloVelocity [21:21:38,032 DEBUG] checking for Portlet permission: view for
> > portlet: HelloVelocity [21:21:38,070 DEBUG] checking for Portlet permission:
> > view for portlet: HelloVelocity [21:21:38,070 DEBUG]
> > VelocityPortlet::getVelocityContent
> > [21:21:38,072 DEBUG] VelocityPortlet found action portlets.HelloAction
> > context org.apache.velocity.VelocityContext@4aa453
> > [21:21:38,113 ERROR]
> > java.lang.ClassNotFoundException:
> >
> >     Requested Action not found: portlets.HelloAction
> >     Turbine looked in the following modules.packages path:
> >     [org.apache.jetspeed.modules, org.apache.turbine.modules]
> >
> >     at
> > org.apache.turbine.modules.ActionLoader.getInstance(ActionLoader.java:174)
> >     at
> > org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
> >     at
> > org.apache.jetspeed.portal.portlets.VelocityPortlet.getVelocityContent(Veloc
> > ityPortlet.java:192)
> >     at
> > org.apache.jetspeed.portal.portlets.VelocityPortlet.getContent(VelocityPortl
> > et.java:129)
> >     at
> > org.apache.jetspeed.portal.security.portlets.PortletWrapper.getContent(Portl
> > etWrapper.java:142)
> >     at java.lang.reflect.Method.invoke(Native Method)
> >     at
> > org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:259
> > )
> >     at
> > org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReferenceja
> > va:20
> > .
> > .
> > .
> > .
> > .
> >
> >
> >
> > I started to change the HelloAction.java file, since I could not make my own
> > MyHelloAction.java run. In a recent post I read that I could make my own
> > package for example 'project.rql.modules.actions.portlets', make an entry in
> > the TurbineResources.properties to know where to look for, and add an entry
> > to the jetspeed's registry, but I could not make it work. What am I doing
> > wrong?
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> >
> > For additional commands, e-mail:
> >
> >
> > --
> > To unsubscribe, e-mail:
> > For additional commands, e-mail:
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:
>
>
>
> __________________________________________________
>
> Todav�a no ten�s tu Ciudad Internet Mail? Obtenelo ahora! - 
>http://webmail.ciudad.com.ar
>
> Descarg� Gratis el nuevo Internet Explorer 6.0, el mejor software para actualizar tu 
>PC.
> http://www.ciudad.com.ar/ar/servicios/ie/
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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

Reply via email to