pier        2003/03/04 20:02:47

  Added:       src/scratchpad/flowspec Cocoon.xml style.css style.xsl
  Log:
  Preliminary and _very_partial_ language independent flow specification.
  NOTE: This is heavily tuned to be used with Mozilla 1.3 on client side.
  
  Revision  Changes    Path
  1.1                  xml-cocoon2/src/scratchpad/flowspec/Cocoon.xml
  
  Index: Cocoon.xml
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1"?>
  
  <?xml-stylesheet href="style.xsl" type="text/xsl"?>
  
  <interface name="Cocoon">
    <attribute name="componentManager" type="ComponentManager" access="read-only">
      <p>The Cocoon ComponentManager associated with this instance.</p>
    </attribute>
  
    <attribute name="environment" type="Environment" access="read-only">
      <p>The Cocoon Environment instance associated with this request.</p>
    </attribute>
  
    <attribute name="interpreter" type="Interpreter" access="read-only">
      <p>The Cocoon Interpreter instance executing this script.</p>
    </attribute>
  
    <attribute name="context" type="Context" access="read-only">
      <p>The Cocoon Context associated with this instance.</p>
    </attribute>
  
    <attribute name="parameters" type="BeanArray" access="read-only">
      <p>
        An array of <ref type="Bean">Bean</ref> objects representing the current
        request parameters.
      </p>
      <p>random gibberish</p>
    </attribute>
  
    <attribute name="request" type="Request" access="read-only">
      <p>The current Cocoon Request instance associated with this request.</p>
    </attribute>
  
    <attribute name="response" type="Response" access="read-only">
      <p>The current Cocoon Response instance associated with this request.</p>
    </attribute>
  
    <attribute name="session" type="Session" access="read-only">
      <p>The Cocoon Session instance associated with the requesting client.</p>
    </attribute>
  
    <function name="callAction" type="Bean" raise="Exception">
      <argument type="String" name="type">[???]</argument>
      <argument type="String" name="source">[???]</argument>
      <return>[???]</return>
      <raise>[???]</raise>
      <p>
        Invoke a named action defined in the Cocoon pipeline.
      </p>
      <p>
        random stuff...
      </p>
    </function>
  
    <function name="createSession">
      <p>
        Create a new Cocoon Session instance and associate it univocally with the
        current client.
      </p>
    </function>
  
    <function name="displayAllContinuations" raise="ComponentException">
      <raise>[???]</raise>
      <p>
        [???]
      </p>
    </function>
  
    <function name="forwardTo" raise="Exception">
      <raise>[???]</raise>
      <argument type="String" name="uri">[???]</argument>
      <argument type="Bean" name="bizData">[???]</argument>
      <argument type="Continuation" name="continuation">[???]</argument>
      <p>
        Forward the current request to the specified URI to be used as a view.
      </p>
    </function>
  
    <function name="inputModuleGetAttribute" raise="Exception">
      <argument type="String" name="type">[???]</argument>
      <argument type="String" name="attribute">[???]</argument>
      <raise>[???]</raise>
      <p>
        [???]
      </p>
    </function>
  
    <function name="load" type="Object" raise="Exception">
      <argument type="String" name="filename">The file containing the script to 
load</argument>
      <raise>If the script cannot be loaded</raise>
      <return>[???]</return>
      <p>
        Load and include a specified script in memory, as if it were typed in the
        current script.
      </p>
    </function>
  
    <function name="outputModuleCommit" raise="Exception">
      <argument type="String" name="type">[???]</argument>
      <raise>[???]</raise>
      <p>
        [???]
      </p>
    </function>
  
    <function name="outputModuleRollback" raise="Exception">
      <argument type="String" name="type">[???]</argument>
      <raise>[???]</raise>
      <p>
        [???]
      </p>
    </function>
  
    <function name="outputModuleSetAttribute" raise="Exception">
      <argument type="String" name="type">[???]</argument>
      <argument type="String" name="attribute">The name of the attribute to 
set</argument>
      <argument type="String" name="value">The value of the attribute</argument>
      <raise>[???]</raise>
      <p>
        [???]
      </p>
    </function>
  
    <function name="process" type="boolean" raise="Exception">
      <argument type="String" name="uri">The Cocoon URI generating the 
subrequest</argument>
      <argument type="Bean" name="bizData">
        A <ref type="Bean">Bean</ref> which can be evaluated by the invoked pipeline
        components containing the business data associated with the subrequest
      </argument>
      <argument type="Object">
        A Java-Native OutputStream where the subrequest output should be written to
      </argument>
      <return>Whatever the Cocoon Environment returns processing this 
subrequest</return>
      <raise>If an error occurred processing the subrequest</raise>
      <p>
        Process a subrequest made to the Cocoon sitemap, writing the output to
        a specified OutputStream.
      </p>
    </function>
  
  </interface>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/flowspec/style.css
  
  Index: style.css
  ===================================================================
  table.index {
  background-color: #ccccff;
  border-width: thin;
  border-color: #3333ff;
  border-style: ridge;
}

table.index thead th {
  background-color: #9999ff;
  border-width: thin;
  border-color: #3333ff;
  border-style: ridge;
  font-size: larger;
}

