You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2006/03/07 16:49:57 UTC

Re: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/ java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

> +            String urlID = "content/" + document.getArea() + document.getId()
> +                            + "/" + DEFAULT_INDEX + "_"
> +                            + document.getLanguage() + ODT_EXTENSION;

:(

This code will break with a custom DocumentIdToPathMapper.
I agree that there's no clean way to do this ATM - but IMO it would
be a better workaround to use the extension .xml instead of .odt.

Maybe we find a way to allow resource type based mappers.
A solution would be to

- use a common syntax for meta data paths, independent from the mapper:
  /foo/bar.en.meta instead of /foo/bar/index_en.meta

- this way, we can determine the resource type without accessing
  the mapper

- the resource type can be asked for the path to read the document from
  (or maybe it is sufficient to ask the resource type for the
  file extension)

-- Andreas



--------------------------------------------------------------
Andreas Hartmann     andreas.hartmann@wyona.com +41 1 272 9161
                     Wyona AG, Hardstrasse 219, CH-8005 Zurich
Open Source CMS      http://www.wyona.org http://www.wyona.com
--------------------------------------------------------------

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


Re: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:
> Andreas Hartmann wrote:
> 
>> [...]
>>
>>  
>>
>>>> - the resource type can be asked for the path to read the document from
>>>>  (or maybe it is sufficient to ask the resource type for the
>>>>  file extension)
>>>>     
>>> I dunno understand, can you explain a bit more.
>>>   
>>
>> We have a circular dependency:
>>
>> - The resource type is stored in the meta data.
>> - The location of the meta data is determined by the DocIdToPathMapper.
>> - The DocIdToPathMapper should be determined by the resource type.
>>
>> That's why we have to break a dependency. The easiest one
>> to break is the dependency from the meta data location to
>> the DocIdToPathMapper. We could use a generic location for
>> meta files, without using the mapper. Just something like
>>
>>  {document-id}.{language}.meta
>>  
>>
> 
> why not have something like
> 
> .lenya/meta/{document-id}
> 
> whereas the ".lenya" would be configurable?

The best would be to use UUIDs, otherwise the meta data files
have to be moved when documents are move.

> (this path could also be used within a JCR repo)
>
> It seems to me that SVN shows how nicely this can be
> done and how clear it separates ones data from the managing
> system.

Good point. The hidden directories certainly make sense.

-- Andreas


-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


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


Re: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:
> Andreas Hartmann wrote:
> 
>> [...]
>>
>>  
>>
>>>> - the resource type can be asked for the path to read the document from
>>>>  (or maybe it is sufficient to ask the resource type for the
>>>>  file extension)
>>>>     
>>> I dunno understand, can you explain a bit more.
>>>   
>>
>> We have a circular dependency:
>>
>> - The resource type is stored in the meta data.
>> - The location of the meta data is determined by the DocIdToPathMapper.
>> - The DocIdToPathMapper should be determined by the resource type.
>>
>> That's why we have to break a dependency. The easiest one
>> to break is the dependency from the meta data location to
>> the DocIdToPathMapper. We could use a generic location for
>> meta files, without using the mapper. Just something like
>>
>>  {document-id}.{language}.meta
>>  
>>
> 
> why not have something like
> 
> .lenya/meta/{document-id}
> 
> whereas the ".lenya" would be configurable?
> (this path could also be used within a JCR repo)

Just FYI: The JCRSourceNode uses JCR properties to store the
meta data, so no special path is needed.

-- Andreas



-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


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


Re: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

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

>[...]
>
>  
>
>>>- the resource type can be asked for the path to read the document from
>>>  (or maybe it is sufficient to ask the resource type for the
>>>  file extension)
>>>      
>>>
>>I dunno understand, can you explain a bit more.
>>    
>>
>
>We have a circular dependency:
>
>- The resource type is stored in the meta data.
>- The location of the meta data is determined by the DocIdToPathMapper.
>- The DocIdToPathMapper should be determined by the resource type.
>
>That's why we have to break a dependency. The easiest one
>to break is the dependency from the meta data location to
>the DocIdToPathMapper. We could use a generic location for
>meta files, without using the mapper. Just something like
>
>  {document-id}.{language}.meta
>  
>

why not have something like

.lenya/meta/{document-id}

whereas the ".lenya" would be configurable?
(this path could also be used within a JCR repo)

It seems to me that SVN shows how nicely this can be
done and how clear it separates ones data from the managing
system.

Michi

>This way, we can
>
>- read the meta file
>- determine the resource type
>- call resourceType.getPathMapper().getPath(document)
>
>which will return /foo/bar/index_en.odt for the ODT resource type.
>
>-- Andreas
>
>--------------------------------------------------------------
>Andreas Hartmann     andreas.hartmann@wyona.com +41 1 272 9161
>                     Wyona AG, Hardstrasse 219, CH-8005 Zurich
>Open Source CMS      http://www.wyona.org http://www.wyona.com
>--------------------------------------------------------------
>
>---------------------------------------------------------------------
>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: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

Posted by Andreas Hartmann <an...@apache.org>.
[...]

>> - the resource type can be asked for the path to read the document from
>>   (or maybe it is sufficient to ask the resource type for the
>>   file extension)
>
> I dunno understand, can you explain a bit more.

We have a circular dependency:

- The resource type is stored in the meta data.
- The location of the meta data is determined by the DocIdToPathMapper.
- The DocIdToPathMapper should be determined by the resource type.

That's why we have to break a dependency. The easiest one
to break is the dependency from the meta data location to
the DocIdToPathMapper. We could use a generic location for
meta files, without using the mapper. Just something like

  {document-id}.{language}.meta

This way, we can

- read the meta file
- determine the resource type
- call resourceType.getPathMapper().getPath(document)

which will return /foo/bar/index_en.odt for the ODT resource type.

-- Andreas

--------------------------------------------------------------
Andreas Hartmann     andreas.hartmann@wyona.com +41 1 272 9161
                     Wyona AG, Hardstrasse 219, CH-8005 Zurich
Open Source CMS      http://www.wyona.org http://www.wyona.com
--------------------------------------------------------------

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


Re: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/ java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler wrote:
> El jue, 09-03-2006 a las 09:58 +0100, Andreas Hartmann escribió:
>> Thorsten Scherler wrote:
>>
>> [...]
>>
>>>> btw, you might just want to improve the line above by using the lenya 
>>>> protocol, etc. ;-)
>>> Well http://lenya.apache.org/1_4/reference/protocols/lenya.html
>>> "The resolution of the URI is based on the context: protocol handler."
>>> so not an option.
>> That's not the whole story. The lenya:// protocol just points to respository
>> nodes. Whether the nodes use context:// sources, or JCR nodes, or whatever,
>> depends on the NodeFactory you use.
>>
> 
> Does that mean that I can get with 
> Node node = getRepositoryNode(destination);
> node.lock();
> any given destination uri?

