flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mamsel...@apache.org
Subject [2/2] git commit: [flex-sdk] [refs/heads/asdoc] - FLEX-33800 Add disclaimer in html ASDocs for experimental classes
Date Sat, 05 Oct 2013 19:19:43 GMT
FLEX-33800 Add disclaimer in html ASDocs for experimental classes


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/89c0d71c
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/89c0d71c
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/89c0d71c

Branch: refs/heads/asdoc
Commit: 89c0d71c6b3174276dec40c68da2bee06b926a35
Parents: 77410b8
Author: mamsellem <maurice.amsellem@systar.com>
Authored: Sat Oct 5 21:18:51 2013 +0200
Committer: mamsellem <maurice.amsellem@systar.com>
Committed: Sat Oct 5 21:18:51 2013 +0200

----------------------------------------------------------------------
 asdoc/build.xml                                 |  11 +--
 asdoc/templates/ASDoc_terms.xml                 |   9 +++
 asdoc/templates/class-files.xslt                |   9 +++
 asdoc/templates/class-parts.xslt                |  14 ++++
 asdoc/templates/images/experimental_small.png   | Bin 0 -> 1485 bytes
 asdoc/templates/style.css                       |   4 +
 .../src/spark/components/MobileGrid.as          |   2 +
 .../java/flex2/compiler/asdoc/ClassTable.java   |   3 +-
 .../asdoc/TopLevelClassesGenerator.java         |  78 ++++++++++++-------
 .../flex2/compiler/asdoc/TopLevelGenerator.java |   8 +-
 .../flex2/compiler/mxml/lang/StandardDefs.java  |   2 +-
 11 files changed, 100 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/asdoc/build.xml
----------------------------------------------------------------------
diff --git a/asdoc/build.xml b/asdoc/build.xml
index d1834b5..0557b24 100644
--- a/asdoc/build.xml
+++ b/asdoc/build.xml
@@ -70,13 +70,10 @@
         <taskdef resource="flexTasks.tasks" classpathref="flexTasks.path"/>
 
 		<!-- Call asdoc to generate dita xml files -->
-		<asdoc output="${FLEX_HOME}/asdoc-output" lenient="true" failonerror="true" warnings="false"
strict="false" locale="en_US" fork="true">
-               main-title="${release} Reference "
-               footer="${manifest.Implementation-Vendor}"
-               window-title="ApacheFlex Reference"
-                >
-              <!--            examples-path="${bbrFxDoc.project.docExamples}"
-               templates-path="${bbrFxDoc.project.templates}"-->
+		<asdoc output="${FLEX_HOME}/asdoc-output" lenient="true" failonerror="true" warnings="false"
strict="false" locale="en_US" fork="true"
+               window-title="ApacheFlex API Reference"
+               main-title="${release} API Reference "
+               footer="${manifest.Implementation-Vendor}"  >
 
 			<!-- top level class to include in asdoc -->
 		    <doc-classes class="AIRFrameworkClasses"/>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/asdoc/templates/ASDoc_terms.xml
----------------------------------------------------------------------
diff --git a/asdoc/templates/ASDoc_terms.xml b/asdoc/templates/ASDoc_terms.xml
index 9057df8..8d2f83e 100644
--- a/asdoc/templates/ASDoc_terms.xml
+++ b/asdoc/templates/ASDoc_terms.xml
@@ -4209,6 +4209,15 @@
                            </draft-comment>
                         </entry>
                      </row>
+                      <!-- text entry for experimental disclaimer-->
+                      <row rowsep="1" class="- topic/row ">
+                          <entry colname="1" colsep="1" class="- topic/entry ">
+                              <p translate="no" class="- topic/p ">experimental.disclaimer</p>
+                          </entry>
+                          <entry colname="2" colsep="1" class="- topic/entry ">
+                              <p class="- topic/p ">This class is experimental, which
means it has not been tested or documented as thoroughly as other core Apache Flex classes.</p>
+                          </entry>
+                      </row>
                   </tbody>
                </tgroup>
             </adobetable>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/asdoc/templates/class-files.xslt
----------------------------------------------------------------------
diff --git a/asdoc/templates/class-files.xslt b/asdoc/templates/class-files.xslt
index 9710273..5f673bf 100644
--- a/asdoc/templates/class-files.xslt
+++ b/asdoc/templates/class-files.xslt
@@ -112,6 +112,14 @@
 								<xsl:with-param name="packageName" select="$packageName"/>
 							</xsl:call-template>
 						</xsl:variable>
+                        <xsl:variable name="experimental" >
+                            <xsl:if test="prolog/asMetadata/experimental">
+                                <xsl:value-of select="'true'"/>
+                            </xsl:if>
+                            <xsl:if test="not(prolog/asMetadata/experimental)">
+                                <xsl:value-of select="'false'"/>
+                            </xsl:if>
+                        </xsl:variable>
 						<xsl:result-document href="{$classFile}" method="html">
 							<!--xsl:message select="$classFile"/-->
 							<xsl:copy-of select="$docType"/>