table.index thead td {
  background-color: #6666ff;
  border-width: thin;
  border-color: #3333ff;
  border-style: ridge;
  font-size: smaller;
  font-weight: bold;
  width: 0%;
}

table.index thead td.type {
  width: 0%;
}

table.index thead td.desc {
  width: 100%;
}

table.index thead td.accs {
  width: 0%;
}

table.index tbody td {
  background-color: #ffffff;
  border-width: thin;
  border-color: #3333ff;
  border-style: solid;
  vertical-align: top;
}

table.index tbody td.type {
  width: 0%;
}

table.index tbody td.desc {
  width: 0%;
}

table.index tbody td.type {
  width: 0%;
}

table.index tbody td.read-only {
  background-color: #ff9999;
  text-align: center;
  vertical-align: middle;
}

table.index tbody td.write-only {
  background-color: #99ff99;
  text-align: center;
  vertical-align: middle;
}

table.index tbody td.read-write {
  background-color: #ffff99;
  text-align: center;
  vertical-align: middle;
}

table.index div.type {
  text-align: right;
  font-family: monospace;
}

table.index div.name {
  font-family: monospace;
}

table.index div.desc {
  margin-left: 25px;
}
  
  
  1.1                  xml-cocoon2/src/scratchpad/flowspec/style.xsl
  
  Index: style.xsl
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1"?>

<?xml-stylesheet href="style.xsl" type="text/xsl"?>

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml";
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

  <xsl:output method="html"
              doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
              doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>

  <xsl:template match="/">
    <html>
      <xsl:apply-templates/>
    </html>
  </xsl:template>

  <xsl:template match="interface">
    <head>
      <title>Flow Layer: Interface "<xsl:value-of select="@name"/>" definition.</title>
      <link href="style.css" rel="stylesheet" text="text/css"/>
    </head>
    <body>
      <h1><em><xsl:value-of select="@name"/></em> interface</h1>

      <p>
        <table width="100%" class="index">
          <thead>
            <tr><th colspan="3">Attributes</th></tr>
            <tr>
              <td class="type">Type</td>
              <td class="desc">Name / Description</td>
              <td class="accs">Acc.</td>
            </tr>
          </thead>
          <xsl:apply-templates select="attribute">
            <xsl:sort select="@name"/>
          </xsl:apply-templates>
        </table>
      </p>

      <p>
        <table width="100%" class="index">
          <thead>
            <tr><th colspan="3">Functions</th></tr>
            <tr>
              <td class="type">Type</td>
              <td class="desc">Name / Description</td>
            </tr>
          </thead>
          <xsl:apply-templates select="function">
            <xsl:sort select="@name"/>
          </xsl:apply-templates>
        </table>
      </p>

    </body>
  </xsl:template>

  <xsl:template match="attribute">
    <tbody>
      <tr>
        <td><div class="type"><a href="./[EMAIL PROTECTED]"><xsl:value-of 
select="@type"/></a></div></td>
        <td>
          <div class="name"><a href="[EMAIL PROTECTED]"><xsl:value-of 
select="@name"/></a></div>
          <div class="desc">
            <xsl:apply-templates select="child::p[position()=1]" mode="index"/>
          </div>
        </td>
        <td class="[EMAIL PROTECTED]">
          <xsl:choose>
            <xsl:when test="@access='read-only'">R</xsl:when>
            <xsl:when test="@access='write-only'">W</xsl:when>
            <xsl:otherwise>RW</xsl:otherwise>
          </xsl:choose>
        </td>
      </tr>
    </tbody>
  </xsl:template>

  <xsl:template match="function">
    <tbody>
      <tr>
        <td>
          <div class="type">
            <xsl:choose>
              <xsl:when test="@type!=''">
                <a href="./[EMAIL PROTECTED]"><xsl:value-of select="@type"/></a>
              </xsl:when>
              <xsl:otherwise>void</xsl:otherwise>
            </xsl:choose>
          </div>
        </td>
        <td>
          <div class="name">
            <a href="[EMAIL PROTECTED]"><xsl:value-of select="@name"/></a>
            <xsl:text> (</xsl:text>
              <xsl:apply-templates select="argument" mode="index"/>
            <xsl:text>)</xsl:text>
            <xsl:if test="@raise != ''">
              <br/>raise <a href="./[EMAIL PROTECTED]"><xsl:value-of 
select="@raise"/></a>
            </xsl:if>
          </div>

          <div class="desc">
            <xsl:apply-templates select="child::p[position()=1]" mode="index"/>
          </div>
        </td>
      </tr>
    </tbody>
  </xsl:template>

  <xsl:template match="p" mode="index">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="argument" mode="index">
    <xsl:if test="position() > 1"><xsl:text>, </xsl:text></xsl:if>
    <a href="./[EMAIL PROTECTED]"><xsl:value-of select="@type"/></a>
    <xsl:text> </xsl:text>
    <xsl:value-of select="@name"/>
  </xsl:template>

  <xsl:template match="ref">
    <a href="./[EMAIL PROTECTED]"><xsl:apply-templates/></a>
  </xsl:template>

</xsl:stylesheet>
  
  

Reply via email to