Xara NavBar Generator

Service Information

Description

Creates a 'mouse-over' graphical navigation bar for websites.

A SOAP Web Service that generates a button bar or navigation bar. This is made from a number of separate PNG images for each button that when placed next to each other form the complete NavBar. The service returns 'off' and 'over' versions of the buttons and all the required Javascript to make the Navbar react when the mouse moves over the buttons.

This service is aimed at web authoring tools, e-commerce applications, store or web site builders of any type that require high quality, professional looking website navigation links, and for these to be integrated with the stylistic design of the website. The service could easily be integrated with online site builders or integrated into online desktop apps.

The style of the Navbar is controlled by the selected template design. Each design has a vertical or horizontal variation. You pass a number of parameters including the style, the text to go on each button, the link URLs, the colors required to customize the design to match your website etc. The SOAP call should take about 2 to 4 seconds.

This service is based on the proprietary Xara vector rendering engine that creates the graphics from a master vector design, anti-aliases, color and palette optimizes the images for use (so the image files are as small as possible). The buttons scale to accommodate the required button text but also can scale in size with no loss of quality.

This service is available for test purposes free-of-charge with a limited number of design styles available. For commercial applications please see this page for more info.

You can find an online builder UI and hosted version of this service from Xara Online at http://www.xaraonline.com

There are also various example scripts that demonstrate how to call the service using the MS Soap Toolkit and a simple ASP client application.

Methods

Service WSDL File

GetTemplates(Template, Variant)

This method enumerates the available templates that match the parameters passed in (an empty string will match all templates). This allows clients to easily generate lists of all variants of a style or all styles of a variant or to get the tumbnail for a particular template.

Required inputs:
Name Type Purpose
Template string Templates to return.
Variant string Template variants to return.
Output:
Name Type Purpose
Templates array of Template structures The available templates.

The Template structure is defined as follows:

Name Type Purpose
Name string The name of the template style.
Variant string The variant name of the style (used for horizontal and vertical).
ThumbURL string URL of preview image of the template.

GetFonts()

This method enumerates the available fonts.

Output:
Name Type Purpose
Fonts array of Font structures The available fonts.

The Font structure is defined as follows:

Name Type Purpose
Font string The name of the font.
ThumbURL string URL of preview image of the font.

GetColours(Template, Variant)

This method enumerates the colours present in a template.

Required inputs:
Name Type Purpose
Template string Sets the template.
Variant string Sets the template variant.
Output:
Name Type Purpose
Colours array of Colour structures The design colours of the template.

The Colour structure is defined as follows:

Name Type Purpose
Colour string The name of the colour
RGB string RGB colour value.
Six hex digits

CreateNavBar(...)

This method does the actual NavBar generation.

Required inputs:
Name Type Purpose
Template string Sets the template to use.
Variant string Sets the template variant to use
Text array of strings Sets the button text on each button.
The size of this array sets the number of buttons
Optional inputs:
Name Type Purpose Default
BackgroundRGB string Sets the desired background colour.
Six hex digits.
FFFFFF
BackgroundURL string Sets the background texture.
URL of texture image file.
None
Links array of Link structures Sets the links on the buttons. None
AltText array of strings Sets the alt text on the buttons. None
StatusText array of strings Sets the mouse-over status line text for the buttons. None
Colours array of Colour structures Sets the RGB values of the template's colours.
See GetColours() above.
None
Font string Name of the font to use None
FontSize double Size of the text in points. None
TextOffsetX int Horizontal offset of button text.
Millipoint (1/72000th inch)
0
TextOffsetY int Vertical offset of button text.
Millipoint (1/72000th inch)
0
FontAspect double Aspect ratio of font.
Percentage (200% is double width)
100
FontSpacing int Inter-character spacing.
1/1000th em
0
PercentSize double Size of NavBar.
Percentage of design size (10-400)
100
ButtonWidth int Button width control.
> 0 makes all buttons the specified width.
0 makes each button large enough for it's own text.
-1 makes all buttons the size of the largest button.
-1
ExportType string Sets the type of image file to create.
"gif", "png" or "jpg"
gif
Quality double Sets the quality of JPEG export.
Percentage (0-100)
75
NumColours int Sets the number of colours for GIF and PNG export 32
Transparent string Controls GIF and PNG transparency.
"true" or "false"
true
Dither string Sets the dither style to use for GIF and PNG export.
"none" or "diffused"
none
Preview string Controls whether images are hosted by the service or returned as encoded data.
"true" or "false"
false
NoHTML string Controls whether the NavBar HTML is returned.
"true" or "false"
false
OutputUNC string Sets the UNC path for the image files. None
OutputURL string Sets the base URL to use for the images. None
ImagePrefix string Sets the prefix to use when generating image filenames. None

