|
Rabbit 1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Rabbit
Rabbit is a framework for providing kind of rapid application
prototyping features in Helma.
Defined in Global/Rabbit.js
Field Summary | |
<static> <final> Number |
DATE
Constant representing the date datatype |
<static> <final> String |
DATEFORMAT
Constant representing the format of the date datatype |
<static> <final> Number |
EMAIL
Constant representing the e-mail datatype |
<static> <final> Number |
FILE
Constant representing the file datatype |
<static> <final> Number |
IMAGE
Constant representing the image datatype |
<static> <final> Number |
NUMBER
Constant representing the numeric datatype |
<static> <final> Number |
TEXT
Constant representing the alphanumeric datatype |
<static> <final> Number |
VERSION
Constant representing the current version number |
Constructor Summary | |
Rabbit
(<Boolean> restricted)
Constructs a new instance of the Rabbit class. |
Method Summary | |
void
|
editor(<HopObject> object)
Renders an editor for a HopObject instance. |
HopObject
|
getChildElement(<String> child)
Retrieves the child element of an HopObject instance. |
Object
|
getMeta(<String> prototype, <String> property)
For convenience, easier access and also better performance all settings of a prototype are serialized to a file which serves as object cache. |
Object
|
getSetup(<HopObject> object)
Gets a map of key/value pairs defining the database mapping of an arbitrary HopObject instance's prototype. |
java.sql.Statement
|
init()
Initializes the Rabbit framework. |
Object
|
readPropertiesFile(<String> dir, <String> name)
Reads a Java properties file into a JavaScript map. |
void
|
registerGlobals()
Registers some global and HopObject-related fields and methods for convenience. |
void
|
reset()
Drops all previously created tables from the database and clear the object cache of the Helma application. |
void
|
setMeta(<String> prototype, <String> property, <Object> value)
For convenience, easier access and also better performance all settings of a prototype are serialized to a file which serves as object cache. |
void
|
setup(<String> prototype, <Object> map)
Defines a HopObject prototype and its database mapping. |
void
|
update(object, data)
Updates a HopObject instance from a map of key/value pairs derived from the corresponding Rabbit editor. |
void
|
viewer(<HopObject> object)
Renders a viewer for a HopObject instance. |
String
|
writePropertiesFile(<String> dir, <String> name, <Object> data)
Creates a Java properties file from a JavaScript map. |
<static> String
|
chooser(<String> name, <Object> options, <String> selected, buffer)
Helper method to render an HTML drop down element. |
<static> String
|
dateEditor(<String> name, <Date> date, buffer)
Helper method to render a combination of HTML drop down elements representing an editor for a datetime value. |
<static> Object
|
getPropertyMeta(<HopObject> object, <String> property, <String> name)
Helper method to retrieve property meta data. |
<static> HopObject
|
property(<String> property)
Helper method to render a property of a HopObject instance. |
<static> void
|
setPropertyMeta(<HopObject> object, <String> property, <String> name, <Object> value)
Helper method to set property meta data. |
<static> Object
|
snippet(<String> name, <Object> param, <String> buffer)
Renders a snippet. |
Field Detail |
<static> <final> Number DATE
<static> <final> String DATEFORMAT
<static> <final> Number EMAIL
<static> <final> Number FILE
<static> <final> Number IMAGE
<static> <final> Number NUMBER
<static> <final> Number TEXT
<static> <final> Number VERSION
Constructor Detail |
Rabbit(<Boolean> restricted)
restricted
- Flag indicating whether some global and prototype settings will be applied on instantation. If true, the values as described in registerGlobals() will be set.
Method Detail |
void editor(<HopObject> object)
object
- The underlying HopObject instance.
HopObject getChildElement(<String> child)
child
- The name of the child element
Object getMeta(<String> prototype, <String> property)
prototype
- The name of the prototype.
property
- The name of the property.
Object getSetup(<HopObject> object)
object
- The underlying HopObject
java.sql.Statement init()
Object readPropertiesFile(<String> dir, <String> name)
dir
- The directory containing the properties file
name
- The name of the properties file
void registerGlobals()
void reset()
void setMeta(<String> prototype, <String> property, <Object> value)
prototype
- The name of the prototype.
property
- The name of the property.
value
- The future value of the prototype's property.
void setup(<String> prototype, <Object> map)
prototype
- The name of the prototype.
map
- A map of key/value pairs defining all database-related properties of the prototype's instances optionally including void update(object, data)
The
- desired HopObject instance
The
- underlying map data
void viewer(<HopObject> object)
object
- The underlying HopObject instance.
String writePropertiesFile(<String> dir, <String> name, <Object> data)
dir
- The directory containing the properties file
name
- The name of the properties file
data
- The underlying map structure.
<static> String chooser(<String> name, <Object> options, <String> selected, buffer)
name
- The name of the element.
options
- A map of key/value pairs containing the names and values of each option.
selected
- The currently selected value.
The
- name of a snippet buffer (see snippet() method for details)
<static> String dateEditor(<String> name, <Date> date, buffer)
name
- The name of the element.
date
- The underlying date object.
The
- name of a snippet buffer (see snippet() method for details)
<static> Object getPropertyMeta(<HopObject> object, <String> property, <String> name)
object
- The HopObject containing the underlying property
property
- The name of the underlying property
name
- The key of the desired meta value
<static> HopObject property(<String> property)
property
- The name of the property.
<static> void setPropertyMeta(<HopObject> object, <String> property, <String> name, <Object> value)
object
- The HopObject containing the underlying property
property
- The name of the underlying property
name
- The key of the desired meta value
value
- The property's future meta value
<static> Object snippet(<String> name, <Object> param, <String> buffer)
To enable a skin file containing snippets the file must end
with ".snippets.skin". The rendering mechanics comply to
Helma's generic skin features with the exception that an
additional third argument can be provided to determine a
snippet buffer. Snippet buffers are handled by
res.data.rendered, ie. the rendered result will be appended
to the contents of a named property in res.data.rendered.name
- The name of the snippet. If the name contains a colon (e.g. "main:header"), the Rabbit framework tries to render the subskin "header" contained in the skin file "main.snippets.skin". Otherwise, common rendering applies.
param
- A generic Helma macro paramater object.
buffer
- The name of a snippet buffer. This name will be used to determine a named property in res.data.rendered. E.g. "header" relates to res.data.rendered.header where any additionally rendered snippet using the "header" buffer will be appended to. Since snippet buffers reside in res.handlers.rendered, one can refer to them from within skin files via the "rendered" macro, e.g. <% rendered.header %>
|
Rabbit 1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |