diff --git a/IdentityService/nbproject/build-impl.xml b/IdentityService/nbproject/build-impl.xml index 298b8d09fc98d020c3bccabb3e82102c145bdd78..f47cd5c329cb086de2afdaeea58ec6a16d55519b 100644 --- a/IdentityService/nbproject/build-impl.xml +++ b/IdentityService/nbproject/build-impl.xml @@ -997,10 +997,17 @@ exists or setup the property manually. For example like this: </target> <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/> <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest"> + <copyfiles files="${file.reference.commons-fileupload-1.3.2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> + <copyfiles files="${file.reference.mysql-connector-java-5.1.40-bin.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> + <copyfiles files="${file.reference.org.json.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> <mkdir dir="${build.web.dir}/META-INF"/> <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/> </target> - <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"/> + <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"> + <copyfiles files="${file.reference.commons-fileupload-1.3.2.jar}" todir="${build.web.dir}/WEB-INF/lib"/> + <copyfiles files="${file.reference.mysql-connector-java-5.1.40-bin.jar}" todir="${build.web.dir}/WEB-INF/lib"/> + <copyfiles files="${file.reference.org.json.jar}" todir="${build.web.dir}/WEB-INF/lib"/> + </target> <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib"> <delete dir="${build.web.dir}/WEB-INF/lib"/> </target> diff --git a/IdentityService/nbproject/genfiles.properties b/IdentityService/nbproject/genfiles.properties index 384a259b7fdde539117324954d261bbffe09a244..262a3a2a53cc1112616580d5bf6d9e04e973c8ab 100644 --- a/IdentityService/nbproject/genfiles.properties +++ b/IdentityService/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=e503d7fd +build.xml.data.CRC32=1d216b83 build.xml.script.CRC32=e342e6c3 build.xml.stylesheet.CRC32=651128d4@1.77.1.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=e503d7fd -nbproject/build-impl.xml.script.CRC32=1bf58e11 +nbproject/build-impl.xml.data.CRC32=1d216b83 +nbproject/build-impl.xml.script.CRC32=21e9d869 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 diff --git a/IdentityService/nbproject/project.properties b/IdentityService/nbproject/project.properties index 8bcfc037ce0ac41f3cec801f73464c51dc9059c3..592fb7b8598bcebd2948dc8a2e89cc13cc84c2ff 100644 --- a/IdentityService/nbproject/project.properties +++ b/IdentityService/nbproject/project.properties @@ -28,6 +28,9 @@ dist.war=${dist.dir}/${war.name} endorsed.classpath=\ ${libs.javaee-endorsed-api-7.0.classpath} excludes= +file.reference.commons-fileupload-1.3.2.jar=..\\commons-fileupload-1.3.2.jar +file.reference.mysql-connector-java-5.1.40-bin.jar=..\\mysql-connector-java-5.1.40-bin.jar +file.reference.org.json.jar=..\\org.json.jar includes=** j2ee.compile.on.save=true j2ee.copy.static.files.on.save=true @@ -41,7 +44,10 @@ j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.ja j2ee.platform.wsit.classpath= j2ee.server.type=gfv3ee6 jar.compress=false -javac.classpath= +javac.classpath=\ + ${file.reference.commons-fileupload-1.3.2.jar}:\ + ${file.reference.mysql-connector-java-5.1.40-bin.jar}:\ + ${file.reference.org.json.jar} # Space-separated list of extra javac options javac.compilerargs= javac.debug=true diff --git a/IdentityService/nbproject/project.xml b/IdentityService/nbproject/project.xml index 1570b8b64667fe7f3335c7cb1347bb27716c29d4..657f876b53446f7fea6141ed266649f64e381d31 100644 --- a/IdentityService/nbproject/project.xml +++ b/IdentityService/nbproject/project.xml @@ -5,7 +5,20 @@ <data xmlns="http://www.netbeans.org/ns/web-project/3"> <name>IdentityService</name> <minimum-ant-version>1.6.5</minimum-ant-version> - <web-module-libraries/> + <web-module-libraries> + <library dirs="200"> + <file>${file.reference.commons-fileupload-1.3.2.jar}</file> + <path-in-war>WEB-INF/lib</path-in-war> + </library> + <library dirs="200"> + <file>${file.reference.mysql-connector-java-5.1.40-bin.jar}</file> + <path-in-war>WEB-INF/lib</path-in-war> + </library> + <library dirs="200"> + <file>${file.reference.org.json.jar}</file> + <path-in-war>WEB-INF/lib</path-in-war> + </library> + </web-module-libraries> <web-module-additional-libraries/> <source-roots> <root id="src.dir" name="Source Packages"/> diff --git a/IdentityService/src/java/json-simple-master/.classpath b/IdentityService/src/java/json-simple-master/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..41c3da140a6b92f92f28b128f2cfeb214e381ea6 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src/main/java"/> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/IdentityService/src/java/json-simple-master/.project b/IdentityService/src/java/json-simple-master/.project new file mode 100644 index 0000000000000000000000000000000000000000..b1980df94948567b27006ad58dd1b7bc0871c1d1 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>json-simple</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/IdentityService/src/java/json-simple-master/.settings/org.eclipse.core.resources.prefs b/IdentityService/src/java/json-simple-master/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000000000000000000000000000000000..f707871d90cd0d50b25f1a4aec380c35dbc2e916 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Mon Feb 06 00:32:07 CST 2012 +eclipse.preferences.version=1 +encoding/<project>=UTF-8 diff --git a/IdentityService/src/java/json-simple-master/AUTHORS.txt b/IdentityService/src/java/json-simple-master/AUTHORS.txt new file mode 100644 index 0000000000000000000000000000000000000000..2bea086506e80ca8ddb2d4a8c7e908d4f90fa1a6 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/AUTHORS.txt @@ -0,0 +1,3 @@ +Yidong Fang +Chris Nokleberg +Dave Hughes diff --git a/IdentityService/src/java/json-simple-master/ChangeLog.txt b/IdentityService/src/java/json-simple-master/ChangeLog.txt new file mode 100644 index 0000000000000000000000000000000000000000..b34ae2ce6e28c1ab9e06b1d813147db075ed48c9 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/ChangeLog.txt @@ -0,0 +1,28 @@ +ChangeLog + +Version 1.1.1 (2012/01/29) +* Supports OSGi +* Accepts a java.util.Map parameter in constructor of JSONObject + +Version 1.1 (2009/01/23) +* Supports stoppable SAX-like content handler for streaming of JSON text +* Added JSONStreamAware to support streaming JSON text +* Added ContainerFactory to support creating arbitrary Map and List as JSON object and JSON array container during decoding +* Supports any Map and List as JSON object and JSON array container during encoding +* Added interface JSONAware +* Added ParseException to get detail error report while parsing +* Added escaping for Unicode characters that cause problems for browser JS eval + +Version 1.02 (2009/01/10) +* Updated json.lex to improve performance of the lexer +* Removed Rope.java and related junit test + +Version 1.01 (2008/08/26) +* License changed to a more commerce friendly and clear one, Apache License 2.0 +* Use JFlex to generate a faster Yylex.java +* Added Rope.java to get faster string operations +* Separate test codes from source codes +* Added ant build file build.xml + +Version 1.0 (2006/04/15) +* Initial version diff --git a/IdentityService/src/java/json-simple-master/LICENSE.txt b/IdentityService/src/java/json-simple-master/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/IdentityService/src/java/json-simple-master/README.txt b/IdentityService/src/java/json-simple-master/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..be14817f2b42e44bc9407ad9d2d87dc04f393e43 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/README.txt @@ -0,0 +1,2 @@ +Please visit: +http://code.google.com/p/json-simple/ \ No newline at end of file diff --git a/IdentityService/src/java/json-simple-master/VERSION.txt b/IdentityService/src/java/json-simple-master/VERSION.txt new file mode 100644 index 0000000000000000000000000000000000000000..524cb55242b53f6a64cc646ea05db6acc7696d2d --- /dev/null +++ b/IdentityService/src/java/json-simple-master/VERSION.txt @@ -0,0 +1 @@ +1.1.1 diff --git a/IdentityService/src/java/json-simple-master/build.xml b/IdentityService/src/java/json-simple-master/build.xml new file mode 100644 index 0000000000000000000000000000000000000000..01a29645150337e47b1945054d4da9010571df53 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/build.xml @@ -0,0 +1,41 @@ +<project name="json-simple" default="main" basedir="."> + <property name="current-version" value="1.1.1"/> + <property name="targetDir" value="target"/> + <property name="javaSourceDir" value="src/main/java"/> + <property name="javaTargetDir" value="target/classes"/> + + <target name="main" depends="jar"></target> + + <target name="clean"> + <delete includeemptydirs="true"> + <fileset dir="${targetDir}" includes="**/*"/> + </delete> + </target> + + <target name="mkdir"> + <mkdir dir="${javaTargetDir}"/> + </target> + + <target name="compile" depends="mkdir"> + <javac srcdir="${javaSourceDir}" + destdir="${javaTargetDir}" + includes="**/*.java" + target="1.2" + source="1.2"/> + </target> + + <target name="jar" depends="compile"> + <jar destfile="${targetDir}/json-simple-${current-version}.jar" + basedir="${javaTargetDir}" + includes="**/*.class"> + <manifest> + <attribute name="Bundle-Name" value="JSON.simple"/> + <attribute name="Bundle-SymbolicName" value="com.googlecode.json-simple.json-simple"/> + <attribute name="Bundle-Version" value="${current-version}"/> + <attribute name="Bundle-License" value="http://www.apache.org/licenses/LICENSE-2.0.txt"/> + <attribute name="Bundle-Description" value="A simple Java toolkit for JSON"/> + <attribute name="Export-Package" value="org.json.simple, org.json.simple.parser"/> + </manifest> + </jar> + </target> +</project> diff --git a/IdentityService/src/java/json-simple-master/doc/json.lex b/IdentityService/src/java/json-simple-master/doc/json.lex new file mode 100644 index 0000000000000000000000000000000000000000..40aa08c08299f43c5d59fc11cd77733b5e142736 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/doc/json.lex @@ -0,0 +1,61 @@ +package org.json.simple.parser; + +%% + +%{ +private StringBuffer sb=new StringBuffer(); + +int getPosition(){ + return yychar; +} + +%} + +%table +%unicode +%state STRING_BEGIN + +%yylexthrow ParseException +%char + +HEX_D = [a-fA-F0-9] +INT = [-]?[0-9]+ +DOUBLE = {INT}((\.[0-9]+)?([eE][-+]?[0-9]+)?) +WS = [ \t\r\n] +UNESCAPED_CH = [^\"\\] +FALLBACK_CH = . +%% + +<STRING_BEGIN> \" { yybegin(YYINITIAL);return new Yytoken(Yytoken.TYPE_VALUE, sb.toString());} +<STRING_BEGIN> {UNESCAPED_CH}+ { sb.append(yytext());} +<STRING_BEGIN> \\\" {sb.append('"');} +<STRING_BEGIN> \\\\ {sb.append('\\');} +<STRING_BEGIN> \\\/ {sb.append('/');} +<STRING_BEGIN> \\b {sb.append('\b');} +<STRING_BEGIN> \\f {sb.append('\f');} +<STRING_BEGIN> \\n {sb.append('\n');} +<STRING_BEGIN> \\r {sb.append('\r');} +<STRING_BEGIN> \\t {sb.append('\t');} +<STRING_BEGIN> \\u{HEX_D}{HEX_D}{HEX_D}{HEX_D} { try{ + int ch=Integer.parseInt(yytext().substring(2),16); + sb.append((char)ch); + } + catch(Exception e){ + throw new ParseException(yychar, ParseException.ERROR_UNEXPECTED_EXCEPTION, e); + } + } +<STRING_BEGIN> \\ {sb.append('\\');} + +<YYINITIAL> \" { sb = null; sb = new StringBuffer(); yybegin(STRING_BEGIN);} +<YYINITIAL> {INT} { Long val=Long.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);} +<YYINITIAL> {DOUBLE} { Double val=Double.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);} +<YYINITIAL> "true"|"false" { Boolean val=Boolean.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);} +<YYINITIAL> "null" { return new Yytoken(Yytoken.TYPE_VALUE, null);} +<YYINITIAL> "{" { return new Yytoken(Yytoken.TYPE_LEFT_BRACE,null);} +<YYINITIAL> "}" { return new Yytoken(Yytoken.TYPE_RIGHT_BRACE,null);} +<YYINITIAL> "[" { return new Yytoken(Yytoken.TYPE_LEFT_SQUARE,null);} +<YYINITIAL> "]" { return new Yytoken(Yytoken.TYPE_RIGHT_SQUARE,null);} +<YYINITIAL> "," { return new Yytoken(Yytoken.TYPE_COMMA,null);} +<YYINITIAL> ":" { return new Yytoken(Yytoken.TYPE_COLON,null);} +<YYINITIAL> {WS}+ {} +<YYINITIAL> {FALLBACK_CH} { throw new ParseException(yychar, ParseException.ERROR_UNEXPECTED_CHAR, new Character(yycharat(0)));} diff --git a/IdentityService/src/java/json-simple-master/pom.xml b/IdentityService/src/java/json-simple-master/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..bfa0b627af0aef49affb3473ba5e73b475f54464 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/pom.xml @@ -0,0 +1,111 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>com.googlecode.json-simple</groupId> + <artifactId>json-simple</artifactId> + <packaging>bundle</packaging> + <name>JSON.simple</name> + <version>1.1.1</version> + <description>A simple Java toolkit for JSON</description> + <url>http://code.google.com/p/json-simple/</url> + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + </license> + </licenses> + <developers> + <developer> + <id>Yidong</id> + <name>Yidong Fang</name> + <roles> + <role>architect</role> + <role>developer</role> + </roles> + <timezone>+8</timezone> + </developer> + </developers> + <scm> + <connection>scm:svn:http://json-simple.googlecode.com/svn/trunk/</connection> + <developerConnection>scm:svn:http://json-simple.googlecode.com/svn/trunk/</developerConnection> + <url>http://json-simple.googlecode.com/svn/trunk/</url> + </scm> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.10</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <version>2.3.6</version> + <extensions>true</extensions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.2</version> + <configuration> + <source>1.2</source> + <target>1.2</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>2.1.2</version> + <executions> + <execution> + <id>attach-sources</id> + <phase>verify</phase> + <goals> + <goal>jar-no-fork</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>release-sign-artifacts</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + <version>1.4</version> + <executions> + <execution> + <id>sign-artifacts</id> + <phase>verify</phase> + <goals> + <goal>sign</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + +</project> + diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/ItemList.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/ItemList.java new file mode 100644 index 0000000000000000000000000000000000000000..830961b960448a1b40d71ef42cfc27e27dfac273 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/ItemList.java @@ -0,0 +1,147 @@ +/* + * $Id: ItemList.java,v 1.1 2006/04/15 14:10:48 platform Exp $ + * Created on 2006-3-24 + */ +package org.json.simple; + +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +/** + * |a:b:c| => |a|,|b|,|c| + * |:| => ||,|| + * |a:| => |a|,|| + * @author FangYidong<fangyidong@yahoo.com.cn> + */ +public class ItemList { + private String sp=","; + List items=new ArrayList(); + + + public ItemList(){} + + + public ItemList(String s){ + this.split(s,sp,items); + } + + public ItemList(String s,String sp){ + this.sp=s; + this.split(s,sp,items); + } + + public ItemList(String s,String sp,boolean isMultiToken){ + split(s,sp,items,isMultiToken); + } + + public List getItems(){ + return this.items; + } + + public String[] getArray(){ + return (String[])this.items.toArray(); + } + + public void split(String s,String sp,List append,boolean isMultiToken){ + if(s==null || sp==null) + return; + if(isMultiToken){ + StringTokenizer tokens=new StringTokenizer(s,sp); + while(tokens.hasMoreTokens()){ + append.add(tokens.nextToken().trim()); + } + } + else{ + this.split(s,sp,append); + } + } + + public void split(String s,String sp,List append){ + if(s==null || sp==null) + return; + int pos=0; + int prevPos=0; + do{ + prevPos=pos; + pos=s.indexOf(sp,pos); + if(pos==-1) + break; + append.add(s.substring(prevPos,pos).trim()); + pos+=sp.length(); + }while(pos!=-1); + append.add(s.substring(prevPos).trim()); + } + + public void setSP(String sp){ + this.sp=sp; + } + + public void add(int i,String item){ + if(item==null) + return; + items.add(i,item.trim()); + } + + public void add(String item){ + if(item==null) + return; + items.add(item.trim()); + } + + public void addAll(ItemList list){ + items.addAll(list.items); + } + + public void addAll(String s){ + this.split(s,sp,items); + } + + public void addAll(String s,String sp){ + this.split(s,sp,items); + } + + public void addAll(String s,String sp,boolean isMultiToken){ + this.split(s,sp,items,isMultiToken); + } + + /** + * @param i 0-based + * @return + */ + public String get(int i){ + return (String)items.get(i); + } + + public int size(){ + return items.size(); + } + + public String toString(){ + return toString(sp); + } + + public String toString(String sp){ + StringBuffer sb=new StringBuffer(); + + for(int i=0;i<items.size();i++){ + if(i==0) + sb.append(items.get(i)); + else{ + sb.append(sp); + sb.append(items.get(i)); + } + } + return sb.toString(); + + } + + public void clear(){ + items.clear(); + } + + public void reset(){ + sp=","; + items.clear(); + } +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONArray.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONArray.java new file mode 100644 index 0000000000000000000000000000000000000000..60f54c45d12094b316d05b705ad645e0f163af8d --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONArray.java @@ -0,0 +1,381 @@ +/* + * $Id: JSONArray.java,v 1.1 2006/04/15 14:10:48 platform Exp $ + * Created on 2006-4-10 + */ +package org.json.simple; + +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +/** + * A JSON array. JSONObject supports java.util.List interface. + * + * @author FangYidong<fangyidong@yahoo.com.cn> + */ +public class JSONArray extends ArrayList implements JSONAware, JSONStreamAware { + private static final long serialVersionUID = 3957988303675231981L; + + /** + * Constructs an empty JSONArray. + */ + public JSONArray(){ + super(); + } + + /** + * Constructs a JSONArray containing the elements of the specified + * collection, in the order they are returned by the collection's iterator. + * + * @param c the collection whose elements are to be placed into this JSONArray + */ + public JSONArray(Collection c){ + super(c); + } + + /** + * Encode a list into JSON text and write it to out. + * If this list is also a JSONStreamAware or a JSONAware, JSONStreamAware and JSONAware specific behaviours will be ignored at this top level. + * + * @see org.json.simple.JSONValue#writeJSONString(Object, Writer) + * + * @param collection + * @param out + */ + public static void writeJSONString(Collection collection, Writer out) throws IOException{ + if(collection == null){ + out.write("null"); + return; + } + + boolean first = true; + Iterator iter=collection.iterator(); + + out.write('['); + while(iter.hasNext()){ + if(first) + first = false; + else + out.write(','); + + Object value=iter.next(); + if(value == null){ + out.write("null"); + continue; + } + + JSONValue.writeJSONString(value, out); + } + out.write(']'); + } + + public void writeJSONString(Writer out) throws IOException{ + writeJSONString(this, out); + } + + /** + * Convert a list to JSON text. The result is a JSON array. + * If this list is also a JSONAware, JSONAware specific behaviours will be omitted at this top level. + * + * @see org.json.simple.JSONValue#toJSONString(Object) + * + * @param collection + * @return JSON text, or "null" if list is null. + */ + public static String toJSONString(Collection collection){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(collection, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + public static void writeJSONString(byte[] array, Writer out) throws IOException{ + if(array == null){ + out.write("null"); + } else if(array.length == 0) { + out.write("[]"); + } else { + out.write("["); + out.write(String.valueOf(array[0])); + + for(int i = 1; i < array.length; i++){ + out.write(","); + out.write(String.valueOf(array[i])); + } + + out.write("]"); + } + } + + public static String toJSONString(byte[] array){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(array, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + public static void writeJSONString(short[] array, Writer out) throws IOException{ + if(array == null){ + out.write("null"); + } else if(array.length == 0) { + out.write("[]"); + } else { + out.write("["); + out.write(String.valueOf(array[0])); + + for(int i = 1; i < array.length; i++){ + out.write(","); + out.write(String.valueOf(array[i])); + } + + out.write("]"); + } + } + + public static String toJSONString(short[] array){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(array, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + public static void writeJSONString(int[] array, Writer out) throws IOException{ + if(array == null){ + out.write("null"); + } else if(array.length == 0) { + out.write("[]"); + } else { + out.write("["); + out.write(String.valueOf(array[0])); + + for(int i = 1; i < array.length; i++){ + out.write(","); + out.write(String.valueOf(array[i])); + } + + out.write("]"); + } + } + + public static String toJSONString(int[] array){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(array, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + public static void writeJSONString(long[] array, Writer out) throws IOException{ + if(array == null){ + out.write("null"); + } else if(array.length == 0) { + out.write("[]"); + } else { + out.write("["); + out.write(String.valueOf(array[0])); + + for(int i = 1; i < array.length; i++){ + out.write(","); + out.write(String.valueOf(array[i])); + } + + out.write("]"); + } + } + + public static String toJSONString(long[] array){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(array, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + public static void writeJSONString(float[] array, Writer out) throws IOException{ + if(array == null){ + out.write("null"); + } else if(array.length == 0) { + out.write("[]"); + } else { + out.write("["); + out.write(String.valueOf(array[0])); + + for(int i = 1; i < array.length; i++){ + out.write(","); + out.write(String.valueOf(array[i])); + } + + out.write("]"); + } + } + + public static String toJSONString(float[] array){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(array, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + public static void writeJSONString(double[] array, Writer out) throws IOException{ + if(array == null){ + out.write("null"); + } else if(array.length == 0) { + out.write("[]"); + } else { + out.write("["); + out.write(String.valueOf(array[0])); + + for(int i = 1; i < array.length; i++){ + out.write(","); + out.write(String.valueOf(array[i])); + } + + out.write("]"); + } + } + + public static String toJSONString(double[] array){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(array, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + public static void writeJSONString(boolean[] array, Writer out) throws IOException{ + if(array == null){ + out.write("null"); + } else if(array.length == 0) { + out.write("[]"); + } else { + out.write("["); + out.write(String.valueOf(array[0])); + + for(int i = 1; i < array.length; i++){ + out.write(","); + out.write(String.valueOf(array[i])); + } + + out.write("]"); + } + } + + public static String toJSONString(boolean[] array){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(array, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + public static void writeJSONString(char[] array, Writer out) throws IOException{ + if(array == null){ + out.write("null"); + } else if(array.length == 0) { + out.write("[]"); + } else { + out.write("[\""); + out.write(String.valueOf(array[0])); + + for(int i = 1; i < array.length; i++){ + out.write("\",\""); + out.write(String.valueOf(array[i])); + } + + out.write("\"]"); + } + } + + public static String toJSONString(char[] array){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(array, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + public static void writeJSONString(Object[] array, Writer out) throws IOException{ + if(array == null){ + out.write("null"); + } else if(array.length == 0) { + out.write("[]"); + } else { + out.write("["); + JSONValue.writeJSONString(array[0], out); + + for(int i = 1; i < array.length; i++){ + out.write(","); + JSONValue.writeJSONString(array[i], out); + } + + out.write("]"); + } + } + + public static String toJSONString(Object[] array){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(array, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + public String toJSONString(){ + return toJSONString(this); + } + + /** + * Returns a string representation of this array. This is equivalent to + * calling {@link JSONArray#toJSONString()}. + */ + public String toString() { + return toJSONString(); + } +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONAware.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONAware.java new file mode 100644 index 0000000000000000000000000000000000000000..5e7452faa7fd051ba135c92cf13e7efe5db37323 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONAware.java @@ -0,0 +1,12 @@ +package org.json.simple; + +/** + * Beans that support customized output of JSON text shall implement this interface. + * @author FangYidong<fangyidong@yahoo.com.cn> + */ +public interface JSONAware { + /** + * @return JSON text + */ + String toJSONString(); +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONObject.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONObject.java new file mode 100644 index 0000000000000000000000000000000000000000..fafa36b214ba7db29dc07439501902a6e7ca9da6 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONObject.java @@ -0,0 +1,132 @@ +/* + * $Id: JSONObject.java,v 1.1 2006/04/15 14:10:48 platform Exp $ + * Created on 2006-4-10 + */ +package org.json.simple; + +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +/** + * A JSON object. Key value pairs are unordered. JSONObject supports java.util.Map interface. + * + * @author FangYidong<fangyidong@yahoo.com.cn> + */ +public class JSONObject extends HashMap implements Map, JSONAware, JSONStreamAware{ + + private static final long serialVersionUID = -503443796854799292L; + + + public JSONObject() { + super(); + } + + /** + * Allows creation of a JSONObject from a Map. After that, both the + * generated JSONObject and the Map can be modified independently. + * + * @param map + */ + public JSONObject(Map map) { + super(map); + } + + + /** + * Encode a map into JSON text and write it to out. + * If this map is also a JSONAware or JSONStreamAware, JSONAware or JSONStreamAware specific behaviours will be ignored at this top level. + * + * @see org.json.simple.JSONValue#writeJSONString(Object, Writer) + * + * @param map + * @param out + */ + public static void writeJSONString(Map map, Writer out) throws IOException { + if(map == null){ + out.write("null"); + return; + } + + boolean first = true; + Iterator iter=map.entrySet().iterator(); + + out.write('{'); + while(iter.hasNext()){ + if(first) + first = false; + else + out.write(','); + Map.Entry entry=(Map.Entry)iter.next(); + out.write('\"'); + out.write(escape(String.valueOf(entry.getKey()))); + out.write('\"'); + out.write(':'); + JSONValue.writeJSONString(entry.getValue(), out); + } + out.write('}'); + } + + public void writeJSONString(Writer out) throws IOException{ + writeJSONString(this, out); + } + + /** + * Convert a map to JSON text. The result is a JSON object. + * If this map is also a JSONAware, JSONAware specific behaviours will be omitted at this top level. + * + * @see org.json.simple.JSONValue#toJSONString(Object) + * + * @param map + * @return JSON text, or "null" if map is null. + */ + public static String toJSONString(Map map){ + final StringWriter writer = new StringWriter(); + + try { + writeJSONString(map, writer); + return writer.toString(); + } catch (IOException e) { + // This should never happen with a StringWriter + throw new RuntimeException(e); + } + } + + public String toJSONString(){ + return toJSONString(this); + } + + public String toString(){ + return toJSONString(); + } + + public static String toString(String key,Object value){ + StringBuffer sb = new StringBuffer(); + sb.append('\"'); + if(key == null) + sb.append("null"); + else + JSONValue.escape(key, sb); + sb.append('\"').append(':'); + + sb.append(JSONValue.toJSONString(value)); + + return sb.toString(); + } + + /** + * Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F). + * It's the same as JSONValue.escape() only for compatibility here. + * + * @see org.json.simple.JSONValue#escape(String) + * + * @param s + * @return + */ + public static String escape(String s){ + return JSONValue.escape(s); + } +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONStreamAware.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONStreamAware.java new file mode 100644 index 0000000000000000000000000000000000000000..ab63b3e578cadb0073e1331d13ca27f60ead594a --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONStreamAware.java @@ -0,0 +1,15 @@ +package org.json.simple; + +import java.io.IOException; +import java.io.Writer; + +/** + * Beans that support customized output of JSON text to a writer shall implement this interface. + * @author FangYidong<fangyidong@yahoo.com.cn> + */ +public interface JSONStreamAware { + /** + * write JSON string to out. + */ + void writeJSONString(Writer out) throws IOException; +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONValue.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONValue.java new file mode 100644 index 0000000000000000000000000000000000000000..5da3cd09411df984b9c5436f37e73cc6c332d496 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/JSONValue.java @@ -0,0 +1,316 @@ +/* + * $Id: JSONValue.java,v 1.1 2006/04/15 14:37:04 platform Exp $ + * Created on 2006-4-15 + */ +package org.json.simple; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; +import java.util.Collection; +// import java.util.List; +import java.util.Map; + +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; + + +/** + * @author FangYidong<fangyidong@yahoo.com.cn> + */ +public class JSONValue { + /** + * Parse JSON text into java object from the input source. + * Please use parseWithException() if you don't want to ignore the exception. + * + * @see org.json.simple.parser.JSONParser#parse(Reader) + * @see #parseWithException(Reader) + * + * @param in + * @return Instance of the following: + * org.json.simple.JSONObject, + * org.json.simple.JSONArray, + * java.lang.String, + * java.lang.Number, + * java.lang.Boolean, + * null + * + * @deprecated this method may throw an {@code Error} instead of returning + * {@code null}; please use {@link JSONValue#parseWithException(Reader)} + * instead + */ + public static Object parse(Reader in){ + try{ + JSONParser parser=new JSONParser(); + return parser.parse(in); + } + catch(Exception e){ + return null; + } + } + + /** + * Parse JSON text into java object from the given string. + * Please use parseWithException() if you don't want to ignore the exception. + * + * @see org.json.simple.parser.JSONParser#parse(Reader) + * @see #parseWithException(Reader) + * + * @param s + * @return Instance of the following: + * org.json.simple.JSONObject, + * org.json.simple.JSONArray, + * java.lang.String, + * java.lang.Number, + * java.lang.Boolean, + * null + * + * @deprecated this method may throw an {@code Error} instead of returning + * {@code null}; please use {@link JSONValue#parseWithException(String)} + * instead + */ + public static Object parse(String s){ + StringReader in=new StringReader(s); + return parse(in); + } + + /** + * Parse JSON text into java object from the input source. + * + * @see org.json.simple.parser.JSONParser + * + * @param in + * @return Instance of the following: + * org.json.simple.JSONObject, + * org.json.simple.JSONArray, + * java.lang.String, + * java.lang.Number, + * java.lang.Boolean, + * null + * + * @throws IOException + * @throws ParseException + */ + public static Object parseWithException(Reader in) throws IOException, ParseException{ + JSONParser parser=new JSONParser(); + return parser.parse(in); + } + + public static Object parseWithException(String s) throws ParseException{ + JSONParser parser=new JSONParser(); + return parser.parse(s); + } + + /** + * Encode an object into JSON text and write it to out. + * <p> + * If this object is a Map or a List, and it's also a JSONStreamAware or a JSONAware, JSONStreamAware or JSONAware will be considered firstly. + * <p> + * DO NOT call this method from writeJSONString(Writer) of a class that implements both JSONStreamAware and (Map or List) with + * "this" as the first parameter, use JSONObject.writeJSONString(Map, Writer) or JSONArray.writeJSONString(List, Writer) instead. + * + * @see org.json.simple.JSONObject#writeJSONString(Map, Writer) + * @see org.json.simple.JSONArray#writeJSONString(List, Writer) + * + * @param value + * @param writer + */ + public static void writeJSONString(Object value, Writer out) throws IOException { + if(value == null){ + out.write("null"); + return; + } + + if(value instanceof String){ + out.write('\"'); + out.write(escape((String)value)); + out.write('\"'); + return; + } + + if(value instanceof Double){ + if(((Double)value).isInfinite() || ((Double)value).isNaN()) + out.write("null"); + else + out.write(value.toString()); + return; + } + + if(value instanceof Float){ + if(((Float)value).isInfinite() || ((Float)value).isNaN()) + out.write("null"); + else + out.write(value.toString()); + return; + } + + if(value instanceof Number){ + out.write(value.toString()); + return; + } + + if(value instanceof Boolean){ + out.write(value.toString()); + return; + } + + if((value instanceof JSONStreamAware)){ + ((JSONStreamAware)value).writeJSONString(out); + return; + } + + if((value instanceof JSONAware)){ + out.write(((JSONAware)value).toJSONString()); + return; + } + + if(value instanceof Map){ + JSONObject.writeJSONString((Map)value, out); + return; + } + + if(value instanceof Collection){ + JSONArray.writeJSONString((Collection)value, out); + return; + } + + if(value instanceof byte[]){ + JSONArray.writeJSONString((byte[])value, out); + return; + } + + if(value instanceof short[]){ + JSONArray.writeJSONString((short[])value, out); + return; + } + + if(value instanceof int[]){ + JSONArray.writeJSONString((int[])value, out); + return; + } + + if(value instanceof long[]){ + JSONArray.writeJSONString((long[])value, out); + return; + } + + if(value instanceof float[]){ + JSONArray.writeJSONString((float[])value, out); + return; + } + + if(value instanceof double[]){ + JSONArray.writeJSONString((double[])value, out); + return; + } + + if(value instanceof boolean[]){ + JSONArray.writeJSONString((boolean[])value, out); + return; + } + + if(value instanceof char[]){ + JSONArray.writeJSONString((char[])value, out); + return; + } + + if(value instanceof Object[]){ + JSONArray.writeJSONString((Object[])value, out); + return; + } + + out.write(value.toString()); + } + + /** + * Convert an object to JSON text. + * <p> + * If this object is a Map or a List, and it's also a JSONAware, JSONAware will be considered firstly. + * <p> + * DO NOT call this method from toJSONString() of a class that implements both JSONAware and Map or List with + * "this" as the parameter, use JSONObject.toJSONString(Map) or JSONArray.toJSONString(List) instead. + * + * @see org.json.simple.JSONObject#toJSONString(Map) + * @see org.json.simple.JSONArray#toJSONString(List) + * + * @param value + * @return JSON text, or "null" if value is null or it's an NaN or an INF number. + */ + public static String toJSONString(Object value){ + final StringWriter writer = new StringWriter(); + + try{ + writeJSONString(value, writer); + return writer.toString(); + } catch(IOException e){ + // This should never happen for a StringWriter + throw new RuntimeException(e); + } + } + + /** + * Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F). + * @param s + * @return + */ + public static String escape(String s){ + if(s==null) + return null; + StringBuffer sb = new StringBuffer(); + escape(s, sb); + return sb.toString(); + } + + /** + * @param s - Must not be null. + * @param sb + */ + static void escape(String s, StringBuffer sb) { + final int len = s.length(); + for(int i=0;i<len;i++){ + char ch=s.charAt(i); + switch(ch){ + case '"': + sb.append("\\\""); + break; + case '\\': + sb.append("\\\\"); + break; + case '\b': + sb.append("\\b"); + break; + case '\f': + sb.append("\\f"); + break; + case '\n': + sb.append("\\n"); + break; + case '\r': + sb.append("\\r"); + break; + case '\t': + sb.append("\\t"); + break; + case '/': + sb.append("\\/"); + break; + default: + //Reference: http://www.unicode.org/versions/Unicode5.1.0/ + if((ch>='\u0000' && ch<='\u001F') || (ch>='\u007F' && ch<='\u009F') || (ch>='\u2000' && ch<='\u20FF')){ + String ss=Integer.toHexString(ch); + sb.append("\\u"); + for(int k=0;k<4-ss.length();k++){ + sb.append('0'); + } + sb.append(ss.toUpperCase()); + } + else{ + sb.append(ch); + } + } + }//for + } + +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/ContainerFactory.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/ContainerFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..0bb7baf2d554e404d670cfd01dc168eb6da7a282 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/ContainerFactory.java @@ -0,0 +1,23 @@ +package org.json.simple.parser; + +import java.util.List; +import java.util.Map; + +/** + * Container factory for creating containers for JSON object and JSON array. + * + * @see org.json.simple.parser.JSONParser#parse(java.io.Reader, ContainerFactory) + * + * @author FangYidong<fangyidong@yahoo.com.cn> + */ +public interface ContainerFactory { + /** + * @return A Map instance to store JSON object, or null if you want to use org.json.simple.JSONObject. + */ + Map createObjectContainer(); + + /** + * @return A List instance to store JSON array, or null if you want to use org.json.simple.JSONArray. + */ + List creatArrayContainer(); +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/ContentHandler.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/ContentHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..056a85c482861226b24c3f3d25c249b4486e76d8 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/ContentHandler.java @@ -0,0 +1,110 @@ +package org.json.simple.parser; + +import java.io.IOException; + +/** + * A simplified and stoppable SAX-like content handler for stream processing of JSON text. + * + * @see org.xml.sax.ContentHandler + * @see org.json.simple.parser.JSONParser#parse(java.io.Reader, ContentHandler, boolean) + * + * @author FangYidong<fangyidong@yahoo.com.cn> + */ +public interface ContentHandler { + /** + * Receive notification of the beginning of JSON processing. + * The parser will invoke this method only once. + * + * @throws ParseException + * - JSONParser will stop and throw the same exception to the caller when receiving this exception. + */ + void startJSON() throws ParseException, IOException; + + /** + * Receive notification of the end of JSON processing. + * + * @throws ParseException + */ + void endJSON() throws ParseException, IOException; + + /** + * Receive notification of the beginning of a JSON object. + * + * @return false if the handler wants to stop parsing after return. + * @throws ParseException + * - JSONParser will stop and throw the same exception to the caller when receiving this exception. + * @see #endJSON + */ + boolean startObject() throws ParseException, IOException; + + /** + * Receive notification of the end of a JSON object. + * + * @return false if the handler wants to stop parsing after return. + * @throws ParseException + * + * @see #startObject + */ + boolean endObject() throws ParseException, IOException; + + /** + * Receive notification of the beginning of a JSON object entry. + * + * @param key - Key of a JSON object entry. + * + * @return false if the handler wants to stop parsing after return. + * @throws ParseException + * + * @see #endObjectEntry + */ + boolean startObjectEntry(String key) throws ParseException, IOException; + + /** + * Receive notification of the end of the value of previous object entry. + * + * @return false if the handler wants to stop parsing after return. + * @throws ParseException + * + * @see #startObjectEntry + */ + boolean endObjectEntry() throws ParseException, IOException; + + /** + * Receive notification of the beginning of a JSON array. + * + * @return false if the handler wants to stop parsing after return. + * @throws ParseException + * + * @see #endArray + */ + boolean startArray() throws ParseException, IOException; + + /** + * Receive notification of the end of a JSON array. + * + * @return false if the handler wants to stop parsing after return. + * @throws ParseException + * + * @see #startArray + */ + boolean endArray() throws ParseException, IOException; + + /** + * Receive notification of the JSON primitive values: + * java.lang.String, + * java.lang.Number, + * java.lang.Boolean + * null + * + * @param value - Instance of the following: + * java.lang.String, + * java.lang.Number, + * java.lang.Boolean + * null + * + * @return false if the handler wants to stop parsing after return. + * @throws ParseException + */ + boolean primitive(Object value) throws ParseException, IOException; + +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/JSONParser.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/JSONParser.java new file mode 100644 index 0000000000000000000000000000000000000000..59f8e316e10be7fdc51f703fc2d7d7d5d981bce2 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/JSONParser.java @@ -0,0 +1,533 @@ +/* + * $Id: JSONParser.java,v 1.1 2006/04/15 14:10:48 platform Exp $ + * Created on 2006-4-15 + */ +package org.json.simple.parser; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; + + +/** + * Parser for JSON text. Please note that JSONParser is NOT thread-safe. + * + * @author FangYidong<fangyidong@yahoo.com.cn> + */ +public class JSONParser { + public static final int S_INIT=0; + public static final int S_IN_FINISHED_VALUE=1;//string,number,boolean,null,object,array + public static final int S_IN_OBJECT=2; + public static final int S_IN_ARRAY=3; + public static final int S_PASSED_PAIR_KEY=4; + public static final int S_IN_PAIR_VALUE=5; + public static final int S_END=6; + public static final int S_IN_ERROR=-1; + + private LinkedList handlerStatusStack; + private Yylex lexer = new Yylex((Reader)null); + private Yytoken token = null; + private int status = S_INIT; + + private int peekStatus(LinkedList statusStack){ + if(statusStack.size()==0) + return -1; + Integer status=(Integer)statusStack.getFirst(); + return status.intValue(); + } + + /** + * Reset the parser to the initial state without resetting the underlying reader. + * + */ + public void reset(){ + token = null; + status = S_INIT; + handlerStatusStack = null; + } + + /** + * Reset the parser to the initial state with a new character reader. + * + * @param in - The new character reader. + * @throws IOException + * @throws ParseException + */ + public void reset(Reader in){ + lexer.yyreset(in); + reset(); + } + + /** + * @return The position of the beginning of the current token. + */ + public int getPosition(){ + return lexer.getPosition(); + } + + public Object parse(String s) throws ParseException{ + return parse(s, (ContainerFactory)null); + } + + public Object parse(String s, ContainerFactory containerFactory) throws ParseException{ + StringReader in=new StringReader(s); + try{ + return parse(in, containerFactory); + } + catch(IOException ie){ + /* + * Actually it will never happen. + */ + throw new ParseException(-1, ParseException.ERROR_UNEXPECTED_EXCEPTION, ie); + } + } + + public Object parse(Reader in) throws IOException, ParseException{ + return parse(in, (ContainerFactory)null); + } + + /** + * Parse JSON text into java object from the input source. + * + * @param in + * @param containerFactory - Use this factory to createyour own JSON object and JSON array containers. + * @return Instance of the following: + * org.json.simple.JSONObject, + * org.json.simple.JSONArray, + * java.lang.String, + * java.lang.Number, + * java.lang.Boolean, + * null + * + * @throws IOException + * @throws ParseException + */ + public Object parse(Reader in, ContainerFactory containerFactory) throws IOException, ParseException{ + reset(in); + LinkedList statusStack = new LinkedList(); + LinkedList valueStack = new LinkedList(); + + try{ + do{ + nextToken(); + switch(status){ + case S_INIT: + switch(token.type){ + case Yytoken.TYPE_VALUE: + status=S_IN_FINISHED_VALUE; + statusStack.addFirst(new Integer(status)); + valueStack.addFirst(token.value); + break; + case Yytoken.TYPE_LEFT_BRACE: + status=S_IN_OBJECT; + statusStack.addFirst(new Integer(status)); + valueStack.addFirst(createObjectContainer(containerFactory)); + break; + case Yytoken.TYPE_LEFT_SQUARE: + status=S_IN_ARRAY; + statusStack.addFirst(new Integer(status)); + valueStack.addFirst(createArrayContainer(containerFactory)); + break; + default: + status=S_IN_ERROR; + }//inner switch + break; + + case S_IN_FINISHED_VALUE: + if(token.type==Yytoken.TYPE_EOF) + return valueStack.removeFirst(); + else + throw new ParseException(getPosition(), ParseException.ERROR_UNEXPECTED_TOKEN, token); + + case S_IN_OBJECT: + switch(token.type){ + case Yytoken.TYPE_COMMA: + break; + case Yytoken.TYPE_VALUE: + if(token.value instanceof String){ + String key=(String)token.value; + valueStack.addFirst(key); + status=S_PASSED_PAIR_KEY; + statusStack.addFirst(new Integer(status)); + } + else{ + status=S_IN_ERROR; + } + break; + case Yytoken.TYPE_RIGHT_BRACE: + if(valueStack.size()>1){ + statusStack.removeFirst(); + valueStack.removeFirst(); + status=peekStatus(statusStack); + } + else{ + status=S_IN_FINISHED_VALUE; + } + break; + default: + status=S_IN_ERROR; + break; + }//inner switch + break; + + case S_PASSED_PAIR_KEY: + switch(token.type){ + case Yytoken.TYPE_COLON: + break; + case Yytoken.TYPE_VALUE: + statusStack.removeFirst(); + String key=(String)valueStack.removeFirst(); + Map parent=(Map)valueStack.getFirst(); + parent.put(key,token.value); + status=peekStatus(statusStack); + break; + case Yytoken.TYPE_LEFT_SQUARE: + statusStack.removeFirst(); + key=(String)valueStack.removeFirst(); + parent=(Map)valueStack.getFirst(); + List newArray=createArrayContainer(containerFactory); + parent.put(key,newArray); + status=S_IN_ARRAY; + statusStack.addFirst(new Integer(status)); + valueStack.addFirst(newArray); + break; + case Yytoken.TYPE_LEFT_BRACE: + statusStack.removeFirst(); + key=(String)valueStack.removeFirst(); + parent=(Map)valueStack.getFirst(); + Map newObject=createObjectContainer(containerFactory); + parent.put(key,newObject); + status=S_IN_OBJECT; + statusStack.addFirst(new Integer(status)); + valueStack.addFirst(newObject); + break; + default: + status=S_IN_ERROR; + } + break; + + case S_IN_ARRAY: + switch(token.type){ + case Yytoken.TYPE_COMMA: + break; + case Yytoken.TYPE_VALUE: + List val=(List)valueStack.getFirst(); + val.add(token.value); + break; + case Yytoken.TYPE_RIGHT_SQUARE: + if(valueStack.size()>1){ + statusStack.removeFirst(); + valueStack.removeFirst(); + status=peekStatus(statusStack); + } + else{ + status=S_IN_FINISHED_VALUE; + } + break; + case Yytoken.TYPE_LEFT_BRACE: + val=(List)valueStack.getFirst(); + Map newObject=createObjectContainer(containerFactory); + val.add(newObject); + status=S_IN_OBJECT; + statusStack.addFirst(new Integer(status)); + valueStack.addFirst(newObject); + break; + case Yytoken.TYPE_LEFT_SQUARE: + val=(List)valueStack.getFirst(); + List newArray=createArrayContainer(containerFactory); + val.add(newArray); + status=S_IN_ARRAY; + statusStack.addFirst(new Integer(status)); + valueStack.addFirst(newArray); + break; + default: + status=S_IN_ERROR; + }//inner switch + break; + case S_IN_ERROR: + throw new ParseException(getPosition(), ParseException.ERROR_UNEXPECTED_TOKEN, token); + }//switch + if(status==S_IN_ERROR){ + throw new ParseException(getPosition(), ParseException.ERROR_UNEXPECTED_TOKEN, token); + } + }while(token.type!=Yytoken.TYPE_EOF); + } + catch(IOException ie){ + throw ie; + } + + throw new ParseException(getPosition(), ParseException.ERROR_UNEXPECTED_TOKEN, token); + } + + private void nextToken() throws ParseException, IOException{ + token = lexer.yylex(); + if(token == null) + token = new Yytoken(Yytoken.TYPE_EOF, null); + } + + private Map createObjectContainer(ContainerFactory containerFactory){ + if(containerFactory == null) + return new JSONObject(); + Map m = containerFactory.createObjectContainer(); + + if(m == null) + return new JSONObject(); + return m; + } + + private List createArrayContainer(ContainerFactory containerFactory){ + if(containerFactory == null) + return new JSONArray(); + List l = containerFactory.creatArrayContainer(); + + if(l == null) + return new JSONArray(); + return l; + } + + public void parse(String s, ContentHandler contentHandler) throws ParseException{ + parse(s, contentHandler, false); + } + + public void parse(String s, ContentHandler contentHandler, boolean isResume) throws ParseException{ + StringReader in=new StringReader(s); + try{ + parse(in, contentHandler, isResume); + } + catch(IOException ie){ + /* + * Actually it will never happen. + */ + throw new ParseException(-1, ParseException.ERROR_UNEXPECTED_EXCEPTION, ie); + } + } + + public void parse(Reader in, ContentHandler contentHandler) throws IOException, ParseException{ + parse(in, contentHandler, false); + } + + /** + * Stream processing of JSON text. + * + * @see ContentHandler + * + * @param in + * @param contentHandler + * @param isResume - Indicates if it continues previous parsing operation. + * If set to true, resume parsing the old stream, and parameter 'in' will be ignored. + * If this method is called for the first time in this instance, isResume will be ignored. + * + * @throws IOException + * @throws ParseException + */ + public void parse(Reader in, ContentHandler contentHandler, boolean isResume) throws IOException, ParseException{ + if(!isResume){ + reset(in); + handlerStatusStack = new LinkedList(); + } + else{ + if(handlerStatusStack == null){ + isResume = false; + reset(in); + handlerStatusStack = new LinkedList(); + } + } + + LinkedList statusStack = handlerStatusStack; + + try{ + do{ + switch(status){ + case S_INIT: + contentHandler.startJSON(); + nextToken(); + switch(token.type){ + case Yytoken.TYPE_VALUE: + status=S_IN_FINISHED_VALUE; + statusStack.addFirst(new Integer(status)); + if(!contentHandler.primitive(token.value)) + return; + break; + case Yytoken.TYPE_LEFT_BRACE: + status=S_IN_OBJECT; + statusStack.addFirst(new Integer(status)); + if(!contentHandler.startObject()) + return; + break; + case Yytoken.TYPE_LEFT_SQUARE: + status=S_IN_ARRAY; + statusStack.addFirst(new Integer(status)); + if(!contentHandler.startArray()) + return; + break; + default: + status=S_IN_ERROR; + }//inner switch + break; + + case S_IN_FINISHED_VALUE: + nextToken(); + if(token.type==Yytoken.TYPE_EOF){ + contentHandler.endJSON(); + status = S_END; + return; + } + else{ + status = S_IN_ERROR; + throw new ParseException(getPosition(), ParseException.ERROR_UNEXPECTED_TOKEN, token); + } + + case S_IN_OBJECT: + nextToken(); + switch(token.type){ + case Yytoken.TYPE_COMMA: + break; + case Yytoken.TYPE_VALUE: + if(token.value instanceof String){ + String key=(String)token.value; + status=S_PASSED_PAIR_KEY; + statusStack.addFirst(new Integer(status)); + if(!contentHandler.startObjectEntry(key)) + return; + } + else{ + status=S_IN_ERROR; + } + break; + case Yytoken.TYPE_RIGHT_BRACE: + if(statusStack.size()>1){ + statusStack.removeFirst(); + status=peekStatus(statusStack); + } + else{ + status=S_IN_FINISHED_VALUE; + } + if(!contentHandler.endObject()) + return; + break; + default: + status=S_IN_ERROR; + break; + }//inner switch + break; + + case S_PASSED_PAIR_KEY: + nextToken(); + switch(token.type){ + case Yytoken.TYPE_COLON: + break; + case Yytoken.TYPE_VALUE: + statusStack.removeFirst(); + status=peekStatus(statusStack); + if(!contentHandler.primitive(token.value)) + return; + if(!contentHandler.endObjectEntry()) + return; + break; + case Yytoken.TYPE_LEFT_SQUARE: + statusStack.removeFirst(); + statusStack.addFirst(new Integer(S_IN_PAIR_VALUE)); + status=S_IN_ARRAY; + statusStack.addFirst(new Integer(status)); + if(!contentHandler.startArray()) + return; + break; + case Yytoken.TYPE_LEFT_BRACE: + statusStack.removeFirst(); + statusStack.addFirst(new Integer(S_IN_PAIR_VALUE)); + status=S_IN_OBJECT; + statusStack.addFirst(new Integer(status)); + if(!contentHandler.startObject()) + return; + break; + default: + status=S_IN_ERROR; + } + break; + + case S_IN_PAIR_VALUE: + /* + * S_IN_PAIR_VALUE is just a marker to indicate the end of an object entry, it doesn't proccess any token, + * therefore delay consuming token until next round. + */ + statusStack.removeFirst(); + status = peekStatus(statusStack); + if(!contentHandler.endObjectEntry()) + return; + break; + + case S_IN_ARRAY: + nextToken(); + switch(token.type){ + case Yytoken.TYPE_COMMA: + break; + case Yytoken.TYPE_VALUE: + if(!contentHandler.primitive(token.value)) + return; + break; + case Yytoken.TYPE_RIGHT_SQUARE: + if(statusStack.size()>1){ + statusStack.removeFirst(); + status=peekStatus(statusStack); + } + else{ + status=S_IN_FINISHED_VALUE; + } + if(!contentHandler.endArray()) + return; + break; + case Yytoken.TYPE_LEFT_BRACE: + status=S_IN_OBJECT; + statusStack.addFirst(new Integer(status)); + if(!contentHandler.startObject()) + return; + break; + case Yytoken.TYPE_LEFT_SQUARE: + status=S_IN_ARRAY; + statusStack.addFirst(new Integer(status)); + if(!contentHandler.startArray()) + return; + break; + default: + status=S_IN_ERROR; + }//inner switch + break; + + case S_END: + return; + + case S_IN_ERROR: + throw new ParseException(getPosition(), ParseException.ERROR_UNEXPECTED_TOKEN, token); + }//switch + if(status==S_IN_ERROR){ + throw new ParseException(getPosition(), ParseException.ERROR_UNEXPECTED_TOKEN, token); + } + }while(token.type!=Yytoken.TYPE_EOF); + } + catch(IOException ie){ + status = S_IN_ERROR; + throw ie; + } + catch(ParseException pe){ + status = S_IN_ERROR; + throw pe; + } + catch(RuntimeException re){ + status = S_IN_ERROR; + throw re; + } + catch(Error e){ + status = S_IN_ERROR; + throw e; + } + + status = S_IN_ERROR; + throw new ParseException(getPosition(), ParseException.ERROR_UNEXPECTED_TOKEN, token); + } +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/ParseException.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/ParseException.java new file mode 100644 index 0000000000000000000000000000000000000000..09b1fd49eaa819fc411b34e2660f33db0dc463fb --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/ParseException.java @@ -0,0 +1,90 @@ +package org.json.simple.parser; + +/** + * ParseException explains why and where the error occurs in source JSON text. + * + * @author FangYidong<fangyidong@yahoo.com.cn> + * + */ +public class ParseException extends Exception { + private static final long serialVersionUID = -7880698968187728547L; + + public static final int ERROR_UNEXPECTED_CHAR = 0; + public static final int ERROR_UNEXPECTED_TOKEN = 1; + public static final int ERROR_UNEXPECTED_EXCEPTION = 2; + + private int errorType; + private Object unexpectedObject; + private int position; + + public ParseException(int errorType){ + this(-1, errorType, null); + } + + public ParseException(int errorType, Object unexpectedObject){ + this(-1, errorType, unexpectedObject); + } + + public ParseException(int position, int errorType, Object unexpectedObject){ + this.position = position; + this.errorType = errorType; + this.unexpectedObject = unexpectedObject; + } + + public int getErrorType() { + return errorType; + } + + public void setErrorType(int errorType) { + this.errorType = errorType; + } + + /** + * @see org.json.simple.parser.JSONParser#getPosition() + * + * @return The character position (starting with 0) of the input where the error occurs. + */ + public int getPosition() { + return position; + } + + public void setPosition(int position) { + this.position = position; + } + + /** + * @see org.json.simple.parser.Yytoken + * + * @return One of the following base on the value of errorType: + * ERROR_UNEXPECTED_CHAR java.lang.Character + * ERROR_UNEXPECTED_TOKEN org.json.simple.parser.Yytoken + * ERROR_UNEXPECTED_EXCEPTION java.lang.Exception + */ + public Object getUnexpectedObject() { + return unexpectedObject; + } + + public void setUnexpectedObject(Object unexpectedObject) { + this.unexpectedObject = unexpectedObject; + } + + public String getMessage() { + StringBuffer sb = new StringBuffer(); + + switch(errorType){ + case ERROR_UNEXPECTED_CHAR: + sb.append("Unexpected character (").append(unexpectedObject).append(") at position ").append(position).append("."); + break; + case ERROR_UNEXPECTED_TOKEN: + sb.append("Unexpected token ").append(unexpectedObject).append(" at position ").append(position).append("."); + break; + case ERROR_UNEXPECTED_EXCEPTION: + sb.append("Unexpected exception at position ").append(position).append(": ").append(unexpectedObject); + break; + default: + sb.append("Unkown error at position ").append(position).append("."); + break; + } + return sb.toString(); + } +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/Yylex.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/Yylex.java new file mode 100644 index 0000000000000000000000000000000000000000..dc36fa2856643adfee46512fd8ec30055b526794 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/Yylex.java @@ -0,0 +1,688 @@ +/* The following code was generated by JFlex 1.4.2 */ + +package org.json.simple.parser; + +class Yylex { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int STRING_BEGIN = 2; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\0\1\7\1\7\2\0\1\7\22\0\1\7\1\0\1\11\10\0"+ + "\1\6\1\31\1\2\1\4\1\12\12\3\1\32\6\0\4\1\1\5"+ + "\1\1\24\0\1\27\1\10\1\30\3\0\1\22\1\13\2\1\1\21"+ + "\1\14\5\0\1\23\1\0\1\15\3\0\1\16\1\24\1\17\1\20"+ + "\5\0\1\25\1\0\1\26\uff82\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\2\0\2\1\1\2\1\3\1\4\3\1\1\5\1\6"+ + "\1\7\1\10\1\11\1\12\1\13\1\14\1\15\5\0"+ + "\1\14\1\16\1\17\1\20\1\21\1\22\1\23\1\24"+ + "\1\0\1\25\1\0\1\25\4\0\1\26\1\27\2\0"+ + "\1\30"; + + private static int [] zzUnpackAction() { + int [] result = new int[45]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\33\0\66\0\121\0\154\0\207\0\66\0\242"+ + "\0\275\0\330\0\66\0\66\0\66\0\66\0\66\0\66"+ + "\0\363\0\u010e\0\66\0\u0129\0\u0144\0\u015f\0\u017a\0\u0195"+ + "\0\66\0\66\0\66\0\66\0\66\0\66\0\66\0\66"+ + "\0\u01b0\0\u01cb\0\u01e6\0\u01e6\0\u0201\0\u021c\0\u0237\0\u0252"+ + "\0\66\0\66\0\u026d\0\u0288\0\66"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[45]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int ZZ_TRANS [] = { + 2, 2, 3, 4, 2, 2, 2, 5, 2, 6, + 2, 2, 7, 8, 2, 9, 2, 2, 2, 2, + 2, 10, 11, 12, 13, 14, 15, 16, 16, 16, + 16, 16, 16, 16, 16, 17, 18, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 4, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 4, 19, 20, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 5, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 16, 16, 16, 16, 16, 16, 16, + 16, -1, -1, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + -1, -1, -1, -1, -1, -1, -1, -1, 24, 25, + 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 34, 35, -1, -1, + 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 39, -1, 39, -1, 39, -1, -1, + -1, -1, -1, 39, 39, -1, -1, -1, -1, 39, + 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 33, -1, 20, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 42, -1, 42, -1, 42, + -1, -1, -1, -1, -1, 42, 42, -1, -1, -1, + -1, 42, 42, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, -1, 43, -1, 43, -1, -1, -1, + -1, -1, 43, 43, -1, -1, -1, -1, 43, 43, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, + -1, 44, -1, 44, -1, -1, -1, -1, -1, 44, + 44, -1, -1, -1, -1, 44, 44, -1, -1, -1, + -1, -1, -1, -1, -1, + }; + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code> + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\2\0\1\11\3\1\1\11\3\1\6\11\2\1\1\11"+ + "\5\0\10\11\1\0\1\1\1\0\1\1\4\0\2\11"+ + "\2\0\1\11"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[45]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /* user code: */ +private StringBuffer sb=new StringBuffer(); + +int getPosition(){ + return yychar; +} + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + Yylex(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + Yylex(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 90) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return <code>false</code>, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * <b>cannot</b> be reused (internal buffer is discarded and lost). + * Lexical state is set to <tt>ZZ_INITIAL</tt>. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position <tt>pos</tt> from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Yytoken yylex() throws java.io.IOException, ParseException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 11: + { sb.append(yytext()); + } + case 25: break; + case 4: + { sb = null; sb = new StringBuffer(); yybegin(STRING_BEGIN); + } + case 26: break; + case 16: + { sb.append('\b'); + } + case 27: break; + case 6: + { return new Yytoken(Yytoken.TYPE_RIGHT_BRACE,null); + } + case 28: break; + case 23: + { Boolean val=Boolean.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val); + } + case 29: break; + case 22: + { return new Yytoken(Yytoken.TYPE_VALUE, null); + } + case 30: break; + case 13: + { yybegin(YYINITIAL);return new Yytoken(Yytoken.TYPE_VALUE, sb.toString()); + } + case 31: break; + case 12: + { sb.append('\\'); + } + case 32: break; + case 21: + { Double val=Double.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val); + } + case 33: break; + case 1: + { throw new ParseException(yychar, ParseException.ERROR_UNEXPECTED_CHAR, new Character(yycharat(0))); + } + case 34: break; + case 8: + { return new Yytoken(Yytoken.TYPE_RIGHT_SQUARE,null); + } + case 35: break; + case 19: + { sb.append('\r'); + } + case 36: break; + case 15: + { sb.append('/'); + } + case 37: break; + case 10: + { return new Yytoken(Yytoken.TYPE_COLON,null); + } + case 38: break; + case 14: + { sb.append('"'); + } + case 39: break; + case 5: + { return new Yytoken(Yytoken.TYPE_LEFT_BRACE,null); + } + case 40: break; + case 17: + { sb.append('\f'); + } + case 41: break; + case 24: + { try{ + int ch=Integer.parseInt(yytext().substring(2),16); + sb.append((char)ch); + } + catch(Exception e){ + throw new ParseException(yychar, ParseException.ERROR_UNEXPECTED_EXCEPTION, e); + } + } + case 42: break; + case 20: + { sb.append('\t'); + } + case 43: break; + case 7: + { return new Yytoken(Yytoken.TYPE_LEFT_SQUARE,null); + } + case 44: break; + case 2: + { Long val=Long.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val); + } + case 45: break; + case 18: + { sb.append('\n'); + } + case 46: break; + case 9: + { return new Yytoken(Yytoken.TYPE_COMMA,null); + } + case 47: break; + case 3: + { + } + case 48: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + return null; + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/Yytoken.java b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/Yytoken.java new file mode 100644 index 0000000000000000000000000000000000000000..9d7e7e723b2aa80156b88bc581c4f020b8e781d7 --- /dev/null +++ b/IdentityService/src/java/json-simple-master/src/main/java/org/json/simple/parser/Yytoken.java @@ -0,0 +1,58 @@ +/* + * $Id: Yytoken.java,v 1.1 2006/04/15 14:10:48 platform Exp $ + * Created on 2006-4-15 + */ +package org.json.simple.parser; + +/** + * @author FangYidong<fangyidong@yahoo.com.cn> + */ +public class Yytoken { + public static final int TYPE_VALUE=0;//JSON primitive value: string,number,boolean,null + public static final int TYPE_LEFT_BRACE=1; + public static final int TYPE_RIGHT_BRACE=2; + public static final int TYPE_LEFT_SQUARE=3; + public static final int TYPE_RIGHT_SQUARE=4; + public static final int TYPE_COMMA=5; + public static final int TYPE_COLON=6; + public static final int TYPE_EOF=-1;//end of file + + public int type=0; + public Object value=null; + + public Yytoken(int type,Object value){ + this.type=type; + this.value=value; + } + + public String toString(){ + StringBuffer sb = new StringBuffer(); + switch(type){ + case TYPE_VALUE: + sb.append("VALUE(").append(value).append(")"); + break; + case TYPE_LEFT_BRACE: + sb.append("LEFT BRACE({)"); + break; + case TYPE_RIGHT_BRACE: + sb.append("RIGHT BRACE(})"); + break; + case TYPE_LEFT_SQUARE: + sb.append("LEFT SQUARE([)"); + break; + case TYPE_RIGHT_SQUARE: + sb.append("RIGHT SQUARE(])"); + break; + case TYPE_COMMA: + sb.append("COMMA(,)"); + break; + case TYPE_COLON: + sb.append("COLON(:)"); + break; + case TYPE_EOF: + sb.append("END OF FILE"); + break; + } + return sb.toString(); + } +} diff --git a/IdentityService/src/java/json-simple-master/test.xml b/IdentityService/src/java/json-simple-master/test.xml new file mode 100644 index 0000000000000000000000000000000000000000..1cbfc898cf2904cbb89d472fdb0aadae8b13987a --- /dev/null +++ b/IdentityService/src/java/json-simple-master/test.xml @@ -0,0 +1,48 @@ +<project name="json-simple" default="main" basedir="."> + <path id="runtime.path"> + <fileset dir="lib"> + <include name="*.jar"/> + </fileset> + <pathelement location="build/test"/> + </path> + + <path id="compile.path"> + <fileset dir="lib"> + <include name="*.jar"/> + </fileset> + </path> + + <target name="main" depends="mkdir,compile,junit"> + </target> + + <target name="clean"> + <delete includeemptydirs="true"> + <fileset dir="build/test" includes="**/*"/> + <fileset dir="." includes="TEST-*.txt"/> + </delete> + </target> + + <target name="mkdir"> + <mkdir dir="build/test"/> + </target> + + <target name="compile"> + <javac srcdir="test" + destdir="build/test" + includes="**/*.java" + encoding="UTF-8" + target="1.2" + source="1.2"> + <classpath refid="compile.path"/> + </javac> + </target> + + <target name="junit"> + <junit> + <classpath refid="runtime.path"/> + <formatter type="plain"/> + <test name="org.json.simple.Test"/> + <test name="org.json.simple.parser.YylexTest"/> + </junit> + </target> +</project> diff --git a/IdentityService/src/java/validate/SignIn.java b/IdentityService/src/java/validate/SignIn.java new file mode 100644 index 0000000000000000000000000000000000000000..c4db84487405c0634b290ad35eb43f68dc18b069 --- /dev/null +++ b/IdentityService/src/java/validate/SignIn.java @@ -0,0 +1,226 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Validate; + +import java.io.IOException; +import java.io.PrintWriter; +import java.math.BigInteger; +import java.security.SecureRandom; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.json.simple.JSONObject; + +/** + * + * @author raudi + */ +@WebServlet(name = "SignIn", urlPatterns = {"/SignIn"}) +public class SignIn extends HttpServlet { + + /** + * Processes requests for both HTTP <code>GET</code> and <code>POST</code> + * methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + * @throws java.sql.SQLException + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + String username = request.getParameter("username"); + String email = request.getParameter("email"); + String password = request.getParameter("password"); + + try { + Class.forName("com.mysql.jdbc.Driver"); + } catch (ClassNotFoundException ex) { + Logger.getLogger(SignIn.class.getName()).log(Level.SEVERE, null, ex); + } + try + ( Connection conn = DriverManager.getConnection( + "jdbc:mysql://localhost:3306/Identity?zeroDateTimeBehavior=convertToNull", + "root", + ""); + Statement stmt = conn.createStatement()) { + String sql; + sql = "SELECT * FROM account WHERE username = ? and password = ?"; + PreparedStatement dbStatement = conn.prepareStatement(sql); + dbStatement.setString(1, username); + dbStatement.setString(2, password); + JSONObject json = new JSONObject(); + /* Get every data returned by SQL query */ + ResultSet rs = dbStatement.executeQuery(); + if (rs.next()) { + + SecureRandom random = new SecureRandom(); + String token = new BigInteger(130, random).toString(32); + + String sqlCek; + boolean ulang = true; + PreparedStatement dbStatementCek; + + while (ulang) { + token = new BigInteger(130, random).toString(32); + sqlCek = "SELECT * FROM token WHERE token = ?"; + dbStatementCek = conn.prepareStatement(sqlCek); + dbStatementCek.setString(1, token); + ResultSet rsCek = dbStatementCek.executeQuery(); + if (rsCek.next()) { + ulang = true; + } else { + ulang = false; + } + } + + Date dNow = new Date(); + SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd"); + SimpleDateFormat timeFormat = new SimpleDateFormat ("HH:mm:ss"); + String time_expired = timeFormat.format(dNow); + String date_expired = dateFormat.format(dNow); + String sqlInputToken; + sqlInputToken = "INSERT INTO token(id_account,token,date_expired,time_expired) VALUES(?,?,?,?)"; + PreparedStatement dbStatementInputToken = conn.prepareStatement(sqlInputToken); + dbStatementInputToken.setInt(1, rs.getInt("id")); + dbStatementInputToken.setString(2, token); + dbStatementInputToken.setString(3, date_expired); + dbStatementInputToken.setString(4, time_expired); + int rsInputToken = dbStatementInputToken.executeUpdate(); + + json.put("id",rs.getInt("id")); + json.put("fullname",rs.getString("fullname")); + json.put("username",rs.getString("username")); + json.put("address",rs.getString("address")); + json.put("postalcode",rs.getString("postalcode")); + json.put("phonenumber",rs.getString("phonenumber")); + json.put("token",token); + } else { + String sqlEmail; + sqlEmail = "SELECT * FROM account WHERE email = ? and password = ?"; + PreparedStatement dbStatementEmail = conn.prepareStatement(sqlEmail,Statement.RETURN_GENERATED_KEYS); + dbStatementEmail.setString(1, email); + dbStatementEmail.setString(2, password); + ResultSet rsEmail = dbStatementEmail.executeQuery(); + if (rsEmail.next()) { + SecureRandom random = new SecureRandom(); + String token = new BigInteger(130, random).toString(32); + + String sqlCek; + boolean ulang = true; + PreparedStatement dbStatementCek; + + while (ulang) { + token = new BigInteger(130, random).toString(32); + sqlCek = "SELECT * FROM token WHERE token = ?"; + dbStatementCek = conn.prepareStatement(sqlCek); + dbStatementCek.setString(1, token); + ResultSet rsCek = dbStatementCek.executeQuery(); + if (rsCek.next()) { + ulang = true; + } else { + ulang = false; + } + } + + Date dNow = new Date(); + SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd"); + SimpleDateFormat timeFormat = new SimpleDateFormat ("HH:mm:ss"); + String time_expired = timeFormat.format(dNow); + String date_expired = dateFormat.format(dNow); + String sqlInputToken; + sqlInputToken = "INSERT INTO token(id_account,token,date_expired,time_expired) VALUES(?,?,?,?)"; + PreparedStatement dbStatementInputToken = conn.prepareStatement(sqlInputToken); + dbStatementInputToken.setInt(1, rs.getInt("id")); + dbStatementInputToken.setString(2, token); + dbStatementInputToken.setString(3, date_expired); + dbStatementInputToken.setString(4, time_expired); + int rsInputToken = dbStatementInputToken.executeUpdate(); + + json.put("id",rsEmail.getInt("id")); + json.put("fullname",rsEmail.getString("fullname")); + json.put("username",rsEmail.getString("username")); + json.put("address",rsEmail.getString("address")); + json.put("postalcode",rsEmail.getString("postalcode")); + json.put("phonenumber",rsEmail.getString("phonenumber")); + json.put("token",token); + } else { + json.put("id",0); + json.put("fullname",""); + json.put("username",""); + json.put("address",""); + json.put("postalcode",""); + json.put("phonenumber",""); + } + } + /* Get every data returned by SQL query */ + + response.setContentType("application/json"); + response.getWriter().write(json.toString()); + rs.close(); + stmt.close(); + conn.close(); + } + } catch (SQLException | IOException ex) { + + } + } + + // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> + /** + * Handles the HTTP <code>GET</code> method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Handles the HTTP <code>POST</code> method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// </editor-fold> + +} diff --git a/IdentityService/src/java/validate/ValidateToken.java b/IdentityService/src/java/validate/ValidateToken.java new file mode 100644 index 0000000000000000000000000000000000000000..08f6de13a1420d9ce03af194a7384c9906699afb --- /dev/null +++ b/IdentityService/src/java/validate/ValidateToken.java @@ -0,0 +1,88 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package validate; + +import java.io.IOException; +import java.io.PrintWriter; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * + * @author TIFAH06 + */ +@WebServlet(name = "ValidateToken", urlPatterns = {"/ValidateToken"}) +public class ValidateToken extends HttpServlet { + + /** + * Processes requests for both HTTP <code>GET</code> and <code>POST</code> + * methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + /* TODO output your page here. You may use following sample code. */ + out.println("<!DOCTYPE html>"); + out.println("<html>"); + out.println("<head>"); + out.println("<title>Servlet ValidateToken</title>"); + out.println("</head>"); + out.println("<body>"); + out.println("<h1>Servlet ValidateToken at " + request.getContextPath() + "</h1>"); + out.println("</body>"); + out.println("</html>"); + } + } + + // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> + /** + * Handles the HTTP <code>GET</code> method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Handles the HTTP <code>POST</code> method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// </editor-fold> + +} diff --git a/WebApp/web/index.jsp b/WebApp/web/index.jsp index fed9a26dee64cd2ee4c418bad9fe9d2e6e1e7b29..d1e438f4a4129a8ae3383f31ac779affb3d36c03 100644 --- a/WebApp/web/index.jsp +++ b/WebApp/web/index.jsp @@ -4,7 +4,10 @@ Author : TIFAH06 --%> -<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page contentType="text/html" pageEncoding="UTF-8" + + + %> <!DOCTYPE html> <html> <head> @@ -32,7 +35,7 @@ <body> <div class="login" id="form-login"> <h2 class="title">---LOGIN---</h2> - <form name="form-login" action="profile.jsp" method="post" onsubmit="return validateForm()"> + <form name="form-login" action="profile.jsp" method="post"> <div class="input-form"> <div class="label"> <p style="width: 120px;">Username</p> diff --git a/build/web/META-INF/MANIFEST.MF b/build/web/META-INF/MANIFEST.MF deleted file mode 100644 index 59499bce4a2bd51cba227b7c00fcf745b19c95a4..0000000000000000000000000000000000000000 --- a/build/web/META-INF/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/build/web/WEB-INF/classes/.netbeans_automatic_build b/build/web/WEB-INF/classes/.netbeans_automatic_build deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/build/web/WEB-INF/classes/.netbeans_update_resources b/build/web/WEB-INF/classes/.netbeans_update_resources deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/build/web/WEB-INF/glassfish-web.xml b/build/web/WEB-INF/glassfish-web.xml deleted file mode 100644 index 13e0059fffb79e9888f6bfa2f5249d72cad958d1..0000000000000000000000000000000000000000 --- a/build/web/WEB-INF/glassfish-web.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"> -<glassfish-web-app error-url=""> - <class-loader delegate="true"/> - <jsp-config> - <property name="keepgenerated" value="true"> - <description>Keep a copy of the generated servlet class' java code.</description> - </property> - </jsp-config> -</glassfish-web-app> diff --git a/build/web/WEB-INF/web.xml b/build/web/WEB-INF/web.xml deleted file mode 100644 index 6058a36702ad03a4cd622100cfee7881c4e2e62b..0000000000000000000000000000000000000000 --- a/build/web/WEB-INF/web.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" - version="3.1"> - <session-config> - <session-timeout> - 30 - </session-timeout> - </session-config> -</web-app> diff --git a/build/web/driver-history.jsp b/build/web/driver-history.jsp deleted file mode 100644 index a4d6ab882f672e13754e21b093c97b83fe3f2d85..0000000000000000000000000000000000000000 --- a/build/web/driver-history.jsp +++ /dev/null @@ -1,63 +0,0 @@ -<html> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="description" content="Ngo-Jek - Ojek Online Clone Website"> - <meta name="author" content="Taufan Mahaputra, Robby Syaifullah, M Rafli"> - <!-- Properties Title --> - <link rel="shortcut icon" href="historydriver.css" /> - <title>Ngo-Jek</title> - - <!-- Custom CSS --> - <link href="style/main.css" rel="stylesheet" type='text/css' /> - <link href="style/driver-history.css" rel="stylesheet" type='text/css' /> - <!-- Custom Fonts --> - <link href="assets/stylesheets/font-awesome.css" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Patua+One" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Oswald:400,500,600" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Roboto:400,500" rel="stylesheet"> - <!-- Script --> - -</head> -<body> - <div class="container-his"> - <!-- navbar --> - <div class="navbar-his"> - <img src="assets/image/yesbos.png" class="logo-his"> - <div class="logout-his"> - <p style="margin-bottom: 2px;">Hi, <strong> </strong> !</p> - <a href="index.php">Logout</a> - </div> - </div> - <!-- navigation --> - <div class="header" id="header"> - <nav> - <ul> - <li><a href="sel-destination.jsp">ORDER</a></li> - <li><a href="order-history.jsp" class="option-active" >HISTORY</a></li> - <li><a href="profile.jsp" >MY PROFILE</a></li> - </ul> - </nav> - </div> - <!-- make-an-hist --> - <div class="make-an-hist"> - <div class="make-an-hist-header"> - TRANSACTION HISTORY - </div> - </div> - <div class="hist-header1"> - <btn class="hist-2" id="-active"> - <div class="content"><a href="order-history.jsp"> MY PREVIOUS ORDER </a></div> - </btn> - <btn class="hist-2 option-active-sub" > - <div class="content"><a href=""> DRIVER HISTORY </a></div> - </btn> - </div> - <table> - - - </table> - </div> -</body> -</html> diff --git a/build/web/gfv3ee6.dpf b/build/web/gfv3ee6.dpf deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/build/web/index.html b/build/web/index.html deleted file mode 100644 index fed47c6669a23a2ecb5a2f33bb3d9ec469848d12..0000000000000000000000000000000000000000 --- a/build/web/index.html +++ /dev/null @@ -1,17 +0,0 @@ -<!DOCTYPE html> -<!-- -To change this license header, choose License Headers in Project Properties. -To change this template file, choose Tools | Templates -and open the template in the editor. ---> -<html> - <head> - <title>TODO supply a title</title> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - </head> - <body> - <div>TODO write content</div> - <a href="order-history.jsp">Ini order-history</a> - </body> -</html> diff --git a/build/web/order-history.jsp b/build/web/order-history.jsp deleted file mode 100644 index d91aef3285cbab6749f17c59f7ded4ec824124f9..0000000000000000000000000000000000000000 --- a/build/web/order-history.jsp +++ /dev/null @@ -1,73 +0,0 @@ -<%-- - Document : order-history - Created on : Nov 5, 2017, 7:28:32 AM - Author : TIFAH06 ---%> - -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="description" content="Ngo-Jek - Ojek Online Clone Website"> - <meta name="author" content="Taufan Mahaputra, Robby Syaifullah, M Rafli"> - <!-- Properties Title --> - <link rel="shortcut icon" href="historypenumpang.css" /> - <title>Ngo-Jek</title> - - <!-- Custom CSS --> - <link href="assets/stylesheets/main.css" rel="stylesheet" type='text/css' /> - <link href="assets/stylesheets/historypenumpang.css" rel="stylesheet" type='text/css' /> - <!-- Custom Fonts --> - <link href="assets/stylesheets/font-awesome.css" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Patua+One" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Oswald:400,500,600" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Roboto:400,500" rel="stylesheet"> - <link href="style/order-history.css" rel="stylesheet"> - <!-- Script --> - <script src="assets/javascript/edit-location.js"></script> - <script src="assets/javascript/history.js"></script> -</head> -<body> - <div class="container-his"> - <!-- navbar --> - <div class="navbar-his"> - <img src="assets/image/yesbos.png" class="logo-his"> - <div class="logout-his"> - <p style="margin-bottom: 2px;">Hi, <strong> </strong> !</p> - <a href="index.jsp">Logout</a> - </div> - </div> - <!-- navigation --> - <div class="header" id="header"> - <nav> - <ul> - <li><a href="sel-destination.jsp">ORDER</a></li> - <li><a href="history-penumpang.jsp" class="option-active" >HISTORY</a></li> - <li><a href="profile.jsp" >MY PROFILE</a></li> - </ul> - </nav> - </div> - <!-- make-an-hist --> - <div class="make-an-hist"> - <div class="make-an-hist-header"> - TRANSACTION HISTORY - </div> - </div> - <div class="hist-header1"> - <btn class="hist-2 option-active-sub" id="-active"> - <div class="content"><a href=""> MY PREVIOUS ORDER </a></div> - </btn> - <btn class="hist-2"> - <div class="content"><a href="driver-history.jsp"> DRIVER HISTORY </a></div> - </btn> - </div> - <table> - - - </table> - </div> -</body> -</html> diff --git a/build/web/style/driver-history.css b/build/web/style/driver-history.css deleted file mode 100644 index 8a7995a9da2b147ed1e5b26c951dbf967a342eab..0000000000000000000000000000000000000000 --- a/build/web/style/driver-history.css +++ /dev/null @@ -1,269 +0,0 @@ -.container-his { - display: block; - margin-left: auto; - margin-right: auto; - margin-top: 5%; - width: 35em; - height: 45em; - -webkit-box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); - -moz-box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); - box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); -} - -.navbar-his { - padding-top: 5px; - width: 100%; -} - -.logo-his { - float: left; - max-height: 80px; - line-height: 80px; - margin-left: 12px; -} - -body { - background-color: #f5f5f5; - font-family: 'Roboto', sans-serif; -} - -div { - margin: auto; -} - -.make-an-hist-header { - display: flex; - padding-left: 36px; - padding-top: 8px; - padding-bottom: 8px; - font-weight: 500; - font-size: 24px; - font-family: 'Oswald', sans-serif; - text-transform: uppercase; -} - -.location-header { - display: flex; -} - -.hist-header1 { - margin-left: 90px; - display: flex; - align-content: center; - text-align: center; -} - -.buletan { - height: 30px; - min-width: 30px; - background-color: gray; - border-radius: 100%; - margin-top: 3px; - margin-left: 3px; - text-align: center; -} - -.teks-buletan { - font-size: 16px; - margin-top: 6px; - color: black; -} - -.hist-2 { - margin-left: 16px; - display: flex; - font-size: 12px; - color: black; - width: 150px; - text-align: center; - padding: 6px 6px; - border: 1px solid black; - font-size: 32px; - font-family: 'Oswald', sans-serif; - text-transform: uppercase; -} - -.content { - font-size: 18px; - text-align: center; - color: black; -} - -.content2 { - font-size: 12px; - padding: 10px 5px 10px 5px; - color: black; -} - -a.whitelink { - color: white; -} - -#hist-active { - background-color: yellow; - color: yellow; -} - -.whitelink { - border-radius: 15px; -} - -.preferred-drivers-container { - margin-top: 15px; - margin-left: 36px; - margin-right: 36px; - border: 1px solid black; - border-radius: 15px; -} - -.preferred-drivers-header { - margin-left: 5px; - margin-top: 3px; - font-size: 21px; - font-weight: 500; -} - -.img-history > img { - max-height: 100px; - max-width: 100px; - margin-top: 36px; - margin-left: 36px; - border: 10px solid black; -} - -.sub-title { - float: right; - margin-left: 12px; - margin-right: 36px; - width: 370px; -} - -.grey-title { - font-size: 13px; - color: grey; - margin-top: 24px; - margin-bottom: 2px; -} - -.driver { - margin-top: 2px; - margin-bottom: 2px; - font-size: 17px; -} - -.sub-text { - margin-top: 7px; - margin-bottom: 2px; - font-size: 12px; -} - -.rate-comment { - margin-top: 5px; - font-size: 12px; -} - -.rate { - padding-right: 8px; -} - -.comment-content { - margin-top: 2px; - margin-left: 12px; - width: 30em; -} - -.checked { - color: orange; -} - -.hide-button { - float: right; - margin-top: 24px; - background-color: #db1c26; - border-radius: 8px; - text-align: center; - font-size: 18px; - width: 80px; - padding: 6px 6px 6px 6px; -} - -.header nav ul { - display: -moz-flex; - display: -webkit-flex; - display: -ms-flex; - display: flex; - padding-left: 36px; - margin-bottom: 0; - list-style: none; - width: 100%; -} - - .header nav ul li { - padding-left: 0; - border: solid 1px #000; - } - - .header nav ul li a { - color: black; - display: block; - width: 160px; - height: 3.25rem; - line-height: 3.25rem; - text-transform: uppercase; - font-size: 1.45rem; - margin: auto; - text-align: center; - font-weight: 700; - border-bottom: 0; - -webkit-transition: all .3s ease; - -moz-transition: all .3s ease; - -o-transition: all .3s ease; - transition: all .3s ease; - text-decoration: none; - } - - .header nav ul li a:hover { - background-color: #008000; - color: #f5f5f5; - } - - .header nav ul li a:active { - background-color: #008000; - color: #f5f5f5; - } - -.header .option-active { - background-color: #008000; - color: #f5f5f5; -} - -.option-active-sub { - background-color: #6dc066; -} - -.logout-his { - text-align: right; - font-size: 15px; - margin-right: 36px; - display: inline-block; - float: right; - margin-top: 5px; -} - -.pict { - margin-top: 30px; - height: 120px; - width: 120px; - margin-left: 36px; - border: 1px solid black; -} - -.errmsg { - background-color: lightgreen; - margin-top: 24px; - border-radius: 7px; - border: 3px solid green; - border-color: darkgreen; - width: 370px; - text-align: center; -} diff --git a/build/web/style/main.css b/build/web/style/main.css deleted file mode 100644 index abd23a4120aa35e5b89ef7e13e5340b56aca8c5e..0000000000000000000000000000000000000000 --- a/build/web/style/main.css +++ /dev/null @@ -1,87 +0,0 @@ -body { - background-color: #f5f5f5; - font-family: 'Roboto', sans-serif; -} - -div { - margin: 0 0 0 0; -} - -a { - text-decoration: none !important; - color: inherit; -} - -.login { - background-color: #81ba2c; - background-size: 100%; - border-radius: 15%; - border: 10px solid #008000; - margin-top: 5%; - margin-left: auto; - margin-right: auto; - width: 20em; - height: 25em; - padding: 20px; - color: #21660e; -} - -.title { - margin-bottom: 20px; - font-size: 3em; - font-weight: 500; - font-family: 'Oswald', sans-serif; - text-transform: uppercase; - text-align: center; -} - -.input-form { - font-size: 1.5em; - margin-left: 15px; - display: inline-block; -} - -.submit-form { - margin-top: 40px; - margin-left: 15px; - display: inline-flex; -} - -input[type=submit] { - cursor: pointer; - float: right; - width: 85px; - margin-left: 60px; - border-radius: 15%; - border: 2px solid black; - background-color: #a1dd27; - font-size: 20px; -} - -input[type=submit]:hover { - opacity: .7; - font-weight: 700; -} - -.login p { - margin-right: 20px; -} - -.login .no-acc { - font-size: .8em; -} - -.login .label { - display: flex; - padding-bottom: 10px; -} - -.login .label input { - border: 1px solid black; - margin: auto; - height: 25px; -} - -.label { - margin-bottom: -50px; -} diff --git a/build/web/style/order-history.css b/build/web/style/order-history.css deleted file mode 100644 index 79f5b4eea8e0a293ec86f4def42720b49276190a..0000000000000000000000000000000000000000 --- a/build/web/style/order-history.css +++ /dev/null @@ -1,269 +0,0 @@ -.container-his { - display: block; - margin-left: auto; - margin-right: auto; - margin-top: 5%; - width: 35em; - height: 45em; - -webkit-box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); - -moz-box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); - box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); -} - -.navbar-his { - padding-top: 5px; - width: 100%; -} - -.logo-his { - float: left; - max-height: 80px; - line-height: 80px; - margin-left:12px; -} - -body { - background-color: #f5f5f5; - font-family: 'Roboto', sans-serif; -} - -div { - margin: auto; -} - -.make-an-hist-header { - display: flex; - padding-left: 36px; - padding-top: 8px; - padding-bottom: 8px; - font-weight: 500; - font-size: 24px; - font-family: 'Oswald', sans-serif; - text-transform: uppercase; -} - -.location-header { - display: flex; -} - -.hist-header1 { - margin-left: 90px; - display: flex; - align-content: center; - text-align: center; -} - -.buletan { - height: 30px; - min-width: 30px; - background-color: gray; - border-radius: 100%; - margin-top: 3px; - margin-left: 3px; - text-align: center; -} - -.teks-buletan { - font-size: 16px; - margin-top: 6px; - color: black; -} - -.hist-2 { - margin-left: 16px; - display: flex; - font-size: 12px; - color: black; - width: 150px; - text-align: center; - padding: 6px 6px; - border: 1px solid black; - font-size: 32px; - font-family: 'Oswald', sans-serif; - text-transform: uppercase; -} - -.content { - font-size: 18px; - text-align: center; - color: black; -} - -.content2 { - font-size: 12px; - padding: 10px 5px 10px 5px; - color: black; -} - -a.whitelink { - color: white; -} - -#hist-active { - background-color: yellow; - color: yellow; -} - -.whitelink { - border-radius: 15px; -} - -.preferred-drivers-container { - margin-top: 15px; - margin-left: 36px; - margin-right: 36px; - border: 1px solid black; - border-radius: 15px; -} - -.preferred-drivers-header { - margin-left: 5px; - margin-top: 3px; - font-size: 21px; - font-weight: 500; -} - -.img-history > img { - max-height: 100px; - max-width: 100px; - margin-top: 36px; - margin-left: 36px; - border: 1px solid black; -} - -.sub-title { - float: right; - margin-left:12px; - margin-right: 36px; - width : 370px; -} - -.grey-title { - font-size: 13px; - color: grey; - margin-top: 24px; - margin-bottom: 2px; -} - -.driver { - margin-top: 2px; - margin-bottom: 2px; - font-size: 17px; -} - -.sub-text { - margin-top: 7px; - margin-bottom: 2px; - font-size: 12px; -} - -.rate-comment { - margin-top: 5px; - font-size: 12px; -} - -.rate { - padding-right: 8px; -} - -.comment-content { - margin-top: 2px; - margin-left: 12px; - width: 30em; -} - -.checked { - color: orange; -} - -.hide-button { - float: right; - margin-top: 24px; - background-color: #db1c26; - border-radius: 8px; - text-align: center; - font-size: 18px; - width: 80px; - padding: 6px 6px 6px 6px; -} - -.header nav ul { - display: -moz-flex; - display: -webkit-flex; - display: -ms-flex; - display: flex; - padding-left: 36px; - margin-bottom: 0; - list-style: none; - width: 100%; -} - - .header nav ul li { - padding-left: 0; - border: solid 1px #000; - } - - .header nav ul li a { - color: black; - display: block; - width: 160px; - height: 3.25rem; - line-height: 3.25rem; - text-transform: uppercase; - font-size: 1.45rem; - margin: auto; - text-align: center; - font-weight: 700; - border-bottom: 0; - -webkit-transition: all .3s ease; - -moz-transition: all .3s ease; - -o-transition: all .3s ease; - transition: all .3s ease; - text-decoration: none; - } - - .header nav ul li a:hover { - background-color: #008000; - color: #f5f5f5; - } - - .header nav ul li a:active { - background-color: #008000; - color: #f5f5f5; - } - -.header .option-active { - background-color: #008000; - color: #f5f5f5; -} - -.option-active-sub { - background-color: #6dc066; -} - -.logout-his { - text-align: right; - font-size: 15px; - margin-right: 36px; - display: inline-block; - float: right; - margin-top: 5px; -} - -.pict { - margin-top: 30px; - height: 120px; - width: 120px; - margin-left: 36px; - border: 1px solid black; -} - -.errmsg { - background-color: lightgreen; - margin-top: 24px; - border-radius: 7px; - border: 3px solid green; - border-color: darkgreen; - width: 370px; - text-align:center; -} diff --git a/commons-fileupload-1.3.2.jar b/commons-fileupload-1.3.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..4975590e34f0990118d0063b601bd9ce62fc4a3e Binary files /dev/null and b/commons-fileupload-1.3.2.jar differ diff --git a/data/account.sql b/data/account.sql index ef4faaad4c9b67bfcbc3d376199102bfb1a4e6f4..644af00012e276b061d7d63c298663d4f2d7c3a3 100644 --- a/data/account.sql +++ b/data/account.sql @@ -1,57 +1,24 @@ --- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) --- --- Host: localhost Database: go-young --- ------------------------------------------------------ --- Server version 5.7.18-log - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `user` --- - -DROP TABLE IF EXISTS `user`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `user` ( - `username` varchar(15) NOT NULL, - `email` varchar(45) NOT NULL, - `name` varchar(45) DEFAULT NULL, - `password` varchar(45) NOT NULL, - `phone_no` varchar(15) DEFAULT NULL, - `profile_pict` varchar(50) DEFAULT NULL, - PRIMARY KEY (`username`), - UNIQUE KEY `email_UNIQUE` (`email`), - UNIQUE KEY `username_UNIQUE` (`username`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE account ( + id integer NOT NULL AUTO_INCREMENT, + username varchar(15) NOT NULL, + email varchar(45) NOT NULL, + fullname varchar(45) DEFAULT NULL, + password varchar(45) NOT NULL, + phone_no varchar(15) DEFAULT NULL, + profile_pict varchar(50) DEFAULT NULL, + PRIMARY KEY (id, username), + UNIQUE KEY email_UNIQUE (email), + UNIQUE KEY username_UNIQUE (username) +); /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user` -- -LOCK TABLES `user` WRITE; -/*!40000 ALTER TABLE `user` DISABLE KEYS */; -INSERT INTO `user` VALUES ('ahlfaith','tipehtipeh@google.com','Lathifah Nurrahmah','ewewew','0899999999','wow'),('kucing','sayamaung@google.com','Sebastian Loki','yuyuyu','081208120812','wow'),('lazuardilazu','lazuardifirdaus369@yahoo.com','Lazuardi Firdaus','mamayugero','08567718483','wow'),('matthewrichard','mattrich34@yahoo.com','Richard Matthew','uwouwo','08179222323','wow'); -/*!40000 ALTER TABLE `user` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2017-10-04 18:27:51 +INSERT INTO account (username, email, fullname, password, phone_no) VALUES +('ahlfaith','tipehtipeh@google.com','Lathifah Nurrahmah','ewewew','0899999999'), +('kucing','sayamaung@google.com','Sebastian Loki','yuyuyu','081208120812'), +('lazuardilazu','lazuardifirdaus369@yahoo.com','Lazuardi Firdaus','mamayugero','08567718483'), +('matthewrichard','mattrich34@yahoo.com','Richard Matthew','uwouwo','08179222323'); diff --git a/data/ojekonline.sql b/data/ojekonline.sql index 03d30e4d4dc08f81c3ce9d1a0ae0d372a0e01b7e..f5591a5375035b8ba59e7fd993546424db6add15 100644 --- a/data/ojekonline.sql +++ b/data/ojekonline.sql @@ -1,102 +1,63 @@ --- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) --- --- Host: localhost Database: go-young --- ------------------------------------------------------ --- Server version 5.7.18-log - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `driver` --- -DROP TABLE IF EXISTS `driver`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `driver` ( - `username` varchar(15) NOT NULL, - `status` binary(1) NOT NULL, - PRIMARY KEY (`username`), - UNIQUE KEY `username_UNIQUE` (`username`), -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE driver ( + username varchar(15) NOT NULL, + status binary(1) NOT NULL, + PRIMARY KEY (username), + UNIQUE KEY username_UNIQUE (username), +); /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `driver` -- -LOCK TABLES `driver` WRITE; -/*!40000 ALTER TABLE `driver` DISABLE KEYS */; -INSERT INTO `driver` VALUES ('ahlfaith','1'); -/*!40000 ALTER TABLE `driver` ENABLE KEYS */; -UNLOCK TABLES; +INSERT INTO driver VALUES ('ahlfaith','1'); -- -- Table structure for table `preferred_location` -- -DROP TABLE IF EXISTS `preferred_location`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `preferred_location` ( - `username` varchar(15) NOT NULL, - `location` varchar(50) NOT NULL, - PRIMARY KEY (`username`,`location`), - KEY `location_foreign_location_idx` (`location`), - CONSTRAINT `username_foreign_driver` FOREIGN KEY (`username`) REFERENCES `driver` (`username`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE preferred_location ( + username varchar(15) NOT NULL, + location varchar(50) NOT NULL, + PRIMARY KEY (username,location), + KEY location_foreign_location_idx (location), + CONSTRAINT username_foreign_driver FOREIGN KEY (username) REFERENCES driver (username) ON DELETE NO ACTION ON UPDATE NO ACTION +); /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `preferred_location` -- -LOCK TABLES `preferred_location` WRITE; -/*!40000 ALTER TABLE `preferred_location` DISABLE KEYS */; -INSERT INTO `preferred_location` VALUES ('ahlfaith','cimohay'),('ahlfaith','dago'); -/*!40000 ALTER TABLE `preferred_location` ENABLE KEYS */; -UNLOCK TABLES; +INSERT INTO preferred_location VALUES ('ahlfaith','cimohay'),('ahlfaith','dago'); + -- -- Table structure for table `transaction` -- -DROP TABLE IF EXISTS `transaction`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `transaction` ( - `driver_name` varchar(15) NOT NULL, - `id` int(11) NOT NULL, - `user_name` varchar(15) DEFAULT NULL, - `picking_point` varchar(50) DEFAULT NULL, - `destination` varchar(50) DEFAULT NULL, - `date` date DEFAULT NULL, - `comment` mediumtext, - `rating` int(11) DEFAULT NULL, - `user_hide` binary(1) DEFAULT NULL, - `driver_hide` binary(1) DEFAULT NULL, - PRIMARY KEY (`driver_name`,`id`), - KEY `name_foreign_user_idx` (`user_name`), - KEY `picking_foreign_location_idx` (`picking_point`), - KEY `destination_foreign_location_idx` (`destination`), - CONSTRAINT `name_foreign_driver` FOREIGN KEY (`driver_name`) REFERENCES `driver` (`username`) ON DELETE NO ACTION ON UPDATE NO ACTION, -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `transaction` --- -LOCK TABLES `transaction` WRITE; -/*!40000 ALTER TABLE `transaction` DISABLE KEYS */; -INSERT INTO `transaction` VALUES ('ahlfaith',1,'matthewrichard','dago','cimohay','2017-10-04','mantap nih mbak-mbaknya. ngebut banget',5,'0','0'); -/*!40000 ALTER TABLE `transaction` ENABLE KEYS */; -UNLOCK TABLES; +CREATE TABLE transaksi ( + id int(11) NOT NULL AUTO_INCREMENT, + driver_name varchar(15) NOT NULL, + user_name varchar(15) DEFAULT NULL, + picking_point varchar(50) DEFAULT NULL, + destination varchar(50) DEFAULT NULL, + tanggal date DEFAULT NULL, + comment mediumtext, + rating int(11) DEFAULT 0, + user_hide binary(1) DEFAULT 0, + driver_hide binary(1) DEFAULT 0, + PRIMARY KEY (id), + KEY name_foreign_user_idx (user_name), + KEY picking_foreign_location_idx (picking_point), + KEY destination_foreign_location_idx (destination), + CONSTRAINT name_foreign_driver FOREIGN KEY (driver_name) REFERENCES driver (username) ON DELETE NO ACTION ON UPDATE NO ACTION, +); + + +INSERT INTO transaksi (driver_name, user_name, picking_point, +destination, tanggal, comment, rating, user_hide, driver_hide) VALUES +('ahlfaith','matthewrichard','dago','cimohay', +'2017-10-04','mantap nih mbak-mbaknya. ngebut banget', +5,'0','0'); diff --git a/mysql-connector-java-5.1.40-bin.jar b/mysql-connector-java-5.1.40-bin.jar new file mode 100644 index 0000000000000000000000000000000000000000..60bef5cfbfbecf98b7371ba19389fe792be305e0 Binary files /dev/null and b/mysql-connector-java-5.1.40-bin.jar differ diff --git a/nbproject/ant-deploy.xml b/nbproject/ant-deploy.xml deleted file mode 100644 index 5d33e0d6e743ce97b9b63e4c37346ab71071ce70..0000000000000000000000000000000000000000 --- a/nbproject/ant-deploy.xml +++ /dev/null @@ -1,150 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - -Copyright (c) 2008, 2016 Oracle and/or its affiliates. All rights reserved. - -Oracle and Java are registered trademarks of Oracle and/or its affiliates. -Other names may be trademarks of their respective owners. - -The contents of this file are subject to the terms of either the GNU -General Public License Version 2 only ("GPL") or the Common -Development and Distribution License("CDDL") (collectively, the -"License"). You may not use this file except in compliance with the -License. You can obtain a copy of the License at -http://www.netbeans.org/cddl-gplv2.html -or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the -specific language governing permissions and limitations under the -License. When distributing the software, include this License Header -Notice in each file and include the License file at -nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this -particular file as subject to the "Classpath" exception as provided -by Oracle in the GPL Version 2 section of the License file that -accompanied this code. If applicable, add the following below the -License Header, with the fields enclosed by brackets [] replaced by -your own identifying information: -"Portions Copyrighted [year] [name of copyright owner]" - -If you wish your version of this file to be governed by only the CDDL -or only the GPL Version 2, indicate your decision by adding -"[Contributor] elects to include this software in this distribution -under the [CDDL or GPL Version 2] license." If you do not indicate a -single choice of license, a recipient has the option to distribute -your version of this file under either the CDDL, the GPL Version 2 or -to extend the choice of license to its licensees as provided above. -However, if you add GPL Version 2 code and therefore, elected the GPL -Version 2 license, then the option applies only if the new code is -made subject to such option by the copyright holder. - -Contributor(s): ---> -<project default="-deploy-ant" basedir="."> - <target name="-init-cl-deployment-env" if="deploy.ant.enabled"> - <property file="${deploy.ant.properties.file}" /> - <available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/> - <available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/> - <available file="${deploy.ant.resource.dir}" property="has.setup"/> - <tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> - <echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/> - </target> - - <target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present"> - <tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/> - <copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/> - <!-- The doctype triggers resolution which can fail --> - <replace file="${temp.sun.web}"> - <replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> - <replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> - </replace> - <replace file="${temp.sun.web}"> - <replacetoken><![CDATA[<sun-web-app]]></replacetoken> - <replacevalue><![CDATA[--> <sun-web-app]]></replacevalue> - </replace> - <xmlproperty file="${temp.sun.web}" validate="false"> - </xmlproperty> - <delete file="${temp.sun.web}"/> - <condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> - <isset property="sun-web-app.context-root"/> - </condition> - <condition property="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}" else="/${ant.project.name}"> - <isset property="sun-web-app.context-root"/> - </condition> - </target> - <target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present"> - <tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/> - <copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/> - <!-- The doctype triggers resolution which can fail --> - <replace file="${temp.gf.web}"> - <replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> - <replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> - </replace> - <replace file="${temp.gf.web}"> - <replacetoken><![CDATA[<glassfish-web-app]]></replacetoken> - <replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue> - </replace> - <xmlproperty file="${temp.gf.web}" validate="false"> - </xmlproperty> - <delete file="${temp.gf.web}"/> - <condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> - <isset property="glassfish-web-app.context-root"/> - </condition> - <condition property="deploy.context.root.argument" value="&contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}"> - <isset property="glassfish-web-app.context-root"/> - </condition> - </target> - <target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present"> - <property name="deploy.context.root.argument" value=""/> - </target> - <target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup"> - <tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/> - <mkdir dir="${gfv3.resources.dir}"/> - <mkdir dir="${gfv3.resources.dir}/META-INF"/> - <copy todir="${gfv3.resources.dir}/META-INF"> - <fileset dir="${deploy.ant.resource.dir}"/> - </copy> - <jar destfile="${deploy.ant.archive}" update="true"> - <fileset dir="${gfv3.resources.dir}"/> - </jar> - <delete dir="${gfv3.resources.dir}"/> - </target> - <target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled"> - <antcall target="-deploy-without-pw"/> - <antcall target="-deploy-with-pw"/> - </target> - - <target name="-deploy-without-pw" unless="gfv3.password"> - <echo message="Deploying ${deploy.ant.archive}"/> - <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> - <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> - <get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" - dest="${gfv3.results.file}"/> - <delete file="${gfv3.results.file}"/> - </target> - <target name="-deploy-with-pw" if="gfv3.password"> - <echo message="Deploying ${deploy.ant.archive}"/> - <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> - <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> - <get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" - dest="${gfv3.results.file}"/> - <delete file="${gfv3.results.file}"/> - </target> - <target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled"> - <antcall target="-undeploy-without-pw"/> - <antcall target="-undeploy-with-pw"/> - </target> - - <target name="-undeploy-without-pw" unless="gfv3.password"> - <echo message="Undeploying ${deploy.ant.archive}"/> - <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> - <get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" - dest="${gfv3.results.file}"/> - <delete file="${gfv3.results.file}"/> - </target> - <target name="-undeploy-with-pw" if="gfv3.password"> - <echo message="Undeploying ${deploy.ant.archive}"/> - <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> - <get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" - dest="${gfv3.results.file}"/> - <delete file="${gfv3.results.file}"/> - </target> -</project> diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml deleted file mode 100644 index f89ad941101493c2af3463eb403d72923086d642..0000000000000000000000000000000000000000 --- a/nbproject/build-impl.xml +++ /dev/null @@ -1,1442 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - *** GENERATED FROM project.xml - DO NOT EDIT *** - *** EDIT ../build.xml INSTEAD *** - - For the purpose of easier reading the script - is divided into following sections: - - initialization - - compilation - - dist - - execution - - debugging - - javadoc - - test compilation - - test execution - - test debugging - - cleanup - - --> -<project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="SabebTeam-impl"> - <import file="jaxws-build.xml"/> - <import file="ant-deploy.xml"/> - <fail message="Please build using Ant 1.7.1 or higher."> - <condition> - <not> - <antversion atleast="1.7.1"/> - </not> - </condition> - </fail> - <target depends="dist,javadoc" description="Build whole project." name="default"/> - <!-- - INITIALIZATION SECTION - --> - <target name="-pre-init"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="-pre-init" name="-init-private"> - <property file="nbproject/private/private.properties"/> - </target> - <target depends="-pre-init,-init-private" name="-init-user"> - <property file="${user.properties.file}"/> - <!-- The two properties below are usually overridden --> - <!-- by the active platform. Just a fallback. --> - <property name="default.javac.source" value="1.4"/> - <property name="default.javac.target" value="1.4"/> - </target> - <target depends="-pre-init,-init-private,-init-user" name="-init-project"> - <property file="nbproject/project.properties"/> - </target> - <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" if="dist.ear.dir" name="-do-ear-init"/> - <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init"> - <condition property="have.tests"> - <or> - <available file="${test.src.dir}"/> - </or> - </condition> - <condition property="have.sources"> - <or> - <available file="${src.dir}"/> - </or> - </condition> - <condition property="netbeans.home+have.tests"> - <and> - <isset property="netbeans.home"/> - <isset property="have.tests"/> - </and> - </condition> - <condition property="no.javadoc.preview"> - <isfalse value="${javadoc.preview}"/> - </condition> - <property name="javac.compilerargs" value=""/> - <condition property="no.deps"> - <and> - <istrue value="${no.dependencies}"/> - </and> - </condition> - <condition property="no.dist.ear.dir"> - <not> - <isset property="dist.ear.dir"/> - </not> - </condition> - <property name="build.web.excludes" value="${build.classes.excludes}"/> - <condition property="do.compile.jsps"> - <istrue value="${compile.jsps}"/> - </condition> - <condition property="do.debug.server"> - <or> - <not> - <isset property="debug.server"/> - </not> - <istrue value="${debug.server}"/> - <and> - <not> - <istrue value="${debug.server}"/> - </not> - <not> - <istrue value="${debug.client}"/> - </not> - </and> - </or> - </condition> - <condition property="do.debug.client"> - <istrue value="${debug.client}"/> - </condition> - <condition property="do.display.browser"> - <istrue value="${display.browser}"/> - </condition> - <condition property="do.display.browser.debug.old"> - <and> - <isset property="do.display.browser"/> - <not> - <isset property="do.debug.client"/> - </not> - <not> - <isset property="browser.context"/> - </not> - </and> - </condition> - <condition property="do.display.browser.debug"> - <and> - <isset property="do.display.browser"/> - <not> - <isset property="do.debug.client"/> - </not> - <isset property="browser.context"/> - </and> - </condition> - <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/> - <available file="${persistence.xml.dir}/persistence.xml" property="has.persistence.xml"/> - <condition property="do.war.package.with.custom.manifest"> - <isset property="has.custom.manifest"/> - </condition> - <condition property="do.war.package.without.custom.manifest"> - <not> - <isset property="has.custom.manifest"/> - </not> - </condition> - <condition property="do.tmp.war.package.with.custom.manifest"> - <and> - <isset property="has.custom.manifest"/> - <or> - <isfalse value="${directory.deployment.supported}"/> - <isset property="dist.ear.dir"/> - </or> - </and> - </condition> - <condition property="do.tmp.war.package.without.custom.manifest"> - <and> - <not> - <isset property="has.custom.manifest"/> - </not> - <or> - <isfalse value="${directory.deployment.supported}"/> - <isset property="dist.ear.dir"/> - </or> - </and> - </condition> - <condition property="do.tmp.war.package"> - <or> - <isfalse value="${directory.deployment.supported}"/> - <isset property="dist.ear.dir"/> - </or> - </condition> - <property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/> - <condition else="" property="application.args.param" value="${application.args}"> - <and> - <isset property="application.args"/> - <not> - <equals arg1="${application.args}" arg2="" trim="true"/> - </not> - </and> - </condition> - <property name="source.encoding" value="${file.encoding}"/> - <condition property="javadoc.encoding.used" value="${javadoc.encoding}"> - <and> - <isset property="javadoc.encoding"/> - <not> - <equals arg1="${javadoc.encoding}" arg2=""/> - </not> - </and> - </condition> - <property name="javadoc.encoding.used" value="${source.encoding}"/> - <property name="includes" value="**"/> - <property name="excludes" value=""/> - <property name="runmain.jvmargs" value=""/> - <path id="endorsed.classpath.path" path="${endorsed.classpath}"/> - <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'"> - <and> - <isset property="endorsed.classpath"/> - <length length="0" string="${endorsed.classpath}" when="greater"/> - </and> - </condition> - <condition else="false" property="jdkBug6558476"> - <and> - <matches pattern="1\.[56]" string="${java.specification.version}"/> - <not> - <os family="unix"/> - </not> - </and> - </condition> - <property name="javac.fork" value="${jdkBug6558476}"/> - <condition property="junit.available"> - <or> - <available classname="org.junit.Test" classpath="${run.test.classpath}"/> - <available classname="junit.framework.Test" classpath="${run.test.classpath}"/> - </or> - </condition> - <condition property="testng.available"> - <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/> - </condition> - <condition property="junit+testng.available"> - <and> - <istrue value="${junit.available}"/> - <istrue value="${testng.available}"/> - </and> - </condition> - <condition else="testng" property="testng.mode" value="mixed"> - <istrue value="${junit+testng.available}"/> - </condition> - <condition else="" property="testng.debug.mode" value="-mixed"> - <istrue value="${junit+testng.available}"/> - </condition> - </target> - <target depends="init" name="-init-cos" unless="deploy.on.save"> - <condition property="deploy.on.save" value="true"> - <or> - <istrue value="${j2ee.deploy.on.save}"/> - <istrue value="${j2ee.compile.on.save}"/> - </or> - </condition> - </target> - <target name="-post-init"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check"> - <fail unless="src.dir">Must set src.dir</fail> - <fail unless="test.src.dir">Must set test.src.dir</fail> - <fail unless="build.dir">Must set build.dir</fail> - <fail unless="build.web.dir">Must set build.web.dir</fail> - <fail unless="build.generated.dir">Must set build.generated.dir</fail> - <fail unless="dist.dir">Must set dist.dir</fail> - <fail unless="build.classes.dir">Must set build.classes.dir</fail> - <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail> - <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail> - <fail unless="build.test.results.dir">Must set build.test.results.dir</fail> - <fail unless="build.classes.excludes">Must set build.classes.excludes</fail> - <fail unless="dist.war">Must set dist.war</fail> - <condition property="missing.j2ee.server.home"> - <and> - <matches pattern="j2ee.server.home" string="${j2ee.platform.classpath}"/> - <not> - <isset property="j2ee.server.home"/> - </not> - </and> - </condition> - <fail if="missing.j2ee.server.home"> -The Java EE server classpath is not correctly set up - server home directory is missing. -Either open the project in the IDE and assign the server or setup the server classpath manually. -For example like this: - ant -Dj2ee.server.home=<app_server_installation_directory> - </fail> - <fail unless="j2ee.platform.classpath"> -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) - </fail> - </target> - <target name="-init-macrodef-property"> - <macrodef name="property" uri="http://www.netbeans.org/ns/web-project/1"> - <attribute name="name"/> - <attribute name="value"/> - <sequential> - <property name="@{name}" value="${@{value}}"/> - </sequential> - </macrodef> - </target> - <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors"> - <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${src.dir}" name="srcdir"/> - <attribute default="${build.classes.dir}" name="destdir"/> - <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/> - <attribute default="${javac.processorpath}" name="processorpath"/> - <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="${javac.debug}" name="debug"/> - <attribute default="${empty.dir}" name="gensrcdir"/> - <element name="customize" optional="true"/> - <sequential> - <property location="${build.dir}/empty" name="empty.dir"/> - <mkdir dir="${empty.dir}"/> - <mkdir dir="@{apgeneratedsrcdir}"/> - <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}"> - <src> - <dirset dir="@{gensrcdir}" erroronmissingdir="false"> - <include name="*"/> - </dirset> - </src> - <classpath> - <path path="@{classpath}"/> - </classpath> - <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> - <compilerarg line="${javac.compilerargs}"/> - <compilerarg value="-processorpath"/> - <compilerarg path="@{processorpath}:${empty.dir}"/> - <compilerarg line="${ap.processors.internal}"/> - <compilerarg value="-s"/> - <compilerarg path="@{apgeneratedsrcdir}"/> - <compilerarg line="${ap.proc.none.internal}"/> - <customize/> - </javac> - </sequential> - </macrodef> - </target> - <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal"> - <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${src.dir}" name="srcdir"/> - <attribute default="${build.classes.dir}" name="destdir"/> - <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/> - <attribute default="${javac.processorpath}" name="processorpath"/> - <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="${javac.debug}" name="debug"/> - <attribute default="${empty.dir}" name="gensrcdir"/> - <element name="customize" optional="true"/> - <sequential> - <property location="${build.dir}/empty" name="empty.dir"/> - <mkdir dir="${empty.dir}"/> - <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}"> - <src> - <dirset dir="@{gensrcdir}" erroronmissingdir="false"> - <include name="*"/> - </dirset> - </src> - <classpath> - <path path="@{classpath}"/> - </classpath> - <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> - <compilerarg line="${javac.compilerargs}"/> - <customize/> - </javac> - </sequential> - </macrodef> - </target> - <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac"> - <macrodef name="depend" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${src.dir}" name="srcdir"/> - <attribute default="${build.classes.dir}" name="destdir"/> - <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/> - <sequential> - <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}"> - <classpath> - <path path="@{classpath}"/> - </classpath> - </depend> - </sequential> - </macrodef> - <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${build.classes.dir}" name="destdir"/> - <sequential> - <fail unless="javac.includes">Must set javac.includes</fail> - <pathconvert pathsep="${line.separator}" property="javac.includes.binary"> - <path> - <filelist dir="@{destdir}" files="${javac.includes}"/> - </path> - <globmapper from="*.java" to="*.class"/> - </pathconvert> - <tempfile deleteonexit="true" property="javac.includesfile.binary"/> - <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/> - <delete> - <files includesfile="${javac.includesfile.binary}"/> - </delete> - <delete file="${javac.includesfile.binary}"/> - </sequential> - </macrodef> - </target> - <target if="${junit.available}" name="-init-macrodef-junit-init"> - <condition else="false" property="nb.junit.batch" value="true"> - <and> - <istrue value="${junit.available}"/> - <not> - <isset property="test.method"/> - </not> - </and> - </condition> - <condition else="false" property="nb.junit.single" value="true"> - <and> - <istrue value="${junit.available}"/> - <isset property="test.method"/> - </and> - </condition> - </target> - <target name="-init-test-properties"> - <property name="test.binaryincludes" value="<nothing>"/> - <property name="test.binarytestincludes" value=""/> - <property name="test.binaryexcludes" value=""/> - </target> - <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}"> - <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <element name="customize" optional="true"/> - <sequential> - <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}"> - <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/> - <syspropertyset> - <propertyref prefix="test-sys-prop."/> - <mapper from="test-sys-prop.*" to="*" type="glob"/> - </syspropertyset> - <formatter type="brief" usefile="false"/> - <formatter type="xml"/> - <jvmarg value="-ea"/> - <customize/> - </junit> - </sequential> - </macrodef> - </target> - <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}"> - <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <element name="customize" optional="true"/> - <sequential> - <property name="run.jvmargs.ide" value=""/> - <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}"> - <batchtest todir="${build.test.results.dir}"> - <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> - <filename name="@{testincludes}"/> - </fileset> - <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}"> - <filename name="${test.binarytestincludes}"/> - </fileset> - </batchtest> - <syspropertyset> - <propertyref prefix="test-sys-prop."/> - <mapper from="test-sys-prop.*" to="*" type="glob"/> - </syspropertyset> - <formatter type="brief" usefile="false"/> - <formatter type="xml"/> - <jvmarg value="-ea"/> - <jvmarg line="${run.jvmargs.ide}"/> - <customize/> - </junit> - </sequential> - </macrodef> - </target> - <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/> - <target if="${testng.available}" name="-init-macrodef-testng"> - <macrodef name="testng" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <element name="customize" optional="true"/> - <sequential> - <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}"> - <isset property="test.method"/> - </condition> - <union id="test.set"> - <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}"> - <filename name="@{testincludes}"/> - </fileset> - </union> - <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/> - <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="SabebTeam" testname="TestNG tests" workingDir="${basedir}"> - <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/> - <propertyset> - <propertyref prefix="test-sys-prop."/> - <mapper from="test-sys-prop.*" to="*" type="glob"/> - </propertyset> - <customize/> - </testng> - </sequential> - </macrodef> - </target> - <target name="-init-macrodef-test-impl"> - <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <element implicit="true" name="customize" optional="true"/> - <sequential> - <echo>No tests executed.</echo> - </sequential> - </macrodef> - </target> - <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl"> - <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <element implicit="true" name="customize" optional="true"/> - <sequential> - <webproject2:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> - <customize/> - </webproject2:junit> - </sequential> - </macrodef> - </target> - <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl"> - <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <element implicit="true" name="customize" optional="true"/> - <sequential> - <webproject2:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> - <customize/> - </webproject2:testng> - </sequential> - </macrodef> - </target> - <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test"> - <macrodef name="test" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <sequential> - <webproject2:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> - <customize> - <classpath> - <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/> - </classpath> - <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> - <jvmarg line="${runmain.jvmargs}"/> - </customize> - </webproject2:test-impl> - </sequential> - </macrodef> - </target> - <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}"> - <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <element name="customize" optional="true"/> - <sequential> - <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}"> - <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/> - <syspropertyset> - <propertyref prefix="test-sys-prop."/> - <mapper from="test-sys-prop.*" to="*" type="glob"/> - </syspropertyset> - <formatter type="brief" usefile="false"/> - <formatter type="xml"/> - <jvmarg value="-ea"/> - <jvmarg line="${debug-args-line}"/> - <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> - <customize/> - </junit> - </sequential> - </macrodef> - </target> - <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch"> - <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <element name="customize" optional="true"/> - <sequential> - <property name="run.jvmargs.ide" value=""/> - <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}"> - <batchtest todir="${build.test.results.dir}"> - <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> - <filename name="@{testincludes}"/> - </fileset> - <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}"> - <filename name="${test.binarytestincludes}"/> - </fileset> - </batchtest> - <syspropertyset> - <propertyref prefix="test-sys-prop."/> - <mapper from="test-sys-prop.*" to="*" type="glob"/> - </syspropertyset> - <formatter type="brief" usefile="false"/> - <formatter type="xml"/> - <jvmarg value="-ea"/> - <jvmarg line="${run.jvmargs.ide}"/> - <jvmarg line="${debug-args-line}"/> - <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> - <customize/> - </junit> - </sequential> - </macrodef> - </target> - <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl"> - <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <element implicit="true" name="customize" optional="true"/> - <sequential> - <webproject2:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> - <customize/> - </webproject2:junit-debug> - </sequential> - </macrodef> - </target> - <target if="${testng.available}" name="-init-macrodef-testng-debug"> - <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${main.class}" name="testClass"/> - <attribute default="" name="testMethod"/> - <element name="customize2" optional="true"/> - <sequential> - <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}"> - <isset property="test.method"/> - </condition> - <condition else="-suitename SabebTeam -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}"> - <matches pattern=".*\.xml" string="@{testClass}"/> - </condition> - <delete dir="${build.test.results.dir}" quiet="true"/> - <mkdir dir="${build.test.results.dir}"/> - <webproject1:debug args="${testng.cmd.args}" classname="org.testng.TestNG" classpath="${debug.test.classpath}:${j2ee.platform.embeddableejb.classpath}"> - <customize> - <customize2/> - <jvmarg value="-ea"/> - <arg line="${testng.debug.mode}"/> - <arg line="-d ${build.test.results.dir}"/> - <arg line="-listener org.testng.reporters.VerboseReporter"/> - </customize> - </webproject1:debug> - </sequential> - </macrodef> - </target> - <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl"> - <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${main.class}" name="testClass"/> - <attribute default="" name="testMethod"/> - <element implicit="true" name="customize2" optional="true"/> - <sequential> - <webproject2:testng-debug testClass="@{testClass}" testMethod="@{testMethod}"> - <customize2/> - </webproject2:testng-debug> - </sequential> - </macrodef> - </target> - <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit"> - <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <attribute default="${main.class}" name="testClass"/> - <attribute default="" name="testMethod"/> - <sequential> - <webproject2:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> - <customize> - <classpath> - <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/> - </classpath> - <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> - <jvmarg line="${runmain.jvmargs}"/> - </customize> - </webproject2:test-debug-impl> - </sequential> - </macrodef> - </target> - <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng"> - <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2"> - <attribute default="${includes}" name="includes"/> - <attribute default="${excludes}" name="excludes"/> - <attribute default="**" name="testincludes"/> - <attribute default="" name="testmethods"/> - <attribute default="${main.class}" name="testClass"/> - <attribute default="" name="testMethod"/> - <sequential> - <webproject2:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}"> - <customize2> - <syspropertyset> - <propertyref prefix="test-sys-prop."/> - <mapper from="test-sys-prop.*" to="*" type="glob"/> - </syspropertyset> - </customize2> - </webproject2:testng-debug-impl> - </sequential> - </macrodef> - </target> - <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/> - <target name="-init-macrodef-java"> - <macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1"> - <attribute default="${main.class}" name="classname"/> - <attribute default="${debug.classpath}" name="classpath"/> - <element name="customize" optional="true"/> - <sequential> - <java classname="@{classname}" fork="true"> - <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> - <jvmarg line="${runmain.jvmargs}"/> - <classpath> - <path path="@{classpath}:${j2ee.platform.classpath}"/> - </classpath> - <syspropertyset> - <propertyref prefix="run-sys-prop."/> - <mapper from="run-sys-prop.*" to="*" type="glob"/> - </syspropertyset> - <customize/> - </java> - </sequential> - </macrodef> - </target> - <target name="-init-macrodef-nbjsdebug"> - <macrodef name="nbjsdebugstart" uri="http://www.netbeans.org/ns/web-project/1"> - <attribute default="${client.url}" name="webUrl"/> - <sequential> - <nbjsdebugstart urlPart="${client.urlPart}" webUrl="@{webUrl}"/> - </sequential> - </macrodef> - </target> - <target depends="-init-debug-args" name="-init-macrodef-nbjpda"> - <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/web-project/1"> - <attribute default="${main.class}" name="name"/> - <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/> - <sequential> - <nbjpdastart addressproperty="jpda.address" name="@{name}" transport="${debug-transport}"> - <classpath> - <path path="@{classpath}"/> - </classpath> - </nbjpdastart> - </sequential> - </macrodef> - <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/web-project/1"> - <attribute default="${build.classes.dir}" name="dir"/> - <sequential> - <nbjpdareload> - <fileset dir="@{dir}" includes="${fix.classes}"> - <include name="${fix.includes}*.class"/> - </fileset> - </nbjpdareload> - </sequential> - </macrodef> - <macrodef name="nbjpdaappreloaded" uri="http://www.netbeans.org/ns/web-project/1"> - <sequential> - <nbjpdaappreloaded/> - </sequential> - </macrodef> - </target> - <target name="-init-debug-args"> - <property name="version-output" value="java version "${ant.java.version}"/> - <condition property="have-jdk-older-than-1.4"> - <or> - <contains string="${version-output}" substring="java version "1.0"/> - <contains string="${version-output}" substring="java version "1.1"/> - <contains string="${version-output}" substring="java version "1.2"/> - <contains string="${version-output}" substring="java version "1.3"/> - </or> - </condition> - <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none"> - <istrue value="${have-jdk-older-than-1.4}"/> - </condition> - <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem"> - <os family="windows"/> - </condition> - <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}"> - <isset property="debug.transport"/> - </condition> - </target> - <target depends="-init-debug-args" name="-init-macrodef-debug"> - <macrodef name="debug" uri="http://www.netbeans.org/ns/web-project/1"> - <attribute default="${main.class}" name="classname"/> - <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/> - <attribute default="${application.args.param}" name="args"/> - <element name="customize" optional="true"/> - <sequential> - <java classname="@{classname}" fork="true"> - <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> - <jvmarg line="${debug-args-line}"/> - <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> - <jvmarg line="${runmain.jvmargs}"/> - <classpath> - <path path="@{classpath}"/> - </classpath> - <syspropertyset> - <propertyref prefix="run-sys-prop."/> - <mapper from="run-sys-prop.*" to="*" type="glob"/> - </syspropertyset> - <arg line="@{args}"/> - <customize/> - </java> - </sequential> - </macrodef> - </target> - <target name="-init-taskdefs"> - <fail unless="libs.CopyLibs.classpath"> -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 - </fail> - <taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/> - </target> - <target name="-init-ap-cmdline-properties"> - <property name="annotation.processing.enabled" value="true"/> - <property name="annotation.processing.processors.list" value=""/> - <property name="annotation.processing.run.all.processors" value="true"/> - <property name="javac.processorpath" value="${javac.classpath}"/> - <property name="javac.test.processorpath" value="${javac.test.classpath}"/> - <condition property="ap.supported.internal" value="true"> - <not> - <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/> - </not> - </condition> - </target> - <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported"> - <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}"> - <isfalse value="${annotation.processing.run.all.processors}"/> - </condition> - <condition else="" property="ap.proc.none.internal" value="-proc:none"> - <isfalse value="${annotation.processing.enabled}"/> - </condition> - </target> - <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline"> - <property name="ap.cmd.line.internal" value=""/> - </target> - <!-- - pre NB7.2 profiling section; consider it deprecated - --> - <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/> - <target if="profiler.info.jvmargs.agent" name="-profile-pre-init"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target if="profiler.info.jvmargs.agent" name="-profile-post-init"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="-profile-pre-init, init, -profile-post-init" if="profiler.info.jvmargs.agent" name="-profile-init-check"> - <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail> - <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail> - </target> - <!-- - end of pre NB7.2 profiling section - --> - <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-java,-init-macrodef-nbjpda,-init-macrodef-nbjsdebug,-init-macrodef-debug,-init-taskdefs,-init-ap-cmdline" name="init"/> - <!-- - COMPILATION SECTION - --> - <target depends="init" if="no.dist.ear.dir" name="deps-module-jar" unless="no.deps"/> - <target depends="init" if="dist.ear.dir" name="deps-ear-jar" unless="no.deps"/> - <target depends="init, deps-module-jar, deps-ear-jar" name="deps-jar" unless="no.deps"/> - <target depends="init,deps-jar" name="-pre-pre-compile"> - <mkdir dir="${build.classes.dir}"/> - </target> - <target name="-pre-compile"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target name="-copy-webdir"> - <copy todir="${build.web.dir}"> - <fileset dir="${web.docbase.dir}" excludes="${build.web.excludes},${excludes}" includes="${includes}"/> - </copy> - <copy todir="${build.web.dir}/WEB-INF"> - <fileset dir="${webinf.dir}" excludes="${build.web.excludes}"/> - </copy> - </target> - <target depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest" if="have.sources" name="-do-compile"> - <webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/> - <copy todir="${build.classes.dir}"> - <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> - </copy> - </target> - <target if="has.custom.manifest" name="-copy-manifest"> - <mkdir dir="${build.meta.inf.dir}"/> - <copy todir="${build.meta.inf.dir}"> - <fileset dir="${conf.dir}" includes="MANIFEST.MF"/> - </copy> - </target> - <target if="has.persistence.xml" name="-copy-persistence-xml"> - <mkdir dir="${build.web.dir}/WEB-INF/classes/META-INF"/> - <copy todir="${build.web.dir}/WEB-INF/classes/META-INF"> - <fileset dir="${persistence.xml.dir}" includes="persistence.xml orm.xml"/> - </copy> - </target> - <target name="-post-compile"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/> - <target name="-pre-compile-single"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single"> - <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> - <webproject2:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}"/> - <copy todir="${build.classes.dir}"> - <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> - </copy> - </target> - <target name="-post-compile-single"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/> - <property name="jspc.schemas" value="/resources/schemas/"/> - <property name="jspc.dtds" value="/resources/dtds/"/> - <target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps"> - <mkdir dir="${build.generated.dir}/src"/> - <java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true"> - <arg value="-uriroot"/> - <arg file="${basedir}/${build.web.dir}"/> - <arg value="-d"/> - <arg file="${basedir}/${build.generated.dir}/src"/> - <arg value="-die1"/> - <arg value="-schemas ${jspc.schemas}"/> - <arg value="-dtds ${jspc.dtds}"/> - <arg value="-compilerSourceVM ${javac.source}"/> - <arg value="-compilerTargetVM ${javac.target}"/> - <arg value="-javaEncoding ${source.encoding}"/> - <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/> - <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/> - </java> - <mkdir dir="${build.generated.dir}/classes"/> - <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/> - </target> - <target depends="compile" if="jsp.includes" name="-do-compile-single-jsp"> - <fail unless="javac.jsp.includes">Must select some files in the IDE or set javac.jsp.includes</fail> - <mkdir dir="${build.generated.dir}/src"/> - <java classname="org.netbeans.modules.web.project.ant.JspCSingle" failonerror="true" fork="true"> - <arg value="-uriroot"/> - <arg file="${basedir}/${build.web.dir}"/> - <arg value="-d"/> - <arg file="${basedir}/${build.generated.dir}/src"/> - <arg value="-die1"/> - <arg value="-schemas ${jspc.schemas}"/> - <arg value="-dtds ${jspc.dtds}"/> - <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/> - <arg value="-jspc.files"/> - <arg path="${jsp.includes}"/> - <arg value="-compilerSourceVM ${javac.source}"/> - <arg value="-compilerTargetVM ${javac.target}"/> - <arg value="-javaEncoding ${source.encoding}"/> - <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/> - </java> - <mkdir dir="${build.generated.dir}/classes"/> - <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"> - <customize> - <patternset includes="${javac.jsp.includes}"/> - </customize> - </webproject2:javac> - </target> - <target name="compile-single-jsp"> - <fail unless="jsp.includes">Must select a file in the IDE or set jsp.includes</fail> - <antcall target="-do-compile-single-jsp"/> - </target> - <!-- - DIST BUILDING SECTION - --> - <target name="-pre-dist"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.without.custom.manifest" name="-do-dist-without-manifest"> - <dirname file="${dist.war}" property="dist.jar.dir"/> - <mkdir dir="${dist.jar.dir}"/> - <jar compress="${jar.compress}" jarfile="${dist.war}"> - <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/> - </jar> - </target> - <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest"> - <dirname file="${dist.war}" property="dist.jar.dir"/> - <mkdir dir="${dist.jar.dir}"/> - <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF"> - <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/> - </jar> - </target> - <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest"> - <dirname file="${dist.war}" property="dist.jar.dir"/> - <mkdir dir="${dist.jar.dir}"/> - <jar compress="${jar.compress}" jarfile="${dist.war}"> - <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/> - </jar> - </target> - <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest"> - <dirname file="${dist.war}" property="dist.jar.dir"/> - <mkdir dir="${dist.jar.dir}"/> - <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF"> - <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/> - </jar> - </target> - <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/> - <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest"> - <mkdir dir="${build.web.dir}/META-INF"/> - <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/> - </target> - <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"/> - <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib"> - <delete dir="${build.web.dir}/WEB-INF/lib"/> - </target> - <target depends="init,-clean-webinf-lib,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist"> - <dirname file="${dist.ear.war}" property="dist.jar.dir"/> - <mkdir dir="${dist.jar.dir}"/> - <jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF"> - <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/> - </jar> - </target> - <target name="-post-dist"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="init,compile,-pre-dist,do-dist,-post-dist" description="Build distribution (WAR)." name="dist"/> - <target depends="init,-clean-webinf-lib,-init-cos,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR." name="dist-ear"/> - <!-- - EXECUTION SECTION - --> - <target depends="run-deploy,run-display-browser" description="Deploy to server and show in browser." name="run"/> - <target name="-pre-run-deploy"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target name="-post-run-deploy"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target name="-pre-nbmodule-run-deploy"> - <!-- Empty placeholder for easier customization. --> - <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. --> - </target> - <target name="-post-nbmodule-run-deploy"> - <!-- Empty placeholder for easier customization. --> - <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. --> - </target> - <target name="-run-deploy-am"> - <!-- Task to deploy to the Access Manager runtime. --> - </target> - <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy,-do-update-breakpoints" name="run-deploy"/> - <target if="netbeans.home" name="-run-deploy-nb"> - <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/> - </target> - <target name="-init-deploy-ant" unless="netbeans.home"> - <property name="deploy.ant.archive" value="${dist.war}"/> - <property name="deploy.ant.docbase.dir" value="${web.docbase.dir}"/> - <property name="deploy.ant.resource.dir" value="${resource.dir}"/> - <property name="deploy.ant.enabled" value="true"/> - </target> - <target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/> - <target if="netbeans.home" name="-run-undeploy-nb"> - <fail message="Undeploy is not supported from within the IDE"/> - </target> - <target depends="init,-pre-dist,dist,-post-dist" name="verify"> - <nbverify file="${dist.war}"/> - </target> - <target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/> - <target if="do.display.browser" name="-init-display-browser"> - <condition property="do.display.browser.nb.old"> - <and> - <isset property="netbeans.home"/> - <not> - <isset property="browser.context"/> - </not> - </and> - </condition> - <condition property="do.display.browser.nb"> - <and> - <isset property="netbeans.home"/> - <isset property="browser.context"/> - </and> - </condition> - <condition property="do.display.browser.cl"> - <isset property="deploy.ant.enabled"/> - </condition> - </target> - <target if="do.display.browser.nb.old" name="-display-browser-nb-old"> - <nbbrowse url="${client.url}"/> - </target> - <target if="do.display.browser.nb" name="-display-browser-nb"> - <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/> - </target> - <target if="do.display.browser.cl" name="-get-browser" unless="browser"> - <condition property="browser" value="rundll32"> - <os family="windows"/> - </condition> - <condition else="" property="browser.args" value="url.dll,FileProtocolHandler"> - <os family="windows"/> - </condition> - <condition property="browser" value="/usr/bin/open"> - <os family="mac"/> - </condition> - <property environment="env"/> - <condition property="browser" value="${env.BROWSER}"> - <isset property="env.BROWSER"/> - </condition> - <condition property="browser" value="/usr/bin/firefox"> - <available file="/usr/bin/firefox"/> - </condition> - <condition property="browser" value="/usr/local/firefox/firefox"> - <available file="/usr/local/firefox/firefox"/> - </condition> - <condition property="browser" value="/usr/bin/mozilla"> - <available file="/usr/bin/mozilla"/> - </condition> - <condition property="browser" value="/usr/local/mozilla/mozilla"> - <available file="/usr/local/mozilla/mozilla"/> - </condition> - <condition property="browser" value="/usr/sfw/lib/firefox/firefox"> - <available file="/usr/sfw/lib/firefox/firefox"/> - </condition> - <condition property="browser" value="/opt/csw/bin/firefox"> - <available file="/opt/csw/bin/firefox"/> - </condition> - <condition property="browser" value="/usr/sfw/lib/mozilla/mozilla"> - <available file="/usr/sfw/lib/mozilla/mozilla"/> - </condition> - <condition property="browser" value="/opt/csw/bin/mozilla"> - <available file="/opt/csw/bin/mozilla"/> - </condition> - </target> - <target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl"> - <fail unless="browser"> - Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. - </fail> - <property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/> - <echo>Launching ${browse.url}</echo> - <exec executable="${browser}" spawn="true"> - <arg line="${browser.args} ${browse.url}"/> - </exec> - </target> - <target depends="init,-init-cos,compile-single" name="run-main"> - <fail unless="run.class">Must select one file in the IDE or set run.class</fail> - <webproject1:java classname="${run.class}"/> - </target> - <target depends="init,compile-test-single,-pre-test-run-single" name="run-test-with-main"> - <fail unless="run.class">Must select one file in the IDE or set run.class</fail> - <webproject1:java classname="${run.class}" classpath="${run.test.classpath}"/> - </target> - <target depends="init" if="netbeans.home" name="-do-update-breakpoints"> - <webproject1:nbjpdaappreloaded/> - </target> - <!-- - DEBUGGING SECTION - --> - <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" description="Debug project in IDE." if="netbeans.home" name="debug"> - <nbstartserver debugmode="true"/> - <antcall target="connect-debugger"/> - <nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/> - <antcall target="debug-display-browser-old"/> - <antcall target="debug-display-browser"/> - <antcall target="connect-client-debugger"/> - </target> - <target if="do.debug.server" name="connect-debugger" unless="is.debugged"> - <condition property="listeningcp" value="sourcepath"> - <istrue value="${j2ee.compile.on.save}"/> - </condition> - <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" listeningcp="${listeningcp}" name="${name}" transport="${jpda.transport}"> - <classpath> - <path path="${debug.classpath}:${j2ee.platform.classpath}"/> - </classpath> - <sourcepath> - <path path="${web.docbase.dir}"/> - </sourcepath> - </nbjpdaconnect> - </target> - <target if="do.display.browser.debug.old" name="debug-display-browser-old"> - <nbbrowse url="${client.url}"/> - </target> - <target if="do.display.browser.debug" name="debug-display-browser"> - <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/> - </target> - <target if="do.debug.client" name="connect-client-debugger"> - <webproject1:nbjsdebugstart webUrl="${client.url}"/> - </target> - <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test"> - <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> - <webproject1:debug classname="${debug.class}" classpath="${debug.test.classpath}"/> - </target> - <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/> - <target depends="init,compile,compile-jsps,-do-compile-single-jsp,debug" if="netbeans.home" name="debug-single"/> - <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test"> - <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/> - </target> - <target depends="init" if="netbeans.home" name="-debug-start-debugger"> - <webproject1:nbjpdastart name="${debug.class}"/> - </target> - <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single"> - <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> - <webproject1:debug classname="${debug.class}"/> - </target> - <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single-main"/> - <target depends="init" name="-pre-debug-fix"> - <fail unless="fix.includes">Must set fix.includes</fail> - <property name="javac.includes" value="${fix.includes}.java"/> - </target> - <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix"> - <webproject1:nbjpdareload/> - </target> - <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/> - <!-- - ================= - PROFILING SECTION - ================= - --> - <!-- - pre NB7.2 profiling section; consider it deprecated - --> - <target description="Profile a J2EE project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72"> - <condition else="start-profiled-server" property="profiler.startserver.target" value="start-profiled-server-extraargs"> - <isset property="profiler.info.jvmargs.extra"/> - </condition> - <antcall target="${profiler.startserver.target}"/> - <antcall target="run"/> - <antcall target="-profile-start-loadgen"/> - </target> - <target if="profiler.info.jvmargs.agent" name="start-profiled-server"> - <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}"> - <jvmarg value="${profiler.info.jvmargs.agent}"/> - <jvmarg value="${profiler.j2ee.agentID}"/> - </nbstartprofiledserver> - </target> - <target if="profiler.info.jvmargs.agent" name="start-profiled-server-extraargs"> - <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}"> - <jvmarg value="${profiler.info.jvmargs.extra}"/> - <jvmarg value="${profiler.info.jvmargs.agent}"/> - <jvmarg value="${profiler.j2ee.agentID}"/> - </nbstartprofiledserver> - </target> - <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72"> - <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail> - <nbprofiledirect> - <classpath> - <path path="${run.test.classpath}"/> - <path path="${j2ee.platform.classpath}"/> - </classpath> - </nbprofiledirect> - <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true"> - <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> - <jvmarg value="${profiler.info.jvmargs.agent}"/> - <jvmarg line="${profiler.info.jvmargs}"/> - <test name="${profile.class}"/> - <classpath> - <path path="${run.test.classpath}"/> - <path path="${j2ee.platform.classpath}"/> - </classpath> - <syspropertyset> - <propertyref prefix="test-sys-prop."/> - <mapper from="test-sys-prop.*" to="*" type="glob"/> - </syspropertyset> - <formatter type="brief" usefile="false"/> - <formatter type="xml"/> - </junit> - </target> - <target if="netbeans.home" name="-profile-check"> - <condition property="profiler.configured"> - <or> - <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/> - <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/> - </or> - </condition> - </target> - <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" name="-do-profile"> - <startprofiler/> - <nbstartserver profilemode="true"/> - <nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/> - <antcall target="debug-display-browser-old"/> - <antcall target="debug-display-browser"/> - <antcall target="-profile-start-loadgen"/> - </target> - <target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent"> - <antcall target="-do-profile"/> - </target> - <target depends="-profile-test-single-pre72" name="profile-test-single"/> - <target depends="-profile-check" if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs.agent"> - <startprofiler/> - <antcall target="test-single"/> - </target> - <target if="profiler.loadgen.path" name="-profile-start-loadgen"> - <loadgenstart path="${profiler.loadgen.path}"/> - </target> - <!-- - JAVADOC SECTION - --> - <target depends="init" if="have.sources" name="javadoc-build"> - <mkdir dir="${dist.javadoc.dir}"/> - <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> - <classpath> - <path path="${javac.classpath}:${j2ee.platform.classpath}"/> - </classpath> - <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> - <filename name="**/*.java"/> - </fileset> - <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> - <include name="**/*.java"/> - </fileset> - </javadoc> - <copy todir="${dist.javadoc.dir}"> - <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> - <filename name="**/doc-files/**"/> - </fileset> - <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> - <include name="**/doc-files/**"/> - </fileset> - </copy> - </target> - <target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview"> - <nbbrowse file="${dist.javadoc.dir}/index.html"/> - </target> - <target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/> - <!-- - - TEST COMPILATION SECTION - --> - <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test"> - <mkdir dir="${build.test.classes.dir}"/> - <property name="j2ee.platform.embeddableejb.classpath" value=""/> - </target> - <target name="-pre-compile-test"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test"> - <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/> - <copy todir="${build.test.classes.dir}"> - <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> - </copy> - </target> - <target name="-post-compile-test"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/> - <target name="-pre-compile-test-single"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single"> - <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> - <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" srcdir="${test.src.dir}"/> - <copy todir="${build.test.classes.dir}"> - <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> - </copy> - </target> - <target name="-post-compile-test-single"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/> - <!-- - - TEST EXECUTION SECTION - --> - <target depends="init" if="have.tests" name="-pre-test-run"> - <mkdir dir="${build.test.results.dir}"/> - </target> - <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run"> - <webproject2:test includes="${includes}" testincludes="**/*Test.java"/> - </target> - <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run"> - <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> - </target> - <target depends="init" if="have.tests" name="test-report"/> - <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/> - <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/> - <target depends="init" if="have.tests" name="-pre-test-run-single"> - <mkdir dir="${build.test.results.dir}"/> - </target> - <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single"> - <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> - <webproject2:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/> - </target> - <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single"> - <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> - </target> - <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/> - <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method"> - <fail unless="test.class">Must select some files in the IDE or set test.class</fail> - <fail unless="test.method">Must select some method in the IDE or set test.method</fail> - <webproject2:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/> - </target> - <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method"> - <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> - </target> - <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/> - <!-- - - TEST DEBUGGING SECTION - --> - <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test"> - <fail unless="test.class">Must select one file in the IDE or set test.class</fail> - <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/> - </target> - <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method"> - <fail unless="test.class">Must select one file in the IDE or set test.class</fail> - <fail unless="test.method">Must select some method in the IDE or set test.method</fail> - <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/> - </target> - <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test"> - <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/> - </target> - <target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/> - <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/> - <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test"> - <webproject1:nbjpdareload dir="${build.test.classes.dir}"/> - </target> - <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/> - <!-- - - CLEANUP SECTION - --> - <target depends="init" name="deps-clean" unless="no.deps"/> - <target depends="init" name="do-clean"> - <condition property="build.dir.to.clean" value="${build.web.dir}"> - <isset property="dist.ear.dir"/> - </condition> - <property name="build.dir.to.clean" value="${build.web.dir}"/> - <delete includeEmptyDirs="true" quiet="true"> - <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/> - </delete> - <delete dir="${build.dir}"/> - <available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/> - <delete dir="${dist.dir}"/> - </target> - <target depends="do-clean" if="status.clean-failed" name="check-clean"> - <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/> - <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/> - </target> - <target depends="init" if="netbeans.home" name="undeploy-clean"> - <nbundeploy failOnError="false" startServer="false"/> - </target> - <target name="-post-clean"> - <!-- Empty placeholder for easier customization. --> - <!-- You can override this target in the ../build.xml file. --> - </target> - <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/> - <target depends="clean" description="Clean build products." name="clean-ear"/> -</project> diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties deleted file mode 100644 index f03f563416efa04fb79859b3bed1cd26202395bc..0000000000000000000000000000000000000000 --- a/nbproject/genfiles.properties +++ /dev/null @@ -1,9 +0,0 @@ -build.xml.data.CRC32=9056fd3e -build.xml.script.CRC32=dbe0c9d0 -build.xml.stylesheet.CRC32=651128d4@1.77.1.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=9056fd3e -nbproject/build-impl.xml.script.CRC32=fc597094 -nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 -nbproject/jaxws-build.xml.stylesheet.CRC32=6608c2cf diff --git a/nbproject/jax-ws.xml b/nbproject/jax-ws.xml deleted file mode 100644 index e7003aed3059954a102256e762fc426347b4a588..0000000000000000000000000000000000000000 --- a/nbproject/jax-ws.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<jax-ws xmlns="http://www.netbeans.org/ns/jax-ws/1"> - <services> - <service name="History"> - <implementation-class>OjekOnline.History</implementation-class> - </service> - </services> - <clients/> -</jax-ws> diff --git a/nbproject/jaxws-build.xml b/nbproject/jaxws-build.xml deleted file mode 100644 index 69fb227edcdfd24982bf5bf6a5f4a7156ecc5b5a..0000000000000000000000000000000000000000 --- a/nbproject/jaxws-build.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><!-- - *** GENERATED FROM jax-ws.xml - DO NOT EDIT ! *** - *** TO MODIFY wsimport options USE Web Service node -> Edit WS Attributes *** - *** TO CHANGE TARGETS GENERATED TO jaxws-build.xml COPY THOSE *** - *** TARGETS TO ../build.xml AND MODIFY THAT FILE INSTEAD *** - - --><project xmlns:xalan="http://xml.apache.org/xslt" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1"> - <!-- - =================== - JAX-WS WSGEN SECTION - =================== - --> - <target name="wsgen-init" depends="init, -do-compile"> - <mkdir dir="${build.generated.sources.dir}/jax-ws/resources/"/> - <mkdir dir="${build.classes.dir}"/> - <mkdir dir="${build.classes.dir}/META-INF"/> - <property name="j2ee.platform.wsgen.classpath" value="${libs.jaxws21.classpath}"/> - <taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen"> - <classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}"/> - </taskdef> - </target> - <target name="wsgen-History" depends="wsgen-init"> - <copy todir="${build.classes.dir}/META-INF"> - <fileset dir="${webinf.dir}" includes="wsit-OjekOnline.History.xml"/> - </copy> - <wsgen sourcedestdir="${build.generated.sources.dir}/jax-ws" resourcedestdir="${build.generated.sources.dir}/jax-ws/resources/" destdir="${build.generated.sources.dir}/jax-ws" verbose="true" keep="true" genwsdl="true" sei="OjekOnline.History" xendorsed="true"> - <classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}"/> - </wsgen> - </target> - <!-- - =================== - JAX-WS WSIMPORT SECTION - =================== - --> -</project> diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties deleted file mode 100644 index 516ad992f6bd57da1533bf0b7614959f8c240ad5..0000000000000000000000000000000000000000 --- a/nbproject/private/private.properties +++ /dev/null @@ -1,7 +0,0 @@ -deploy.ant.properties.file=C:\\Users\\Lenovo-\\AppData\\Roaming\\NetBeans\\8.2\\config\\GlassFishEE6\\Properties\\gfv3-1874012289.properties -j2ee.platform.is.jsr109=true -j2ee.server.domain=C:/Users/Lenovo-/AppData/Roaming/NetBeans/8.2/config/GF_4.1.1/domain1 -j2ee.server.home=C:/Program Files/glassfish-4.1.1/glassfish -j2ee.server.instance=[C:\\Program Files\\glassfish-4.1.1\\glassfish;C:\\Program Files\\glassfish-4.1.1\\glassfish\\domains\\domain1]deployer:gfv3ee6wc:localhost:4848 -j2ee.server.middleware=C:/Program Files/glassfish-4.1.1 -user.properties.file=C:\\Users\\Lenovo-\\AppData\\Roaming\\NetBeans\\8.2\\build.properties diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml deleted file mode 100644 index 161c2df193c65acb00395d81042339911ba45e31..0000000000000000000000000000000000000000 --- a/nbproject/private/private.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> - <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> - <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> - <group> - <file>file:/D:/SabebTeam/TugasBesar2_2017/src/java/IdentityService/User.java</file> - <file>file:/D:/SabebTeam/TugasBesar2_2017/src/java/OjekOnline/History.java</file> - </group> - </open-files> -</project-private> diff --git a/nbproject/project.properties b/nbproject/project.properties deleted file mode 100644 index 82eb3807c6a222c4aa76702ffc0f26211046e31c..0000000000000000000000000000000000000000 --- a/nbproject/project.properties +++ /dev/null @@ -1,89 +0,0 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=true -annotation.processing.processors.list= -annotation.processing.run.all.processors=true -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output -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 -# Files to be excluded from distribution war -dist.archive.excludes= -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-7.0.classpath} -excludes= -includes=** -j2ee.compile.on.save=true -j2ee.copy.static.files.on.save=true -j2ee.deploy.on.save=true -j2ee.platform=1.7-web -j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/cdi-api.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar -j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar -j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar -j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar -j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar -j2ee.platform.wsit.classpath= -j2ee.server.type=gfv3ee6 -jar.compress=false -javac.classpath= -# Space-separated list of extra javac options -javac.compilerargs= -javac.debug=true -javac.deprecation=false -javac.processorpath=\ - ${javac.classpath} -javac.source=1.8 -javac.target=1.8 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -javac.test.processorpath=\ - ${javac.test.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= -lib.dir=${web.docbase.dir}/WEB-INF/lib -no.dependencies=false -persistence.xml.dir=${conf.dir} -platform.active=default_platform -resource.dir=setup -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=${war.name} -war.name=SabebTeam.war -web.docbase.dir=web -webinf.dir=web/WEB-INF diff --git a/nbproject/project.xml b/nbproject/project.xml deleted file mode 100644 index 5a581b4ac13e726e8fca99c49a3f3c0229f30798..0000000000000000000000000000000000000000 --- a/nbproject/project.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://www.netbeans.org/ns/project/1"> - <type>org.netbeans.modules.web.project</type> - <configuration> - <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1"> - <extension file="jaxws-build.xml" id="jaxws"/> - </buildExtensions> - <data xmlns="http://www.netbeans.org/ns/web-project/3"> - <name>SabebTeam</name> - <minimum-ant-version>1.6.5</minimum-ant-version> - <web-module-libraries/> - <web-module-additional-libraries/> - <source-roots> - <root id="src.dir" name="Source Packages"/> - </source-roots> - <test-roots> - <root id="test.src.dir" name="Test Packages"/> - </test-roots> - </data> - </configuration> -</project> diff --git a/org.json.jar b/org.json.jar new file mode 100644 index 0000000000000000000000000000000000000000..543438992fab3d820a1d900d65537347be419d21 Binary files /dev/null and b/org.json.jar differ diff --git a/src/conf/MANIFEST.MF b/src/conf/MANIFEST.MF deleted file mode 100644 index 59499bce4a2bd51cba227b7c00fcf745b19c95a4..0000000000000000000000000000000000000000 --- a/src/conf/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/src/java/IdentityService/User.java b/src/java/IdentityService/User.java deleted file mode 100644 index 6341420e9f914d0e7f36135d194462e9fb907e82..0000000000000000000000000000000000000000 --- a/src/java/IdentityService/User.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package IdentityService; - -/** - * - * @author TIFAH06 - */ -public class User { - private String username; - private String fullname; - private String email; - private String phonenumber; - private String password; - - public User() { - username=""; - fullname=""; - email=""; - phonenumber=""; - password=""; - } - public String getUsername() { - return username; - } - public String getFullname() { - return fullname; - } - public String getEmail() { - return email; - } - public String getPhonenumber() { - return phonenumber; - } - public String getPassword() { - return password; - } - public void setUsername(String uname) { - username = uname; - } - public void setFullname(String fname) { - fullname = fname; - } - public void setEmail(String e_mail) { - email = e_mail; - } - public void setPhonenumber(String phone) { - phonenumber = phone; - } - public void setPassword(String pass) { - password = pass; - } - -} diff --git a/src/java/OjekOnline/History.java b/src/java/OjekOnline/History.java deleted file mode 100644 index b70122f73e2075d7a20113d3ecb7236789f0a993..0000000000000000000000000000000000000000 --- a/src/java/OjekOnline/History.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package OjekOnline; - -import javax.jws.WebService; -import javax.jws.WebMethod; -import javax.jws.WebParam; - -/** - * - * @author TIFAH06 - */ -@WebService(serviceName = "History") -public class History { - protected String name; - protected String pickup; - protected String dest; - protected int rate; - protected String comment; - public History() { - - } - public String getName() { - return name; - } - public String getPickup(){ - return pickup; - } - public String getDest(){ - return dest; - } - public int getRate(){ - return rate; - } - public String getComment() { - return comment; - } - -} diff --git a/src/java/newXMLDocument.xml b/src/java/newXMLDocument.xml deleted file mode 100644 index 5b2eb49c0e666459d966a1501a00bec89d8bfbe5..0000000000000000000000000000000000000000 --- a/src/java/newXMLDocument.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -To change this license header, choose License Headers in Project Properties. -To change this template file, choose Tools | Templates -and open the template in the editor. ---> - - -<root> - -</root> diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml deleted file mode 100644 index 6058a36702ad03a4cd622100cfee7881c4e2e62b..0000000000000000000000000000000000000000 --- a/web/WEB-INF/web.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" - version="3.1"> - <session-config> - <session-timeout> - 30 - </session-timeout> - </session-config> -</web-app> diff --git a/web/WEB-INF/wsit-OjekOnline.History.xml b/web/WEB-INF/wsit-OjekOnline.History.xml deleted file mode 100644 index 27861fd58bf1bce443541ef850acece44e465fb7..0000000000000000000000000000000000000000 --- a/web/WEB-INF/wsit-OjekOnline.History.xml +++ /dev/null @@ -1,113 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - <definitions - xmlns="http://schemas.xmlsoap.org/wsdl/" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="NewWebService" targetNamespace="http://OjekOnline/" xmlns:tns="http://OjekOnline/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" - > - <message name="getName"/> - <message name="getNameResponse"/> - <message name="getPickup"/> - <message name="getPickupResponse"/> - <message name="getRate"/> - <message name="getRateResponse"/> - <message name="getDest"/> - <message name="getDestResponse"/> - <message name="getComment"/> - <message name="getCommentResponse"/> - <portType name="History"> - <operation name="getName"> - <input message="tns:getName"/> - <output message="tns:getNameResponse"/> - </operation> - <operation name="getPickup"> - <input message="tns:getPickup"/> - <output message="tns:getPickupResponse"/> - </operation> - <operation name="getRate"> - <input message="tns:getRate"/> - <output message="tns:getRateResponse"/> - </operation> - <operation name="getDest"> - <input message="tns:getDest"/> - <output message="tns:getDestResponse"/> - </operation> - <operation name="getComment"> - <input message="tns:getComment"/> - <output message="tns:getCommentResponse"/> - </operation> - </portType> - <binding name="HistoryPortBinding" type="tns:History"> - <operation name="getName"> - <input/> - <output/> - </operation> - <operation name="getPickup"> - <input/> - <output/> - </operation> - <operation name="getRate"> - <input/> - <output/> - </operation> - <operation name="getDest"> - <input/> - <output/> - </operation> - <operation name="getComment"> - <input/> - <output/> - </operation> - </binding> - <service name="NewWebService"> - <port name="HistoryPort" binding="tns:HistoryPortBinding"/> - </service> - <wsp:Policy wsu:Id="HistoryPortBinding_operation_Input_Policy"> - <wsp:ExactlyOne> - <wsp:All> - <sp:EncryptedParts> - <sp:Body/> - </sp:EncryptedParts> - <sp:SignedParts> - <sp:Body/> - </sp:SignedParts> - </wsp:All> - </wsp:ExactlyOne> - </wsp:Policy> - <wsp:Policy wsu:Id="HistoryPortBinding_operation_Output_Policy"> - <wsp:ExactlyOne> - <wsp:All> - <sp:EncryptedParts> - <sp:Body/> - </sp:EncryptedParts> - <sp:SignedParts> - <sp:Body/> - </sp:SignedParts> - </wsp:All> - </wsp:ExactlyOne> - </wsp:Policy> - <wsp:Policy wsu:Id="HistoryPortBinding_hello_Input_Policy"> - <wsp:ExactlyOne> - <wsp:All> - <sp:EncryptedParts> - <sp:Body/> - </sp:EncryptedParts> - <sp:SignedParts> - <sp:Body/> - </sp:SignedParts> - </wsp:All> - </wsp:ExactlyOne> - </wsp:Policy> - <wsp:Policy wsu:Id="HistoryPortBinding_hello_Output_Policy"> - <wsp:ExactlyOne> - <wsp:All> - <sp:EncryptedParts> - <sp:Body/> - </sp:EncryptedParts> - <sp:SignedParts> - <sp:Body/> - </sp:SignedParts> - </wsp:All> - </wsp:ExactlyOne> - </wsp:Policy> -</definitions> diff --git a/web/driver-history.jsp b/web/driver-history.jsp deleted file mode 100644 index a4d6ab882f672e13754e21b093c97b83fe3f2d85..0000000000000000000000000000000000000000 --- a/web/driver-history.jsp +++ /dev/null @@ -1,63 +0,0 @@ -<html> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="description" content="Ngo-Jek - Ojek Online Clone Website"> - <meta name="author" content="Taufan Mahaputra, Robby Syaifullah, M Rafli"> - <!-- Properties Title --> - <link rel="shortcut icon" href="historydriver.css" /> - <title>Ngo-Jek</title> - - <!-- Custom CSS --> - <link href="style/main.css" rel="stylesheet" type='text/css' /> - <link href="style/driver-history.css" rel="stylesheet" type='text/css' /> - <!-- Custom Fonts --> - <link href="assets/stylesheets/font-awesome.css" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Patua+One" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Oswald:400,500,600" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Roboto:400,500" rel="stylesheet"> - <!-- Script --> - -</head> -<body> - <div class="container-his"> - <!-- navbar --> - <div class="navbar-his"> - <img src="assets/image/yesbos.png" class="logo-his"> - <div class="logout-his"> - <p style="margin-bottom: 2px;">Hi, <strong> </strong> !</p> - <a href="index.php">Logout</a> - </div> - </div> - <!-- navigation --> - <div class="header" id="header"> - <nav> - <ul> - <li><a href="sel-destination.jsp">ORDER</a></li> - <li><a href="order-history.jsp" class="option-active" >HISTORY</a></li> - <li><a href="profile.jsp" >MY PROFILE</a></li> - </ul> - </nav> - </div> - <!-- make-an-hist --> - <div class="make-an-hist"> - <div class="make-an-hist-header"> - TRANSACTION HISTORY - </div> - </div> - <div class="hist-header1"> - <btn class="hist-2" id="-active"> - <div class="content"><a href="order-history.jsp"> MY PREVIOUS ORDER </a></div> - </btn> - <btn class="hist-2 option-active-sub" > - <div class="content"><a href=""> DRIVER HISTORY </a></div> - </btn> - </div> - <table> - - - </table> - </div> -</body> -</html> diff --git a/web/index.html b/web/index.html deleted file mode 100644 index fed47c6669a23a2ecb5a2f33bb3d9ec469848d12..0000000000000000000000000000000000000000 --- a/web/index.html +++ /dev/null @@ -1,17 +0,0 @@ -<!DOCTYPE html> -<!-- -To change this license header, choose License Headers in Project Properties. -To change this template file, choose Tools | Templates -and open the template in the editor. ---> -<html> - <head> - <title>TODO supply a title</title> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - </head> - <body> - <div>TODO write content</div> - <a href="order-history.jsp">Ini order-history</a> - </body> -</html> diff --git a/web/order-history.jsp b/web/order-history.jsp deleted file mode 100644 index d91aef3285cbab6749f17c59f7ded4ec824124f9..0000000000000000000000000000000000000000 --- a/web/order-history.jsp +++ /dev/null @@ -1,73 +0,0 @@ -<%-- - Document : order-history - Created on : Nov 5, 2017, 7:28:32 AM - Author : TIFAH06 ---%> - -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="description" content="Ngo-Jek - Ojek Online Clone Website"> - <meta name="author" content="Taufan Mahaputra, Robby Syaifullah, M Rafli"> - <!-- Properties Title --> - <link rel="shortcut icon" href="historypenumpang.css" /> - <title>Ngo-Jek</title> - - <!-- Custom CSS --> - <link href="assets/stylesheets/main.css" rel="stylesheet" type='text/css' /> - <link href="assets/stylesheets/historypenumpang.css" rel="stylesheet" type='text/css' /> - <!-- Custom Fonts --> - <link href="assets/stylesheets/font-awesome.css" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Patua+One" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Oswald:400,500,600" rel="stylesheet"> - <link href="https://fonts.googleapis.com/css?family=Roboto:400,500" rel="stylesheet"> - <link href="style/order-history.css" rel="stylesheet"> - <!-- Script --> - <script src="assets/javascript/edit-location.js"></script> - <script src="assets/javascript/history.js"></script> -</head> -<body> - <div class="container-his"> - <!-- navbar --> - <div class="navbar-his"> - <img src="assets/image/yesbos.png" class="logo-his"> - <div class="logout-his"> - <p style="margin-bottom: 2px;">Hi, <strong> </strong> !</p> - <a href="index.jsp">Logout</a> - </div> - </div> - <!-- navigation --> - <div class="header" id="header"> - <nav> - <ul> - <li><a href="sel-destination.jsp">ORDER</a></li> - <li><a href="history-penumpang.jsp" class="option-active" >HISTORY</a></li> - <li><a href="profile.jsp" >MY PROFILE</a></li> - </ul> - </nav> - </div> - <!-- make-an-hist --> - <div class="make-an-hist"> - <div class="make-an-hist-header"> - TRANSACTION HISTORY - </div> - </div> - <div class="hist-header1"> - <btn class="hist-2 option-active-sub" id="-active"> - <div class="content"><a href=""> MY PREVIOUS ORDER </a></div> - </btn> - <btn class="hist-2"> - <div class="content"><a href="driver-history.jsp"> DRIVER HISTORY </a></div> - </btn> - </div> - <table> - - - </table> - </div> -</body> -</html> diff --git a/web/style/driver-history.css b/web/style/driver-history.css deleted file mode 100644 index 8a7995a9da2b147ed1e5b26c951dbf967a342eab..0000000000000000000000000000000000000000 --- a/web/style/driver-history.css +++ /dev/null @@ -1,269 +0,0 @@ -.container-his { - display: block; - margin-left: auto; - margin-right: auto; - margin-top: 5%; - width: 35em; - height: 45em; - -webkit-box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); - -moz-box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); - box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); -} - -.navbar-his { - padding-top: 5px; - width: 100%; -} - -.logo-his { - float: left; - max-height: 80px; - line-height: 80px; - margin-left: 12px; -} - -body { - background-color: #f5f5f5; - font-family: 'Roboto', sans-serif; -} - -div { - margin: auto; -} - -.make-an-hist-header { - display: flex; - padding-left: 36px; - padding-top: 8px; - padding-bottom: 8px; - font-weight: 500; - font-size: 24px; - font-family: 'Oswald', sans-serif; - text-transform: uppercase; -} - -.location-header { - display: flex; -} - -.hist-header1 { - margin-left: 90px; - display: flex; - align-content: center; - text-align: center; -} - -.buletan { - height: 30px; - min-width: 30px; - background-color: gray; - border-radius: 100%; - margin-top: 3px; - margin-left: 3px; - text-align: center; -} - -.teks-buletan { - font-size: 16px; - margin-top: 6px; - color: black; -} - -.hist-2 { - margin-left: 16px; - display: flex; - font-size: 12px; - color: black; - width: 150px; - text-align: center; - padding: 6px 6px; - border: 1px solid black; - font-size: 32px; - font-family: 'Oswald', sans-serif; - text-transform: uppercase; -} - -.content { - font-size: 18px; - text-align: center; - color: black; -} - -.content2 { - font-size: 12px; - padding: 10px 5px 10px 5px; - color: black; -} - -a.whitelink { - color: white; -} - -#hist-active { - background-color: yellow; - color: yellow; -} - -.whitelink { - border-radius: 15px; -} - -.preferred-drivers-container { - margin-top: 15px; - margin-left: 36px; - margin-right: 36px; - border: 1px solid black; - border-radius: 15px; -} - -.preferred-drivers-header { - margin-left: 5px; - margin-top: 3px; - font-size: 21px; - font-weight: 500; -} - -.img-history > img { - max-height: 100px; - max-width: 100px; - margin-top: 36px; - margin-left: 36px; - border: 10px solid black; -} - -.sub-title { - float: right; - margin-left: 12px; - margin-right: 36px; - width: 370px; -} - -.grey-title { - font-size: 13px; - color: grey; - margin-top: 24px; - margin-bottom: 2px; -} - -.driver { - margin-top: 2px; - margin-bottom: 2px; - font-size: 17px; -} - -.sub-text { - margin-top: 7px; - margin-bottom: 2px; - font-size: 12px; -} - -.rate-comment { - margin-top: 5px; - font-size: 12px; -} - -.rate { - padding-right: 8px; -} - -.comment-content { - margin-top: 2px; - margin-left: 12px; - width: 30em; -} - -.checked { - color: orange; -} - -.hide-button { - float: right; - margin-top: 24px; - background-color: #db1c26; - border-radius: 8px; - text-align: center; - font-size: 18px; - width: 80px; - padding: 6px 6px 6px 6px; -} - -.header nav ul { - display: -moz-flex; - display: -webkit-flex; - display: -ms-flex; - display: flex; - padding-left: 36px; - margin-bottom: 0; - list-style: none; - width: 100%; -} - - .header nav ul li { - padding-left: 0; - border: solid 1px #000; - } - - .header nav ul li a { - color: black; - display: block; - width: 160px; - height: 3.25rem; - line-height: 3.25rem; - text-transform: uppercase; - font-size: 1.45rem; - margin: auto; - text-align: center; - font-weight: 700; - border-bottom: 0; - -webkit-transition: all .3s ease; - -moz-transition: all .3s ease; - -o-transition: all .3s ease; - transition: all .3s ease; - text-decoration: none; - } - - .header nav ul li a:hover { - background-color: #008000; - color: #f5f5f5; - } - - .header nav ul li a:active { - background-color: #008000; - color: #f5f5f5; - } - -.header .option-active { - background-color: #008000; - color: #f5f5f5; -} - -.option-active-sub { - background-color: #6dc066; -} - -.logout-his { - text-align: right; - font-size: 15px; - margin-right: 36px; - display: inline-block; - float: right; - margin-top: 5px; -} - -.pict { - margin-top: 30px; - height: 120px; - width: 120px; - margin-left: 36px; - border: 1px solid black; -} - -.errmsg { - background-color: lightgreen; - margin-top: 24px; - border-radius: 7px; - border: 3px solid green; - border-color: darkgreen; - width: 370px; - text-align: center; -} diff --git a/web/style/main.css b/web/style/main.css deleted file mode 100644 index abd23a4120aa35e5b89ef7e13e5340b56aca8c5e..0000000000000000000000000000000000000000 --- a/web/style/main.css +++ /dev/null @@ -1,87 +0,0 @@ -body { - background-color: #f5f5f5; - font-family: 'Roboto', sans-serif; -} - -div { - margin: 0 0 0 0; -} - -a { - text-decoration: none !important; - color: inherit; -} - -.login { - background-color: #81ba2c; - background-size: 100%; - border-radius: 15%; - border: 10px solid #008000; - margin-top: 5%; - margin-left: auto; - margin-right: auto; - width: 20em; - height: 25em; - padding: 20px; - color: #21660e; -} - -.title { - margin-bottom: 20px; - font-size: 3em; - font-weight: 500; - font-family: 'Oswald', sans-serif; - text-transform: uppercase; - text-align: center; -} - -.input-form { - font-size: 1.5em; - margin-left: 15px; - display: inline-block; -} - -.submit-form { - margin-top: 40px; - margin-left: 15px; - display: inline-flex; -} - -input[type=submit] { - cursor: pointer; - float: right; - width: 85px; - margin-left: 60px; - border-radius: 15%; - border: 2px solid black; - background-color: #a1dd27; - font-size: 20px; -} - -input[type=submit]:hover { - opacity: .7; - font-weight: 700; -} - -.login p { - margin-right: 20px; -} - -.login .no-acc { - font-size: .8em; -} - -.login .label { - display: flex; - padding-bottom: 10px; -} - -.login .label input { - border: 1px solid black; - margin: auto; - height: 25px; -} - -.label { - margin-bottom: -50px; -} diff --git a/web/style/order-history.css b/web/style/order-history.css deleted file mode 100644 index 79f5b4eea8e0a293ec86f4def42720b49276190a..0000000000000000000000000000000000000000 --- a/web/style/order-history.css +++ /dev/null @@ -1,269 +0,0 @@ -.container-his { - display: block; - margin-left: auto; - margin-right: auto; - margin-top: 5%; - width: 35em; - height: 45em; - -webkit-box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); - -moz-box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); - box-shadow: -1px 1px 17px 0px rgba(0,0,0,0.22); -} - -.navbar-his { - padding-top: 5px; - width: 100%; -} - -.logo-his { - float: left; - max-height: 80px; - line-height: 80px; - margin-left:12px; -} - -body { - background-color: #f5f5f5; - font-family: 'Roboto', sans-serif; -} - -div { - margin: auto; -} - -.make-an-hist-header { - display: flex; - padding-left: 36px; - padding-top: 8px; - padding-bottom: 8px; - font-weight: 500; - font-size: 24px; - font-family: 'Oswald', sans-serif; - text-transform: uppercase; -} - -.location-header { - display: flex; -} - -.hist-header1 { - margin-left: 90px; - display: flex; - align-content: center; - text-align: center; -} - -.buletan { - height: 30px; - min-width: 30px; - background-color: gray; - border-radius: 100%; - margin-top: 3px; - margin-left: 3px; - text-align: center; -} - -.teks-buletan { - font-size: 16px; - margin-top: 6px; - color: black; -} - -.hist-2 { - margin-left: 16px; - display: flex; - font-size: 12px; - color: black; - width: 150px; - text-align: center; - padding: 6px 6px; - border: 1px solid black; - font-size: 32px; - font-family: 'Oswald', sans-serif; - text-transform: uppercase; -} - -.content { - font-size: 18px; - text-align: center; - color: black; -} - -.content2 { - font-size: 12px; - padding: 10px 5px 10px 5px; - color: black; -} - -a.whitelink { - color: white; -} - -#hist-active { - background-color: yellow; - color: yellow; -} - -.whitelink { - border-radius: 15px; -} - -.preferred-drivers-container { - margin-top: 15px; - margin-left: 36px; - margin-right: 36px; - border: 1px solid black; - border-radius: 15px; -} - -.preferred-drivers-header { - margin-left: 5px; - margin-top: 3px; - font-size: 21px; - font-weight: 500; -} - -.img-history > img { - max-height: 100px; - max-width: 100px; - margin-top: 36px; - margin-left: 36px; - border: 1px solid black; -} - -.sub-title { - float: right; - margin-left:12px; - margin-right: 36px; - width : 370px; -} - -.grey-title { - font-size: 13px; - color: grey; - margin-top: 24px; - margin-bottom: 2px; -} - -.driver { - margin-top: 2px; - margin-bottom: 2px; - font-size: 17px; -} - -.sub-text { - margin-top: 7px; - margin-bottom: 2px; - font-size: 12px; -} - -.rate-comment { - margin-top: 5px; - font-size: 12px; -} - -.rate { - padding-right: 8px; -} - -.comment-content { - margin-top: 2px; - margin-left: 12px; - width: 30em; -} - -.checked { - color: orange; -} - -.hide-button { - float: right; - margin-top: 24px; - background-color: #db1c26; - border-radius: 8px; - text-align: center; - font-size: 18px; - width: 80px; - padding: 6px 6px 6px 6px; -} - -.header nav ul { - display: -moz-flex; - display: -webkit-flex; - display: -ms-flex; - display: flex; - padding-left: 36px; - margin-bottom: 0; - list-style: none; - width: 100%; -} - - .header nav ul li { - padding-left: 0; - border: solid 1px #000; - } - - .header nav ul li a { - color: black; - display: block; - width: 160px; - height: 3.25rem; - line-height: 3.25rem; - text-transform: uppercase; - font-size: 1.45rem; - margin: auto; - text-align: center; - font-weight: 700; - border-bottom: 0; - -webkit-transition: all .3s ease; - -moz-transition: all .3s ease; - -o-transition: all .3s ease; - transition: all .3s ease; - text-decoration: none; - } - - .header nav ul li a:hover { - background-color: #008000; - color: #f5f5f5; - } - - .header nav ul li a:active { - background-color: #008000; - color: #f5f5f5; - } - -.header .option-active { - background-color: #008000; - color: #f5f5f5; -} - -.option-active-sub { - background-color: #6dc066; -} - -.logout-his { - text-align: right; - font-size: 15px; - margin-right: 36px; - display: inline-block; - float: right; - margin-top: 5px; -} - -.pict { - margin-top: 30px; - height: 120px; - width: 120px; - margin-left: 36px; - border: 1px solid black; -} - -.errmsg { - background-color: lightgreen; - margin-top: 24px; - border-radius: 7px; - border: 3px solid green; - border-color: darkgreen; - width: 370px; - text-align:center; -}