You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Thorsten Scherler <th...@wyona.com> on 2006/03/10 12:45:42 UTC

Re: svn commit: r384556

El jue, 09-03-2006 a las 16:56 +0000, andreas@apache.org escribió:
> Author: andreas
> Date: Thu Mar  9 08:56:01 2006
> New Revision: 384556
> 
> URL: http://svn.apache.org/viewcvs?rev=384556&view=rev
> Log:
> Add extension attribute to LenyaMetaData. This way, the extension can be accessed by the DocumentIdToPathMapper - this allows custom source extensions (like .odt, ...) and is a first step towards handling assets and documents in the same way.
> 
> Modified:
...
>     lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java
...

> Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java
> URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java?rev=384556&r1=384555&r2=384556&view=diff
> ==============================================================================
> --- lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java (original)
> +++ lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java Thu Mar  9 08:56:01 2006
> @@ -115,7 +115,8 @@
>  
...
> @@ -331,7 +346,9 @@
>              RepositorySource source = null;
>              try {
>                  resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
> -                source = (RepositorySource) resolver.resolveURI(getSourceURI());
> +                String sourceUri = getPublication().getSourceURI() + "/content/" + getArea()
> +                        + getId() + "/index_" + getLanguage() + ".xml";
> +                source = (RepositorySource) resolver.resolveURI(sourceUri);
>                  this.metaDataManager = source.getNode().getMetaDataManager();
>              } catch (Exception e) {
>                  throw new RuntimeException(e);

This code change is not compatible with custom mapping. 

We need use the Mapper to lookup the sourceURI.

I will try to fix it right now.

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: r384556

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler wrote:
> El vie, 10-03-2006 a las 14:25 +0100, Andreas Hartmann escribió:
>> Thorsten Scherler wrote:
>>
>> [...]
>>
>>>>> Yeah, to move the meta to
>>>>> lenya://lenya/pubs/myPub/content/authoring/index/index_en.xml.meta but
>>>>> that does make 0% sense for custom mapping if I want this location I
>>>>> would not write a custom mapper.
>>>> The hard-coded location applies only to the meta sources.
>>>> The location of the actual document sources is determined by
>>>> your custom DocumentIdToPathMapper.
>>>>
>>> Well the problem is now with my pub that you cannot create any pages
>>> anymore because the meta data file will be written to a different
>>> location then I need.
>> That's very strange. Do you access the meta data files directly?
> 
> No, it happends in the DocumentManagerImpl.java. When add() is called.
> 
> We have now 2 *different* ids when we use custom mapping.

You're right :(

The problem is in SourceNode:

     protected String getMetaSourceURI() {
         return getSourceURI() + ".meta";
     }

That won't work.
I'll take a look.

-- 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: r384556

Posted by Thorsten Scherler <th...@apache.org>.
El vie, 10-03-2006 a las 14:25 +0100, Andreas Hartmann escribió:
> Thorsten Scherler wrote:
> 
> [...]
> 
> >>> Yeah, to move the meta to
> >>> lenya://lenya/pubs/myPub/content/authoring/index/index_en.xml.meta but
> >>> that does make 0% sense for custom mapping if I want this location I
> >>> would not write a custom mapper.
> >> The hard-coded location applies only to the meta sources.
> >> The location of the actual document sources is determined by
> >> your custom DocumentIdToPathMapper.
> >>
> > 
> > Well the problem is now with my pub that you cannot create any pages
> > anymore because the meta data file will be written to a different
> > location then I need.
> 
> That's very strange. Do you access the meta data files directly?

No, it happends in the DocumentManagerImpl.java. When add() is called.

We have now 2 *different* ids when we use custom mapping.

salu2

> 
> -- Andreas
> 
> 
> 
-- 
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: r384556

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

[...]

>>> Yeah, to move the meta to
>>> lenya://lenya/pubs/myPub/content/authoring/index/index_en.xml.meta but
>>> that does make 0% sense for custom mapping if I want this location I
>>> would not write a custom mapper.
>> The hard-coded location applies only to the meta sources.
>> The location of the actual document sources is determined by
>> your custom DocumentIdToPathMapper.
>>
> 
> Well the problem is now with my pub that you cannot create any pages
> anymore because the meta data file will be written to a different
> location then I need.

That's very strange. Do you access the meta data files directly?

-- 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: r384556

Posted by Thorsten Scherler <th...@apache.org>.
El vie, 10-03-2006 a las 13:41 +0100, Andreas Hartmann escribió:
> Thorsten Scherler wrote:
> > El vie, 10-03-2006 a las 13:13 +0100, Andreas Hartmann escribió:
> >> Thorsten Scherler wrote:
> >>
> >> [...]
> >>
> >>> ...
> >>>> @@ -331,7 +346,9 @@
> >>>>              RepositorySource source = null;
> >>>>              try {
> >>>>                  resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
> >>>> -                source = (RepositorySource) resolver.resolveURI(getSourceURI());
> >>>> +                String sourceUri = getPublication().getSourceURI() + "/content/" + getArea()
> >>>> +                        + getId() + "/index_" + getLanguage() + ".xml";
> >>>> +                source = (RepositorySource) resolver.resolveURI(sourceUri);
> >>>>                  this.metaDataManager = source.getNode().getMetaDataManager();
> >>>>              } catch (Exception e) {
> >>>>                  throw new RuntimeException(e);
> >>> This code change is not compatible with custom mapping.
> >> It is compatible. You just have to move your meta files once.
> > 
> > ¿?
> > 
> > The above string is looking up:
> > lenya://lenya/pubs/myPub/content/authoring/index/index_en.xml
> > 
> > Yeah, to move the meta to
> > lenya://lenya/pubs/myPub/content/authoring/index/index_en.xml.meta but
> > that does make 0% sense for custom mapping if I want this location I
> > would not write a custom mapper.
> 
> The hard-coded location applies only to the meta sources.
> The location of the actual document sources is determined by
> your custom DocumentIdToPathMapper.
> 

Well the problem is now with my pub that you cannot create any pages
anymore because the meta data file will be written to a different
location then I need.

:(

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: r384556

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler wrote:
> El vie, 10-03-2006 a las 13:13 +0100, Andreas Hartmann escribió:
>> Thorsten Scherler wrote:
>>
>> [...]
>>
>>> ...
>>>> @@ -331,7 +346,9 @@
>>>>              RepositorySource source = null;
>>>>              try {
>>>>                  resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
>>>> -                source = (RepositorySource) resolver.resolveURI(getSourceURI());
>>>> +                String sourceUri = getPublication().getSourceURI() + "/content/" + getArea()
>>>> +                        + getId() + "/index_" + getLanguage() + ".xml";
>>>> +                source = (RepositorySource) resolver.resolveURI(sourceUri);
>>>>                  this.metaDataManager = source.getNode().getMetaDataManager();
>>>>              } catch (Exception e) {
>>>>                  throw new RuntimeException(e);
>>> This code change is not compatible with custom mapping.
>> It is compatible. You just have to move your meta files once.
> 
> ¿?
> 
> The above string is looking up:
> lenya://lenya/pubs/myPub/content/authoring/index/index_en.xml
> 
> Yeah, to move the meta to
> lenya://lenya/pubs/myPub/content/authoring/index/index_en.xml.meta but
> that does make 0% sense for custom mapping if I want this location I
> would not write a custom mapper.

The hard-coded location applies only to the meta sources.
The location of the actual document sources is determined by
your custom DocumentIdToPathMapper.


> We need to change this ASAP. I recommend to create a meta data dir (like
> mentioned from others as well) and get the metada from there.

This is fine with me. I just used the behavior of the
DefaultDocumentIdToPathMapper for the moment so that most people don't
have to migrate their meta files to a new location.


>>> We need use the Mapper to lookup the sourceURI.
>> No, you can't use the mapper, because the mapper has to access the
>> document source extension. But this would require access to the meta
>> data. You'll end up with a StackOverflowError. I already mentioned
>> this problem a couple of times.
>>
> 
> Yeah, I just found out myself. ;)

:)

-- 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: r384556

Posted by Thorsten Scherler <th...@wyona.com>.
El vie, 10-03-2006 a las 13:13 +0100, Andreas Hartmann escribió:
> Thorsten Scherler wrote:
> 
> [...]
> 
> > ...
> >> @@ -331,7 +346,9 @@
> >>              RepositorySource source = null;
> >>              try {
> >>                  resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
> >> -                source = (RepositorySource) resolver.resolveURI(getSourceURI());
> >> +                String sourceUri = getPublication().getSourceURI() + "/content/" + getArea()
> >> +                        + getId() + "/index_" + getLanguage() + ".xml";
> >> +                source = (RepositorySource) resolver.resolveURI(sourceUri);
> >>                  this.metaDataManager = source.getNode().getMetaDataManager();
> >>              } catch (Exception e) {
> >>                  throw new RuntimeException(e);
> > 
> > This code change is not compatible with custom mapping.
> 
> It is compatible. You just have to move your meta files once.

¿?

The above string is looking up:
lenya://lenya/pubs/myPub/content/authoring/index/index_en.xml

Yeah, to move the meta to
lenya://lenya/pubs/myPub/content/authoring/index/index_en.xml.meta but
that does make 0% sense for custom mapping if I want this location I
would not write a custom mapper.

We need to change this ASAP. I recommend to create a meta data dir (like
mentioned from others as well) and get the metada from there.

> 
> 
> > We need use the Mapper to lookup the sourceURI.
> 
> No, you can't use the mapper, because the mapper has to access the
> document source extension. But this would require access to the meta
> data. You'll end up with a StackOverflowError. I already mentioned
> this problem a couple of times.
> 

Yeah, I just found out myself. ;)

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: r384556

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

[...]

> ...
>> @@ -331,7 +346,9 @@
>>              RepositorySource source = null;
>>              try {
>>                  resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
>> -                source = (RepositorySource) resolver.resolveURI(getSourceURI());
>> +                String sourceUri = getPublication().getSourceURI() + "/content/" + getArea()
>> +                        + getId() + "/index_" + getLanguage() + ".xml";
>> +                source = (RepositorySource) resolver.resolveURI(sourceUri);
>>                  this.metaDataManager = source.getNode().getMetaDataManager();
>>              } catch (Exception e) {
>>                  throw new RuntimeException(e);
> 
> This code change is not compatible with custom mapping.

It is compatible. You just have to move your meta files once.


> We need use the Mapper to lookup the sourceURI.

No, you can't use the mapper, because the mapper has to access the
document source extension. But this would require access to the meta
data. You'll end up with a StackOverflowError. I already mentioned
this problem a couple of times.

-- 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