You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by bu...@apache.org on 2007/05/31 17:43:53 UTC

DO NOT REPLY [Bug 42558] New: - [Patch] lenya.properties.xml per publication

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558

           Summary: [Patch] lenya.properties.xml per publication
           Product: Lenya
           Version: 1.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Miscellaneous
        AssignedTo: dev@lenya.apache.org
        ReportedBy: mangst@inventec.ch


Make it possible to use lenya.properties.xml per publication, in addition to the
existing places (Lenya, modules). The precedence order is:

1. Publication
2. Lenya local
3. Modules
4. Lenya

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From mangst@inventec.ch  2007-08-21 13:20 -------
Just realized that I made a really stupid mistake: I replied to some of the
above posts on the dev mailing list instead of bugzilla. Really silly. I
apologize for this.

The state of this issue is as follows:

1.0

The publication properties cannot be read in the initialization phase. At least
I don't know how. The approach with

Request request = contextUtility.getRequest();
DocumentFactory factory = DocumentUtil.getDocumentFactory(serviceManager, request);
Publication[] pubs = publicationManager.getPublications(factory);

cannot be used in the initialization phase. You get "Unable to get the request
object from the context" when you try it. Being able to call
publicationManager.getPublications() without the factory parameter could maybe
help, but this doesn't seem to be possible unless some of the recent changes of
Andreas have changed this.

1.1

This leads to the workaround with loadPublicationPropertiesIfNotDone, called
from all get* methods which circumvents the problem by lazy loading the
publication properties.

1.2

This in turn led to the question if this could cause synchronization problems. I
don't think calling loadPublicationPropertiesIfNotDone twice in parallel would
be very dangerous but I am not fit enough to judge this.

2.0

J�rn suggested to (re-)use aggregating fallback for properties of templated
publications.

2.1

I found AggregatingFallbackSourceFactory which provides the protocol called
"aggregate-fallback://". I think to be able to reuse it some of the code of
getSource would have to be refactored. I am not able to do this myself without
help. If anybody with a better understanding of the big picture could have a
look at it and tell me if this is the right way to go i would give it a try.
(There are some similarities in code with FallbackSourceFactory.getSource, so
maybe this would have to be taken into account as well.)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558


andreas@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|2.0                         |2.0.1




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From nettings@apache.org  2007-07-30 23:01 -------
(In reply to comment #3)
> Created an attachment (id=20569)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20569&action=view) [edit]
> Patch for enhancement described below, second version
> 
> Just tried another one. I don't know if in loadPublicationPropertiesIfNotDone
> 
> - the avalon stuff is handled correctly (does the publication have to be
> released?)

iiuc, you're not dealing with avalon components directly (PublicationUtil does
it for you). so you should be fine.
 
> - there could be synchronization issues or if the ThreadSafe implementation of
> PropertiesModule takes already care of this
 
not sure about this. someone else should look at it. anyone?

anyway, i think this is a very useful addition, and i'm +1 for adding it.



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From mangst@inventec.ch  2007-10-25 12:02 -------
I put a documentation draft on the wiki:
http://wiki.apache.org/lenya/LenyaProperties?action=show. It is open for
discussion. Comments and edits welcome.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Re: DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by Markus Angst <ma...@inventec.ch>.
> ------- Additional Comments From thorsten@apache.org  2007-08-02 13:54 -------
> (In reply to comment #3)
>> Created an attachment (id=20569)
>  --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20569&action=view) [edit]
>> Patch for enhancement described below, second version
>>
>> Just tried another one. I don't know if in loadPublicationPropertiesIfNotDone
>>
>> - the avalon stuff is handled correctly (does the publication have to be
>> released?)
> 
> No, you need to release all components that you looked up with
> manager.lookup(...) AFAIR. So it is good as gold.

I see. Thanks for clarifying this.

>> - there could be synchronization issues or if the ThreadSafe implementation of
>> PropertiesModule takes already care of this
> 
> Why do you think of synchronization issues? > 

I saw this ThreadSafe implementation of PropertiesModule and i thought it is
there for a reason but i really don't understand enough of all this avalon stuff
atm so i thought i'd better ask just to make sure :-)

Regards,
Markus Angst

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From thorsten@apache.org  2007-08-02 13:54 -------
(In reply to comment #3)
> Created an attachment (id=20569)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20569&action=view) [edit]
> Patch for enhancement described below, second version
> 
> Just tried another one. I don't know if in loadPublicationPropertiesIfNotDone
> 
> - the avalon stuff is handled correctly (does the publication have to be
> released?)

