cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernhard Huber" <bh22...@i-one.at>
Subject Re: more docs
Date Sun, 02 Sep 2001 21:14:35 GMT
I have forgotten to include profile-generator.xml!!! sorry

<?xml version="1.0"?>
<!DOCTYPE document SYSTEM "dtd/document-v10.dtd">
<document>
  <header>
    <title>Profile Generator</title>
    <subtitle>in @doctitle@</subtitle>
    <version>0.9</version>
    <type>Technical document</type>
    <authors>
      <person name="Carsten Ziegeler" email="cziegeler@apache.org"/>
    </authors>
    <abstract>This document describes the profile generator of 
@docname@.</abstract>
  </header>
  <body>
    <s1 title="Profile Generator">
      <p>
        The profile generator creates xml from the current profiler 
measurement 
        results of cocoon.
      </p>
      <p>
        The information is surrounded by the root element 
<code>profilerinfo</code>
        and grouped with the elements <code>pipeline</code>, 
        <code>average</code>, <code>result</code> and 
<code>element</code>.
      </p>
      <p>
        The <code>profilerinfo</code> element has the attribute 
<code>date</code>.
        The <code>pipeline</code> element has the attributes 
          <code>uri</code>, <code>count</code> and <code>time</code>.
        The <code>average</code> element has the attribute
          <code>time</code>.
        The <code>element</code> element has the attributes 
          <code>role</code>, <code>source</code> and <code>time</code>.
      </p>
      <p>
        A <code>pipeline</code> summarizes profile information of a 
pipeline
        as specified in the <code>sitemap</code>.
        Each <code>pipeline</code> element consists of 
        an <code>average</code>, and a <code>result</code> element.
        The <code>average</code> element describes the average time 
values, 
        whereas the <code>result</code> element describes each pipeline 
processing.
      </p>
      <p>
        The <code>element</code> element describes the timing values 
for each stage of
        the pipeline processing.
      </p>
      <p>
        All elements have the namespace 
        <code>http://apache.org/cocoon/profiler/1.0</code>.
      </p>
      <ul>
        <li>Name : profile</li>
        <li>Class: 
org.apache.cocoon.components.profiler.ProfilerGenerator</li>
        <li>Cacheable: no.</li>
      </ul>
      <s2 title="Configuraton of cocoon.xconf">
        <p>Edit <code>cocoon.xconf</code>
        </p>
<source><![CDATA[
...
<event-pipeline class="org.apache.cocoon.components.profiler.\
  ProfilingNonCachingEventPipeline"/>  
<sax-connector class="org.apache.cocoon.components.profiler.\
  ProfilingSAXConnector"/>
...
<profiler/>
]]></source>
    </s2>
    <s2 title="Configuration sitemap.xmap">
      <p>Edit <code>sitemap.xmap</code>
      </p>
<source><![CDATA[
  <map:generators default="file">
    ...
    <map:generator  name="profile"
     src="org.apache.cocoon.components.profiler.ProfilerGenerator" 
label="content"/>
    </map:generators>  ...
  
  <map:match pattern="profile">
  <map:generate type="profile"/>
  <map:transform type="xslt" src="stylesheets/system/profile2html.xsl"/>
  <map:serialize/>
  </map:match>
]]></source>
    </s2>
      <p>
        You may try <code>http://localhost/cocoon/profile</code>
        several times.
      </p>
    </s1>
    <s1 title="Configuration">
      <p>The following parameter can be specified in the pipeline for 
         the generate command:
      </p>
      <ul>
        <li>
          sort (optional) : Sets how Profile Generator sorts 
          pipeline elements. You may set <code>sort</code> to 
<code>uri</code>
          to sort <code>pipeline</code> element by its <code>uri</code>

attribute, 
          setting <code>sort</code> to time sorts 
          <code>pipeline</code> elements by its <code>time</code>

attribute, 
          finally setting <code>sort</code> to count sorts 
<code>pipeline</code> elements
          by its <code>count</code> attribute. 
        </li>
      </ul>
    </s1>
    <s1 title="DTD">
      <p>XML generated by status generator uses namespace 
        <code>http://apache.org/cocoon/status/2.0</code>. The DTD of XML
        generated by status generator:
      </p>
<source><![CDATA[
<!ELEMENT profilerinfo (pipeline)*>
<!ATTLIST profilerinfo
  date CDATA #IMPLIED
>

<!ELEMENT pipeline (average, result)*>
<!ATTLIST pipeline
  uri CDATA #REQUIRED
  count CDATA #REQUIRED
  time CDATA #REQUIRED
>
<!ELEMENT average (element)*>
<!ATTLIST average
  time CDATA #REQUIRED
>

<!ELEMENT result (element)*>
<!ATTLIST result
  time CDATA #REQUIRED
>

<!ELEMENT element EMPTY>
<!ATTLIST element
  role CDATA #REQUIRED
  source CDATA #IMPLIED
  time CDATA #REQUIRED
>

]]></source>
    </s1>
    <s1 title="Example">
      <p>The profile generator may output information:
      </p>
