Can't brand the webconsole

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can't brand the webconsole

mario.toffia
Hi, I'm trying to test out branding on karaf 4.0.0.M2 (tried earlier on M1 as well with same result). The console branding works great. However I've been trying to do a simple replacement of the favico and the logo in the webconsole but fails miserabely. I have followed the guide (4.0.0.M1) and looked into the git repo how to do the branding.

I've added the branding bundles under the system folder and added them in custom.properties: org.osgi.framework.system.packages.extra.
They load just fine (the console-branding is active and webconsole-branding is installed). When I install feature:webconsole the webconsole-branding bundle gets resolved. When I access the webconsole it still have the karaf image etc. I've added fragments of (what I see) important parts of them.

Is there any obvious errors in my setup?

Cheers,
 Mario


META-INF/webconsole.properties:
----------------------
webconsole.brand.name = Test Web Console

webconsole.product.name = Test
webconsole.product.url = http://www.test.se/
webconsole.product.image = /res/cb/imgs/logo.png

webconsole.vendor.name = Test Vendor
webconsole.vendor.url = http://www.test.se
webconsole.vendor.image = /res/cb/imgs/logo.png

webconsole.favicon = /res/cb/imgs/favicon.ico
webconsole.stylesheet = /res/cb/ui/webconsole.css


pom.xml:
--------
...
<resource>
        <directory>src/main/resources</directory>
                <filtering>true</filtering>
                        <includes>
                                <include>**/*</include>
                        </includes>
                        <excludes>
                                <exclude>README.txt</exclude>
                </excludes>
        </resource>
</resources>
<plugins>
        <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${version.maven.bundle.plugin}</version>
                <extensions>true</extensions>
                <configuration>
                        <instructions>
                                <Bundle-Vendor>
                    Test Vendor
                </Bundle-Vendor>
                                <Bundle-DocURL>http://www.test.se</Bundle-DocURL>
                                <Fragment-Host>org.apache.karaf.webconsole.console;bundle-version="[3,5)"</Fragment-Host>
                                <Export-Package>!*</Export-Package>
                                <Import-Package>
                                        org.osgi.service.metatype;resolution:=optional,
                                        org.osgi.service.prefs;resolution:=optional,
                                        javax.portlet;resolution:=optional,
                                        javax.servlet.*;version="[2.6, 4.0)",
                                        !org.apache.felix.bundlerepository,
                                        !org.osgi.service.obr,
                                        !org.osgi.service.cm,
                                        !org.osgi.service.condpermadmin,
                                        !org.osgi.service.log,
                                        !org.osgi.service.metatype,
                                        !org.osgi.service.permissionadmin,
                                        !org.osgi.service.wireadmin,
                                        *
                                </Import-Package>
                        </instructions>
                </configuration>
        </plugin>
</plugins>

Initial State:
--------------
karaf@root>list -t 0
START LEVEL 100 , List Threshold: 0
ID | State     | Lvl | Version        | Name                                                              
-----------------------------------------------------------------------------------------------------------
 0 | Active    |   0 | 4.4.1          | System Bundle                                                      
 ...
 6 | Active    |  30 | 1.0.0.SNAPSHOT | Test Console Branding                                        
 7 | Installed |  30 | 1.0.0.SNAPSHOT | Test Web Console Branding                                    
 8 | Active    |  15 | 4.0.0.M2       | Apache Karaf :: Features :: Core                                  
 ...
 karaf@root>

After feature:install webconsole:
---------------------------------
karaf@root>list -t 0
START LEVEL 100 , List Threshold: 0
ID | State    | Lvl | Version         | Name                                                                
-------------------------------------------------------------------------------------------------------------
 0 | Active   |   0 | 4.4.1           | System Bundle                                                        
 ...                                          
 6 | Active   |  30 | 1.0.0.SNAPSHOT  | Test Console Branding                                          
 7 | Resolved |  30 | 1.0.0.SNAPSHOT  | Test Web Console Branding, Hosts: 58    
 ...                                    
 58 | Active   |  30 | 4.0.0.M2        | Apache Karaf :: Web Console :: Console, Fragments: 7  
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't brand the webconsole

jbonofre
Hi Mario,

Is your branding bundle a fragment of
org.apache.karaf.webconsole.console bundle ?

Regards
JB

On 03/09/2015 08:07 AM, mario.toffia wrote:

> Hi, I'm trying to test out branding on karaf 4.0.0.M2 (tried earlier on M1 as
> well with same result). The console branding works great. However I've been
> trying to do a simple replacement of the favico and the logo in the
> webconsole but fails miserabely. I have followed the guide (4.0.0.M1) and
> looked into the git repo how to do the branding.
>
> I've added the branding bundles under the system folder and added them in
> custom.properties: org.osgi.framework.system.packages.extra.
> They load just fine (the console-branding is active and webconsole-branding
> is installed). When I install feature:webconsole the webconsole-branding
> bundle gets resolved. When I access the webconsole it still have the karaf
> image etc. I've added fragments of (what I see) important parts of them.
>
> Is there any obvious errors in my setup?
>
> Cheers,
>   Mario
>
>
> META-INF/webconsole.properties:
> ----------------------
> webconsole.brand.name = Test Web Console
>
> webconsole.product.name = Test
> webconsole.product.url = http://www.test.se/
> webconsole.product.image = /res/cb/imgs/logo.png
>
> webconsole.vendor.name = Test Vendor
> webconsole.vendor.url = http://www.test.se
> webconsole.vendor.image = /res/cb/imgs/logo.png
>
> webconsole.favicon = /res/cb/imgs/favicon.ico
> webconsole.stylesheet = /res/cb/ui/webconsole.css
>
>
> pom.xml:
> --------
> ...
> <resource>
> <directory>src/main/resources</directory>
> <filtering>true</filtering>
> <includes>
> <include>**/*</include>
> </includes>
> <excludes>
> <exclude>README.txt</exclude>
> </excludes>
> </resource>
> </resources>
> <plugins>
> <plugin>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-bundle-plugin</artifactId>
> <version>${version.maven.bundle.plugin}</version>
> <extensions>true</extensions>
> <configuration>
> <instructions>
> <Bundle-Vendor>
>                      Test Vendor
>                  </Bundle-Vendor>
> <Bundle-DocURL>http://www.test.se</Bundle-DocURL>
>
> <Fragment-Host>org.apache.karaf.webconsole.console;bundle-version="[3,5)"</Fragment-Host>
> <Export-Package>!*</Export-Package>
> <Import-Package>
> org.osgi.service.metatype;resolution:=optional,
> org.osgi.service.prefs;resolution:=optional,
> javax.portlet;resolution:=optional,
> javax.servlet.*;version="[2.6, 4.0)",
> !org.apache.felix.bundlerepository,
> !org.osgi.service.obr,
> !org.osgi.service.cm,
> !org.osgi.service.condpermadmin,
> !org.osgi.service.log,
> !org.osgi.service.metatype,
> !org.osgi.service.permissionadmin,
> !org.osgi.service.wireadmin,
> *
> </Import-Package>
> </instructions>
> </configuration>
> </plugin>
> </plugins>
>
> Initial State:
> --------------
> karaf@root>list -t 0
> START LEVEL 100 , List Threshold: 0
> ID | State     | Lvl | Version        | Name
> -----------------------------------------------------------------------------------------------------------
>   0 | Active    |   0 | 4.4.1          | System Bundle
>   ...
>   6 | Active    |  30 | 1.0.0.SNAPSHOT | Test Console Branding
>   7 | Installed |  30 | 1.0.0.SNAPSHOT | Test Web Console Branding
>   8 | Active    |  15 | 4.0.0.M2       | Apache Karaf :: Features :: Core
>   ...
>   karaf@root>
>
> After feature:install webconsole:
> ---------------------------------
> karaf@root>list -t 0
> START LEVEL 100 , List Threshold: 0
> ID | State    | Lvl | Version         | Name
> -------------------------------------------------------------------------------------------------------------
>   0 | Active   |   0 | 4.4.1           | System Bundle
>   ...
>   6 | Active   |  30 | 1.0.0.SNAPSHOT  | Test Console Branding
>   7 | Resolved |  30 | 1.0.0.SNAPSHOT  | Test Web Console Branding, Hosts: 58
>   ...
>   58 | Active   |  30 | 4.0.0.M2        | Apache Karaf :: Web Console ::
> Console, Fragments: 7
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Can-t-brand-the-webconsole-tp4038868.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't brand the webconsole