No, you need to release all components that you looked up with
manager.lookup(...) AFAIR. So it is good as gold.

> 
> - there could be synchronization issues or if the ThreadSafe implementation of
> PropertiesModule takes already care of this

Why do you think of synchronization issues? > 



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From mangst@inventec.ch  2007-05-31 08:46 -------
Created an attachment (id=20301)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20301&action=view)
Patch for enhancement described above


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Re: DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by Markus Angst <ma...@inventec.ch>.
> http://issues.apache.org/bugzilla/show_bug.cgi?id=42558
> 
> ------- Additional Comments From thorsten@apache.org  2007-08-03 03:45 -------
> (In reply to comment #10)
>> (In reply to comment #7)
>>>> - there could be synchronization issues or if the ThreadSafe implementation of
>>>> PropertiesModule takes already care of this
>>> Why do you think of synchronization issues?
>> Because on should always think about synchronization issues :)
>> But at a first glance the module doesn't change its state (or the state of
>> another object) after the initialization, so this should be fine.
>>
> 
> (see comment #9)
>> One thing that I do not like too much is the 
>> loadPublicationPropertiesIfNotDone
>> not been done in initialize().
> 
> Now I understand the synchronization issues. The module changes state with the
> getAtribute!

Yes. I didn't find a better solution. See my response(s) to Thorsten for more
detail.

Regards,
Markus Angst


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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From thorsten@apache.org  2007-08-03 03:45 -------
(In reply to comment #10)
> (In reply to comment #7)
> >> - there could be synchronization issues or if the ThreadSafe implementation of
> >> PropertiesModule takes already care of this
> > 
> > Why do you think of synchronization issues?
> 
> Because on should always think about synchronization issues :)
> But at a first glance the module doesn't change its state (or the state of
> another object) after the initialization, so this should be fine.
> 

(see comment #9)
> One thing that I do not like too much is the 
> loadPublicationPropertiesIfNotDone
> not been done in initialize().

Now I understand the synchronization issues. The module changes state with the
getAtribute!

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From nettings@apache.org  2007-07-30 22:50 -------
(In reply to comment #4)
> I see two solutions:
> 
> - modules and publications have to use name prefixes
> 
> - properties have to be saved (and may only be read) together with an "owner id"

i think we should make prefixes mandatory: for modules, it should be
<module-name>.your.property. for publications, it could be
<pub-id>.your.property, but i guess we should leave the choice to the admin.
users may also want to overload global properties...

plus we need to find out and document really well in which order properties are
loaded and how to override them.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558


thorsten@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Additional Comments From thorsten@apache.org  2007-08-02 15:05 -------
One thing that I do not like too much is the 
loadPublicationPropertiesIfNotDone
not been done in initialize().

ATM I am unsure how to do it myself maybe Andreas has an idea. 

If not I will apply the patch within the next 72 hours.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From andreas@apache.org  2007-08-03 01:10 -------
(In reply to comment #10)

> Because on should

That should read "one", sorry.



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558


mangst@inventec.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #20301|0                           |1
        is obsolete|                            |




------- Additional Comments From mangst@inventec.ch  2007-07-30 13:41 -------
Created an attachment (id=20569)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20569&action=view)
Patch for enhancement described below, second version

Just tried another one. I don't know if in loadPublicationPropertiesIfNotDone

- the avalon stuff is handled correctly (does the publication have to be
released?)

- there could be synchronization issues or if the ThreadSafe implementation of
PropertiesModule takes already care of this


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From andreas@apache.org  2007-08-03 01:09 -------
(In reply to comment #7)

>> 
>> - there could be synchronization issues or if the ThreadSafe implementation of
>> PropertiesModule takes already care of this
> 
> Why do you think of synchronization issues?

Because on should always think about synchronization issues :)
But at a first glance the module doesn't change its state (or the state of
another object) after the initialization, so this should be fine.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558


thorsten@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|1.4                         |2.0
            Version|1.4                         |2.0




------- Additional Comments From thorsten@apache.org  2007-07-16 01:58 -------
Renaming Lenya 1.4 to 2.0

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558


thorsten@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From thorsten@apache.org  2007-08-23 00:17 -------
Committed revision 568857.

I as well added a sample to the default pub in revision 568859.

There are still some issues to solve regarding the documentation (we do not have
any).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From mangst@inventec.ch  2007-07-30 14:05 -------
In initialize() the properties of all modules are collected during the Cocoon
components initialization phase regardless of the publications referencing them.
These references are probably unknown at this point, but I think this should be
documented because it can lead to property name conflicts between modules. The
same holds true for the publication properties. The way I implemented them a
publication should not use properties of another publication, is not even
guaranteed to see them and name conflicts could occur as well (not to mention
publication templating). 

I see two solutions:

- modules and publications have to use name prefixes

- properties have to be saved (and may only be read) together with an "owner id"


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Re: DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by Markus Angst <ma...@inventec.ch>.
Markus Angst wrote:
> Jörn Nettingsmeier wrote:

...

>> will template publications be taken into account? if so, we should mimic 
>> (or better yet, re-use) an aggregating fallback behaviour with 
>> last-one-wins as described above. 
> 
> Good point.
> 
>> are you doing that already?
> 
> Not that i am aware of, but i will have to check.

I think aggregating fallback is not done yet. I found
AggregatingFallbackSourceFactory which provides the protocol called
"aggregate-fallback://". I think to be able to reuse it some of the code of
getSource would have to be refactored or whatever. But this is only a wild guess
and i am not able to do this myself without help. If anybody with a better
understanding of the big picture could have a look at it and tell me if this is
the right way to go i would give it a try.

There are some similarities in code with FallbackSourceFactory.getSource, so
maybe this would have to be taken into account as well but as i said i do not
understand enough of all this, so i will keep quiet now... :-)

Thanks!
Markus Angst

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


Re: DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by Markus Angst <ma...@inventec.ch>.
Jörn Nettingsmeier wrote:
> Markus Angst wrote:
>> Jörn Nettingsmeier wrote:
>>> but the publication should be *able* to override anything, right? 
>> The idea was that a command line property should be able to override even a
>> publication property, but i don't have very strong feelings about this
>> particular issue.
> 
> makes sense imho. i hadn't really thought of command line properties, 
> but yes, they should be the mostest mightiest.
> 
>>> so it ought to be at the beginning if the parsing follows "first one wins".
>> Regarding the point in time the publication properties are read in last (if
>> nobody else finds a better solution) so the order of precedence has to be kept
>> artificially by applying some magic (like leaving alone some properties with
>> particular name prefixes and overwriting others...).
> 
> ok, so then forget my remark about parsing order. it's "order of 
> precedence" then, which could be accomplished by
> if (property) {
>    remove(property);
>    add(property,otherSource);
> }

Yes. That's already done for system and publication properties (in
overwriteProperty()) but because the system properties are processed in
initialize() and the publication properties are lazy loaded - well just as i
write this i realize that this could probably be simplified by lazy loading the
system properties, too.

