Skip to content

Commit

Permalink
updated JapidContact app to use the latest japid, using the
Browse files Browse the repository at this point in the history
dependencies.yml.
  • Loading branch information
branaway committed Jul 17, 2014
1 parent aceb528 commit a2e99dd
Show file tree
Hide file tree
Showing 65 changed files with 1,209 additions and 2,033 deletions.
5 changes: 0 additions & 5 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
Expand Down
6 changes: 3 additions & 3 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand Down Expand Up @@ -71,4 +71,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.source=1.6
8 changes: 5 additions & 3 deletions JapidContact/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<classpathentry excluding="views/**" kind="src" path="app"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="src" path="docviewer"/>

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/Users/bran/projects/play-git/framework/play-1.2.6-jdk8-1.4.1-2-ga81da9d.jar" sourcepath="/Users/bran/projects/play-git/framework/src"/>
<classpathentry kind="lib" path="/Users/bran/projects/play-git/framework/play-1.2.6-jdk8-1.4.1-2-ga81da9d.jar" sourcepath="/Users/bran/projects/play-git/framework/src" />
<classpathentry kind="lib" path="/Users/bran/projects/japid/JapidContact/lib/classmate-0.8.0.jar"/>
<classpathentry kind="lib" path="/Users/bran/projects/japid/JapidContact/lib/hibernate-jpa-2.1-api-1.0.0.Draft-16.jar"/>
<classpathentry kind="lib" path="/Users/bran/projects/japid/JapidContact/lib/hibernate-validator-5.0.1.Final.jar"/>
<classpathentry kind="lib" path="/Users/bran/projects/japid/JapidContact/lib/japid-0.9.27.jar"/>
<classpathentry kind="lib" path="/Users/bran/projects/japid/JapidContact/lib/japidplay-0.9.27.jar" sourcepath="/japid"/>
<classpathentry kind="lib" path="/Users/bran/projects/japid/JapidContact/lib/japid-0.9.5.2.jar"/>
<classpathentry kind="lib" path="/Users/bran/projects/japid/JapidContact/lib/japidplay-0.9.5.2.jar"/>
<classpathentry kind="lib" path="/Users/bran/projects/japid/JapidContact/lib/javaparser-1.0.8.jar" sourcepath="/Users/bran/.ivy2/cache/com.google.code.javaparser/javaparser/sources/javaparser-1.0.8-sources.jar"/>
<classpathentry kind="lib" path="/Users/bran/projects/japid/JapidContact/lib/jboss-logging-3.1.1.GA.jar"/>
<classpathentry kind="lib" path="/Users/bran/projects/japid/JapidContact/lib/jsoup-1.7.1.jar"/>
Expand Down Expand Up @@ -95,5 +96,6 @@
<classpathentry kind="lib" path="/Users/bran/projects/play-git/framework/lib/validation-api-1.0.0.GA.jar"/>
<classpathentry kind="lib" path="/Users/bran/projects/play-git/framework/lib/xmlpull-1.1.3.1.jar"/>
<classpathentry kind="lib" path="/Users/bran/projects/play-git/framework/lib/xstream-1.4.2.jar"/>

<classpathentry kind="output" path="eclipse/classes"/>
</classpath>
4 changes: 4 additions & 0 deletions JapidContact/app/controllers/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@ public static void save(@Valid Contact contact) {
list();
}

