webmail − webnail file formats The program allows
its state to be saved in XML files that use the file
extensions or This file will be described below. For
configuring the program, several additional files may be
needed. The first is a ’layout’ file with an
extension of This file starts with the following lines:
<?xml version="1.1"
encoding="UTF-8"?>
<!DOCTYPE images PUBLIC
"-//BZDev//Webnail_Layout_Info 1.0//EN"
"sresource:webnail-1.0.dtd"> All spaces after
must be single spaces, not tabs, with this restriction
applying up to the second double quote. The second is a
template file, with an extension of It starts with the
sequence of characters $(!M.T
application/x.webnail-template) which indicates that
file’s MIME type. These files are passed to the
template processor provided by the BZDev class library, and
that template processor treats directives starting with an
exclamation point as a comment. Both the layout and template
files are described in the Webnail manual, accessible from
the Webnail program via the "help" menu. The
remainder of this manual page will describe the Webnail
input-file format. An XML input file provides more options
than are possible using the command-line interface. The file
must start with the following two lines: <?xml
version="1.1" encoding="UTF-8"?>
<!DOCTYPE images PUBLIC "-//BZDev//Webnail
1.0//EN"
/"sresource:webnail-1.0.dtd"> The first line
indicates the version of XML and the character set encoding.
The second line specifies the DTD file giving the input
syntax for the XML file. URL’s starting with
"sresource" are interpreted by the program as
resources that can be obtained from the program’s JAR
file. In addition, the first element, must contain an
attribute with a specific value: The top level element is
named and it is defined as follows: <!ELEMENT webnail
(title?, descr?, head?,
header?, image*, trailer?, finalHtml?, webxmlExtras)>
<!ATTLIST webnail
xmlns CDATA #FIXED
"http://bzdev.org/DTD/webnail-1.0"
windowTitle CDATA #IMPLIED
mimeType CDATA #IMPLIED
webMode (true|false) #IMPLIED
linkMode (true|false) #IMPLIED
flatMode (true|false) #IMPLIED
highResMode (true|false) #IMPLIED
webArchiveMode (true|false) #IMPLIED
zipped (true|false) #IMPLIED
syncMode (true|false) #IMPLIED
waitOnError (true|false) #IMPLIED
imageTime CDATA #IMPLIED
minImageTime CDATA #IMPLIED
bgcolor CDATA #IMPLIED
fgcolor CDATA #IMPLIED
rvmode CDATA #IMPLIED
height CDATA #IMPLIED
width CDATA #IMPLIED
hrefToOrig (true|false) #IMPLIED
layout CDATA #IMPLIED> The child elements are described
below. The attributes are defined as follows: This attribute
specifies the title that will appear in the browser’s
menu bar. This attribute specifies the MIME type of scaled
image files. The default value is "image/jpeg".
This attribute should be set to true if the output directory
or zip file should be set up for use with a web site. The
default value is false. When the value is true, for full
resolution images and when the image is specified using a
URL, a link to the original image rather than copy of the
image is used it. The default value is false. High
resolution images are not put in a sub-directory when
webMode is true. If the images are not scaled and its MIME
type matches the MIME type specified by the mimeType
attribute (or its default value), and the original image is
in the target directory, then the image will not be copied.
The default value is false. has a default value of true.
When it is false, high resolution images are not included
and the full-screen option for a slideshow will not appear.
When set to true (the default is false), the output will be
a web-archive file, or a directory with the same structure.
There will be a WEB-INFO/web.xml entry that specifies how a
web server should be configured. When set to true (the
default is false) the output will be a ZIP file instead of a
directory. This option is ignored when a single image is
being scaled. This attribute has a default value of false.
When it is true, if an image (e.g., one obtained from a web
server) arrives late, the duration over the image and
subsequent ones are shown will be adjusted to compensate for
the delay. This attribute has a default value of false. When
true, if images were skipped because errors were detected
while attempting to download them, the skipped images’
imageTime (the duration for which an image should be
displayed) will be added to the imageTime of the currently
displayed image. This attribute specifies the duration for
which an image should be displayed in seconds (three digits
pass a decimal point are allowed to specify time in
milliseconds). To specify times in minutes and seconds,
separate minutes and seconds with a colon. To specify the
duration in hours, minutes and seconds, separate hours and
minutes, and minutes and seconds, with a colon. Thus,
1:0:20.5, 60:20.5, and 80.5 all represent the same value.
The default value is 10 seconds. This attribute specifies
the minimum duration for which an image should be shown when
syncMode is true. The default value is 4 seconds. This
attribute specifies the background color used on HTML pages.
See the CSS specification for the syntax. The default value
is "gray". This attribute specifies the foreground
(or text) color used on HTML pages. See the CSS
specification for the syntax. The default value is
"black". When the value is "true", icons
will use a light color suitable for a dark background. When
"false", icons will use a dark color. The default
is "false". This attribute specifies the height of
a bounding box for full-resolution images in pixels. This
attribute specifies the width of a bounding box for
full-resolution images in pixels. This attribute has a value
of true or false. When true, a default value for the hrefURL
attribute of each image element is provided, the URL of the
original unscaled image. When false, the hrefURL attribute
defaults to a scaled copy whose bounding box is the height
and width attributes above. This attribute specifies a
layout for the web page. The value is an a URL. URLs that
with the scheme refer to standard layouts provided by and
indicate the location in the JAR file. Each layout has a
name that will display in a Java "combo box", but
the URL will appear in the intput file. The URLS and names
are the following:
indicates the images will be displayed vertically with a
larger view in an adjacent frame, and provides navigation
buttons and the ability to show the images in a slideshow,
with HTML text provided by the header and trailer elements
above and below the images respectively.
indicates the images will be displayed vertically with a
larger view in an adjacent frame, with HTML text provided by
the header and trailer elements above and below the images
respectively.
indicates that there will be a navigation bar followed by a
single image. The navigation button provides the ability to
show the images in a slideshow, with HTML text provided by
the header and trailer elements above and below the images
respectively.
indicates the images will be displayed horizontally with a
larger view below, and provides navigation buttons and the
ability to show the images in a slideshow, with HTML text
provided by the header and trailer elements above and below
the images respectively.
indicates the images will be displayed horizontally with a
larger view below, with HTML text provided by the header and
trailer elements above and below the images respectively.
indicates that the images are placed in a table whose number
of columns is chosen based on the image size, with the
header and trailer elements providing HTML text above and
belows the images respectively.
indicates that the HTML text from the header element appears
first on the page, followed by two columns, the first
showing the images (one image per row) and the second the
HTML text provided by the trailer element.
indicates that the HTML text from the header element appears
first on the page, followed by two columns, the first
showing the HTML text provided by the trailer element and
the second showing the images (one image per row).
indicates that the web page should contain two columns, the
first containing the images (one image per row) and the
second containing the HTML text from the header element
followed by the HTML text from the trailer element.
indicates that the web page contains two columns, the first
containing the HTML text from the header element followed by
the HTML text from the trailer element, and the second
containing the images (one image per row). The element is
defined as follows: <!ELEMENT title (#PCDATA)*>
<!ATTLIST title
|
url CDATA #IMPLIED> The element’s content specifies a title. When it appears as a child of the element, it specifies the default title to display below an image. When it appears in an element, it specifies the title for a specific image. The value is spliced into an HTML document. The entities "<", ">", "&", or """ should be used instead of the corresponding characters, or the value should appear in a CDATA section (delimited by "<![CDATA[" and "]]>". Alternatively, a attribute can be used. This attribute provides a URL that points to a resource containing the element’s content. The element’s content will be ignored when a attribute is provided. The element is defined as follows: <!ELEMENT descr (#PCDATA)*> |
<!ATTLIST descr
url CDATA #IMPLIED> The element specifies a description,
which is displayed directly below the title. When it appears
as a child of the element, it specifies the default
description. When it appears as a child of an element, it
provides the description for that specific image. The value
is spliced into an HTML document. The entities
"<", ">",
"&", or """ should be
used instead of the corresponding characters, or the value
should appear in a CDATA section (delimited by
"<![CDATA[" and "]]>").
Alternatively, a attribute can be used. This attribute
provides a URL that points to a resource containing the
element’s content. The element’s content will be
ignored when a attribute is provided. The element is defined
by <!ELEMENT head (#PCDATA)*>
<!ATTLIST head
url CDATA #IMPLIED> and its content will appear in the
HEAD section of an HTML document. The entities
"<", ">",
"&", or """ should be
used instead of the corresponding characters, or the value
should appear in a CDATA section (delimited by
"<![CDATA[" and "]]>". This allows
various HTML elements to be added to the document head.
Alternatively, a attribute can be used. This attribute
provides a URL that points to a resource containing the
element’s content. The element’s content will be
ignored when a attribute is provided. The element is defined
by <!ELEMENT header (#PCDATA)*>
<!ATTLIST header
url CDATA #IMPLIED> and its content will appear at the
start of the element in an HTML document. The entities
"<", ">",
"&", or """ should be
used instead of the corresponding characters, or the value
should appear in a CDATA section (delimited by
"<![CDATA[" and "]]>".
Alternatively, a attribute can be used. This attribute
provides a URL that points to a resource containing the
element’s content. The element’s content will be
ignored when a attribute is provided. The element is defined
by <!ELEMENT image ((filename | url), title?)>
<!ATTLIST image
mimeType CDATA #IMPLIED
linkMode (true|false) #IMPLIED
hrefURL CDATA #IMPLIED
hrefTarget (_blank|_top) #IMPLIED
imageTime CDATA #IMPLIED
minImageTime CDATA #IMPLIED> The children define a file
name or URL for an image, and optionally a title and
description. The attributes, and have the same meaning as
the attributes with the same name do for the element, but
apply to a specific image. The attribute (if present) gives
the URL to load when the image (not the thumbnail) is
clicked on the web page. The attribute indicates the
corresponding target for the link, either or The child
elements and were defined above. The child elements or its
alternative indicate where to find an image. The element
definitions for these are <!ELEMENT filename
(#PCDATA)*>
<!ELEMENT url (#PCDATA)*> Both contain character data
as their contents. The character data provides a file name
or URL respectively. Alternatively, a attribute can be used.
This attribute provides a URL that points to a resource
containing the element’s content. The element’s
content will be ignored when a attribute is provided. Next
the and elements allow additional HTML to be added. These
are defined by <!ELEMENT trailer (#PCDATA)*>
<!ATTLIST trailer
url CDATA #IMPLIED>
<!ELEMENT finalHtml (#PCDATA)*>
<!ATTLIST finalHtml
url CDATA #IMPLIED> The contents of both give the HTML to
insert into an HTML document. The entities
"<", ">",
"&", or """ should be
used instead of the corresponding characters, or the value
should appear in a CDATA section (delimited by
"<![CDATA[" and "]]>".
Alternatively, a attribute can be used. This attribute
provides a URL that points to a resource containing the
element’s content. The element’s content will be
ignored when a attribute is provided. For standard layouts,
the content of the element will appear before the final
element, that appears in the HTML document by default and
which loads the file and the content of the element will
follow that script. Finally, the element allows a web.xml
file to be extended. This is defined by <!ELEMENT
webxmlExtras (#PCDATA)*
<!ATTLIST webxmlExtras
url CDATA #IMPLIED> The contents of this element provides
the XML to insert into a web application’s
WEB-INF/web.xml file just before that file’s closing
</web-app> element. The entities "<",
">", "&", or
""" should be used instead of the
corresponding characters, or the value should appear in a
CDATA section (delimited by "<![CDATA[" and
"]]>". Alternatively, a attribute can be used.
This attribute provides a URL that points to a resource
containing the element’s content. The element’s
content will be ignored when a attribute is provided.
Layouts are defined by XML files that should start with the
following lines: <?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE layout PUBLIC
"-//BZDev//Webnail_Layout_Info 1.0//EN"
"sresource:webnail-layout-info-1.0.dtd">
<layout
xmlns="http://bzdev.org/DTD/webnail-layout-info-1.0">
The DTD starts with the element: <!ELEMENT layout (multi
| single)>
|
<!ATTLIST layout |
xmlns CDATA #FIXED "http://bzdev.org/DTD/webnail-layout-info-1.0"> This element merely provides a choice between two elements. The element indicates that images are displayed dynamically by using navigation controls or running a slideshow, whereas the element indicates that all the images are on a single page. The element is defined as follows: <!ELEMENT multi (name)*> |
<!ATTLIST multi
twidth CDATA #REQUIRED
theight CDATA #REQUIRED
mwidth CDATA #REQUIRED
mheight CDATA #REQUIRED
marginw CDATA #REQUIRED
marginh CDATA #REQUIRED
margin_hpad CDATA #REQUIRED
margin_vpad CDATA #REQUIRED
t_vpad CDATA #REQUIRED
t_hpad CDATA #REQUIRED
num_t_images CDATA #REQUIRED
t_vcorrection CDATA #IMPLIED
t_hcorrection CDATA #IMPLIED
name CDATA #REQUIRED
url CDATA #REQUIRED> The maximum width of each thumbnail
image’s bounding box in pixels. The maximum height of
each thumbnail imge’s bounding box in pixels. The
maximum width of each medium image’s bounding box in
pixels. The maximum height of each medium image’s
bounding box in pixels. The margin padding on each
horizontal side of the frame containing thumbnails or the
medium-sized image. This is the marginwidth attribute for a
thumbnail and medium-image IFRAME. The margin padding on
each vertical side of the frame containing thumbnails or the
medium-sized image. This is the marginheight attribute for a
thumbnail and medium-image IFRAME>. Additional vertical
padding for thumbnails and the medium-sized image beyond
that expected from the marginh attribute (twice its value).
This additional separation prevents some browsers from
placing a scroll pane around an image and allows space for a
border around selectable images. Additional vertical padding
for thumbnails and the medium-sized image beyond that
expected from the marginh attribute (twice its value). This
additional separation prevents some browsers from placing a
scroll pane around an image and allows space for a border
around selectable images. Additional horizontal padding for
thumbnails and the medium-sized image beyond the amount
expected from the marginw attribute (twice its value). This
additional separation prevents some browsers from placing a
scroll pane around an image and allows space for a border
around selectable images. The number of thumbnail images
visible in a scrollable frame. Correction term in pixels for
the thumbnail-frame height. This value is added to the frame
height that would be computed from the other parameters. The
default is zero. This is not used unless the thumbnails are
stacked vertically. Correction term in pixels for the
thumbnail-frame width. This value is added to the frame
width that would be computed from the other parameters. The
default is zero. This is not used unless the thumbnails are
stacked horizontally. This is the default print name for the
layout as displayed in a combo box. Multiple elements can
also be provided to give locale-specific alternatives..TP
The URL of the template for the top-level HTML page being
generated. <!ELEMENT single (name)*>
<!ATTLIST single
max_thumbwidth CDATA #REQUIRED
max_thumbheight CDATA #REQUIRED
tiled (true | false) #IMPLIED
tiledWidth CDATA #IMPLIED
name CDATA #REQUIRED
linkedURL CDATA #REQUIRED
noLinkURL CDATA #REQUIRED> The maximum width of a
thumbnail image in pixels. If the images are tiled, this
value must not be larger than the value of the tildedWidth
attribute and will be reduced to that width if necessary.
The maximum height of a thumbnail image in pixels. The value
is if the images are tiled (arranged in a grid); if the
images arranged vertically. The width of the bounding box
surrounding tiled images in units of pixels. The default
value is 670. This is the default print name for the layout
as displayed in a combo box. Multiple name elements can also
be provided to give locale-specific alternatives. URL of the
template for the HTML file to generate when the HTML file
contains absolute links for each image to a corresponding
higher-resolution image. URL of the template for the HTML
file to generate when the HTML file does not contains
relative links for each image to a corresponding
higher-resolution image. Finally, the element provides a
locale-specific name for the enclosing or element:
<!ELEMENT name (#PCDATA)>
<!ATTLIST name
lang CDATA #REQUIRED> The contents of this element is the
locale-specific name, and the attribute should be the locale
as specified in RFCs 4647 and 5646. The attributes and
defined above are references to templates. These URLs should
end in a name with the extension and the corresponding file
should start with the string This string allows the
file’s mediat type to be determined from its contents
and will otherwise be ignored. It may be prefaced by a
byte-order mark, and should be UTF-8 encoded. Template files
use the following escapes and directives: The character is
represented directives start with end with the following A
directive whose contents start with is a comment A directive
whose contents contain letters, digits, and periods will be
replaced with a value. A directive consisting of two
subdirectives, separated by a colon with each subdirective
consisting of letters, digits, and periods, indicates
iteration. The first subdirective indicates a replacement
table to use and the second subdirective names a directive
that ends the iteration. The text in between will be
repeated N times, with directives in the replacement table
possibly changing from one iteration to the next. A
directive consisting of two subdirectives, separated by a
colon with each subdirective consisting of letters, digits,
and periods, with the first subdirective prefaced by
.B + r is a conditional directive. It is treated like an
iterative directive but with a single iteration that will
occur for the case if the first subdirective matches a
directive that is defined, and for the case if the the first
subdirective does not match a directive that is defined.
While some directives are used internally, the following
ones are used in templates explicitly defined for layouts,
all of which are used to create HTML files: This directive
has a default value of "gray". It specifies the
background color used on HTML pages. See the CSS
specification for the syntax. This directive has a default
value of "black". It specifies the foreground (or
text) color used on HTML pages. See the CSS specification
for the syntax. This directive provides the additional
horizontal padding for thumbnails and the medium-sized image
beyond the amount expected from the marginw attribute (twice
its value). This additional separation prevents some
browsers from placing a scroll pane around an image and
allows space for a border around selectable images. The
value is identical to that provided by the marginw
attribute. This directive provides the margin padding on
each vertical side of the frame containing thumbnails or the
medium-sized image. This is the marginheight attribute for a
thumbnail and medium-image IFRAME>. This directive
provides the a value computed from the twidth, marginw and
margin_hpad using the expression twidth + 2 * marginw +
margin_hpad. This directive provides the a value computed
from the theight, t_vpad, num_t_images, margin_vpad, and
_vcorrection using the expression ((theight + (2 * t_vpad))
* num_t_images) + (2 * marginh) + margin_vpad +
t_vcorrection. This directive provides a value computed from
the theight, marginh and margin_vpad using the expression
theight + 2 * marginh + margin_vpad. This directive provides
a value computed from the twidth, t_hpad, num_t_images,
margin_hpad, and t_hcorrection using the expression (twidth
+ (2 * t_hpad)) * num_t_images + * marginw) + margin_vpad/2
+ t_hcorrection. This directive provides a value computed
from the mwidth, marginw, and margin_hpad attributes using
the expression mwidth + 2 * marginw + margin_hpad. This
directive provides a value computed from the mheight,
marginh, and margin_vpad attributes using the expression
mheight + 2 * marginh + margin_vpad. This directive provides
a value computed from the twidth, marginw, margin_hpad, and
mwidth atributes using the expression twidth + 4 * marginw +
margin_hpad + mwidth. This directive provides a value
computed from the theight, marginh, margin_vpad, and mheight
atributes using the expression theight + 4 * marginh +
margin_vpad) + mheight. This directive provides the TITLE
element in the HTML head. This directive provides the HTML
elements to add just before the end of the HEAD element.
This directive provides the HTML elements to add after the
start of the BODY element. The exact position is template
dependent, but these elements should appear before the
trailer elements. This directive provides the HTML elements
to place as a title for a medium-sized image. There may be a
default title and per-image titles that can override the
default. This directive provides the HTML elements to place
as a description of a medium-sized image. This will usually
be below the title. There may be a default description and
per-image descriptions that can override the default. This
directive provides the HTML elements to place in the
trailer, whose exact position is template dependent, but
suchelements should appear after the header elements. This
directive provides the finalHtml elements. These appear
after the final script element in the HTML file and
immediately before the end of the BODY element. This can be
used to add additional scripts. Putting scripts at the end
of an HTML file when feasible improves performance: a
browser runs scripts sequentially and will not load an image
or style sheet while a script is running. As a result,
putting scripts near the start of an HTML file can increase
the delay before images referenced in the file are loaded.
This directive iterates over images. The name reflects its
use in a template that generates Javascript, where a block
is used to construct an array initializer. This directive
provides the URL that will be visited when a medium-scale
image is clicked. The value is changed during iteration.
This directive provides a URL that points to the target
frame corresponding to the directive. The value is changed
during iteration. This directive provides the URL of a
full-scale image relative to the top-level URL. This
directivive provides the HTML sequence needed to start a new
row in a table: if a row should end and an empty string
otherwise.