Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
   * with the License.  You may obtain a copy of the License at
   *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
 package org.apache.felix.webconsole;
 
 
The DefaultBrandingPlugin class is the default implementation of the BrandingPlugin interface. The singleton instance of this class is used as branding plugin if no BrandingPlugin service is registered in the system.

This default implementation provides Apache Felix based default branding as follows:

NameProperty NameDefault Value
Product Namewebconsole.product.nameApache Felix
Product URLwebconsole.product.urlhttp://felix.apache.org
Product Imagewebconsole.product.image/res/imgs/logo.png
Vendor Namewebconsole.vendor.nameThe Apache Software Foundation
Vendor URLwebconsole.vendor.urlhttp://www.apache.org
Vendor Imagewebconsole.vendor.image/res/imgs/logo.png
Favourite Iconwebconsole.favicon/res/imgs/favicon.ico
Main Stylesheetwebconsole.stylesheet/res/ui/admin.css

If a properties file META-INF/webconsole.properties is available through the class loader of this class, the properties overwrite the default settings according to the property names listed above. The easiest way to add such a properties file is to provide a fragment bundle with the file.

 
 public class DefaultBrandingPlugin implements BrandingPlugin
 {

    
The name of the bundle entry providing branding properties for this default branding plugin (value is "/META-INF/webconsole.properties").
 
     private static final String BRANDING_PROPERTIES = "/META-INF/webconsole.properties";
 
     private static DefaultBrandingPlugin instance;
 
     private final String productName;
 
     private final String productURL;
 
     private final String productImage;
    private final String vendorName;
    private final String vendorURL;
    private final String vendorImage;
    private final String favIcon;
    private final String mainStyleSheet;
    private DefaultBrandingPlugin()
    {
        Properties props = new Properties();
        // try to load the branding properties
        if ( ins != null )
        {
            try
            {
                props.loadins );
            }
            catch ( IOException ignore )
            {
            }
            finally
            {
                try
                {
                    ins.close();
                }
                catch ( IOException ignore )
                {
                }
            }
        }
        // set the fields from the properties now
         = props.getProperty"webconsole.product.name""Apache Felix" );
         = props.getProperty"webconsole.product.url""http://felix.apache.org" );
         = props.getProperty"webconsole.product.image""/res/imgs/logo.png" );
         = props.getProperty"webconsole.vendor.name""The Apache Software Foundation" );
         = props.getProperty"webconsole.vendor.url""http://www.apache.org" );
         = props.getProperty"webconsole.vendor.image""/res/imgs/logo.png" );
         = props.getProperty"webconsole.favicon""/res/imgs/favicon.ico" );
         = props.getProperty"webconsole.stylesheet""/res/ui/webconsole.css" );
    }
    public static DefaultBrandingPlugin getInstance()
    {
        if (  == null )
        {
             = new DefaultBrandingPlugin();
        }
        return ;
    }
    public String getBrandName()
    {
        return "DefaultBrandingPlugin";
    }
    public String getProductName()
    {
        return ;
    }
    public String getProductURL()
    {
        return ;
    }
    public String getProductImage()
    {
        return ;
    }
    public String getVendorName()
    {
        return ;
    }
    public String getVendorURL()
    {
        return ;
    }
    public String getVendorImage()
    {
        return ;
    }
    public String getFavIcon()
    {
        return ;
    }
    public String getMainStyleSheet()
    {
        return ;
    }
New to GrepCode? Check out our FAQ X