Skip to main content
summaryrefslogblamecommitdiffstats
blob: c6c4ef525d44685e243a351094e637b4af55e6b9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                                    

                                                                                                









                                                                                    
                                                                                                                                            
                                                                                                                                     
                                                                  












































                                                                                                                                                                                                                                

                                                                                                                                           



                                                                                       
                                                                                                                                    








                                                             
<%@taglib prefix="c" id="org.eclipse.jet.controlTags" %>
<%@taglib prefix="f" id="org.eclipse.jet.formatTags" %>
<%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>

*** Control template for Generate JET2 Tag Documentation

<%-- Define variables for standard items --%>
<c:setVariable var="jetPluginNS" select="'org.eclipse.jet'"/>
<c:setVariable var="tagLibrariesXP" select="concat($jetPluginNS, '.tagLibraries')"/>
<%-- XXX Hack. This should be picked up from the plug-in itself. To do this we need
	1) the ability to readn Manifest.MF files with JET
	2) the ability to discover the project containing the input (plugin.xml)
	We're not there yet.
--%>
<c:setVariable var="pluginNS" select="$org.eclipse.jet.resource.project.name"/>
<c:setVariable var="docPlugin" select="concat($org.eclipse.jet.resource.project.name, '.doc')"/>

    --- Define additional attributes for the current plugin element

    --- Iterate over each nested extension element 
    <c:iterate select="/plugin/extension[@point = $tagLibrariesXP]" var="extension">
        --- Define additional attributes for the current extension element

        --- Iterate over each nested tagLibrary element 
        <c:iterate select="$extension/tagLibrary" var="tagLibrary">
            --- Define additional attributes for the current tagLibrary element
            <c:set select="$tagLibrary" name="htmlDir">references/taglibs/<c:get select="$tagLibrary/@id"/><%-- TODO format=QC --%></c:set> 
            <c:set select="$tagLibrary" name="tocXmlFile">toc<c:get select="$tagLibrary/@id"/><%-- TODO format="QC" --%>.xml</c:set> 
            <c:set select="$tagLibrary" name="tocXmlDir"></c:set> 
            <c:set select="$tagLibrary" name="tagPrefix"></c:set>
            <c:if test="$tagLibrary/@standardPrefix">
            	<c:set select="$tagLibrary" name="tagPrefix"><c:get select="$tagLibrary/@standardPrefix"/>:</c:set>
            </c:if>
            <c:set select="$tagLibrary" name="description">TODO Define description of <c:get select="$tagLibrary/@name"/></c:set>
            <c:if test="$tagLibrary/description">
            	<c:set select="$tagLibrary" name="description"><f:replaceAll value="\r?\n" replacement="<P>" regex="true"><c:get select="$tagLibrary/description"/></f:replaceAll></c:set>
            </c:if>

            --- Iterate over each nested conditionalTag element 
            <c:iterate select="$tagLibrary/*[local-name() != 'description']" var="tag">
                --- Define additional attributes for the current conditionalTag element
                <c:set select="$tag" name="tagHtmlFile"><c:get select="$tag/@name" />Tag.html</c:set> 
 				<c:set select="$tag" name="tagQName"><c:get select="$tagLibrary/@tagPrefix"/><c:get select="$tag/@name" /></c:set>
 				<c:set select="$tag" name="requiredAttrs"><c:iterate select="$tag/attribute[@use='required']" var="attribute"> <c:get select="$attribute/@name" />=&quot;<I>value</I>&quot;</c:iterate></c:set>
 				<c:set select="$tag" name="optionalAttrs"><c:iterate select="$tag/attribute[@use!='required']" var="attribute"> <c:get select="$attribute/@name" />=&quot;<I>value</I>&quot;</c:iterate></c:set>
 				<c:set select="$tag" name="requiredTagInnards"><c:get select="$tag/@tagQName" /><c:get select="$tag/@requiredAttrs"/></c:set>
 				<c:set select="$tag" name="allTagInnards"><c:get select="$tag/@tagQName" /><c:get select="$tag/@requiredAttrs"/><c:get select="$tag/@optionalAttrs"/></c:set>
                <c:set select="$tag" name="description">TODO Define description of <c:get select="$tag/@name"/></c:set>
                <c:if test="$tag/description">
                	<c:set select="$tag" name="description"><f:replaceAll value="\r?\n" replacement="<P>" regex="true"><c:get select="$tag/description"/></f:replaceAll></c:set>
                </c:if>
                --- Iterate over each nested attribute element 
                <c:iterate select="$tag/attribute" var="attribute">
                    --- Define additional attributes for the current attribute element
                    <c:set select="$attribute" name="description">TODO Define description of <c:get select="$attribute/@name"/></c:set>
                    <c:if test="$attribute/description">
                    	<c:set select="$attribute" name="description"><f:replaceAll value="\r?\n" replacement="<BR>" regex="true"><c:get select="$attribute/description"/></f:replaceAll></c:set>
                    </c:if>
                </c:iterate>
            </c:iterate>

        </c:iterate>
    </c:iterate>

*** Traverse the model and generate artifacts 
    --- Generate artifacts for the current plugin element

    --- Iterate over each nested extension element 
    <c:iterate select="/plugin/extension[@point = $tagLibrariesXP]" var="extension">
        --- Generate artifacts for the current extension element

        --- Iterate over each nested tagLibrary element 
        <c:iterate select="$extension/tagLibrary" var="tagLibrary">
            --- Generate artifacts for the current tagLibrary element
            <ws:file template="templates/tagLibrary/overview.html.jet"  path="{$docPlugin}/{$tagLibrary/@htmlDir}/overview.html" />
            <ws:file template="templates/tagLibrary/toc.xml.jet"  path="{$docPlugin}/{$tagLibrary/@tocXmlDir}/{$tagLibrary/@tocXmlFile}" />

            --- Iterate over each nested conditionalTag element 
            <c:iterate select="$tagLibrary/*[local-name() != 'description']" var="tag">
                --- Generate artifacts for the current conditionalTag element
                <ws:file template="templates/allTags/tag.html.jet"  path="{$docPlugin}/{$tagLibrary/@htmlDir}/{$tag/@tagHtmlFile}"/>

            </c:iterate>
        </c:iterate>
    </c:iterate>
   
*** Dump the transformed model for testing and debug purposes



Back to the top