On 13/07/14 01:44, [email protected] wrote:
> Hello,
>
> I'm interesting with project bloodhound.
> I got some information from page
> https://issues.apache.org/bloodhound/wiki/Proposals/BEP-0003, which about
> multi-product.
>
> 1. I got information from the BEP-0003 page about we can config every
> product, I want to add config file for every product, but not working.
> Now I have two products, first is "@" which it's default, the second is
> "new_product" which I want to reconfig something.
> For example: I want set the "[header_logo]" for "new_product" with a new
> image[Like: http://xxxxxxx.com/new_image.png].
> Could you tell me what config file should I add?
> Could you tell me where should I put the config file?
>
> 2. I also want to add config in database for every product, I find table
> "bloodhound_productconfig" but I'm not find any method for inserting config
> into the table.
> Could you tell me where can I find the insert method? Or should I implement
> it by myself?
>
>
>
> Best regards,
> Charlie Tian
I was hoping that someone with better knowledge of that area will answer
so sorry for the delay.
A quick look around the appropriate bits of code suggests that there is
nothing currently implemented to allow for per-product configuration to
be specified by file; it is only stored in the database.
It is also true that a good amount of the configuration is not exposed
directly in the admin interface or other parts of the site. However, if
you know the options you want to set, it is possible to modify config
using trac-admin. For example:
trac-admin path/to/environment product admin new_product config set
header_logo src "http://xxxxxxx.com/new_image.png"
where path/to/environment is the same bloodhound environment you have to
list when you are running tracd.
I am not sure that the above method would be any different from what you
require to answer your second question. Technically, I believe you can
add to the bloodhound_productconfig table by using the config object
within the appropriate product context. I tested that by adding a line a
bit like this to some admin panel code:
self.config.set('header_logo', 'src', imageurl)
Is that any help?
Cheers,
Gary