Geert,
I am clear on the element definition (in the sites xml) and
implementation (in java) and my template here is actually quite
similar to the one you have linked to; Pasted below is my form
(login/form.html), which is included in the overrall login template
(login/login.html)
<!--I 'common.error_area' /-->
<form name="profile" action="[!V 'SUBMISSION:FORM:authenticate'/]"
method="post">
<!--V 'SUBMISSION:PARAMS:authenticate'/-->
<div class="login">
<div class="form_field">
<div>
<div [!V 'MARK:username'][!/V]>
<!--V 'ERRORS:username'--><!--/V-->
<label
for="username"><strong>Username</strong>:</label>
<!--V 'FORM:INPUT:username'-->id="username"
size="15"<!--/V-->
</div>
</div>
</div>
<div class="form_field">
<div>
<div [!V 'MARK:password'][!/V]>
<!--V 'ERRORS:password'--><!--/V-->
<label
for="password"><strong>Password</strong>:</label>
<!--V 'FORM:SECRET:password'-->id="password"
size="20"<!--/V-->
</div>
</div>
</div>
<div class="form_field">
<div>
<div [!V 'MARK:remember'][!/V]>
<!--V 'ERRORS:remember'--><!--/V-->
<!--V
'FORM:CHECKBOX:remember'-->id="remember"<!--/V-->
<label for="remember"><strong>Remeber
me</strong></label>
</div>
</div>
</div>
<p> </p>
<div class="form_field">
<p><input type="submit" value="Login"></p>
</div>
</div>
<script>
<!--
document.getElementById('username').focus();
-->
</script>
</form>
The element I pasted in my initial email is the definition that is in
the sites.xml file... I am sure extending DatabaseAuthenticated does
some behind the scenes work for me; what I am not sure about is
_exactly_ what it does and how it does that.
Below is a skeleton of my Login.java file
public class Login extends DatabaseAuthenticated {
public static final String TEMPLATE = "login.Login";
public static final String DATASOURCE = "datasource";
private Template tt;
@Override
protected void validatedCredentials(Credentials credentials) {
super.validatedCredentials(credentials);
}
@Override
protected void authenticated(long userId) {
super.authenticated(userId);
}
@Override
public boolean childTriggered(String name, String[] values) {
return super.childTriggered(name, values);
}
@Override
protected void entrance(Template template) {
super.entrance(template);
}
@Override
protected void initializeAuthentication() {
super.initializeAuthentication();
}
@Override
public void processElement() {
super.processElement();
}
}
Thanks,
Emmanuel
On 11/9/05, Geert Bevin <[EMAIL PROTECTED]> wrote:
> Hi Emmanuel,
>
> you get the Element implementation and the template confused. The
> Element implementation is written in Java and is similar to action
> classes in other frameworks, the templates just contain regular (X)
> HTML for the presentation. All you need to do here is provide an
> XHTML file with the expected tags.
>
> This is detailed here:
> http://rifers.org/docs/usersguide/ch08s03.html
>
> This is however an old way of doing so and someone should update the
> Users Guide.
>
> You can find a better template example that uses error messages,
> marking and form building here:
> https://svn.rifers.org/rife-jumpstart/trunk/src/templates/
> authentication/admin.html
>
> Hope this helps.
>
> Best regards,
>
> Geert
>
> > I am trying to follow along with the Authentication tutorial in the
> > userguide, but it is not at all clear.
> >
> > here are the steps I have taken:
> >
> > 1// I have created an element ided as LOGIN in my main.xml site
> > file as:
> >
> > <element id="LOGIN"
> > extends="rife/authenticated/database.xml"
> > implementation="foo.Login">
> > <property name="role">user</property>
> > <property name="datasource"><config param="datasource"
> > /></property>
> > <property name="password_encryption">SHA</property>
> > <property name="template_name">login.Login</property>
> > <property name="authvar_type">cookie</property>
> >
> > <submission name="authenticate">
> > <param name="username" />
> > <param name="password" />
> > <param name="remember" />
> > </submission>
> >
> > <incookie name="rememberid"/>
> > <outcookie name="rememberid"/>
> >
> > <childtrigger name="authid"/>
> > </element>
> >
> > 2// As you can see from the template_name param, I have a template
> > called Login under the login folder which has the necessary text input
> > controls for username/password... wich will be implemented in the
> > foo.Login class
> >
> > 3// I have created the Login class which extends DatabaseAuthenticated
> >
> > 4// Up till now, all my template implementations follow the format set
> > forth in the simple blog tutorial... that is, i implemente
> > initialize(), processElement(), and various doXXX methods; the
> > authentication tutorial seems to point to a childTriggered() method,
> > and I am wondering how this fits in.
> >
> > I'm I on the right path? any pointers?
> >
> > Thanks,
> > Emmanuel
> > _______________________________________________
> > Rife-users mailing list
> > [email protected]
> > http://www.uwyn.com/mailman/listinfo/rife-users
> >
>
> --
> Geert Bevin Uwyn bvba
> "Use what you need" Avenue de Scailmont 34
> http://www.uwyn.com 7170 Manage, Belgium
> gbevin[remove] at uwyn dot com Tel +32 64 84 80 03
>
> PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9
> Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net
>
>
> _______________________________________________
> Rife-users mailing list
> [email protected]
> http://www.uwyn.com/mailman/listinfo/rife-users
>
_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users