You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Zamek <za...@vili.pmmf.hu> on 2003/03/01 15:54:31 UTC
I don't understand working of intake
Hi All,
I read intake service and howto documentation, but I need some codes
forexample an user registration.
There are two mode of operations: insert or modify
In insert there is no business object (null), the form code is following:
<form method="post"
action="$link.setPage('UserForm.vm').setAction('UsrAction')">
#if ($uid != 0) ## modify
#set ($itUser = $intake.User.mapTo($user))
## modified business object (ExtendedUser)
#else ## new user registration
#set ($itUser = $intake.User.Default )
#end
...
#if( ! $itUser.Email.isValid())
#errorMsg($itUSer.Email.Message)<br>
#formLabel("e-mail")
<td><input type="text" name="$itUser.Email.Key" value="$itUser.Email"></td>
ok, it seems to be good, but
1. when I register a new user and I fill a wrong email value, I get an intake
error message, but the value is empty! Generated html is:
<input type="text" size="30" name="usr_0umail" value="">
Why it clear presetting value?
2. If I modifiy user's values there is a wrong fieldname in the generated
html:
<input type="text" size="30" name="usrnullumail"
value="hallgato@vili.pmmf.hu">
What is usrnullumail instead of usr_0umail?
intake.xml is:
<group name="User" key="usr" mapToObject="vili.om.ExtendedUser">
<field name="Email" key="umail" type="String" mapToProperty="Email">
<rule name="required" value="true">fieldCannotEmpty</rule>
<rule name="maxLength" value="99">fieldLenMax99</rule>
<rule name="mask" value="^.+@.+\..+">emailFormatError</rule>
</field>
...
</group>
--
thx a lot,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: I don't understand working of intake
Posted by Zamek <za...@vili.pmmf.hu>.
Oh my God, that was the solution! I note that it is not in intake service
documents. :-)
thank you for your help.
at 2003. március 1. 20:45 wrote:
> > and I don't know do I have to use setQueryKey in velocity form, or it
> > automatic.
>
> the difference between calling the insert und update methods is :
> IntakeTool intake = (IntakeTool) context.get("intake");
> Group group = intake.get(intakeTable,
> data.getParameters().getString("id"));
> when you call the update, so your html should be usr55umail if your usr PK
> is 55.
> in your case the getQueryKey is returning null instead of the PK.
> looking at your code, it seems to me that you implemented the Retrievable
> interface manually, if it is generated to you by Torque,
> you should have it in the abstract base class and it should look like that:
> public String getQueryKey()
> {
> if (getPrimaryKey() == null)
> {
> return "";
> }
> else
> {
> return getPrimaryKey().toString();
> }
> }
> /**
> * set an id that differentiates this object from others
> * of its class.
> */
> public void setQueryKey(String key) throws TorqueException
> {
> setPrimaryKey(key);
> }
> hope that helps
Absolutely, many thanks to you.
--
bye,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: I don't understand working of intake
Posted by Akmal Sarhan <as...@byteaction.de>.
> and I don't know do I have to use setQueryKey in velocity form, or it
> automatic.
the difference between calling the insert und update methods is :
IntakeTool intake = (IntakeTool) context.get("intake");
Group group = intake.get(intakeTable, data.getParameters().getString("id"));
when you call the update, so your html should be usr55umail if your usr PK
is 55.
in your case the getQueryKey is returning null instead of the PK.
looking at your code, it seems to me that you implemented the Retrievable
interface manually, if it is generated to you by Torque,
you should have it in the abstract base class and it should look like that:
public String getQueryKey()
{
if (getPrimaryKey() == null)
{
return "";
}
else
{
return getPrimaryKey().toString();
}
}
/**
* set an id that differentiates this object from others
* of its class.
*/
public void setQueryKey(String key) throws TorqueException
{
setPrimaryKey(key);
}
hope that helps
Akmal
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: I don't understand working of intake
Posted by Zamek <za...@vili.pmmf.hu>.
at 2003. március 1. 19:46 wrote:
> > Hi All,
> >
> > I read intake service and howto documentation, but I need some codes
> > forexample an user registration.
> >
> > There are two mode of operations: insert or modify
> >
> > In insert there is no business object (null), the form code is following:
> >
> > <form method="post"
> > action="$link.setPage('UserForm.vm').setAction('UsrAction')">
> > #if ($uid != 0) ## modify
> > #set ($itUser = $intake.User.mapTo($user))
> > ## modified business object (ExtendedUser)
> > #else ## new user registration
> > #set ($itUser = $intake.User.Default )
> > #end
> > ...
> > #if( ! $itUser.Email.isValid())
> > #errorMsg($itUSer.Email.Message)<br>
> > #formLabel("e-mail")
> > <td><input type="text" name="$itUser.Email.Key"
>
> value="$itUser.Email"></td>
>
> > ok, it seems to be good, but
> > 1. when I register a new user and I fill a wrong email value, I get an
>
> intake
>
> > error message, but the value is empty! Generated html is:
> > <input type="text" size="30" name="usr_0umail" value="">
> > Why it clear presetting value?
>
> there is somewhere a patch dealing with this issue, you will have to search
> the mailing list for it.
>
> > 2. If I modifiy user's values there is a wrong fieldname in the generated
> > html:
> > <input type="text" size="30" name="usrnullumail"
> > value="hallgato@vili.pmmf.hu">
> > What is usrnullumail instead of usr_0umail?
>
> is your Object implementing Retrievable interface ?
> regards Akmal
yes, it is, but I don't know what I have to do in set/getQueryKey:
public class Student extends com.zamek.vili.om.BaseStudent
implements Persistent, Retrievable {
private String key;
public void setQueryKey(String newKey) {
this.key = newKey;
}
public String getQueryKey () {
return key;
}
}
and I don't know do I have to use setQueryKey in velocity form, or it
automatic.
--
thx,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: I don't understand working of intake
Posted by Akmal Sarhan <as...@byteaction.de>.
----- Original Message -----
From: "Zamek" <za...@vili.pmmf.hu>
To: "turbine-user" <tu...@jakarta.apache.org>
Sent: Saturday, March 01, 2003 3:54 PM
Subject: I don't understand working of intake
> Hi All,
>
> I read intake service and howto documentation, but I need some codes
> forexample an user registration.
>
> There are two mode of operations: insert or modify
>
> In insert there is no business object (null), the form code is following:
>
> <form method="post"
> action="$link.setPage('UserForm.vm').setAction('UsrAction')">
> #if ($uid != 0) ## modify
> #set ($itUser = $intake.User.mapTo($user))
> ## modified business object (ExtendedUser)
> #else ## new user registration
> #set ($itUser = $intake.User.Default )
> #end
> ...
> #if( ! $itUser.Email.isValid())
> #errorMsg($itUSer.Email.Message)<br>
> #formLabel("e-mail")
> <td><input type="text" name="$itUser.Email.Key"
value="$itUser.Email"></td>
>
> ok, it seems to be good, but
> 1. when I register a new user and I fill a wrong email value, I get an
intake
> error message, but the value is empty! Generated html is:
> <input type="text" size="30" name="usr_0umail" value="">
> Why it clear presetting value?
there is somewhere a patch dealing with this issue, you will have to search
the mailing list for it.
> 2. If I modifiy user's values there is a wrong fieldname in the generated
> html:
> <input type="text" size="30" name="usrnullumail"
> value="hallgato@vili.pmmf.hu">
> What is usrnullumail instead of usr_0umail?
is your Object implementing Retrievable interface ?
regards Akmal
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
password expires
Posted by Bruce Altner <ba...@hq.nasa.gov>.
Greetings:
The out-of-the-box user creation process for Turbine 2.1 applications
includes a "Password Expires" checkbox. I've looked at the flux actions
behind user management and cannot see where this is ever used. Is it? If
so, what is the time before passwords expire and where is this set?
Thanks,
bruce
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org