<source><![CDATA[
<profilerinfo xmlns="http://apache.org/cocoon/profiler/1.0" 
  date="01.09.2001 21:50:00">
  <pipeline uri="welcome" count="1" time="481">
    <average time="481">
      <element role="file" source="docs/samples/samples.xml" 
time="250"/>
      <element role="xslt" source="stylesheets/simple-samples2html.xsl" 
time="171"/>
      <element role="org.apache.cocoon.serialization.HTMLSerializer" 
time="60"/>
    </average>
    <result time="481">
      <element role="file" source="docs/samples/samples.xml" 
time="250"/>
      <element role="xslt" source="stylesheets/simple-samples2html.xsl" 
time="171"/>
      <element role="org.apache.cocoon.serialization.HTMLSerializer" 
time="60"/>
    </result>
  </pipeline>
  <pipeline uri="profile" count="1" time="3355">
    <average time="3355">
      <element role="profile" time="2964"/>
      <element role="xslt" source="stylesheets/system/profile2html.xsl" 
time="180"/>
      <element role="org.apache.cocoon.serialization.HTMLSerializer" 
time="211"/>
    </average>
    <result time="3355">
      <element role="profile" time="2964"/>
      <element role="xslt" source="stylesheets/system/profile2html.xsl" 
time="180"/>
      <element role="org.apache.cocoon.serialization.HTMLSerializer" 
time="211"/>
    </result>
  </pipeline>
</profilerinfo>
]]></source>
    </s1>
  </body>
</document>



----- Originalnachricht -----
Von: "Bernhard Huber" <bh22351@i-one.at>
Datum: Sonntag, September 2, 2001 11:03 pm
Betreff: more docs

