Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 46663 invoked from network); 21 Feb 2007 23:06:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Feb 2007 23:06:39 -0000 Received: (qmail 88519 invoked by uid 500); 21 Feb 2007 23:06:48 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 88481 invoked by uid 500); 21 Feb 2007 23:06:48 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 88470 invoked by uid 99); 21 Feb 2007 23:06:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Feb 2007 15:06:47 -0800 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Feb 2007 15:06:33 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 8FD0D1A9827; Wed, 21 Feb 2007 15:05:47 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r510296 [6/14] - in /directory/sandbox/oersoy/documentation.checklist.parent: ./ documentation.checklist.archetype/ documentation.checklist.archetype/src/ documentation.checklist.archetype/src/main/ documentation.checklist.archetype/src/mai... Date: Wed, 21 Feb 2007 23:05:34 -0000 To: commits@directory.apache.org From: oersoy@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070221230547.8FD0D1A9827@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.v100/text/description.txt URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.v100/text/description.txt?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.v100/text/description.txt (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.v100/text/description.txt Wed Feb 21 15:05:11 2007 @@ -0,0 +1,42 @@ +Model Model + +This model description is not a real EMF artifact. It was generated by the +org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's +code generator can be extended. +This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false. + +Package checklist + + Class CheckItem + Attribute label : String + Attribute required : Boolean + Reference separator : Separator + Attribute recipeReferenceId : String + + Class CheckGroup + Reference checkItems : CheckItem<<1..*>> + Attribute id : String + Attribute label : String + Operation getFileName() : EString + + Class Checklist + Reference packagingTarget : PackagingTarget<<1..1>> + Reference checkGroups : CheckGroup<<1..*>> + Attribute name : EString + Attribute recipeMap : EMap + + Class DocumentRoot + Attribute mixed : EFeatureMapEntry<<0..*>> + Reference xMLNSPrefixMap : EStringToStringMapEntry<<0..*>> + Reference xSISchemaLocation : EStringToStringMapEntry<<0..*>> + Reference /checklist : Checklist + + Class PackagingTarget + Attribute label : String + Attribute type : String + + Class Separator + Attribute tagName : EString<<1..1>> + Attribute tagBody : EString<<1..1>> + + DataType EMap Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.classpath URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.classpath?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.classpath (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.classpath Wed Feb 21 15:05:11 2007 @@ -0,0 +1,4 @@ + + + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.project URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.project?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.project (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.project Wed Feb 21 15:05:11 2007 @@ -0,0 +1,14 @@ + + documentation.checklist.model.xsd.v100 + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.jdt.core.javanature + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.settings/org.eclipse.jdt.core.prefs URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.settings/org.eclipse.jdt.core.prefs?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.settings/org.eclipse.jdt.core.prefs (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/.settings/org.eclipse.jdt.core.prefs Wed Feb 21 15:05:11 2007 @@ -0,0 +1,5 @@ +#Wed Feb 14 13:57:09 CST 2007 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/model/checklist-schema.xsd URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/model/checklist-schema.xsd?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/model/checklist-schema.xsd (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/model/checklist-schema.xsd Wed Feb 21 15:05:11 2007 @@ -0,0 +1,148 @@ + + + + + + + 1.0.0 + + The <code>&lt;checklist&gt;</code> + element is the root of the descriptor. The following table + lists all of the possible child elements. + + + + + + + + + + + + + 1.0.0 + + The type of maven artifact (jar, war, etc.) that this + checklist is for. + + + + + + + + + 1.0.0 + + A container for a group of checks that should + be performed on the artifact deliverable. + + + + + + + + + + + + + + 1.0.0 + + A single check for this artifact type. + + + + + + + + + + + + + 1.0.0 + + A single check for this artifact type. + + + + + + + + + + + + + + + + + 1.0.0 + + A single check for this artifact type. + + + + + + + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/pom.xml URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/pom.xml?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/pom.xml (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/pom.xml Wed Feb 21 15:05:11 2007 @@ -0,0 +1,13 @@ + + + documentation.checklist.parent + org.apache.maven + 1.0-SNAPSHOT + + 4.0.0 + org.apache.maven + documentation.checklist.model.xsd.v100 + + 1.0-SNAPSHOT + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/target/documentation.checklist.model.xsd.v100-1.0-SNAPSHOT.jar URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/target/documentation.checklist.model.xsd.v100-1.0-SNAPSHOT.jar?view=auto&rev=510296 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.model.xsd.v100/target/documentation.checklist.model.xsd.v100-1.0-SNAPSHOT.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.classpath URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.classpath?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.classpath (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.classpath Wed Feb 21 15:05:11 2007 @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.jetproperties URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.jetproperties?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.jetproperties (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.jetproperties Wed Feb 21 15:05:11 2007 @@ -0,0 +1,4 @@ + + + templates src/main/java + Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.project URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.project?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.project (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.project Wed Feb 21 15:05:11 2007 @@ -0,0 +1,22 @@ + + documentation.checklist.mojo + + + documentation.recipe.model.v100 + documentation.checklist.model.v100 + + + + org.eclipse.emf.codegen.JETBuilder + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.emf.codegen.jet.IJETNature + org.eclipse.jdt.core.javanature + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.settings/org.eclipse.jdt.core.prefs URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.settings/org.eclipse.jdt.core.prefs?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.settings/org.eclipse.jdt.core.prefs (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/.settings/org.eclipse.jdt.core.prefs Wed Feb 21 15:05:11 2007 @@ -0,0 +1,5 @@ +#Fri Feb 16 00:50:40 CST 2007 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/pom.xml URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/pom.xml?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/pom.xml (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/pom.xml Wed Feb 21 15:05:11 2007 @@ -0,0 +1,198 @@ + + + + documentation.checklist.parent + org.apache.maven + 1.0-SNAPSHOT + + 4.0.0 + org.apache.maven + documentation.checklist.mojo + maven-plugin + documentation.checklist.mojo Maven Mojo + 1.0-SNAPSHOT + http://maven.apache.org + + + + org.apache.maven + documentation.recipe.model.v100 + 1.0-SNAPSHOT + + + + commons-io + commons-io + 1.2 + compile + + + + commons-lang + commons-lang + 2.2 + compile + + + + documentation.checklist.model.v100 + org.apache.maven + 1.0-SNAPSHOT + compile + + + + org.apache.maven + maven-plugin-api + 2.0 + + + junit + junit + + + org.eclipse.emf + ant + + + org.eclipse.emf + codegen + + + org.eclipse.emf + codegen-ecore + + + org.eclipse.emf + codegen-ecore-ui + + + org.eclipse.emf + codegen-ui + + + org.eclipse.emf + common + + + org.eclipse.emf + commonj-sdo + + + org.eclipse.emf + common-ui + + + org.eclipse.emf + converter + + + org.eclipse.emf + ecore + + + org.eclipse.emf + ecore-change + + + org.eclipse.emf + ecore-change-edit + + + org.eclipse.emf + ecore-edit + + + org.eclipse.emf + ecore-sdo + + + org.eclipse.emf + ecore-sdo-edit + + + org.eclipse.emf + ecore-xmi + + + org.eclipse.emf + edit + + + org.eclipse.emf + edit-ui + + + org.eclipse.emf + emf + + + org.eclipse.emf + exporter + + + org.eclipse.emf + importer + + + org.eclipse.emf + importer-ecore + + + org.eclipse.emf + importer-java + + + org.eclipse.emf + importer-rose + + + org.eclipse.emf + mapping + + + org.eclipse.emf + mapping-ecore2ecore + + + org.eclipse.emf + mapping-ecore2ecore-editor + + + org.eclipse.emf + mapping-ecore2xml + + + org.eclipse.emf + mapping-ecore2xml-ui + + + org.eclipse.emf + mapping-ui + + + org.eclipse.emf + mapping-xsd2ecore + + + org.eclipse.emf + mapping-xsd2ecore-editor + + + org.eclipse.xsd + ecore-exporter + + + org.eclipse.xsd + ecore-importer + + + org.eclipse.xsd + edit + + + org.eclipse.xsd + xsd + + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojo.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojo.java?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojo.java (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojo.java Wed Feb 21 15:05:11 2007 @@ -0,0 +1,91 @@ +package org.apache.maven.plugins.documentation.checklist.mojo; + +/* + * Copyright 2001-2005 The Apache Software Foundation. + * + * 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. + */ + + +import org.apache.maven.model.emf.documentation.checklist.Checklist; +import org.apache.maven.model.emf.documentation.recipe.Recipes; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import java.io.File; +import java.util.List; + +/** + * Goal which generates a eclipse checklist documentation plugin + * + * @goal generate + * @phase generate + */ +public class ChecklistMojo + extends AbstractMojo implements ChecklistMojoConstants +{ + private List directoryFileList = null; + + public void execute() + throws MojoExecutionException + { + ResourceSet resourceSet = ChecklistMojoHelper.createResourceSet(); + + Resource recipeResource = + ChecklistMojoHelper.loadResource( + RECIPE_SOURCE_RESOURCE_PATH, + resourceSet); + + Recipes recipes = ( Recipes ) recipeResource.getEObject("//@recipes"); + + recipes.getInitializedRecipeMap(); + + Resource checklistResource = + ChecklistMojoHelper.loadResource( + CHECKLIST_SOURCE_RESOURCE_PATH, + resourceSet); +//TODO - Put the fragments on the constants + Checklist checklist = (Checklist) checklistResource.getEObject( "//@checklist" ); + checklist.setRecipeMap( recipes.getRecipeMap() ); + + if (directoryFileList==null) + { + directoryFileList = ChecklistMojoHelper.createDirectoryFiles(); + } + + ChecklistMojoHelper.deleteFiles(directoryFileList); + ChecklistMojoHelper.createFiles(directoryFileList); + + ChecklistMojoHelper.generateChecklists( new File(CHECKLIST_ROOT_DIRECTORY_PATH), checklist ); + ChecklistMojoHelper.generateRecipes( new File(RECIPE_ROOT_DIRECTORY_PATH), checklist ); + ChecklistMojoHelper.generateTOC(checklist); + + /* + + EList checkGroups = checklist.getCheckGroups(); + + Iterator iterator = checkGroups.iterator(); + while(iterator.hasNext()) + { + CheckGroup checkGroup = ( CheckGroup ) iterator.next(); + ChecklistHTMLGenerator checklistHTMLGenerator + = new ChecklistHTMLGenerator(); + String page = checklistHTMLGenerator.generate( checkGroup ); + getLog().info(page); + } + */ + } +} \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoConstants.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoConstants.java?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoConstants.java (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoConstants.java Wed Feb 21 15:05:11 2007 @@ -0,0 +1,44 @@ + +package org.apache.maven.plugins.documentation.checklist.mojo; + +/* + * Copyright 2001-2005 The Apache Software Foundation. + * + * 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. + */ + +public interface ChecklistMojoConstants +{ + String HTML_RESOURCE_EXTENSION = "html"; + + String XML_RESOURCE_EXTENSION = "xml"; + + String RECIPE_NAME_STRING = "recipe"; + + String CHECKLIST_SOURCE_RESOURCE_PATH = + "source/checklist.xml"; + + String RECIPE_SOURCE_RESOURCE_PATH = + "source/recipes.xml"; + + String ROOT_HTML_DIRECTORY_PATH = + "target/html/"; + + String CHECKLIST_ROOT_DIRECTORY_PATH = + ROOT_HTML_DIRECTORY_PATH + "checklists/"; + + String RECIPE_ROOT_DIRECTORY_PATH = + ROOT_HTML_DIRECTORY_PATH + "recipes/"; + + String TOC_FILE_NAME = "toc.xml"; +} Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoHelper.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoHelper.java?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoHelper.java (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoHelper.java Wed Feb 21 15:05:11 2007 @@ -0,0 +1,293 @@ + +package org.apache.maven.plugins.documentation.checklist.mojo; + +/* + * Copyright 2001-2005 The Apache Software Foundation. + * + * 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. + */ + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.EMap; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.apache.commons.io.FileUtils; +import org.apache.maven.model.emf.documentation.checklist.CheckGroup; +import org.apache.maven.model.emf.documentation.checklist.CheckItem; +import org.apache.maven.model.emf.documentation.checklist.Checklist; +import org.apache.maven.model.emf.documentation.checklist.ChecklistFactory; +import org.apache.maven.model.emf.documentation.checklist.ChecklistPackage; +import org.apache.maven.model.emf.documentation.recipe.Recipe; +import org.apache.maven.model.emf.documentation.recipe.RecipePackage; +import org.apache.maven.model.emf.documentation.recipe.util.RecipeResourceFactoryImpl; +import org.apache.maven.model.emf.documentation.checklist.util.ChecklistResourceFactoryImpl; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.documentation.checklist.mojo.templates.ChecklistHTMLGenerator; +import org.apache.maven.plugins.documentation.checklist.mojo.templates.RecipeHTMLGenerator; +import org.apache.maven.plugins.documentation.checklist.mojo.templates.TOCGenerator; + +public class ChecklistMojoHelper +implements ChecklistMojoConstants +{ + /* + * TODO + */ + public static ResourceSet createResourceSet() + { + + ResourceSet resourceSet = new ResourceSetImpl(); + + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put + (XML_RESOURCE_EXTENSION, + new ChecklistResourceFactoryImpl()); + + resourceSet.getPackageRegistry().put + ( + ChecklistPackage.eNS_URI, + ChecklistPackage.eINSTANCE + ); + + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put + (XML_RESOURCE_EXTENSION, + new RecipeResourceFactoryImpl()); + + resourceSet.getPackageRegistry().put + ( + RecipePackage.eNS_URI, + RecipePackage.eINSTANCE + ); + + return resourceSet; + } + + /* + * TODO Move to utility + */ + public static Resource loadResource(String resourcePath, ResourceSet resourceSet) + { + File file = new File(resourcePath); + URI fileURI = URI.createFileURI(file.getAbsolutePath()); + return resourceSet.getResource(fileURI, true); + } + + public static List createDirectoryFiles() + { + List directoryFileList = new ArrayList(); + + File rootHtmlDirectory = new File(ROOT_HTML_DIRECTORY_PATH); + File checklistDirectory = new File(CHECKLIST_ROOT_DIRECTORY_PATH); + File recipesDirectory = new File(RECIPE_ROOT_DIRECTORY_PATH); + + directoryFileList.add(rootHtmlDirectory); + directoryFileList.add(checklistDirectory); + directoryFileList.add(recipesDirectory); + + return directoryFileList; + } + + public static void deleteFiles(List list) + throws MojoExecutionException + { + Iterator iterator = list.iterator(); + + while(iterator.hasNext()) + { + File file = iterator.next(); + try + { + FileUtils.deleteDirectory( file ); + } + catch ( IOException e ) + { + e.printStackTrace(); + throw new MojoExecutionException("TODO -Sexy Message"); + } + } + } + + public static void createFiles(List list) + { + Iterator iterator = list.iterator(); + + while(iterator.hasNext()) + { + File file = iterator.next(); + file.mkdirs(); + } + } + + public static void generateChecklists( + File checklistRootDirectory, + Checklist checklist) + throws MojoExecutionException + { + EList checkGroups = checklist.getCheckGroups(); + + Iterator iterator = checkGroups.iterator(); + + while(iterator.hasNext()) + { + CheckGroup checkGroup = ( CheckGroup ) iterator.next(); + + File checklistDirectory = new File(checklistRootDirectory, checkGroup.getId()); + + try + { + FileUtils.deleteDirectory( checklistDirectory ); + } + catch ( IOException e ) + { + e.printStackTrace(); + throw new MojoExecutionException("TODO -Sexy Message"); + } + + checklistDirectory.mkdirs(); + + ChecklistHTMLGenerator checklistHTMLGenerator + = new ChecklistHTMLGenerator(); + + generateChecklist(checkGroup, checklistHTMLGenerator, checklistDirectory); + + } + } + + public static void generateChecklist( + CheckGroup checkGroup, + ChecklistHTMLGenerator checklistHTMLGenerator, + File checklistDirectory) + throws MojoExecutionException + { + String checklistString = checklistHTMLGenerator.generate( checkGroup ); + + String checklistFileName = checkGroup.getFileName(); + + File checklistFile = new File(checklistDirectory, checklistFileName); + checklistFile.delete(); + + try { + FileWriter fileWriter = new FileWriter(checklistFile); + fileWriter.write(checklistString); + fileWriter.close(); + } catch (IOException e) { + throw new MojoExecutionException("Could not checklist file to: "+ checklistFile.getAbsolutePath()); + } + } + + + public static void generateRecipes( + File recipeRootDirectory, + Checklist checklist) + throws MojoExecutionException + { + EList checkGroups = checklist.getCheckGroups(); + + Iterator iterator = checkGroups.iterator(); + + while(iterator.hasNext()) + { + CheckGroup checkGroup = ( CheckGroup ) iterator.next(); + + File recipeDirectory = new File(recipeRootDirectory, checkGroup.getId()); + + try + { + FileUtils.deleteDirectory( recipeDirectory ); + } + catch ( IOException e ) + { + e.printStackTrace(); + throw new MojoExecutionException("TODO -Sexy Message"); + } + + recipeDirectory.mkdirs(); + + RecipeHTMLGenerator recipeHTMLGenerator + = new RecipeHTMLGenerator(); + + EList checkItems = checkGroup.getCheckItems(); + CheckItem checkItem = null; + + for (int i = 0; i < checkItems.size(); i++) + { + checkItem = checkItems.get(i); + generateRecipe( + checkItem, + recipeHTMLGenerator, + recipeDirectory); + } + } + } + + + /* + * TODO Consider catching NPE's from trying to access recipes that are non existant on the recipeMap + * This can occur when there's an invalid recipeReferenceId on a CheckItem. + * Also, I have to get the recipe both here and in the template. + * It would be sexier if I just had to get it in one place. + */ + + + public static void generateRecipe( + CheckItem checkItem, + RecipeHTMLGenerator recipeHTMLGenerator, + File recipeDirectory) throws MojoExecutionException + { + String recipeString = recipeHTMLGenerator.generate( checkItem ); + + + Checklist checklist = (Checklist) checkItem.eResource().getEObject("//@checklist"); + EMap recipeMap = checklist.getRecipeMap(); + Recipe recipe = recipeMap.get(checkItem.getRecipeReferenceId()); + + File recipeFile = new File(recipeDirectory, recipe.getFileName()); + + recipeFile.delete(); + + try + { + FileWriter fileWriter = new FileWriter(recipeFile); + fileWriter.write(recipeString); + fileWriter.close(); + } catch (IOException e) + { + throw new MojoExecutionException("Could not write recipe file to: "+ recipeFile.getAbsolutePath()); + } + } + + public static void generateTOC( + Checklist checklist) throws MojoExecutionException + { + TOCGenerator tocGenerator = new TOCGenerator(); + String tocString = tocGenerator.generate(checklist); + File tocFile = new File(TOC_FILE_NAME); + tocFile.delete(); + try + { + FileWriter fileWriter = new FileWriter(tocFile); + fileWriter.write(tocString); + fileWriter.close(); + } catch (IOException e) + { + throw new MojoExecutionException("Could not write toc file to: " + tocFile.getAbsolutePath()); + } + } +} \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/ChecklistHTMLGenerator.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/ChecklistHTMLGenerator.java?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/ChecklistHTMLGenerator.java (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/ChecklistHTMLGenerator.java Wed Feb 21 15:05:11 2007 @@ -0,0 +1,105 @@ +package org.apache.maven.plugins.documentation.checklist.mojo.templates; + +import org.apache.maven.model.emf.documentation.checklist.Checklist; +import org.apache.maven.model.emf.documentation.checklist.CheckGroup; +import org.apache.maven.model.emf.documentation.checklist.CheckItem; +import org.apache.maven.model.emf.documentation.recipe.Recipe; +import org.apache.maven.model.emf.documentation.checklist.Separator; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.EMap; +import org.apache.commons.lang.StringUtils; +import java.util.Iterator; + +public class ChecklistHTMLGenerator +{ + protected static String nl; + public static synchronized ChecklistHTMLGenerator create(String lineSeparator) + { + nl = lineSeparator; + ChecklistHTMLGenerator result = new ChecklistHTMLGenerator(); + nl = null; + return result; + } + + protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; + protected final String TEXT_1 = " "; + protected final String TEXT_2 = NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + NL + ""; + protected final String TEXT_3 = "" + NL + "" + NL + "" + NL + "" + NL + "

Checklist

" + NL + "" + NL + "

"; + protected final String TEXT_4 = "

" + NL; + protected final String TEXT_5 = NL + "<"; + protected final String TEXT_6 = "> "; + protected final String TEXT_7 = " "; + protected final String TEXT_9 = NL + NL + "" + NL + "\t\t" + NL + "\t\t\t" + NL + "\t\t\t" + NL + "\t\t" + NL + "\t" + NL + "
" + NL + " \t\t\t" + NL + " \t\t\t\t" + NL + " \t\t\t" + NL + "\t\t\t"; + protected final String TEXT_16 = "
"; + protected final String TEXT_17 = NL + "" + NL + ""; + + public String generate(Object argument) + { + final StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(TEXT_1); + + CheckGroup checkGroup = (CheckGroup) argument; + Checklist checklist = (Checklist) checkGroup.eContainer(); + EList checkItems = checkGroup.getCheckItems(); + EMap recipeMap = checklist.getRecipeMap(); + + stringBuffer.append(TEXT_2); + stringBuffer.append(checkGroup.getLabel()); + stringBuffer.append(TEXT_3); + stringBuffer.append(checkGroup.getLabel()); + stringBuffer.append(TEXT_4); + +CheckItem checkItem = null; +Recipe recipe = null; +String recipeId = null; +Separator separator = null; + +for (int i = 0; i < checkItems.size(); i++) +{ + checkItem = checkItems.get(i); + recipeId = checkItem.getRecipeReferenceId(); + + recipe = recipeMap.get(recipeId); + separator = checkItem.getSeparator(); + if (separator != null) + { + + stringBuffer.append(TEXT_5); + stringBuffer.append(separator.getTagName()); + stringBuffer.append(TEXT_6); + stringBuffer.append(separator.getTagBody()); + stringBuffer.append(TEXT_7); + stringBuffer.append(separator.getTagName()); + stringBuffer.append(TEXT_8); + + } + + stringBuffer.append(TEXT_9); + if (!checkItem.isRequired() ) { + stringBuffer.append(TEXT_10); + } + stringBuffer.append(TEXT_11); + stringBuffer.append(checkGroup.getId()); + stringBuffer.append(TEXT_12); + stringBuffer.append(recipe.getFileName()); + stringBuffer.append(TEXT_13); + stringBuffer.append(recipe.getChallenge()); + stringBuffer.append(TEXT_14); + stringBuffer.append(recipe.getChallenge()); + stringBuffer.append(TEXT_15); + stringBuffer.append(checkItem.getLabel()); + stringBuffer.append(TEXT_16); + +} + + stringBuffer.append(TEXT_17); + return stringBuffer.toString(); + } +} Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/RecipeHTMLGenerator.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/RecipeHTMLGenerator.java?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/RecipeHTMLGenerator.java (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/RecipeHTMLGenerator.java Wed Feb 21 15:05:11 2007 @@ -0,0 +1,98 @@ +package org.apache.maven.plugins.documentation.checklist.mojo.templates; + +import org.apache.maven.model.emf.documentation.checklist.Checklist; +import org.apache.maven.model.emf.documentation.checklist.CheckGroup; +import org.apache.maven.model.emf.documentation.checklist.CheckItem; +import org.apache.maven.model.emf.documentation.recipe.Recipes; +import org.apache.maven.model.emf.documentation.recipe.Recipe; +import org.eclipse.emf.common.util.EMap; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.common.util.EList; +import org.apache.commons.lang.StringUtils; +import java.util.Iterator; + +public class RecipeHTMLGenerator +{ + protected static String nl; + public static synchronized RecipeHTMLGenerator create(String lineSeparator) + { + nl = lineSeparator; + RecipeHTMLGenerator result = new RecipeHTMLGenerator(); + nl = null; + return result; + } + + protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; + protected final String TEXT_1 = " "; + protected final String TEXT_2 = NL + "" + NL + "" + NL + " " + NL + " "; + protected final String TEXT_3 = "" + NL + " \t" + NL + "\t" + NL + "\t" + NL + " " + NL + "" + NL + "" + NL + "

Challenge

" + NL + "" + NL + "
" + NL + "\t

"; + protected final String TEXT_4 = "

" + NL + "
" + NL + "" + NL + "

Solution

" + NL + "" + NL + "
" + NL + "\t

"; + protected final String TEXT_5 = "

" + NL + "
" + NL + "" + NL + "

Discussion

" + NL + "" + NL + "
" + NL + "

"; + protected final String TEXT_6 = "

" + NL; + protected final String TEXT_7 = NL + NL + "

Related Challenges

" + NL + "" + NL + "" + NL + "\t"; + protected final String TEXT_8 = NL + NL + "\t\t" + NL + "\t\t\t" + NL + "\t\t\t" + NL + "\t\t"; + protected final String TEXT_14 = NL + NL + "\t" + NL + "
" + NL + " \t\t\t" + NL + " \t\t\t\t" + NL + " \t\t\t" + NL + "\t\t\t"; + protected final String TEXT_13 = "
"; + protected final String TEXT_15 = NL + NL + NL + "" + NL + ""; + + public String generate(Object argument) + { + final StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(TEXT_1); + + CheckItem checkItem = (CheckItem) argument; + CheckGroup checkGroup = (CheckGroup) checkItem.eContainer(); + Checklist checklist = (Checklist) checkItem.eResource().getEObject("//@checklist"); + EMap recipeMap + = checklist.getRecipeMap(); + Recipe recipe = recipeMap.get(checkItem.getRecipeReferenceId()); + + EList relatedRecipeIDs = recipe.getRelatedRecipeIDs(); + + stringBuffer.append(TEXT_2); + stringBuffer.append(recipe.getChallenge()); + stringBuffer.append(TEXT_3); + stringBuffer.append(recipe.getChallenge()); + stringBuffer.append(TEXT_4); + stringBuffer.append(recipe.getSolution()); + stringBuffer.append(TEXT_5); + stringBuffer.append(recipe.getDiscussion()); + stringBuffer.append(TEXT_6); + +if (relatedRecipeIDs.size() > 0) +{ + + stringBuffer.append(TEXT_7); + +Recipe relatedRecipe = null; +for (int i = 0; i < relatedRecipeIDs.size(); i++) +{ + String id = (String) relatedRecipeIDs.get(i); + relatedRecipe = recipeMap.get(id); + + stringBuffer.append(TEXT_8); + stringBuffer.append(checkGroup.getId()); + stringBuffer.append(TEXT_9); + stringBuffer.append(relatedRecipe.getFileName()); + stringBuffer.append(TEXT_10); + stringBuffer.append(relatedRecipe.getChallenge()); + stringBuffer.append(TEXT_11); + stringBuffer.append(relatedRecipe.getChallenge()); + stringBuffer.append(TEXT_12); + stringBuffer.append(relatedRecipe.getChallenge()); + stringBuffer.append(TEXT_13); + +} + + stringBuffer.append(TEXT_14); + +} + + stringBuffer.append(TEXT_15); + return stringBuffer.toString(); + } +} Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/TOCGenerator.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/TOCGenerator.java?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/TOCGenerator.java (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/java/org/apache/maven/plugins/documentation/checklist/mojo/templates/TOCGenerator.java Wed Feb 21 15:05:11 2007 @@ -0,0 +1,109 @@ +package org.apache.maven.plugins.documentation.checklist.mojo.templates; + +import org.apache.maven.model.emf.documentation.checklist.Checklist; +import org.apache.maven.model.emf.documentation.checklist.CheckGroup; +import org.apache.maven.model.emf.documentation.checklist.CheckItem; +import org.apache.maven.model.emf.documentation.recipe.Recipe; +import org.apache.maven.model.emf.documentation.checklist.PackagingTarget; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.EMap; +import org.apache.commons.lang.StringUtils; +import java.util.Iterator; + +public class TOCGenerator +{ + protected static String nl; + public static synchronized TOCGenerator create(String lineSeparator) + { + nl = lineSeparator; + TOCGenerator result = new TOCGenerator(); + nl = null; + return result; + } + + protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; + protected final String TEXT_1 = " "; + protected final String TEXT_2 = NL + "" + NL + "" + NL + "" + NL + "" + NL + "\t" + NL + "\t\t"; + protected final String TEXT_5 = "\t" + NL + "\t\t\t"; + protected final String TEXT_7 = NL + "\t\t\t\t"; + protected final String TEXT_11 = NL + "\t\t\t"; + protected final String TEXT_12 = NL + "\t\t" + NL + "\t\t"; + protected final String TEXT_13 = "\t" + NL + "\t\t\t"; + protected final String TEXT_17 = NL + "\t\t" + NL + "\t" + NL + ""; + + public String generate(Object argument) + { + final StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(TEXT_1); + + Checklist checklist = (Checklist) argument; + EMap recipeMap = checklist.getRecipeMap(); + PackagingTarget packagingTarget = checklist.getPackagingTarget(); + EList checkGroups = checklist.getCheckGroups(); + + stringBuffer.append(TEXT_2); + stringBuffer.append(checklist.getName()); + stringBuffer.append(TEXT_3); + stringBuffer.append(packagingTarget.getLabel()); + stringBuffer.append(TEXT_4); + +Iterator checkGroupsIterator1 = checkGroups.iterator(); +while (checkGroupsIterator1.hasNext()) +{ + CheckGroup checkGroup = checkGroupsIterator1.next(); + + stringBuffer.append(TEXT_5); + stringBuffer.append(checkGroup.getLabel()); + stringBuffer.append(TEXT_6); + + Iterator checkItemsIterator = checkGroup.getCheckItems().iterator(); + while (checkItemsIterator.hasNext()) + { + CheckItem checkItem = checkItemsIterator.next(); + Recipe recipe = recipeMap.get( checkItem.getRecipeReferenceId() ); + + + stringBuffer.append(TEXT_7); + stringBuffer.append(recipe.getChallenge()); + stringBuffer.append(TEXT_8); + stringBuffer.append(checkGroup.getId()); + stringBuffer.append(TEXT_9); + stringBuffer.append(recipe.getFileName()); + stringBuffer.append(TEXT_10); + + } + + stringBuffer.append(TEXT_11); + +} + + stringBuffer.append(TEXT_12); + +Iterator checkGroupsIterator2 = checkGroups.iterator(); +while (checkGroupsIterator2.hasNext()) +{ + CheckGroup checkGroup = checkGroupsIterator2.next(); + + stringBuffer.append(TEXT_13); + stringBuffer.append(checkGroup.getLabel()); + stringBuffer.append(TEXT_14); + stringBuffer.append(checkGroup.getId()); + stringBuffer.append(TEXT_15); + stringBuffer.append(checkGroup.getFileName()); + stringBuffer.append(TEXT_16); + +} + + stringBuffer.append(TEXT_17); + return stringBuffer.toString(); + } +} Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/resources/META-INF/plexus/component.xml URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/resources/META-INF/plexus/component.xml?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/resources/META-INF/plexus/component.xml (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/src/main/resources/META-INF/plexus/component.xml Wed Feb 21 15:05:11 2007 @@ -0,0 +1,18 @@ + + + + + org.apache.maven.lifecycle.mapping.LifecycleMapping + documentation.checklist + org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping + + + org.apache.maven:documentation.checklist.plugin:generate + org.codehaus.plexus:plexus-maven-plugin:app + org.apache.maven.plugins:maven-install-plugin:install + org.apache.maven.plugins:maven-deploy-plugin:deploy + + + + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/META-INF/plexus/component.xml URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/META-INF/plexus/component.xml?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/META-INF/plexus/component.xml (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/META-INF/plexus/component.xml Wed Feb 21 15:05:11 2007 @@ -0,0 +1,18 @@ + + + + + org.apache.maven.lifecycle.mapping.LifecycleMapping + documentation.checklist + org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping + + + org.apache.maven:documentation.checklist.plugin:generate + org.codehaus.plexus:plexus-maven-plugin:app + org.apache.maven.plugins:maven-install-plugin:install + org.apache.maven.plugins:maven-deploy-plugin:deploy + + + + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojo.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojo.class?view=auto&rev=510296 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojo.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoConstants.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoConstants.class?view=auto&rev=510296 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoConstants.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoHelper.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoHelper.class?view=auto&rev=510296 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/ChecklistMojoHelper.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/templates/ChecklistHTMLGenerator.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/templates/ChecklistHTMLGenerator.class?view=auto&rev=510296 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/templates/ChecklistHTMLGenerator.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/templates/RecipeHTMLGenerator.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/templates/RecipeHTMLGenerator.class?view=auto&rev=510296 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/templates/RecipeHTMLGenerator.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/templates/TOCGenerator.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/templates/TOCGenerator.class?view=auto&rev=510296 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/classes/org/apache/maven/plugins/documentation/checklist/mojo/templates/TOCGenerator.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/documentation.checklist.mojo-1.0-SNAPSHOT.jar URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/documentation.checklist.mojo-1.0-SNAPSHOT.jar?view=auto&rev=510296 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/target/documentation.checklist.mojo-1.0-SNAPSHOT.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/ChecklistHTMLGenerator.javajet URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/ChecklistHTMLGenerator.javajet?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/ChecklistHTMLGenerator.javajet (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/ChecklistHTMLGenerator.javajet Wed Feb 21 15:05:11 2007 @@ -0,0 +1,77 @@ +<%@ jet package="org.apache.maven.plugins.documentation.checklist.mojo.templates" + class="ChecklistHTMLGenerator" + imports=" org.apache.maven.model.emf.documentation.checklist.Checklist + org.apache.maven.model.emf.documentation.checklist.CheckGroup + org.apache.maven.model.emf.documentation.checklist.CheckItem + org.apache.maven.model.emf.documentation.recipe.Recipe + org.apache.maven.model.emf.documentation.checklist.Separator + org.eclipse.emf.common.util.EList + org.eclipse.emf.common.util.EMap + org.apache.commons.lang.StringUtils + java.util.Iterator + "%> +<% + CheckGroup checkGroup = (CheckGroup) argument; + Checklist checklist = (Checklist) checkGroup.eContainer(); + EList checkItems = checkGroup.getCheckItems(); + EMap recipeMap = checklist.getRecipeMap(); +%> + + + + + + + + +<%=checkGroup.getLabel()%> + + + +

Checklist

+ +

<%=checkGroup.getLabel()%>

+ +<% +CheckItem checkItem = null; +Recipe recipe = null; +String recipeId = null; +Separator separator = null; + +for (int i = 0; i < checkItems.size(); i++) +{ + checkItem = checkItems.get(i); + recipeId = checkItem.getRecipeReferenceId(); + + recipe = recipeMap.get(recipeId); + separator = checkItem.getSeparator(); + if (separator != null) + { +%> +<<%=separator.getTagName()%>> <%=separator.getTagBody()%> > +<% + } +%> + + class="notRequired" <%}%>> + + + + + + +
+ + <%=recipe.getChallenge()%> + + <%=checkItem.getLabel()%>
+<% +} +%> + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/RecipeHTMLGenerator.javajet URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/RecipeHTMLGenerator.javajet?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/RecipeHTMLGenerator.javajet (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/RecipeHTMLGenerator.javajet Wed Feb 21 15:05:11 2007 @@ -0,0 +1,93 @@ +<%@ jet package="org.apache.maven.plugins.documentation.checklist.mojo.templates" + class="RecipeHTMLGenerator" + imports=" org.apache.maven.model.emf.documentation.checklist.Checklist + org.apache.maven.model.emf.documentation.checklist.CheckGroup + org.apache.maven.model.emf.documentation.checklist.CheckItem + org.apache.maven.model.emf.documentation.recipe.Recipes + org.apache.maven.model.emf.documentation.recipe.Recipe + org.eclipse.emf.common.util.EMap + org.eclipse.emf.ecore.resource.Resource + org.eclipse.emf.common.util.EList + org.apache.commons.lang.StringUtils + java.util.Iterator + "%> +<% + CheckItem checkItem = (CheckItem) argument; + CheckGroup checkGroup = (CheckGroup) checkItem.eContainer(); + Checklist checklist = (Checklist) checkItem.eResource().getEObject("//@checklist"); + EMap recipeMap + = checklist.getRecipeMap(); + Recipe recipe = recipeMap.get(checkItem.getRecipeReferenceId()); + + EList relatedRecipeIDs = recipe.getRelatedRecipeIDs(); +%> + + + + <%=recipe.getChallenge()%> + + + + + + +

Challenge

+ +
+

<%=recipe.getChallenge()%>

+
+ +

Solution

+ +
+

<%=recipe.getSolution()%>

+
+ +

Discussion

+ +
+

<%=recipe.getDiscussion()%>

+ +<% +if (relatedRecipeIDs.size() > 0) +{ +%> + +

Related Challenges

+ + + +<% +Recipe relatedRecipe = null; +for (int i = 0; i < relatedRecipeIDs.size(); i++) +{ + String id = (String) relatedRecipeIDs.get(i); + relatedRecipe = recipeMap.get(id); +%> + + + + + +<% +} +%> + + +
+ + <%=relatedRecipe.getChallenge()%> + + <%=relatedRecipe.getChallenge()%>
+<% +} +%> + + + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/TOCGenerator.xmljet URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/TOCGenerator.xmljet?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/TOCGenerator.xmljet (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.mojo/templates/TOCGenerator.xmljet Wed Feb 21 15:05:11 2007 @@ -0,0 +1,62 @@ +<%@ jet package="org.apache.maven.plugins.documentation.checklist.mojo.templates" + class="TOCGenerator" + imports=" org.apache.maven.model.emf.documentation.checklist.Checklist + org.apache.maven.model.emf.documentation.checklist.CheckGroup + org.apache.maven.model.emf.documentation.checklist.CheckItem + org.apache.maven.model.emf.documentation.recipe.Recipe + org.apache.maven.model.emf.documentation.checklist.PackagingTarget + org.eclipse.emf.common.util.EList + org.eclipse.emf.common.util.EMap + org.apache.commons.lang.StringUtils + java.util.Iterator" +%> +<% + Checklist checklist = (Checklist) argument; + EMap recipeMap = checklist.getRecipeMap(); + PackagingTarget packagingTarget = checklist.getPackagingTarget(); + EList checkGroups = checklist.getCheckGroups(); +%> + + + + + + +<% +Iterator checkGroupsIterator1 = checkGroups.iterator(); +while (checkGroupsIterator1.hasNext()) +{ + CheckGroup checkGroup = checkGroupsIterator1.next(); +%> + +<% + Iterator checkItemsIterator = checkGroup.getCheckItems().iterator(); + while (checkItemsIterator.hasNext()) + { + CheckItem checkItem = checkItemsIterator.next(); + Recipe recipe = recipeMap.get( checkItem.getRecipeReferenceId() ); + +%> + +<% + } +%> + +<% +} +%> + + +<% +Iterator checkGroupsIterator2 = checkGroups.iterator(); +while (checkGroupsIterator2.hasNext()) +{ + CheckGroup checkGroup = checkGroupsIterator2.next(); +%> + +<% +} +%> + + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.classpath URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.classpath?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.classpath (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.classpath Wed Feb 21 15:05:11 2007 @@ -0,0 +1,4 @@ + + + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.project URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.project?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.project (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.project Wed Feb 21 15:05:11 2007 @@ -0,0 +1,14 @@ + + documentation.checklist.test + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.jdt.core.javanature + + \ No newline at end of file Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.settings/org.eclipse.jdt.core.prefs URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.settings/org.eclipse.jdt.core.prefs?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.settings/org.eclipse.jdt.core.prefs (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/.settings/org.eclipse.jdt.core.prefs Wed Feb 21 15:05:11 2007 @@ -0,0 +1,5 @@ +#Fri Feb 16 13:48:12 CST 2007 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 Added: directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/pom.xml URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/pom.xml?view=auto&rev=510296 ============================================================================== --- directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/pom.xml (added) +++ directory/sandbox/oersoy/documentation.checklist.parent/documentation.checklist.test/pom.xml Wed Feb 21 15:05:11 2007 @@ -0,0 +1,28 @@ + + + documentation.checklist.parent + org.apache.maven + 1.0-SNAPSHOT + + 4.0.0 + documentation.checklist.test + 1.0.0 + + + + org.apache.maven + documentation.checklist.mojo + 1.0-SNAPSHOT + true + + + generate + + generate + + + + + + +