Fiz extension structure
This page describes the structure of a directory containing a Fiz extension, as it appears under the ext
directory in a Fiz application. An extension can appear in either source or binary form; these have the same structure, except that certain directories are only present in source installations. An extension directory includes the following files and subdirectories (extName refers to the name of the extension, which is the name of the directory containing all of this information):
config css lib out extName classes javadoc extName-pkg-1.0.0.zip src static test jsunit build.xml
config
Contains configuration datasets for this extension. The contents of this directory will be deployed to the directory WEB-INF/ext/extName/config
.
css
Contains CSS templates for this extension. The contents of this directory will be deployed to the directory WEB-INF/ext/extName/css
.
lib
If this extension requires additional Java libraries that are not included with Fiz, then they should be placed in this directory. The contents of this directory will be copied to the directory WEB-INF/lib
during deployment.
out
Information in this directory is generated automatically by various Ant targets. This directory can be deleted at any time: its contents can always be reconstructed later.
out/extName
ant build
will create a deployable version of the extension in this directory. Files get copied from this directory to the overall application's out
directory when ant build
is invoked in the application.
out/javadoc
Documentation for the extension is compiled here in javadoc format by various Ant targets.
out/extName-pkg-1.0.0.zip
A packaged version of the extension, ready for distribution for uploading to the Fiz Web site. Created by ant build
.
src
Contains Java source files using the standard Java conventions for organizing packages in subdirectories. For example, classes not part of any package are defined in the top-level src
directory, classes in the package com.mycompany.xyz are defined in src/com/mycompany/xyz
, and so on.
static
Contains static resources such as images and Javascript files that will be accessed via URLs when the extension is deployed as part of an application. The contents of this directory will be copied to the directory static/ext/extName
during deployment. Thus the URL htt
p://www.mycompany.com/static/ext/extName/images/xyz.gif
will map to the file static/images/xyz.gif
.
test
Contains unit tests for the extension. Java unit tests are based on junit
; test files should be stored in directories that match the Java classes that test. For example, tests for the Java file in src/com/mycompany/xyz/Widget.java
should be in the file tests/com/mycompany/xyz/WidgetTest.java
.
test/jsunit
Contains unit tests for Javascript files in the extension, organized using the Fiz jsunit
mechanism. For example, tests for the Javascript file in static/Effect.js
should be in the file test/jsunit/EffectTest.js
.
build.xml
Ant file for the extension. An initial version of this file with a basic set of targets is created by the fiz
tool when it creates the extension. You can modify this file to add additional targets.