You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Neil Stevens <ne...@firstlightassociates.co.uk> on 2002/11/14 13:19:32 UTC

Can some intake fileds have no mapToProperty

Hi,

Do all fields in a group have to be mapped? I added a 'Delete' (boolean)
unmapped field to my group, without setting the mapToProperty, but I get an
error :-

ERROR -- Property, Delete for class, ....PriceCategoryLevel could not be
found in the turbine log. I don't want this field mapped!

I am just trying to have multiple rows in one form of a table that can all
be updated or deleted in one hit.

Should this have worked ?

Neil


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: is it possible to distinguish new and old Groups in intake?

Posted by Rodney Schneider <ro...@actf.com.au>.
On Mon, 18 Nov 2002 20:43, you wrote:

> However in my screen, I want a new empty line at the end of the table so I
> add :-
>
>
> #set ( $newLineGroup = $intake.InvoiceLine.Default )
> #textfield ( $newLineGroup.ProdCode.Key $newLineGroup.ProdCode )
> #showError ( $newLineGroup.ProdCode.isValid()
> $newLineGroup.ProdCode.getMessage() )
>      ...etc
>
> This allows the user to add a new Invoice line, and it work fine,
> mostly!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
> Sometimes, the line gets data in it from previous requests
> AAAAAAAGGGGGGGHHHHHHH!!!!!!!!!!!!!

Hi Neil,

I am not 100% sure this will fix your problem, but here is an extract from 
the latest version of the intake howto:

--------------
Intake data is retained in the request in order to allow for the              
possibility that it will be re-presented to the user on the next              
page. Normally this is desirable behaviour - there may have been              
an error in the data so you want to redisplay it. There is a
possibility however that you might want to reuse the same group
on either the same or a different page after fully processing
the data; in this case it may be undesirable to redisplay the
previously entered data. The prime example of this is where a
page includes a repeating group of records and provides an
opportunity to add a further record using the default group,
returning to the same page after each record is added.  In this
situation you will find that the default group needs to be
removed from the request, otherwise the data entered on the
previous page will be redisplayed.

Intake allows for this by providing a way of removing the data
that is no longer appropriate to display.  Simply:

intake.remove(group);

... where "intake" is a reference to your IntakeTool and "group"              
is a reference to the group you wish to remove from the
request.  You would do this after the new record had been
validated and added to the database.

It will be rare that you actually need to do this - it is
required only in situations where the same group is used on
subsequent pages after the data has been fully processed.
--------------

Regards,

-- Rodney

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problems extending user as per how to (and previous messages)

Posted by malcolm cooke <ma...@firstlightassociates.co.uk>.
Renuka

I am fairly new to all this so may not be able to help you much.

To make the data available I would have thought that you need to store it 
in the session as you say.

If you are not using the security service then I would think that you will 
have to create your own tool with a method similar to getAuthenticatedUser 
which will check against your user, role tables etc.

One possibility might be to modify the fluxtool and put your required 
methods in there - but to a large degree you may be better off taking 
advice from someone else in the group with a better understanding of these 
things than I have.

Good luck

Malcolm


At 10:52 21/11/02 +0530, you wrote:

>Hi Malcolm
>Even i am also facing the similar type of problem extending the user.
>In my applicatin I am not  importing the Om.Security at all . I have created
>my own tables and users for application security and created the users,
>roles and permissions also.  According to the role id 's and permissions the
>application is working perfectly.
>The main (Big) problem is when i am navigating the pages backward then the
>page is not displaying anything. because I am passing the Userid and role id
>everything to the next page . so It's forward navigation the Userid and
>Roleid are available so pages are displaying the data. If it's back ward
>then problem is Occuring.
>it's not holding the Userid value at all.
>The solution is if i will put the Userid and Roleid in the Session then it
>will work.I am not importing the Om.Security  i am not able to use
>geAuthenticatedUser(username,password) . what ever the solution i got at
>last they mentioned to use the getAuthenticatedUser().
>Is there any other way to invoke the session and put the required values
>where ever we required if the navigation is forward or backward? .
>Your help is alway appreciateble
>
>Regards
>Renuka
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.417 / Virus Database: 233 - Release Date: 08/11/02

confirm_value in turbine_user?

Posted by malcolm cooke <ma...@firstlightassociates.co.uk>.
Hi,

can anyone give me a clue what the column confirm_value in TURBINE_USER 
(tdk 2.1) is used for.

Thanks

malcolm

Re: Problems extending user as per how to (and previous messages)

Posted by Renuka <re...@bigtec.org>.
Hi Malcolm
Even i am also facing the similar type of problem extending the user.
In my applicatin I am not  importing the Om.Security at all . I have created
my own tables and users for application security and created the users,
roles and permissions also.  According to the role id 's and permissions the
application is working perfectly.
The main (Big) problem is when i am navigating the pages backward then the
page is not displaying anything. because I am passing the Userid and role id
everything to the next page . so It's forward navigation the Userid and
Roleid are available so pages are displaying the data. If it's back ward
then problem is Occuring.
it's not holding the Userid value at all.
The solution is if i will put the Userid and Roleid in the Session then it
will work.I am not importing the Om.Security  i am not able to use
geAuthenticatedUser(username,password) . what ever the solution i got at
last they mentioned to use the getAuthenticatedUser().
Is there any other way to invoke the session and put the required values
where ever we required if the navigation is forward or backward? .
Your help is alway appreciateble

Regards
Renuka


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Problems extending user as per how to (and previous messages)

Posted by malcolm cooke <ma...@firstlightassociates.co.uk>.
Ok Chris we'll do that.

Rgds

Malcolm

At 10:31 20/11/02 -0700, you wrote:

>I am glad to hear you got it working!  I encourage you to check out the
>turbine-2-site source code from cvs and add your lessons learned to the
>Extend-User Howto.  When you are finished, submit the patch to the
>'turbine-2 -> documentation' module in Scarab.
>
>CVS: http://jakarta.apache.org/site/cvsindex.html
>SCARAB: http://scarab.werken.com/scarab/issues/
>
>Thanks,
>
>Chris
>
> > -----Original Message-----
> > From: malcolm cooke [mailto:malcolm.cooke@firstlightassociates.co.uk]
> > Sent: Tuesday, November 19, 2002 6:15 AM
> > To: Turbine Users List
> > Subject: RE: Problems extending user as per how to (and previous
> > messages)
> >
> >
> > Thanks for the response Chris - it helped set me off looking at the right
> > area to get it working.
> >
> > For the benefit of others here is a result of my findings.
> >
>...snip...
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.417 / Virus Database: 233 - Release Date: 08/11/02

