Author: mfortun Date: 2011-08-28 16:55:30 +0200 (Sun, 28 Aug 2011) New Revision: 1193 Url: http://nuiton.org/repositories/revision/wikitty/1193 Log: *add example application to svn Added: trunk/wikitty-publication/src/site/exemple/ trunk/wikitty-publication/src/site/exemple/resourceAppli/ trunk/wikitty-publication/src/site/exemple/resourceAppli/pom.xml trunk/wikitty-publication/src/site/exemple/resourceAppli/src/ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/resources/ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/resources/images/ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/resources/images/wikittypubuml.png trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/resources/jar/ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/JavaView.java trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/Javahtml.htmlja trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/SelfModify.htmljs trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/Test.java trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/clearProxy.java trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/dummy.htmljs trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/resources.htmljs trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/view.htmljs trunk/wikitty-publication/src/site/exemple/resourceEntity/ trunk/wikitty-publication/src/site/exemple/resourceEntity/LICENSE.tx trunk/wikitty-publication/src/site/exemple/resourceEntity/LICENSE.txt trunk/wikitty-publication/src/site/exemple/resourceEntity/README.txt trunk/wikitty-publication/src/site/exemple/resourceEntity/changelog.txt trunk/wikitty-publication/src/site/exemple/resourceEntity/pom.xml trunk/wikitty-publication/src/site/exemple/resourceEntity/src/ trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/ trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/java/ trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/resources/ trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/xmi/ trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/xmi/wp-resource.properties trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/xmi/wp-resource.zargo Added: trunk/wikitty-publication/src/site/exemple/resourceAppli/pom.xml =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceAppli/pom.xml (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceAppli/pom.xml 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.codelutin</groupId> + <artifactId>reseapplication</artifactId> + <version>1.0</version> + <description>An exemple application to understand how build application +within wikitty publication</description> + +<dependencies> + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <version>1.2.2</version> + </dependency> +</dependencies> + <build> + <plugins> + <plugin> + <groupId>org.nuiton.wikitty</groupId> + <artifactId>wp-maven-plugin</artifactId> + <version>3.2-SNAPSHOT</version> + <configuration> + <applicationName>example</applicationName> + <wikittyServiceUrl>cajo://localhost:1111/wikitty</wikittyServiceUrl> + <serveurID>serveurTest</serveurID> + <uploadUrl>http://localhost/</uploadUrl> + <publicationVersion>3.2-SNAPSHOT</publicationVersion> + </configuration> + </plugin> + </plugins> + </build> +</project> Added: trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/resources/images/wikittypubuml.png =================================================================== (Binary files differ) Property changes on: trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/resources/images/wikittypubuml.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/JavaView.java =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/JavaView.java (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/JavaView.java 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,11 @@ + +wpContext.setContentType("text/html; charset=UTF-8"); + +String result = "ceci va être intégré à un corps de méthode java" + + "Compiler et éxécuté ensuite, et on aura accès au binding" + + "exemple le nom de la page "+wpPage; + +return result; + + + Added: trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/Javahtml.htmlja =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/Javahtml.htmlja (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/Javahtml.htmlja 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,14 @@ +<html> +<body> + +<% +String result = "ceci va être intégré à un corps de méthode java" + + "Compiler et éxécuté ensuite, et on aura accès au binding" + + "exemple le nom de la page "+wpPage; + +%> + + +<h1><%=result%></h1> +</body> +<html> Added: trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/SelfModify.htmljs =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/SelfModify.htmljs (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/SelfModify.htmljs 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,45 @@ +<% +var content="Que je peux me tripoter le content"; +%> + + +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<head> +<body> +<h1>Je suis le Wikitty id: <%=wpWikitty.getId()%></h1> +<h2>Et je tiens a dire: <%=content%></h2> +<br> + +<form action="<%=wpPage%>.action" method ="post"> +Changer mon message: <input type="text" value="" name="message"/> +<br/> +<input type="submit" name="post" value="post"/> +</form> +</body> +</html> + + +<% +if (wpContext.getArgument("post")!=""){ + importPackage(org.nuiton.wikitty.publication.entities); + + var wikittyPubText = new WikittyPubTextImpl(); + var futurMessage = wpContext.getArgument("message"); + + + var thisWikitty = wpContext.getWikittyProxy().restore(wikittyPubText.getClass(), wpWikitty.getId()); + + var content= thisWikitty.getContent(); + + content = content.replaceFirst("var content=\".*\";", "var content=\""+futurMessage+"\";"); + + + thisWikitty.setContent(content); + + wpContext.getWikittyProxy().store(thisWikitty); +} +%> + + Added: trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/Test.java =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/Test.java (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/Test.java 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,3 @@ +WikittyRessource tt = new WikittyRessourceImpl(); + +return "yo"; Added: trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/clearProxy.java =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/clearProxy.java (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/clearProxy.java 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,6 @@ +String result = "Proxy Clear"; +wpContext.getWikittyProxy().clear(); + +String youhou ="youhou"; + +return youhou; Added: trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/dummy.htmljs =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/dummy.htmljs (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/dummy.htmljs 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,19 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<head> +<body> + + +<!--afficher les ressources réservée ici--> + +<h1><%=wpContext.getArgument("yo")%></h1> + + +<form method="post" action="<%=wpPage%>.action"> +<input type="type" value="chaussette" name="yo"> +<input type="submit" name="post" value="post"/> +</form> +</body> +</html> + Added: trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/resources.htmljs =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/resources.htmljs (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/resources.htmljs 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,85 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<head> +<body> + +<% +if (wpContext.getArgument("save")!=""){ + importPackage(org.nuiton.wikitty.entities); + var resource = new WikittyResourceImpl(); + + resource.setName(wpContext.getArgument("nom")); + resource.setDescription(wpContext.getArgument("description")); + + wpContext.getWikittyProxy().store(resource); + + wp_result += "<p>Nouvelle ressource Sauvegardées Wikitty-Id" + resource.getWikittyId()+"</p>"; +} + +if (wpContext.getArgument("delete")!=""){ + + var idtodelete = wpContext.getArgument("id_delete"); + /*Little did you know that delete is a key word in javascript ? + So to call delete on wikitty proxy, as you can call a method + on a javascript object simply add the method name like this: + ['methodName'](param, other param)*/ + wpContext.getWikittyProxy()['delete'](idtodelete); + + wp_result += "<p>Wikitty supprimé" + idtodelete+"</p>"; +} + + +%> + +Création de nouvelle ressources: +<form method="post" action="<%=wpPage%>.action"> +Nom :<input type="text" name="nom"/></br> +Description :<input type="text" name="description"/> + +<input type="submit" name="save" value="save"/> + +</form> + +Listes des ressources existantes: + +<% +importPackage( org.nuiton.wikitty.search); +importPackage(org.nuiton.wikitty.entities); + +var wikittyResourceClazz = new WikittyResourceImpl(); + +var searchResult = wpContext.getWikittyProxy().findAllByCriteria( + Search.query().exteq(WikittyResource.EXT_WIKITTYRESOURCE).criteria()); + +var listWikitty = searchResult.cast(wpContext.getWikittyProxy(), wikittyResourceClazz.getClass()); +listWikitty = listWikitty.getAll(); + +var size = listWikitty.size(); + + +wp_result+="<table border=\"1\">\n"; +wp_result+="<tr><td>Id</td><td>Nom</td><td>Description</td>\n"; +for (var gg=0; gg < size; gg++){ +var w = listWikitty.get(gg); +wp_result+="<tr>\n"; +wp_result+= "<td>"+w.getWikittyId()+"</td>\n"; +wp_result+= "<td>"+w.getName()+"</td>\n"; +wp_result+= "<td>"+w.getDescription()+"</td>\n"; +wp_result+= "<td><form><input type='hidden' value='"+w.getWikittyId()+"' name ='id_delete'/> <input type='submit' name='delete' value='delete'/></form></td>"; +wp_result+="</tr>\n"; +} + +wp_result+="</table>"; + +%> +</body> +</html> + + + + + + + + Added: trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/view.htmljs =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/view.htmljs (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceAppli/src/main/wp/view.htmljs 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,121 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<head> +<title>Liste des réservations</title> +<body> + +<% +importPackage( org.nuiton.wikitty.search); +importPackage(org.nuiton.wikitty.entities); + + + +if (wpContext.getArgument("save")!=""){ + var resource = new WikittyResaImpl(); + + + resource.setDescription(wpContext.getArgument("description")); + resource.setWikittyResource(wpContext.getArgument("resource")); + resource.setEmail(wpContext.getArgument("mail")) + resource.setDateFin(wpContext.getArgument("dateFin")) + resource.setDateDebut(wpContext.getArgument("dateDebut")) + + + wpContext.getWikittyProxy().store(resource); + + wp_result += "<p>Nouvelle ressource Sauvegardées Wikitty-Id" + resource.getWikittyId()+"</p>"; +} + +if (wpContext.getArgument("delete")!=""){ + + var idtodelete = wpContext.getArgument("id_delete"); + /*Little did you know that delete is a key word in javascript ? + So to call delete on wikitty proxy, as you can call a method + on a javascript object simply add the method name like this: + ['methodName'](param, other param)*/ + wpContext.getWikittyProxy()['delete'](idtodelete); + + wp_result += "<p>Wikitty supprimé" + idtodelete+"</p>"; +} + + + +var wikittyResaClazz = new WikittyResaImpl(); +var wikittyResourceClazz = new WikittyResourceImpl(); + +var searchResult = wpContext.getWikittyProxy().findAllByCriteria( + Search.query().exteq(WikittyResa.EXT_WIKITTYRESA).criteria()); + +var listWikitty = searchResult.cast(wpContext.getWikittyProxy(), wikittyResaClazz.getClass()); +listWikitty = listWikitty.getAll(); + +var size = listWikitty.size(); + + +wp_result+="<table border=\"1\">\n"; +wp_result+="<tr><td>Id</td><td>Email</td><td>Date Debut</td><td>Date fin</td> <td>ressource</td>\n"; +for (var gg=0; gg < size; gg++){ +var w = listWikitty.get(gg); +wp_result+="<tr>\n"; +wp_result+= "<td>"+w.getWikittyId()+"</td>\n"; +wp_result+= "<td>"+w.getEmail()+"</td>\n"; +wp_result+= "<td>"+w.getDateDebut()+"</td>\n"; +wp_result+= "<td>"+w.getDateFin()+"</td>\n"; +var resourceLinked = wpContext.getWikittyProxy().restore( wikittyResourceClazz.getClass(),w.getWikittyResource()) +var ressourceName = ""; +if ( resourceLinked != null){ + ressourceName = resourceLinked.getName() +} +wp_result+= "<td>"+ressourceName+"</td>\n"; +wp_result+= "<td><form><input type='hidden' value='"+w.getWikittyId()+"' name ='id_delete'/> <input type='submit' name='delete' value='delete'/></form></td>"; +wp_result+="</tr>\n"; +} + +wp_result+="</table>"; + + + +%> + + +Création de nouvelle réservation: +<form method="post" action="<%=wpPage%>.action"> +Email :<input type="text" name="mail"/></br> +DateDébut :<input type="text" name="dateDebut"/></br> +DateFin :<input type="text" name="dateFin"/></br> +Description :<input type="text" name="description"/></br> +ressource :<select name="resource" size="1"> + <option value="" selected="true"></option> +<% +var searchrResource = wpContext.getWikittyProxy().findAllByCriteria( + Search.query().exteq(WikittyResource.EXT_WIKITTYRESOURCE).criteria()); + +var listWResource = searchrResource.cast(wpContext.getWikittyProxy(), wikittyResourceClazz.getClass()); +listWResource = listWResource.getAll(); + +var sizeR = listWResource.size(); + +for (var gg=0; gg < sizeR; gg++){ +var w = listWResource.get(gg); + +wp_result+= "<option value="+w.getWikittyId()+" >"+w.getName()+"</option>\n"; +} + +%> +</select> + + +<input type="submit" name="save" value="save"/> + +</form> + + + + + + + + +</body> +</html> Added: trunk/wikitty-publication/src/site/exemple/resourceEntity/pom.xml =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceEntity/pom.xml (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceEntity/pom.xml 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,186 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.nuiton</groupId> + <artifactId>mavenpom4redmine</artifactId> + <version>3.0.2</version> + </parent> + + <!-- ************************************************************* --> + <!-- *** POM Relationships *************************************** --> + <!-- ************************************************************* --> + + <groupId>org.nuiton.wikitty</groupId> + <artifactId>resource</artifactId> +<version>1.0</version> + + <!--properties> + <i18n.bundleOutputName>wikitty-publication</i18n.bundleOutputName> + </properties--> + + <dependencies> + <dependency> + <groupId>org.nuiton.wikitty</groupId> + <artifactId>wikitty-api</artifactId> + <version>3.2-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </dependency> + + + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </dependency> + + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + </dependency> + + <dependency> + <groupId>javassist</groupId> + <artifactId>javassist</artifactId> + <version>${javassistVersion}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-utils</artifactId> + <version>${nuitonUtilsVersion}</version> + <scope>compile</scope> + </dependency> + + + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> + + + + + </dependencies> + + <properties> + <platform>nuiton.org</platform> + <projectId>wikitty</projectId> + + <!-- common versions used in sub-poms --> + <eugeneVersion>2.3.5</eugeneVersion> + <nuitonUtilsVersion>2.2</nuitonUtilsVersion> + <nuitonI18nVersion>2.4.1</nuitonI18nVersion> + <processPluginVersion>1.1</processPluginVersion> + <jettyVersion>7.4.2.v20110526</jettyVersion> + <struts2jqueryVersion>3.1.0</struts2jqueryVersion> + <struts2Version>2.2.3</struts2Version> + <javassistVersion>3.8.0.GA</javassistVersion> + <jspapiversion>2.1</jspapiversion> + + <nuitonProcessessorVersion>1.2.2-SNAPSHOT</nuitonProcessessorVersion> + <nuiton-struts2>1.3</nuiton-struts2> + <!--Multilanguage maven-site --> + <locales>fr,en</locales> + + </properties> + + + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + + <name>Ressource exemple entity</name> + + <description>Web publication api for Wikitty publication</description> + <inceptionYear>2011</inceptionYear> + + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> + + <build> + + <resources> + <resource> + <directory>src/main/resources</directory> + </resource> + <resource> + <directory> + ${project.build.directory}/generated-sources/models + </directory> + <includes> + <include>*.objectmodel</include> + <include>*.properties</include> + </includes> + </resource> + </resources> + + <plugins> + <!--plugin> + <groupId>org.nuiton.i18n</groupId> + <artifactId>maven-i18n-plugin</artifactId> + <version>${nuitonI18nVersion}</version> + <configuration> + <bundles>fr_FR,en_GB</bundles> + </configuration> + <executions> + <execution> + <id>scan-and-gen</id> + <goals> + <goal>parserJava</goal> + <goal>gen</goal> + </goals> + </execution> + </executions> + </plugin--> + + <plugin> + <groupId>org.nuiton.eugene</groupId> + <artifactId>maven-eugene-plugin</artifactId> + <executions> + <execution> + <id>api-generation</id> + <phase>generate-sources</phase> + <configuration> + <inputs> + <input>zargo</input> + </inputs> + <fullPackagePath> + org.nuiton.wikitty.entities + </fullPackagePath> + <defaultPackage> + org.nuiton.wikitty.entities + </defaultPackage> + <extractedPackages> + org.nuiton.wikitty.entities + </extractedPackages> + <templates> + org.nuiton.wikitty.generator.WikittyMetaGenerator + </templates> + </configuration> + <goals> + <goal>smart-generate</goal> + </goals> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.nuiton.wikitty</groupId> + <artifactId>wikitty-generators</artifactId> + <version>3.2-SNAPSHOT</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> + + +</project> Added: trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/xmi/wp-resource.properties =================================================================== --- trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/xmi/wp-resource.properties (rev 0) +++ trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/xmi/wp-resource.properties 2011-08-28 14:55:30 UTC (rev 1193) @@ -0,0 +1,29 @@ +### +# #%L +# Wikitty :: api +# +# $Id: wikitty-publication.properties 1136 2011-08-12 14:24:03Z tchemit $ +# $HeadURL: http://svn.nuiton.org/svn/wikitty/trunk/wikitty-publication/src/main/xmi/wik... $ +# %% +# Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Lesser Public License for more details. +# +# You should have received a copy of the GNU General Lesser Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/lgpl-3.0.html>. +# #L% +### +org.nuiton.wikitty.entities.WikittyRessource.class.tagvalue.version=1.0 +org.nuiton.wikitty.entities.WikittyResa.class.tagvalue.version=1.0 + + + Added: trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/xmi/wp-resource.zargo =================================================================== (Binary files differ) Property changes on: trunk/wikitty-publication/src/site/exemple/resourceEntity/src/main/xmi/wp-resource.zargo ___________________________________________________________________ Added: svn:mime-type + application/octet-stream