Author: ilgrosso
Date: Mon Jun 16 10:41:19 2014
New Revision: 1602838

URL: http://svn.apache.org/r1602838
Log:
[SYNCOPE-488] Offline generation of WADL + HTML transformation

Removed:
    syncope/trunk/core/src/main/webapp/css/
Modified:
    syncope/trunk/common/pom.xml
    syncope/trunk/console/pom.xml
    syncope/trunk/core/src/main/resources/wadl2html/index.xsl
    syncope/trunk/pom.xml

Modified: syncope/trunk/common/pom.xml
URL: 
http://svn.apache.org/viewvc/syncope/trunk/common/pom.xml?rev=1602838&r1=1602837&r2=1602838&view=diff
==============================================================================
--- syncope/trunk/common/pom.xml (original)
+++ syncope/trunk/common/pom.xml Mon Jun 16 10:41:19 2014
@@ -88,7 +88,7 @@ under the License.
 
   <build>
     <plugins>
-      <!-- Generating javadoc JAR artifact for usage with CXF's WADL generator 
-->
+      <!-- Generating javadoc JAR artifact for usage with CXF's WADL generator 
(for core) -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
@@ -145,4 +145,169 @@ under the License.
       </resource>
     </resources>
   </build>
+  
+  <profiles>
+    <profile>
+      <id>offline-doc</id>
+      
+      <build>
+        <defaultGoal>clean verify</defaultGoal>
+        
+        <plugins>
+          <!-- 1. Generate offline WADL -->
+          <plugin>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-java2wadl-plugin</artifactId>
+            <inherited>true</inherited>
+            <executions>
+              <execution>
+                <id>parsejavadoc</id>
+                <phase>generate-resources</phase>
+                <goals>
+                  <goal>parsejavadoc</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>process-classes</id>
+                <phase>process-classes</phase>
+                <goals>
+                  <goal>java2wadl</goal>
+                </goals>
+                <configuration>
+                  <applicationTitle>Apache Syncope 
${project.version}</applicationTitle>
+                  <namespacePrefix>syncope</namespacePrefix>
+                  <addResourceAndMethodIds>true</addResourceAndMethodIds>
+                  
<linkAnyMediaTypeToXmlSchema>true</linkAnyMediaTypeToXmlSchema>
+                  <classResourceNames/>
+                  
<basePackages>org.apache.syncope.common.services</basePackages>
+                  
<docProvider>org.apache.cxf.maven_plugin.javatowadl.ResourceMapJavaDocProvider</docProvider>
+                  <attachWadl>true</attachWadl>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- 2. Transform WADL into 2 HTML pages -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>xml-maven-plugin</artifactId>
+            <inherited>true</inherited>
+            <executions>
+              <execution>
+                <phase>prepare-package</phase>
+                <goals>
+                  <goal>transform</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <transformationSets>
+                <transformationSet>
+                  <dir>${project.build.directory}/generated/wadl/</dir>
+                  <includes>
+                    <include>application.wadl</include>
+                  </includes>
+                  
<outputDir>${project.build.directory}/generated/wadl</outputDir>
+                  
<stylesheet>${basedir}/../core/src/main/resources/wadl2html/index.xsl</stylesheet>
+                  <parameters>
+                    <parameter>
+                      <name>contextPath</name>
+                      <value>/restdocs/${project.version}</value>
+                    </parameter>
+                  </parameters>
+                  <outputProperties>
+                    <outputProperty>
+                      <name>indent</name>
+                      <value>yes</value>
+                    </outputProperty>
+                  </outputProperties>
+                  <fileMappers>
+                    <fileMapper 
implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
+                      <pattern>^.*$</pattern>
+                      <replacement>index.html</replacement>
+                    </fileMapper>
+                  </fileMappers>
+                </transformationSet>
+                <transformationSet>
+                  <dir>${project.build.directory}/generated/wadl/</dir>
+                  <includes>
+                    <include>application.wadl</include>
+                  </includes>
+                  
<outputDir>${project.build.directory}/generated/wadl</outputDir>
+                  
<stylesheet>${basedir}/../core/src/main/resources/wadl2html/schema.xsl</stylesheet>
+                  <parameters>
+                    <parameter>
+                      <name>contextPath</name>
+                      <value>/restdocs/${project.version}</value>
+                    </parameter>
+                    <parameter>
+                      <name>schema-position</name>
+                      <value>1</value>
+                    </parameter>
+                    <parameter>
+                      <name>schema-prefix</name>
+                      <value>syncope1</value>
+                    </parameter>
+                  </parameters>
+                  <outputProperties>
+                    <outputProperty>
+                      <name>indent</name>
+                      <value>yes</value>
+                    </outputProperty>
+                  </outputProperties>
+                  <fileMappers>
+                    <fileMapper 
implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
+                      <pattern>^.*$</pattern>
+                      <replacement>schema_1_syncope1.html</replacement>
+                    </fileMapper>
+                  </fileMappers>
+                </transformationSet>
+              </transformationSets>
+            </configuration>
+          </plugin>   
+          <!-- 3. Replace CSS and JS local includes with hosted -->
+          <plugin>
+            <groupId>com.google.code.maven-replacer-plugin</groupId>
+            <artifactId>replacer</artifactId>
+            <inherited>true</inherited>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <goals>
+                  <goal>replace</goal>
+                </goals>                   
+              </execution>
+            </executions>
+            <configuration>
+              <regex>false</regex>
+              <includes>
+                
<include>${project.build.directory}/generated/wadl/*.html</include>
+              </includes>              
+              <replacements>
+                <replacement>
+                  
<token>/restdocs/${project.version}/webjars/highlightjs/$/styles/default.min.css</token>
+                  
<value>http://yandex.st/highlightjs/${highlightjs.version}/styles/default.min.css</value>
+                </replacement>         
+                <replacement>
+                  
<token>/restdocs/${project.version}/webjars/highlightjs/$/highlight.min.js</token>
+                  
<value>http://yandex.st/highlightjs/${highlightjs.version}/highlight.min.js";</value>
+                </replacement>         
+                <replacement>
+                  
<token>/restdocs/${project.version}/webjars/jquery-ui/$/themes/base/minified/jquery-ui.min.css</token>
+                  
<value>http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/base/minified/jquery-ui.min.css</value>
+                </replacement>  
+                <replacement>
+                  
<token>/restdocs/${project.version}/webjars/jquery-ui/$/ui/minified/jquery-ui.min.js</token>
+                  
<value>http://ajax.googleapis.com/ajax/libs/jqueryui/${jquery-ui.version}/jquery-ui.min.js</value>
+                </replacement>  
+                <replacement>
+                  
<token>/restdocs/${project.version}/webjars/jquery/$/jquery.min.js</token>
+                  
<value>http://ajax.googleapis.com/ajax/libs/jquery/${jquery.version}/jquery.min.js</value>
+                </replacement>  
+              </replacements>
+            </configuration>
+          </plugin>                 
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>

Modified: syncope/trunk/console/pom.xml
URL: 
http://svn.apache.org/viewvc/syncope/trunk/console/pom.xml?rev=1602838&r1=1602837&r2=1602838&view=diff
==============================================================================
--- syncope/trunk/console/pom.xml (original)
+++ syncope/trunk/console/pom.xml Mon Jun 16 10:41:19 2014
@@ -130,10 +130,6 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.webjars</groupId>
-      <artifactId>highlightjs</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.webjars</groupId>
       <artifactId>codemirror</artifactId>
     </dependency>      
       

Modified: syncope/trunk/core/src/main/resources/wadl2html/index.xsl
URL: 
http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/wadl2html/index.xsl?rev=1602838&r1=1602837&r2=1602838&view=diff
==============================================================================
--- syncope/trunk/core/src/main/resources/wadl2html/index.xsl (original)
+++ syncope/trunk/core/src/main/resources/wadl2html/index.xsl Mon Jun 16 
10:41:19 2014
@@ -47,8 +47,53 @@
         </title>
 
         <link rel="stylesheet" 
href="{$contextPath}/webjars/jquery-ui/${jquery-ui.version}/themes/base/minified/jquery-ui.min.css"/>
-        <link rel="stylesheet" href="{$contextPath}/css/style.css"/>
+        <style>
+body {
+  font-family: "Verdana,Arial,sans-serif";
+  font-size: 0.9em;
+}
 
+table {
+  font-family: "Verdana,Arial,sans-serif";
+  font-size: 0.9em;
+  border-width: 1px;
+  border-color: #666666;
+  border-collapse: collapse;
+}
+table th {
+  border-width: 1px;
+  padding: 8px;
+  border-style: solid;
+  border-color: #666666;
+  background-color: #dedede;
+}
+td {
+  border-width: 1px;
+  padding: 8px;
+  border-style: solid;
+  border-color: #666666;
+  background-color: #ffffff;
+  vertical-align: top;
+}
+
+.methods {
+  padding: 5px;
+}
+
+.representation-label {
+  font-weight: bold;
+  width: 80px;
+}
+
+.ui-widget { font-size: 0.9em; }
+.ui-tabs-vertical { width: 60em; }
+.ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; 
width: 15em; }
+.ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; 
border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 
0 -1px .2em 0; }
+.ui-tabs-vertical .ui-tabs-nav li a { display:block; }
+.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; 
padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }
+.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: right; width: 40em;}
+        </style>
+        
         <script 
src="{$contextPath}/webjars/jquery/${jquery.version}/jquery.min.js">
         </script>
         <script 
src="{$contextPath}/webjars/jquery-ui/${jquery-ui.version}/ui/minified/jquery-ui.min.js">
          

Modified: syncope/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/syncope/trunk/pom.xml?rev=1602838&r1=1602837&r2=1602838&view=diff
==============================================================================
--- syncope/trunk/pom.xml (original)
+++ syncope/trunk/pom.xml Mon Jun 16 10:41:19 2014
@@ -321,7 +321,7 @@ under the License.
     
     <aspectj.version>1.8.0</aspectj.version>
 
-    <cxf.version>3.0.0</cxf.version>   
+    <cxf.version>3.0.1-SNAPSHOT</cxf.version>  
     <spring.version>4.0.5.RELEASE</spring.version>
     <spring-security.version>3.2.4.RELEASE</spring-security.version>
     <jackson.version>2.4.0</jackson.version>
@@ -339,7 +339,7 @@ under the License.
 
     <wicket.version>6.15.0</wicket.version>
 
-    <groovy.version>2.3.2</groovy.version>
+    <groovy.version>2.3.3</groovy.version>
 
     <h2.version>1.4.178</h2.version>
 
@@ -348,7 +348,7 @@ under the License.
     <disruptor.version>3.2.1</disruptor.version>
 
     <junit.version>4.11</junit.version>
-    <selenium.version>2.42.1</selenium.version>
+    <selenium.version>2.42.2</selenium.version>
 
     <apacheds.version>1.5.7</apacheds.version>
 
@@ -358,7 +358,7 @@ under the License.
  
     <jquery.version>1.11.1</jquery.version>
     <jquery-ui.version>1.10.4</jquery-ui.version>
-    <highlightjs.version>7.3-1</highlightjs.version>
+    <highlightjs.version>8.0</highlightjs.version>
     <codemirror.version>3.23</codemirror.version>
  
     <bundles.directory>${project.build.directory}/bundles</bundles.directory>
@@ -867,7 +867,7 @@ under the License.
       <dependency>
         <groupId>org.webjars</groupId>
         <artifactId>highlightjs</artifactId>
-        <version>${highlightjs.version}</version>
+        <version>${highlightjs.version}-3</version>
       </dependency>
       <dependency>
         <groupId>org.webjars</groupId>
@@ -922,7 +922,6 @@ under the License.
   </dependencyManagement>
 
   <repositories>
-
     <repository>
       <id>sonatype</id>
       <url>https://oss.sonatype.org/content/repositories/snapshots</url>
@@ -932,10 +931,16 @@ under the License.
       <snapshots>
         <enabled>true</enabled>
       </snapshots>
-    </repository>
-    
+    </repository>    
   </repositories>
 
+  <pluginRepositories>
+    <pluginRepository>
+      <id>apache.snapshots</id>
+      <url>http://repository.apache.org/snapshots</url>
+    </pluginRepository>
+  </pluginRepositories>
+
   <build>
     <defaultGoal>clean verify</defaultGoal>
 
@@ -970,6 +975,16 @@ under the License.
           <version>2.9.1</version>          
         </plugin>
         <plugin>
+          <groupId>org.apache.cxf</groupId>
+          <artifactId>cxf-java2wadl-plugin</artifactId>
+          <version>${cxf.version}</version>
+        </plugin>
+        <plugin>
+          <groupId>com.google.code.maven-replacer-plugin</groupId>
+          <artifactId>replacer</artifactId>
+          <version>1.5.3</version>
+        </plugin>
+        <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>exec-maven-plugin</artifactId>
           <version>1.3</version>


Reply via email to