@@ -153,6 +161,7 @@
 										<xsl:call-template name="classHeader">
 											<xsl:with-param name="classDeprecated" select="$classDeprecated"/>
 											<xsl:with-param name="classNode" select="$classNode"/>
+                                            <xsl:with-param name="experimental" select="$experimental"/>
 										</xsl:call-template>
 									</xsl:for-each>
 									<xsl:for-each select="$field_map//apiClassifier[@id=$ID]">

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/asdoc/templates/class-parts.xslt
----------------------------------------------------------------------
diff --git a/asdoc/templates/class-parts.xslt b/asdoc/templates/class-parts.xslt
index bdc5c74..455193a 100644
--- a/asdoc/templates/class-parts.xslt
+++ b/asdoc/templates/class-parts.xslt
@@ -635,6 +635,7 @@
 	<xsl:template name="classHeader">
 		<xsl:param name="classNode"/>
 		<xsl:param name="classDeprecated"/>
+        <xsl:param name="experimental"/>
 		<xsl:variable name="packageName" select="ancestor-or-self::apiPackage/apiName"/>
 		<xsl:variable name="baseRef">
 			<xsl:call-template name="getBaseRef">
@@ -1061,6 +1062,19 @@
 			</xsl:if>
 			<xsl:apply-templates select="apiClassifierDetail/apiClassifierDef/apiDeprecated"/>
 			<xsl:call-template name="version"/>
+
+            <!-- display experimental disclaimer-->
+            <p/>
+            <xsl:if test="$experimental = 'true'">
+                <table width="100%" class="innertable">
+                    <tr>
+                        <td class="experimental"><img src="{$baseRef}images/experimental_small.png"/></td>
+                        <td class="experimental">
+                            <xsl:value-of  select="$asdoc_terms/row[entry[1][p/text()
= 'experimental.disclaimer']]/entry[2]/p"/>
+                        </td>
+                    </tr>
+                </table>
+            </xsl:if>
 			<p/>
 			  <xsl:if test="prolog/asMetadata/Alternative">
 			    <xsl:text disable-output-escaping="yes">&lt;br/&gt;</xsl:text>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/asdoc/templates/images/experimental_small.png
----------------------------------------------------------------------
diff --git a/asdoc/templates/images/experimental_small.png b/asdoc/templates/images/experimental_small.png
new file mode 100644
index 0000000..872a137
Binary files /dev/null and b/asdoc/templates/images/experimental_small.png differ

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/asdoc/templates/style.css
----------------------------------------------------------------------
diff --git a/asdoc/templates/style.css b/asdoc/templates/style.css
index 4a29620..d0af2fe 100644
--- a/asdoc/templates/style.css
+++ b/asdoc/templates/style.css
@@ -410,6 +410,10 @@ table.withBorder {
 	padding: 2px 3px 2px 3px;
 }
 
