tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Howard Lewis Ship <hls...@gmail.com>
Subject Re: [13/13] git commit: TAP5-2153 Adapt quickstart archetype generated sources to be bootstrap and 5.4 compatibile login page (simulated) and page for 404 error handling
Date Thu, 01 Aug 2013 21:00:20 GMT
Care to post or tweet a screenshot of what it looks like with the new
archetype?


On Thu, Aug 1, 2013 at 7:52 AM, <mlusetti@apache.org> wrote:

> TAP5-2153 Adapt quickstart archetype generated sources to be bootstrap and
> 5.4 compatibile
> login page (simulated) and page for 404 error handling
>
>
> Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
> Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/4489a8a4
> Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/4489a8a4
> Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/4489a8a4
>
> Branch: refs/heads/master
> Commit: 4489a8a4b3c7be9577dbb42ffd54bd68d8c4e537
> Parents: c641d82
> Author: Massimo Lusetti <mlusetti@apache.org>
> Authored: Thu Aug 1 16:33:55 2013 +0200
> Committer: Massimo Lusetti <mlusetti@apache.org>
> Committed: Thu Aug 1 16:33:55 2013 +0200
>
> ----------------------------------------------------------------------
>  .../src/main/java/pages/Error404.java           |  6 ++
>  .../src/main/java/pages/Login.java              | 61 ++++++++++++++++++++
>  .../src/main/resources/pages/Error404.tml       | 11 ++++
>  .../src/main/resources/pages/Login.tml          | 16 +++++
>  4 files changed, 94 insertions(+)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4489a8a4/quickstart/filtered/archetype-resources/src/main/java/pages/Error404.java
> ----------------------------------------------------------------------
> diff --git
> a/quickstart/filtered/archetype-resources/src/main/java/pages/Error404.java
> b/quickstart/filtered/archetype-resources/src/main/java/pages/Error404.java
> new file mode 100644
> index 0000000..bbf51a4
> --- /dev/null
> +++
> b/quickstart/filtered/archetype-resources/src/main/java/pages/Error404.java
> @@ -0,0 +1,6 @@
> +package ${package}.pages;
> +
> +public class Error404
> +{
> +
> +}
>
>
> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4489a8a4/quickstart/filtered/archetype-resources/src/main/java/pages/Login.java
> ----------------------------------------------------------------------
> diff --git
> a/quickstart/filtered/archetype-resources/src/main/java/pages/Login.java
> b/quickstart/filtered/archetype-resources/src/main/java/pages/Login.java
> new file mode 100644
> index 0000000..fad2ac4
> --- /dev/null
> +++
> b/quickstart/filtered/archetype-resources/src/main/java/pages/Login.java
> @@ -0,0 +1,61 @@
> +package ${package}.pages;
> +
> +import org.apache.tapestry5.alerts.AlertManager;
> +import org.apache.tapestry5.annotations.InjectComponent;
> +import org.apache.tapestry5.annotations.InjectPage;
> +import org.apache.tapestry5.annotations.Property;
> +import org.apache.tapestry5.corelib.components.Form;
> +import org.apache.tapestry5.corelib.components.PasswordField;
> +import org.apache.tapestry5.corelib.components.TextField;
> +import org.apache.tapestry5.ioc.annotations.Inject;
> +import org.slf4j.Logger;
> +
> +public class Login
> +{
> +       @Inject
> +       private Logger logger;
> +
> +       @Inject
> +       private AlertManager alertManager;
> +
> +       @InjectComponent
> +       private Form login;
> +       @InjectComponent
> +       private TextField email;
> +       @InjectComponent
> +       private PasswordField password;
> +
> +       @InjectPage
> +       private Index index;
> +
> +       @Property
> +       private String emailValue;
> +       @Property
> +       private String passwordValue;
> +
> +
> +
> +       void onValidateFromLogin()
> +       {
> +               if ( !emailValue.equals("users@tapestry.apache.org"))
> +                       login.recordError(email, "Try with user:
> users@tapestry.apache.org");
> +
> +               if ( !passwordValue.equals("Tapestry5"))
> +                       login.recordError(password, "Try with password:
> Tapestry5");
> +       }
> +
> +       Object onSuccessFromLogin()
> +       {
> +               logger.info("Login successful!");
> +               alertManager.success("Welcome aboard!");
> +
> +               return index;
> +       }
> +
> +       void onFailureFromLogin()
> +       {
> +               logger.warn("Login error!");
> +               alertManager.error("I'm sorry but I can't log you in!");
> +       }
> +
> +}
> \ No newline at end of file
>
>
> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4489a8a4/quickstart/filtered/archetype-resources/src/main/resources/pages/Error404.tml
> ----------------------------------------------------------------------
> diff --git
> a/quickstart/filtered/archetype-resources/src/main/resources/pages/Error404.tml
> b/quickstart/filtered/archetype-resources/src/main/resources/pages/Error404.tml
> new file mode 100644
> index 0000000..2c184e9
> --- /dev/null
> +++
> b/quickstart/filtered/archetype-resources/src/main/resources/pages/Error404.tml
> @@ -0,0 +1,11 @@
> +<html t:type="layout" title="Not found ${artifactId}"
> +      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
> +      xmlns:p="tapestry:parameter">
> +
> +    <div class="row">
> +        <div class="span12">
> +            <h1>Requested page not found!</h1>
> +        </div>
> +    </div>
> +
> +</html>
>
>
> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4489a8a4/quickstart/filtered/archetype-resources/src/main/resources/pages/Login.tml
> ----------------------------------------------------------------------
> diff --git
> a/quickstart/filtered/archetype-resources/src/main/resources/pages/Login.tml
> b/quickstart/filtered/archetype-resources/src/main/resources/pages/Login.tml
> new file mode 100644
> index 0000000..fe2a914
> --- /dev/null
> +++
> b/quickstart/filtered/archetype-resources/src/main/resources/pages/Login.tml
> @@ -0,0 +1,16 @@
> +<html t:type="layout" title="${artifactId} com.example"
> +      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
> +      xmlns:p="tapestry:parameter">
> +
> +<div class="row">
> +    <div class="span4 offset3">
> +        <t:form t:id="login" class="form-signin">
> +            <h2 class="form-signin-heading">Please sign in</h2>
> +            <t:textfield t:id="email" value="emailValue"
> class="input-block-level" validate="required" placeholder="Email address" />
> +            <t:passwordfield t:id="password" value="passwordValue"
> class="input-block-level" validate="required" placeholder="Password" />
> +            <t:submit class="btn btn-large btn-primary" value="Sign in" />
> +        </t:form>
> +    </div>
> +</div>
> +
> +</html>
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message