Using Maqetta, the user create web application prototypes which are subsequently handed off to developers, who transform the prototype incrementally into a production application.
This article introduces the features in Maqetta that help with the designer-to-developer hand-off. The article starts by introducing some important concepts. The article then highlights the product's export-as-ZIP and workspace management features, including the ability to create Eclipse-compatible projects.
When you launch Maqetta for the first time, Maqetta creates a default workspace and a default project ("project1"). The picture below shows the default workspace:
Make the following adjustments to the Files palette
lib entry in the Files palette.
If it is closed (i.e., it has a "+" icon on the left size),
then click on the "+' to open lib to show its children.lib, you should see a child entry for dojo.
Look at the dojo entry in the Files palette.
If it is closed (i.e., it has a "+" icon on the left size),
then click on the "+' to open dojo to show its children.themes entry in the Files palette.
If it is closed (i.e., it has a "+" icon on the left size),
then click on the "+' to open themes to show its childrenThe Files palette should now look something like this:
Some things to note:
lib/ folder.
The picture above shows multiple libraries, clipart/, custom/, dojo/, maqetta/ and shapes/.
dojo/ folder contains a read-only version of the
Dojo toolkit.
Inside the outer dojo/ are the three main folders that make up a Dojo release,
dijit (Dojo's desktop widget library),
dojo (Dojo's core functions) and
dojox (an extensive library of Dojo extensions).
clipart/ folder contains the widgets found in the Clip Art section of the Palette.custom/ folder is custom widgets are stored (when using the SaveAs Widget feature).maqetta/ folder includes a couple of Maqetta-supplied runtime JavaScript files, including
AppStates.js that provides runtime support for Maqetta's application states feature.shapes/ folder contains the widgets found in the Drawing Tools section of the Palette.themes/ folder. Maqetta includes
seven themes by default in each workspace, all of which are read-only. Maqetta includes two desktop themes:
claro/ theme is the default theme used by the Dijit widget library in the Dojo toolkit.
sketch/ theme restyles Dijit widgets to have a pseudo-hand-drawn look that is
useful in early wireframing scenarios when designers prefer visually neutral rendition
of UI so that reviewers will focus on the flow of the UI rather than focus on
visual aspects such as fonts and colors.
android/ theme provides styling that matches the native look-and-feel of Android devices.blackberry/ theme provides styling that matches the native look-and-feel of Blackberry devices.ipad/ theme provides styling that matches the native look-and-feel of the iPad.iphone/ theme provides styling that matches the native look-and-feel of the iPhone.custom/ theme is a generic, cross-platform theme that is designed for custom theme development
for development teams that prefer highly customized visual styling instead of attempting to exactly match native device styling.dijit/folder for supplemental CSS files needed by the various Dojo themes:
themes/ folder. For example, if you create a new theme called "mytheme1":
then the Files palette would show a mytheme1 subfolder under themes/:
Maqetta automatically includes a reference to an application CSS file (i.e., app.css) with each new HTML
file created by a Create command.
You can insert application-specific CSS style rules in the app.css file
either by using some of the advanced features in the Properties palette
or by double-clicking on app.css in the Files palette
to bring up the source editor, where you can type CSS style rules by hand.
(See Creating Style Rules with app.css.)
At the top of the default app.css file, you will find a large CSS comment block
that explains the purpose of the file and some hints about how to use it:
app.css default contents
/*
* This file is provided for application-specific style rules.
*
* By default, Maqetta includes this CSS file within HTML pages
* authored in Maqetta.
*
* This file is typically used to override style rules found in
* theme CSS files. For example, suppose the theme CSS file has:
*
* .claro .dijitButton .dijitButtonNode {
* padding:2px 4px 4px 4px;
* }
*
* But for your application suppose you want to tighten the padding
* for buttons. Then, you might include the following style rule
* in this file (assuming that you accept Maqetta's default where
* id "myapp" is present on the BODY element, and assuming
* that you are using the "claro" theme):
*
* #myapp.claro .dijitButton .dijitButtonNode {
* padding:1px 3px 3px 3px;
* }
*
* Because of CSS precedence rules (see [1]), the above style rule
* (which begins with #myapp.claro) will "win the cascade" versus
* the style rule from the theme CSS file due to the use of the
* ID select (#myapp), which has higher specificity than the class
* selectors used throughout the Claro theme.
*
* [1] http://www.w3.org/TR/CSS21/cascade.html#cascade
*/
html,body {
height: 100%;
width: 100%;
}
Maqetta also automatically includes a reference to an application JavaScript file (i.e., app.js) with each new HTML
file created by a Create command. This file is a convenient place for you to insert
custom runtime JavaScript logic.
app.js default contents
/*
* This file is provided for custom JavaScript logic that your HTML files might need.
* Maqetta includes this JavaScript file by default within HTML pages authored in Maqetta.
*/
require(["dojo/ready"], function(ready){
ready(function(){
// logic that requires that Dojo is fully initialized should go here
});
});
This part of the article provides an overview of some technical details about the HTML files that Maqetta creates:
Go to the Create menu at the top of the application, and issue a "Create Desktop Application" command.
You can either accept the default filename
(e.g., file1.html) or enter a custom filename. Click on the Create button.
HTML source file contents
[01] <!DOCTYPE html>
[02] <html>
[03] <head>
[04] <meta charset="utf-8"/>
[05] <title>Untitled</title>
[06] <script type="text/javascript" src="lib/dojo/dojo/dojo.js" data-dojo-config="'parseOnLoad':true,'async':true,'packages':[{'name':'gridx','location':'../gridx'},{'name':'clipart','location':'../../clipart'},{'name':'maqettaSamples','location':'../../../samples'},{'name':'maqetta','location':'../../maqetta'},{'name':'shapes','location':'../../shapes'},{'name':'widgets','location':'../../custom'}]"></script>
[07] <script type="text/javascript">
[08] require([
[09] "dijit/dijit",
[10] "dojo/parser",
[11] "maqetta/space",
[12] "maqetta/AppStates",
[13] "dijit/form/Button"
[14] ]);
[15] </script>
[16] <style>@import "themes/claro/document.css";@import "themes/claro/claro.css";@import "app.css";
[17] </style>
[18] <script type="text/javascript" src="app.js"></script>
[19] </head>
[20] <body class="claro" data-maq-flow-layout="true" data-maq-ws="collapse" id="myapp" data-maq-appstates="{}">
[21] <input type="button" data-dojo-type="dijit.form.Button" intermediateChanges="false" label="Button" iconClass="dijitNoIcon"></input>
[22] </body>
[23] </html>
[06] - This line loads Dojo's JavaScript files.
In general, everyone on this line is essential for pages to work either in the Maqetta page editor
and/or when running in the browser outside of Maqetta.
The 'packages' section of this line (many characters) provides information that allows Maqetta to load widgets properly.
dojo.js and the packages
in various scenarios. For example, if you save an HTML file into a nested folder,
Maqetta will insert any necessary ../ references so that the HTML files
will properly load Dojo's JavaScript files.
[07]-[15] - These lines are Dojo-specific JavaScript.
Dojo requires calls to require() for each Dojo module used
by an HTML page. Maqetta automatically adds all necessary require()
statements to the HTML page.
[16]-[17] - These lines load the CSS files used by this HTML file:
themes/claro/claro.css - Reference to the CSS theme used by this page. (Default for Dojo/Dijit is the "claro" theme.)app.css - Application-specific CSS style rules. (See discussion earlier in this article about app.css.)../ references so that the HTML files
will properly load the CSS files.
[18] - Application-specific JavaScript logic. (See discussion earlier in this article about app.js.))
[20] - The <body> element often includes some Maqetta-specific
attributes that provide essential authoring information to the Maqetta page editor
and/or are required so that the application states feature can run outside of the
Maqetta authoring environment:
class="claro" - The currently active theme name (in this case, "claro")
appears in two places
in the HTML source code: (1) within an @import command in the <head>
and as a class name on the <body> element.data-maq-flow-layout="true" - This attribute persists whether this HTML file
is currently being editing using flow layout or absolute layout.data-davinci-ws="collapse" - This attribute allows Maqetta
to work around HTML/CSS white space complexities. Without this attribute,
Maqetta would either have to create unreadable source code or
fail to deliver on true WYWIWYG authoring.id="myapp" - This attribute allows Maqetta to insert
style rules within app.css file that reliably
override style rules within the CSS themes. Typically, CSS themes
use class selectors to style widgets and HTML.
This allows Maqetta to create override CSS rules in app.css
that reliably override the theme CSS rules because Maqetta's override
CSS rules use id selectors, which have higher priority (i.e., "specificity") in CSS.
#myapp at the
beginning of the selector.data-maq-appstates attribute - If an HTML page
defines custom application states via the States palette, then the
<body> element and various other elements within the page
will include a data-maq-appstates attribute. The data-maq-appstates attribute
is necessary to make the application states feature work
when your HTML page runs outside of the Maqetta authoring environment.[21] - This line provides the declarative markup for the Button widget.
Typically, each widget on the page will be represented in the HTML file as a single line of HTML.
Some widgets, however, expand into multiple lines of HTML.
Maqetta allows you to export your entire workspace or a subset of your workspace as a ZIP file that can be handed to developers, who can then incrementally transform the UI mockup created by Maqetta into a production application.
To export your entire workspace as a ZIP file:
This brings up the following dialog:
workspace1.zip. This will initiate a browser download
action, with the download process happening in the background.htdocs/
folder. This will allow you to actually run the Maqetta-created web pages
on your localhost server.
To export only selected files within a ZIP file:
lib/ files. (The download
dialog will allow you to include or exclude those files.)
This will bring up a similar download dialog as the
Download Entire Workspace icon.
The download dialog provides the following options:
Include/exclude particular libraries - The checkboxes to the left of the list of libraries controls whether the given resources should be included in the download ZIP file. By default, all JavaScript libraries (e.g., dojo) will be included in the download ZIP file.
The decision whether to include particular JavaScript libraries in your download ZIP depends on the needs and constraints of the team that will receive the ZIP. Usually, you will want to collaborate with your development team to find out whether they want or do not want the libaries and/or themes within the ZIP. Three common scenarios:
./lib/dojo, whereas the development team
might place Dojo at a different location, such as ./js/dojo,
./dojo or perhaps ../../libraries/dojo.
The editable textboxes within the dialog allow you to "relocate" the JavaScript
libraries when the ZIP file is created to an alternate location than what you are
using in your Maqetta workspace. For example, if Dojo is located at ./lib/dojo
and your development team put the Dojo library at ./dojo, then you
can change the textbox from lib/dojo to dojo.
Maqetta will automatically fix up the cloned copies of all HTML files in the ZIP
file such that all URL references to Dojo will point to ./dojo
instead of ./lib/dojo.
The third icon at the top of the Files palettes allows you to permanently modify the folder structure of your Maqetta workspace.
For example, by default, Maqetta places all JavaScript libraries
within the ./lib folder, with the Dojo toolkit located at ./lib/dojo.
These defaults usually work well for most Maqetta users. However, if your development team
uses a different folder hierarchy, and you often create download ZIPs that you hand off to your developers,
then sometimes it will be more efficient and less error-prone if you customize your Maqetta workspace
to match the folder structure used by your developers. That way, when you create a download ZIP,
you won't need to relocate JavaScript libraries for each new ZIP file.
Maqetta will automatically fix up all HTML files in your workspace
to take into account the new location(s) for your JavaScript libraries.
This section is relevant to web development teams that use the Eclipse IDE or IBM Rational Application Developer (RAD) 8.5 and want to export a fully self-contained Eclipse project that can be imported simply into the Eclipse IDE.
Here are steps for creating a self-contained, Eclipse-compatible project, exporting as a ZIP, unzipping into your Eclipse workspace, and then importing the project into Eclipse:
WebContent/ folder. Additionally,
Maqetta under the hood will create all of the hidden "dot files" (i.e., files whose name begins with a "." character)
used by the Eclipse IDE when managing web projects.
WebContent/ folder
becauses that is what Eclipse expects.
within the Files palette. If using RAD, then you may want to check the Download uncompressed source for selected
libraries option. Otherwise, click OK in the dialog that appears to start the download process.