RE: Problems extending user as per how to (and previous messages)

Posted by Chris K Chew <ch...@fenetics.com>.
I am glad to hear you got it working!  I encourage you to check out the
turbine-2-site source code from cvs and add your lessons learned to the
Extend-User Howto.  When you are finished, submit the patch to the
'turbine-2 -> documentation' module in Scarab.

CVS: http://jakarta.apache.org/site/cvsindex.html
SCARAB: http://scarab.werken.com/scarab/issues/

Thanks,

Chris

> -----Original Message-----
> From: malcolm cooke [mailto:malcolm.cooke@firstlightassociates.co.uk]
> Sent: Tuesday, November 19, 2002 6:15 AM
> To: Turbine Users List
> Subject: RE: Problems extending user as per how to (and previous
> messages)
>
>
> Thanks for the response Chris - it helped set me off looking at the right
> area to get it working.
>
> For the benefit of others here is a result of my findings.
>
...snip...


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Problems extending user as per how to (and previous messages)

Posted by malcolm cooke <ma...@firstlightassociates.co.uk>.
Thanks for the response Chris - it helped set me off looking at the right 
area to get it working.

For the benefit of others here is a result of my findings.

1. Because the foreign keys were not defined in the AGENT alias at all the 
generated BaseAgentPeer had numColumns set to 1, so that even though I'd 
defined the extra columns in TurbineUserAdaptor, although the correct SQL 
was being generated to get the information from the turbine user table they 
weren't being put into Perm correctly (that's my theory based on my limited 
knowledge). Once i changed the definition of AGENT in my xml schema as follows:
                 <column name="EO_ID" required="true" type="INTEGER"/>
                 <column name="ST_ID" required="true" type="INTEGER"/>
                 <foreign-key foreignTable="ORGANISATION">
                         <reference local="EO_ID" foreign="O_ID"/>
                 </foreign-key>
                 <foreign-key foreignTable="STATUS">
                         <reference local="ST_ID" foreign="ST_ID"/>
                 </foreign-key>

then BaseAgentPeer had the correct number of columns , and I could then 
retrieve the foreign key (eventually - see next comment:-))

2. The docs describing the creation of TurbineUserAdapter and 
TurbineUserPeerAdapter are not precise enough for when you want to set up 
something other than a straightforward column (or perhaps my reading is not 
deep enough - who knows). I had made a few errors here which I had to 
rectify before I could get it completely working.

2.1 Foreign Keys are not string values they are NumberKey values so when 
defining setter/getter must match accordingly.
2.2 I had a string constant referring to STATUS rather than the actual 
column name of ST_ID - perhaps my not quite understanding that there is a 
strict 1:1 with the table column names, and that getter and setter methods 
must follow the naming convention i.e for ST_ID it is getStId
2.3 had to reflect the changed method names introduced in 
TurbineUserAdaptor in TurbineUserPeerAdaptor.
2.4 Also had TurbineMapBuilderAdapter defined as a private in 
TurbineUserPeerAdapter - had to change to public.

3. TurbineMapBuilderAdapter
3.1 Changed method names to reflect thos in TurbineUserAdapter
3.2 Realised that the object being created had to represent the type of the 
columns they were going to be used with ie for a Foreign Key needed to use 
a NumberKey object.
3.3 Realised that for foreign keys that addForeignKey method is used 
instead of addColumn method for adding the foreign key columns to the map.

It may well be that this is all obvious if I'd looked properly - but I 
couldn't see it easily. At least I'll be able to get an early night tonight 
:-))

Malcolm

At 09:30 18/11/02 -0700, you wrote:

>Hi Malcolm.
>
>Gosh, you are really doing a lot of extending, and the problem could be just
>about anywhere.  I would suggest setting up some junit test cases and adding
>the extensions one-by-one, that is, adding a new extension only after the
>previous extension passes the test.  When you get to specific problem that
>you can't figure out, we will be much more likely to lead you in the right
>direction.
>
>Also, it is a good practice to write Services to wrap your OM layer instead
>of repeatedly using the Peers.  In this case, Turbine already provides a
>service, the TurbineSecurity Service:
>
>TurbineUserAdapter user =
>(TurbineUserAdapter)TurbineSecurity.get("username");
>assertEquals("Name","name",user.getFirstName());
>assertEquals("EoId","1",user.getEoId());
>
>Good luck,
>
>Chris
>
> > -----Original Message-----
> > From: malcolm cooke [mailto:malcolm.cooke@firstlightassociates.co.uk]
> > Sent: Monday, November 18, 2002 5:05 AM
> > To: Turbine Users List
> > Subject: Problems extending user as per how to (and previous messages)
> >
> >
> > Hi,
> > I am Using tdk 2.1.and trying to extend turbine_user as per the
> > how to and
> > have made patches to Object.vm as described in previous threads on this
> > subject. I am a newbie as far as turbine is concerned and any
> > help would be
> > appreciated.
> >
> > I have extended turbine user as per the how to  i.e
> >       <table name="TURBINE_USER" idMethod="idbroker">
> >               <column name="USER_ID" required="true"
> > primaryKey="true" type="INTEGER"/>
> >               <column name="EO_ID" required="true" type="INTEGER"/>
> >               <column name="ST_ID" required="true" type="INTEGER"/>
> >               <column name="LOGIN_NAME" required="true" size="32"
> > type="VARCHAR"/>
> >               <column name="PASSWORD_VALUE" required="true"
> > size="32" type="VARCHAR"/>
> >               <column name="FIRST_NAME" required="true" size="99"
> > type="VARCHAR"/>
> >               <column name="LAST_NAME" required="true" size="99"
> > type="VARCHAR"/>
> >               <column name="EMAIL" size="99" type="VARCHAR"/>
> >               <column name="CONFIRM_VALUE" size="99" type="VARCHAR"/>
> >               <column name="MODIFIED" type="TIMESTAMP"/>
> >               <column name="CREATED" type="TIMESTAMP"/>
> >               <column name="LAST_LOGIN" type="TIMESTAMP"/>
> >               <column name="NOTES" size="255" type="VARCHAR"/>
> >               <column name="OBJECTDATA" type="VARBINARY"/>
> >               <unique>
> >                       <unique-column name="LOGIN_NAME"/>
> >               </unique>
> >               <foreign-key foreignTable="ORGANISATION">
> >                       <reference local="EO_ID" foreign="O_ID"/>
> >               </foreign-key>
> >               <foreign-key foreignTable="STATUS">
> >                       <reference local="ST_ID" foreign="ST_ID"/>
> >               </foreign-key>
> >       </table>
> >
> > with amongst other things two foreign keys. My Agent table
> > definition is as
> > follows:
> >       <table name="AGENT" javaName="Agent" alias="TurbineUser"
> > baseClass="com.testthingy.test.om.TurbineUserAdapter"
> > basePeer="com.testthingy.test.om.TurbineUserPeerAdapter">
> >               <column name="USER_ID" primaryKey="true"
> > autoIncrement="true"
> > required="true" type="INTEGER"/>
> >       </table>
> >
> > I have created the TurbineUserAdapter with the following methods :
> >
> >   public void setEoId(NumberKey org)    {
> >          setPerm(EO_ID, org);
> >      }
> >
> >      public NumberKey getEoId()    {
> >          NumberKey tmp = null;
> >          try   {
> >              tmp = (NumberKey) getPerm(EO_ID);
> >          }
> >          catch ( Exception e )
> >          {
> >          }
> >          return tmp;
> >      }
> >
> > and TurbineUserAdapterPeer with
> >      public static final String EO_ID = mapBuilder.getUser_EoId(); in it.
> >
> > TurbineMapBuilderAdapter has the following:
> >
> >       public static String getEoId()    {
> >          return "EO_ID";
> >      }
> >
> >      public String getUser_EoId()    {
> >          return getTableUser() + '.' + getEoId();
> >      }
> >
> >
> > THE PROBLEM:
> > When I try to access the EO_ID column via the agent i.e
> >       NumberKey numkey = new NumberKey("0");
> >
> >          tester = AgentPeer.retrieveByPK(numkey);
> >          System.out.println("pk = " + tester.getUserId());
> >          System.out.println("name = " + tester.getFirstName());
> >          System.out.println("eoid = " + tester.getEoId());
> >
> > I get the User Id and the First name correctly , but it always
> > returns null
> > for getEoId(). Where am I going wrong?
> >
> > thanks
> >
> > Malcolm
> >
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.417 / Virus Database: 233 - Release Date: 08/11/02