mario.toffia
Hi,
Yes i do that in the "<Fragment-Host>org.apache.karaf.webconsole.console;bundle-version="[3,5)"</Fragment-Host>" (in the maven-bundle-plugin) and I can see it when I install webconsole feature - I get "Hosts: 58" on my bundle and the webconsole "Apache Karaf :: Web Console ::
> Console, Fragments: 7" (where 7 is my bundle).

Cheers,
 Mario

PS.
 in the manifest.mf "Fragment-Host: org.apache.karaf.webconsole.console;bundle-version="[3,5)" gets rendered - thus seems correct :)
DS.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't brand the webconsole

mario.toffia
Hi, I'd just wondering if there's someone that can point me to a direction? Is there someone that have tried branded the M1 or M2?

Cheers,
 Mario
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't brand the webconsole

Fabian Lange
Hi,
I have tried branding M1 and M2.

branding via the properties file does not work.
https://issues.apache.org/jira/browse/KARAF-3515
branding the shell for shell.sh does not work.
https://issues.apache.org/jira/browse/KARAF-3567

branding for karaf.sh does work.

I assume that some loading is broken.

Fabian


On Tue, Mar 10, 2015 at 6:03 PM, mario.toffia <[hidden email]>
wrote:

> Hi, I'd just wondering if there's someone that can point me to a direction?
> Is there someone that have tried branded the M1 or M2?
>
> Cheers,
>  Mario
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Can-t-brand-the-webconsole-tp4038868p4038930.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't brand the webconsole

mario.toffia
Resumed my effort to brand karafs repack of felix webconsole - it can be done but it is not perfect :)

Since karaf console project provides with a webconsole.properties felix will pick those up - if I fragment 'org.apache.karaf.webconsole.console' it will pick it's own due to OSGi classloading priorities.

So, I've created a felix BrandingPlugin and register it as a service - works great - but...

Since bundle cannot be a fragment and host a service at the same time - I need two bundles one fragments the images and one hosts the service...

Do any have other suggestions how to solve this?

Cheers,
 Mario
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't brand the webconsole

peter.berkman
I'm having the exact same problem in Karaf 4.0.8....  webconsole branding is set up properly and the fragment links up to the correct bundle

 69 | Active   |  30 | 4.0.8                              | Apache Karaf :: Web Console :: Console, Fragments: 288
288 | Resolved |  80 | 10.0.0.SNAPSHOT                    | NextGate :: Branding :: Web Console (build: 26308), Hosts: 69


has anyone successfully branded Karaf 4's web console?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't brand the webconsole

ivoleitao
I've exactly the same problem. I have open an issue for that. Please check https://issues.apache.org/jira/browse/KARAF-4942. By the way the same happens with karaf 4.1
Loading...