The Link structure is defined as follows:

Name Type Purpose
URL string The URL to link to
Target string The target for the link
Outputs:
Name Type Purpose
HTML string The HTML for the NavBar
Images array of Image structures The generated graphic images

The Image structure is defined as follows:

Name Type Purpose
ImageName string The name of the image.
Width int The width of the image in pixels.
Height int The height of the image in pixels.
Data string The image data (see below).

The image names are as follows (<n> is the 1-based button index) though code should not be written that relies on these particular values:

startcap
endcap
button<n>
button<n>over
button<n>on

Modes of Operation

The following parameters modify the behaviour and output in various ways:

Preview, NoHTML, OutputURL, ImagePrefix & OutputUNC

If Preview is true then the service will locally host the image files (OutputUNC, OutputURL and ImagePrefix are ignored). If NoHTML is false then the HTML will contain the URLs of the locally hosted preview images and no images will be returned. If NoHTML is true then no HTML will be returned but the images will be returned with the Data fields containg the full URLs of the locally hosted images.

If Preview is false then the Data fields contain the encoded image files. If NoHTML is true then no HTML is returned otherwise OutputURL and ImagePrefix control how the image files are referenced in the HTML. If OutputURL is not set then all image URLs are output as tokens consisting of the image name wrapped in double hashes (e.g. ##button2over##) for substitution by the client. If OutputURL is set then the image URLs are written in the following form and no substitution is necessary:

<OutputURL>/<ImagePrefix><ImageName>.<ExportType>

If the OutputUNC back door is set to a valid UNC path and the client passes a security check of some kind then the images are saved to unique filenames (beginning with ImagePrefix if supplied) in the specified directory and the Data fields will contain the leafnames of the images. If OutputURL is not set then all image URLs are output as tokens as above. If OutputURL is set then the image URLs are written in the following form and no substitution is necessary:

<OutputURL>/<ImageLeafName>

The following table lists all the legal combinations:

Preview NoHTML OutputUNC OutputURL ImagePrefix HTML Image Data
true false ignored ignored ignored Full URLs None
true true ignored ignored ignored None Full URLs
false false unset unset ignored Tokens Encoded
false false unset set used Full URLs Encoded
false true unset ignored ignored None Encoded
false false set unset used Tokens Leafnames
false false set set used Full URLs Leafnames
false true set ignored used None Leafnames

A note on array representation

Arrays are supposed to be transmitted as described in section 5.4.2 of the SOAP v1.1 TR. The service doesn't insist on exact conformance to this. It just uses each child element of the parameter element as the items of the array with the element names being ignored e.g. the Text parameter could be:

<Text>
  <blah>Button 1</blah>
  <junk>Button 2</junk>
</Text>
In arrays of structures, the structure field element names are important but again the row element name is not, so Links could be:
<Links>
  <random>
    <URL>http://www.xaraonline.com/</URL>
    <Target>_blank</Target>
  </random>
  <otherone>
    <URL>http://www.xara.com/</URL>
    <Target/>
  </otherone>
</Links>
This is an example of an actual soap message sent by the ASP client app.