[Pmwiki-users] Re: Re: Action to provide last modified date and md5 checksum

John Rankin john.rankin
Mon Jul 12 16:09:54 CDT 2004


On Monday, 12 July 2004 8:34 PM, Christian Ridderstr?m <chr at home.se> wrote:
>On 11 Jul 2004, John Rankin wrote:
>
>> >> IIRC, the Dublin Core recipe will return some of what you want. See
>> >> 
>> >> http://www.pmwiki.org/wiki/Cookbook/MetaData
>> >> 
>> >> For example, have a look at the xhtml source of
>> >> http://wiki.lianza.org.nz/index.php/Main/HomePage?action=dc
>> >
>> >It's close, but no cigar. The date field doesn't contain enough 
>> >resolution.
>> 
>> Ah, you need to change the line in dublincore.php that reads:
>> 
>> DcElement('date',strftime('%Y-%m-%d', $page['time']));
>> 
>> to use a more suitable date and time format.
>
>Hmm... don't I risking breaking the standard then? I was thinking more
>along the lines of adding a new kind of 'DcElement' (that might break the
>standard as well of course...)

No, it's OK; the following date formats are acceptable under DC:


   Year:
      YYYY (eg 1997)
   Year and month:
      YYYY-MM (eg 1997-07)
   Complete date:
      YYYY-MM-DD (eg 1997-07-16)
   Complete date plus hours and minutes:
      YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
   Complete date plus hours, minutes and seconds:
      YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
   Complete date plus hours, minutes, seconds and a decimal fraction of a
second
      YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)


where:
     YYYY = four-digit year
     MM   = two-digit month (01=January, etc.)
     DD   = two-digit day of month (01 through 31)
     hh   = two digits of hour (00 through 23) (am/pm NOT allowed)
     mm   = two digits of minute (00 through 59)
     ss   = two digits of second (00 through 59)
     s    = one or more digits representing a decimal fraction of a second
     TZD  = time zone designator (Z or +hh:mm or -hh:mm)


>
>> >    <dc:format>text/html</dc:format>
>> 
>> >From my (admittedly cursory) reading of the Dublin Core documentation,
>> I thinkit would be OK to include a checksum as part of the format 
>> element's content.
>
>Um.. wouldn't that break the standard as well? Assuming that there is a
>standard, I haven't had time to look at this (and probably won't for a
>while).

I don't think so. To quote:

Typically, Format may include the media-type or dimensions of the resource. Format may be used to identify the software, hardware, or other equipment needed to display or operate the resource. Examples of dimensions include size and duration....

I think you have a 'dimension' usage. For example, you might generate:

    text/html(md5:.........)

Alternatively, it may be better to use the 'extent' element, which is a
refinement of the 'format' element. Like this:

<dc:format xsi:type="dcterms:IMT">
    text/html
  </dc:format>
  <dcterms:extent>
    checksum ........
  </dcterms:extent>
>
>Anyway, I'll have to think about making this compatible with all 
>(future) pmwiki installations. That might complicate things if I depend 
>too much additional cookbook recipies.

One of the reasons I used this recipe is that it's just a new PmWiki
action, so it *should* work with future versions. It inserts a
new line in a regular page's header that reads (for example):

<link rel='meta' type='text/xml' href='http://wiki.lianza.org.nz/index.php/Main/HomePage?action=dc' />

Then action=dc is just a new thing to handle.

And IMHO, PmWiki should include Dublin Core support.

But your call of course. If you decide to go this route, let
me know, because I extended the Cookbook recipe to support
DcTerms as well as DcElements. No sense your reinventing the
wheel.


Useful links:
http://dublincore.org/documents/dces/
http://dublincore.org/documents/dcmi-terms/

-- 
JR
--
John Rankin





More information about the pmwiki-users mailing list