This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-docs.git


The following commit(s) were added to refs/heads/master by this push:
     new 3ed1379  crux: added crux configuration page
3ed1379 is described below

commit 3ed13798caae8ac163e34aadf89d4e438054132f
Author: Carlos Rovira <[email protected]>
AuthorDate: Tue Feb 18 00:08:55 2020 +0100

    crux: added crux configuration page
---
 _data/toc.json                  |  3 ++
 libraries/crux.md               |  1 +
 libraries/crux/configuration.md | 77 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 81 insertions(+)

diff --git a/_data/toc.json b/_data/toc.json
index e735b1f..f0f16c2 100644
--- a/_data/toc.json
+++ b/_data/toc.json
@@ -167,6 +167,9 @@
                     "children": [
                         {
                             "path": "libraries/crux/quickstart.md"
+                        },
+                        {
+                            "path": "libraries/crux/configuration.md"
                         }
                     ]
                 },
diff --git a/libraries/crux.md b/libraries/crux.md
index d9053b1..be957ef 100644
--- a/libraries/crux.md
+++ b/libraries/crux.md
@@ -34,6 +34,7 @@ Apache Royale Crux provides:
 Start here:
 
 - [Quick Start](libraries/crux/quickstart)
+- [Configuration](libraries/crux/configuration)
 
 for your Apache Royale project.
 
diff --git a/libraries/crux/configuration.md b/libraries/crux/configuration.md
new file mode 100644
index 0000000..024abee
--- /dev/null
+++ b/libraries/crux/configuration.md
@@ -0,0 +1,77 @@
+---
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+layout: docpage
+title: Configuration
+description: Crux Configuration
+permalink: /libraries/crux/configuration
+---
+
+# Crux Configuration
+
+Learn how to configure Crux
+
+Page Contents:
+
+* [Configuration Overview](libraries/crux/configuration.html#overview)
+<!-- * [Logging] -->
+* [setUpEventType, 
setUpEventPhase](libraries/crux/configuration.html#setup-event)
+* [tearDownEventType, 
tearDownEventPhase](libraries/crux/configuration.html#tear-down)
+* [Default Dispatcher](libraries/crux/configuration.html#default-dispatcher)
+
+## Configuration Overview {#overview}
+
+You configure each Crux instance using the `CruxConfig` class. It allows you 
to modify common settings, and to provide values that allow your tags and code 
elsewhere to be more concise. Below is an example with all properties shown. 
Where applicable, they have been set to their default values. However, in most 
cases, the default values should work fine (see the note below on Configuration 
Defaults).
+
+```mxml
+<crux:Crux>
+    <crux:beanProviders>
+        <local:MyBeans/>
+    </crux:beanProviders>
+ 
+    <crux:config>
+        <crux:CruxConfig
+            setUpEventType="{ Event.ADDED_TO_STAGE }"
+            setUpEventPhase="{ EventPhase.CAPTURING_PHASE }"
+            tearDownEventType="{ Event.REMOVED_FROM_STAGE }"
+            tearDownEventPhase="{ EventPhase.CAPTURING_PHASE }"
+            eventPackages="com.foo.event.*, org.bar.event.*"
+            viewPackages="com.foo.view.*, org.bar.view.*"
+            defaultFaultHandler="handleUnhandledFaults"
+            defaultDispatcher="global" />
+    </crux:config>
+</crux:Crux>
+```
+
+> **Configuration Defaults**. Unless you are specifying your own set up and 
tear down values, the only configuration values that commonly need to be set 
are `eventPackages` and `viewPackages`. If you are using Crux's support for 
server communication, you may also set `defaultFaultHandler`.
+
+> **Specifying Packages**. Note that due to limitations in the _AS3_ 
reflection API, when you define `eventPackages`, you must specify each package 
individually. Children of your specified packages cannot be resolved and must 
be explicitly set. This limitation does not apply to `viewPackages` because 
they are handled differently, but for consistency it may be useful to use the 
same rules to define both sets of packages.
+
+<!-- ## Logging
+
+As you can see above, Crux includes a basic logging target called 
SwizTraceTarget to trace debugging information to the console. Due to the way 
the MXMLC compiler works, it was not possible to use the built-in Royale 
logging target(s), because it increases the size of the Crux swc by an 
unacceptable amount. If necessary, you can extend the AbstractSwizLoggingTarget 
to customize the output. -->
+
+## setUpEventType, setUpEventPhase {#setup-event}
+
+These properties configure the listener that Crux will use to trigger the set 
up of views (assuming they are eligible) to inject dependencies, create event 
handlers, etc. The default is a capture phase listener (to catch all views 
regardless of their place in the display list hierarchy) for the 
`Event.ADDED_TO_STAGE` event.<!-- , with a priority of 50.  -->
+
+## tearDownEventType, tearDownEventPhase {#tear-down}
+
+These properties configure the listener that Crux will use to trigger the 
tearing down of views to clean up injected dependencies, remove event handlers, 
etc. The default is a capture phase listener for the `Event.REMOVED_FROM_STAGE` 
event.<!-- , with a priority of 50. -->
+
+## Default Dispatcher {#default-dispatcher}
+
+The default dispatcher value is "global". This means that in the case where a 
Crux instance is the child of another Crux instance, the child will use the 
parent dispatcher. This allows for easy communication between Crux instances, 
since they all share the same event dispatcher. However, if you want to force a 
child Crux to use it's own dispatcher, you can set this value to "local". In 
most cases, developers should not need to change the default value ("global"). 
More information on pare [...]

Reply via email to