Changeset 784
- Timestamp:
- 19/11/08 14:24:52 (2 months ago)
- Files:
-
- trunk/tools/kauri-archetype/archetype-catalog.xml (modified) (1 diff)
- trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/pom.xml (modified) (1 diff)
- trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/java/module1/PersonResource.java (modified) (1 diff)
- trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/pages/index.html.xml (modified) (2 diffs)
- trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/pages/persons/{id}.html.xml (modified) (2 diffs)
- trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/representations.groovy (modified) (1 diff)
- trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/router.groovy (modified) (1 diff)
- trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/spring/production/module1-production-beans.xml (modified) (1 diff)
- trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/spring/prototype/module1-prototype-beans.xml (modified) (1 diff)
- trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/templates (added)
- trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/templates/layout.xml (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tools/kauri-archetype/archetype-catalog.xml
r304 r784 9 9 <repository>http://kauriproject.org/maven/maven2/deploy</repository> 10 10 </archetype> 11 <archetype> 12 <groupId>org.kauriproject</groupId> 13 <artifactId>kauri-archetype-prototype</artifactId> 14 <version>${kauri.version}</version> 15 <description>A Kauri project with typical setup to start prototyping</description> 16 <repository>http://kauriproject.org/maven/maven2/deploy</repository> 17 </archetype> 11 18 </archetypes> 12 19 </archetype-catalog> trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/pom.xml
r689 r784 36 36 <artifactId>kauri-representationbuilder-api</artifactId> 37 37 </dependency> 38 <dependency> 39 <groupId>org.kauriproject</groupId> 40 <artifactId>kauri-dbresources-impl</artifactId> 41 <version>${version.kauri}</version> 42 </dependency> 38 43 </dependencies> 39 44 trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/java/module1/PersonResource.java
r689 r784 24 24 // to be build. The mapping between this logical name and the real representation 25 25 // implementation can be found in representations.groovy 26 return new KauriRepresentation("p ersons/{id}", data);26 return new KauriRepresentation("pages/persons/{id}", data); 27 27 } else { 28 28 throw new WebApplicationException(404); trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/pages/index.html.xml
r748 r784 1 1 <?xml version="1.0"?> 2 <html> 3 <head> 4 <title>Home page</title> 5 </head> 2 <html t:inherit="module:/templates/layout.xml" 3 xmlns:t="http://kauriproject.org/template"> 6 4 7 <body> 8 <h1>Welcome</h1> 5 <t:block name="title">Home page</t:block> 6 7 <t:block name="content"> 8 <h2>Welcome</h2> 9 9 10 10 <p>We have created a sample 'person' resource for you:</p> … … 17 17 --> 18 18 <p><a href="${publicUri('service:/router/persons/1.html')}">View person</a></p> 19 </ body>19 </t:block> 20 20 </html> trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/pages/persons/{id}.html.xml
r748 r784 1 1 <?xml version="1.0"?> 2 <html xmlns:t="http://kauriproject.org/template"> 3 <!-- In prototype mode, the template is executed directly, and pulls in 4 the data it needs itself. In production mode, the data will be 5 supplied from the resource class (PersonResource). 6 --> 7 <t:variable name="person" src="service:/data/persons/${request.attributes.id}.json" overwrite="false"/> 2 <html t:inherit="module:/templates/layout.xml" 3 xmlns:t="http://kauriproject.org/template"> 8 4 9 <head> 10 <title>Person data</title> 11 </head> 12 13 <body> 14 <h1>Person: ${person.name}</h1> 5 <t:block name="title">Person data</t:block> 6 7 <t:block name="content"> 8 <!-- In prototype mode, the template is executed directly, and pulls in 9 the data it needs itself. In production mode, the data will be 10 supplied from the resource class (PersonResource). 11 --> 12 <t:variable name="person" src="service:/data/persons/${request.attributes.id}" overwrite="false"/> 13 14 <h2>Person: ${person.name}</h2> 15 15 16 16 <p><b>Hint:</b> If you see as name "Mr. Production" above, try starting Kauri with the … … 20 20 <p>City: ${person.city}</p> 21 21 <p>Postal code: ${person.postal_code}</p> 22 </body> 22 </t:block> 23 23 24 </html> trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/representations.groovy
r748 r784 13 13 builder.representations { 14 14 select { 15 when(name: " {name:**}") {15 when(name: "pages/{name:**}") { 16 16 template(src: "module:/pages/{name}.html.xml") 17 17 } 18 19 when(name: "{name:**}") { 20 template(src: "module:/{name}.xml") 21 } 18 22 } 19 23 trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/router.groovy
r760 r784 11 11 pages(root: "pages") 12 12 } 13 14 /*15 * Custom-implemented resources using Restlet API.16 */17 //resource(uri: "/person/{id}.html", continueIfNotFound: "true", ofClass: "org.kauriproject.routing.test.testmodules.routing2.PersonResource")18 13 19 14 /* trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/spring/production/module1-production-beans.xml
r748 r784 17 17 18 18 <!-- TODO: for production use, replace the mock data with real data --> 19 <bean id="data" class="org. restlet.Directory">19 <bean id="data" class="org.kauriproject.dbmock.DbMockFinder"> 20 20 <constructor-arg ref="restletContext"/> 21 <constructor-arg value="module:/mockdata/"/> 21 <constructor-arg ref="module"/> 22 <constructor-arg value="mockdata"/> 22 23 </bean> 23 24 <kauri:export-restservice ref="data"/> trunk/tools/kauri-archetype/kauri-archetype-prototyping/src/main/resources/archetype-resources/module1/src/main/kauri/spring/prototype/module1-prototype-beans.xml
r748 r784 15 15 <kauri:module restletContextBeanId="restletContext" classLoaderBeanId="moduleClassLoader" rapiBeanId="module"/> 16 16 17 <bean id="data" class="org. restlet.Directory">17 <bean id="data" class="org.kauriproject.dbmock.DbMockFinder"> 18 18 <constructor-arg ref="restletContext"/> 19 <constructor-arg value="module:/mockdata/"/> 19 <constructor-arg ref="module"/> 20 <constructor-arg value="mockdata"/> 20 21 </bean> 21 22 <kauri:export-restservice ref="data"/>
