kprevas / ronin Goto Github PK
View Code? Open in Web Editor NEWRonin web framework
Home Page: http://ronin-web.org
Ronin web framework
Home Page: http://ronin-web.org
vox populi, vox dei
roninit is currently using Jetty 6. Should put a more recent version of the Jetty jar in support folder, and update DevServer to use new packages (org.mortbay -> org.eclipse)
Add an assertion method to RoninTest which asserts that a response received during the test is a redirect (potentially to a specific URL).
When I run Roninit, I get the following output: Creating /Users/kprevas/temp/ronin/ronin/../my_app/build.vark Creating /Users/kprevas/temp/ronin/ronin/../my_app/db/init.sql Creating /Users/kprevas/temp/ronin/ronin/../my_app/html/WEB-INF/web.xml Creating /Users/kprevas/temp/ronin/ronin/../my_app/lib/ronin.jar Creating /Users/kprevas/temp/ronin/ronin/../my_app/lib/ronindb.jar Creating /Users/kprevas/temp/ronin/ronin/../my_app/lib/stringtree-json-2.0.9.jar Creating /Users/kprevas/temp/ronin/ronin/../my_app/src/config/RoninConfig.gs Creating /Users/kprevas/temp/ronin/ronin/../my_app/src/controller/Main.gs Creating /Users/kprevas/temp/ronin/ronin/../my_app/src/view/Main.gst Creating /Users/kprevas/temp/ronin/ronin/../my_app/support/h2-1.3.146.jar Creating /Users/kprevas/temp/ronin/ronin/../my_app/support/jetty-all-8.0.0.M2.jar Creating /Users/kprevas/temp/ronin/ronin/../my_app/support/junit-4.8.2.jar Creating /Users/kprevas/temp/ronin/ronin/../my_app/support/roninit.jar Creating /Users/kprevas/temp/ronin/ronin/../my_app/support/vark/RoninVarkTargets.gsx Creating /Users/kprevas/temp/ronin/ronin/../my_app/test/controller/MainTestV3.gs Creating /Users/kprevas/temp/ronin/ronin/../my_app/test/controller/MainTestV4.gs Aardvark was not found on your path. Ronin uses Aardvark to package and run applications. Please download it from http://vark.github.com A ronin application was created at ../my_app. To start the application: cd ../my_app vark server But Aardvark ~is~ on my path; I can type "vark" and it works just fine.
I'm following along the tutorial (hey, awesome that you're downloading all the req'd libs via ivy).
Unfortunately I don't get good code completion on my PostCx.gs file. It won't recognize the package, and doesn't like the uses ronin.roninController. Looks like maybe I need to setup the classpath, but the Gosu editor doesn't seem to accept anything I put in there. Cmd-line classpath args aren't playing nice for me either. Wondering what I'm doing wrong, or if I just need to put the ronin-0.8.6.jar file into my java classpath?
Carson had some good ideas here, like an enhancement for java.net.URL.get()
The app template used by Roninit doesn't include a .dbc file in the source tree, so RoninDB won't be able to find the database.
Build in basic support for XSRF protection. - On each request, generate a random token in the session if one isn't there already. - Provide a method on RoninTemplate to insert the session token. - On a non-GET request, reject the request if the token is not present. - Since this should all be off by default, provide a way to turn it on from RoninConfig.
System: Windows 7, 64 bit
GOSU: gosul-0.9-14-full.zip
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\System32>d:
D:>cd ronin
D:\Ronin>vark -version
Aardvark version 0.4
D:\Ronin>vark -url http://ronin-web.org/init.vark
java.lang.RuntimeException:
gw.internal.ext.org.sonatype.aether.resolution.Depen
dencyResolutionException: Could not find artifact org.gosu-
lang.aardvark:aardvar
k-aether-utils:jar:1.0-SNAPSHOT
at
gw.lang.launch.aether.AetherRepositorySystem.collect(AetherRepository
System.java:103)
at
gw.lang.launch.aether.AetherClasspathElementHandler.getClasspathFiles
(AetherClasspathElementHandler.java:53)
at gw.lang.launch.GosuLauncher.run(GosuLauncher.java:99)
at gw.lang.launch.GosuLauncher.main(GosuLauncher.java:45)
Caused by:
gw.internal.ext.org.sonatype.aether.resolution.DependencyResolutionEx
ception: Could not find artifact org.gosu-lang.aardvark:aardvark-
aether-utils:ja
r:1.0-SNAPSHOT
at
gw.internal.ext.org.sonatype.aether.impl.internal.DefaultRepositorySy
stem.resolveDependencies(DefaultRepositorySystem.java:412)
at
gw.lang.launch.aether.AetherRepositorySystem.collect(AetherRepository
System.java:96)
... 3 more
Caused by:
gw.internal.ext.org.sonatype.aether.resolution.ArtifactResolutionExce
ption: Could not find artifact org.gosu-lang.aardvark:aardvark-aether-
utils:jar:
1.0-SNAPSHOT
at
gw.internal.ext.org.sonatype.aether.impl.internal.DefaultArtifactReso
lver.resolve(DefaultArtifactResolver.java:541)
at
gw.internal.ext.org.sonatype.aether.impl.internal.DefaultArtifactReso
lver.resolveArtifacts(DefaultArtifactResolver.java:220)
at
gw.internal.ext.org.sonatype.aether.impl.internal.DefaultRepositorySy
stem.resolveDependencies(DefaultRepositorySystem.java:395)
... 4 more
Caused by:
gw.internal.ext.org.sonatype.aether.transfer.ArtifactNotFoundExceptio
n: Could not find artifact org.gosu-lang.aardvark:aardvark-aether-
utils:jar:1.0-
SNAPSHOT
at
gw.internal.ext.org.sonatype.aether.impl.internal.DefaultArtifactReso
lver.resolve(DefaultArtifactResolver.java:531)
... 6 more
D:\Ronin>
Now that we're using feature literals for urlFor(), controller methods don't have to be static any more. - remove static check in RoninServlet - have RoninServlet instantiate controller - add beforeRequest() and afterRequest() to RoninController, have RoninServlet call them
Think about how to support UI testing (HtmlUnit, Selenium, etc.)
Given the following method on class Foo:
static function bar(s : String, s2 : String = "") {}
This works fine:
new Foo().bar("a")
But this fails to compile (wrong number of arguments to function):
Foo.bar("a")
Automatically generate JSONP callbacks
Possibly: have an annotation to mark a test as a load test, then a "vark pound" target with appropriate parameters like number of threads, number of repetitions, profiler connection, etc.
Apache Shiro looks like a good option for authentication. Need to figure out if we want to try and integrate it somehow, or just recommend it to users (as the API seems pretty sane on its own).
Ideally just define a parameter on your method - InputStream? File? - and have it populated automatically.
Add a version of both findSorted() and findSortedPaged() which takes a feature literal for the sort column instead of an IPropertyInfo. Potentially deprecate the old IPropertyInfo version.
When I create a new app from scratch via Roninit, it doesn't include the servlet-api.jar, so "vark server" results in the following: Buildfile: /Users/kprevas/temp/ronin/my_app/build.vark [23:52:40] Done parsing Aardvark buildfile in 700 ms server: Starting server in socket debug mode at 8088 [java] The args attribute is deprecated. Please use nested arg elements. [java] The jvmargs attribute is deprecated. Please use nested jvmarg elements. [java] Listening for transport dt_socket at address: 8088 [java] Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletResponse [java] at ronin.DevServer.main(DevServer.java:39) [java] Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletResponse [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202) [java] at java.security.AccessController.doPrivileged(Native Method) [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:307) [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [java] ... 1 more BUILD FAILED Java returned: 1 Total time: 3 seconds
Documentation says something like this.
Person.selectWhere("Name is not null and PhoneNumber like :phoneNum"),
{ "phoneNum" -> "555%" })
What I found is that a similar statement would not execute and I had to place quotes around the column names.
var userResult = db.model.User.selectWhere(" "Name" = :userName AND "Hash" = :password",
{ "userName" -> userName,
"password" -> pass
})
add a little zazz to the skeleton app that Roninit generates
(obviously call it something other than "protected")
An annotation for a property which disallows Ronin from setting it via request parameters.
When running RoBlog via "vark server": ``` [java] Use org.h2.tools.Server@2d42c778 as your url, and a blank username/password to connect. ```
add tests for the caching system
it could stand to be broken up a bit
Add an annotation, @Methods(), for controller methods to limit the HTTP methods which can access them. e.g. @Methods({POST}) function createThing(thing : Thing) { ... } This will help with XSRF protection in particular.
you know what you doing
bauer@bauer-desktop:~/workspace/gosu$ vark -url http://ronin-web.org/init.vark init -name my_app
gosu-aether: Downloaded http://gosu-lang.org/nexus/content/repositories/snapshots/org/gosu-lang/aardvark/aardvark-aether-utils/0.1-SNAPSHOT/maven-metadata.xml (787 B at 0.9 KB/sec) to /home/bauer/.m2/repository/org/gosu-lang/aardvark/aardvark-aether-utils/0.1-SNAPSHOT/maven-metadata-gosu-lang.org-snapshots.xml
Buildfile: http://ronin-web.org/init.vark
Done parsing Aardvark buildfile in 2529 ms
init:
Please enter a group ID (e.g. "com.yourcompany"): com.yourcompany
[get] Getting: http://gosu-lang.org/nexus/content/groups/releases/org/gosu-lang/ronin/ronin/maven-metadata.xml
[get] To: /tmp/maven-metadata4894327401086987436.xml
[echo] Using the latest published version of Ronin: 0.9.3
[resolve] Downloading http://gosu-lang.org/nexus/content/groups/releases/org/gosu-lang/ronin/ronin-archetype/0.9.3/ronin-archetype-0.9.3.pom
[resolve] The POM for org.gosu-lang.ronin:ronin-archetype:jar:0.9.3 is missing, no dependency information available
[resolve] Resolving artifacts
[resolve] Downloading http://gosu-lang.org/nexus/content/groups/releases/org/gosu-lang/ronin/ronin-archetype/0.9.3/ronin-archetype-0.9.3.jar
BUILD FAILED
Could not resolve artifacts: Could not find artifact org.gosu-lang.ronin:ronin-archetype:jar:0.9.3 in gosu-lang.org-releases (http://gosu-lang.org/nexus/content/groups/releases)
Total time: 11 seconds
The wiki pages need to be updated to reflect the new feature literal-based APIs. While we're in there, I'd like to try to push the [Foo]Cx naming convention for controllers, and (in the tutorial) recommend using the built-in Gosu editor, maybe go into a little detail on how to use it.
I think it should be "application/javascript"
Looking at the code, I don't think we recurse on objects that come in as json members. Some interns at GW were having issues around that.
Add a method to RoninTemplate called n() which generates the appropriate form input name for a type literal or feature literal. (Any way we can do this for array components as well? e.g. n(Post#Tags[0]))
Annotate a parameter with @required, and have RoninServlet throw if that parameter isn't passed in. Saves a lot of tedious null-checking in controller methods.
The verify-app vark target is pretty unreliable at the moment; in particular:
show cache hits/misses
I've heard that Ivy (http://ant.apache.org/ivy/) is a good Ant-based dependency management system that leverages the Maven dependency infrastructure without having to actually use Maven. We should see if we can hook Aardvark into this easily, which would save us having to include all the dependency jars in the initial download.
Running vark clean build gives me two artifacts, ronin.zip and ronin.tgz. From the draft docs, it looks like these should be the same thing - but ronin.zip just contains the exploded "template" directory, and one lone class file (Roninit.class).
All public APIs need to be javadoc'd.
This could be really helpful for AJAX responses.
Roninit generates a placeholder page with a handy link to the H2 console that DevServer starts; however, the JDBC URL for the app's database isn't pre-filled correctly. For me, the URL that was prefilled was the previous database that I had accessed via an entirely different instance of the H2 console. Not sure if we have any actual control over this, but if we don't, we need to tell the user the correct URL before they click that link.
RoninTest and associated classes should be in a separate jar which goes in support, rather than lib, as they're not needed in a deployed app.
RoBlog needs to be updated to use the new feature literal-based API.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.