https://issues.apache.org/jira/browse/MYFACES-3292
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/LICENSE.txt b/maven2-plugins/myfaces-jsdoc-plugin/LICENSE.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/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/maven2-plugins/myfaces-jsdoc-plugin/NOTICE.txt b/maven2-plugins/myfaces-jsdoc-plugin/NOTICE.txt
new file mode 100644
index 0000000..fa3dbd6
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/NOTICE.txt
@@ -0,0 +1,16 @@
+=========================================================================
+== NOTICE file corresponding to section 4(d) of the Apache License, ==
+== Version 2.0, in this case for the Apache MyFaces Maven Plugins ==
+=========================================================================
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of this software were originally based on the following:
+
+ - software copyright (c) 2000-2006, Oracle Corp, <http://www.oracle.com/>.
+and are licensed to the Apache Software Foundation under the
+"Software Grant and Corporate Contribution License Agreement"
+
+See the LICENSE.txt file for information on all licenses
+associated with this software.
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/pom.xml b/maven2-plugins/myfaces-jsdoc-plugin/pom.xml
new file mode 100644
index 0000000..5754315
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/pom.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-plugin-parent</artifactId>
+ <version>1.0.4</version>
+ <relativePath>../myfaces-plugin-parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-jsdoc-plugin</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>maven-plugin</packaging>
+ <name>Apache MyFaces Buildtools Maven2 Javascript Documentation Plugin</name>
+
+ <scm>
+ <connection>
+ scm:svn:http://svn.apache.org/repos/asf/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-javascript-plugin
+ </connection>
+ <developerConnection>
+ scm:svn:https://svn.apache.org/repos/asf/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-javascript-plugin
+ </developerConnection>
+ <url>http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-javascript-plugin
+ </url>
+ </scm>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>rhino</groupId>
+ <artifactId>js</artifactId>
+ <version>1.7R1</version>
+ </dependency>
+
+ <!-- note jsdoc throws a lot of warnings
+ which will be gone in 2.4 -->
+ <dependency>
+ <groupId>org.jsdoctoolkit</groupId>
+ <artifactId>jsdoc</artifactId>
+ <version>2.1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.4</version>
+ </dependency>
+
+ <!-- we have to add the stax api just in case
+ we are on an older build system -->
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax</artifactId>
+ <version>1.2.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ </plugins>
+ </reporting>
+
+</project>
\ No newline at end of file
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/JSDocMojo.java b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/JSDocMojo.java
new file mode 100644
index 0000000..9ee0b4a
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/JSDocMojo.java
@@ -0,0 +1,342 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.myfaces.plugins.jsdoc;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.TrueFileFilter;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.myfaces.plugins.jsdoc.util.HTMLFileContentFilter;
+import org.apache.myfaces.plugins.jsdoc.util.XMLConfig;
+import org.apache.myfaces.plugins.jsdoc.util.JSDocPack;
+import org.apache.myfaces.plugins.jsdoc.util.JSDocPackMaven;
+import org.apache.myfaces.plugins.jsdoc.util.JSFileNameFilter;
+
+import javax.xml.stream.XMLStreamException;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ * <p/>
+ * A simple jsdoc plugin which should cover our documentation needs
+ * Note this plugin is a simplified tailored derivate from
+ * <p/>
+ * http://www.abiss.gr some code stems from there.
+ * <p/>
+ * since we use jsdoc for now and are not in the reporting part
+ * a simple plugin suffices.
+ * @goal jsdoc
+ */
+public class JSDocMojo extends AbstractMojo
+{
+
+ /**
+ * the root project build dir (target directory)
+ *
+ * @parameter expression="${project.build.directory}"
+ */
+ String projectBuildDir;
+
+ /**
+ * The project source directory
+ *
+ * @parameter expression="${project.build.directory}/../src/main/javascript/META-INF/"
+ */
+ String buildSourceDirectory;
+
+ /**
+ * Path to the assembly file containing the file paths to our source javascript files
+ *
+ * @parameter expression="${project.build.directory}/../src/assembler/jsdoc-compiler.xml"
+ */
+ String assemblyFile;
+
+ //various jsdoc params, copied over as well as the corresponding snippets from
+ /**
+ * Whether to include symbols tagged as private. Default is <code>false</code>.
+ *
+ * @parameter expression="false"
+ */
+ boolean includePrivate;
+
+ /**
+ * Include all functions, even undocumented ones. Default is <code>false</code>.
+ *
+ * @parameter expression="false"
+ */
+ boolean includeUndocumented;
+
+ /**
+ * Include all functions, even undocumented, underscored ones. Default is <code>false</code>.
+ *
+ * @parameter expression="false"
+ */
+ boolean includeUndocumentedUnderscored;
+
+ /**
+ * template directory used by jsdoc the default is <code>templates/jsdoc</code> under the jsdoc root
+ *
+ * @parameter expression="templates/jsdoc"
+ */
+ String templates;
+
+ /**
+ * output dir override
+ *
+ * @parameter expression=""
+ */
+ String outputDirectory;
+
+ /**
+ * the parsed xml filemap containing the single source files
+ */
+ XMLConfig fileMap;
+
+ JSDocPack unpacker;
+
+ /**
+ * target path for the unpacked jsdoc engine
+ */
+ String jsdocEngineUnpacked = null;
+
+ /**
+ * target patchs for the javascript
+ */
+ String javascriptTargetPath = null;
+
+ /**
+ * run path for the jsdoc engine
+ */
+ String jsdocRunPath = null;
+
+ protected void _setup() throws MojoExecutionException
+ {
+ try
+ {
+ fileMap = new XMLConfig(assemblyFile);
+ }
+ catch (XMLStreamException e)
+ {
+ getLog().error(e);
+ throw new MojoExecutionException(e.toString());
+ }
+ catch (FileNotFoundException e)
+ {
+ getLog().error(e);
+ throw new MojoExecutionException(e.toString());
+ }
+ unpacker = new JSDocPackMaven();
+ //unpacker = new JSDocPackResources();
+
+ jsdocRunPath = projectBuildDir + File.separator + JSDocMojoConst.JSDOC;
+ jsdocEngineUnpacked = projectBuildDir + File.separator + JSDocMojoConst.TEMP
+ + File.separator + JSDocMojoConst.JSDOC;
+
+ javascriptTargetPath = jsdocRunPath + File.separator + JSDocMojoConst.JAVASCRIPT;
+
+ File pathCreator = new File(jsdocEngineUnpacked);
+ File jsdocPathCreator = new File(javascriptTargetPath);
+ pathCreator.mkdirs();
+ jsdocPathCreator.mkdirs();
+ }
+
+ public void _tearDown()
+ {
+
+ }
+
+ protected void _execute() throws MojoExecutionException, IOException
+ {
+
+ copyJavascripts();
+
+ fetchJavascriptSources();
+ //now we have all files we now can now work on our plugin call
+ unpackJSDoc();
+
+ String systemJsdocDir = setenvJSDocDir();
+ String userDir = setenvUserDir();
+ try
+ {
+ executeJSDoc();
+ }
+ finally
+ {
+ resetSysenvVars(systemJsdocDir, userDir);
+ }
+ }
+
+ private void resetSysenvVars(String systemJsdocDir, String userDir)
+ {
+ if (systemJsdocDir != null)
+ {
+ System.setProperty(JSDocMojoConst.JSDOC_DIR, systemJsdocDir);
+ }
+ if (userDir != null)
+ {
+ System.setProperty("user.dir", userDir);
+ }
+ }
+
+ private void executeJSDoc()
+ {
+ List args = _initArguments();
+
+ getLog().info("[JSDOC] Executing within maven: '" + args.toString().replaceAll(",", "") + "'");
+
+ // tell Rhino to run JSDoc with the provided params
+ // without calling System.exit
+
+ org.mozilla.javascript.tools.shell.Main.main((String[]) args.toArray(new String[0]));
+
+ this.fixHTML();
+ }
+
+ private String setenvUserDir()
+ {
+ String userDir = System.getProperty("user.dir");
+ System.setProperty("user.dir", jsdocEngineUnpacked + File.separator);
+ return userDir;
+ }
+
+ private String setenvJSDocDir()
+ {
+ String systemJsdocDir = System.getProperty(JSDocMojoConst.JSDOC_DIR);
+ System.setProperty(JSDocMojoConst.JSDOC_DIR, jsdocEngineUnpacked + File.separator);
+ return systemJsdocDir;
+ }
+
+ private void unpackJSDoc() throws IOException
+ {
+ getLog().info("[JSDOC] Unpacking jsdoc toolkit for further processing");
+ unpacker.unpack(jsdocEngineUnpacked, getLog());
+ getLog().info("[JSDOC] Unpacking jsdoc toolkit for further processing done");
+ }
+
+ /**
+ * initially copies all source files from the given source dir to the target
+ * dir so that the files can be referenced later on by the html files
+ */
+ private void copyJavascripts() throws IOException
+ {
+ getLog().info("[JSDOC] Copying all javascript sources to the target dir for later reference");
+ FileUtils.copyDirectory(new File(buildSourceDirectory), new File(javascriptTargetPath));
+ getLog().info("[JSDOC] Copying done without any errors");
+ }
+
+ private final List _initArguments()
+ {
+ List args = new ArrayList();
+ String runJsPath = jsdocEngineUnpacked + File.separator + JSDocMojoConst.APP
+ + File.separator + JSDocMojoConst.RUN_JS;
+ args.add(runJsPath);
+
+ if (this.includeUndocumented)
+ {
+ args.add(JSDocMojoConst.PARAM_UNDOCUMENTED);
+ }
+ if (this.includeUndocumentedUnderscored)
+ {
+ args.add(JSDocMojoConst.PARAM_UNDOCUMENTED_UNDERSCORED);
+ }
+ if (this.includePrivate)
+ {
+ args.add(JSDocMojoConst.PARAM_PRIVATE);
+ }
+ args.add(JSDocMojoConst.PARAM_OUTPUT + JSDocMojoConst.EQUALS + this.getOutputDirectory());
+ args.add(JSDocMojoConst.PARAM_TEMPLATE + JSDocMojoConst.EQUALS + getTemplateDirectory());
+
+ args.addAll(fetchJavascriptSources());
+ //according to the run.js source the last argument
+ //must be a -j param pointing to the jsdoc javascripts
+ args.add(JSDocMojoConst.PARAM_JS_FLAG + JSDocMojoConst.EQUALS + runJsPath);
+ return args;
+ }
+
+ /**
+ * @return the directory as absolute path holding the jsdoc toolkit templates
+ */
+ private final String getTemplateDirectory()
+ {
+ return (JSDocMojoConst.TEMPLATES_JSDOC.equals(this.templates)) ?
+ this.jsdocEngineUnpacked + File.separator + this.templates :
+ this.templates;
+ }
+
+ /**
+ * @return the target directory for the jsdoc files
+ */
+ private final String getOutputDirectory()
+ {
+ return (this.outputDirectory == null || this.outputDirectory.equals("")) ?
+ projectBuildDir + File.separator + JSDocMojoConst.JSDOC :
+ this.outputDirectory;
+
+ }
+
+ /**
+ * @return fetches the sources for the javascripts in the order given by the xml
+ */
+ private List fetchJavascriptSources()
+ {
+ getLog().info("[JSDOC] Fetch Javascript sources for further processing");
+ JSFileNameFilter fileNameFilter = new JSFileNameFilter(fileMap);
+ FileUtils.iterateFiles(new File(getOutputDirectory()), fileNameFilter, TrueFileFilter.INSTANCE);
+
+ Map sortedResult = fileNameFilter.getSortedResults();
+ List sources = new ArrayList(sortedResult.size());
+ Iterator it = sortedResult.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry singleItem = (Map.Entry) it.next();
+ String finalFileName = (String) singleItem.getValue();
+ sources.add(finalFileName);
+ }
+ getLog().info("[JSDOC] All Javascript sources are prepared for processing");
+ return sources;
+ }
+
+ private void fixHTML()
+ {
+ FileUtils.iterateFiles(new File(getOutputDirectory()), new HTMLFileContentFilter(getOutputDirectory()),
+ TrueFileFilter.INSTANCE);
+ }
+
+ public void execute() throws MojoExecutionException
+ {
+ _setup();
+ try
+ {
+ _execute();
+ }
+ catch (IOException e)
+ {
+ throw new MojoExecutionException(e.toString());
+ }
+
+ }
+
+}
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/JSDocMojoConst.java b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/JSDocMojoConst.java
new file mode 100644
index 0000000..c2a7190
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/JSDocMojoConst.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.myfaces.plugins.jsdoc;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class JSDocMojoConst
+{
+ public static final String TEMPLATES_JSDOC = "templates/jsdoc";
+ public static final String JSDOC = "jsdoc";
+ public static final String TEMP = "temp";
+ public static final String JSDOC_DIR = "jsdoc.dir";
+ public static final String APP = "app";
+ public static final String RUN_JS = "run.js";
+ public static final String PARAM_UNDOCUMENTED = "-a";
+ public static final String PARAM_UNDOCUMENTED_UNDERSCORED = "-A";
+ public static final String PARAM_PRIVATE = "-p";
+ public static final String PARAM_OUTPUT = "-d";
+ public static final String PARAM_TEMPLATE = "-t";
+ public static final String PARAM_JS_FLAG = "-j";
+ public static final String EQUALS = "=";
+ public static final String JAVASCRIPT = "javascript";
+}
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/HTMLFileContentFilter.java b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/HTMLFileContentFilter.java
new file mode 100644
index 0000000..a916164
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/HTMLFileContentFilter.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.myfaces.plugins.jsdoc.util;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.IOFileFilter;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ * <p/>
+ * Since jsdoc adds the full canonical path to our filenames we have to fix it within the generated html
+ */
+
+public class HTMLFileContentFilter implements IOFileFilter
+{
+
+ String substitutionDir;
+
+ public HTMLFileContentFilter(String substitutionDir)
+ {
+ this.substitutionDir = substitutionDir;
+ }
+
+ private boolean fixFile(String fileName) throws IOException
+ {
+ if (!fileName.toLowerCase().endsWith(".html"))
+ {
+ return false;
+ }
+ String fileContents = FileUtils.readFileToString(new File(fileName));
+ List currFile = FileUtils.readLines(new File(fileName));
+ List targetLines = new ArrayList(currFile.size());
+ Iterator it = currFile.iterator();
+ while (it.hasNext())
+ {
+ Object line = it.next();
+ String sLine = (String) line;
+ targetLines.add(sLine.replaceAll(substitutionDir, ""));
+ }
+ FileUtils.writeLines(new File(fileName), targetLines);
+ return true;
+ }
+
+ public boolean accept(File file)
+ {
+ if (file.isDirectory())
+ {
+ return false;
+ }
+ try
+ {
+ fixFile(file.getAbsolutePath());
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ return true;
+ }
+
+ public boolean accept(File file, String s)
+ {
+ if (file.isDirectory())
+ {
+ return false;
+ }
+ try
+ {
+ fixFile(file.getAbsolutePath() + File.separator + s);
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ return true;
+ }
+}
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSDocPack.java b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSDocPack.java
new file mode 100644
index 0000000..9b54585
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSDocPack.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.myfaces.plugins.jsdoc.util;
+
+import org.apache.maven.plugin.logging.Log;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.FileOutputStream;
+
+import java.util.Enumeration;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ * <p/>
+ * base class for all our jsdoc unpackers
+ */
+
+public abstract class JSDocPack
+{
+ String _jarPath;
+ File _jsdocContainer;
+
+ protected JSDocPack()
+ {
+
+ }
+
+ public abstract void unpack(String targetDir, Log log) throws IOException;
+
+ protected void _expandJarFile(String targetDir, Log log, JarFile jarFile) throws IOException
+ {
+ Enumeration entries = jarFile.entries();
+ while (entries.hasMoreElements())
+ {
+ JarEntry entry = (JarEntry) entries.nextElement();
+
+ File targetFile = new File(targetDir + File.separator + entry.getName());
+ if (entry.isDirectory())
+ {
+ targetFile.mkdir();
+ continue;
+ }
+ InputStream istr = new BufferedInputStream(jarFile.getInputStream(entry));
+ OutputStream ostr = new BufferedOutputStream(new FileOutputStream(targetFile));
+ log.debug("[JSDOC] Unpacking jar: Writing" + targetFile);
+ while (istr.available() > 0)
+ {
+ ostr.write(istr.read());
+ }
+ ostr.close();
+ istr.close();
+ }
+ }
+
+}
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSDocPackMaven.java b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSDocPackMaven.java
new file mode 100644
index 0000000..bdbb8a5
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSDocPackMaven.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.myfaces.plugins.jsdoc.util;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.jar.JarFile;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ * <p/>
+ * An unpacker for the jsdoc toolkit
+ * Unfortunately we have to unpack the jsdoc toolkit during
+ * the build process because we have a set of js files
+ * running via rhino which will not work unless we have them
+ * on the filesystem instead of the jar.
+ * <p/>
+ * The jsdoc toolkit itself can be streamed in via maven.
+ */
+
+public class JSDocPackMaven extends JSDocPack
+{
+
+ /**
+ * constructor
+ */
+ public JSDocPackMaven()
+ {
+ super();
+ _jarPath = fetchJarLocation();
+
+ }
+
+ /**
+ * public method which is called from the outside
+ * unpacks the current jsdoc package into our target dir
+ *
+ * @param targetDir the target dir to unpack to
+ * @param log the target log to log into
+ * @throws java.io.IOException in case of an error
+ */
+ public void unpack(String targetDir, org.apache.maven.plugin.logging.Log log) throws IOException
+ {
+ JarFile jarFile = new JarFile(_jarPath);
+ _expandJarFile(targetDir, log, jarFile);
+ }
+
+ /**
+ * fetches the location of the jsdoc hosting jar,
+ * the location already should be in maven and our main
+ * constant is the <code>app/main.js</code> file which should be present
+ * everywhere
+ *
+ * @return a string to the location
+ */
+ protected String fetchJarLocation()
+ {
+ URL markerResourceLocation = this.getClass().getClassLoader().getResource("app/main.js");
+ String markerResource = markerResourceLocation.getFile();
+ markerResource = markerResource.substring(5);
+ markerResource = markerResource.substring(0, markerResource.length() - "!/app/main.js".length());
+ return markerResource;
+ }
+
+}
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSDocPackResources.java b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSDocPackResources.java
new file mode 100644
index 0000000..792ec27
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSDocPackResources.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.myfaces.plugins.jsdoc.util;
+
+import org.apache.commons.io.FileUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.jar.JarFile;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ * <p/>
+ * unpacks a locally hosted jsdoc (which is placed in our resources folder
+ */
+
+public class JSDocPackResources extends JSDocPack
+{
+ /**
+ * constructor
+ */
+ public JSDocPackResources()
+ {
+ super();
+ }
+
+ public void unpack(String targetDir, org.apache.maven.plugin.logging.Log log) throws IOException
+ {
+ JarFile jarFile = null;
+ try
+ {
+ jarFile = new JarFile(fetchJarLocation());
+ _expandJarFile(targetDir, log, jarFile);
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IOException(e);
+ }
+
+ }
+
+ protected File fetchJarLocation() throws IOException, URISyntaxException
+ {
+ URL markerResourceLocation = this.getClass().getClassLoader().getResource("jsdoc-toolkit-2.4.0.jar");
+ //we cannot simply use the uri we have to copy the file over to a temp file first
+ File tempFile = File.createTempFile("jsdoc-toolkit-2.4.0", "jar");
+ tempFile.deleteOnExit();
+ FileUtils.copyURLToFile(markerResourceLocation, tempFile);
+
+ return tempFile;
+
+ }
+}
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSFileNameFilter.java b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSFileNameFilter.java
new file mode 100644
index 0000000..eed67d6
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSFileNameFilter.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.myfaces.plugins.jsdoc.util;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.filefilter.IOFileFilter;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ * <p/>
+ * A javascript filename filter which can be used within the context of commons-io
+ */
+public class JSFileNameFilter implements IOFileFilter
+{
+
+ XMLConfig _fileMap = null;
+
+ Map _sortedResults = new TreeMap();
+
+ public JSFileNameFilter(XMLConfig fileMap)
+ {
+ this._fileMap = fileMap;
+ }
+
+ private boolean matchNames(String fileName)
+ {
+ Iterator it = _fileMap.getFileNames().iterator();
+ while (it.hasNext())
+ {
+ String matchPattern = (String) it.next();
+ boolean matches = FilenameUtils.wildcardMatch(fileName, matchPattern);
+ if (matches)
+ {
+ _sortedResults.put(_fileMap.getFileNameIdx().get(matchPattern), fileName);
+ return matches;
+ }
+ }
+ return false;
+ }
+
+ public boolean accept(File file)
+ {
+ //no js file no match
+ return file.getName().endsWith(".js") && matchNames(file.getAbsolutePath());
+ }
+
+ public boolean accept(File file, String s)
+ {
+ return s.endsWith(".js") && matchNames(file.getAbsolutePath() + "/" + s);
+ }
+
+ public XMLConfig getFileMap()
+ {
+ return _fileMap;
+ }
+
+ public void setFileMap(XMLConfig fileMap)
+ {
+ _fileMap = fileMap;
+ }
+
+ public Map getSortedResults()
+ {
+ return _sortedResults;
+ }
+
+ public void setSortedResults(Map sortedResults)
+ {
+ _sortedResults = sortedResults;
+ }
+}
+
+
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSRun.java b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSRun.java
new file mode 100644
index 0000000..dceb30c
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/JSRun.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.myfaces.plugins.jsdoc.util;
+
+/**
+ * A trivial bootstrap class that simply adds the path to the
+ * .js file as an argument to the Rhino call. This little hack
+ * allows the code in the .js file to have access to it's own
+ * path via the Rhino arguments object. This is necessary to
+ * allow the .js code to find resource files in a location
+ * relative to itself.
+ * <p/>
+ * USAGE: java -jar jsrun.jar path/to/file.js
+ */
+public class JSRun
+{
+ public static void main(String[] args)
+ {
+ String[] jsargs = {"-j=" + args[0]};
+
+ String[] allArgs = new String[jsargs.length + args.length];
+ System.arraycopy(args, 0, allArgs, 0, args.length);
+ System.arraycopy(jsargs, 0, allArgs, args.length, jsargs.length);
+
+ org.mozilla.javascript.tools.shell.Main.main(allArgs);
+ }
+}
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/XMLConfig.java b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/XMLConfig.java
new file mode 100644
index 0000000..dd53fce
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/src/main/java/org/apache/myfaces/plugins/jsdoc/util/XMLConfig.java
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.myfaces.plugins.jsdoc.util;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.XMLEvent;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+//import static javax.xml.stream.XMLStreamConstants.*;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ * <p/>
+ * A helper which reads the xml config appopriately
+ */
+
+public class XMLConfig
+{
+
+ String _fileName = null;
+
+ List _fileNames = null;
+ Map _fileNameIdx = new HashMap();
+
+ public XMLConfig(String fileName) throws XMLStreamException, FileNotFoundException
+ {
+ _fileName = fileName;
+ _fileNames = new LinkedList();
+ postCreate();
+ }
+
+ protected void postCreate() throws XMLStreamException, FileNotFoundException
+ {
+ XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ // einen neuen eventReader einrichten
+ InputStream in = new FileInputStream(_fileName);
+ XMLEventReader parser = inputFactory.createXMLEventReader(in);
+ StringBuilder elementText = null;
+
+ int cnt = 0;
+ while (parser.hasNext())
+ {
+ XMLEvent event = parser.nextEvent();
+ switch (event.getEventType())
+ {
+ case XMLStreamConstants.END_DOCUMENT:
+ parser.close();
+ break;
+ case XMLStreamConstants.START_ELEMENT:
+ if (!event.asStartElement().getName().toString().equals("include"))
+ {
+ break;
+ }
+ elementText = new StringBuilder(100);
+ break;
+ case XMLStreamConstants.CHARACTERS:
+ if (elementText == null)
+ {
+ break;
+ }
+ elementText.append(event.asCharacters().getData());
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ if (!event.asEndElement().getName().toString().equals("include") || elementText == null)
+ {
+ break;
+ }
+
+ _fileNames.add(elementText.toString());
+ _fileNameIdx.put(elementText.toString(), new Integer(cnt));
+ cnt++;
+ elementText = null;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ public String getFileName()
+ {
+ return _fileName;
+ }
+
+ public void setFileName(String fileName)
+ {
+ _fileName = fileName;
+ }
+
+ public List getFileNames()
+ {
+ return _fileNames;
+ }
+
+ public void setFileNames(List fileNames)
+ {
+ _fileNames = fileNames;
+ }
+
+ public Map getFileNameIdx()
+ {
+ return _fileNameIdx;
+ }
+
+ public void setFileNameIdx(Map fileNameIdx)
+ {
+ _fileNameIdx = fileNameIdx;
+ }
+}
diff --git a/maven2-plugins/myfaces-jsdoc-plugin/src/main/resources/META-INF/NOTICE b/maven2-plugins/myfaces-jsdoc-plugin/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000..fa3dbd6
--- /dev/null
+++ b/maven2-plugins/myfaces-jsdoc-plugin/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,16 @@
+=========================================================================
+== NOTICE file corresponding to section 4(d) of the Apache License, ==
+== Version 2.0, in this case for the Apache MyFaces Maven Plugins ==
+=========================================================================
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of this software were originally based on the following:
+
+ - software copyright (c) 2000-2006, Oracle Corp, <http://www.oracle.com/>.
+and are licensed to the Apache Software Foundation under the
+"Software Grant and Corporate Contribution License Agreement"
+
+See the LICENSE.txt file for information on all licenses
+associated with this software.
diff --git a/maven2-plugins/pom.xml b/maven2-plugins/pom.xml
index bad5143..b2dfa32 100644
--- a/maven2-plugins/pom.xml
+++ b/maven2-plugins/pom.xml
@@ -61,6 +61,7 @@
<module>myfaces-i18n-plugin</module>
<module>myfaces-javacc-plugin</module>
<module>myfaces-javascript-plugin</module>
+ <module>myfaces-jsdoc-plugin</module>
<module>myfaces-jdev-plugin</module>
<module>myfaces-tagdoc-plugin</module>
<module>myfaces-wagon-plugin</module>