You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Jörn Nettingsmeier <ne...@apache.org> on 2007/08/12 14:17:03 UTC

making resource type configuration more consistent...

hi everyone!


our current resource type configuration syntax is a little confusing imho:

<schema src="foo" language=""/>

<link-rewrite xpath="/foo/bar"/>

<sample-name name="foo" mime-type="application/bar">foo://bar</sample-name>
or
<samples uri="foo://bar.xml"/>

<format name="foo" uri="foo://bar"/>

<expires secords="42"/>

first of all, what does "expires" mean? the xhtml doctype gives this
very helpful comment:
<!-- Default time in seconds until the resource-type has expired -->
does the resource type self-destruct one hour after the servlet engine
has started? are documents older than one hour automatically deleted?
please enlighten me...

next, we have three ways of specifying a uri: by an attribute "src", an
attribute "uri" or by element content.

third, "sample-name" is not a very lucky choice imho. clearly, it's not
a name for a sample that's being defined, but the sample itself.

then, remind me again of the meaning of "link-rewrite"... is it still
necessary after the Grand Proxying Rewrite of 2007? if yes, can it be
folded into proxy or uuid2uri rewriting?


there's a (trivial) patch in my queue that cleans up the syntax of
resource type declarations a bit. i'd like to sneak it in before 2.0,
but it will mean people have to change their custom resource types a
little. any objections?


regards,

jörn



-- 
Jörn Nettingsmeier

"One of my most productive days was throwing away 1000 lines of code."
   - Ken Thompson.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: making resource type configuration more consistent...

Posted by Joern Nettingsmeier <ne...@folkwang-hochschule.de>.
Andreas Hartmann wrote:
> Jörn Nettingsmeier schrieb:
>>>> <expires secords="42"/>
>> <cache seconds="42"/>
> 
> The problem here is that the method is "ResourceType.getExpires()".
> If we change the configuration, we should also change the API.
> "expires" is maybe more precise.

i think "expires" is not self-explanatory in the context of a resource 
type configuration.  if cache is too vague for your taste, how about
<cache-time seconds="42"/> ?

-- 
jörn nettingsmeier

home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621

Kurt is up in Heaven now.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: making resource type configuration more consistent...

Posted by Andreas Hartmann <an...@apache.org>.
Jörn Nettingsmeier schrieb:
> Andreas Hartmann wrote:
>>> there's a (trivial) patch in my queue that cleans up the syntax of
>>> resource type declarations a bit. i'd like to sneak it in before 2.0,
>>> but it will mean people have to change their custom resource types a
>>> little. any objections?
>>
>> Would you mind attaching the patch so that we can take a look? TIA!
> 
> i'd rather not do that, but do a series of incremental commits instead...
> here are the changes i'm thinking of, maybe you can comment on them:
> 
>>> <schema src="foo" language=""/>
> 
> <schema uri="foo" language="rng"/>

+1

> 
>>> <link-rewrite xpath="/foo/bar"/>
> 
> unchanged (or maybe removed, depending on how it interacts with proxying
> and link rewriting)
> 
>>> <sample-name name="foo"
>>> mime-type="application/bar">foo://bar</sample-name>
>>> or
>>> <samples uri="foo://bar.xml"/>
> 
> <sample name="foo" mime-type="application/bar" uri="foo://bar"/>
> <samples uri="foo://bar/baz.xml"/>

+1

>>> <format name="foo" uri="foo://bar"/>
> 
> unchanged
> 
>>> <expires secords="42"/>
> 
> <cache seconds="42"/>

The problem here is that the method is "ResourceType.getExpires()".
If we change the configuration, we should also change the API.
"expires" is maybe more precise. What do the others think?

-- Andreas

-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: making resource type configuration more consistent...

Posted by Jörn Nettingsmeier <ne...@apache.org>.
Andreas Hartmann wrote:
 >> there's a (trivial) patch in my queue that cleans up the syntax of
 >> resource type declarations a bit. i'd like to sneak it in before 2.0,
 >> but it will mean people have to change their custom resource types a
 >> little. any objections?
 >
 > Would you mind attaching the patch so that we can take a look? TIA!

i'd rather not do that, but do a series of incremental commits instead...
here are the changes i'm thinking of, maybe you can comment on them:

>> <schema src="foo" language=""/>

<schema uri="foo" language="rng"/>

>> <link-rewrite xpath="/foo/bar"/>

unchanged (or maybe removed, depending on how it interacts with proxying 
and link rewriting)

>> <sample-name name="foo" mime-type="application/bar">foo://bar</sample-name>
>> or
>> <samples uri="foo://bar.xml"/>

<sample name="foo" mime-type="application/bar" uri="foo://bar"/>
<samples uri="foo://bar/baz.xml"/>

>> <format name="foo" uri="foo://bar"/>

unchanged

>> <expires secords="42"/>

<cache seconds="42"/>

wdyt?


-- 
jörn nettingsmeier

home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621

Kurt is up in Heaven now.

-- 
Jörn Nettingsmeier

"One of my most productive days was throwing away 1000 lines of code."
   - Ken Thompson.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: making resource type configuration more consistent...

Posted by Andreas Hartmann <an...@apache.org>.
Hi Jörn,

Jörn Nettingsmeier schrieb:

> our current resource type configuration syntax is a little confusing imho:
> 
> <schema src="foo" language=""/>
> 
> <link-rewrite xpath="/foo/bar"/>
> 
> <sample-name name="foo" mime-type="application/bar">foo://bar</sample-name>
> or
> <samples uri="foo://bar.xml"/>
> 
> <format name="foo" uri="foo://bar"/>
> 
> <expires secords="42"/>
> 
> first of all, what does "expires" mean? the xhtml doctype gives this
> very helpful comment:
> <!-- Default time in seconds until the resource-type has expired -->
> does the resource type self-destruct one hour after the servlet engine
> has started? are documents older than one hour automatically deleted?
> please enlighten me...

it's the expiration time for caching the corresponding pages.

svn praises Doug Chestnut for this method:

557603    andreas      * Returns the date at which point the requested
resource is considered
557603    andreas      * expired
423080   chestnut      * @return a string in RFC 1123 date format
422950   chestnut      */
423122   chestnut     Date getExpires();

Doug, maybe you'd like to add some docs? I filed a bug:
http://issues.apache.org/bugzilla/show_bug.cgi?id=43097


> next, we have three ways of specifying a uri: by an attribute "src", an
> attribute "uri" or by element content.

I'd prefer "uri" because it implies the type of the attribute.


> third, "sample-name" is not a very lucky choice imho. clearly, it's not
> a name for a sample that's being defined, but the sample itself.

+1 for <sample>


> then, remind me again of the meaning of "link-rewrite"... is it still
> necessary after the Grand Proxying Rewrite of 2007? if yes, can it be
> folded into proxy or uuid2uri rewriting?

I think this is now handled by the configuration of the various link
rewriting transformers (which could be the worse option), but I'll take
a closer look tomorrow.


> there's a (trivial) patch in my queue that cleans up the syntax of
> resource type declarations a bit. i'd like to sneak it in before 2.0,
> but it will mean people have to change their custom resource types a
> little. any objections?

Would you mind attaching the patch so that we can take a look? TIA!

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org