strange error???

Posted by malcolm cooke <ma...@firstlightassociates.co.uk>.
Hi everyone,
I'm getting an odd error and I hope someone can cast some light on it for 
me. I have logged out of turbine (Using tdk 2.1 b.t.w)
and just leave the browser alone. This error then pops up which I guess 
must be being triggered by a timeout. What I don't really understand is why 
it is trying to do a user update to the DB. Nything to do with my extension 
to Turbine_user table?
Thanks

Malcolm

Closing XML-RPC server socket.
java.lang.NullPointerException
         at org.apache.turbine.om.peer.BasePeer.doUpdate(BasePeer.java:1635)
         at org.apache.turbine.om.peer.BasePeer.doUpdate(BasePeer.java:1578)
         at 
org.apache.turbine.om.security.peer.TurbineUserPeer.doUpdate(TurbineU
serPeer.java:463)
         at 
org.apache.turbine.services.security.db.DBUserManager.store(DBUserMan
ager.java:272)
rethrown as org.apache.turbine.util.security.DataBackendException: Failed 
to sav
e user object
         at 
org.apache.turbine.services.security.db.DBUserManager.store(DBUserMan
ager.java:276)
         at 
org.apache.turbine.services.security.BaseSecurityService.saveUser(Bas
eSecurityService.java:379)
         at 
org.apache.turbine.services.security.TurbineSecurity.saveUser(Turbine
Security.java:261)
         at 
org.apache.turbine.om.security.TurbineUser.valueUnbound(TurbineUser.j
ava:649)
         at 
org.apache.catalina.session.StandardSession.removeAttribute(StandardS
ession.java:953)
         at 
org.apache.catalina.session.StandardSession.expire(StandardSession.ja
va:551)
         at 
org.apache.catalina.session.StandardManager.unload(StandardManager.ja
va:541)
         at 
org.apache.catalina.session.StandardManager.stop(StandardManager.java
:648)
         at 
org.apache.catalina.core.StandardContext.reload(StandardContext.java:
2312)
         at 
org.apache.catalina.loader.ContextNotifier.run(StandardLoader.java:13
46)
         at java.lang.Thread.run(Thread.java:536)

RE: Problem writing to TURBINE_USER.OBJECTDATA

Posted by Mitch Christensen <mi...@informatixinc.com>.
This seems accurate as my initial tests do indicate that that the '4537'
number *is* the size of my user data.  If I manipulate the amount data
stored in user.perm, I can reduce this number.  When it drops below 4,000,
everything works fine.

I hate to nit-pick, but shouldn't the 4k limit apply to varchar2 fields,
*not* long raw. :)

If this is what is happening, then this means is that user.perm in 2.2b3 is
useless for anything larger than 4k.  A significant (read "showstopper") bug
IMO.  I'm not sure if the bug is in Turbine proper, Village or Torque, as
I'm a bit fuzzy on where one ends and the other begins.

I will test this against 2.2rc1 as soon as I get a chance.  In the meantime,
if anyone can think of a work around *other* than extending TurbineUser, I
would greatly appreciate it.

Thanks for the response Quinton.

-Mitch

-----Original Message-----
From: Quinton McCombs [mailto:qmccombs@nequalsone.com]
Sent: Monday, November 18, 2002 9:00 AM
To: Turbine Users List
Subject: Re: Problem writing to TURBINE_USER.OBJECTDATA


If my memory serves me correctly, it is because Village uses the
setString( data ) method on the prepared statement.  The JDBC driver has
an upper limit of data that it is willing to accept using setString().

I ran into this situation myself.  The way that I worked around it was
to extend TurbineUser.  I created more columns in the database table and
stopped using OBJECTDATA.


