With the help of RAPs 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.
You can define a new branding by creating an extension for the
org.eclipse.rap.ui.branding
extension point.
And here the same as it appears in the plugin.xml:
<extension
point="org.eclipse.rap.ui.branding">
<branding
id="org.eclipse.rap.demo.branding1"
servletName="tea"
defaultEntrypointId="org.eclipse.rap.demo.entrypoint1"
themeId="org.eclipse.rap.demo.alttheme"
title="It's tea-time"
favicon="icons/favicon2.ico"
body="body.html"
exitConfirmation="Do you really want to leave the party?">
</branding>
</extension>
The servletName attribute is responsible for the URL of the
application for the outside
world. For those without J2EE experience this means that you your application
will be available at <host>:<port>/<servletName>.
The defaultEntrypointId refers to an entrypoint which should be
used as the default one for this servlet. Looking at the example branding above
the URI http://<host>:<port>/tea and
http://<host>:<port>/tea?startup=foo are equivalent if
there is an entrypoint defined with the id org.eclipse.rap.demo.entrypoint1
and parameter foo.
Which theme to be used for this branding can be specified here. You need to provide
an id for the theme that is defined by an extension of org.eclipse.rap.ui.themes.
Without the themeId the RAP standard theme will be used.
To define the title which will be shown in the browser title or the the title of
the browser tab, you can use the title attribute.
The favicon is the icon shown in the address bar of the browser. This has to be a valid .ico file to be correctly displayed in the browser.
If you have the need for some custom (X)HTML markup in the RAP index page you can
register a valid (X)HTML file with the body attribute which will be included
in the body tag of the generated index page.
If not empty the string in exitConfirmation will be shown to the user
if he wants to leave the RAP application. This is useful to prevent users to accidentally
close the browser window/tab.
NOTE: This will only work in browsers of the Mozilla family and Internet Explorer. Some of the supported browser don't only use the specified string but instead wrapping it in some other explaination why this popup is opened.
To extend different aspects of the generated index page you can add a subelement
called additionalHeaders to your branding to add for example meta tags.
These informations will be added to the <head> tag of the index page.
<additionalHeaders>
<meta
content="RAP Team"
name="author">
</meta>
</additionalHeaders>
Available tags are meta and link. Furthermore you
can add as much additional attributes to each tag with the attribute
element.
The idea behind this is to have several different entrypoints in your application
but you want to group them behind a special branding (servletname, theme, etc).
In the normal use case you will not have the associatedEntrypoints
and thus every entrypoint is available in every branding. Introducing such an element
will give you the chance to allow only certain entrypoints for this branding.
Imagine you have the following entrypoints defined:
...
<associatedEntrypoints>
<entrypoint
id="org.eclipse.rap.demo.customerA">
</entrypoint>
<entrypoint
id="org.eclipse.rap.demo.customerA_Admin">
</entrypoint>
</associatedEntrypoints>
...
And the same should be done for Customer B (with other entrypoint ids)