I don't quite understand what you mean with "destination URI" ...
You can access all nodes which are provided by the NodeFactory.

[...]

>>> Further it does not solve the "custom DocumentIdToPathMapper" problem.
>> Yes, which is the root of all evil in this issue. We have to solve it,
>> then the problems will vanish.
> 
> Ok, then we should start the meta data stuff.

+1

-- Andreas

-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


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


Re: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/ java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

Posted by Thorsten Scherler <th...@apache.org>.
El jue, 09-03-2006 a las 09:58 +0100, Andreas Hartmann escribió:
> Thorsten Scherler wrote:
> 
> [...]
> 
> >> btw, you might just want to improve the line above by using the lenya 
> >> protocol, etc. ;-)
> > 
> > Well http://lenya.apache.org/1_4/reference/protocols/lenya.html
> > "The resolution of the URI is based on the context: protocol handler."
> > so not an option.
> 
> That's not the whole story. The lenya:// protocol just points to respository
> nodes. Whether the nodes use context:// sources, or JCR nodes, or whatever,
> depends on the NodeFactory you use.
> 

Does that mean that I can get with 
Node node = getRepositoryNode(destination);
node.lock();
any given destination uri?

> 
> > lenya-doc http://lenya.apache.org/1_4/reference/protocols/lenyadoc.html
> > is assuming file extension xml as far as I understand it ATM, so not an
> > option.
> 
> That's only because the DocumentIdToPathMapper is tied to the publication
> and not to the resource type. We have already discussed that.