On Mon, 2002-11-18 at 10:44, Mitch Christensen wrote:
> Hey,
>
> I'm currently saving user preferences (10 key/value pairs), and some
> (~15-20) HashTables with about 7 key/val pairs each to user.setPerm().
This
> was working fine, but suddenly stopped working.  I noticed the following
> exception being thrown.
>
> The datatype for the OBJECTDATA column is LONG RAW, which supposedly
> supports up to 4gig of data.  I suspect that the '4537' number in the
> exception may be my actual data size.  If so, this if far from what I
would
> consider "excessive" for storage via setPerm().
>
> I really don't have time to crack the torque/village code right now, so
any
> pointers would be greatly appreciated.
>
> Any ideas?
>
> -Mitch
>
>
> java.sql.SQLException: Data size bigger than max size for this type: 4537
>         at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
>         at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
>         at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:99)
>         at
>
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1761)
>         at
>
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.j
> ava:855)
>         at
>
oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.
> java:1812)
>         at com.workingdogs.village.Value.setPreparedStatementValue(Unknown
> Source)
>         at com.workingdogs.village.Record.saveWithUpdate(Unknown Source)
>         at com.workingdogs.village.Record.save(Unknown Source)
>         at com.workingdogs.village.Record.save(Unknown Source)
>         at
> org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:891)
>         at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1812)
>         at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1711)
>         at
>
org.apache.turbine.om.security.peer.TurbineUserPeer.doUpdate(TurbineUserPeer
> .java:482)
>         at
>
org.apache.turbine.services.security.db.DBUserManager.store(DBUserManager.ja
> va:267)
>         at
>
org.apache.turbine.services.security.BaseSecurityService.saveUser(BaseSecuri
> tyService.java:374)
>         at
>
org.apache.turbine.services.security.TurbineSecurity.saveUser(TurbineSecurit
> y.java:256)
>         at
>
org.apache.turbine.om.security.TurbineUser.valueUnbound(TurbineUser.java:653
> )
>         at
> jrun.servlet.session.JRunSession.setAttribute(JRunSession.java:278)
>         at jrun.servlet.session.JRunSession.putValue(JRunSession.java:254)
>         at
>
org.apache.turbine.services.rundata.DefaultTurbineRunData.save(DefaultTurbin
> eRunData.java:1355)
>         at
>
org.apache.turbine.modules.actions.LogoutUser.doPerform(LogoutUser.java:118)
>         at org.apache.turbine.modules.Action.perform(Action.java:87)
>         at
> org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
>         at org.apache.turbine.Turbine.doGet(Turbine.java:509)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
>         at
> jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
>         at
> jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241)
>         at
> jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
>         at
jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
>         at
>
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:
> 348)
>         at
>
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451
> )
>         at
>
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:29
> 4)
>         at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
> rethrown as org.apache.torque.TorqueException: Data size bigger than max
> size for this type: 4537
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>Quinton McCombs<
Strategic Planner, NEqualsOne
 1800 International Park Drive
 Suite 205
 Birmingham, AL 35243
p: 205.324.8005 x121  800.466.1337
 f: 205.324.7008
e: qmccombs@NEqualsOne.com
 www.NEqualsOne.com



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Problem writing to TURBINE_USER.OBJECTDATA

Posted by Mitch Christensen <mi...@informatixinc.com>.
Just wanted to remind everyone before I completely move off of this issue,
that the reason for this bug is because Village is using non-streaming JDBC
calls for OBJECTDATA.

*****All data stored in Oracle (9i) via User.setPerm() will fail to persist
once the data size exceeds 4kbytes.*****

Any Oracle users out there using User.setPerm() beware.  This is one of
those "down the road" symptoms.

I made local change to the Village code to use streaming calls to overcome
the problem, and posted the solution to the Village and Turbine-User groups.

-Mitch

-----Original Message-----
From: Quinton McCombs [mailto:qmccombs@nequalsone.com]
Sent: Monday, November 18, 2002 9:00 AM
To: Turbine Users List
Subject: Re: Problem writing to TURBINE_USER.OBJECTDATA


If my memory serves me correctly, it is because Village uses the
setString( data ) method on the prepared statement.  The JDBC driver has
an upper limit of data that it is willing to accept using setString().

I ran into this situation myself.  The way that I worked around it was
to extend TurbineUser.  I created more columns in the database table and
stopped using OBJECTDATA.


On Mon, 2002-11-18 at 10:44, Mitch Christensen wrote:
> Hey,
>
> I'm currently saving user preferences (10 key/value pairs), and some
> (~15-20) HashTables with about 7 key/val pairs each to user.setPerm().
This
> was working fine, but suddenly stopped working.  I noticed the following
> exception being thrown.
>
> The datatype for the OBJECTDATA column is LONG RAW, which supposedly
> supports up to 4gig of data.  I suspect that the '4537' number in the
> exception may be my actual data size.  If so, this if far from what I
would
> consider "excessive" for storage via setPerm().
>
> I really don't have time to crack the torque/village code right now, so
any
> pointers would be greatly appreciated.
>
> Any ideas?
>
> -Mitch
>
>
> java.sql.SQLException: Data size bigger than max size for this type: 4537
>         at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
>         at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
>         at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:99)
>         at
>
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1761)
>         at
>
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.j
> ava:855)
>         at
>
oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.
> java:1812)
>         at com.workingdogs.village.Value.setPreparedStatementValue(Unknown
> Source)
>         at com.workingdogs.village.Record.saveWithUpdate(Unknown Source)
>         at com.workingdogs.village.Record.save(Unknown Source)
>         at com.workingdogs.village.Record.save(Unknown Source)
>         at
> org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:891)
>         at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1812)
>         at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1711)
>         at
>
org.apache.turbine.om.security.peer.TurbineUserPeer.doUpdate(TurbineUserPeer
> .java:482)
>         at
>
org.apache.turbine.services.security.db.DBUserManager.store(DBUserManager.ja
> va:267)
>         at
>
org.apache.turbine.services.security.BaseSecurityService.saveUser(BaseSecuri
> tyService.java:374)
>         at
>
org.apache.turbine.services.security.TurbineSecurity.saveUser(TurbineSecurit
> y.java:256)
>         at
>
org.apache.turbine.om.security.TurbineUser.valueUnbound(TurbineUser.java:653
> )
>         at
> jrun.servlet.session.JRunSession.setAttribute(JRunSession.java:278)
>         at jrun.servlet.session.JRunSession.putValue(JRunSession.java:254)
>         at
>
org.apache.turbine.services.rundata.DefaultTurbineRunData.save(DefaultTurbin
> eRunData.java:1355)
>         at
>
org.apache.turbine.modules.actions.LogoutUser.doPerform(LogoutUser.java:118)
>         at org.apache.turbine.modules.Action.perform(Action.java:87)
>         at
> org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
>         at org.apache.turbine.Turbine.doGet(Turbine.java:509)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
>         at
> jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
>         at
> jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241)
>         at
> jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
>         at
jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
>         at
>
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:
> 348)
>         at
>
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451
> )
>         at
>
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:29
> 4)
>         at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
> rethrown as org.apache.torque.TorqueException: Data size bigger than max
> size for this type: 4537
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>Quinton McCombs<
Strategic Planner, NEqualsOne
 1800 International Park Drive
 Suite 205
 Birmingham, AL 35243
