blob: 334d1308a2733ae7ffa9b982cbbd3e9f8cd0127c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="copyright" content="Copyright (c) 2007, 2011 EclipseSource. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page."/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Branding</title>
<link rel="stylesheet" href="../../../../PRODUCT_PLUGIN/book.css" type="text/css"/>
</head>
<body>
<h1>Branding</h1>
<em>
Note: Branding is only available when your RAP Application is used in a
<a href = "application-setup.html#summary">setup</a> with workbench.
When using a <q>RAP with OSGi</q> or<q>RWT Standalone</q>
setup, see <q><a href = "application-configuration.html">Application Configuration</a></q>.
</em>
<h3>Introduction</h3>
<p>
With the help of RAP's branding features you're able to define several (visual) aspects of your
RAP application. This includes for example the page title which is shown in the
browser or the theme to be used for the application.
</p>
<img src="../../images/branding/example.png" alt="Example branding"/>
<h3>Capabilities of the Branding</h3>
<p>
You can define a new branding by creating an extension for the
<code>org.eclipse.rap.ui.branding</code>
extension point.
</p>
<img src="../../images/branding/extension.png" alt="Extension point editor"/>
<p>
And here the same as it appears in the <code>plugin.xml</code>:
</p>
<pre><code>
&lt;extension
point=&quot;org.eclipse.rap.ui.branding&quot;&gt;
&lt;branding
id=&quot;my.project.branding1&quot;
servletName=&quot;myapp&quot;
title=&quot;My Custom Title&quot;
favicon=&quot;icons/favicon.png&quot;
body=&quot;body.html&quot;
defaultEntrypointId=&quot;my.project.entrypoint1&quot;
themeId=&quot;org.eclipse.rap.design.example.fancy.theme&quot;
exitConfirmationClass=&quot;my.project.ExitConfirmationImpl&quot;&gt;
&lt;/branding&gt;
&lt;/extension&gt;
</code></pre>
<h4>servletName</h4>
<p>
The <code>servletName</code> attribute defines the URL path to the application.
The application will be available at<br/>
<code>http://host[:port]/[contextName/]<b>servletName</b></code>.
The <code>contextName</code> is optional.
In a deployment, this will be the webapp path.
You can also specify a context path in the RAP launcher.
</p>
<h4>defaultEntrypointId</h4>
<p>
The id of the entrypoint that should be started by default for this branding.
For example, with the example configuration shown above, the following URLs are equivalent:<br/>
<code>http://host[:port]/myapp</code><br/>
<code>http://host[:port]/myapp?startup=foo</code><br/>
given that the <code>parameter</code> of the entrypoint <code>my.project.entrypoint1</code>
is <code>foo</code>.
</p>
<h4>themeId</h4>
<p>
The id of the theme to be used for this branding.
The theme must be defined by an extension of <code>org.eclipse.rap.ui.themes</code>.
Without this parameter, the RAP default theme will be used.
See also <a href="../rwt/theming.html">RWT Theming</a>.
</p>
<h4>title</h4>
<p>
To define the title which will be shown in the browser title or the the title of
the browser tab, you can use the <code>title</code> attribute.
</p>
<h4>favicon</h4>
<p>
The <a href="http://en.wikipedia.org/wiki/Favicon">favicon</a> is a 16x16 pixel
square icon shown in the browser's address bar or tab.
To be compatible with legacy browsers, use a file in the
<a href="http://en.wikipedia.org/wiki/ICO_%28icon_image_file_format%29">ICO format</a>.
</p>
<h4>body</h4>
<p>
An optional file containing an HTML snippet to be included in the RAP index page.
This snippet will be included in the <code>body</code> element of the generated index page.
Please note that the preferred way of styling the application background is to add a theming
for the Display background property.
</p>
<h4>exitConfirmationClass</h4>
<p>
An optional class that implements the interface <code>IExitConfirmation</code>.
Implementations of this interface can control the exit confirmation that is shown whenever
the user tries to close the browser window or tab or navigates to another URL.
</p>
<img src="../../images/branding/exitConfirmation.png" alt="Exit confirmation dialog"/>
<p>
<strong>NOTE:</strong>
Note that this is feature is not supported by every browser. Furthermore,
some browsers may show additional text in the confirmation dialog.
</p>
<h4>Element additionalHeaders</h4>
<p>
An optional sub-element of a branding extension, that allows to add
<code>&lt;meta&gt;</code> or <code>&lt;link&gt;</code> tags
to the <code>&lt;head&gt;</code> of the generated index page.
Here's an example:
</p>
<pre><code>
&lt;additionalHeaders&gt;
&lt;meta name=&quot;author&quot; content=&quot;Arthur Dent&quot;&gt;
&lt;/meta&gt;
&lt;/additionalHeaders&gt;
</code></pre>
<p>
Available tags are <code>&lt;meta&gt;</code> and <code>&lt;link&gt;</code>.
You can add more additional attributes to each tag with the <code>attribute</code> element.
</p>
<h4>Element associatedEntrypoints</h4>
<p>
This is an optional sub-element that allows to limit the available entrypoints of a branding.
Without this element, all entrypoints are available in every branding.
When the element <code>&lt;associatedEntrypoints&gt;</code> is specified, only the included
entrypoints are available for this branding.
</p>
<p>
Here's an example: imagine you have the following entrypoints defined:
</p>
<ul>
<li>customerA</li>
<li>customerB</li>
<li>administrationA</li>
<li>administrationB</li>
</ul>
<p>
Using different brandings, you can now group them so that customer A and
administration A have the same branding (page title, servletName, theme, etc.)
and are not allowed to access the applications for customer B.
A sample implementation of the branding for customer A could look like this:
</p>
<pre><code>
&lt;branding
id=&quot;my.project.brandingA&quot;
... &gt;
&lt;associatedEntrypoints&gt;
&lt;entrypoint id="my.project.customerA"&gt;
&lt;/entrypoint&gt;
&lt;entrypoint id="my.project.administrationA"&gt;
&lt;/entrypoint&gt;
&lt;/associatedEntrypoints&gt;
</code></pre>
<p>
The same would be done for Customer B (with different entrypoint ids).
</p>
</body>
</html>