Source Code Cross Referenced for NamespaceTransformerMojo.java in  » UML » AndroMDA-3.2 » org » andromda » maven » plugin » site » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » UML » AndroMDA 3.2 » org.andromda.maven.plugin.site 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.andromda.maven.plugin.site;
002:
003:        import java.io.File;
004:        import java.io.IOException;
005:        import java.net.URL;
006:
007:        import java.util.Iterator;
008:        import java.util.List;
009:
010:        import org.apache.commons.lang.StringUtils;
011:        import org.apache.commons.lang.exception.ExceptionUtils;
012:        import org.apache.maven.artifact.Artifact;
013:        import org.apache.maven.plugin.AbstractMojo;
014:        import org.apache.maven.plugin.MojoExecutionException;
015:        import org.apache.maven.plugin.MojoFailureException;
016:        import org.apache.maven.project.MavenProject;
017:
018:        import org.andromda.core.common.ResourceUtils;
019:
020:        /**
021:         * Used to perform the transformation of the namespace XSL document to namespace.xml xdoc format
022:         * within the site plugin.
023:         *
024:         * @phase pre-site
025:         * @goal namespace-xsl
026:         * @description runs AndroMDA site namespace xsl transformation
027:         * @author Vance Karimi
028:         */
029:        public class NamespaceTransformerMojo extends AbstractMojo {
030:            /**
031:             * The name of the project injected from pom.xml
032:             * 
033:             * @parameter default-value="${project.name}"
034:             */
035:            private String projectName;
036:
037:            /**
038:             * Path to the project namespace.xml
039:             * 
040:             * @parameter expression="${basedir}/src/main/resources/META-INF/andromda/namespace.xml"
041:             */
042:            private String namespaceDocumentPath;
043:
044:            /**
045:             * Path to the project namespace transformation XSL
046:             */
047:            private static final String NAMESPACE_TRANSFORMATION_URI = "META-INF/xsl/namespace.xsl";
048:
049:            /**
050:             * @parameter expression="${basedir}/src/main/resources/META-INF/xsl/namespace.xsl"
051:             */
052:            private String namespaceTransformationPath;
053:
054:            /**
055:             * Path to the project namespace document output
056:             * 
057:             * @parameter expression="${basedir}/src/site/axdoc/namespace.xml"
058:             */
059:            private String namespaceOutputPath;
060:
061:            /**
062:             * @parameter expression="${project}"
063:             * @required
064:             * @readonly
065:             */
066:            protected MavenProject project;
067:
068:            /**
069:             * XSL Transformer
070:             */
071:            private XslTransformer xslTransformer;
072:
073:            /**
074:             * @see org.apache.maven.plugin.Mojo#execute()
075:             */
076:            public void execute() throws MojoExecutionException,
077:                    MojoFailureException {
078:                this 
079:                        .getLog()
080:                        .info(
081:                                "-----------------------------------------------------------------------------");
082:                this 
083:                        .getLog()
084:                        .info(
085:                                "  A n d r o M D A   S i t e   N a m e s p a c e   T r a n s f o r m a t i o n");
086:                this 
087:                        .getLog()
088:                        .info(
089:                                "-----------------------------------------------------------------------------");
090:
091:                if (xslTransformer == null) {
092:                    xslTransformer = new XslTransformer(projectName);
093:                }
094:
095:                this .getLog().info(
096:                        "Transforming namespace " + this .namespaceDocumentPath);
097:
098:                try {
099:                    final File namespaceDocumentFile = new File(
100:                            this .namespaceDocumentPath);
101:                    if (namespaceDocumentFile.exists()
102:                            && namespaceDocumentFile.isFile()) {
103:                        final URL namespaceTransformationUri = ResourceUtils
104:                                .getResource(NAMESPACE_TRANSFORMATION_URI);
105:                        xslTransformer
106:                                .transform(namespaceDocumentPath,
107:                                        namespaceTransformationUri,
108:                                        namespaceOutputPath);
109:                    }
110:
111:                    this .getLog()
112:                            .info(
113:                                    "Transformed namesapce "
114:                                            + this .namespaceOutputPath);
115:                    this .getLog().info("TRANSFORMING NAMESPACE SUCCESSFUL");
116:                } catch (final Throwable throwable) {
117:                    if (throwable instanceof  MojoExecutionException) {
118:                        throw (MojoExecutionException) throwable;
119:                    }
120:                    throw new MojoExecutionException(
121:                            "An error occured creating namespace site document '"
122:                                    + this .project.getArtifactId() + "'",
123:                            ExceptionUtils.getRootCause(throwable));
124:                }
125:            }
126:
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.