p: 205.324.8005 x121  800.466.1337
 f: 205.324.7008
e: qmccombs@NEqualsOne.com
 www.NEqualsOne.com



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problem writing to TURBINE_USER.OBJECTDATA

Posted by Quinton McCombs <qm...@nequalsone.com>.
If my memory serves me correctly, it is because Village uses the
setString( data ) method on the prepared statement.  The JDBC driver has
an upper limit of data that it is willing to accept using setString().  

I ran into this situation myself.  The way that I worked around it was
to extend TurbineUser.  I created more columns in the database table and
stopped using OBJECTDATA.  


On Mon, 2002-11-18 at 10:44, Mitch Christensen wrote:
> Hey,
> 
> I'm currently saving user preferences (10 key/value pairs), and some
> (~15-20) HashTables with about 7 key/val pairs each to user.setPerm().  This
> was working fine, but suddenly stopped working.  I noticed the following
> exception being thrown.
> 
> The datatype for the OBJECTDATA column is LONG RAW, which supposedly
> supports up to 4gig of data.  I suspect that the '4537' number in the
> exception may be my actual data size.  If so, this if far from what I would
> consider "excessive" for storage via setPerm().
> 
> I really don't have time to crack the torque/village code right now, so any
> pointers would be greatly appreciated.
> 
> Any ideas?
> 
> -Mitch
> 
> 
> java.sql.SQLException: Data size bigger than max size for this type: 4537
>         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
>         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
>         at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:99)
>         at
> oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1761)
>         at
> oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.j
> ava:855)
>         at
> oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.
> java:1812)
>         at com.workingdogs.village.Value.setPreparedStatementValue(Unknown
> Source)
>         at com.workingdogs.village.Record.saveWithUpdate(Unknown Source)
>         at com.workingdogs.village.Record.save(Unknown Source)
>         at com.workingdogs.village.Record.save(Unknown Source)
>         at
> org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:891)
>         at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1812)
>         at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1711)
>         at
> org.apache.turbine.om.security.peer.TurbineUserPeer.doUpdate(TurbineUserPeer
> .java:482)
>         at
> org.apache.turbine.services.security.db.DBUserManager.store(DBUserManager.ja
> va:267)
>         at
> org.apache.turbine.services.security.BaseSecurityService.saveUser(BaseSecuri
> tyService.java:374)
>         at
> org.apache.turbine.services.security.TurbineSecurity.saveUser(TurbineSecurit
> y.java:256)
>         at
> org.apache.turbine.om.security.TurbineUser.valueUnbound(TurbineUser.java:653
> )
>         at
> jrun.servlet.session.JRunSession.setAttribute(JRunSession.java:278)
>         at jrun.servlet.session.JRunSession.putValue(JRunSession.java:254)
>         at
> org.apache.turbine.services.rundata.DefaultTurbineRunData.save(DefaultTurbin
> eRunData.java:1355)
>         at
> org.apache.turbine.modules.actions.LogoutUser.doPerform(LogoutUser.java:118)
>         at org.apache.turbine.modules.Action.perform(Action.java:87)
>         at
> org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
>         at org.apache.turbine.Turbine.doGet(Turbine.java:509)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
>         at
> jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
>         at
> jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241)
>         at
> jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
>         at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
>         at
> jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:
> 348)
>         at
> jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451
> )
>         at
> jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:29
> 4)
>         at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
> rethrown as org.apache.torque.TorqueException: Data size bigger than max
> size for this type: 4537
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>Quinton McCombs<
Strategic Planner, NEqualsOne
 1800 International Park Drive
 Suite 205 
 Birmingham, AL 35243
p: 205.324.8005 x121  800.466.1337
 f: 205.324.7008
e: qmccombs@NEqualsOne.com
 www.NEqualsOne.com



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Problem writing to TURBINE_USER.OBJECTDATA

Posted by Mitch Christensen <mi...@informatixinc.com>.
Hey,

I'm currently saving user preferences (10 key/value pairs), and some
(~15-20) HashTables with about 7 key/val pairs each to user.setPerm().  This
was working fine, but suddenly stopped working.  I noticed the following
exception being thrown.

The datatype for the OBJECTDATA column is LONG RAW, which supposedly
supports up to 4gig of data.  I suspect that the '4537' number in the
exception may be my actual data size.  If so, this if far from what I would
consider "excessive" for storage via setPerm().

I really don't have time to crack the torque/village code right now, so any
pointers would be greatly appreciated.

Any ideas?

-Mitch


java.sql.SQLException: Data size bigger than max size for this type: 4537
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
        at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:99)
        at
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1761)
        at
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.j
ava:855)
        at
oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.
java:1812)
        at com.workingdogs.village.Value.setPreparedStatementValue(Unknown
Source)
        at com.workingdogs.village.Record.saveWithUpdate(Unknown Source)
        at com.workingdogs.village.Record.save(Unknown Source)
        at com.workingdogs.village.Record.save(Unknown Source)
        at
org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:891)
        at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1812)
        at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1711)
        at
org.apache.turbine.om.security.peer.TurbineUserPeer.doUpdate(TurbineUserPeer
.java:482)
        at
org.apache.turbine.services.security.db.DBUserManager.store(DBUserManager.ja
va:267)
        at
org.apache.turbine.services.security.BaseSecurityService.saveUser(BaseSecuri
tyService.java:374)
        at
org.apache.turbine.services.security.TurbineSecurity.saveUser(TurbineSecurit
y.java:256)
        at
org.apache.turbine.om.security.TurbineUser.valueUnbound(TurbineUser.java:653
)
        at
jrun.servlet.session.JRunSession.setAttribute(JRunSession.java:278)
        at jrun.servlet.session.JRunSession.putValue(JRunSession.java:254)
        at
org.apache.turbine.services.rundata.DefaultTurbineRunData.save(DefaultTurbin
eRunData.java:1355)
        at
org.apache.turbine.modules.actions.LogoutUser.doPerform(LogoutUser.java:118)
        at org.apache.turbine.modules.Action.perform(Action.java:87)
        at
org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
        at org.apache.turbine.Turbine.doGet(Turbine.java:509)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
        at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
        at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241)
        at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
        at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
        at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:
348)
        at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451
)
        at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:29
4)
        at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
rethrown as org.apache.torque.TorqueException: Data size bigger than max
size for this type: 4537



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Problems extending user as per how to (and previous messages)