> i don't think prefixes should have an impact on whether a property can 
> be overridden. they should just be there to avoid *accidetal* overriding 
> when names clash.

I agree. Lazy loading the system properties would eliminate the magic i
mentioned above.

> i'm a little confused about some things:
> can there be a lenya.properties in the core (i.e. under webapp/lenya)?

Yes, there is one under webapp. It is even used, it contains a property of
arguable usefulness called

<property name="pubs.default.author" value="the Lenya community"/>,

which is used when creating a new document. Take the file away and Lenya will
complain. :-)

> can there be one lenya.properties per publication? 

Yes, that is the idea of the patch.

> or does that have to be local.lenya.properties? 

No. I think one properties file per publication would be enough.

> will template publications be taken into account? if so, we should mimic 
> (or better yet, re-use) an aggregating fallback behaviour with 
> last-one-wins as described above. 

Good point.

> are you doing that already?

Not that i am aware of, but i will have to check.

Thanks!
Markus Angst

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


Re: DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by Jörn Nettingsmeier <ne...@apache.org>.
Markus Angst wrote:
> Jörn Nettingsmeier wrote:
>> but the publication should be *able* to override anything, right? 
> 
> The idea was that a command line property should be able to override even a
> publication property, but i don't have very strong feelings about this
> particular issue.

makes sense imho. i hadn't really thought of command line properties, 
but yes, they should be the mostest mightiest.

>> so it ought to be at the beginning if the parsing follows "first one wins".
> 
> Regarding the point in time the publication properties are read in last (if
> nobody else finds a better solution) so the order of precedence has to be kept
> artificially by applying some magic (like leaving alone some properties with
> particular name prefixes and overwriting others...).

ok, so then forget my remark about parsing order. it's "order of 
precedence" then, which could be accomplished by
if (property) {
   remove(property);
   add(property,otherSource);
}
i don't think prefixes should have an impact on whether a property can 
be overridden. they should just be there to avoid *accidetal* overriding 
when names clash.