ok

> 
> > One could extend the above protocols though (I think best would be the
> > lenya-doc). The only protocol that I made aware of the content-dir is
> > the fallback:// but it feels like an abuse to use it to get content.
> 
> This is true. Please don't use it!

;)


> > Further it does not solve the "custom DocumentIdToPathMapper" problem.
> 
> Yes, which is the root of all evil in this issue. We have to solve it,
> then the problems will vanish.

Ok, then we should start the meta data stuff.

> -- Andreas
> 

Thanks for your feedback. :)

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


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


Re: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/ java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler wrote:

[...]

>> btw, you might just want to improve the line above by using the lenya 
>> protocol, etc. ;-)
> 
> Well http://lenya.apache.org/1_4/reference/protocols/lenya.html
> "The resolution of the URI is based on the context: protocol handler."
> so not an option.

That's not the whole story. The lenya:// protocol just points to respository
nodes. Whether the nodes use context:// sources, or JCR nodes, or whatever,
depends on the NodeFactory you use.


> lenya-doc http://lenya.apache.org/1_4/reference/protocols/lenyadoc.html
> is assuming file extension xml as far as I understand it ATM, so not an
> option.

That's only because the DocumentIdToPathMapper is tied to the publication
and not to the resource type. We have already discussed that.


> One could extend the above protocols though (I think best would be the
> lenya-doc). The only protocol that I made aware of the content-dir is
> the fallback:// but it feels like an abuse to use it to get content.

This is true. Please don't use it!


> Further it does not solve the "custom DocumentIdToPathMapper" problem.

Yes, which is the root of all evil in this issue. We have to solve it,
then the problems will vanish.

-- Andreas

-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


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


Re: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/ java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

Posted by Thorsten Scherler <th...@wyona.com>.
El mié, 08-03-2006 a las 00:42 +0100, Michael Wechner escribió:
> Thorsten Scherler wrote:
> 
> >El mar, 07-03-2006 a las 17:00 +0100, Thorsten Scherler escribió:
> >  
> >
> >>El mar, 07-03-2006 a las 16:49 +0100, Andreas Hartmann escribió:
> >>    
> >>
> >>>>+            String urlID = "content/" + document.getArea() + document.getId()
> >>>>+                            + "/" + DEFAULT_INDEX + "_"
> >>>>+                            + document.getLanguage() + ODT_EXTENSION;
> >>>>        
> >>>>
> >>>:(
> >>>
> >>>This code will break with a custom DocumentIdToPathMapper.
> >>>      
> >>>
> >>Yeah, I know. :(
> >>    
> >>
> >
> >BTW that is not the only part of this module. Like I said in the other
> >thread you can find in lenya-trunk/src/modules/opendocument/sitemap.xmap
> > <map:generate
> >src="zip:context://lenya/pubs/{page-envelope:publication-id}/content/{page-envelope:area}/{page-envelope:document-id}/index_{page-envelope:document-language}.odt!/content.xml"/>
> >
> >You are right, that does not make the above code better but since the
> >usages is already limited I just used this knowledge. ;)
> >  
> >
> 
> btw, you might just want to improve the line above by using the lenya 
> protocol, etc. ;-)

Well http://lenya.apache.org/1_4/reference/protocols/lenya.html
"The resolution of the URI is based on the context: protocol handler."
so not an option.

lenya-doc http://lenya.apache.org/1_4/reference/protocols/lenyadoc.html
is assuming file extension xml as far as I understand it ATM, so not an
option.

One could extend the above protocols though (I think best would be the
lenya-doc). The only protocol that I made aware of the content-dir is
the fallback:// but it feels like an abuse to use it to get content.
Further it does not solve the "custom DocumentIdToPathMapper" problem.

I will have a closer look now on the lenya-doc.

salu2
-- 
Thorsten Scherler
COO Spain
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org


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


Re: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/ java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

Posted by Michael Wechner <mi...@wyona.com>.
Thorsten Scherler wrote:

