Jörn Nettingsmeier wrote:
Jörn Nettingsmeier wrote:
hi thorsten, hi everyone!

ok, here's my first attempt.

the first patch changes all private methods in LenyaMetaDataGenerator to "protected".

the second file is a new subclass, LenyaSaneMetaDataGenerator (NOI thorsten ;), that attempts to parse the messy metadata into something more xmlish, which can then be handled more gracefully with xslts. if you want to try it, just drop it into src/java/org/apache/lenya/cms/cocoon/generation.

the third patch activates the new generator in the default sitemap.
after rebuilding, browse default/authoring/meta&docid=index&lang=en and check out the output. for maximum enjoyment, it is advisable to submit the current document, otherwise there will be no workflow metadata to view.

before i push this patch into bugzilla for inclusion, a few questions:

* does anyone have objections or suggestions regarding the
implementation? (whitespace will be fixed)

* in the light of another recent discussion about lenya namespaces, what
do you think about creating a new namespace for the output of the
metadata generator, so as not to abuse the page-envelope ns? a
suggestion is attached below, please comment.

* since we're not exactly in code freeze, does it make sense to maintain
this generator as a subclass of thorsten's implementation, or should we
rather merge the two? i would prefer the latter.


btw, i'd like to suggest that in the future we try to create a working
relaxng (or xml schema) for any and all new namespaces that are being
introduced, and only then start coding. there is no better way for
normative documentation imho. it would also be nice to come up with
validation schemas for the namespaces that are already in use....


regards,


jörn


--
"Open source takes the bullshit out of software."
        - Charles Ferguson on TechnologyReview.com

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: [EMAIL PROTECTED], Telefon: 0203/379-2736

<?xml version="1.0" encoding="utf-8"?>
<!--
  Suggested grammar for a new Lenya metadata namespace, target milestone 1.4.0.
  Namespace URI: http://apache.org/cocoon/lenya/document-metadata/1.0
  The suggested namespace prefix is "lenya-meta:".
-->

<grammar 
    xmlns="http://relaxng.org/ns/structure/1.0";
    xmlns:xs="http://www.w3.org/2001/XMLSchema-datatypes";
>

<start>


<element name="meta" 
    ns="http://apache.org/cocoon/lenya/document-metadata/1.0";
    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>

  <element name="internal">

    <element name="resourceType"><data type="string"/></element>

    <element name="contentType"><data type="string"/></element>

    <optional>
      <element name="workflowHistory">

        <oneOrMore>
          <element name="revision">
            <attribute name="index">
              <data type="integer"/>
            </attribute>
            <element name="event">
              <choice>
                <value>create</value>
                <value>edit</value>
                <value>submit</value>
                <value>reject</value>
                <value>publish</value>
              </choice>
            </element>
            <element name="state">
            <!-- 
              this is probably be redundant, since state can
              be inferred from the revision history. are there
              any reasons we should keep it?
            -->
              <choice>
                <value>authoring</value>
                <value>review</value>
                <value>live</value>
              </choice>
            </element>
            <element name="isLive">
              <data type="boolean"/>
            </element>
            <element name="user">
              <data type="string"/>
            </element>
            <element name="machine">
              <data type="string">
                 <param name="pattern">((1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]).){3}             (1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])"</param>
              </data>
            </element>
            <element name="timestamp">
              <data type="dateTime"/>
            </element>
          </element>
        </oneOrMore>

      </element>
    </optional>

  </element>

  <element name="dc">
    <oneOrMore>
      <element>
         <nsName ns="http://purl.org/dc/elements/1.1/"/>
         <data type="string"/>
      </element>
    </oneOrMore>
  </element>

  <element name="custom">
    <oneOrMore>
      <element>
        <anyName>
          <except>
            <nsName ns="http://apache.org/cocoon/lenya/document-metadata/1.0"/>
          </except>
        </anyName>
        <data type="string"/>
      </element>
    </oneOrMore>
  </element>
</element>

</start>

</grammar>






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to