You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Michael Wechner <mi...@wyona.com> on 2005/07/21 16:51:45 UTC

Using the Lenya RepositorySource within a publication sitemap

Hi

I am currently using the Lenya source as follows within the sitemap

lenya://lenya/pubs/blog/content/authoring/feeds/all/index.xml

But actually I would like to call it without the lenya/pubs/blog/content
prefix.

Any suggestions on how to improve this?

Thanks

Michi

-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


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


Re: Using the Lenya RepositorySource within a publication sitemap

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:
> Andreas Hartmann wrote:
> 
>>
>>
>> Up to now, no solution was found to this problem.
> 
> 
> 
> what about introducing a new protocol type?
> 
> e.g.
> 
> lenya-pub://...

Reducing the URI scope to the publication level is probably
an option. I can't yet tell if this will cause problems.

-- Andreas


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


Re: Using the Lenya RepositorySource within a publication sitemap

Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:

>
>
> Up to now, no solution was found to this problem.


what about introducing a new protocol type?

e.g.

lenya-pub://...

Michi

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


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


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


Re: Using the Lenya RepositorySource within a publication sitemap

Posted by Andreas Hartmann <an...@apache.org>.
Felix Röthenbacher wrote:

[...]

> I see, there are many different usecases for the lenya protocol
> (documents, administration, predicates). Would it make sense
> to introduce a selector in the url wherewith the source factory
> can decide how to handle the request?
> 
> lenya://<selector>/<selector-url>
> 
> E.g.
> 
> lenya://document/<publication>/<area>/<doc-id>/<language>
> lenya://administration/<admin-url>
> lenya://doc-query/<document-query>
> 
> WDYT?

Hmmm, it looks tempting, but it rings a bell re. the
"swiss army knife" antipattern ...

Are there any examples how this is handled in other projects,
or even recommendations in the JSR-170 / Jackrabbit communities?

-- Andreas


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


Re: Using the Lenya RepositorySource within a publication sitemap

Posted by Felix Röthenbacher <fe...@wyona.com>.
Andreas Hartmann wrote:
> Felix Roethenbacher wrote:
> 
>> If I have a look at the lenya protocol, e.g.
>>
>> lenya://lenya/pubs/blog/content/authoring/feeds/all/index.xml
>>         ^^^^^^^^^^      ^^^^^^^
>>
>> the parts marked with ^ are used in a static fashion and may be
>> omitted. What do you think about using an abbreviated version of the
>> lenya protocol, like
>>
>>   lenya://<publication>/<area>/<doc-id>
> 
> 
> We could do that, but it would require some (IMO useful) changes.
> 
> 1) assets would be handled as documents (that would be great anyway)
> 
> 2) user data etc. would be handled as documents (fine with me),
>    I guess that would mean generalizing the area concept (add an
>    "administration" area for access control files etc.)
> 
> 
>> e.g.
>>
>>   lenya://blog/authoring/feeds/all
> 
> 
> Another example:
> 
>     lenya://blog/administration/policies/feeds/all
> 
> How about the language? If it was stored as a property, could we
> add a predicate syntax to the lenya:// protocol? IMO that would
> be quite flexible (workflow states etc.), but requires a well-documented
> set of property names.

I see, there are many different usecases for the lenya protocol
(documents, administration, predicates). Would it make sense
to introduce a selector in the url wherewith the source factory
can decide how to handle the request?

lenya://<selector>/<selector-url>

E.g.

lenya://document/<publication>/<area>/<doc-id>/<language>
lenya://administration/<admin-url>
lenya://doc-query/<document-query>

WDYT?

- Felix


> 
> BTW - maybe it's time to reconsider the area concept. Maybe it
> can be replaced by using different versions / workspaces. But
> that would certainly require addressing, which ccould be done
> in the same manner (lenya://pub/area/...). Actually it's only
> a storage backend concern.
> 
> 
>> A further improvement may be omitting the publication as well
>> if you want to stay in the current publication. The url may
>> look like this:
>>
>>   lenya:/<area>/<doc-id>
>>
>> e.g.
>>
>>   lenya:/authoring/all
>>
>> Note: only one / is used
> 
> 
> OK, this certainly makes sense - but only if it is used in a context
> that has been invoked by an HTTP request. Otherwise, an
> "InvalidContextException" or something like that could be thrown.
> 
>> What do you think about the proposal?
> 
> 
> IMO it is very useful. But I'm not quite sure if the publication
> can be omitted (lenya:/area/...).
> 
>> At least, it helps us avoid a lot of typing ... :-)
> 
> 
> Yes, and it avoids the redundant lenya/pubs prefix.
> Can we rely on the fact that we will never want to write files
> outside of publications? (I can't imagine a situation where this
> would be required)
> 
> -- Andreas
> 

-- 
Felix Röthenbacher                  felix.roethenbacher@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

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


Re: Using the Lenya RepositorySource within a publication sitemap

Posted by Andreas Hartmann <an...@apache.org>.
Felix Roethenbacher wrote:

