# HG changeset patch # User František Kučera # Date 1270473674 -7200 # Node ID eb6fce71e85c90bf09e410d040054e8004a6ae1d # Parent 063871cec626bbb681eac13d269f3aba9b5553e8 Základ REST API. diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-ear/nbproject/build-impl.xml --- a/java/nekurak.net-ear/nbproject/build-impl.xml Tue Mar 23 16:11:07 2010 +0100 +++ b/java/nekurak.net-ear/nbproject/build-impl.xml Mon Apr 05 15:21:14 2010 +0200 @@ -166,6 +166,15 @@ + + + + + + + + + @@ -184,6 +193,7 @@ + @@ -261,6 +271,7 @@ + @@ -455,6 +466,15 @@ + + + + + + + + + diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-ear/nbproject/genfiles.properties --- a/java/nekurak.net-ear/nbproject/genfiles.properties Tue Mar 23 16:11:07 2010 +0100 +++ b/java/nekurak.net-ear/nbproject/genfiles.properties Mon Apr 05 15:21:14 2010 +0200 @@ -3,6 +3,6 @@ build.xml.stylesheet.CRC32=475c2a62@1.17.2 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=dd0510f0 -nbproject/build-impl.xml.script.CRC32=b94a2023 +nbproject/build-impl.xml.data.CRC32=efe37659 +nbproject/build-impl.xml.script.CRC32=4bf9637a nbproject/build-impl.xml.stylesheet.CRC32=624b8ca2@1.17.2 diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-ear/nbproject/project.properties --- a/java/nekurak.net-ear/nbproject/project.properties Tue Mar 23 16:11:07 2010 +0100 +++ b/java/nekurak.net-ear/nbproject/project.properties Mon Apr 05 15:21:14 2010 +0200 @@ -16,7 +16,8 @@ jar.compress=false jar.content.additional=\ ${reference.nekurak_net-web.dist-ear}:\ - ${reference.nekurak_net-ejb.dist-ear} + ${reference.nekurak_net-ejb.dist-ear}:\ + ${reference.nekurak_net-rest.dist-ear} jar.name=nekurak.net-ear.ear javac.debug=true javac.deprecation=false @@ -26,8 +27,10 @@ no.dependencies=false platform.active=default_platform project.nekurak_net-ejb=../nekurak.net-ejb +project.nekurak_net-rest=../nekurak.net-rest project.nekurak_net-web=../nekurak.net-web reference.nekurak_net-ejb.dist-ear=${project.nekurak_net-ejb}/dist/nekurak.net-ejb.jar +reference.nekurak_net-rest.dist-ear=${project.nekurak_net-rest}/dist/nekurak.net-rest.war reference.nekurak_net-web.dist-ear=${project.nekurak_net-web}/dist/nekurak.net-web.war resource.dir=setup run.classpath= diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-ear/nbproject/project.xml --- a/java/nekurak.net-ear/nbproject/project.xml Tue Mar 23 16:11:07 2010 +0100 +++ b/java/nekurak.net-ear/nbproject/project.xml Mon Apr 05 15:21:14 2010 +0200 @@ -15,6 +15,10 @@ ${reference.nekurak_net-ejb.dist-ear} / + + ${reference.nekurak_net-rest.dist-ear} + / + @@ -27,6 +31,14 @@ dist-ear + nekurak_net-rest + j2ee_ear_archive + + dist-ear + clean-ear + dist-ear + + nekurak_net-web j2ee_ear_archive diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/nbproject/ant-deploy.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/nbproject/ant-deploy.xml Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/nbproject/build-impl.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/nbproject/build-impl.xml Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,856 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.war + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/nbproject/genfiles.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/nbproject/genfiles.properties Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,11 @@ +build.xml.data.CRC32=8f44a4ef +build.xml.script.CRC32=fb1b7f84 +build.xml.stylesheet.CRC32=c0ebde35@1.21.2.1 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=8f44a4ef +nbproject/build-impl.xml.script.CRC32=f658df40 +nbproject/build-impl.xml.stylesheet.CRC32=b139b33b@1.21.2.1 +nbproject/rest-build.xml.data.CRC32=d32e8880 +nbproject/rest-build.xml.script.CRC32=23da2c77 +nbproject/rest-build.xml.stylesheet.CRC32=ddd64843@1.4.1 diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/nbproject/project.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/nbproject/project.properties Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,75 @@ +build.classes.dir=${build.web.dir}/WEB-INF/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +build.web.dir=${build.dir}/web +build.web.excludes=${build.classes.excludes} +client.urlPart= +compile.jsps=false +conf.dir=${source.root}/conf +debug.classpath=${build.classes.dir}:${javac.classpath} +debug.test.classpath=\ + ${run.test.classpath} +display.browser=true +dist.dir=dist +dist.ear.war=${dist.dir}/${war.ear.name} +dist.javadoc.dir=${dist.dir}/javadoc +dist.war=${dist.dir}/${war.name} +endorsed.classpath=\ + ${libs.javaee-endorsed-api-6.0.classpath} +excludes= +includes=** +j2ee.deploy.on.save=false +j2ee.platform=1.6-web +j2ee.server.type=gfv3ee6 +jar.compress=false +javac.classpath=\ + ${libs.restlib_gfv3ee6.classpath} +# Space-separated list of extra javac options +javac.compilerargs= +javac.debug=true +javac.deprecation=false +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.junit_4.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.preview=true +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jspcompilation.classpath=${jspc.classpath}:${javac.classpath} +lib.dir=${web.docbase.dir}/WEB-INF/lib +persistence.xml.dir=${conf.dir} +platform.active=default_platform +resource.dir=setup +rest.config.type=dd +rest.support.on=true +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running a class with a main method or a unit test +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): +runmain.jvmargs= +source.encoding=UTF-8 +source.root=src +src.dir=${source.root}/java +test.src.dir=test +war.content.additional= +war.ear.name=nekurak.net-rest.war +war.name=nekurak.net-rest.war +web.docbase.dir=web +webinf.dir=web/WEB-INF diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/nbproject/project.xml Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,27 @@ + + + org.netbeans.modules.web.project + + + + + + + + nekurak.net-rest + 1.6.5 + + + ${libs.restlib_gfv3ee6.classpath} + + + + + + + + + + + + diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/nbproject/rest-build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/nbproject/rest-build.xml Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package org.netbeans.rest.application.config; +/** + * This class is generated by the Netbeans IDE, + * and registers all REST root resources created in the project. + * Please, DO NOT EDIT this class ! + */ +@javax.ws.rs.ApplicationPath("${rest.resources.path}") +public class ApplicationConfig extends javax.ws.rs.core.Application { +} + + diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/src/conf/MANIFEST.MF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/src/conf/MANIFEST.MF Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/src/java/cz/frantovo/nekurak/rest/ClankyREST.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/src/java/cz/frantovo/nekurak/rest/ClankyREST.java Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,15 @@ +package cz.frantovo.nekurak.rest; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; + +@Path("clanek") +public class ClankyREST { + + @GET + @Produces("text/plain") + public String getText() { + return "ahoj"; + } +} diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/web/WEB-INF/beans.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/web/WEB-INF/beans.xml Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,5 @@ + + + diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/web/WEB-INF/sun-web.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/web/WEB-INF/sun-web.xml Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,11 @@ + + + + /nekurak.net-rest + + + + Keep a copy of the generated servlet class' java code. + + + diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/web/WEB-INF/web.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/web/WEB-INF/web.xml Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,17 @@ + + + + ServletAdaptor + com.sun.jersey.spi.container.servlet.ServletContainer + 1 + + + ServletAdaptor + /zdroje/* + + + + 30 + + + diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-rest/web/index.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-rest/web/index.jsp Mon Apr 05 15:21:14 2010 +0200 @@ -0,0 +1,24 @@ + + + + + + + + + REST + + +

REST

+

REST API

+ + + +
diff -r 063871cec626 -r eb6fce71e85c java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/RegistraceUzivatele.java --- a/java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/RegistraceUzivatele.java Tue Mar 23 16:11:07 2010 +0100 +++ b/java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/RegistraceUzivatele.java Mon Apr 05 15:21:14 2010 +0200 @@ -1,6 +1,5 @@ package cz.frantovo.nekurak.web; -import cz.frantovo.nekurak.vyjimky.NekurakVyjimka; import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -33,8 +32,8 @@ } /** - * @return true, pokud registrace proběhla, jinak vyhazuje výjimku. - * @throws NekurakVyjimka špatný token nebo chyba při zakládání uživatele + * @return null, pokud je vše v pořádku. + * Jinak vrací chybovou hlášku (resp. klíč k lokalizaci) */ public String getDokonciRegistraci() {