> Hi
> As I was trying using cocoon2 generators, I missed docs about
> profile generator, and more detailed docs about directory generator,
> and status generator.
> Profile Generator is a great tool, but w/o docs nearly no one
> will use it.
> 
> I added documentation. 
> I made diffs to xdocs of snapshot xml-cocoon2_20010809161514,
> hope it helps using all the great code.
> 
> cvs diff directory-generator.xml docs-book.xml generators.xml site-
> book.xml status-generator.xml (in directory D:\projects\apache-
> xml\xml-
> cocoon2\xdocs)
> Index: directory-generator.xml
> ===================================================================
> RCS file: d:\cvsroot/xml-cocoon2/xdocs/directory-generator.xml,v
> retrieving revision 1.1.1.1
> diff -r1.1.1.1 directory-generator.xml
> 17,37c17,39
> <  <p>
> <  The root node of the generated document will normally be a
> <  <code>directory</code> node, and a directory node can contain zero
> <  or more <code>file</code> or <code>directory</code> nodes.
A 
> file 
> node has no
> <  children. Each node will contain the following attributes:</p>
> <    <ul>
> < 	<li>name : the name of the file or directory</li>
> <       <li>lastModified : the time the file was last modified, 
> measured as the number of
> <    milliseconds since the epoch (as in 
> java.io.File.lastModified)</li><       <li>date (optional) : the 
> time the file was last modified in 
> human-readable form</li>
> <    </ul>
> < 	<p>All generated elements have the namespace
> <          <code>." target="l">http:. The 
> root <code>directory</code>
> <          node has the attribute <code>requested</code> with the 
> value 
> <code>true</code>.</p>
> < 			<ul>
> < 				<li>Name : directory</li>
> < 				<li>Class: 
> org.apache.cocoon.generation.DirectoryGenerator</li>
> < 				<li>Cacheable: no.</li>
> < 			</ul>
> < <source>
> <      <![CDATA[
> ---
> >       <p>
> >         The root node of the generated document will normally be a
> >         <code>directory</code> node, and a directory node can 
> contain 
> zero
> >         or more <code>file</code> or <code>directory</code>

> nodes. A 
> file node has no
> >         children. Each node will contain the following attributes:
> >       </p>
> >       <ul>
> >         <li>name : the name of the file or directory</li>
> >         <li>lastModified : the time the file was last modified, 
> measured as the number of
> >         milliseconds since the epoch (as in 
> java.io.File.lastModified)</li>
> >         <li>date (optional) : the time the file was last 
> modified in 
> human-readable form</li>
> >       </ul>
> >       <p>All generated elements have the namespace
> >         <code>." target="l">http:.
> >         The root <code>directory</code>
> >         node has the attribute <code>requested</code> with the 
> value 
> <code>true</code>.
> >       </p>
> >       <ul>
> >         <li>Name : directory</li>
> >         <li>Class: 
> org.apache.cocoon.generation.DirectoryGenerator</li>
> >         <li>Cacheable: no.</li>
> >       </ul>
> > <source><![CDATA[
> 39,40c41
> <      ]]>
> < </source>
> ---
> > ]]></source>
> 42,56c43,96
> < <s1 title="Configuration">
> < <p>The following parameter can be specified in the pipeline for 
> <    the generate command:</p>
> < <ul>
> < <li>depth (optional) : Sets how deep Directory Generator should 
> delve 
> into the
> <  directory structure. If set to 1 (the default), only the starting
> <  directory's immediate contents will be returned.</li>
> < <li>dateFormat (optional) :  Sets the format for the date 
> attribute 
> of each node, as
> <  described in java.text.SimpleDateFormat. If unset, the default
> <  format for the current locale will be used.</li>
> < <li>root (optional) : The root pattern</li>
> < <li>include (optional) : The include pattern</li>
> < <li>exclude (optional) : The exclude pattern</li>
> < </ul>
> < </s1>
> ---
> >     <s1 title="Configuration">
> >       <p>The following parameter can be specified in the 
> pipeline for 
> >          the generate command:
> >       </p>
> >       <ul>
> >         <li>depth (optional) : Sets how deep Directory Generator 
> should delve into the
> >          directory structure. If set to 1 (the default), only 
> the 
> starting
> >          directory's immediate contents will be returned.</li>
> >         <li>dateFormat (optional) :  Sets the format for the 
> date 
> attribute of each node, as
> >          described in java.text.SimpleDateFormat. If unset, the 
> default
> >          format for the current locale will be used.</li>
> >         <li>root (optional) : The root pattern</li>
> >         <li>include (optional) : The include pattern</li>
> >         <li>exclude (optional) : The exclude pattern</li>
> >       </ul>
> >     </s1>
> >     <s1 title="DTD">
> >       <p>XML generated by directory generator uses namespace
> >         <code>." target="l">http:. The DTD
> >         of XML generated by directory generator:
> >       </p>
> > <source><![CDATA[
> >   <!ELEMENT directory (directory|file)*>
> >   <!ATTLIST directroy
> >     name         CDATA #REQUIRED
> >     lastModified CDATA #REQUIRED
> >     date         CDATA #IMPLIED
> >     requested    CDATA #IMPLIED>
> >   
> >   <!ELEMENt file #EMPTY>
> >   <!ATTLIST file
> >     name         CDATA #REQUIRED
> >     lastModified CDATA #REQUIRED
> >     date         CDATA #IMPLIED>
> > ]]></source>
> >     </s1>
> >     <s1 title="Example">
> >       <p>
> >         The current directory generator may generate following xml:
> >       </p>
> > <source><![CDATA[
> > <directory xmlns="http: 
> >   name="stylesheets" lastModified="999425490000" 
> >   date="02.09.01 12:11" 
> >   requested="true">
> >   <directory name="sites" 
> >     lastModified="999425490000" date="02.09.01 12:11"/>
> >   <file name="dynamic-page2html.xsl" 
> >     lastModified="999425490000" date="02.09.01 12:11"/>
> >   <file name="simple-xml2html.xsl" 
> >     lastModified="999425490000" date="02.09.01 12:11"/>
> > </directory>
> > ]]></source>
> >     </s1>
> Index: docs-book.xml
> ===================================================================
> RCS file: d:\cvsroot/xml-cocoon2/xdocs/docs-book.xml,v
> retrieving revision 1.1.1.2
> diff -r1.1.1.2 docs-book.xml
> 30a31
> >   <hidden id="profile-generator" label="Profile Generator" 
> source="profile-generator.xml"/>
> Index: generators.xml
> ===================================================================
> RCS file: d:\cvsroot/xml-cocoon2/xdocs/generators.xml,v
> retrieving revision 1.1.1.2
> diff -r1.1.1.2 generators.xml
> 37a38
> > 				<li><link href="profile-
> generator.html">Profile Generator</link></li>
> Index: site-book.xml
> ===================================================================
> RCS file: d:\cvsroot/xml-cocoon2/xdocs/site-book.xml,v
> retrieving revision 1.1.1.2
> diff -r1.1.1.2 site-book.xml
> 33a34
> >   <hidden id="profile-generator" label="Profile Generator" 
> source="profile-generator.xml"/>
> Index: status-generator.xml
> ===================================================================
> RCS file: d:\cvsroot/xml-cocoon2/xdocs/status-generator.xml,v
> retrieving revision 1.1.1.1
> diff -r1.1.1.1 status-generator.xml
> 37a38,62
> >                 <s1 title="DTD">
> >                 <p>XML generated by status generator uses 
> namespace 
> >                   <code>." target="l">http:. 
> The DTD of XML
> >                   generated by status generator:
> >                 </p>
> > <source><![CDATA[
> > <!ELEMENT statusinfo (group|value)*>
> > 
> > <!ATTLIST statusinfo
> >    date CDATA #IMPLIED
> >    host CDATA #IMPLIED
> > >
> > 
> > <!ELEMENT group (group|value)*>
> > <!ATTLIST group
> >    name CDATA #IMPLIED
> > >
> > 
> > <!ELEMENT value (line)+>
> > <!ATTLIST value
> >    name CDATA #REQUIRED
> > 
> > <!ELEMENT line (#PCDATA)+>
> > ]]></source>
> >                 </s1>
> 
> *****CVS exited normally with code 1*****
> 
> 
> 

Mime
View raw message