i'm a little confused about some things:
can there be a lenya.properties in the core (i.e. under webapp/lenya)?
can there be one lenya.properties per publication? or does that have to 
be local.lenya.properties? if so, why?
will template publications be taken into account? if so, we should mimic 
(or better yet, re-use) an aggregating fallback behaviour with 
last-one-wins as described above. are you doing that already?

thanks,

jörn



-- 
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: DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by Markus Angst <ma...@inventec.ch>.
Jörn Nettingsmeier wrote:
> Markus Angst wrote:
>>> ------- Additional Comments From thorsten@apache.org  2007-08-02 14:08 -------
>>> (In reply to comment #5)
>>>> (In reply to comment #4)
>>>>> I see two solutions:
>>>>>
>>>>> - modules and publications have to use name prefixes
>>>>>
>>>>> - properties have to be saved (and may only be read) together with an "owner id"
>>>> i think we should make prefixes mandatory: for modules, it should be
>>>> <module-name>.your.property. for publications, it could be
>>>> <pub-id>.your.property, but i guess we should leave the choice to the admin.
>>>> users may also want to overload global properties...
>>>>
>>> I am as well for prefixing, additional a check/record of double named properties.
>>>
>>>> plus we need to find out and document really well in which order properties are
>>>> loaded and how to override them.
>>> The case of double properties is very common because we implement a fallback
>>> mechanism aka ant properties files. 
>>>
>>> Ant properties work the following order:
>>> 1. cli (e.g. -Dmodule=a)
>>> 2. build files - normally more then one (local.)build.properties. First in wins.
>>>
>>> For us it is (before the patch)
>>> a) SystemProperties
>>> b) local.lenya.properties.xml
>>> c) modules
>>> d) lenya.properties.xml
>>>
>>> I thought I wrote some documentation about it but cannot find it. 
>> I think it would be nice if the publication properties could go between a) and
>> b) but afair as the patch is now they are on top of a). I think this could only
>> be changed if the system properties can be distinguished from the rest (by a
>> name prefix?) so that the publication can leave them alone and not override them.
> 
> but the publication should be *able* to override anything, right? 

The idea was that a command line property should be able to override even a
publication property, but i don't have very strong feelings about this
particular issue.

> so it ought to be at the beginning if the parsing follows "first one wins".

Regarding the point in time the publication properties are read in last (if
nobody else finds a better solution) so the order of precedence has to be kept
artificially by applying some magic (like leaving alone some properties with
particular name prefixes and overwriting others...).

Regards,
Markus Angst


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


Re: DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by Jörn Nettingsmeier <ne...@apache.org>.
Markus Angst wrote:
>> ------- Additional Comments From thorsten@apache.org  2007-08-02 14:08 -------
>> (In reply to comment #5)
>>> (In reply to comment #4)
>>>> I see two solutions:
>>>>
>>>> - modules and publications have to use name prefixes
>>>>
>>>> - properties have to be saved (and may only be read) together with an "owner id"
>>> i think we should make prefixes mandatory: for modules, it should be
>>> <module-name>.your.property. for publications, it could be
>>> <pub-id>.your.property, but i guess we should leave the choice to the admin.
>>> users may also want to overload global properties...
>>>
>> I am as well for prefixing, additional a check/record of double named properties.
>>
>>> plus we need to find out and document really well in which order properties are
>>> loaded and how to override them.
>> The case of double properties is very common because we implement a fallback
>> mechanism aka ant properties files. 
>>
>> Ant properties work the following order:
>> 1. cli (e.g. -Dmodule=a)
>> 2. build files - normally more then one (local.)build.properties. First in wins.
>>
>> For us it is (before the patch)
>> a) SystemProperties
>> b) local.lenya.properties.xml
>> c) modules
>> d) lenya.properties.xml
>>
>> I thought I wrote some documentation about it but cannot find it. 
> 
> I think it would be nice if the publication properties could go between a) and
> b) but afair as the patch is now they are on top of a). I think this could only
> be changed if the system properties can be distinguished from the rest (by a
> name prefix?) so that the publication can leave them alone and not override them.

but the publication should be *able* to override anything, right? so it 
ought to be at the beginning if the parsing follows "first one wins".

as for distinguishing system properties, i'm a big fan of prefixing 
everything with "lenya.". one global symbol, and all the rest is free 
for user purposes.


