Skip to content

Commit

Permalink
fixed some issues in the JapidSampleDecoupled example
Browse files Browse the repository at this point in the history
  • Loading branch information
branaway committed Jun 16, 2016
1 parent a9534c0 commit 38181f9
Show file tree
Hide file tree
Showing 136 changed files with 279 additions and 257 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<classpathentry kind="src" path="plainjapid"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="lib" path="lib/javaparser-1.0.8.jar" sourcepath="/javaparser"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/play-git"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib.plain/org.eclipse.jdt.core_3.9.50.v20140317-1741.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/play"/>
<classpathentry kind="output" path="eclipse/classes"/>
</classpath>
174 changes: 86 additions & 88 deletions JapidSampleDecoupled/.classpath

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions JapidSampleDecoupled/.project
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.playframework.playclipse.playNature</nature>
</natures>
<linkedResources><link><name>docviewer</name><type>2</type><location>/Users/bran/projects/play-git/modules/docviewer/app</location></link>
</linkedResources>
<linkedResources>
<link>
<name>docviewer</name>
<type>2</type>
<location>/Users/ran/projects/play/modules/docviewer/app</location>
</link>
</linkedResources>
</projectDescription>
2 changes: 2 additions & 0 deletions JapidSampleDecoupled/app/controllers/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public static void indexAt2() {
renderJapid(); //
}

public static void kk2k(){}

