Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More doc updates

  • Loading branch information...
commit c03c5470f0e55c26af1f49c790e9d8e7c28babb7 1 parent 77c5c05
@c9developer c9developer authored
View
8 core/baseclasses/databinding.js
@@ -1607,9 +1607,11 @@ apf.DataBinding = function(){
// #ifdef __WITH_VIRTUALVIEWPORT
/**
- * @attribute {String} viewport Sets or gets the way this element renders its data. Possible values include:
- * - `"virtual"`: this element only renders data that it needs to display.
- * - `"normal`"`: this element renders all data at startup.
+ * @attribute {String} viewport Sets or gets the way this element renders its data.
+ *
+ * The possible values include:
+ * - `"virtual"`: this element only renders data that it needs to display.
+ * - `"normal`"`: this element renders all data at startup.
* @experimental
*/
this.$propHandlers["viewport"] = function(value){
View
6 doc/build.js
@@ -17,9 +17,9 @@ var buildOptions = {
// XML stuff for Jade
"define", "allowchild", "action",
// TOC forms
- "container", "form", "layout", "selection", "logic", "media", "parser", "apfclass",
- // crap to ignore
- "inheritsElsewhere"],
+ "container", "form", "layout", "selection", "logic", "media", "parser", "additional",
+ // just ignorable rubbish
+ "inheritsElsewhere", "apfclass"],
linkFormat : function (linkHtml, obj) {
if (linkHtml.classes && linkHtml.classes[0] == "isXML" && linkHtml.href !== undefined) {
linkHtml.href = linkHtml.href.replace(".html", "-element.html");
View
3  doc/index.md
@@ -1,3 +1,4 @@
# APF API
-Here are the API docs for APF. Hooray !
+Welcome to the APF documentation. This is a work in progress. If you have any feedback, please
+e-mail the developer support team [developer@c9.io](mailto:developer+support@c9.io).
View
115 doc/resources/assets/csses/refguide_overrides.css
@@ -508,6 +508,11 @@ header.filler {
padding-bottom: 10px;
}
+#documentation h4 {
+ font-size: 18px;
+ margin: 20px 0 7px 0;
+}
+
#documentation h4, #documentation h3, #documentation h2, #documentation h1 {
font-weight: 100;
font-family: Helvetica;
@@ -752,13 +757,15 @@ li.signature {
div#inheritance {
float: right;
+ min-width: 130px;
border: 1px solid #DDD;
- padding: 2px 10px 5px 10px;
- margin: 10px 0 -10px 10px;
+ padding: 2px 10px 0px 10px;
+ margin: 0px 0 0px 10px;
max-width: 240px;
border-top-right-radius: 5px;
- box-shadow: inset 2px -2px 2px rgba(0, 0, 0, 0.1);
- border-bottom-left-radius: 5px;
+ box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1);
+ border-radius: 5px;
+ background: white;
}
div#inheritance ul {
@@ -767,18 +774,45 @@ div#inheritance ul {
div#inheritance ul#hierarchyTree {
margin-left: 0;
+ overflow: hidden;
+ padding: 5px 2px 5px 0px;
+}
+
+#inheritance {
+ visibility: hidden;
}
#inheritance h6 {
background: #25A8E7;
color: white;
display: block;
- padding: 2px 3px 2px 4px;
+ padding: 3px 6px 1px 6px;
margin: -2px -11px 0 -11px;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.4);
border-top-right-radius: 5px;
+ border-top-left-radius: 5px;
font-family: Helvetica;
font-weight: 100;
+ cursor: pointer;
+ letter-spacing: 1px;
+ -webkit-transition: border-radius 0.4s ease-out;
+ -moz-transition: border-radius 0.4s ease-out;
+ -o-transition: border-radius 0.4s ease-out;
+}
+
+#inheritance.collapsed h6 {
+ border-bottom-right-radius: 5px;
+ border-bottom-left-radius: 5px;
+}
+
+#hierarchyTree {
+ -webkit-transition: height 0.2s, padding 0.2s;
+ -moz-transition: height 0.2s, padding 0.2s;
+ -o-transition: height 0.2s, padding 0.2s;
+}
+
+div#inheritance.collapsed ul#hierarchyTree {
+ padding: 0;
}
#hierarchyTree li {
@@ -877,72 +911,6 @@ h3.methodToggle.active {
Footer? I hardly know her
*/
-#footer {
- width:100%;
- background: #101010 url(../images/footer_bg.png) repeat 0 0;
- font-size: 12px;
- color: #c3c3c3;
- height: 40px;
-}
-#footer .footerInner {
- padding-left: 300px;
- margin-left: auto;
- margin-right: auto;
- min-height: 40px;
- background: url(../images/arrow_footer.png) no-repeat 261px 0;
-}
-#footer .footer-text {
- display: block;
- float: left;
- margin-right: 10px;
- margin-top: 24px;
-}
-#footer .sponsors {
- display: inline-block;
- margin-top: 18px;
-}
-
-#footer .sponsors .sponsor {
- padding-right: 22px;
-}
-#footer .container
-#footer a {
-/* color: #c3c3c3;
- text-decoration: underline;*/
-}
-#footer .c9-logo {
- width: 141px;
- height: 20px;
- background: url(../images/c9-log-footer.png) no-repeat 0 0;
- display: inline-block;
- padding-right: 10px;
-}
-#footer .joyent-logo {
- width: 70px;
- height: 19px;
- background: url(../images/joyent-logo-footer.png) no-repeat 0 0;
- display: inline-block;
- padding-right: 10px;
-}
-#footer .mozilla-logo {
- width: 78px;
- height: 24px;
- background: url(../images/mozilla-logo-footer.png) no-repeat 0 0;
- display: inline-block;
- padding-right: 10px;
-}
-#footer .debuggable-logo {
- width: 119px;
- height: 25px;
- background: url(../images/debuggable-logo-footer.png) no-repeat 0 0;
- display: inline-block;
- padding-right: 0 !important;
- margin-bottom : -3px;
-}
-#footer .span11 {
- margin-left: 0;
-}
-
.logoText, .logoImg {
/*position: absolute;*/
margin-bottom: 5px;
@@ -1019,9 +987,6 @@ html, body {
div.push {
height: 40px; /* .push must be the same height as .footer */
}
-#footer, div.push {
+div.push {
clear: both;
-}
-#footer {
- margin-top: 40px;
}
View
2  doc/resources/templates/apf_menu.jade
@@ -1,5 +1,7 @@
-var link = link || termLink;
input#live_search_toc
+ p#no_search_results
+ | <span class="number_circle">!</span> No search results
h3 Containers
ul.menu
for obj in fullTree.children.filter(function(x){return x.private !== true && x.define !== undefined && x.container === true})
View
25 doc/resources/templates/lib.jade
@@ -8,7 +8,8 @@
mixin makeHierarchy(obj)
div#inheritance
- h6 Inheritance
+ h6 Hierarchy
+ span#inheritance_arrow
ul#hierarchyTree
li
strong #{obj.id}
@@ -33,18 +34,21 @@ mixin makeTag(obj, attributes)
-xmlBlobs = "<pre><code class='language-xml'><span class='tag'>&lt;<span class='title'>a:" + obj.define + "</span>"
-for k in obj.children.filter(function(x){return x.type === 'attribute'})
- -xmlBlobs += "\n <span class='" + (k.inheritedFrom ? "isInherited" : "") + "'><span class='attribute'>" + k.name + "</span>=";
+ -xmlBlobs += "\n <span class='" + (k.inheritedFrom ? "isInheritedAttribute" : " ") + "'><span class='attribute'>" + k.name + "</span>=";
-types = [];
- -k.signatures[0].returns.forEach(function (r) {
+ -moreThanOneType = k.signatures[0].returns.length > 1;
+ -k.signatures[0].returns.forEach(function (r, idx, arr) {
-if (r.type == "Boolean")
-types.push('<span class="value">"' + 'true | false' + '"')
-else
- -types.push('<span class="value">"' + r.type + '"')
- -xmlBlobs += types.join("|") + "</span></span>";
+ -if (moreThanOneType)
+ -types.push('<span class="value">' + r.type)
+ -else
+ -types.push('<span class="value">"' + r.type + '"')
-})
-
+ -xmlBlobs += (moreThanOneType ? '"' + types.join(' | ') + '"</span>' : types) + "</span></span>";
!= xmlBlobs + "></span></code></pre>"
-
+
mixin commonDescription(obj, parents)
if typeof obj === 'string'
obj = list[obj]
@@ -219,17 +223,18 @@ mixin api()
if obj.hierarchy
mixin makeHierarchy(obj)
+
if obj.description
.section.description
.memberContent
mixin markdown(obj.description)
- else if obj.define && obj.children
+ if obj.define && obj.children
h4 XML Definition
- div.xmlBlob
+ div#xmlBlob
mixin makeTag(obj)
- mixin article(obj, obj.children.filter(function(x){return x.type === 'class method'}), obj.children.filter(function(x){return x.type === 'event'}), obj.children.filter(function(x){return x.type === 'class property'}))
+ mixin article(obj, obj.children.filter(function(x){return x.type === 'class method'}), obj.children.filter(function(x){return x.type === 'event'}), obj.children.filter(function(x){return x.type === 'class property'}))
mixin short_description_list(collection)
ul.method-details-list
View
31 doc/terms/actionrules.md
@@ -3,15 +3,15 @@
Action rules determine whether a user can execute an action and
takes care of executing the change both locally and on a remote server. Each
triggered action creates an item on the undo stack.
-Action rules are part of the {@link term.smartbinding smartbinding concept}.
+Action rules are part of the [smartbinding concept](./smartbinding.html).
## Syntax
-Actions are added to {@link element.actions}. The <i>select</i> attribute specifies
-whether an action can be executed. The <i>set</i> attribute specifies how the change
+Actions are added to [`apf.actions`](./actions.html). The `select` attribute specifies
+whether an action can be executed. The `set` attribute specifies how the change
to the data is send to the server. The following example shows a remove
action on a datagrid. A jsp script is called to process the change. This is
-specified using a {@link term.datainstruction data instruction}.
+specified using a [data instruction](./datainstruction.html).
```xml
<a:datagrid>
@@ -122,7 +122,7 @@ Another possibility is to add the item again as shown in this example:
Each action has a method associated with it that exists on the element that
the action rule is assigned to. The method has the same name as the action
-and can be called from javascript. For instance, the {@link baseclass.multiselect.binding.remove remove action}:
+and can be called from javascript:
```javascript
myTree.remove();
@@ -131,11 +131,12 @@ and can be called from javascript. For instance, the {@link baseclass.multiselec
## Add
-Adding {@link term.datanode data nodes} to an element is a bit more advanced because the origin of
-the new data can be encoded in {@link baseclass.multiselect.binding.add the add action rule}.
+Adding [data nodes](./datanode.html) to an element is a bit more advanced because the origin of
+the new data can be encoded in the add action rule.
+
There are three ways to provide the data to add a node.
-The first is by calling the add method using javascript.
+The first is by calling the `add` method using Javascript.
```xml
<a:list id="myList">
@@ -146,7 +147,7 @@ The first is by calling the add method using javascript.
</a:script>
```
-The second by specifying the template as a child of the add action rule:
+The second is by specifying the template as a child of the add action rule:
```xml
<a:add set="{comm.addProduct([.])}">
@@ -180,11 +181,11 @@ The third way gets the added node from the server.
## Purging
-Sometimes it's necesary to not send the changes directly to the server. For
-instance when the application offers a <i>save</i> button. To achieve this
-set the {@link element.actiontracker.attribute.realtime realtime attribute}
-of the actiontracker to false. The save button can call the
-{@link element.actiontracker.method.purge purge method} to have the
+Sometimes, it's necesary to not send the changes directly to the server. For
+instance when the application offers a _save_ button. To achieve this
+set the [realtime attribute](./actiontracker.html#realtime)
+of the actiontracker to zfalsez. The save button can call [`purge()`](./actiontracker.html#purge)
+to have the
actiontracker send the calls.
```xml
@@ -230,4 +231,4 @@ When a user edits data, for instance user information, all the changes are
seen as one edit and put on the undo stack as a single action. Thus clicking
undo will undo the entire transaction, not just the last change done by that
user in the edit window. Transaction support both optimistic and pessimistic
-locking. For more information on transactions see {@link baseclass.transaction}.
+locking.
View
7 doc/terms/baseclass.md
@@ -30,8 +30,9 @@ A baseclass in Ajax.org Platform (APF) is a class that
The `apf.Class` baseclass provides all basic features a APF element needs, such
as event system, property binding and multiple inheritance with state defined
by each baseclass.
- By setting the prototype of a function to an instance of apf.Class
- these <i title="an inherited characteristic (merriam-webster)">traits</i> are
+
+ By setting the prototype of a function to an instance of `apf.Class`,
+ these traits are
transferred to your class.
## API
@@ -49,7 +50,7 @@ A baseclass in Ajax.org Platform (APF) is a class that
There is a class tree that you can use to create your own elements. For
instance to create a visible element that uses skinning you can inherit from
- apf.Presentation:
+ `apf.Presentation`:
```javascript
var myElement = function(){
View
12 doc/terms/bindingrules.md
@@ -8,8 +8,8 @@ Binding rules determine how an element displays the data that
Binding rules are part of the [smartbinding concept](./smartbinding.html).
- Let's take a simple example, that of a {@link element.textbox textbox}. A
- textbox has a {@link element.textbox.attribute.value value attribute}. This
+ Let's take a simple example, that of a [textbox](./textbox.html). A
+ textbox has a `value` attribute. This
attribute can be set like this:
```xml
@@ -39,7 +39,7 @@ Binding rules determine how an element displays the data that
Each attribute on an element can be bound to data by using the attribute
name as the name of the binding rule. In the next example, the visible
- attribute of a textbox is based on the availability of a {@link term.datanode data node}:
+ attribute of a textbox is based on the availability of a [data node](./datanode.html):
```xml
<a:model>
@@ -128,7 +128,7 @@ Binding rules determine how an element displays the data that
## Processors
There are several ways to convert the data retrieved from the xml data into
- the needed string or boolean. The following example uses {@link term.livemarkup live markup}
+ the needed string or boolean. The following example uses [live markup](./livemarkup.html)
to determine the icon by the extension of the filename:
```xml
@@ -183,8 +183,8 @@ Binding rules determine how an element displays the data that
## Extending
- Two special binding rules are the {@link baseclass.databinding.binding.load load}
- and the {@link element.tree.binding.insert insert} bindings. These bindings
+ Two special binding rules are the load
+ and the insert bindings. These bindings
are used to load and insert new data into the data bound to the element that
uses them. With these rules an application can start out with only a bit of
data and when the user needs it extends the data. A simple example is that of
View
1  doc/terms/eachnode.md
@@ -30,6 +30,7 @@ each nodes of the list. This list will display three items.
```
## Remarks
+
A somewhat advanced topic is understanding how an element can use the
each [binding rule](./bindingrule.html). For the tree, these binding rules
can be used to create a virtual tree mapping of the XML.
View
100 doc/terms/locking.md
@@ -1,67 +1,67 @@
# Locking
[A lock](http://en.wikipedia.org/wiki/Lock_(computer_science))
- is a mechanism for enforcing limits on access to a resource in a
- multi-user environment. Locks are one way of enforcing concurrency
- control policies. Ajax.org Platform (APF) has support for locking in
- combination with [action rules](./actionrules.md). There are two
- types of locks; pessimistic and optimistic locks. Descriptions below are
- from [wikipedia](http://en.wikipedia.org/wiki/Lock_(computer_science)).
+is a mechanism for enforcing limits on access to a resource in a
+multi-user environment. Locks are one way of enforcing concurrency
+control policies. Ajax.org Platform (APF) has support for locking in
+combination with [action rules](./actionrules.md). There are two
+types of locks; pessimistic and optimistic locks. Descriptions below are
+from [wikipedia](http://en.wikipedia.org/wiki/Lock_(computer_science)).
## Optimistic
- This allows multiple concurrent users access to the database whilst the
- system keeps a copy of the initial-read made by each user. When a user
- wants to update a record, the application determines whether another user
- has changed the record since it was last read. The application does this
- by comparing the initial-read held in memory to the database record to
- verify any changes made to the record. Any discrepancies between the
- initial-read and the database record violates concurrency rules and hence
- causes the system to disregard any update request. An error message is
- generated and the user is asked to start the update process again.
- It improves database performance by reducing the amount of locking
- required, thereby reducing the load on the database server. It works
- efficiently with tables that require limited updates since no users are
- locked out. However, some updates may fail. The downside is constant
- update failures due to high volumes of update requests from multiple
- concurrent users - it can be frustrating for users.
-
- For optimistic locking APF can run as if there would be no locking.
- Changed data is sent to the server and is either successfully saved or
- not. When the action isn't changed and the server returns an error code
- the `apf.actiontracker` **automatically
- reverts the change**.
+This allows multiple concurrent users access to the database whilst the
+system keeps a copy of the initial-read made by each user. When a user
+wants to update a record, the application determines whether another user
+has changed the record since it was last read. The application does this
+by comparing the initial-read held in memory to the database record to
+verify any changes made to the record. Any discrepancies between the
+initial-read and the database record violates concurrency rules and hence
+causes the system to disregard any update request. An error message is
+generated and the user is asked to start the update process again.
+It improves database performance by reducing the amount of locking
+required, thereby reducing the load on the database server. It works
+efficiently with tables that require limited updates since no users are
+locked out. However, some updates may fail. The downside is constant
+update failures due to high volumes of update requests from multiple
+concurrent users - it can be frustrating for users.
+
+For optimistic locking APF can run as if there would be no locking.
+Changed data is sent to the server and is either successfully saved or
+not. When the action isn't changed and the server returns an error code
+the `apf.actiontracker` **automatically
+reverts the change**.
## Pessimistic
- This is whereby a user who reads a record with the intention of updating
- it, places an exclusive lock on the record to prevent other users from
- manipulating it. This means no one else can manipulate that record until
- the user releases the lock. The downside is that users can be locked out
- for a long time thereby causing frustration.
-
- For pessimistic locking add the locking attribute to the {@link term.action action rules}
- that need it. The following example shows a lock request for a rename
- action on a file browser tree.
-
- ```xml
- <a:rename set="..." lock="{comm.lockFile([@path], unlock)}" />
- ```
-
- The unlock variable is true when the lock needs to be released. This is
- done when the action was cancelled after getting a lock. For instance
- when the user presses escape while renaming.
+This is whereby a user who reads a record with the intention of updating
+it, places an exclusive lock on the record to prevent other users from
+manipulating it. This means no one else can manipulate that record until
+the user releases the lock. The downside is that users can be locked out
+for a long time thereby causing frustration.
+
+For pessimistic locking add the locking attribute to the [action rules](./actionrules.html)
+that need it. The following example shows a lock request for a rename
+action on a file browser tree.
+
+```xml
+ <a:rename set="..." lock="{comm.lockFile([@path], unlock)}" />
+```
+
+The unlock variable is true when the lock needs to be released. This is
+done when the action was cancelled after getting a lock. For instance
+when the user presses escape while renaming.
### MultiUser
- In multi-user environments it can be handy
- to be signalled of changes by others within the application. For more
- information on this please look at `apf.remote`.
+In multi-user environments it can be handy
+to be signalled of changes by others within the application. For more
+information on this please look at `apf.remote`.
### Remarks
- During offline works pessimistic locks will always fail. If the application
- does not use {@link element.remote remote smart bindings} the developer
- should reload the part of the content for which the lock failed. See `databinding@lockfailed`.
+During offline works pessimistic locks will always fail. If the application
+does not use remote smart bindings the developer
+should reload the part of the content for which the lock failed. See `databinding@lockfailed`.
Note: APF understands the status codes specified in [RFC4918](http://tools.ietf.org/html/rfc4918#section-9.10.6) for the locking implementation
View
2  doc/terms/propertybinding.md
@@ -8,7 +8,7 @@ With property binding you can define the way a
the property will always be kept up to date. This means that when one of the
dependent properties changes, the property is recalculated.
- ## Example
+ #### Example
Let me give you an example to make it a bit straightforward. This example
sets the visibility of the slider based on the state of the checkbox.
View
4 doc/terms/smartbinding.md
@@ -14,7 +14,7 @@ See also more information about [binding rules](./binding.html) and [action rule
## Model:
The model is the place where your xml data resides. Data is loaded into the
-model using a {@link term.datainstruction data instruction} as the following
+model using a [data instruction](./datainstruction.html) as the following
example shows:
```xml
@@ -56,7 +56,7 @@ The actions element is a container for action rules. Action rules influence
and trigger several parts of the user interaction.
* It determines whether a user action can be executed on the bound and/or
- selected {@link term.datanode data node}.
+ selected [data node](./datanode.html).
* It dispatches events, before and after the data is changed.
* It creates a [command object](http://en.wikipedia.org/wiki/Command_pattern)
that is pushed on the undo stack of the [action tracker](./actiontracker.html)
View
12 elements/bindingrule.js
@@ -22,10 +22,12 @@
//#ifdef __WITH_DATABINDING
/**
- * @define bindings element containing all the binding rules for the data
+ * An element containing all the binding rules for the data
* bound elements referencing this element.
- * Example:
- * <code>
+ *
+ * #### Example
+ *
+ * ```xml
* <a:model id="mdlList">
* <data>
* <item date="2009-11-12" deleted="0"></item>
@@ -43,9 +45,9 @@
* height = "200"
* model = "mdlList"
* bindings = "bndFolders" />
- * </code>
+ * ```
+ *
* @see apf.smartbinding
- *
* @baseclass
*
* @author Ruben Daniels (ruben AT ajax DOT org)
Please sign in to comment.
Something went wrong with that request. Please try again.