Posted by Chris K Chew <ch...@fenetics.com>.
Hi Malcolm.

Gosh, you are really doing a lot of extending, and the problem could be just
about anywhere.  I would suggest setting up some junit test cases and adding
the extensions one-by-one, that is, adding a new extension only after the
previous extension passes the test.  When you get to specific problem that
you can't figure out, we will be much more likely to lead you in the right
direction.

Also, it is a good practice to write Services to wrap your OM layer instead
of repeatedly using the Peers.  In this case, Turbine already provides a
service, the TurbineSecurity Service:

TurbineUserAdapter user =
(TurbineUserAdapter)TurbineSecurity.get("username");
assertEquals("Name","name",user.getFirstName());
assertEquals("EoId","1",user.getEoId());

Good luck,

Chris

> -----Original Message-----
> From: malcolm cooke [mailto:malcolm.cooke@firstlightassociates.co.uk]
> Sent: Monday, November 18, 2002 5:05 AM
> To: Turbine Users List
> Subject: Problems extending user as per how to (and previous messages)
>
>
> Hi,
> I am Using tdk 2.1.and trying to extend turbine_user as per the
> how to and
> have made patches to Object.vm as described in previous threads on this
> subject. I am a newbie as far as turbine is concerned and any
> help would be
> appreciated.
>
> I have extended turbine user as per the how to  i.e
> 	<table name="TURBINE_USER" idMethod="idbroker">
> 		<column name="USER_ID" required="true"
> primaryKey="true" type="INTEGER"/>
> 		<column name="EO_ID" required="true" type="INTEGER"/>
> 		<column name="ST_ID" required="true" type="INTEGER"/>
> 		<column name="LOGIN_NAME" required="true" size="32"
> type="VARCHAR"/>
> 		<column name="PASSWORD_VALUE" required="true"
> size="32" type="VARCHAR"/>
> 		<column name="FIRST_NAME" required="true" size="99"
> type="VARCHAR"/>
> 		<column name="LAST_NAME" required="true" size="99"
> type="VARCHAR"/>
> 		<column name="EMAIL" size="99" type="VARCHAR"/>
> 		<column name="CONFIRM_VALUE" size="99" type="VARCHAR"/>
> 		<column name="MODIFIED" type="TIMESTAMP"/>
> 		<column name="CREATED" type="TIMESTAMP"/>
> 		<column name="LAST_LOGIN" type="TIMESTAMP"/>
> 		<column name="NOTES" size="255" type="VARCHAR"/>
> 		<column name="OBJECTDATA" type="VARBINARY"/>
> 		<unique>
> 			<unique-column name="LOGIN_NAME"/>
> 		</unique>
> 		<foreign-key foreignTable="ORGANISATION">
> 			<reference local="EO_ID" foreign="O_ID"/>
> 		</foreign-key>
> 		<foreign-key foreignTable="STATUS">
> 			<reference local="ST_ID" foreign="ST_ID"/>
> 		</foreign-key>
> 	</table>
>
> with amongst other things two foreign keys. My Agent table
> definition is as
> follows:
> 	<table name="AGENT" javaName="Agent" alias="TurbineUser"
> baseClass="com.testthingy.test.om.TurbineUserAdapter"
> basePeer="com.testthingy.test.om.TurbineUserPeerAdapter">
> 		<column name="USER_ID" primaryKey="true"
> autoIncrement="true"
> required="true" type="INTEGER"/>
> 	</table>
>
> I have created the TurbineUserAdapter with the following methods :
>
>   public void setEoId(NumberKey org)    {
>          setPerm(EO_ID, org);
>      }
>
>      public NumberKey getEoId()    {
>          NumberKey tmp = null;
>          try   {
>              tmp = (NumberKey) getPerm(EO_ID);
>          }
>          catch ( Exception e )
>          {
>          }
>          return tmp;
>      }
>
> and TurbineUserAdapterPeer with
>      public static final String EO_ID = mapBuilder.getUser_EoId(); in it.
>
> TurbineMapBuilderAdapter has the following:
>
>       public static String getEoId()    {
>          return "EO_ID";
>      }
>
>      public String getUser_EoId()    {
>          return getTableUser() + '.' + getEoId();
>      }
>
>
> THE PROBLEM:
> When I try to access the EO_ID column via the agent i.e
>   	NumberKey numkey = new NumberKey("0");
>
>          tester = AgentPeer.retrieveByPK(numkey);
>          System.out.println("pk = " + tester.getUserId());
>          System.out.println("name = " + tester.getFirstName());
>          System.out.println("eoid = " + tester.getEoId());
>
> I get the User Id and the First name correctly , but it always
> returns null
> for getEoId(). Where am I going wrong?
>
> thanks
>
> Malcolm
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Problems extending user as per how to (and previous messages)

Posted by malcolm cooke <ma...@firstlightassociates.co.uk>.
Hi,
I am Using tdk 2.1.and trying to extend turbine_user as per the how to and 
have made patches to Object.vm as described in previous threads on this 
subject. I am a newbie as far as turbine is concerned and any help would be 
appreciated.

I have extended turbine user as per the how to  i.e
	<table name="TURBINE_USER" idMethod="idbroker">
		<column name="USER_ID" required="true" primaryKey="true" type="INTEGER"/>
		<column name="EO_ID" required="true" type="INTEGER"/>
		<column name="ST_ID" required="true" type="INTEGER"/>
		<column name="LOGIN_NAME" required="true" size="32" type="VARCHAR"/>
		<column name="PASSWORD_VALUE" required="true" size="32" type="VARCHAR"/>
		<column name="FIRST_NAME" required="true" size="99" type="VARCHAR"/>
		<column name="LAST_NAME" required="true" size="99" type="VARCHAR"/>
		<column name="EMAIL" size="99" type="VARCHAR"/>
		<column name="CONFIRM_VALUE" size="99" type="VARCHAR"/>
		<column name="MODIFIED" type="TIMESTAMP"/>
		<column name="CREATED" type="TIMESTAMP"/>
		<column name="LAST_LOGIN" type="TIMESTAMP"/>
		<column name="NOTES" size="255" type="VARCHAR"/>
		<column name="OBJECTDATA" type="VARBINARY"/>
		<unique>
			<unique-column name="LOGIN_NAME"/>
		</unique>
		<foreign-key foreignTable="ORGANISATION">
			<reference local="EO_ID" foreign="O_ID"/>
		</foreign-key>
		<foreign-key foreignTable="STATUS">
			<reference local="ST_ID" foreign="ST_ID"/>
		</foreign-key>
	</table>