>El mar, 07-03-2006 a las 17:00 +0100, Thorsten Scherler escribió:
>  
>
>>El mar, 07-03-2006 a las 16:49 +0100, Andreas Hartmann escribió:
>>    
>>
>>>>+            String urlID = "content/" + document.getArea() + document.getId()
>>>>+                            + "/" + DEFAULT_INDEX + "_"
>>>>+                            + document.getLanguage() + ODT_EXTENSION;
>>>>        
>>>>
>>>:(
>>>
>>>This code will break with a custom DocumentIdToPathMapper.
>>>      
>>>
>>Yeah, I know. :(
>>    
>>
>
>BTW that is not the only part of this module. Like I said in the other
>thread you can find in lenya-trunk/src/modules/opendocument/sitemap.xmap
> <map:generate
>src="zip:context://lenya/pubs/{page-envelope:publication-id}/content/{page-envelope:area}/{page-envelope:document-id}/index_{page-envelope:document-language}.odt!/content.xml"/>
>
>You are right, that does not make the above code better but since the
>usages is already limited I just used this knowledge. ;)
>  
>

btw, you might just want to improve the line above by using the lenya 
protocol, etc. ;-)

Michi

>salu2
>  
>


-- 
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: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/ java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

Posted by Thorsten Scherler <th...@wyona.com>.
El mar, 07-03-2006 a las 17:00 +0100, Thorsten Scherler escribió:
> El mar, 07-03-2006 a las 16:49 +0100, Andreas Hartmann escribió:
> > > +            String urlID = "content/" + document.getArea() + document.getId()
> > > +                            + "/" + DEFAULT_INDEX + "_"
> > > +                            + document.getLanguage() + ODT_EXTENSION;
> > 
> > :(
> > 
> > This code will break with a custom DocumentIdToPathMapper.
> 
> Yeah, I know. :(

BTW that is not the only part of this module. Like I said in the other
thread you can find in lenya-trunk/src/modules/opendocument/sitemap.xmap
 <map:generate
src="zip:context://lenya/pubs/{page-envelope:publication-id}/content/{page-envelope:area}/{page-envelope:document-id}/index_{page-envelope:document-language}.odt!/content.xml"/>

You are right, that does not make the above code better but since the
usages is already limited I just used this knowledge. ;)

salu2
-- 
Thorsten Scherler
COO Spain
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org


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


Re: svn commit: r383910 - in /lenya/trunk/src/modules/opendocument:config/cocoon-xconf/ config/menus/ java/ java/src/ java/src/org/java/src/org/apache/ java/src/org/apache/lenya/java/src/org/apache/lenya/cms/ java/src/org/apache/lenya/cms/site/java/src...

Posted by Thorsten Scherler <th...@wyona.com>.
El mar, 07-03-2006 a las 16:49 +0100, Andreas Hartmann escribió:
> > +            String urlID = "content/" + document.getArea() + document.getId()
> > +                            + "/" + DEFAULT_INDEX + "_"
> > +                            + document.getLanguage() + ODT_EXTENSION;
> 
> :(
> 
> This code will break with a custom DocumentIdToPathMapper.

Yeah, I know. :(

> I agree that there's no clean way to do this ATM - but IMO it would
> be a better workaround to use the extension .xml instead of .odt.

Hmm, the problem is that you cannot create the document (even with .xml)
since we assume a sample (in xml) in the DefaultCreator.java. 

I could rewrite this part to Input/OutputStream, but I am unsure whether
that is the way to go.

> Maybe we find a way to allow resource type based mappers.
> A solution would be to
> 
> - use a common syntax for meta data paths, independent from the mapper:
>   /foo/bar.en.meta instead of /foo/bar/index_en.meta

hmm, I am all for a flat but that will cause confusion if the doc would
still resist in /foo/bar/index_en.xml.

> 
> - this way, we can determine the resource type without accessing
>   the mapper

yeah.

> - the resource type can be asked for the path to read the document from
>   (or maybe it is sufficient to ask the resource type for the
>   file extension)

I dunno understand, can you explain a bit more.

TIA

salu2
-- 
Thorsten Scherler
COO Spain
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org


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