Académique Documents
Professionnel Documents
Culture Documents
FINNtech AS
Written date: 10.12.04
Written by: Henry Chuks & Roar Johansen
Version: 1.1
Site builder’s toolbox Printed date: 12/12/2004 10:35 AM
Revision History
Date Version Description Author
30.01.2004 0.1 Initial document Roar Johansen
02.06.2004 0.2 Added sections on RJ + Henry Chuks
configuration and templates.
Minor layout fixes.
06.08.2004 0.3 Updates on addressing RJ + HC
structures.
10.10.2004 1.0 Renamed to “Site builder’s RJ + HC
toolbox”
Amended according to newly
developed tags.
10.12.2004 1.1 Revised, added an overview HC
chapter plus a mail chapter
Contents
1. PURPOSE OF DOCUMENT 4
2. GENERAL 4
5. TEMPLATES 7
1. Purpose of document
This document is intended as an aid for creators of “Local sites” in an iAd application.
It describes the concept in general terms, specifies the necessary tags in general, as well as in
the specialized context of an ad or collections of such, and finally gives examples of how to use
the tags. In fact, the term “Local site” is a subset of anything that comprises a full-blown iAd
site. Hence, the name of this document is “Site builder’s toolbox”, since the tags apply also to
building a main site.
2. General
A Local site (and a “Client site”, for that matter), is a subsidiary web site being served off an
iAd based web site’s server(s). It is capable of presenting ads pertinent to a sub-organisation via
a slightly different URL, and possibly presented in a “look and feel” adapted to the Internet
profile of the sub-organisation itself. Local sites will normally be branded according to a
newspaper’s profile, and client sites may (but not necessarily will) be branded according to
organisations that are subordinated to a Local site owner.
For this purpose, an iAd application comes with a comprehensive library of JSP (Java Server
Pages) “Tags”. JSP tags look very much like ordinary HTML tags, but will invoke dedicated
code in the iAd application in order to perform various tasks, i.e. retrieving values of various
fields in an ad, applying formatting, testing for presence of fields, etc. Altogether, the iAd tags
along with regular html tags, provide a set of “tools” (hence the term “toolbox”) for creators of
dedicated JSP pages.
However, some additional knowledge is required in order to utilize the iAd tags to their full
potential. This document sets out to provide this knowledge.
Templates make up most of the look and feel of a site, in the sense that they will carry banners,
menus, static information, etc. A personality is a folder holding a structure of JSP folders and
files, the folders/files follow the naming convention of that of the “main site”.
Business personalities are, as for template personalities, folders of equal structure, but with
contents differing from, the main site. Again, the files must be created first, using the “toolbox”,
or an existing personality folder may be referenced. For instance, the main site’s JSPs may be
referenced, or a “white labelled” personality. The term “white label” suggests what this is: A
copy of the main site’s business JSPs, residing in a separate folder, and stripped of any main site
specific contents, such as names, specific graphics, etc. A fast track to creating a local site may
be to create a template reflecting the “emulated” main site’s look and feel, and referencing this
white labelled set of pages.
A graphics personality is a graphics profile stored in a separate folder, following the naming
convention of the main site.
A sub-site’s CSS is submitted to a browser AFTER the main CSS is presented, thus, it may be
used to override corresponding classes/styles when necessary.
The main site’s graphics may be referenced if it is sufficient for the needs of the sub-site;
otherwise it is necessary to create graphics for the sub-site and storing it in the personality folder
before using it.
Should one wish to deviate from this pattern, e.g. by searching for only specific car makes, this
is possible, but requires an amount of work in advance to going live with such a site.
1. A full business JSP personality is required, since the main site’s JSPs are no longer
sufficient
2. The database must be examined for the identifiers of the required search criteria.
3. JSPs must be edited to cater for the altered search criteria.
The latter step is carried out by locating the part of the JSP in question which generates the full
search criteria, e.g. a “dropdown list box”, and replacing this with, using the toolbox tags, a
hidden field with the same field name, but with the located identifier from item (2) above as its
“constantValue”. This will act as a static search criteria to submitted searches, thus limiting the
searches. If you want to apply multiple ids to the search, simply specify a semicolon separated
string of identifiers as the constantValue.
A similar approach is possible if you want to limit the number of possible selections to a
dropdown (select) box. Locate the desired box in the JSP, remove the automatically generated
body of “option” tags, and manually add option tags instead, with values set to the identifiers
desired.
It is possible to alter the control used for selecting search criteria. For instance, you may utilize
radio buttons or checkboxes instead of dropdown/selects. This is just a matter of changing the
tags that comprise the control, with tags that create the desired control. For example, it is quite
feasible to substitute the following structure:
<input:select field=”somevalue”>
<iteration:repeat>
<input:option />
</iteration:repeat>
</input:select>
<input:group field=”somevalue”>
<iteration:repeat>
<input:radio />
</iteration:repeat>
</input:group>
, thus creating an array of radio buttons instead of a dropdown select. The functionality of the
search remains unaltered.
(Please note that the supplied example is only an example, it reflects only the structure of the
tags and not their proper syntaxes.)
With these pointers in mind, it is possible to create and maintain mail templates and organized
them into personalities, for the purpose of sending differently looking mails from the various
sites (“branded” e-mails).
3.5. Summary
As can be found from the above paragraphs, the creation of a local site is basically a six-tier
operation:
1. Create the site in Admin Tool (AT) and assign the basic search criteria.
2. Create (or select for re-use) a set of templates
3. Create (or select for re-use) a set of business JSPs
4. Create (or select for re-use) a set of graphics and CSS files
5. Create (or select for re-use) a set of mail XML templates
6. Configure all the above into the suborg.properties file (see below), specifying
the proper database ids (site id, org id), the personalities assigned in item 2 through 5
above, along with other items to configure, see below.
The syntax for defining a sub-organisation, call it mysuborg, as a Local Site, is:
mysuborg.suborgType = 1
for a Local site, or
mysuborg.suborgType = 2
for a Client site.
An important part of configuring a local site, is “closing the loop” between the web tier and the
database tier, by specifying the database identifiers (the site id and org id) resulting from the
database configuration, into the suborg.properties file for all sub-sites.
For a complete overview of how to configure a site, please refer to the “iAd configuration
guide” document.
5. Templates
5.3. Graphics
Likewise, graphic elements (gifs, etc.) may be created specially or shared, specified by the
setting
Special.ownGraphics=true/false
Altogether, this gives great flexibility with respect to creating the look and feel of a site.
It is possible to create a collection of graphics and style sheets, and refer to this as a
“graphicsPersonality”. A Graphics Personality may be assigned to any site, thus re-using
graphics and style sheets for multiple sites.
5.4. Mail
As stated above, mails from a site are created using XML-like mail templates. This is handy for
branding e-mail as emerging from different sites.
For example, an innovative combination of all these personalities may be used for creating sites
with both common elements and differing sub-elements.
6.1. Fields
”Fields” in this context refer to single entities of data. A field normally pertains to an attribute to
an ad, but may also stand alone.
Examples of a field:
• The make of a car in a car ad
• The price of a car in a car ad
• The address of a flat in a homes ad
• The salary in a job ad
• Etc…
Any field has a name, determined by the data model. A field may be “composite”, i.e. it may be
a collection of sub-fields, rather than just being a simple string. This scheme might be used on
e.g. an address, which actually is a collection of a street name, a number, a postcode and a city.
The field names might then look something like
address.street
address.number
address.postcode
address.city
The “dot” (i.e. “.”) separates the field and subfield names, and this is the only visible difference
between a basic field and a composite field. Technically speaking, composite fields consist of
members of an object (as for Hashmaps), and not, like basic fields, an object (as for Strings).
6.2.1. Scope
The scope is a string with one of the following values:
• parameter
• attribute
• … or may be missing
6.2.1.1 ”Parameter” scope
Fields with scope “request” exist only within the current http request. Their values are not
bound to the iAd ad database, and this scope is not elaborated in this document.
6.2.1.2 ”Attribute” scope
Likewise, “attribute” scoped fields take their value from attributes (J2EE internals) on the
request, and are not elaborated in this document.
6.2.1.3 No scope defined
Missing definition of scope will cause the toolbox to assume that the “Object” is neither of the
above, but one of the following:
• a Map or a Hashtable with members
• a List or an ArrayList with members
• a bean (Java Bean, not EJB) with getter methods.
and will act accordingly.
6.2.2. Object
This comprises the Object part of the addressing. The object says where to look for the field’s
value. As explained in the chapter “Tags in the ad context” the creator of result and detail pages
need not be concerned with this. For those with special interest, please refer to the
“Programmer’s summary of Addressing scheme” below.
6.2.3. Field
Field is a string containing the name of the data entity to be presented. All possible fields in an
iAd ad have their own names (set forth by the “DTD” - the XML Data Type Definition - of the
ad type). Please refer to separate documentation for these names.
– field may also be “composite”, i.e. a field name may represent a java Map,
which may again contain members. Thus, a composite field follows the naming
pattern “main.sub”. This means that the field “main” has subfields when a dot
(“.”) is present in the name.
The third testing tag may retrieve several values, and as it is not obvious to this tag which one
will be displayed inside of it, none are retained. Input/output tags inside this testing tag must
specify a field name. Of course, any input/output tag living inside the former two may also
specify a field name, thus creating the capability of testing for the presence of one field, and
then displaying another, should this be necessary. In general, any tag may specify a value where
this is not necessary according to the addressing scheme, in order to override the default
functionality whenever necessary.
The last tag checks for presence of output from within its body. E.g. an
<output:showvalue> tag in the body of a <cond:exists> tag will not produce output
to the user, but its output will be intercepted and tested by the <cond:exists> tag.
Other tags may also assume the behaviour of a conditional tag, please refer to the complete tag
library documentation for details.
Note: Regarding “inheritance” of a value from a previous display of a page, it must be noted
that this is only true when a page is displayed accompanied by an error message. This is due to
the fact that an error message usually is issued when storing to a database is not possible.
Therefore, instead of relying on the database to supply a persistent value, the contents of a field
must be preserved from what the user typed on the previous display of a page. When no error
message is present, the defaultValue is displayed directly when a persistent field value is
missing.
(Programmer’s note: It is possible for the application code to alter this behaviour, by calling
the API SystemUtils.preserveInputContents(request)).
Several other tags may be subclassing the behaviour of input/output tags, all exploiting the fact
that field values are inherently available. Please refer to the online tag library documentation for
a complete overview.
7.1.3.1 WML
All these above input: tags have their counterpart with the same name in the wml: tag library.
The functionality is that of the above input tags, however, they render wml instead of html. This
is for creating sites with e.g. WAP capability, or iDTV sites that render wml.
This is achieved using the grouping tags. They may appear within an
<iteration:repeat/> tag, and consist of the tags
• <util:holdvalue />, which acts as an “anchor” for the part of a JSP which is
concerned with the grouping, and
• <util:rowgrouping />, which tests for change in the value to cause a break in
the grouping and output a new headline (or other action). This tag may live within a
<cond:if /> tag, enabling the use of a <cond:else />, used to define what to
do when a break is not detected, should this be necessary.
8. Examples
These examples may serve as an illustration of how to create result list and detail pages. Note:
The field names are fictitious, for illustration purpose only, and do not reflect the actual contents
of an iAd database. Please refer to the data model documentation for a correct overview of
available fields. Refer also to the presentation “Site builder’s toolbox” (whose name coincides
with the name of the present document). There, a more end-user approach to understanding the
task of building a site is outlined.
Please note that no HTML is included in the examples. In a real site, a designer will need to add
the proper HTML to take care of formatting, etc.
Note that these pages look very similar. It is, however, their association (through the config file
actions.properties) to an “Action”, which supplies them with the proper data objects.
This is actually a crucial part of making an iAd site work properly, to keep JSPs and Action
classes in sync via a properly configured property file.
Mail templates contain both <BODY> and <BODYPLAIN> sections, the former being used
when generating a mail to a person having opted in on the “I may receive HTML mail” option
in the “myprofile” profile, the latter for generating mail to a person who has opted out of this
option.
<SUBJECT>
#subject#
</SUBJECT>
<BODYHTML>
<HTML>
<HEAD>
#stylesheet#
<TITLE>Email from #from#</TITLE>
</HEAD>
<BODY>
#subject#
<br>
<br>
Hi,
<br>
<br>
A friend of yours would like to alert you to a particular advert on
#homepage#: <br>
<a href="#finnurl#advert?adId=#prospectId#">
#finnurl#advert?adId=#prospectId#</a>
<br>
<br>
Comments: <br>
#comments#
<br>
<br>
<br>
<br>
sent from: #mailsendername#
<br>
#bannerad#
</BODY>
</HTML>
</BODYHTML>
<BODYPLAIN>
plain text version of body text
</BODYPLAIN>