public static void authorPanel(final Author a) {
boolean calledFromView = isInvokedfromJapidView();
System.out.println("calledFromView: " + calledFromView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import cn.bran.play.JapidController2;
import play.mvc.Before;

public class BaseController extends JapidController2 {
public class BaseController extends JapidController {
@Before
static void beforeHandler() {
System.out.println("in before handler");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

import cn.bran.play.JapidController;
import cn.bran.play.JapidController2;
import cn.bran.play.routing.AutoPath;

public class ContentNegotiation extends JapidController2 {
@AutoPath
public class ContentNegotiation extends JapidController {

public static void index() {
renderJapid();
Expand Down
2 changes: 2 additions & 0 deletions JapidSampleDecoupled/app/controllers/more/MyController.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package controllers.more;

import cn.bran.play.routing.AutoPath;
import models.DataModel;

// make sure you have
// module.japid=${play.path}/modules/japid-head
// in your application.conf file, and "play eclipsify"
// if you notice the JapidController is not found.

@AutoPath
public class MyController extends BaseController {

public static void index() {
Expand Down
2 changes: 1 addition & 1 deletion JapidSampleDecoupled/app/japidviews/AutoPather/foo.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.AutoPather;
import java.util.*;
import java.io.*;
Expand Down
4 changes: 4 additions & 0 deletions JapidSampleDecoupled/app/models/Category.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ public String n() {
return "name-: " + name;
// + ". sub name: " + subname;
}

public String getName(){
return name;
}
}
8 changes: 6 additions & 2 deletions JapidSampleDecoupled/conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ java.source=1.8
# ~~~~~
# Specify log level for your application.
# If you want a very customized log, create a log4j.properties file in the conf directory
#application.log=TRACE
application.log=DEBUG
#
# More logging configuration
# application.log.path=/log4j.properties
Expand Down Expand Up @@ -197,4 +197,8 @@ mail.smtp=mock
%test.mail.smtp=mock

# dump the request for debugging, yes/true for request line only, regex pattern for URL specific dump, false/no to disable
japid.dump.request = .*dumpPost.*
japid.dump.request = .*dumpPost.*

# control the usage of class enhancement that apply only to Groovy templates.
#play.LVEnhancer.enabled=false;
#play.PropertiesEnhancer.enabled=false;
4 changes: 2 additions & 2 deletions JapidSampleDecoupled/conf/dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require:
- cn.bran -> japid 0.9.6
- cn.bran -> japidplay 0.9.6
- cn.bran -> japid 0.9.6.1
- cn.bran -> japidplay 0.9.6.1
# - com.github.javaparser -> javaparser-core 2.2.2
- com.google.code.javaparser -> javaparser 1.0.8
- com.fasterxml.jackson.core -> jackson-databind 2.3.0
Expand Down
1 change: 1 addition & 0 deletions JapidSampleDecoupled/eclipse/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/classes/
14 changes: 14 additions & 0 deletions JapidSampleDecoupled/eclipse/JapidSampleDecoupled-plain.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/play/framework/src/play/server/Server.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="play.server.Server"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="JapidSampleDecoupled"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dplay.debug=yes -Dplay.id= -Dapplication.path=&quot;${project_loc:JapidSampleDecoupled}&quot; -Djava.endorsed.dirs=&quot;/Users/ran/projects/play/framework/endorsed&quot; -javaagent:&quot;/Users/ran/projects/play/framework/lib/PlayAgent.jar&quot;"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/JapidSampleDecoupled"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;JapidSampleDecoupled&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/JapidSampleDecoupled/conf&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;JapidSampleDecoupled&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="play.server.Server"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="JapidSampleDecoupled"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value=" -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Dplay.debug=yes -Dplay.id= -Dapplication.path=&quot;${project_loc:JapidSampleDecoupled}&quot; -Djava.endorsed.dirs=&quot;/Users/ran/projects/play/framework/endorsed&quot; -javaagent:&quot;/Users/ran/projects/play/framework/play-1.4.x--bran-1.0-1-g808a9ce.jar&quot;"/>
</launchConfiguration>

20 changes: 0 additions & 20 deletions JapidSampleDecoupled/eclipse/JapidSampleDecoupled.launch

This file was deleted.

4 changes: 2 additions & 2 deletions JapidSampleDecoupled/eclipse/Test JapidSampleDecoupled.launch
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;JapidSampleDecoupled&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/JapidSampleDecoupled/conf&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;/Users/bran/projects/play-git/modules/testrunner/lib/play-testrunner.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;/Users/ran/projects/play/modules/testrunner/lib/play-testrunner.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;JapidSampleDecoupled&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="play.server.Server"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="JapidSampleDecoupled"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value=" -XX:-UseSplitVerifier -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Dplay.debug=yes -Dplay.id=test -Dapplication.path=&quot;${project_loc:JapidSampleDecoupled}&quot; -Djava.endorsed.dirs=&quot;/Users/bran/projects/play-git/framework/endorsed&quot; -javaagent:&quot;/Users/bran/projects/play-git/framework/play-1.4.x-original-1.4.x-merged.jar&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value=" -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Dplay.debug=yes -Dplay.id=test -Dapplication.path=&quot;${project_loc:JapidSampleDecoupled}&quot; -Djava.endorsed.dirs=&quot;/Users/ran/projects/play/framework/endorsed&quot; -javaagent:&quot;/Users/ran/projects/play/framework/play-1.4.x--bran-1.0-1-g808a9ce.jar&quot;"/>
</launchConfiguration>

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
11 changes: 3 additions & 8 deletions JapidSampleDecoupled/japidroot/japidviews/Application/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ <h2>Some Sample Templates that Demonstrate Japid Features.</h2>
<li><a href="Application.dumpPost">show how to dump a post
detail with japid.dump.request spec in the Application.conf. see
console for output.</a></li>
<li><a href="Application.cacheWithRenderJapid?a=hi">cache with
<li><a href="Application.cacheWithRenderJapid/hi">cache with
renderJapid</a></li>
<li><a href="Application.testCacheFor">using the CacheFor
<li><a href="Application.testCacheFor/pp">using the CacheFor
annotation</a></li>
<li><a href="Application.in">action forwarding with
dontRedirect() from JapidController</a></li>
Expand All @@ -71,7 +71,7 @@ <h2>Some Sample Templates that Demonstrate Japid Features.</h2>
`
</li>
<li><a href="more.ContentNegotiation.index"> content
negotiation.</a> Use tools like CURL to test it: <pre>curl -i -H "Accept: Application/json" http://127.0.0.1:9000/more.ContentNegotiation/index</pre>
negotiation.</a> Use tools like CURL to test it: <pre>curl -i -H "Accept: application/json" http://127.0.0.1:9000/more.ContentNegotiation/index</pre>
<p>Content negotiation works with renderJapid(), which does
implicit parameter binding and template picking.</p>
<p>For more doc: see <a
Expand Down Expand Up @@ -110,8 +110,3 @@ <h2>Some Sample Templates that Demonstrate Japid Features.</h2>
<p>app mode: "${_play.mode}"</p>

<br/>

-->"$c.name" ,
"$c.subname"
*{
}*
18 changes: 5 additions & 13 deletions JapidSampleDecoupled/japidroot/japidviews/Application/index.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down Expand Up @@ -146,9 +146,9 @@ public static cn.bran.japid.template.RenderResult apply(models.Category c) {
" <li><a href=\"Application.dumpPost\">show how to dump a post\n" +
" detail with japid.dump.request spec in the Application.conf. see\n" +
" console for output.</a></li>\n" +
" <li><a href=\"Application.cacheWithRenderJapid?a=hi\">cache with\n" +
" <li><a href=\"Application.cacheWithRenderJapid/hi\">cache with\n" +
" renderJapid</a></li>\n" +
" <li><a href=\"Application.testCacheFor\">using the CacheFor\n" +
" <li><a href=\"Application.testCacheFor/pp\">using the CacheFor\n" +
" annotation</a></li>\n" +
" <li><a href=\"Application.in\">action forwarding with\n" +
" dontRedirect() from JapidController</a></li>\n" +
Expand All @@ -160,7 +160,7 @@ public static cn.bran.japid.template.RenderResult apply(models.Category c) {
" ");// line 69, index.html
p(" </li>\n" +
" <li><a href=\"more.ContentNegotiation.index\"> content\n" +
" negotiation.</a> Use tools like CURL to test it: <pre>curl -i -H \"Accept: Application/json\" http://127.0.0.1:9000/more.ContentNegotiation/index</pre>\n" +
" negotiation.</a> Use tools like CURL to test it: <pre>curl -i -H \"Accept: application/json\" http://127.0.0.1:9000/more.ContentNegotiation/index</pre>\n" +
" <p>Content negotiation works with renderJapid(), which does\n" +
" implicit parameter binding and template picking.</p>\n" +
" <p>For more doc: see <a\n" +
Expand Down Expand Up @@ -209,15 +209,7 @@ public static cn.bran.japid.template.RenderResult apply(models.Category c) {
p(_play.mode);// line 110, index.html
p("\"</p>\n" +
"\n" +
"<br/>\n" +
"\n" +
"-->\"");// line 110, index.html
p(c.name);// line 114, index.html
p("\" , \n" +
"\"");// line 114, index.html
p(c.subname);// line 115, index.html
p("\"\n");// line 115, index.html
p("\n");// line 117, index.html
"<br/>\n");// line 110, index.html

endDoLayout(sourceTemplate);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 0.9.6
//version: 0.9.6.1
package japidviews.Application;
import java.util.*;
import java.io.*;
Expand Down
Loading

0 comments on commit 38181f9

Please sign in to comment.