-- 
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: DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by Markus Angst <ma...@inventec.ch>.
> ------- Additional Comments From thorsten@apache.org  2007-08-02 14:08 -------
> (In reply to comment #5)
>> (In reply to comment #4)
>>> I see two solutions:
>>>
>>> - modules and publications have to use name prefixes
>>>
>>> - properties have to be saved (and may only be read) together with an "owner id"
>> i think we should make prefixes mandatory: for modules, it should be
>> <module-name>.your.property. for publications, it could be
>> <pub-id>.your.property, but i guess we should leave the choice to the admin.
>> users may also want to overload global properties...
>>
> 
> I am as well for prefixing, additional a check/record of double named properties.
> 
>> plus we need to find out and document really well in which order properties are
>> loaded and how to override them.
> 
> The case of double properties is very common because we implement a fallback
> mechanism aka ant properties files. 
> 
> Ant properties work the following order:
> 1. cli (e.g. -Dmodule=a)
> 2. build files - normally more then one (local.)build.properties. First in wins.
> 
> For us it is (before the patch)
> a) SystemProperties
> b) local.lenya.properties.xml
> c) modules
> d) lenya.properties.xml
> 
> I thought I wrote some documentation about it but cannot find it. 

I think it would be nice if the publication properties could go between a) and
b) but afair as the patch is now they are on top of a). I think this could only
be changed if the system properties can be distinguished from the rest (by a
name prefix?) so that the publication can leave them alone and not override them.

WDYT?

Markus Angst



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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From thorsten@apache.org  2007-08-02 14:08 -------
(In reply to comment #5)
> (In reply to comment #4)
> > I see two solutions:
> > 
> > - modules and publications have to use name prefixes
> > 
> > - properties have to be saved (and may only be read) together with an "owner id"
> 
> i think we should make prefixes mandatory: for modules, it should be
> <module-name>.your.property. for publications, it could be
> <pub-id>.your.property, but i guess we should leave the choice to the admin.
> users may also want to overload global properties...
> 

I am as well for prefixing, additional a check/record of double named properties.

> plus we need to find out and document really well in which order properties are
> loaded and how to override them.

The case of double properties is very common because we implement a fallback
mechanism aka ant properties files. 

Ant properties work the following order:
1. cli (e.g. -Dmodule=a)
2. build files - normally more then one (local.)build.properties. First in wins.

For us it is (before the patch)
a) SystemProperties
b) local.lenya.properties.xml
c) modules
d) lenya.properties.xml

I thought I wrote some documentation about it but cannot find it. 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558


mangst@inventec.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #20301|text/plain                  |application/zip
          mime type|                            |
  Attachment #20301|1                           |0
           is patch|                            |




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From nettings@apache.org  2007-08-12 14:34 -------
thorsten, markus: what's the state of this issue? i think it would be nice to
have it in 2.0, since it seems to address a real user need.
markus, if you've got some time: can you describe what you're using this for?
then we can add some documentation once it's in.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558


mangst@inventec.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #20301|Patch for enhancement       |Patch for enhancement
        description|described above             |described below




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From thorsten@apache.org  2007-08-23 00:22 -------
(In reply to comment #14)
> ...
> 2.0
> 
> J�rn suggested to (re-)use aggregating fallback for properties of templated
> publications.
> 
> 2.1
> 
> I found AggregatingFallbackSourceFactory which provides the protocol called
> "aggregate-fallback://". I think to be able to reuse it some of the code of
> getSource would have to be refactored. I am not able to do this myself without
> help. If anybody with a better understanding of the big picture could have a
> look at it and tell me if this is the right way to go i would give it a try.
> (There are some similarities in code with FallbackSourceFactory.getSource, so
> maybe this would have to be taken into account as well.)

Actually in loadXMLPropertiesFromURI we use a Source to resolve the uri meaning 
you can use loadXMLPropertiesFromURI(filteringProperties,
"aggregate-fallback://"+PROPERTY_NAME, true);



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558


mangst@inventec.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




------- Additional Comments From mangst@inventec.ch  2007-10-25 09:35 -------
> Actually in loadXMLPropertiesFromURI we use a Source to resolve the uri meaning 
> you can use loadXMLPropertiesFromURI(filteringProperties,
> "aggregate-fallback://"+PROPERTY_NAME, true);

I made an attempt to do that. It works for me so far, but there is the function
PropertiesModule.getAttributeValues which i don't fully understand. I put some
code there but commented it out. Maybe somebody can review it and enlighten
me... Thanks!

Will draft a short doc and put it in the wiki.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 42558] - [Patch] lenya.properties.xml per publication

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42558





------- Additional Comments From mangst@inventec.ch  2007-10-25 09:38 -------
Created an attachment (id=21044)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21044&action=view)
Patch for aggregate-fallback, requires older patch (which is already applied).


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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