> If I have a look at the lenya protocol, e.g.
> 
> lenya://lenya/pubs/blog/content/authoring/feeds/all/index.xml
>         ^^^^^^^^^^      ^^^^^^^
> 
> the parts marked with ^ are used in a static fashion and may be
> omitted. What do you think about using an abbreviated version of the
> lenya protocol, like
> 
>   lenya://<publication>/<area>/<doc-id>

We could do that, but it would require some (IMO useful) changes.

1) assets would be handled as documents (that would be great anyway)

2) user data etc. would be handled as documents (fine with me),
    I guess that would mean generalizing the area concept (add an
    "administration" area for access control files etc.)


> e.g.
> 
>   lenya://blog/authoring/feeds/all

Another example:

     lenya://blog/administration/policies/feeds/all

How about the language? If it was stored as a property, could we
add a predicate syntax to the lenya:// protocol? IMO that would
be quite flexible (workflow states etc.), but requires a well-documented
set of property names.

BTW - maybe it's time to reconsider the area concept. Maybe it
can be replaced by using different versions / workspaces. But
that would certainly require addressing, which ccould be done
in the same manner (lenya://pub/area/...). Actually it's only
a storage backend concern.


> A further improvement may be omitting the publication as well
> if you want to stay in the current publication. The url may
> look like this:
> 
>   lenya:/<area>/<doc-id>
> 
> e.g.
> 
>   lenya:/authoring/all
> 
> Note: only one / is used

OK, this certainly makes sense - but only if it is used in a context
that has been invoked by an HTTP request. Otherwise, an
"InvalidContextException" or something like that could be thrown.

> What do you think about the proposal?

IMO it is very useful. But I'm not quite sure if the publication
can be omitted (lenya:/area/...).

> At least, it helps us avoid a lot of typing ... :-)

Yes, and it avoids the redundant lenya/pubs prefix.
Can we rely on the fact that we will never want to write files
outside of publications? (I can't imagine a situation where this
would be required)

-- Andreas


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


Re: Using the Lenya RepositorySource within a publication sitemap

Posted by Felix Röthenbacher <fe...@wyona.com>.
Andreas Hartmann wrote:
> Michael Wechner wrote:
> 
>> Hi
>>
>> I am currently using the Lenya source as follows within the sitemap
>>
>> lenya://lenya/pubs/blog/content/authoring/feeds/all/index.xml
>>
>> But actually I would like to call it without the lenya/pubs/blog/content
>> prefix.
> 
> 
> This issue has been discussed some time ago. One original idea of
> the lenya:// protocol was that you can get rid of the content, area
> etc. stuff in source URIs.
> 
> Actually we started to implement it like this, but when the "shorthand"
> lenya:// URIs were used, a big problem occured:
> 
> When you call an internal pipeline which contains a URI like this
> from inside a usecase for an arbitrary document, the document belonging
> to the originally called page is read instead of the requested document.
> 
> For instance - imagine you traversing a document set and fetch some
> content from some internal pipeline. If this internal pipeline uses
> the shorthand URI (based on the page envelope) for source access, you
> end up with the content from a wrong document.
> 
> The problem is that shorthand URIs have to rely on context information,
> for instance the page envelope. This requires to set this context
> information for each request to such a URI, which requires great care
> (because it is implicit and happens in the background). That's why
> I'm against shorthand URIs.
> 
> Up to now, no solution was found to this problem.
> 
> -- Andras
> 

If I have a look at the lenya protocol, e.g.

lenya://lenya/pubs/blog/content/authoring/feeds/all/index.xml
         ^^^^^^^^^^      ^^^^^^^

the parts marked with ^ are used in a static fashion and may be
omitted. What do you think about using an abbreviated version of the
lenya protocol, like

   lenya://<publication>/<area>/<doc-id>

e.g.

   lenya://blog/authoring/feeds/all

A further improvement may be omitting the publication as well
if you want to stay in the current publication. The url may
look like this:

   lenya:/<area>/<doc-id>

e.g.

   lenya:/authoring/all

Note: only one / is used

What do you think about the proposal? At least, it helps us
avoid a lot of typing ... :-)

Cheers,

Felix


-- 
Felix Röthenbacher                  felix.roethenbacher@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

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


Re: Using the Lenya RepositorySource within a publication sitemap

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:
> Hi
> 
> I am currently using the Lenya source as follows within the sitemap
> 
> lenya://lenya/pubs/blog/content/authoring/feeds/all/index.xml
> 
> But actually I would like to call it without the lenya/pubs/blog/content
> prefix.

This issue has been discussed some time ago. One original idea of
the lenya:// protocol was that you can get rid of the content, area
etc. stuff in source URIs.

Actually we started to implement it like this, but when the "shorthand"
lenya:// URIs were used, a big problem occured:

When you call an internal pipeline which contains a URI like this
from inside a usecase for an arbitrary document, the document belonging
to the originally called page is read instead of the requested document.

For instance - imagine you traversing a document set and fetch some
content from some internal pipeline. If this internal pipeline uses
the shorthand URI (based on the page envelope) for source access, you
end up with the content from a wrong document.

The problem is that shorthand URIs have to rely on context information,
for instance the page envelope. This requires to set this context
information for each request to such a URI, which requires great care
(because it is implicit and happens in the background). That's why
I'm against shorthand URIs.

Up to now, no solution was found to this problem.

-- Andras


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