+.experimental {
+    background-color: #e4ffe5;
+}
+
 .paramSpacer {
 	font-size: 5px;
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
index ce76f6f..3c7719d 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
@@ -48,6 +48,8 @@ use namespace  mx_internal;
  */
 [Event(name="sortChange", type="spark.events.MobileGridHeaderEvent")]
 
+[Experimental]
+
 /**
  * The MobileGrid displays a collection of items in a grid of rows and columns and column
headers and is optimized for speed on mobile devices.
  * <p> The MobileGrid component provides the following features:

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java
----------------------------------------------------------------------
diff --git a/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java b/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java
index 7e5c9ee..e229884 100644
--- a/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java
+++ b/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java
@@ -1189,7 +1189,8 @@ public class ClassTable implements DocCommentTable {
                             // these metaData types can have their own DocComment associated
with them, though they might also have no comment.
                             if (mdi.getId().equals(StandardDefs.MD_STYLE) || mdi.getId().equals(StandardDefs.MD_EVENT)
|| mdi.getId().equals(StandardDefs.MD_EFFECT)
                                     || mdi.getId().equals(StandardDefs.MD_SKINSTATE) || mdi.getId().equals(StandardDefs.MD_ALTERNATIVE)
-                                    || mdi.getId().equals(StandardDefs.MD_DISCOURAGEDFORPROFILE))
+                                    || mdi.getId().equals(StandardDefs.MD_DISCOURAGEDFORPROFILE)
+                                    ||  mdi.getId().equals(StandardDefs.MD_EXPERIMENTAL))
                             {
                                 if (x+1 < numItems)  // if it has a comment, it will be
the sequentially next DocCommentNode
                                 {

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.java
----------------------------------------------------------------------
diff --git a/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.java
b/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.java
index 929652a..6d3157a 100644
--- a/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.java
+++ b/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.java
@@ -19,21 +19,11 @@
 
 package flex2.compiler.asdoc;
 
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import flex2.compiler.io.FileUtil;
+import flex2.compiler.mxml.lang.StandardDefs;
+import flex2.compiler.util.ThreadLocalToolkit;
+import flex2.tools.ASDoc.ValidationMessage;
+import org.w3c.dom.*;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -42,16 +32,10 @@ import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
-
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import flex2.compiler.io.FileUtil;
-import flex2.compiler.util.ThreadLocalToolkit;
-import flex2.tools.ASDoc.ValidationMessage;
+import java.io.*;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * This class converts the toplevel.xml to dita based xml files. It create one
@@ -824,8 +808,6 @@ public class TopLevelClassesGenerator
 
     /**
      * process all custom elements for the class xml node and resolve
-     * 
-     * @see references now that we have AClass records for every class name
      * record inner class relationship.
      * @param record
      * @param isInterface
@@ -5017,6 +4999,48 @@ public class TopLevelClassesGenerator
                     asMetadata.appendChild(alternative);
                 }
             }
+
+                  /* adding experimental XML */
+            Element experimentalElement = asDocUtil.getElementByTagName((Element) parent,
StandardDefs.MD_EXPERIMENTAL);
+            if (experimentalElement != null) {
+                String fullName = experimentalElement.getAttribute("owner");
+
+               System.out.println(" processing [Experimental] for " + fullName);
+
+                AsClass myClass = classTable.get(fullName);
+
+                if (myClass != null) {
+                    Element node = myClass.getNode();
+
+                    Element profilesElement = null;
+                    Element asMetadata = null;
+                    Element prolog = asDocUtil.getElementByTagName(node, "prolog");
+                    if (prolog != null) {
+                        asMetadata = asDocUtil.getElementByTagName(prolog, "asMetadata");
+                        if (asMetadata != null) {
+                           profilesElement = asDocUtil.getElementByTagName(asMetadata, "experimental");
+                            if (profilesElement == null) {
+                                profilesElement = outputObject.createElement("experimental");
+                                asMetadata.appendChild(profilesElement);
+                            }
+                        } else {
+                            profilesElement = outputObject.createElement("discouragedForProfiles");
+                            asMetadata = outputObject.createElement("asMetadata");
+                            asMetadata.appendChild(profilesElement);
+                            prolog.appendChild(asMetadata);
+                        }
+                    } else {
+                        profilesElement = outputObject.createElement("discouragedForProfiles");
+                        asMetadata = outputObject.createElement("asMetadata");
+                        asMetadata.appendChild(profilesElement);
+                        prolog = outputObject.createElement("prolog");
+                        prolog.appendChild(asMetadata);
+                        myClass.getNode().appendChild(prolog);
+                    }
+
+                }
+
+        }
             
             Element discouragedForProfileElement = asDocUtil.getElementByTagName((Element)parent,
"DiscouragedForProfile");
             if (discouragedForProfileElement != null)

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelGenerator.java
----------------------------------------------------------------------
diff --git a/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelGenerator.java b/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelGenerator.java
index ff445e4..b6390601 100644
--- a/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelGenerator.java
+++ b/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelGenerator.java
@@ -19,14 +19,14 @@
 
 package flex2.compiler.asdoc;
 
+import flex2.compiler.mxml.lang.StandardDefs;
+
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Iterator;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import flex2.compiler.mxml.lang.StandardDefs;
-
 /**
  * This class is used to generate the toplevel.xml file.
  *
@@ -279,7 +279,7 @@ public class TopLevelGenerator implements DocCommentGenerator
             //These types of metadata can have comments associated with them
             if (metadataType == StandardDefs.MD_EVENT || metadataType == StandardDefs.MD_STYLE
|| metadataType == StandardDefs.MD_EFFECT 
                     || metadataType == StandardDefs.MD_SKINSTATE || metadataType == StandardDefs.MD_SKINPART
|| metadataType == StandardDefs.MD_ALTERNATIVE
-                    || metadataType == StandardDefs.MD_DISCOURAGEDFORPROFILE)
+                    || metadataType == StandardDefs.MD_DISCOURAGEDFORPROFILE || metadataType
== StandardDefs.MD_EXPERIMENTAL)
             {
                 String desc = meta.getDescription();
                 if (desc != null)

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89c0d71c/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java
----------------------------------------------------------------------
diff --git a/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java b/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java
index 8e0565a..e944da4 100644
--- a/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java
+++ b/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java
@@ -373,7 +373,7 @@ public abstract class StandardDefs
     public static final String MD_SKINPART = "SkinPart";
     public static final String MD_ALTERNATIVE = "Alternative";
     public static final String MD_DISCOURAGEDFORPROFILE = "DiscouragedForProfile";
-    
+    public static final String MD_EXPERIMENTAL = "Experimental";
     
     //    metadata param names
     public static final String MDPARAM_BINDABLE_EVENT = "event";


Mime
View raw message