public static void yahoo() {
String a = "yahooooo!";
renderJapid(a);
}
}
4 changes: 2 additions & 2 deletions JapidContact/app/japidviews/Application/form.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
`args Contact contact
`(Contact contact)
`extends main
`set title:"Form"
`suppressNull on

<form action="@{save()}" method="POST">
$authenticityToken()
${authenticityToken()}
<input type="hidden" name="contact.id" value="${contact.id}">

<p class="field">
Expand Down
93 changes: 53 additions & 40 deletions JapidContact/app/japidviews/Application/form.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
//version: 0.9.5.2
package japidviews.Application;
import java.util.*;
import java.io.*;
import cn.bran.japid.tags.Each;
import static play.templates.JavaExtensions.*;
import static cn.bran.play.JapidPlayAdapter.*;
import static play.data.validation.Validation.*;
import japidviews._layouts.*;
import static play.templates.JavaExtensions.*;
import play.data.validation.Error;
import play.i18n.Messages;
import play.data.validation.Validation;
import play.mvc.Scope.*;
import models.*;
import static japidviews._javatags.JapidWebUtil.*;
import play.data.validation.Error;
import play.data.validation.Validation;
import play.i18n.Lang;
import play.mvc.Http.*;
import controllers.*;
import static japidviews._javatags.JapidWebUtil.*;
import japidviews._layouts.*;
import models.*;
import play.mvc.Http.*;
//
// NOTE: This file was generated from: japidviews/Application/form.html
// Change to this file will be lost next time the template file is compiled.
Expand All @@ -23,10 +24,12 @@
public class form extends main
{
public static final String sourceTemplate = "japidviews/Application/form.html";
{
private void initHeaders() {
putHeader("Content-Type", "text/html; charset=utf-8");
setContentType("text/html; charset=utf-8");
}
{
}

// - add implicit fields with Play

Expand All @@ -43,11 +46,17 @@ public class form extends main


public form() {
super(null);
super((StringBuilder)null);
initHeaders();
}
public form(StringBuilder out) {
super(out);
initHeaders();
}
public form(cn.bran.japid.template.JapidTemplateBaseWithoutPlay caller) {
super(caller);
}

/* based on https://github.com/branaway/Japid/issues/12
*/
public static final String[] argNames = new String[] {/* args of the template*/"contact", };
Expand All @@ -64,76 +73,80 @@ public form(StringBuilder out) {
}
////// end of named args stuff

private Contact contact; // line 1
private Contact contact; // line 1, japidviews/Application/form.html
public cn.bran.japid.template.RenderResult render(Contact contact) {
this.contact = contact;
long t = -1;
try {super.layout();} catch (RuntimeException e) { super.handleException(e);} // line 1
return new cn.bran.japid.template.RenderResultPartial(getHeaders(), getOut(), t, actionRunners, sourceTemplate);
try {super.layout();} catch (RuntimeException __e) { super.handleException(__e);} // line 1, japidviews/Application/form.html
return getRenderResult();
}

public static cn.bran.japid.template.RenderResult apply(Contact contact) {
return new form().render(contact);
}

@Override protected void doLayout() {
beginDoLayout(sourceTemplate);
//------
;// line 1
p("<form action=\"");// line 4
p(lookup("save", new Object[]{}));// line 6
;// line 1, form.html
;// line 1, form.html
p("<form action=\"");// line 4, form.html
p(lookup("save", new Object[]{}));// line 6, form.html
p("\" method=\"POST\">\n" +
" ");// line 6
try { p(authenticityToken()); } catch (NullPointerException npe) {}// line 7
p(" <input type=\"hidden\" name=\"contact.id\" value=\"");// line 7
try { p(contact.id); } catch (NullPointerException npe) {}// line 8
" ");// line 6, form.html
try { p(authenticityToken()); } catch (NullPointerException npe) {}// line 7, form.html
p(" <input type=\"hidden\" name=\"contact.id\" value=\"");// line 7, form.html
try { p(contact.id); } catch (NullPointerException npe) {}// line 8, form.html
p("\">\n" +
" \n" +
" <p class=\"field\">\n" +
" <label for=\"name\">Name:</label>\n" +
" <input type=\"text\" id=\"name\" name=\"contact.name\" value=\"");// line 8
try { p(contact.name); } catch (NullPointerException npe) {}// line 12
" <input type=\"text\" id=\"name\" name=\"contact.name\" value=\"");// line 8, form.html
try { p(contact.name); } catch (NullPointerException npe) {}// line 12, form.html
p("\">\n" +
" <span class=\"error\">");// line 12
try { p(error("contact.name")); } catch (NullPointerException npe) {}// line 13
" <span class=\"error\">");// line 12, form.html
try { p(error("contact.name")); } catch (NullPointerException npe) {}// line 13, form.html
p("</span>\n" +
" </p>\n" +
"\n" +
" <p class=\"field\">\n" +
" <label for=\"firstname\">First name:</label>\n" +
" <input type=\"text\" id=\"firstname\" name=\"contact.firstname\" value=\"");// line 13
try { p(contact.firstname); } catch (NullPointerException npe) {}// line 18
" <input type=\"text\" id=\"firstname\" name=\"contact.firstname\" value=\"");// line 13, form.html
try { p(contact.firstname); } catch (NullPointerException npe) {}// line 18, form.html
p("\">\n" +
" <span class=\"error\">");// line 18
try { p(error("contact.firstname")); } catch (NullPointerException npe) {}// line 19
" <span class=\"error\">");// line 18, form.html
try { p(error("contact.firstname")); } catch (NullPointerException npe) {}// line 19, form.html
p("</span>\n" +
" </p>\n" +
"\n" +
" <p class=\"field\">\n" +
" <label for=\"birthdate\">Birth date:</label>\n" +
" <input type=\"text\" id=\"birthdate\" name=\"contact.birthdate\" value=\"");// line 19
try { p(format(contact.birthdate, "yyyy-MM-dd")); } catch (NullPointerException npe) {}// line 24
" <input type=\"text\" id=\"birthdate\" name=\"contact.birthdate\" value=\"");// line 19, form.html
try { p(format(contact.birthdate, "yyyy-MM-dd")); } catch (NullPointerException npe) {}// line 24, form.html
p("\">\n" +
" <span class=\"error\">");// line 24
try { p(error("contact.birthdate")); } catch (NullPointerException npe) {}// line 25
" <span class=\"error\">");// line 24, form.html
try { p(error("contact.birthdate")); } catch (NullPointerException npe) {}// line 25, form.html
p("</span>\n" +
" </p>\n" +
"\n" +
" <p class=\"field\">\n" +
" <label for=\"email\">Email:</label>\n" +
" <input type=\"text\" id=\"email\" name=\"contact.email\" value=\"");// line 25
try { p(contact.email); } catch (NullPointerException npe) {}// line 30
" <input type=\"text\" id=\"email\" name=\"contact.email\" value=\"");// line 25, form.html
try { p(contact.email); } catch (NullPointerException npe) {}// line 30, form.html
p("\">\n" +
" <span class=\"error\">");// line 30
try { p(error("contact.email")); } catch (NullPointerException npe) {}// line 31
" <span class=\"error\">");// line 30, form.html
try { p(error("contact.email")); } catch (NullPointerException npe) {}// line 31, form.html
p("</span>\n" +
" </p>\n" +
"\n" +
" <p class=\"buttons\">\n" +
" <a href=\"");// line 31
p(lookup("list", new Object[]{}));// line 35
" <a href=\"");// line 31, form.html
p(lookup("list", new Object[]{}));// line 35, form.html
p("\">Cancel</a> or <input type=\"submit\" value=\"Save this contact\" id=\"saveContact\">\n" +
" </p>\n" +
" \n" +
" <script type=\"text/javascript\" charset=\"utf-8\">\n" +
" $(\"#birthdate\").datepicker({dateFormat:'yy-mm-dd', showAnim:'fadeIn'})\n" +
" </script>\n" +
"</form>\n");// line 35
"</form>\n");// line 35, form.html

endDoLayout(sourceTemplate);
}
Expand Down
2 changes: 1 addition & 1 deletion JapidContact/app/japidviews/Application/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`args Date now
`(Date now)
`extends main
`set title:"Home"

Expand Down
57 changes: 35 additions & 22 deletions JapidContact/app/japidviews/Application/index.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
//version: 0.9.5.2
package japidviews.Application;
import java.util.*;
import java.io.*;
import cn.bran.japid.tags.Each;
import static play.templates.JavaExtensions.*;
import static cn.bran.play.JapidPlayAdapter.*;
import static play.data.validation.Validation.*;
import japidviews._layouts.*;
import static play.templates.JavaExtensions.*;
import play.data.validation.Error;
import play.i18n.Messages;
import play.data.validation.Validation;
import play.mvc.Scope.*;
import models.*;
import static japidviews._javatags.JapidWebUtil.*;
import play.data.validation.Error;
import play.data.validation.Validation;
import play.i18n.Lang;
import play.mvc.Http.*;
import controllers.*;
import static japidviews._javatags.JapidWebUtil.*;
import japidviews._layouts.*;
import models.*;
import play.mvc.Http.*;
//
// NOTE: This file was generated from: japidviews/Application/index.html
// Change to this file will be lost next time the template file is compiled.
Expand All @@ -23,10 +24,12 @@
public class index extends main
{
public static final String sourceTemplate = "japidviews/Application/index.html";
{
private void initHeaders() {
putHeader("Content-Type", "text/html; charset=utf-8");
setContentType("text/html; charset=utf-8");
}
{
}

// - add implicit fields with Play

Expand All @@ -43,11 +46,17 @@ public class index extends main


public index() {
super(null);
super((StringBuilder)null);
initHeaders();
}
public index(StringBuilder out) {
super(out);
initHeaders();
}
public index(cn.bran.japid.template.JapidTemplateBaseWithoutPlay caller) {
super(caller);
}

/* based on https://github.com/branaway/Japid/issues/12
*/
public static final String[] argNames = new String[] {/* args of the template*/"now", };
Expand All @@ -64,35 +73,39 @@ public index(StringBuilder out) {
}
////// end of named args stuff

private Date now; // line 1
private Date now; // line 1, japidviews/Application/index.html
public cn.bran.japid.template.RenderResult render(Date now) {
this.now = now;
long t = -1;
try {super.layout();} catch (RuntimeException e) { super.handleException(e);} // line 1
return new cn.bran.japid.template.RenderResultPartial(getHeaders(), getOut(), t, actionRunners, sourceTemplate);
try {super.layout();} catch (RuntimeException __e) { super.handleException(__e);} // line 1, japidviews/Application/index.html
return getRenderResult();
}

public static cn.bran.japid.template.RenderResult apply(Date now) {
return new index().render(now);
}

@Override protected void doLayout() {
beginDoLayout(sourceTemplate);
//------
;// line 1
;// line 1, index.html
;// line 1, index.html
p("\n" +
"\n" +
"<p id=\"time\">\n" +
" <span>");// line 3
p(format(now, "EEEE',' MMMM dd',' yyyy"));// line 7
" <span>");// line 3, index.html
p(format(now, "EEEE',' MMMM dd',' yyyy"));// line 7, index.html
p("</span>\n" +
" ");// line 7
p(format(now, "hh'h' MM'mn' ss's'"));// line 8
" ");// line 7, index.html
p(format(now, "hh'h' MM'mn' ss's'"));// line 8, index.html
p("\n" +
"</p>\n" +
"\n" +
"<script type=\"text/javascript\" charset=\"utf-8\">\n" +
" setInterval(function() {\n" +
" $('section').load('");// line 8
p(lookup("index", new Object[]{}));// line 13
" $('section').load('");// line 8, index.html
p(lookup("index", new Object[]{}));// line 13, index.html
p(" #time')\n" +
" }, 1000)\n" +
"</script>");// line 13
"</script>");// line 13, index.html

endDoLayout(sourceTemplate);
}
Expand Down
Loading

0 comments on commit a2e99dd

Please sign in to comment.