You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by John McNally <jm...@collab.net> on 2001/04/03 18:49:08 UTC

Re: We now want to present information from the DB on screen using the same........

Adding business object packages to module.packages is going to have no
effect, that property is related to action, screen, layout, etc.

Are the objects actually populating the Vector?  Have you looked at
velocity.log and turbine.log for clues?

I am guessing you are not setting up the connection properly, or missing
your jdbc driver from the classpath, but it is pretty hard to say
without any stacktrace.

john mcnally

> Marco Schoolenberg wrote:
> 
> <snip>
> Hi guys,
> 
> I used Torque to generate a load of classes to access my Database.
> When I
> use Kawa I can access the DB updating records etc as expected :-))
> 
> We now want to present information from the DB on screen using the
> same
> generated classes, unfortunately things are not working 100% :-(
> 
> I do get the correct number of objects in the template engine but
> instead of
> presenting the data I get
> 
> $foo.get"table"Name()   (Where table stands for the name of the
> object)
> 
> on the screen. I thought it may have something to do with the fact
> that the
> template engine can't find the specific (foo) class I'm looking for,
> as in
> 
> foreach ($foo in $foolist)
> 
> I therefore tried to add
> 
> com.foo.om
> 
> to the TurbineResources by the module.packages but as of yet still the
> same
> response.
> 
> Any tips?
> 
> /Colin
> 
> </snip>
> 
> 
> I have been working with Colin to solve this problem and I see that if
> put a vector to the screen (like we did with other Vector's but with
> different objects in it) we can't use the Methode's of the Object in
> the Velocity  .vm I am wondering what the difference is between
> the occasions we use this methode of working. It puzzles me because
> they are both vectors they are both filled with Objects we Put the
> Vectors in the same way. The only thing I can think of that is
> different is That the Objects are coming out of a DB. The other vector
> was not coming from DB. It was a list of Serialized Objects?????
> Might that be the problem. Should I maybe Serialize the Objects in the
> Vector ????? You can see we are puzzled. If anyone can give us input
> Please do so......?
> 
> Marco.Schoolenberg@Maxware.nl

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


Re: We now want to present information from the DB on screen using the same........

Posted by "Frank W. Nolden" <fr...@maxware.nl>.
Hi John,

thanks for your time to react on this problem, but the connection with the DB is OK. WE are experiencing problems when trying to put the information on the screen using Velocity. I will try and describe the problem using a code snippet:

The class building the context 
DataBase connection is OK and Vector is filled with Uss Objects  !




<snip>

 * @author  Marco Schoolenberg Marco.Schoolenberg@Maxware.nl
 */
public class SelectDir extends VelocityScreen
{
    /**
     * Build the screen context.
     *
     * @param data Turbine information.
     * @param context Context for web pages.
     * @exception Exception, a generic exception.
     */
 
    public void doBuildTemplate( RunData data,Context context )
        throws Exception
        {
  
  Criteria crit = new Criteria();
     
  Vector v = UssPeer.doSelect(crit);
 // Vector does fill up !!!
  
  System.out.println(v);
  
  Vector UssList = new Vector();
    Uss test = new Uss();
  
  for (int cnt=0; cnt < v.size(); cnt++)
  {
   test = (Uss)v.elementAt(cnt);
   UssList.add(test);
   System.out.println(test.getUssName() + test.getUssValue() + test.getUssId());
   

  }
   
  context.put("UssList", UssList);
  }  
}

</snip>

As you can see I am trying to put a Vector as Context this is going fine. I can even get something on the screen like 
[ com.maxware.fls.om.Uss@565765  , com.maxware.fls.om.Uss@565789] So I know that the Vector contains elements, but 
I cannot get to the elements as you can see below. 

I am then trying to Use methodes of the objects in the SelectDir.vm I am doing that like this:


<snip>
#foreach ($Uss in $UssList)
 <tr>
  <td>
  $Uss.getUssName()
  </td>
 </tr>
#end
</snip>


If I do this I get this on my screen: $Uss.getUssName()

I know there is information in the object, since if I check if there is a value in it by making a context put with this specific value I can see the content.
However, then I have to hard code the objects, whcih I do not want. I want to run the foreach loop and display all records that obey my search criteria.

Maybe I am completely lost and heading in the wrong direction. I f I am please tell me and let me see how it does work.
Thanks in advance for your (anyones) help.

Frank

  ----- Original Message ----- 
  From: John McNally 
  To: turbine-user@jakarta.apache.org 
  Sent: Tuesday, April 03, 2001 18:49
  Subject: Re: We now want to present information from the DB on screen using the same........


  Adding business object packages to module.packages is going to have no
  effect, that property is related to action, screen, layout, etc.

  Are the objects actually populating the Vector?  Have you looked at
  velocity.log and turbine.log for clues?

  I am guessing you are not setting up the connection properly, or missing
  your jdbc driver from the classpath, but it is pretty hard to say
  without any stacktrace.

  john mcnally

  > Marco Schoolenberg wrote:
  > 
  > <snip>
  > Hi guys,
  > 
  > I used Torque to generate a load of classes to access my Database.
  > When I
  > use Kawa I can access the DB updating records etc as expected :-))
  > 
  > We now want to present information from the DB on screen using the
  > same
  > generated classes, unfortunately things are not working 100% :-(
  > 
  > I do get the correct number of objects in the template engine but
  > instead of
  > presenting the data I get
  > 
  > $foo.get"table"Name()   (Where table stands for the name of the
  > object)
  > 
  > on the screen. I thought it may have something to do with the fact
  > that the
  > template engine can't find the specific (foo) class I'm looking for,
  > as in
  > 
  > foreach ($foo in $foolist)
  > 
  > I therefore tried to add
  > 
  > com.foo.om
  > 
  > to the TurbineResources by the module.packages but as of yet still the
  > same
  > response.
  > 
  > Any tips?
  > 
  > /Colin
  > 
  > </snip>
  > 
  > 
  > I have been working with Colin to solve this problem and I see that if
  > put a vector to the screen (like we did with other Vector's but with
  > different objects in it) we can't use the Methode's of the Object in
  > the Velocity  .vm I am wondering what the difference is between
  > the occasions we use this methode of working. It puzzles me because
  > they are both vectors they are both filled with Objects we Put the
  > Vectors in the same way. The only thing I can think of that is
  > different is That the Objects are coming out of a DB. The other vector
  > was not coming from DB. It was a list of Serialized Objects?????
  > Might that be the problem. Should I maybe Serialize the Objects in the
  > Vector ????? You can see we are puzzled. If anyone can give us input
  > Please do so......?
  > 
  > Marco.Schoolenberg@Maxware.nl

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



Re: We now want to present information from the DB on screen using the same........

Posted by "Frank W. Nolden" <fr...@maxware.nl>.
Hi John,

thanks for your time to react on this problem, but the connection with the DB is OK. WE are experiencing problems when trying to put the information on the screen using Velocity. I will try and describe the problem using a code snippet:

The class building the context 
DataBase connection is OK and Vector is filled with Uss Objects  !




<snip>

 * @author  Marco Schoolenberg Marco.Schoolenberg@Maxware.nl
 */
public class SelectDir extends VelocityScreen
{
    /**
     * Build the screen context.
     *
     * @param data Turbine information.
     * @param context Context for web pages.
     * @exception Exception, a generic exception.
     */
 
    public void doBuildTemplate( RunData data,Context context )
        throws Exception
        {
  
  Criteria crit = new Criteria();
     
  Vector v = UssPeer.doSelect(crit);
 // Vector does fill up !!!
  
  System.out.println(v);
  
  Vector UssList = new Vector();
    Uss test = new Uss();
  
  for (int cnt=0; cnt < v.size(); cnt++)
  {
   test = (Uss)v.elementAt(cnt);
   UssList.add(test);
   System.out.println(test.getUssName() + test.getUssValue() + test.getUssId());
   

  }
   
  context.put("UssList", UssList);
  }  
}

</snip>

As you can see I am trying to put a Vector as Context this is going fine. I can even get something on the screen like 
[ com.maxware.fls.om.Uss@565765  , com.maxware.fls.om.Uss@565789] So I know that the Vector contains elements, but 
I cannot get to the elements as you can see below. 

I am then trying to Use methodes of the objects in the SelectDir.vm I am doing that like this:


<snip>
#foreach ($Uss in $UssList)
 <tr>
  <td>
  $Uss.getUssName()
  </td>
 </tr>
#end
</snip>


If I do this I get this on my screen: $Uss.getUssName()

I know there is information in the object, since if I check if there is a value in it by making a context put with this specific value I can see the content.
However, then I have to hard code the objects, whcih I do not want. I want to run the foreach loop and display all records that obey my search criteria.

Maybe I am completely lost and heading in the wrong direction. I f I am please tell me and let me see how it does work.
Thanks in advance for your (anyones) help.

Frank

  ----- Original Message ----- 
  From: John McNally 
  To: turbine-user@jakarta.apache.org 
  Sent: Tuesday, April 03, 2001 18:49
  Subject: Re: We now want to present information from the DB on screen using the same........


  Adding business object packages to module.packages is going to have no
  effect, that property is related to action, screen, layout, etc.

  Are the objects actually populating the Vector?  Have you looked at
  velocity.log and turbine.log for clues?

  I am guessing you are not setting up the connection properly, or missing
  your jdbc driver from the classpath, but it is pretty hard to say
  without any stacktrace.

  john mcnally

  > Marco Schoolenberg wrote:
  > 
  > <snip>
  > Hi guys,
  > 
  > I used Torque to generate a load of classes to access my Database.
  > When I
  > use Kawa I can access the DB updating records etc as expected :-))
  > 
  > We now want to present information from the DB on screen using the
  > same
  > generated classes, unfortunately things are not working 100% :-(
  > 
  > I do get the correct number of objects in the template engine but
  > instead of
  > presenting the data I get
  > 
  > $foo.get"table"Name()   (Where table stands for the name of the
  > object)
  > 
  > on the screen. I thought it may have something to do with the fact
  > that the
  > template engine can't find the specific (foo) class I'm looking for,
  > as in
  > 
  > foreach ($foo in $foolist)
  > 
  > I therefore tried to add
  > 
  > com.foo.om
  > 
  > to the TurbineResources by the module.packages but as of yet still the
  > same
  > response.
  > 
  > Any tips?
  > 
  > /Colin
  > 
  > </snip>
  > 
  > 
  > I have been working with Colin to solve this problem and I see that if
  > put a vector to the screen (like we did with other Vector's but with
  > different objects in it) we can't use the Methode's of the Object in
  > the Velocity  .vm I am wondering what the difference is between
  > the occasions we use this methode of working. It puzzles me because
  > they are both vectors they are both filled with Objects we Put the
  > Vectors in the same way. The only thing I can think of that is
  > different is That the Objects are coming out of a DB. The other vector
  > was not coming from DB. It was a list of Serialized Objects?????
  > Might that be the problem. Should I maybe Serialize the Objects in the
  > Vector ????? You can see we are puzzled. If anyone can give us input
  > Please do so......?
  > 
  > Marco.Schoolenberg@Maxware.nl

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