with amongst other things two foreign keys. My Agent table definition is as 
follows:
	<table name="AGENT" javaName="Agent" alias="TurbineUser" 
baseClass="com.testthingy.test.om.TurbineUserAdapter" 
basePeer="com.testthingy.test.om.TurbineUserPeerAdapter">
		<column name="USER_ID" primaryKey="true" autoIncrement="true" 
required="true" type="INTEGER"/>		
	</table>

I have created the TurbineUserAdapter with the following methods :

  public void setEoId(NumberKey org)    {
         setPerm(EO_ID, org);
     }

     public NumberKey getEoId()    {
         NumberKey tmp = null;
         try   {
             tmp = (NumberKey) getPerm(EO_ID);
         }
         catch ( Exception e )
         {
         }
         return tmp;
     }

and TurbineUserAdapterPeer with
     public static final String EO_ID = mapBuilder.getUser_EoId(); in it.

TurbineMapBuilderAdapter has the following:

      public static String getEoId()    {
         return "EO_ID";
     }

     public String getUser_EoId()    {
         return getTableUser() + '.' + getEoId();
     }


THE PROBLEM:
When I try to access the EO_ID column via the agent i.e
  	NumberKey numkey = new NumberKey("0");

         tester = AgentPeer.retrieveByPK(numkey);
         System.out.println("pk = " + tester.getUserId());
         System.out.println("name = " + tester.getFirstName());
         System.out.println("eoid = " + tester.getEoId());

I get the User Id and the First name correctly , but it always returns null 
for getEoId(). Where am I going wrong?

thanks

Malcolm

Re: is it possible to distinguish new and old Groups in intake?

Posted by Neil Stevens <ne...@firstlightassociates.co.uk>.
To answer my own question - No, you don't get it. The behaviour you are
after is already built into the group class.

You just use $intake.InvoiceLine.mapto( bean ).
The bean is asked for its query key, which by default returns the primary
key, then if the group exists, it is retrieved, and will deliver its
existing values when asked, otherwise a new one is created, in which case
the beans properties are delivered.

So the correct code is :-

#foreach ( $line in $invoice.getLines() )
     #set $lineGroup = $intake.InvoiceLine.mapto( $line )

     #textfield ( $LineGroup.ProdCode.Key $LineGroup.ProdCode )
     #showError ( $LineGroup.ProdCode.isValid()
$LineGroup.ProdCode.getMessage() )
     ...etc
#end

However in my screen, I want a new empty line at the end of the table so I
add :-


#set ( $newLineGroup = $intake.InvoiceLine.Default )
#textfield ( $newLineGroup.ProdCode.Key $newLineGroup.ProdCode )
#showError ( $newLineGroup.ProdCode.isValid()
$newLineGroup.ProdCode.getMessage() )
     ...etc

This allows the user to add a new Invoice line, and it work fine,
mostly!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Sometimes, the line gets data in it from previous requests
AAAAAAAGGGGGGGHHHHHHH!!!!!!!!!!!!!

This happens even when I have been to another non-intake page inbetween.
When I do a browser refresh, the phantom data disappears.

I have put a bit of debug in IntakeTool.PullHelper.getDefault, and the data
is coming from there, not the browser, or something.

This same effect occasionaly turns up in the action also, when the user has
not added any data to the new line.
There is a clue here though - doing getValue( "ProdCode" ) returns 'abc',
but when you setProprties( aBean ) 'abc' is not set in the bean!!!!

I assume this is to do with pooling of objects, and failing to fully
reinitialize them on reuse???

Any help would be greatly welcomed - I really have put in the hours on this,
and I have read all the how to's, and searched the archives, and read the
source code....


Neil




----- Original Message -----
From: "Neil Stevens" <ne...@firstlightassociates.co.uk>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Saturday, November 16, 2002 12:49 AM
Subject: is it possible to distinguish new and old Groups in intake?


> I am doing my first project with Turbine, and Intake is giving me hell,
but
> I think I get it now, but anyway judge for yourself from this question :-
>
> If I am displaying an invoice and invoice lines on a single page, and
> allowing enterable fields throughout, I may do something like :-
>
> #foreach ( $line in $invoice.getLines() )
>     #set $lineGroup = $intake.get( "InvoiceLine", $line.lineNo )
>
>     #if ( !$redisplay )
>         $lineGroup.init($line)
>     #end
>
>     #textfield ( $LineGroup.ProdCode.Key $LineGroup.ProdCode )
>     #showError ( $LineGroup.ProdCode.isValid()
> $LineGroup.ProdCode.getMessage() )
>     ...etc
> #end
>
>
> I only set $redisplay in the preceding action (if there has been one) if
> validation fails, so they see their data unchanged. On the first visit to
> the screen the groups are all initialized, as redisplay is not there.
>
> But I would really like to get rid of 'redisplay' and put:-
>
> #if ( !$lineGroup.isInitialized() )
>
> this would tell me if the group had been constructed from parameters or
just
> plucked from the pool or whatever.
> .
> This has the advantage that if a new invoice line has been added by user
B,
> whilst user A was slowly entering some invalid data, then the new line
would
> appear and be displayed correctly
> together with the invalid lines, and their error messages.
>
> Is it possible to perform such as test?
>
> I thought of maybe writing a macro that first tried an  $intake.get(
> "InvoiceLine", $line.lineNo, false ) and if the result was null, then set
a
> flag and then  $intake.get( "InvoiceLine", $line.lineNo, true ) to return
> the group. Maybe I could pass in the name of the flag to the macro ....?
>
> Anyway, any advice would be much appreciated.
>
> N
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


is it possible to distinguish new and old Groups in intake?

Posted by Neil Stevens <ne...@firstlightassociates.co.uk>.
I am doing my first project with Turbine, and Intake is giving me hell, but
I think I get it now, but anyway judge for yourself from this question :-

If I am displaying an invoice and invoice lines on a single page, and
allowing enterable fields throughout, I may do something like :-

#foreach ( $line in $invoice.getLines() )
    #set $lineGroup = $intake.get( "InvoiceLine", $line.lineNo )

    #if ( !$redisplay )
        $lineGroup.init($line)
    #end

    #textfield ( $LineGroup.ProdCode.Key $LineGroup.ProdCode )
    #showError ( $LineGroup.ProdCode.isValid()
$LineGroup.ProdCode.getMessage() )
    ...etc
#end


I only set $redisplay in the preceding action (if there has been one) if
validation fails, so they see their data unchanged. On the first visit to
the screen the groups are all initialized, as redisplay is not there.

But I would really like to get rid of 'redisplay' and put:-

#if ( !$lineGroup.isInitialized() )

this would tell me if the group had been constructed from parameters or just
plucked from the pool or whatever.
.
This has the advantage that if a new invoice line has been added by user B,
whilst user A was slowly entering some invalid data, then the new line would
appear and be displayed correctly
together with the invalid lines, and their error messages.

Is it possible to perform such as test?

I thought of maybe writing a macro that first tried an  $intake.get(
"InvoiceLine", $line.lineNo, false ) and if the result was null, then set a
flag and then  $intake.get( "InvoiceLine", $line.lineNo, true ) to return
the group. Maybe I could pass in the name of the flag to the macro ....?

Anyway, any advice would be much appreciated.

N


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Can some intake fileds have no mapToProperty

Posted by Neil Stevens <ne...@firstlightassociates.co.uk>.
Many thanks, that seems to work fine, whereas leaving out the mapToProperty
attribute, did not.

N
----- Original Message -----
From: "George Clernon" <ge...@analog.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Thursday, November 14, 2002 6:52 PM
Subject: Re: Can some intake fileds have no mapToProperty


>
> If you do not want the field to map to any property object use:
>
>   mapToProperty=""
>
>
> -George.
>
>
> On Thursday 14 November 2002 18:12, you wrote:
> > Write accessor methods in your class to handle the Delete boolean
> > flag.  In your action class, you can add logic to delete the record
> > after the form is mapped to the intake object.  This way intake
> > easily maps the checkbox for processing purposes, but doesn't
> > really affect your object.
> >
> > For the multiple records/rows, you just repeat the $intake.mapTo()
> > in your template, and the form processing in your action.  You have
> > to supply an array form field outside of intake that contains the
> > querykey's for the records to be processed.  I am pretty sure you
> > can find more detail about this in the turbine-user archives.
> >
> > Chris
> >
> > > -----Original Message-----
> > > From: Neil Stevens
> > > [mailto:neil.stevens@firstlightassociates.co.uk] Sent: Thursday,
> > > November 14, 2002 5:20 AM
> > > To: Turbine Users List
> > > Subject: Can some intake fileds have no mapToProperty
> > >
> > >
> > > Hi,
> > >
> > > Do all fields in a group have to be mapped? I added a 'Delete'
> > > (boolean) unmapped field to my group, without setting the
> > > mapToProperty, but I get an
> > > error :-
> > >
> > > ERROR -- Property, Delete for class, ....PriceCategoryLevel could
> > > not be found in the turbine log. I don't want this field mapped!
> > >
> > > I am just trying to have multiple rows in one form of a table
> > > that can all be updated or deleted in one hit.
> > >
> > > Should this have worked ?
> > >
> > > Neil
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Can some intake fileds have no mapToProperty

Posted by George Clernon <ge...@analog.com>.
If you do not want the field to map to any property object use: 

  mapToProperty=""


-George.


On Thursday 14 November 2002 18:12, you wrote:
> Write accessor methods in your class to handle the Delete boolean
> flag.  In your action class, you can add logic to delete the record
> after the form is mapped to the intake object.  This way intake
> easily maps the checkbox for processing purposes, but doesn't
> really affect your object.
>
> For the multiple records/rows, you just repeat the $intake.mapTo()
> in your template, and the form processing in your action.  You have
> to supply an array form field outside of intake that contains the
> querykey's for the records to be processed.  I am pretty sure you
> can find more detail about this in the turbine-user archives.
>
> Chris
>
> > -----Original Message-----
> > From: Neil Stevens
> > [mailto:neil.stevens@firstlightassociates.co.uk] Sent: Thursday,
> > November 14, 2002 5:20 AM
> > To: Turbine Users List
> > Subject: Can some intake fileds have no mapToProperty
> >
> >
> > Hi,
> >
> > Do all fields in a group have to be mapped? I added a 'Delete'
> > (boolean) unmapped field to my group, without setting the
> > mapToProperty, but I get an
> > error :-
> >
> > ERROR -- Property, Delete for class, ....PriceCategoryLevel could
> > not be found in the turbine log. I don't want this field mapped!
> >
> > I am just trying to have multiple rows in one form of a table
> > that can all be updated or deleted in one hit.
> >
> > Should this have worked ?
> >
> > Neil
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Can some intake fileds have no mapToProperty

Posted by Chris K Chew <ch...@fenetics.com>.
Write accessor methods in your class to handle the Delete boolean flag.  In
your action class, you can add logic to delete the record after the form is
mapped to the intake object.  This way intake easily maps the checkbox for
processing purposes, but doesn't really affect your object.

For the multiple records/rows, you just repeat the $intake.mapTo() in your
template, and the form processing in your action.  You have to supply an
array form field outside of intake that contains the querykey's for the
records to be processed.  I am pretty sure you can find more detail about
this in the turbine-user archives.

Chris

> -----Original Message-----
> From: Neil Stevens [mailto:neil.stevens@firstlightassociates.co.uk]
> Sent: Thursday, November 14, 2002 5:20 AM
> To: Turbine Users List
> Subject: Can some intake fileds have no mapToProperty
>
>
> Hi,
>
> Do all fields in a group have to be mapped? I added a 'Delete' (boolean)
> unmapped field to my group, without setting the mapToProperty,
> but I get an
> error :-
>
> ERROR -- Property, Delete for class, ....PriceCategoryLevel could not be
> found in the turbine log. I don't want this field mapped!
>
> I am just trying to have multiple rows in one form of a table that can all
> be updated or deleted in one hit.
>
> Should this have worked ?
>
> Neil
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Can some intake fileds have no mapToProperty

Posted by "Dan K." <da...@YorkU.CA>.
Hi,

Yes it should work.  I have an object that is populated by a few forms
one after another, each form populating a few attributes at a time.  So it
should work for you too.  Have you checked the intake how-to and ensure
you got he syntaxes and stuff correct?

On Thu, 14 Nov 2002, Neil Stevens wrote:

> Hi,
>
> Do all fields in a group have to be mapped? I added a 'Delete' (boolean)
> unmapped field to my group, without setting the mapToProperty, but I get an
> error :-
>
> ERROR -- Property, Delete for class, ....PriceCategoryLevel could not be
> found in the turbine log. I don't want this field mapped!
>
> I am just trying to have multiple rows in one form of a table that can all
> be updated or deleted in one hit.
>
> Should this have worked ?
>
> Neil
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>