The web pages files for the planets application can be classified into four groups.
All of the pages use a <ui:composition>
tag that
references templates/masterLayout.xhtml
.
When a page needs non-default content for one of the parts it is
specified with a <ui:define>
tag.
The name
attribute of the tag matches the
name
attribute of one of the
<ui:insert>
tags in
templates/masterLayout.xhtml
.
The files in the sections/login folder provide
<ui:composition>
tags for the titlebar and
the sidebar of the login page.
The files in the sections/planetarium folder provide
<ui:composition>
tags for the titlebar and
the sidebar of all other pages.
The masterLayout.xhtml
file defines the layout for all of
the application pages.
This is an ordinary XHTML file except for the ui:insert tags.
Each one names a variant feature where individual pages may need to
provide different content.
The name
attribute provides a name that the pages use to
refer to a specific variant feature.
Some of the <ui:insert>
tags have non-empty content.
This defines the default content.
The <ui:include>
subtag is a mechanism for getting
content from a <ui:composition>
tag in another file.
The login page has different titlebar and sidebar features
than the other pages.
It defines all four variant features inside a
<ui:composition>
tag that references the master
layout.
The planets application has a welcome page (planetarium.xhtml) and a
page for each of the 8 planets.
They all have identical structure.
They only need to define the windowTitle and content
variant features inside a <ui:composition>
tag that
references the master layout.
Other Pages (Web Pages/):
The application web pages fall into two groups according to structure the login page:
so it makes sense to factor out the commonality. This is done with two sets of composition files which can be included into the actual web pages:
Both sets are in their own subfolders of
Web Pages/sections
.
Each set contains one file for the titlebar variant feature and
one file for the sidebar variant feature.
There are two composition files for the login page:
There are two composition files for the other pages: