diff --git a/v/0.5.0-rc.2/LICENSE.txt b/v/0.5.0-rc.2/LICENSE.txt new file mode 100644 index 000000000..99953f77b --- /dev/null +++ b/v/0.5.0-rc.2/LICENSE.txt @@ -0,0 +1,189 @@ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this content except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + (This is included below for reference.) + + 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. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + diff --git a/v/0.5.0-rc.2/dev/build/eclipse.include.md b/v/0.5.0-rc.2/dev/build/eclipse.include.md new file mode 100644 index 000000000..700f975eb --- /dev/null +++ b/v/0.5.0-rc.2/dev/build/eclipse.include.md @@ -0,0 +1,12 @@ + +- Maven Plugin: m2e from [download.eclipse.org/technology/m2e/releases](http://download.eclipse.org/technology/m2e/releases) + (typically availabile in the default Eclipse update site set) + +- Git Plugin: egit from [download.eclipse.org/egit/updates](http://download.eclipse.org/egit/updates) + (typically availabile in the default Eclipse update site set) + +- Groovy Plugin: GRECLIPSE from [dist.springsource.org/release/GRECLIPSE/e4.2](http://dist.springsource.org/release/GRECLIPSE/e4.2) + (or [for Eclipse 3.7](http://dist.springsource.org/release/GRECLIPSE/e3.7)) + You can even visit the [groovy update site](http://groovy.codehaus.org/Eclipse+Plugin) for more details. + +- TestNG Plugin: beust TestNG from [beust.com/eclipse](http://beust.com/eclipse) diff --git a/v/0.5.0-rc.2/dev/build/ide.html b/v/0.5.0-rc.2/dev/build/ide.html new file mode 100644 index 000000000..2e7ebbe85 --- /dev/null +++ b/v/0.5.0-rc.2/dev/build/ide.html @@ -0,0 +1,927 @@ + + + + + IDE Setup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

IDE Setup

+ +

Gone are the days when IDE integration always just works... Maven and Eclipse fight, +neither quite gets along perfectly with Groovy, +git branch switches (sooo nice) can be slow, etc etc.

+ +

But with a bit of a dance the IDE can still be your friend, +making it much easier to run tests and debug.

+ +

Here are some general tips:

+ +
    +
  • Add your favourite plugins for Maven, Groovy, Git and JavaScript, if necessary

  • +
  • Turn off auto-rebuild if it bothers you

  • +
  • Don't always trust the IDE to build correctly; if you hit a snag, +do a command-line mvn clean install (optionally with -DskipTests) +then refresh the project (optionally regenerate dependencies). +Sometimes closing projects (so that it reads from your ~/.m2/repository) helps.

  • +
+ + +

See instructions below for specific IDEs.

+ +

Eclipse

+ +

If you're an Eclipse user, you'll probably want the Groovy, Maven (m2e), Git, JavaScript and TestNG plugins. +Via Help -> Install New Software, or from the Eclipse Marketplace, +we recommend:

+ + + + +

As of this writing, with Eclipse 4.2, m2e 1.1, and GrEclipse 2.7, +the codebase has been imported (Import -> Existing Maven Projects) +and successfully run with no errors. +However this isn't always the case.

+ +

If you encounter issues, the following hints may be helpful:

+ +
    +
  • If m2e reports import problems, it is usually okay (even good) to mark all to "Resolve All Later". +The build-helper connector is useful if you're prompted for it, but +do not install the Tycho OSGi configurator (this causes show-stopping IAE's, and we don't need Eclipse to make bundles anyway). +You can manually mark as permanently ignored certain errors; +this updates the pom.xml (and should be current).

  • +
  • m2e likes to put excluding="**" on `resourcesdirectories; if you're seeing funny missing files +(things like not resolving jclouds/aws-ec2 locations or missing WARs), try building clean install +from the command-line then doing Maven -> Update Project (clean uses a maven-replacer-plugin to fix.classpath``s). +Alternatively you can go through and remove these manually in Eclipse (Build Path -> Configure) +or the filesystem, or use +the following command to remove these rogue blocks in the generated .classpath files:

    + +

    find . -name .classpath -exec sed -i.bak 's/[ ]*..cluding="[\*\/]*\(\.java\)*"//g' {} \;

  • +
  • Getting the web console project to build nicely can be trickier.

  • +
  • You may need to ensure src/main/{java,resources} is created in each project dir, +if (older versions) complain about missing directories, +and the same for src/test/{java,resources} if there are tests (src/test exists):

    + +

    find . \( -path "*/src/main" -or -path "*/src/test" \) -exec echo {} \; -exec mkdir -p {}/{java,resources} \;

  • +
  • You may need to add the groovy nature (or even java nature) to projects; +with some maven-eclipse plugins this works fine, +but for others (older ones) you may need to handcraft these +(either right-click the project in the Package Explorer and choose Configure, +or edit the .project manually adding it to the project properties). +The tips for jclouds maven-eclipse might be helpful.

  • +
+ + +

<!-- + FIXME Relates to old Grails, rather than new JavaScript web-console. + Should we just delete this section, or does any of it apply to the new web-console?

+ +
    +
  • Getting the web console project to build nicely can be trickier. +If you're lucky it will just work... +But you may find you have to first build from the command-line, +then add all the source folders, and target/plugin-classes as a class file folder. +Easier may be just to run "grails run-app" in the directory to launch it (plus that does dynamic restarts), +and use the IDE as just a text editor (or use a different text editor for that project only). +Note too that some jiggery-pokery may currently be needed to get Groovy 1.8 playing nicely with Grails 1.3. +-->
  • +
+ + +

If the pain starts to be too much, come find us on IRC #brooklyncentral or elsewhere and we can hopefully share our pearls. +(And if you have a tip we haven't mentioned please let us know that too!)

+ +

Intelli-J IDEA

+ +

Tips from Intelli-J users wanted!

+ +

Netbeans

+ +

Tips from Netbeans users wanted!

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/build/index.html b/v/0.5.0-rc.2/dev/build/index.html new file mode 100644 index 000000000..051d25522 --- /dev/null +++ b/v/0.5.0-rc.2/dev/build/index.html @@ -0,0 +1,942 @@ + + + + + Maven Build + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Maven Build

+ +

The Basics

+ +

To build the code, you need Maven (v3) installed and Java (1.6). +With that in place, you should be able to build everything with a:

+ +
brooklyn% mvn clean install
+
+ + +

Key things to note if you're new to Maven:

+ +
    +
  • You may need more JVM memory, e.g. at the command-line (or in .profile):

    + +

    export MAVEN_OPTS="-Xmx1024m -Xms512m -XX:MaxPermSize=256m

  • +
  • You can do this in specific projects as well.

  • +
  • Add -DskipTests to skip tests.

  • +
  • Run -PIntegration to run integration tests, or -PLive to run live tests +(tests described here)

  • +
  • Nearly all the gory details are in the root pom.xml, which is referenced by child project poms.

  • +
  • You can also open and use the code in your favourite IDE, +although you may hit a few snags +(that link has some tips for resolving them too)

  • +
+ + +

Other Handy Hints

+ +
    +
  • On some Ubuntu (e.g. 10.4 LTS) maven v3 is not currently available from the repositories. +Some instructions for installing at are at superuser.com.

  • +
  • The mvnf script +(get the gist here) +simplifies building selected projects, so if you just change something in software-webapp +and then want to re-run the examples you can do:

    + +

    examples/simple-web-cluster% mvnf ../../{software/webapp,usage/all}

  • +
+ + +

Appendix: Sample Output

+ +

A healthy build will look something like the following, +including a few warnings (which we have looked into and +understand to be benign and hard to get rid of them, +although we'd love to if anyone can help!):

+ +
brooklyn% mvn clean install
+[INFO] Scanning for projects...
+[INFO] ------------------------------------------------------------------------
+[INFO] Reactor Build Order:
+[INFO] 
+[INFO] Brooklyn Parent Project
+[INFO] Brooklyn API
+[INFO] Brooklyn Test Support
+[INFO] Brooklyn Core
+
+...
+
+Mar 29, 2012 4:30:17 PM java.util.jar.Attributes read
+WARNING: Duplicate name in Manifest: Manifest-Version.
+Ensure that the manifest does not have duplicate entries, and
+that blank lines separate individual sections in both your
+manifest and in the META-INF/MANIFEST.MF entry in the jar file.
+
+...
+
+[WARNING] We have a duplicate org/jclouds/cloudsigma/CloudSigmaAsyncClient.class in 
+/Users/alex/.m2/repository/org/jclouds/provider/cloudsigma-zrh/1.4.0/cloudsigma-zrh-1.4.0.jar
+
+...
+
+[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ brooklyn-all ---
+[WARNING] JAR will be empty - no content was marked for inclusion!
+
+...
+
+[INFO] ------------------------------------------------------------------------
+[INFO] Reactor Summary:
+[INFO] 
+[INFO] Brooklyn Parent Project ........................... SUCCESS [0.813s]
+[INFO] Brooklyn API ...................................... SUCCESS [6.115s]
+[INFO] Brooklyn Test Support ............................. SUCCESS [4.592s]
+[INFO] Brooklyn Core ..................................... SUCCESS [1:20.536s]
+[INFO] Brooklyn Policies ................................. SUCCESS [57.996s]
+[INFO] Brooklyn Software Base ............................ SUCCESS [29.869s]
+[INFO] Brooklyn OSGi Software Entities ................... SUCCESS [9.392s]
+[INFO] Brooklyn Web App Software Entities ................ SUCCESS [49.606s]
+[INFO] Brooklyn Messaging Software Entities .............. SUCCESS [12.198s]
+[INFO] Brooklyn NoSQL Data Store Software Entities ....... SUCCESS [9.205s]
+[INFO] Brooklyn Database Software Entities ............... SUCCESS [7.815s]
+[INFO] Brooklyn Whirr Base Entities ...................... SUCCESS [21.292s]
+[INFO] Brooklyn Hadoop System Entities ................... SUCCESS [9.972s]
+[INFO] Brooklyn OpenShift PaaS System Entities ........... SUCCESS [11.857s]
+[INFO] Brooklyn Web Console .............................. SUCCESS [1:00.814s]
+[INFO] Brooklyn Launcher ................................. SUCCESS [1:00.603s]
+[INFO] Brooklyn All Things ............................... SUCCESS [23.358s]
+[INFO] hello-world-webapp Maven Webapp ................... SUCCESS [2.521s]
+[INFO] Brooklyn Simple Web Cluster Example ............... SUCCESS [5.860s]
+[INFO] Brooklyn Hadoop and Whirr Example ................. SUCCESS [4.892s]
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 7:52.328s
+[INFO] Finished at: Thu Mar 29 16:30:17 BST 2012
+[INFO] Final Memory: 180M/528M
+[INFO] ------------------------------------------------------------------------
+
+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/build/tests.html b/v/0.5.0-rc.2/dev/build/tests.html new file mode 100644 index 000000000..d3b4d1e48 --- /dev/null +++ b/v/0.5.0-rc.2/dev/build/tests.html @@ -0,0 +1,838 @@ + + + + + Tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Tests

+ +

We have the following tests groups:

+ +
    +
  • normal -- should run quickly, not need internet, and not side effect the machine (apart from a few /tmp files)
  • +
  • integration -- deploys locally, may read and write from internet, takes longer + if you change an entity, rerun the relevant integration test to make sure all is well!
  • +
  • live -- deploys remotely, may provision machines (but should clean up, getting rid of them in a try block)
  • +
+ + + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/build/toc.json b/v/0.5.0-rc.2/dev/build/toc.json new file mode 100644 index 000000000..fca9b7070 --- /dev/null +++ b/v/0.5.0-rc.2/dev/build/toc.json @@ -0,0 +1,8 @@ +[ +{ "title": "Maven", + "file": "{{ site.url }}/dev/build/index.html" }, +{ "title": "IDE", + "file": "{{ site.url }}/dev/build/ide.html" }, +{ "title": "Tests", + "file": "{{ site.url }}/dev/build/tests.html" } +] diff --git a/v/0.5.0-rc.2/dev/code/entity.html b/v/0.5.0-rc.2/dev/code/entity.html new file mode 100644 index 000000000..17b9d71f0 --- /dev/null +++ b/v/0.5.0-rc.2/dev/code/entity.html @@ -0,0 +1,910 @@ + + + + + Writing an Entity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Writing an Entity

+ +

Things To Know

+ +

All entities have an interface and an implementation. The methods on the interface +are its effectors; the interface also defines its sensors.

+ +

Entities are created through the management context (rather than calling the
+constructor directly). This returns a proxy for the entity rather than the real +instance, which is important in a distributed management plane.

+ +

All entity implementations inherit from AbstractEntity, +often through one of the following:

+ +
    +
  • SoftwareProcess: if it's a software process
  • +
  • VanillaJavaApp: if it's a plain-old-java app
  • +
  • JavaWebAppSoftwareProcess: if it's a JVM-based web-app
  • +
  • WhirrEntity: if it's a service launched using Whirr
  • +
  • DynamicGroup: if it's a collection of other entities
  • +
+ + +

Software-based processes tend to use drivers to install and +launch the remote processes onto locations which support that driver type. +For example, AbstractSoftwareProcessSshDriver is a common driver superclass, +targetting SshMachineLocation (a machine to which Brooklyn can ssh). +The various SoftwareProcess entities above (and some of the exemplars +listed at the end of this page) have their own dedicated drivers.

+ +

Finally, there are a collection of traits, such as Resizable, +in the package brooklyn.entity.trait. These provide common +sensors and effectors on entities, supplied as interfaces. +Choose one (or more) as appropriate.

+ +

Key Steps

+ +

So to get started:

+ +
    +
  1. Create your entity interface, extending the appropriate selection from above, +to define the effectors and sensors.
  2. +
  3. Include an annotation like @ImplementedBy(YourEntityImpl.class) on your interface, +where YourEntityImpl will be the class name for your entity implementation.
  4. +
  5. Create your entity class, implementing your entity interface and extending the +classes for your chosen entity super-types. Naming convention is a suffix "Impl" +for the entity class.
  6. +
  7. Create a driver interface, again extending as appropriate (e.g. SoftwareProcessDriver). +The naming convention is to have a suffix "Driver".
  8. +
  9. Create the driver class, implementing your driver interface, and again extending as appropriate. +Naming convention is to have a suffix "SshDriver" for an ssh-based implementation. +The correct driver implementation is found using this naming convention, or via custom +namings provided by the BasicEntityDriverFactory.
  10. +
  11. Wire the public Class getDriverInterface() method in the entity implementation, to specify +your driver interface.
  12. +
  13. Provide the implementation of missing lifecycle methods in your driver class (details below)
  14. +
  15. Connect the sensors from your entity (e.g. overriding connectSensors() of SoftwareProcessImpl).. +See the sensor feeds, such as HttpFeed and JmxFeed.
  16. +
+ + +

Any JVM language can be used to write an entity. However use of pure Java is encouraged for +entities in core brooklyn.

+ +

Helpful References

+ +

A few handy pointers will help make it easy to build your own entities. +Check out some of the exemplar existing entities +(note, some of the other entities use deprecated utilities and a deprecated class +hierarchy; it is suggested to avoid these, looking at the ones below instead):

+ +
    +
  • JBoss7Server
  • +
  • MySqlNode
  • +
  • OpenShift
  • +
+ + +

You might also find the following helpful:

+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/code/index.html b/v/0.5.0-rc.2/dev/code/index.html new file mode 100644 index 000000000..16178b416 --- /dev/null +++ b/v/0.5.0-rc.2/dev/code/index.html @@ -0,0 +1,951 @@ + + + + + Code Structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Code Structure

+ +

The Basics

+ + + + +

Brooklyn is available at GitHub brooklyncentral/brooklyn. Check it out using:

+ + + + +
git clone git@github.com:brooklyncentral/brooklyn.git
+
+ + + + +

You'll find versions in branches, and examples in the examples sub-dir. +These examples are pushed to the brooklyn-examples GitHub project when a version is released.

+ + + + +

Project Structure

+ + + + +

Brooklyn is split into the following projects and subprojects:

+ + + + +
    +
  • api: the pure-Java interfaces for interacting with the system
  • +
  • core: the base class implementations for entities and applications, entity traits, locations, policies, sensor and effector support, tasks, and more
  • +
  • policies: collection of useful policies for automating entity activity
  • +
  • software: entities which are mainly launched by launched software processes on machines, and collections thereof + +
      +
    • base: software process lifecycle abstract classes and drivers (e.g. SSH)
    • +
    • webapp: web servers (JBoss, Tomcat), load-balancers (Nginx), and DNS (Geoscaling)
    • +
    • database: relational databases (SQL)
    • +
    • nosql: datastores other than RDBMS/SQL (often better in distributed environments)
    • +
    • messaging: messaging systems, including Qpid, Apache MQ
    • +
    • ...
    • +
    +
  • +
  • systems: entities which are mainly created or managed by other systems, where Brooklyn integrates with those (multi-machine) systems and is removed from the processes + +
      +
    • whirr: base Whirr integration, and entities built on Whirr such as the configurable hadoop deployment
    • +
    • openshift: entity for deploying and managing OpenShift webapps
    • +
    • ...
    • +
    +
  • +
  • usage: projects which make Brooklyn easier to use, either for end-users or Brooklyn developers + +
      +
    • all: maven project to supply a shaded JAR (containing all dependencies) for convenience
    • +
    • cli: backing implementation for Brooklyn's command line interface
    • +
    • dist: builds brooklyn as a downloadable .zip and .tar.gz
    • +
    • jsgui: Javascript web-app for the brooklyn management web console (builds a WAR)
    • +
    • launcher: for launching brooklyn, either using a main method or invoked from the cli project
    • +
    • qa: longevity and stress tests
    • +
    • rest: implementation of brooklyn's REST api
    • +
    • scripts: various scripts useful for building, updating, etc. (see comments in the scripts)
    • +
    • test-support: provides support for tests, used by nearly all projects in scope test
    • +
    +
  • +
  • docs: the markdown source code for this documentation, as described here
  • +
  • examples: some canonical examples, as listed here
  • +
  • sandbox: various projects, entities, and policies which the Brooklyn Project is incubating
  • +
+ + + + +

Next Steps

+ + + + +

If you're interested in building and editing the code, check out:

+ + + + + + + + + +

If you want to start writing your own policies and entities, have a look at:

+ + + + + + + + + +

Where things aren't documented please ask us at +brooklyn-dev@googlegroups.com +so we can remedy this!

+ + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/code/index.include.md b/v/0.5.0-rc.2/dev/code/index.include.md new file mode 100644 index 000000000..62302f8f3 --- /dev/null +++ b/v/0.5.0-rc.2/dev/code/index.include.md @@ -0,0 +1,65 @@ +## The Basics + +Brooklyn is available at [GitHub brooklyncentral/brooklyn](http://github.com/brooklyncentral/brooklyn). Check it out using: + +{% highlight bash %} +git clone git@github.com:brooklyncentral/brooklyn.git +{% endhighlight %} + +You'll find versions in branches, and examples in the **examples** sub-dir. +These examples are pushed to the [brooklyn-examples](http://github.com/brooklyncentral/brooklyn-examples) GitHub project when a version is released. + + +## Project Structure + +Brooklyn is split into the following projects and subprojects: + +* **``api``**: the pure-Java interfaces for interacting with the system +* **``core``**: the base class implementations for entities and applications, entity traits, locations, policies, sensor and effector support, tasks, and more +* **``policies``**: collection of useful policies for automating entity activity +* **``software``**: entities which are mainly launched by launched software processes on machines, and collections thereof + * **``base``**: software process lifecycle abstract classes and drivers (e.g. SSH) + * **``webapp``**: web servers (JBoss, Tomcat), load-balancers (Nginx), and DNS (Geoscaling) + * **``database``**: relational databases (SQL) + * **``nosql``**: datastores other than RDBMS/SQL (often better in distributed environments) + * **``messaging``**: messaging systems, including Qpid, Apache MQ + * **...** +* **``systems``**: entities which are mainly created or managed by other systems, where Brooklyn integrates with those (multi-machine) systems and is removed from the processes + * **``whirr``**: ``base`` Whirr integration, and entities built on Whirr such as the configurable ``hadoop`` deployment + * **``openshift``**: entity for deploying and managing OpenShift webapps + * **...** +* **``usage``**: projects which make Brooklyn easier to use, either for end-users or Brooklyn developers + * **all**: maven project to supply a shaded JAR (containing all dependencies) for convenience + * **cli**: backing implementation for Brooklyn's command line interface + * **dist**: builds brooklyn as a downloadable .zip and .tar.gz + * **jsgui**: Javascript web-app for the brooklyn management web console (builds a WAR) + * **launcher**: for launching brooklyn, either using a main method or invoked from the cli project + * **qa**: longevity and stress tests + * **rest**: implementation of brooklyn's REST api + * **scripts**: various scripts useful for building, updating, etc. (see comments in the scripts) + * **test-support**: provides support for tests, used by nearly all projects in scope ``test`` +* **``docs``**: the markdown source code for this documentation, as described [here]({{site.url}}/dev/tips/update-docs.html) +* **``examples``**: some canonical examples, as listed [here]({{site.url}}/use/examples) +* **``sandbox``**: various projects, entities, and policies which the Brooklyn Project is incubating + + +## Next Steps + +If you're interested in building and editing the code, check out: + +* [Maven setup](../build/index.html) +* [IDE setup](../build/ide.html) +* [Tests](../build/tests.html) +* [Tips](../tips/index.html) + +If you want to start writing your own policies and entities, have a look at: + +* [Writing a Brooklyn Policy](policy.html) +* [Writing a Brooklyn Entity](entity.html) +* Or see the [User Guide]({{ site.url }}/use/guide/index.html) + on [policies]({{ site.url }}/use/guide/policies/index.html) + and [entities]({{ site.url }}/use/guide/entities/index.html) + +Where things aren't documented **please ask us** at +[brooklyn-dev@googlegroups.com](http://groups.google.com/group/brooklyn-dev) +so we can remedy this! diff --git a/v/0.5.0-rc.2/dev/code/policy.html b/v/0.5.0-rc.2/dev/code/policy.html new file mode 100644 index 000000000..f94850c52 --- /dev/null +++ b/v/0.5.0-rc.2/dev/code/policy.html @@ -0,0 +1,867 @@ + + + + + Writing a Policy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Writing a Policy

+ +

Policies perform the active management enabled by Brooklyn.
+Each policy instance is associated with an entity, +and at runtime it will typically subscribe to sensors on that entity or children, +performing some computation and optionally actions when a subscribed sensor event occurs. +This action might be invoking an effector or emitting a new sensor, +depending the desired behvaiour is.

+ +

Writing a policy is straightforward. +Simply extend AbstractPolicy, +overriding the setEntity method to supply any subscriptions desired:

+ +
    @Override
+    public void setEntity(EntityLocal entity) {
+        super.setEntity(entity)
+        subscribe(entity, TARGET_SENSOR, this)
+    }
+
+ + +

and supply the computation and/or activity desired whenever that event occurs:

+ +
    @Override
+    public void onEvent(SensorEvent<Integer> event) {
+        int val = event.getValue()
+        if (val % 2 == 1)
+            entity.sayYoureOdd();
+    }
+
+ + +

You'll want to do more complicated things, no doubt, +like access other entities, perform multiple subscriptions, +and emit other sensors -- and you can. +See the source code, and see some commonly used policies +in AutoScalerPolicy and RollingMeanEnricher.

+ +

One rule of thumb, to close on: +try to keep policies simple, and compose them together at runtime; +for instance, if a complex computation triggers an action, +define one enricher policy to aggregate other sensors and emit a new sensor, +then write a second policy to perform that action.

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/code/toc.json b/v/0.5.0-rc.2/dev/code/toc.json new file mode 100644 index 000000000..d599dbe72 --- /dev/null +++ b/v/0.5.0-rc.2/dev/code/toc.json @@ -0,0 +1,10 @@ +[ +{ "title": "Structure", + "file": "{{ site.url }}/dev/code/index.html" }, +{ "title": "Writing an Entity", + "file": "{{ site.url }}/dev/code/entity.html" }, +{ "title": "Writing a Policy", + "file": "{{ site.url }}/dev/code/policy.html" }, +{ "title": "brooklyn.git (github)", + "file": "http://github.com/brooklyncentral/brooklyn" } +] diff --git a/v/0.5.0-rc.2/dev/how-to-contrib.html b/v/0.5.0-rc.2/dev/how-to-contrib.html new file mode 100644 index 000000000..2eea98b26 --- /dev/null +++ b/v/0.5.0-rc.2/dev/how-to-contrib.html @@ -0,0 +1,851 @@ + + + + + How to Contribute + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

How to Contribute

+ +

The Process

+ +

If you've built something which you think others could use, or are interested in doing so -- +whether a new supported entity, or a policy, or an example -- +it's easy to give back to the community. Just:

+ +
    +
  1. Tell brooklyn-dev@googlegroups.com about your work or interest

  2. +
  3. Create your fork of the project on GitHub

  4. +
  5. Clone it to your local machine and do your work on it

  6. +
  7. Push it, and tell everyone about it

  8. +
  9. Sign the relevant contributor agreement(s)

  10. +
  11. Issue a pull request from your GitHub repo

  12. +
+ + +

The same process holds for contributing to this documentation (web site and user guide), +but see the additional tips for updating documentation.

+ +

Some Words of Advice

+ +
    +
  • Do early-stage work in the /sandbox, which means we can pulled it in to master more often -- +keeping branches short-lived and making it easier to collaborate!

  • +
  • Include javadoc and tests

  • +
  • See the tips here

  • +
  • If you get blocked, hollar!

  • +
+ + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/index.html b/v/0.5.0-rc.2/dev/index.html new file mode 100644 index 000000000..b84ee31eb --- /dev/null +++ b/v/0.5.0-rc.2/dev/index.html @@ -0,0 +1,939 @@ + + + + + Getting to Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Getting to Code

+ +

The Basics

+ + + + +

Brooklyn is available at GitHub brooklyncentral/brooklyn. Check it out using:

+ + + + +
git clone git@github.com:brooklyncentral/brooklyn.git
+
+ + + + +

You'll find versions in branches, and examples in the examples sub-dir. +These examples are pushed to the brooklyn-examples GitHub project when a version is released.

+ + + + +

Project Structure

+ + + + +

Brooklyn is split into the following projects and subprojects:

+ + + + +
    +
  • api: the pure-Java interfaces for interacting with the system
  • +
  • core: the base class implementations for entities and applications, entity traits, locations, policies, sensor and effector support, tasks, and more
  • +
  • policies: collection of useful policies for automating entity activity
  • +
  • software: entities which are mainly launched by launched software processes on machines, and collections thereof + +
      +
    • base: software process lifecycle abstract classes and drivers (e.g. SSH)
    • +
    • webapp: web servers (JBoss, Tomcat), load-balancers (Nginx), and DNS (Geoscaling)
    • +
    • database: relational databases (SQL)
    • +
    • nosql: datastores other than RDBMS/SQL (often better in distributed environments)
    • +
    • messaging: messaging systems, including Qpid, Apache MQ
    • +
    • ...
    • +
    +
  • +
  • systems: entities which are mainly created or managed by other systems, where Brooklyn integrates with those (multi-machine) systems and is removed from the processes + +
      +
    • whirr: base Whirr integration, and entities built on Whirr such as the configurable hadoop deployment
    • +
    • openshift: entity for deploying and managing OpenShift webapps
    • +
    • ...
    • +
    +
  • +
  • usage: projects which make Brooklyn easier to use, either for end-users or Brooklyn developers + +
      +
    • all: maven project to supply a shaded JAR (containing all dependencies) for convenience
    • +
    • cli: backing implementation for Brooklyn's command line interface
    • +
    • dist: builds brooklyn as a downloadable .zip and .tar.gz
    • +
    • jsgui: Javascript web-app for the brooklyn management web console (builds a WAR)
    • +
    • launcher: for launching brooklyn, either using a main method or invoked from the cli project
    • +
    • qa: longevity and stress tests
    • +
    • rest: implementation of brooklyn's REST api
    • +
    • scripts: various scripts useful for building, updating, etc. (see comments in the scripts)
    • +
    • test-support: provides support for tests, used by nearly all projects in scope test
    • +
    +
  • +
  • docs: the markdown source code for this documentation, as described here
  • +
  • examples: some canonical examples, as listed here
  • +
  • sandbox: various projects, entities, and policies which the Brooklyn Project is incubating
  • +
+ + + + +

Next Steps

+ + + + +

If you're interested in building and editing the code, check out:

+ + + + + + + + + +

If you want to start writing your own policies and entities, have a look at:

+ + + + + + + + + +

Where things aren't documented please ask us at +brooklyn-dev@googlegroups.com +so we can remedy this!

+ + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/links.html b/v/0.5.0-rc.2/dev/links.html new file mode 100644 index 000000000..20e5ff3c0 --- /dev/null +++ b/v/0.5.0-rc.2/dev/links.html @@ -0,0 +1,833 @@ + + + + + Development Bookmarks + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Development Bookmarks

+ +

Handy places:

+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/tips/index.html b/v/0.5.0-rc.2/dev/tips/index.html new file mode 100644 index 000000000..6d9fae920 --- /dev/null +++ b/v/0.5.0-rc.2/dev/tips/index.html @@ -0,0 +1,877 @@ + + + + + Miscellaneous Tips and Tricks + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Miscellaneous Tips and Tricks

+ +

General Good Ways of Working

+ +
    +
  • If working on something which could be contributed to Brooklyn, +do it in a project under the sandbox directory. +This means we can accept pulls more easily (as sandbox items aren't built as part of the main build) +and speed up collaboration.

  • +
  • When debugging an entity, make sure the brooklyn.SSH logger is set to DEBUG and accessible.

  • +
  • Use tests heavily! These are pretty good to run in the IDE (once you've completed IDE setup), +and far quicker to spot problems than runtime, plus we get early-warning of problems introduced in the future. +(In particular, Groovy's laxity with compilation means it is easy to introduce silly errors which good test coverage will find much faster.)

  • +
  • If you hit inexplicable problems at runtime, try clearing your Maven caches, +or the brooklyn-relevant parts, under ~/.m2/repository. +Also note your IDE might be recompiling at the same time as a Maven command-line build, +so consider turning off auto-build.

  • +
+ + +

+ +

Entity Design Tips

+ +
    +
  • Look at related entities and understand what they've done, in particular which +sensors and config keys can be re-used. +(Many are inherited from interfaces, where they are declared as constants, +e.g. Attributes and UsesJmx.)

  • +
  • Understand the location hierarchy: software process entities typically get an SshMachineLocation, +and use a *SshDriver to do what they need. This will usually have a MachineProvisioningLocation parent, e.g. a +JcloudsLocation (e.g. AWS eu-west-1 with credentials) or possibly a LocalhostMachineProvisioningLocation. +Clusters will take such a MachineProvisioningLocation (or a singleton list); fabircs take a list of locations. +Some PaaS systems have their own location model, such as OpenShiftLocation.

  • +
+ + +

Finally, don't be shy about talking with others, +that's far better than spinning your wheels (or worse, having a bad experience), +plus it means we can hopefully improve things for other people!

+ +

Project Maintenance

+ +
    +
  • Adding a new project may need updates to /pom.xml modules section and usage/all dependencies

  • +
  • Adding a new example project may need updates to /pom.xml and /examples/pom.xml (and the documentation too!)

  • +
+ + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/tips/logging.html b/v/0.5.0-rc.2/dev/tips/logging.html new file mode 100644 index 000000000..ebd576d54 --- /dev/null +++ b/v/0.5.0-rc.2/dev/tips/logging.html @@ -0,0 +1,861 @@ + + + + + Logging + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Logging

+ +

Logging: A Quick Overview

+ +

For logging, we use logback which implements the slf4j API. +This means you can use any slf4j compliant logging framework, +or if you just want something that works logback will work out of the box.

+ +

The CLI launcher includes a logback.xml which logs at DEBUG level +to a file ./brooklyn.log and INFO to the console, +with a few exceptions. Exceptions --- and the inverse, favourites which +you might want to enable even if the root logger level is bumped to INFO --- +are in files in core/src/main/resources/brooklyn/ which can easily +be included in your own logback.xml (one of the nicest features of logback).

+ +

Tests have debug logging across the board, included by default from +usage/test-support/src/main/resources/logback-tests.xml.

+ +

You can set a specific logback config file to use with:

+ +
-Dlogback.configurationFile=/path/to/config.xml
+
+ +

Caveats

+ +
    +
  • logback uses SLF4J version 1.6 which is not compatible with 1.5.x. +If you have dependent projects using 1.5.x (such as older Grails) things may break.

  • +
  • If you're not getting the logging you expect in the IDE, make sure +src/main/resources is included in the classpath. +(In eclipse, right-click the project, the Build Path -> Configure, +then make sure all dirs are included (All) and excluded (None) -- +mvn clean install should do this for you.) +You may find that your IDE logs to a file brooklyn-tests.log +if it doesn't distinguish between test build classpaths and normal classpaths.

  • +
+ + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/tips/release.html b/v/0.5.0-rc.2/dev/tips/release.html new file mode 100644 index 000000000..c5c33f6bb --- /dev/null +++ b/v/0.5.0-rc.2/dev/tips/release.html @@ -0,0 +1,844 @@ + + + + + Release Process + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Release Process

+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/tips/standards.html b/v/0.5.0-rc.2/dev/tips/standards.html new file mode 100644 index 000000000..9f8d3bc16 --- /dev/null +++ b/v/0.5.0-rc.2/dev/tips/standards.html @@ -0,0 +1,837 @@ + + + + + Code Standards + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Code Standards

+ +

Without being too restrictive about how you have to code as part of Brooklyn, +there are some style points that really make life easier when sharing code +among ourselves:

+ +
    +
  • Use spaces (not tabs!) with 4 spaces indentation
  • +
  • Keep line length <=128
  • +
  • Don't reformat code or organize imports unless there's very good +reason (this makes history and merges much harder)
  • +
+ + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/tips/toc.json b/v/0.5.0-rc.2/dev/tips/toc.json new file mode 100644 index 000000000..9d406952b --- /dev/null +++ b/v/0.5.0-rc.2/dev/tips/toc.json @@ -0,0 +1,10 @@ +[ +{ "title": "Miscellany", + "file": "{{ site.url }}/dev/tips/index.html" }, +{ "title": "Logging", + "file": "{{ site.url }}/dev/tips/logging.html" }, +{ "title": "Code Standards", + "file": "{{ site.url }}/dev/tips/standards.html" }, +{ "title": "Updating Docs", + "file": "{{ site.url }}/dev/tips/update-docs.html" } +] diff --git a/v/0.5.0-rc.2/dev/tips/update-docs.html b/v/0.5.0-rc.2/dev/tips/update-docs.html new file mode 100644 index 000000000..191d16dd4 --- /dev/null +++ b/v/0.5.0-rc.2/dev/tips/update-docs.html @@ -0,0 +1,897 @@ + + + + + Updating the Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Updating the Docs

+ +

The Brooklyn docs live in the docs project in the Brooklyn codebase. +It's built using standard jekyll/markdown with a few extensions.

+ +

Jekyll

+ +

Install the following:

+ + + + +

Then, in the docs/ directory, run:

+ +
jekyll --pygments --server --auto --url ""
+
+ +

or

+ +
./_scripts/jekyll-debug.sh 
+
+ +

Visit http://localhost:4000/ and you should see the documentation.

+ +

Extensions

+ +

In addition to the standard pygments plugin for code-highlighting, +we use some custom Jekyll plugins (in the _plugins dir) to:

+ +
    +
  • include markdown files inside other files +(see, for example, the *.include.md files which contain text +which is used in multiple other files)
  • +
  • parse JSON which we can loop over in our markdown docs
  • +
  • trim whitespace of ends of variables
  • +
+ + +

Using JSON table-of-contents files (toc.json) is our lightweight solution +to the problem of making the site structure navigable (the menus at left). +If you add a page, simply add the file (with full path from project root) +and a title to the toc.json in that directory, and it will get included +in the menu. You can also configure a special toc to show on your page, +if you wish, by setting the toc variable in the header. +Most pages declare the "page" layout (_layouts/page.html) which builds +a menu in the left side-bar (_includes/sidebar.html) using the JSON -- +and automatically detecting which page is active.

+ +

Publishing

+ +

Because GitHub don't run plugins (they run with the --safe option), +the site is built off-line and uploaded to github, where the documentation is hosted.

+ +

This makes the process a little more tedious, but it does have the advantage +that the documentation lives right in the Brooklyn project, +easy to open alongside the code inside your IDE.

+ +

The off-line build can be done using /docs/_scripts/build.sh, +including both jekyll markdown documentation and Brooklyn javadoc, +with the result of this copied to the brooklyncentral/brooklyncentral.github.com +github project (as per the GitHub pages documentation). +brooklyn.io is CNAMEd to brooklyncentral.github.com +for convenience.

+ +

The latest stable version typically lives in the root of the brooklyncentral.github.com project. +Archived versions are kept under /v/* with logic in the markdown for +meta/versions to link to related versions.
+Additional instructions and scripts for automating the installs can be found in /docs/_scripts/.

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/dev/toc.json b/v/0.5.0-rc.2/dev/toc.json new file mode 100644 index 000000000..cc10ebf04 --- /dev/null +++ b/v/0.5.0-rc.2/dev/toc.json @@ -0,0 +1,28 @@ +[ +{ "title": "The Code", + "file": "{{ site.url }}/dev/code/index.html", + "exclude": true, + "children": {% readj ./code/toc.json %} }, +{ "title": "Build and Test", + "file": "{{ site.url }}/dev/build/index.html", + "exclude": true, + "children": {% readj ./build/toc.json %} }, +{ "title": "Tips and Tricks", + "file": "{{ site.url }}/dev/tips/index.html", + "exclude": true, + "children": {% readj ./tips/toc.json %} }, +{ "title": "Wishlist", + "file": "{{ site.url }}/dev/wishlist.html" }, +{ "title": "Links", + "file": "{{ site.url }}/dev/links.html", + "children": [ + { "title": "Github repo", + "file": "https://github.com/brooklyncentral/" }, + { "title": "Github issues", + "file": "https://github.com/brooklyncentral/brooklyn/issues" }, + { "title": "Maven snapshots", + "file": "http://ccweb.cloudsoftcorp.com/maven/libs-snapshot-local/io/brooklyn/" } + ] }, +{ "title": "How to Contribute", + "file": "{{ site.url }}/dev/how-to-contrib.html" } +] diff --git a/v/0.5.0-rc.2/dev/wishlist.html b/v/0.5.0-rc.2/dev/wishlist.html new file mode 100644 index 000000000..cff7e1f75 --- /dev/null +++ b/v/0.5.0-rc.2/dev/wishlist.html @@ -0,0 +1,850 @@ + + + + + Wishlist + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Wishlist

+ +

This page records some of the additions planned and requested +(approximately a roadmap). +If you're interested in helping, scan the issues list +on Github for anything related, +email the list, and get started!

+ +

Entities

+ +
    +
  • WebApp PaaS: CloudFoundry, AWS Elastic Beanstalk, Google AppEngine (OpenShift a good starting point)
  • +
  • Non-Java webapps: PHP, Rails, Node.js, perl
  • +
  • CDN: AWS Cloudfront, Akamai, others
  • +
  • Data: lots!, including MySQL, Mongo, Couch, etc (look at building on Whirr support, like Hadoop does!)
  • +
  • More monitoring and provisioning: Nagios, Zenoss, Cacti etc; Juju for deployment; possibly direct Puppet or Chef integration (although Whirr integration is quite powerful)
  • +
+ + +

Features

+ +
    +
  • REST API for deploying, viewing, and managing, including application definitions in JSON/XML (and support for dependent configuration)
  • +
  • Distributed management plane
  • +
  • At-Rest serialization of state (likely piggy-backing on JSON/XML and datagrid support)
  • +
  • Bind to existing entities on restart
  • +
  • Extract data from entities that are being stopped, to restore on restart (could extend MySQL example to do this)
  • +
  • Windows: support running from windows (untested); work on installation to Windows servers
  • +
+ + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/favicon.ico b/v/0.5.0-rc.2/favicon.ico new file mode 100644 index 000000000..ac33c5e0b Binary files /dev/null and b/v/0.5.0-rc.2/favicon.ico differ diff --git a/v/0.5.0-rc.2/index.html b/v/0.5.0-rc.2/index.html new file mode 100644 index 000000000..c803e6dd5 --- /dev/null +++ b/v/0.5.0-rc.2/index.html @@ -0,0 +1,908 @@ + + + + + Overview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Overview

+ +

What is Brooklyn?

+ + + + +

brooklyn is a library that simplifies application deployment and management.

+ + + + +

For deployment, it is designed to tie in with other tools, +giving single-click deploy and adding the concepts of +manageable clusters and fabrics:

+ + + + +
    +
  • many common software entities available out-of-the-box
  • +
  • integrates with Apache Whirr -- and thereby Chef and Puppet -- +to deploy well-known services such as Hadoop and elasticsearch +(or use POBS, plain-old-bash-scripts)
  • +
  • use PaaS's such as OpenShift, alongside self-built clusters, for maximum flexibility
  • +
+ + + + +

Brooklyn makes roll-out an integral part of the DevOps chain, +as code which can be version-controlled and programmatically tested, +and portable across many clouds or fixed IP machines, +using jclouds -- +or just hitting localhost for quick dev/test.

+ + + + +

Brooklyn's main emphasis is post-deployment, managing an application once it is live: +management policies are an integral part of the deployment descriptor, +and at runtime policies have access to all aspects of the deployment. +They are aware of the deployment topology (hierarchical) and +locations (machines, PaaSes, and jurisdictions), +as well as scripts, instrumentation, and operational goals and constraints. +This means they're all set, once the application is launched, +to keep the application running optimally, +based on whatever optimally means in that context.

+ + + + +

These deployment patterns and management policies are expressed as Java (and Groovy) classes, +open-sourced here and giving you full control over what you want to happen. +More importantly, however, this code can be shared, improved, and extended.

+ + + + +

We're still near the beginning of figuring this out: +join us to make it better.

+ + + + +

To Get Started

+ + + + + + + + + +

If you like it, or if you have ideas how it could be better, +join the discussion.

+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/license/contributor-agreements/brooklyn-ccla.txt b/v/0.5.0-rc.2/license/contributor-agreements/brooklyn-ccla.txt new file mode 100644 index 000000000..1dc62e81a --- /dev/null +++ b/v/0.5.0-rc.2/license/contributor-agreements/brooklyn-ccla.txt @@ -0,0 +1,175 @@ + + BROOKLYN PROJECT + + Corporate Contributor License Agreement + +In order to clarify the intellectual property license granted with +Contributions from any corporation or other legal entity, the Brooklyn +Project (the "Project") must have a Corporate Contributor License Agreement +("Agreement") on file that has been signed by each Contributor, indicating +agreement to the license terms below. This license is for your protection +as a Contributor as well as the protection of Cloudsoft Corporation Limited +as Project Manager (the "Project Manager") and the Project users; it does +not change your rights to use your own Contributions for any other purpose. + +This version of the Agreement allows an entity (the "Corporation") to +submit Contributions to the Project Manager, to authorize Contributions +submitted by its designated employees to the Project Manager, and to grant +copyright and patent licenses thereto. + + If you have not already done so, please complete and sign this + Corporate Contributor License Agreement by following the instructions + embedded below. After you fill in the required information and apply + your digital signature to the Agreement, the signature service will + generate an email to you. You must confirm your digital signature as + instructed in this email to complete the signing process. The signature + service will then send you a signed copy of this Agreement for your + records. + +You accept and agree to the following terms and conditions for your present +and future Contributions submitted to the Project Manager. Except for the +license granted herein to the Project Manager and recipients of software +distributed by the Project Manager, You reserve all right, title, and +interest in and to your Contributions. + + +1. Definitions + + "You" (or "Your") (whether or not capitalized) shall mean the copyright + owner or legal entity authorized by the copyright owner that is making + this Agreement with the Project Manager. For legal entities, the entity + making a Contribution and all other entities that control, are + controlled by, or are under common control with that entity are + considered to be a single Contributor. For the purposes of this + definition, "control" means (i) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "Contribution" shall mean the code, documentation or other original + works of authorship expressly identified in Schedule B, as well as any + original work of authorship, including any modifications or additions to + an existing work, which is intentionally submitted by you to the Project + Manager for inclusion in, or documentation of, any of the open source + projects owned or managed by the Project Manager (the "Work"). For the + purposes of this definition, "submitted" means any form of electronic, + verbal, or written communication sent to the Project Manager or its + representatives, including but not limited to communication on + electronic mailing lists, source code control systems, and issue + tracking systems that are managed by, or on behalf of, the Project + Manager for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by you as "Not a Contribution." + +2. Grant of Copyright License + + Subject to the terms and conditions of this Agreement, you hereby grant + to the Project Manager and to recipients of software distributed by the + Project Manager a perpetual, worldwide, non-exclusive, no-charge, + royalty-free, irrevocable copyright license to reproduce, prepare + derivative works of, publicly display, publicly perform, sublicense, and + distribute your Contributions and such derivative works. + +3. Grant of Patent License + + Subject to the terms and conditions of this Agreement, you hereby grant + to the Project Manager and to recipients of software distributed by the + Project Manager a perpetual, worldwide, non-exclusive, no-charge, + royalty-free, irrevocable (except as stated in this section) patent + license to make, have made, use, offer to sell, sell, import, and + otherwise transfer the Work, where such license applies only to those + patent claims licensable by you that are necessarily infringed by your + Contribution(s) alone or by combination of your Contribution(s) with the + Work to which such Contribution(s) was submitted. If any entity + institutes patent litigation against you or any other entity (including + a cross-claim or counterclaim in a lawsuit) alleging that your + Contribution, or the Work to which you have contributed, constitutes + direct or contributory patent infringement, then any patent licenses + granted to that entity under this Agreement for that Contribution or + Work shall terminate as of the date such litigation is filed. + +4. You represent that you are legally entitled to grant the above license. + You represent further that each employee of the Corporation designated + on Schedule A below (or in a subsequent written modification to that + Schedule) is authorized to submit Contributions on behalf of the + Corporation. + +5. You represent that each of your Contributions is your original creation + (see Section 7 for submissions on behalf other others). You represent + that your Contribution submissions include complete details of any + third-party license or other restriction (including, but not limited to, + related patents and trademarks) of which you are personally aware and + which are associated with any part of your Contributions. + +6. You are not expected to provide support for your Contributions, except + to the extent you desire to provide support. You may provide support + for free, for a fee, or not at all. Unless required by applicable law + or agreed to in writing, and except for the express licenses and + representations in this Agreement, you provide your Contributions on as + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied, including, without limitation, any warranties or + conditions of TITLE, NONINFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. + +7. Should you wish to submit work that is not your original creation, you + may submit it to the Project Manager separately from any Contribution, + identifying the complete details of its source and of any license or + other restriction (including, but not limited to, related patents, + trademarks, and license agreements) of which you are personally aware, + and conspicuously marking the work as "Submitted on behalf of a + third-party: [named here]". + +8. You agree to notify the Project Manager of any facts or circumstances + of which you become aware that would make these representations + inaccurate in any respect. + +9. It is your responsibility to notify the Project Manager when any change + is required to the list of designated employees authorized to submit + Contributions on behalf of the Corporation, or to the Corporation's + point of contact with the Project Manager. + + + +Company Name: ____________________________________________________________ + +Title: ____________________________________________________________ + +Signature: ____________________________________________________________ + +Email: ____________________________________________________________ + + + +Schedule A + +[Initial list of designated employees. NB: authorization is not tied to +particular Contributions.] + +___________________________________________________________________________ + +___________________________________________________________________________ + +___________________________________________________________________________ + +___________________________________________________________________________ + +___________________________________________________________________________ + + + +Schedule B + +[Identification of optional concurrent software grant. Would be left blank +or omitted if there is no concurrent software grant.] + + +___________________________________________________________________________ + +___________________________________________________________________________ + +___________________________________________________________________________ + +___________________________________________________________________________ + +___________________________________________________________________________ + diff --git a/v/0.5.0-rc.2/license/contributor-agreements/brooklyn-icla.txt b/v/0.5.0-rc.2/license/contributor-agreements/brooklyn-icla.txt new file mode 100644 index 000000000..e5cbeb9c7 --- /dev/null +++ b/v/0.5.0-rc.2/license/contributor-agreements/brooklyn-icla.txt @@ -0,0 +1,128 @@ + + BROOKLYN PROJECT + + Individual Contributor License Agreement + +In order to clarify the intellectual property license granted with +Contributions from any person, the Brooklyn Project (the "Project") must +have an Individual Contributor License Agreement ("Agreement") on file that +has been signed by each Contributor, indicating agreement to the license +terms below. This license is for your protection as a Contributor as well +as the protection of Cloudsoft Corporation Limited as Project Manager (the +"Project Manager") and the Project users; it does not change your rights to +use your own Contributions for any other purpose + + If you have not already done so, please complete and sign this + Individual Contributor License Agreement by following the instructions + embedded below. After you fill in the required information and apply + your digital signature to the Agreement, the signature service will + generate an email to you. You must confirm your digital signature as + instructed in this email to complete the signing process. The signature + service will then send you a signed copy of this Agreement for your + records. + +You accept and agree to the following terms and conditions for your present +and future Contributions submitted to the Project Manager. Except for the +license granted herein to the Project Manager and recipients of software +distributed by the Project Manager, you reserve all right, title, and +interest in and to your Contributions. + + +1. Definitions + + "You" (or "Your") (whether or not capitalized) shall mean the individual + copyright owner or legal entity authorized by the copyright owner that + is making this Agreement with the Project Manager. + + "Contribution" shall mean any original work of authorship, including any + modifications or additions to an existing work, which is intentionally + submitted by you to the Project Manager for inclusion in, or + documentation of, any of the open source projects owned or managed by + the Project Manager (the "Work"). For the purposes of this definition, + "submitted" means any form of electronic, verbal, or written + communication sent to the Project Manager or its representatives, + including but not limited to communication on electronic mailing lists, + source code control systems, and issue tracking systems that are managed + by, or on behalf of, the Project Manager for the purpose of discussing + and improving the Work, but excluding communication that is + conspicuously marked or otherwise designated in writing by you as "Not + a Contribution." + +2. Grant of Copyright License + + Subject to the terms and conditions of this Agreement, you hereby grant + to the Project Manager and to recipients of software distributed by the + Project Manager a perpetual, worldwide, non-exclusive, no-charge, + royalty-free, irrevocable copyright license to reproduce, prepare + derivative works of, publicly display, publicly perform, sublicense, and + distribute your Contributions and such derivative works. + +3. Grant of Patent License. Subject to the terms and conditions of this + Agreement, you hereby grant to the Project Manager and to recipients of + software distributed by the Project Manager a perpetual, worldwide, + non-exclusive, no-charge, royalty-free, irrevocable (except as stated in + this section) patent license to make, have made, use, offer to sell, + sell, import, and otherwise transfer the Work, where such license + applies only to those patent claims licensable by you that are + necessarily infringed by your Contribution(s) alone or by combination of + your Contribution(s) with the Work to which such Contribution(s) was + submitted. If any entity institutes patent litigation against you or any + other entity (including a cross-claim or counterclaim in a lawsuit) + alleging that your Contribution, or the Work to which you have + contributed, constitutes direct or contributory patent infringement, + then any patent licenses granted to that entity under this Agreement for + that Contribution or Work shall terminate as of the date such litigation + is filed. + +4. You represent that you are legally entitled to grant the above license. + If your employer(s) has rights to intellectual property that you create + that includes your Contributions, you represent that you have received + permission to make Contributions on behalf of that employer, that your + employer has waived such rights for your Contributions to the Project + Manager, or that your employer has executed a separate Corporate + Contributor License Agreement with the Project Manager. + +5. You represent that each of your Contributions is your original creation + (see Section 7 for submissions on behalf other others). You represent + that your Contribution submissions include complete details of any + third-party license or other restriction (including, but not limited to, + related patents and trademarks) of which you are personally aware and + which are associated with any part of your Contributions. + +6. You are not expected to provide support for your Contributions, except + to the extent you desire to provide support. You may provide support for + free, for a fee, or not at all. Unless required by applicable law or + agreed to in writing, and except for the express licenses and + representations in this Agreement, you provide your Contributions on as + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied, including, without limitation, any warranties or + conditions of TITLE, NONINFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. + +7. Should you wish to submit work that is not your original creation, you + may submit it to the Project Manager separately from any Contribution, + identifying the complete details of its source and of any license or + other restriction (including, but not limited to, related patents, + trademarks, and license agreements) of which you are personally aware, + and conspicuously marking the work as "Submitted on behalf of a + third-party: [named here]". + +8. You agree to notify the Project Manager of any facts or circumstances of + which you become aware that would make these representations inaccurate + in any respect. + + + +Your Name: ____________________________________________________________ + +Address: ____________________________________________________________ + + ____________________________________________________________ + + ____________________________________________________________ + +Country: ____________________________________________________________ + +Signature: ____________________________________________________________ + +Email: ____________________________________________________________ diff --git a/v/0.5.0-rc.2/license/contributor-agreements/corporate-update-schedule.html b/v/0.5.0-rc.2/license/contributor-agreements/corporate-update-schedule.html new file mode 100644 index 000000000..bff38bbc1 --- /dev/null +++ b/v/0.5.0-rc.2/license/contributor-agreements/corporate-update-schedule.html @@ -0,0 +1,828 @@ + + + + + CCLA Schedule A Update + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

CCLA Schedule A Update

+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/license/contributor-agreements/corporate.html b/v/0.5.0-rc.2/license/contributor-agreements/corporate.html new file mode 100644 index 000000000..1b94941e8 --- /dev/null +++ b/v/0.5.0-rc.2/license/contributor-agreements/corporate.html @@ -0,0 +1,828 @@ + + + + + Corporate Contributor License Agreement + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Corporate Contributor License Agreement

+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/license/contributor-agreements/index.html b/v/0.5.0-rc.2/license/contributor-agreements/index.html new file mode 100644 index 000000000..3ea4cecc6 --- /dev/null +++ b/v/0.5.0-rc.2/license/contributor-agreements/index.html @@ -0,0 +1,867 @@ + + + + + Contributor Agreements + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Contributor Agreements

+ +

The Brooklyn project requires the appropriate permission to include and redistribute any contributions +as part of Brooklyn, in order to protect the project and its users.

+ +

Individual CLA

+ +

All contributors need to complete and sign the Individual Contributor License Agreement. +This can be done easily online:

+ + + + +

Note that Echosign will display a "Name" box which looks like a field +and may be tempting to fill out, but you cannot. You will be prompted for your name later +when you "sign" the form.

+ +

The raw text of the agreement can be downloaded here.

+ +

Additionally, if your work is done in a context where any organization may have rights to the contribution, +such as if you are working for a company, someone authorized by the company must +also file a Corporate Contributor License Agreement designating you by name.

+ +

Corporate CLA

+ +

An authorized representative of a company or organization which wishes to contribute to Brooklyn must file +the Corporate Contributor License Agreement and update this as there are changes to the set of employees designated to make contributions. +These actions can also be done online:

+ + + + +

The raw text of the CCLA agreement can be downloaded here.

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/license/contributor-agreements/individual.html b/v/0.5.0-rc.2/license/contributor-agreements/individual.html new file mode 100644 index 000000000..99b2abef8 --- /dev/null +++ b/v/0.5.0-rc.2/license/contributor-agreements/individual.html @@ -0,0 +1,828 @@ + + + + + Individual Contributor License Agreement + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Individual Contributor License Agreement

+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/license/contributor-agreements/toc.json b/v/0.5.0-rc.2/license/contributor-agreements/toc.json new file mode 100644 index 000000000..21925bc02 --- /dev/null +++ b/v/0.5.0-rc.2/license/contributor-agreements/toc.json @@ -0,0 +1,14 @@ +[ +{ "title": "Instructions", + "file": "{{ site.url }}/license/contributor-agreements/index.html" }, +{ "title": "Individual CLA (echosign)", + "file": "{{ site.url }}/license/contributor-agreements/individual.html" }, +{ "title": "Corporate CLA (echosign)", + "file": "{{ site.url }}/license/contributor-agreements/corporate.html" }, +{ "title": "CCLA Schedule A Update (echosign)", + "file": "{{ site.url }}/license/contributor-agreements/corporate-update-schedule.html" }, +{ "title": "Individual CLA (raw text)", + "file": "{{ site.url }}/license/contributor-agreements/brooklyn-icla.txt" }, +{ "title": "Corporate CLA (raw text)", + "file": "{{ site.url }}/license/contributor-agreements/brooklyn-ccla.txt" } +] diff --git a/v/0.5.0-rc.2/license/index.html b/v/0.5.0-rc.2/license/index.html new file mode 100644 index 000000000..5eb872398 --- /dev/null +++ b/v/0.5.0-rc.2/license/index.html @@ -0,0 +1,830 @@ + + + + + Brooklyn Licenses + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Brooklyn Licenses

+ +

License

+ +

Brooklyn is released to the public as open source under the +terms of the Apache License, v2.0.

+ +

Software Contributor Agreement

+ +

If you or your company wish to make contributions to the Brooklyn +project, we will require the appropriate Software Contributor Agreement.

+ +

Trademark

+ +

brooklyn and the brooklyn logo are trademarks of Cloudsoft Corporation.

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/license/license.html b/v/0.5.0-rc.2/license/license.html new file mode 100644 index 000000000..c5d265224 --- /dev/null +++ b/v/0.5.0-rc.2/license/license.html @@ -0,0 +1,1010 @@ + + + + + License + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

License

+ +

Brooklyn is licensed to the public as open source under the +terms of the Apache License, v2.0. +You may not use this content except in compliance with the License.

+ +

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.

+ +
                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/license/toc.json b/v/0.5.0-rc.2/license/toc.json new file mode 100644 index 000000000..b3e3b5904 --- /dev/null +++ b/v/0.5.0-rc.2/license/toc.json @@ -0,0 +1,8 @@ +[ +{ "title": "Apache License v2.0", + "file": "{{ site.url }}/license/license.html" }, +{ "title": "Contributor Agreements", + "file": "{{ site.url }}/license/contributor-agreements/index.html", + "exclude": true, + "children": {% readj ./contributor-agreements/toc.json %} } +] diff --git a/v/0.5.0-rc.2/meta/brooklyn-gpg-public-key.asc b/v/0.5.0-rc.2/meta/brooklyn-gpg-public-key.asc new file mode 100644 index 000000000..3b515a47b --- /dev/null +++ b/v/0.5.0-rc.2/meta/brooklyn-gpg-public-key.asc @@ -0,0 +1,21 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG/MacGPG2 v2.0.18 (Darwin) +Comment: GPGTools - http://gpgtools.org + +mQENBFDsSLEBCAC2JxQHeXpL3oGN2IickcG9C49gkxIsws4hpasQModVipezrQi0 +9pLq4lkB01GgC2sfPH+XXE8rCpA9EL0e4wVA7JICz5AsLZAAJH91tKksL20tLMeU +Yrbufaq1ga7ifk3JWhF4iwvkDMBKyCjrF173nI+2TwX2XfNTQpzoQGOL1bNvS4NZ +AD9JeXGW2D996zHdSK+x3wVdY3cDECvVMuw61+5ytZrGNnyvaaWTl3lJUyydPXHQ +5TXVtbQH5WgYCLPr4E95axJ0BoY8H+fEaG1Uax1a+xLumVWhiWNp7rMvmgcZXuJO +fx+wXAIbRNlAHoJcdZ4NCReRxDIBQ+2HsU1zABEBAAG0bUJyb29rbHluIFByb2pl +Y3QgKGJyb29rbHluLmlvKSAoS2V5IHVzZWQgdG8gYXV0aGVudGljYXRlIEJyb29r +bHluIGFydGlmYWN0cykgPGJyb29rbHluLWRldkBncm91cHMuZ29vZ2xlLmNvbT6J +AT8EEwECACkFAlDsSLECGy8FCQeGH4AHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIX +gAAKCRANhinnSRLCsOdIB/4tUVShup2NHXJ9acCah8TuEN4GmN9dBiD9YsGW66SR +/ptY0Gn9XExl2wbmQW+7TQg3QUGv8uffwYLtnMwnmCp/WwgE+uSnRmcENxa9GuTu +PLlURKKGK0C9ljTAHwXtPcIYxPNN3BT4VB56ME1DTBRCgEvudaNSANs8/kT88kE2 +eMC7x0Uo3/P38Ob8XSOfR8c6G6nSz6jILcRBXZTPNNK4svyqF5XHIru65d3/0+mr +bpfcDLcUQYms0MpPmO1RCHLZWwJLsPUIxNwGGnKJc8/RNEvQinK+Ap0cf+PGUQSX +PhB6Z81ROFIVToEVZslgSiL+u4Tc7zXDfDQDY4HeLY2t +=w/CG +-----END PGP PUBLIC KEY BLOCK----- diff --git a/v/0.5.0-rc.2/meta/contact.html b/v/0.5.0-rc.2/meta/contact.html new file mode 100644 index 000000000..776484956 --- /dev/null +++ b/v/0.5.0-rc.2/meta/contact.html @@ -0,0 +1,850 @@ + + + + + Contact + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Contact

+ +

Contact us on the discussion groups:

+ + + + + + + + + +

Additionally look for us on:

+ + + + +
    +
  • IRC: #brooklyncentral
  • +
  • Twitter: @brooklyncentral #brooklyncentral
  • +
+ + + + +

We'd love to hear from you!

+ + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/meta/contact.include.md b/v/0.5.0-rc.2/meta/contact.include.md new file mode 100644 index 000000000..dea1f9c87 --- /dev/null +++ b/v/0.5.0-rc.2/meta/contact.include.md @@ -0,0 +1,12 @@ + +Contact us on the discussion groups: + +* **[brooklyn-users@googlegroups.com](http://groups.google.com/group/brooklyn-users)**: discussions about _using_ Brooklyn +* **[brooklyn-dev@googlegroups.com](http://groups.google.com/group/brooklyn-dev)**: discussions about _development_ in Brooklyn + +Additionally look for us on: + +* **IRC**: #brooklyncentral +* **Twitter**: @brooklyncentral #brooklyncentral + +We'd love to hear from you! diff --git a/v/0.5.0-rc.2/meta/governance.html b/v/0.5.0-rc.2/meta/governance.html new file mode 100644 index 000000000..3166b9eb3 --- /dev/null +++ b/v/0.5.0-rc.2/meta/governance.html @@ -0,0 +1,883 @@ + + + + + Brooklyn Project Governance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Brooklyn Project Governance

+ +

Brooklyn's management is modelled on the Apache approach whereby +people guilty of consistent, high-quality reliable contributions +are invited to become committers.

+ +

Most decisions about the project -- +agreeing approaches, accepting contributions, and resolving problems -- +are generally by consensus on the +brooklyn-dev@ +mailing list, +in which all mailing list members may participate. +However, only committers are permitted to make changes to +the code or to vote where there are issues requiring a vote +(such as disagreements or signficant actions, as described below).

+ +

Certain decisions concerning specific governance and oversight matters +are reserved to the Project Management Committee (PMC). +This committee consists of selected committers who have +agreed to take on additional responsibilities, +such as ensuring regulatory compliance and +extra consideration of the protection of project users. +Selected actions require a PMC vote (described below).

+ +

Project Commits and Votes

+ +
    +
  • All commits and pull requests should be approved by at least one committer
  • +
  • Any controversial commit (e.g. if someone -1's it) requires a committer vote
  • +
  • A vote is required for official alpha or release candidate builds
  • +
  • Votes can also be called for other code actions, +and are encouraged for significant changes such as promotion from sandbox +(in large part to let people know)
  • +
+ + +

The voting rules are as follows:

+ +
    +
  • Votes are called by email to brooklyn-dev@googlegroups.com
  • +
  • Votes should come by email
  • +
  • Comments are welcome from all members, and committers should take these into consideration
  • +
  • A simple majority of those committers who respond within 24h is required
  • +
  • If a simple majority of all committers is reached sooner than 24h the action is approved
  • +
+ + +

PMC Vote

+ +

The following activities require a PMC vote, +where again all committers and list members may comment, +and PMC members should take these into consideration, +but only PMC members' votes are binding:

+ +
    +
  • official releases (of release candidate builds)
  • +
  • changes to committer ship, including inviting new committers
  • +
  • changes to PMC membership
  • +
  • changes to the governance policy
  • +
+ + +

The process of the PMC vote is otherwise identical to normal project/committer votes.

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/meta/toc.json b/v/0.5.0-rc.2/meta/toc.json new file mode 100644 index 000000000..0e7a6e98a --- /dev/null +++ b/v/0.5.0-rc.2/meta/toc.json @@ -0,0 +1,10 @@ +[ +{ "title": "Versions", + "file": "{{ site.url }}/meta/versions.html" }, +{ "title": "Governance", + "file": "{{ site.url }}/meta/governance.html" }, +{ "title": "Verify", + "file": "{{ site.url }}/meta/verify.html" }, +{ "title": "Contact", + "file": "{{ site.url }}/meta/contact.html" } +] diff --git a/v/0.5.0-rc.2/meta/verify.html b/v/0.5.0-rc.2/meta/verify.html new file mode 100644 index 000000000..9bb6c355c --- /dev/null +++ b/v/0.5.0-rc.2/meta/verify.html @@ -0,0 +1,866 @@ + + + + + Verify the Integrity of Downloads + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Verify the Integrity of Downloads

+ + + + + + + + + + + +

+ +

It is essential for security that you verify the integrity of the downloaded files using their PGP signatures or SHA-1 checksums.

+ +

Verifying PGP signatures using PGP or GPG

+ +

Download the brooklyn-gpg-public-key.asc +file and the .asc PGP signature file for the relevant artefact.

+ +

(Make sure you get these files from the main Maven Central repository rather than from a mirror.)

+ +

Verify the signatures using one of the following commands:

+ +
pgpk -a brooklyn-gpg-public-key.asc
+pgpv brooklyn-0.6.0-SNAPSHOT-dist.tar.gz.asc
+
+ +

or

+ +
pgp -ka brooklyn-gpg-public-key.asc
+pgp brooklyn-0.6.0-SNAPSHOT-dist.zip.asc
+
+ +

or

+ +
gpg --import brooklyn-gpg-public-key.asc    
+gpg --verify brooklyn-0.6.0-SNAPSHOT-dist.tar.gz.asc
+
+ +

You can also verify the SHA-1 checksum of the files.

+ +

A program called sha1 or sha1sum is included in most Linux distributions and OSx. For Windows users, fsum supports SHA-1.

+ +

Ensure the generated checksum string matches the contents of the .sha1 file for the relevant artefact (and again download from Maven Central repository, rather than from a mirror).

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/meta/versions.html b/v/0.5.0-rc.2/meta/versions.html new file mode 100644 index 000000000..a96eb340c --- /dev/null +++ b/v/0.5.0-rc.2/meta/versions.html @@ -0,0 +1,882 @@ + + + + + Versions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Versions

+ + + + +

Brooklyn v0.6.0-SNAPSHOT

+ + + + + + + + + +

This is the documentation for a snapshot version of Brooklyn, +generated 26 Apr 2013.

+ +

View current documentation here.

+ +

NB: "Snapshot" means it is the code at a point in time, +and that a reference to this version 0.6.0-SNAPSHOT +may resolve to different code at a different point in time. +Where possible it is preferable to develop against a GA version +rather than a shapshot.

+ +

Version History

+ +
    +
  • 0.6.0-SNAPSHOT (master): no major changes yet since 0.5.0-rc.1

  • +
  • 0.5.0-rc.1: includes new JS GUI and REST API, rebind/persistence support, cleaner model and naming conventions, more entities (Apr 2013)

  • +
  • 0.4.0: initial public GA release of Brooklyn to Maven Central, supporting wide range of entities and examples (Jan 2013)

  • +
+ + +

Note: To prevent accidentally referring to out-of-date information, +a banner is displayed when accessing specific versions from the archive. +You may +disable all warnings or +re-enable all warnings.

+ +

Versioning

+ +

Brooklyn uses the semantic versioning guidelines. Releases will be numbered with the following format:

+ +

Brooklyn <major>.<minor>.<patch>

+ +

Breaking backward compatibility increments the <major> version. +New additions without breaking backward compatibility ups the <minor> version. +Bug fixes and misc changes bumps the <patch> version. +New major and minor releases zero the less significant counters.

+ +

Additionally, Brooklyn's release process include Snapshots, Milestones and Release Candidates.

+ +

A Snapshot (-SNAPSHOT) is the bleeding edge. This will not be stable.

+ +

Milestone versions (-Mn) are frozen snapshots. Some code features may be stable, but the documentation and examples may not be complete.

+ +

A Release Candidate (-rc.n) is a just-about-ready version. Release candidates are tested against our acceptance criteria, and qualifying builds are promoted as final.

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/start/docs-summary.html b/v/0.5.0-rc.2/start/docs-summary.html new file mode 100644 index 000000000..7d69e5a35 --- /dev/null +++ b/v/0.5.0-rc.2/start/docs-summary.html @@ -0,0 +1,837 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Documentation

+ +

To learn about Brooklyn, here are some recommended starting points:

+ + + + + + + +

Beyond this, just come chat to us.

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/start/docs-summary.include.md b/v/0.5.0-rc.2/start/docs-summary.include.md new file mode 100644 index 000000000..c08c06fe3 --- /dev/null +++ b/v/0.5.0-rc.2/start/docs-summary.include.md @@ -0,0 +1,7 @@ +To learn about Brooklyn, here are some recommended starting points: + +* [Developer's Walkthrough]({{site.url}}/start/walkthrough/index.html) +* [Examples]({{site.url}}/use/examples/) +* [User Guide]({{site.url}}/use/guide/) +* [Code Overview]({{site.url}}/dev/code/) +* [Code on Github](http://github.com/brooklyncentral/brooklyn/) diff --git a/v/0.5.0-rc.2/start/download.html b/v/0.5.0-rc.2/start/download.html new file mode 100644 index 000000000..d0f20b12c --- /dev/null +++ b/v/0.5.0-rc.2/start/download.html @@ -0,0 +1,1001 @@ + + + + + Downloads + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Downloads

+ + + + + + + + + + + +

+ +

First time user? The getting started guide will walk you through downloading Brooklyn, setup of your brooklyn.properties and catalog.xml files, and then trying the examples.

+ +

Download Version 0.6.0-SNAPSHOT

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
DownloadFile/Formatchecksums (?)
Distrobrooklyn-dist-0.6.0-SNAPSHOT-dist.zipPGP, SHA1
brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gzPGP, SHA1
All Jarbrooklyn-all-0.6.0-SNAPSHOT-with-dependencies.jarPGP, SHA1
Release notes0.6.0-SNAPSHOT -
+ + +

Source: Sonatype

+ +

+ +

The Distro

+ +

The distribution archive contains Brooklyn as a standalone executable package.

+ + + + +

Please note: You are reading the documentation for a snapshot version of Brooklyn. +You should always confirm that the source and date for snapshot artifacts.

+ +

+ +

The All Jar

+ +

This is a single JAR containing all of Brooklyn and its dependencies, for developing Brooklyn into your own applications. Just download your preferred flavour and add it to your classpath.

+ + + + +

Again, check the source and date for SNAPSHOT JARs.

+ +

Release Notes

+ +

Release notes can be found here.

+ +

+ +

Examples

+ +

You can checkout the examples from the brooklyn-examples git repository. +Maven (v3) is required to build them, as described here. +The examples for this version (0.6.0-SNAPSHOT) are in the branch +master, +so if you have git and mvn already, you can simply:

+ +
% git clone https://github.com/brooklyncentral/brooklyn-examples.git
+% cd brooklyn-examples
+% mvn clean install
+
+ + +

Please note: for snapshot versions of Brooklyn, +the examples in this repository may not be automatically synched. +It is recommended that you use the code for the examples included +in the main Brooklyn codebase, or use a released version.

+ +

If you don't use git, you can download the projects as a tarball instead +from this link. +These commands should do the trick:

+ +
% curl -L -o brooklyn-examples-master.tgz \
+     https://github.com/brooklyncentral/brooklyn-examples/tarball/master
+% tar xvfz brooklyn-examples-master.tgz
+% mv brooklyncentral-brooklyn-examples-* brooklyn-examples-master \
+     # change the strange name which github assigns in the tarball
+% mvn clean install
+
+ + +

A good example to start with is the Elastic Web Cluster.

+ +

+ +

Maven

+ +

If you use Maven, you can add Brooklyn with the following in your pom:

+ +
    <dependencies>
+        <dependency>
+            <groupId>io.brooklyn</groupId>
+            <artifactId>brooklyn-all</artifactId>
+            <version>0.6.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+
+ + +

brooklyn-all (used above) brings in all dependencies, including jclouds and Apache Whirr. +If you prefer a smaller repo you might want just brooklyn-core, brooklyn-policies, +and some of brooklyn-software-webapp, brooklyn-software-database, brooklyn-software-messaging, or others +(browse the full list here).

+ +

If you wish to use the Sonatype and/or Cloudsoft repositories (particularly for snapshots), +you can add some of the following sections:

+ +
    <repositories>
+        <repository>
+            <id>cloudsoft-cloudfront-releases-repo</id>
+            <url>http://developers.cloudsoftcorp.com/maven/releases/</url>
+        </repository>
+        <!-- optional for snapshot versions -->
+        <repository>
+            <id>sonatype-nexus-snapshots</id>
+            <name>Sonatype Nexus Snapshots</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+            <releases> <enabled>false</enabled> </releases>
+            <snapshots> <enabled>true</enabled> </snapshots>
+        </repository>
+        <repository>
+            <id>cloudsoft-cloudfront-snapshots-repo</id>
+            <url>http://developers.cloudsoftcorp.com/maven/snapshots/</url>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>never</updatePolicy>
+                <checksumPolicy>fail</checksumPolicy>
+           </snapshots>
+         </repository>
+    </repositories>
+
+ + +

Please note: to use a snapshot version of Brooklyn, you must either have Brooklyn built locally +or one of the additional snapshot repositories above.

+ +

+ +

Source Code

+ +

Full source is at github.com/brooklyncentral/brooklyn. +Information on working with the source is here.

+ +

Alternatively you can download archives of the source directly:

+ +

+

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/start/index.html b/v/0.5.0-rc.2/start/index.html new file mode 100644 index 000000000..a67781c69 --- /dev/null +++ b/v/0.5.0-rc.2/start/index.html @@ -0,0 +1,903 @@ + + + + + Overview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Overview

+ +

What is Brooklyn?

+ + + + +

brooklyn is a library that simplifies application deployment and management.

+ + + + +

For deployment, it is designed to tie in with other tools, +giving single-click deploy and adding the concepts of +manageable clusters and fabrics:

+ + + + +
    +
  • many common software entities available out-of-the-box
  • +
  • integrates with Apache Whirr -- and thereby Chef and Puppet -- +to deploy well-known services such as Hadoop and elasticsearch +(or use POBS, plain-old-bash-scripts)
  • +
  • use PaaS's such as OpenShift, alongside self-built clusters, for maximum flexibility
  • +
+ + + + +

Brooklyn makes roll-out an integral part of the DevOps chain, +as code which can be version-controlled and programmatically tested, +and portable across many clouds or fixed IP machines, +using jclouds -- +or just hitting localhost for quick dev/test.

+ + + + +

Brooklyn's main emphasis is post-deployment, managing an application once it is live: +management policies are an integral part of the deployment descriptor, +and at runtime policies have access to all aspects of the deployment. +They are aware of the deployment topology (hierarchical) and +locations (machines, PaaSes, and jurisdictions), +as well as scripts, instrumentation, and operational goals and constraints. +This means they're all set, once the application is launched, +to keep the application running optimally, +based on whatever optimally means in that context.

+ + + + +

These deployment patterns and management policies are expressed as Java (and Groovy) classes, +open-sourced here and giving you full control over what you want to happen. +More importantly, however, this code can be shared, improved, and extended.

+ + + + +

We're still near the beginning of figuring this out: +join us to make it better.

+ + + + +

To Get Started

+ + + + + + + + + +

If you like it, or if you have ideas how it could be better, +join the discussion.

+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/start/index.include.md b/v/0.5.0-rc.2/start/index.include.md new file mode 100644 index 000000000..d0dad1e36 --- /dev/null +++ b/v/0.5.0-rc.2/start/index.include.md @@ -0,0 +1,50 @@ +## What is Brooklyn? + +**brooklyn** is a library that simplifies application deployment and management. + +For **deployment**, it is designed to tie in with other tools, +giving single-click deploy and adding the concepts of +manageable clusters and fabrics: + +* many common software entities available out-of-the-box +* integrates with [Apache Whirr](http://whirr.apache.org) -- and thereby Chef and Puppet -- + to deploy well-known services such as Hadoop and elasticsearch + (or use POBS, plain-old-bash-scripts) +* use PaaS's such as OpenShift, alongside self-built clusters, for maximum flexibility + +Brooklyn makes roll-out an integral part of the DevOps chain, +as code which can be version-controlled and programmatically tested, +and portable across many clouds or fixed IP machines, +using [jclouds](http://jclouds.org) -- +or just hitting ``localhost`` for quick dev/test. + +Brooklyn's main emphasis is post-deployment, **managing** an application once it is live: +management policies are an integral part of the deployment descriptor, +and at runtime policies have access to all aspects of the deployment. +They are aware of the deployment topology (hierarchical) and +locations (machines, PaaSes, and jurisdictions), +as well as scripts, instrumentation, and operational goals and constraints. +This means they're all set, once the application is launched, +to keep the application running optimally, +based on whatever *optimally* means in that context. + +These deployment patterns and management policies are expressed as Java (and Groovy) classes, +open-sourced here and giving you full control over what you want to happen. +More importantly, however, this code can be shared, improved, and extended. + +We're still near the beginning of figuring this out: +[join us to make it better]({{site.url}}/meta/contact.html). + + +## To Get Started + +* See the [developer's walkthrough]({{site.url}}/start/walkthrough/index.html) for a quick tour +* Check out the [examples]({{site.url}}/use/examples/), from a global web fabric with geo-DNS to a movable PaaS target +* Jump in to the [user guide]({{site.url}}/use/guide/) describing the + [concepts]({{site.url}}/use/guide/defining-applications/basic-concepts.html) + and including a [tutorial]({{site.url}}/use/guide/quickstart/) +* Or dive straight in to the code, either [reading]({{site.url}}/dev/code/) about it + or [gitting](http://github.com/brooklyncentral/brooklyn/) it + +If you like it, or if you have ideas how it could be better, +[join the discussion]({{site.url}}/meta/contact.html). diff --git a/v/0.5.0-rc.2/start/known-issues.html b/v/0.5.0-rc.2/start/known-issues.html new file mode 100644 index 000000000..8f0bdf992 --- /dev/null +++ b/v/0.5.0-rc.2/start/known-issues.html @@ -0,0 +1,843 @@ + + + + + Known Issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Known Issues

+ +

Unable to Provision certain types of Debian VMs

+ +

Symptom: Brooklyn fails to provision Debian VMs (e.g. in aws-ec2).

+ +

Cause: sudo is not available on path, causing Brooklyn to fail to confirm that the VM is ssh'able.

+ +

Workaround: Choose an image that does have sudo (see wiki.debian.org/Cloud/AmazonEC2Image).

+ +

Fix: is Pull #600; you may also want to run with brooklyn.jclouds.aws-ec2.user=root if subsequent commands give permission errors.

+ +

Versions Affected: 0.5.0-M2

+ +

Unable to Provision Ubuntu 8 VMs

+ +

*Symptom: Brooklyn fails to provision Ubuntu 8 VMs (e.g. in aws-ec2) with the following error 'Cannot insert the iptables rule for port 22. Error: sudo: illegal option `-n''.

+ +

*Cause: Ubuntu 8 is too old; the sudo command doesn't support the -n setting.

+ +

*Workaround: Choose Ubuntu 10 or higher.

+ +

Versions Affected: 0.5.0-M2

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/start/release-notes.html b/v/0.5.0-rc.2/start/release-notes.html new file mode 100644 index 000000000..45ffc4f48 --- /dev/null +++ b/v/0.5.0-rc.2/start/release-notes.html @@ -0,0 +1,908 @@ + + + + + Release Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Release Notes

+ +

Brooklyn Version 0.5.0 RC1 (0.5.0-rc.1)

+ +

API Tidy on top of M2, using init() as the method to override when building composed Application and Entity classes.

+ +

There are known issues with Whirr clusters and the Cloud Foundry example (moving) which will be resolved for RC2.

+ +

Brooklyn Version 0.5.0 Milestone Two (0.5.0-M2)

+ +

Introduction

+ +

This milestone release includes many big features, and brings us much closer to a 0.5.0 release.

+ +

It incorporates a lot of improvements and feedback from our community. Thank you!

+ +

Thanks also go to Brooklyn's commercial users. Already Brooklyn has been adopted into some very exciting projects including controlling custom PaaS offerings, big data clusters, and three-tier web-apps.

+ +

Work on this release can be tracked using Brooklyn's GitHub issue tracker:

+ + + + +

And via the mailing lists:

+ + + + +

New Features

+ +

The major changes between M1 and M2 are:

+ +
    +
  1. Entities have been separated into an interface and implementation, rather than just a single class. Construction of entities is now done using an EntitySpec, rather than directly calling the constructor. This improvement is required to simplify remoting in a distributed brooklyn management plane.

  2. +
  3. Downloading of entity installers is greatly improved:

    + +
      +
    • More configurable, with ability to specify URLs in the brooklyn configuration files or to override in code.
    • +
    • Will fallback to a repository maintained by Cloudsoft, so if an artifact is removed from the official public site then it will not break the entity.

      + +

      See downloads.cloudsoftcorp.com/brooklyn/repository/

    • +
    +
  4. +
  5. Support for running applications across private subnets.

  6. +
  7. Policies can now be re-configured on-the-fly through the REST api and through the web-console.

  8. +
  9. Some entities now support configuration files being supplied in FreeMarker template format. These include JBoss AS7, ActiveMQ and MySql. More will be converted to use this pattern.

  10. +
  11. Several new entities have been added, including:

    + +
      +
    • MongoDB
    • +
    • Cassandra
    • +
    • RubyRep
    • +
    • DynamicWebAppFabric
    • +
    +
  12. +
+ + +

Backwards Compatibility

+ +

For upgrading from 0.5.0-M1 to M2:

+ +
    +
  1. Entity classes have been renamed, e.g. MySqlNode is now an interface and the implementationis MySqlNodeImpl.

    + +
      +
    • The minimum change for this to work is to update your references to include the Impl suffixes. However, that will result in deprecation warnings.
    • +
    • The recommended approach is to use the EntitySpec when constructing entities. A good place to start is to look at the updated example applications.
    • +
    +
  2. +
  3. The default username for provisioning with jclouds has changed to use the name of the user executing the Brooklyn process.

    + +
      +
    • Java's System.getProperty("user.name") is used instead of 'root' or 'ubuntu'
    • +
    • Usernames can be overridden in brooklyn.properties or using system properties. + For example, by entering 'brooklyn.location.named.acmecloud.user=root' in brooklyn.properties or using the command syntax -Dbrooklyn.location.named.acmecloud.user=root.

      + +

      'brooklyn.jclouds.aws-ec2.user=root' could also be used to apply user=root to all aws-ec2 VMs.

    • +
    +
  4. +
  5. Some deprecated code has been deleted. All of this code was commented in 0.4.0 with text such as "will be deleted in 0.5".

  6. +
+ + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/start/toc.json b/v/0.5.0-rc.2/start/toc.json new file mode 100644 index 000000000..43d79d7f8 --- /dev/null +++ b/v/0.5.0-rc.2/start/toc.json @@ -0,0 +1,10 @@ +[ +{ "title": "Overview", + "file": "{{ site.url }}/index.html" }, +{ "title": "Walkthrough", + "file": "{{ site.url }}/start/walkthrough/index.html" }, +{ "title": "Download", + "file": "{{ site.url }}/start/download.html" }, +{ "title": "Documentation", + "file": "{{ site.url }}/start/docs-summary.html" } +] diff --git a/v/0.5.0-rc.2/start/video.html b/v/0.5.0-rc.2/start/video.html new file mode 100644 index 000000000..b861733df --- /dev/null +++ b/v/0.5.0-rc.2/start/video.html @@ -0,0 +1,823 @@ + + + + + Video + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Video

+ +

TODO

+ + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/start/walkthrough/index.html b/v/0.5.0-rc.2/start/walkthrough/index.html new file mode 100644 index 000000000..9cc96b5b5 --- /dev/null +++ b/v/0.5.0-rc.2/start/walkthrough/index.html @@ -0,0 +1,1007 @@ + + + + + Walkthrough + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Walkthrough

+ +

Intro

+ +

Brooklyn makes it easy to describe how to launch and manage +sophisticated distributed applications. +Let's start with an example of a three tier application +composed of:

+ +
    +
  • an Nginx load-balancer
  • +
  • a cluster of JBoss appservers
  • +
  • a MySQL database
  • +
+ + +

Here's the essential code which creates these and sets them up +for management:

+ +
public class WebClusterDatabaseExample extends AbstractApplication {
+    @Override
+    public void init() {
+        MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class));
+        ControlledDynamicWebAppCluster web = addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class));
+    }
+}
+
+ + +

Runtime: the Web Console

+ +

Build and run this Brooklyn "Application", specifying a target location, and our application is deployed.

+ +
export BROOKLYN_CLASSPATH=/path/to/your/project/target/classes
+brooklyn launch --app brooklyn.demo.WebClusterDatabaseExample --location jclouds:aws-ec2:eu-west-1
+
+ + +

Amazon is used in these screenshots, but lots of targets are supported (using jclouds) +including fixed IP addresses and private clouds, +or just localhost (very handy for dev/test, and with port conflicts resolved automatically!).

+ +

Web Console

+ +

The management console provides a view on to the entities that launched, +including the hierarchy (appservers grouped into a cluster) and their locations. +Brooklyn collects information from these entities ("sensors"), +aggregates these for clusters and other groups (using "enrichers"), +and exposes operations ("effectors") that can be performed on entities.

+ +

Web Console Details

+ +

Some Configuration and Management

+ +

Of course in the real world, application deployments are more interesting; +they do things and need configuration. For instance you might need to:

+ +
    +
  • specify a WAR file
  • +
  • initialize the database
  • +
  • tell the webapp servers where to find the database
  • +
+ + +

Let's show how these are done using Brooklyn. +We assume the WAR file and the database init script are accessible +on the classpath, but a range of URL formats is supported. +The "dependent inter-process configuration" -- giving the database's URL +to the webapps -- we'll do here with a JVM system property, +but you're free to use any mechanism you wish. +Under the covers, attributeWhenReady is monitoring a sensor from MySQL +and generating a string to pass to the webapp software processes; formatString +is a similar utility that returns a string once all of its parts have been resolved. +Due to the use of futures, the Brooklyn webapp entities will automatically +block "at the last moment" when the value is needed +(but after e.g. the VMs have been provisioned, to speed things up).

+ +
public class WebClusterDatabaseExample extends AbstractApplication {
+    @Override
+    public void init() {
+        MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class)
+                .configure(MySqlNode.CREATION_SCRIPT_URL, "classpath://visitors-database-setup.sql"));
+        
+        ControlledDynamicWebAppCluster web = addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class)
+                .configure("memberSpec", EntitySpecs.spec(JBoss7Server.class)
+                        .configure("httpPort", "8080+")
+                        .configure("war", WAR_PATH)
+                        .configure(javaSysProp("brooklyn.example.db.url"), 
+                                formatString("jdbc:%s%s?user=%s\\&password=%s", 
+                                        attributeWhenReady(mysql, MySqlNode.MYSQL_URL), DB_TABLE, DB_USERNAME, DB_PASSWORD))));
+    }
+}
+
+ + +

We now see our app at the Nginx URL:

+ +

Our Web App

+ +

Finally, we'll bring in some active management: we're going to monitor requests per second, +and scale out if this exceeds 100 up to a maximum of 5 servers. +This is a naively simple policy, but it shows Brooklyn's real metier, +running management policies for applications whose topology it knows.

+ +
        web.getCluster().addPolicy(AutoScalerPolicy.builder().
+                        metric(DynamicWebAppCluster.AVERAGE_REQUESTS_PER_SECOND).
+                        sizeRange(1, 5).
+                        metricRange(10, 100).
+                        build());
+
+ + +

Policies in Brooklyn typically subscribe to sensors, +perform some computation, and if necessary invoke effectors +on entities. This is where the ability to group entities +becomes very useful -- policies can be attached to group entities, +and groups themselves can be hierarchical. +It's also handy that often Brooklyn creates the entities, +so it knows what the hierarchy is.

+ +

Under the covers, this AutoScalerPolicy attaches to any Resizable entity +(exposing a resize effector), and monitors a specified sensor (or function) +attempting to keep it within healthy limits. +A separate policy operates at the Controlled cluster to ensure the +load-balancer is updated as the pool of web servers expands and contracts.

+ +

Fire up a JMeter session and blast the Nginx address. +The resizer policy scales up our cluster:

+ +

Web Cluster Scaling with the Resizer Policy

+ +

Run it Yourself

+ +

All the code for this walkthrough (and even the JMeter script) is included with +Brooklyn as the simple-web-cluster example, +described in detail here.

+ +

For your applications, you might want to mix in other data stores, messaging systems, or on-line services including PaaS. +Brooklyn supports some of these out-of-the-box, including a wide-range of tools which it can use Whirr to provision, such as Hadoop. +But if you have something you don't see, +let us know -- +we want to work with you to +write a new entity or +policy +and contribute it.

+ + + + + +
+ + + +
+ + + +
+ + + diff --git a/v/0.5.0-rc.2/start/walkthrough/walkthrough-webapp-w700.png b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webapp-w700.png new file mode 100644 index 000000000..2176b5a78 Binary files /dev/null and b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webapp-w700.png differ diff --git a/v/0.5.0-rc.2/start/walkthrough/walkthrough-webapp.png b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webapp.png new file mode 100644 index 000000000..c7cf2645d Binary files /dev/null and b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webapp.png differ diff --git a/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-details-w700.png b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-details-w700.png new file mode 100644 index 000000000..f11f353d7 Binary files /dev/null and b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-details-w700.png differ diff --git a/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-details.png b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-details.png new file mode 100644 index 000000000..e17a052dd Binary files /dev/null and b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-details.png differ diff --git a/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-map-w700.png b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-map-w700.png new file mode 100644 index 000000000..620138734 Binary files /dev/null and b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-map-w700.png differ diff --git a/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-map.png b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-map.png new file mode 100644 index 000000000..0a943f721 Binary files /dev/null and b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-map.png differ diff --git a/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-scaling-w700.png b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-scaling-w700.png new file mode 100644 index 000000000..871fdea3c Binary files /dev/null and b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-scaling-w700.png differ diff --git a/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-scaling.png b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-scaling.png new file mode 100644 index 000000000..47988cd91 Binary files /dev/null and b/v/0.5.0-rc.2/start/walkthrough/walkthrough-webconsole-scaling.png differ diff --git a/v/0.5.0-rc.2/style/docs/code.css b/v/0.5.0-rc.2/style/docs/code.css new file mode 100644 index 000000000..5af973b41 --- /dev/null +++ b/v/0.5.0-rc.2/style/docs/code.css @@ -0,0 +1,61 @@ +.hll { background-color: #ffffcc } +.c { color: #60a0b0; font-style: italic } /* Comment */ +.err { border: 1px solid #FF0000 } /* Error */ +.k { color: #007020; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */ +.cp { color: #007020 } /* Comment.Preproc */ +.c1 { color: #60a0b0; font-style: italic } /* Comment.Single */ +.cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #00A000 } /* Generic.Inserted */ +.go { color: #808080 } /* Generic.Output */ +.gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0040D0 } /* Generic.Traceback */ +.kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #007020 } /* Keyword.Pseudo */ +.kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #902000 } /* Keyword.Type */ +.m { color: #40a070 } /* Literal.Number */ +.s { color: #4070a0 } /* Literal.String */ +.na { color: #4070a0 } /* Name.Attribute */ +.nb { color: #007020 } /* Name.Builtin */ +.nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.no { color: #60add5 } /* Name.Constant */ +.nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.ne { color: #007020 } /* Name.Exception */ +.nf { color: #06287e } /* Name.Function */ +.nl { color: #002070; font-weight: bold } /* Name.Label */ +.nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.nt { color: #062873; font-weight: bold } /* Name.Tag */ +.nv { color: #bb60d5 } /* Name.Variable */ +.ow { color: #007020; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mf { color: #40a070 } /* Literal.Number.Float */ +.mh { color: #40a070 } /* Literal.Number.Hex */ +.mi { color: #40a070 } /* Literal.Number.Integer */ +.mo { color: #40a070 } /* Literal.Number.Oct */ +.sb { color: #4070a0 } /* Literal.String.Backtick */ +.sc { color: #4070a0 } /* Literal.String.Char */ +.sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #4070a0 } /* Literal.String.Double */ +.se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #4070a0 } /* Literal.String.Heredoc */ +.si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.sx { color: #c65d09 } /* Literal.String.Other */ +.sr { color: #235388 } /* Literal.String.Regex */ +.s1 { color: #4070a0 } /* Literal.String.Single */ +.ss { color: #517918 } /* Literal.String.Symbol */ +.bp { color: #007020 } /* Name.Builtin.Pseudo */ +.vc { color: #bb60d5 } /* Name.Variable.Class */ +.vg { color: #bb60d5 } /* Name.Variable.Global */ +.vi { color: #bb60d5 } /* Name.Variable.Instance */ +.il { color: #40a070 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/v/0.5.0-rc.2/style/icons/clipboard-green-click.png b/v/0.5.0-rc.2/style/icons/clipboard-green-click.png new file mode 100644 index 000000000..d677539a0 Binary files /dev/null and b/v/0.5.0-rc.2/style/icons/clipboard-green-click.png differ diff --git a/v/0.5.0-rc.2/style/icons/clipboard-green-hover.png b/v/0.5.0-rc.2/style/icons/clipboard-green-hover.png new file mode 100644 index 000000000..4c7ced155 Binary files /dev/null and b/v/0.5.0-rc.2/style/icons/clipboard-green-hover.png differ diff --git a/v/0.5.0-rc.2/style/icons/clipboard-green-normal.png b/v/0.5.0-rc.2/style/icons/clipboard-green-normal.png new file mode 100644 index 000000000..139c236ae Binary files /dev/null and b/v/0.5.0-rc.2/style/icons/clipboard-green-normal.png differ diff --git a/v/0.5.0-rc.2/style/icons/clipboard.png b/v/0.5.0-rc.2/style/icons/clipboard.png new file mode 100644 index 000000000..0a205ac5c Binary files /dev/null and b/v/0.5.0-rc.2/style/icons/clipboard.png differ diff --git a/v/0.5.0-rc.2/style/icons/ok.png b/v/0.5.0-rc.2/style/icons/ok.png new file mode 100644 index 000000000..48b1b9f04 Binary files /dev/null and b/v/0.5.0-rc.2/style/icons/ok.png differ diff --git a/v/0.5.0-rc.2/style/icons/warning.png b/v/0.5.0-rc.2/style/icons/warning.png new file mode 100644 index 000000000..dd2713155 Binary files /dev/null and b/v/0.5.0-rc.2/style/icons/warning.png differ diff --git a/v/0.5.0-rc.2/style/images/bridge.png b/v/0.5.0-rc.2/style/images/bridge.png new file mode 100644 index 000000000..b064ebe23 Binary files /dev/null and b/v/0.5.0-rc.2/style/images/bridge.png differ diff --git a/v/0.5.0-rc.2/style/images/brooklyn.gif b/v/0.5.0-rc.2/style/images/brooklyn.gif new file mode 100644 index 000000000..ece44c547 Binary files /dev/null and b/v/0.5.0-rc.2/style/images/brooklyn.gif differ diff --git a/v/0.5.0-rc.2/style/images/divider-quicklinks.gif b/v/0.5.0-rc.2/style/images/divider-quicklinks.gif new file mode 100644 index 000000000..78dfda21c Binary files /dev/null and b/v/0.5.0-rc.2/style/images/divider-quicklinks.gif differ diff --git a/v/0.5.0-rc.2/style/js/jquery.cookie.js b/v/0.5.0-rc.2/style/js/jquery.cookie.js new file mode 100644 index 000000000..aebaa84fc --- /dev/null +++ b/v/0.5.0-rc.2/style/js/jquery.cookie.js @@ -0,0 +1,94 @@ +/*! + * jQuery Cookie Plugin v1.3.1 + * https://github.com/carhartl/jquery-cookie + * + * Copyright 2013 Klaus Hartl + * Released under the MIT license + */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as anonymous module. + define(['jquery'], factory); + } else { + // Browser globals. + factory(jQuery); + } +}(function ($) { + + var pluses = /\+/g; + + function raw(s) { + return s; + } + + function decoded(s) { + return decodeURIComponent(s.replace(pluses, ' ')); + } + + function converted(s) { + if (s.indexOf('"') === 0) { + // This is a quoted cookie as according to RFC2068, unescape + s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); + } + try { + return config.json ? JSON.parse(s) : s; + } catch(er) {} + } + + var config = $.cookie = function (key, value, options) { + + // write + if (value !== undefined) { + options = $.extend({}, config.defaults, options); + + if (typeof options.expires === 'number') { + var days = options.expires, t = options.expires = new Date(); + t.setDate(t.getDate() + days); + } + + value = config.json ? JSON.stringify(value) : String(value); + + return (document.cookie = [ + config.raw ? key : encodeURIComponent(key), + '=', + config.raw ? value : encodeURIComponent(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } + + // read + var decode = config.raw ? raw : decoded; + var cookies = document.cookie.split('; '); + var result = key ? undefined : {}; + for (var i = 0, l = cookies.length; i < l; i++) { + var parts = cookies[i].split('='); + var name = decode(parts.shift()); + var cookie = decode(parts.join('=')); + + if (key && key === name) { + result = converted(cookie); + break; + } + + if (!key) { + result[name] = converted(cookie); + } + } + + return result; + }; + + config.defaults = {}; + + $.removeCookie = function (key, options) { + if ($.cookie(key) !== undefined) { + $.cookie(key, '', $.extend(options, { expires: -1 })); + return true; + } + return false; + }; + +})); diff --git a/v/0.5.0-rc.2/style/js/jquery/jquery-1.7.1.min.js b/v/0.5.0-rc.2/style/js/jquery/jquery-1.7.1.min.js new file mode 100644 index 000000000..b1b47b81c --- /dev/null +++ b/v/0.5.0-rc.2/style/js/jquery/jquery-1.7.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); diff --git a/v/0.5.0-rc.2/style/js/jquery/jquery-ui-1.8.18.custom.min.js b/v/0.5.0-rc.2/style/js/jquery/jquery-ui-1.8.18.custom.min.js new file mode 100644 index 000000000..f00a62f13 --- /dev/null +++ b/v/0.5.0-rc.2/style/js/jquery/jquery-ui-1.8.18.custom.min.js @@ -0,0 +1,356 @@ +/*! + * jQuery UI 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/* + * jQuery UI Position 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/* + * jQuery UI Draggable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f=k&&g<=l||h>=k&&h<=l||gl)&&(e>=i&&e<=j||f>=i&&f<=j||ej);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/* + * jQuery UI Selectable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.righth||i.bottome&&i.rightf&&i.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+jf&&b+ka[this.floating?"width":"height"]?l:f0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.topthis.containment[3]?h-this.offset.click.topthis.containment[2]?i-this.offset.click.left=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.18",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/* + * jQuery UI Autocomplete 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("
    ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",context:{autocompleteRequest:++c},success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length").data("item.autocomplete",c).append(a("").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/* + * jQuery UI Dialog 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
    ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
    ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.18"})})(jQuery);/* + * jQuery UI Tabs 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.18"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a'))}$.extend($.ui,{datepicker:{version:"1.8.18"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
    ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
    '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
    ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
    '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
    '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
    "+(j?""+(g[0]>0&&N==g[1]-1?'
    ':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""), +a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
    ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
    ";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* + * jQuery UI Progressbar 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
    ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/* + * jQuery UI Effects 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/* + * jQuery UI Effects Fade 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* + * jQuery UI Effects Fold 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* + * jQuery UI Effects Highlight 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* + * jQuery UI Effects Pulsate 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 000000000..5b5dab2ab Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 000000000..ac8b229af Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 000000000..ad3d6346e Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 000000000..42ccba269 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 000000000..5a46b47cb Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 000000000..86c2baa65 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 000000000..4443fdc1a Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 000000000..7c9fa6c6e Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_222222_256x240.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_222222_256x240.png new file mode 100644 index 000000000..b273ff111 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_222222_256x240.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_2e83ff_256x240.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_2e83ff_256x240.png new file mode 100644 index 000000000..09d1cdc85 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_2e83ff_256x240.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_454545_256x240.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_454545_256x240.png new file mode 100644 index 000000000..59bd45b90 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_454545_256x240.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_888888_256x240.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_888888_256x240.png new file mode 100644 index 000000000..6d02426c1 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_888888_256x240.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_cd0a0a_256x240.png b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 000000000..2ab019b73 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/jquery/smoothness/images/ui-icons_cd0a0a_256x240.png differ diff --git a/v/0.5.0-rc.2/style/js/jquery/smoothness/jquery-ui-1.8.18.custom.css b/v/0.5.0-rc.2/style/js/jquery/smoothness/jquery-ui-1.8.18.custom.css new file mode 100644 index 000000000..4cfb50a4a --- /dev/null +++ b/v/0.5.0-rc.2/style/js/jquery/smoothness/jquery-ui-1.8.18.custom.css @@ -0,0 +1,565 @@ +/* + * jQuery UI CSS Framework 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } +.ui-helper-clearfix:after { clear: both; } +.ui-helper-clearfix { zoom: 1; } +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* + * jQuery UI CSS Framework 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* + * jQuery UI Resizable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* + * jQuery UI Selectable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Accordion 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } +/* + * jQuery UI Autocomplete 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.18 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* + * jQuery UI Button 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: hidden; *overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* + * jQuery UI Dialog 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* + * jQuery UI Slider 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* + * jQuery UI Tabs 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* + * jQuery UI Datepicker 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* + * jQuery UI Progressbar 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; overflow: hidden; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/v/0.5.0-rc.2/style/js/superfish.js b/v/0.5.0-rc.2/style/js/superfish.js new file mode 100644 index 000000000..c6a9c7de0 --- /dev/null +++ b/v/0.5.0-rc.2/style/js/superfish.js @@ -0,0 +1,121 @@ + +/* + * Superfish v1.4.8 - jQuery menu widget + * Copyright (c) 2008 Joel Birch + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt + */ + +;(function($){ + $.fn.superfish = function(op){ + + var sf = $.fn.superfish, + c = sf.c, + $arrow = $([' »'].join('')), + over = function(){ + var $$ = $(this), menu = getMenu($$); + clearTimeout(menu.sfTimer); + $$.showSuperfishUl().siblings().hideSuperfishUl(); + }, + out = function(){ + var $$ = $(this), menu = getMenu($$), o = sf.op; + clearTimeout(menu.sfTimer); + menu.sfTimer=setTimeout(function(){ + o.retainPath=($.inArray($$[0],o.$path)>-1); + $$.hideSuperfishUl(); + if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} + },o.delay); + }, + getMenu = function($menu){ + var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; + sf.op = sf.o[menu.serial]; + return menu; + }, + addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; + + return this.each(function() { + var s = this.serial = sf.o.length; + var o = $.extend({},sf.defaults,op); + o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){ + $(this).addClass([o.hoverClass,c.bcClass].join(' ')) + .filter('li:has(ul)').removeClass(o.pathClass); + }); + sf.o[s] = sf.op = o; + + $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { + if (o.autoArrows) addArrow( $('>a:first-child',this) ); + }) + .not('.'+c.bcClass) + .hideSuperfishUl(); + + var $a = $('a',this); + $a.each(function(i){ + var $li = $a.eq(i).parents('li'); + $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); + }); + o.onInit.call(this); + + }).each(function() { + var menuClasses = [c.menuClass]; + if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass); + $(this).addClass(menuClasses.join(' ')); + }); + }; + + var sf = $.fn.superfish; + sf.o = []; + sf.op = {}; + sf.IE7fix = function(){ + var o = sf.op; + if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined) + this.toggleClass(sf.c.shadowClass+'-off'); + }; + sf.c = { + bcClass : 'sf-breadcrumb', + menuClass : 'sf-js-enabled', + anchorClass : 'sf-with-ul', + arrowClass : 'sf-sub-indicator', + shadowClass : 'sf-shadow' + }; + sf.defaults = { + hoverClass : 'sfHover', + pathClass : 'overideThisToUse', + pathLevels : 1, + delay : 800, + animation : {opacity:'show'}, + speed : 'normal', + autoArrows : true, + dropShadows : true, + disableHI : false, // true disables hoverIntent detection + onInit : function(){}, // callback functions + onBeforeShow: function(){}, + onShow : function(){}, + onHide : function(){} + }; + $.fn.extend({ + hideSuperfishUl : function(){ + var o = sf.op, + not = (o.retainPath===true) ? o.$path : ''; + o.retainPath = false; + var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) + .find('>ul').hide().css('visibility','hidden'); + o.onHide.call($ul); + return this; + }, + showSuperfishUl : function(){ + var o = sf.op, + sh = sf.c.shadowClass+'-off', + $ul = this.addClass(o.hoverClass) + .find('>ul:hidden').css('visibility','visible'); + sf.IE7fix.call($ul); + o.onBeforeShow.call($ul); + $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); + return this; + } + }); + +})(jQuery); diff --git a/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.as b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.as new file mode 100755 index 000000000..26ad18b55 --- /dev/null +++ b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.as @@ -0,0 +1,81 @@ +package { + // Simple Set Clipboard System + // Author: Joseph Huckaby + + import flash.display.Stage; + import flash.display.Sprite; + import flash.display.LoaderInfo; + import flash.display.StageScaleMode; + import flash.events.*; + import flash.display.StageAlign; + import flash.display.StageScaleMode; + import flash.external.ExternalInterface; + import flash.system.Security; + import flash.utils.*; + import flash.system.System; + + public class ZeroClipboard extends Sprite { + + private var id:String = ''; + private var button:Sprite; + private var clipText:String = ''; + + public function ZeroClipboard() { + // constructor, setup event listeners and external interfaces + stage.scaleMode = StageScaleMode.EXACT_FIT; + flash.system.Security.allowDomain("*"); + + // import flashvars + var flashvars:Object = LoaderInfo( this.root.loaderInfo ).parameters; + id = flashvars.id; + + // invisible button covers entire stage + button = new Sprite(); + button.buttonMode = true; + button.useHandCursor = true; + button.graphics.beginFill(0xCCFF00); + button.graphics.drawRect(0, 0, Math.floor(flashvars.width), Math.floor(flashvars.height)); + button.alpha = 0.0; + addChild(button); + button.addEventListener(MouseEvent.CLICK, clickHandler); + + button.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event) { + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOver', null ); + } ); + button.addEventListener(MouseEvent.MOUSE_OUT, function(event:Event) { + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOut', null ); + } ); + button.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event) { + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseDown', null ); + } ); + button.addEventListener(MouseEvent.MOUSE_UP, function(event:Event) { + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseUp', null ); + } ); + + // external functions + ExternalInterface.addCallback("setHandCursor", setHandCursor); + ExternalInterface.addCallback("setText", setText); + + // signal to the browser that we are ready + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'load', null ); + } + + public function setText(newText) { + // set the maximum number of files allowed + clipText = newText; + } + + public function setHandCursor(enabled:Boolean) { + // control whether the hand cursor is shown on rollover (true) + // or the default arrow cursor (false) + button.useHandCursor = enabled; + } + + private function clickHandler(event:Event):void { + // user click copies text to clipboard + // as of flash player 10, this MUST happen from an in-movie flash click event + System.setClipboard( clipText ); + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'complete', clipText ); + } + } +} diff --git a/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.fla b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.fla new file mode 100755 index 000000000..007dc9495 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.fla differ diff --git a/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.js b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.js new file mode 100755 index 000000000..5adde9510 --- /dev/null +++ b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.js @@ -0,0 +1,311 @@ +// Simple Set Clipboard System +// Author: Joseph Huckaby + +var ZeroClipboard = { + + version: "1.0.7", + clients: {}, // registered upload clients on page, indexed by id + moviePath: 'ZeroClipboard.swf', // URL to movie + nextId: 1, // ID of next movie + + $: function(thingy) { + // simple DOM lookup utility function + if (typeof(thingy) == 'string') thingy = document.getElementById(thingy); + if (!thingy.addClass) { + // extend element with a few useful methods + thingy.hide = function() { this.style.display = 'none'; }; + thingy.show = function() { this.style.display = ''; }; + thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; }; + thingy.removeClass = function(name) { + var classes = this.className.split(/\s+/); + var idx = -1; + for (var k = 0; k < classes.length; k++) { + if (classes[k] == name) { idx = k; k = classes.length; } + } + if (idx > -1) { + classes.splice( idx, 1 ); + this.className = classes.join(' '); + } + return this; + }; + thingy.hasClass = function(name) { + return !!this.className.match( new RegExp("\\s*" + name + "\\s*") ); + }; + } + return thingy; + }, + + setMoviePath: function(path) { + // set path to ZeroClipboard.swf + this.moviePath = path; + }, + + dispatch: function(id, eventName, args) { + // receive event from flash movie, send to client + var client = this.clients[id]; + if (client) { + client.receiveEvent(eventName, args); + } + }, + + register: function(id, client) { + // register new client to receive events + this.clients[id] = client; + }, + + getDOMObjectPosition: function(obj, stopObj) { + // get absolute coordinates for dom element + var info = { + left: 0, + top: 0, + width: obj.width ? obj.width : obj.offsetWidth, + height: obj.height ? obj.height : obj.offsetHeight + }; + + while (obj && (obj != stopObj)) { + info.left += obj.offsetLeft; + info.top += obj.offsetTop; + obj = obj.offsetParent; + } + + return info; + }, + + Client: function(elem) { + // constructor for new simple upload client + this.handlers = {}; + + // unique ID + this.id = ZeroClipboard.nextId++; + this.movieId = 'ZeroClipboardMovie_' + this.id; + + // register client with singleton to receive flash events + ZeroClipboard.register(this.id, this); + + // create movie + if (elem) this.glue(elem); + } +}; + +ZeroClipboard.Client.prototype = { + + id: 0, // unique ID for us + ready: false, // whether movie is ready to receive events or not + movie: null, // reference to movie object + clipText: '', // text to copy to clipboard + handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor + cssEffects: true, // enable CSS mouse effects on dom container + handlers: null, // user event handlers + + glue: function(elem, appendElem, stylesToAdd) { + // glue to DOM element + // elem can be ID or actual DOM element object + this.domElement = ZeroClipboard.$(elem); + + // float just above object, or zIndex 99 if dom element isn't set + var zIndex = 99; + if (this.domElement.style.zIndex) { + zIndex = parseInt(this.domElement.style.zIndex, 10) + 1; + } + + if (typeof(appendElem) == 'string') { + appendElem = ZeroClipboard.$(appendElem); + } + else if (typeof(appendElem) == 'undefined') { + appendElem = document.getElementsByTagName('body')[0]; + } + + // find X/Y position of domElement + var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem); + + // create floating DIV above element + this.div = document.createElement('div'); + var style = this.div.style; + style.position = 'absolute'; + style.left = '' + box.left + 'px'; + style.top = '' + box.top + 'px'; + style.width = '' + box.width + 'px'; + style.height = '' + box.height + 'px'; + style.zIndex = zIndex; + + if (typeof(stylesToAdd) == 'object') { + for (addedStyle in stylesToAdd) { + style[addedStyle] = stylesToAdd[addedStyle]; + } + } + + // style.backgroundColor = '#f00'; // debug + + appendElem.appendChild(this.div); + + this.div.innerHTML = this.getHTML( box.width, box.height ); + }, + + getHTML: function(width, height) { + // return HTML for movie + var html = ''; + var flashvars = 'id=' + this.id + + '&width=' + width + + '&height=' + height; + + if (navigator.userAgent.match(/MSIE/)) { + // IE gets an OBJECT tag + var protocol = location.href.match(/^https/i) ? 'https://' : 'http://'; + html += ''; + } + else { + // all other browsers get an EMBED tag + html += ''; + } + return html; + }, + + hide: function() { + // temporarily hide floater offscreen + if (this.div) { + this.div.style.left = '-2000px'; + } + }, + + show: function() { + // show ourselves after a call to hide() + this.reposition(); + }, + + destroy: function() { + // destroy control and floater + if (this.domElement && this.div) { + this.hide(); + this.div.innerHTML = ''; + + var body = document.getElementsByTagName('body')[0]; + try { body.removeChild( this.div ); } catch(e) {;} + + this.domElement = null; + this.div = null; + } + }, + + reposition: function(elem) { + // reposition our floating div, optionally to new container + // warning: container CANNOT change size, only position + if (elem) { + this.domElement = ZeroClipboard.$(elem); + if (!this.domElement) this.hide(); + } + + if (this.domElement && this.div) { + var box = ZeroClipboard.getDOMObjectPosition(this.domElement); + var style = this.div.style; + style.left = '' + box.left + 'px'; + style.top = '' + box.top + 'px'; + } + }, + + setText: function(newText) { + // set text to be copied to clipboard + this.clipText = newText; + if (this.ready) this.movie.setText(newText); + }, + + addEventListener: function(eventName, func) { + // add user event listener for event + // event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel + eventName = eventName.toString().toLowerCase().replace(/^on/, ''); + if (!this.handlers[eventName]) this.handlers[eventName] = []; + this.handlers[eventName].push(func); + }, + + setHandCursor: function(enabled) { + // enable hand cursor (true), or default arrow cursor (false) + this.handCursorEnabled = enabled; + if (this.ready) this.movie.setHandCursor(enabled); + }, + + setCSSEffects: function(enabled) { + // enable or disable CSS effects on DOM container + this.cssEffects = !!enabled; + }, + + receiveEvent: function(eventName, args) { + // receive event from flash + eventName = eventName.toString().toLowerCase().replace(/^on/, ''); + + // special behavior for certain events + switch (eventName) { + case 'load': + // movie claims it is ready, but in IE this isn't always the case... + // bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function + this.movie = document.getElementById(this.movieId); + if (!this.movie) { + var self = this; + setTimeout( function() { self.receiveEvent('load', null); }, 1 ); + return; + } + + // firefox on pc needs a "kick" in order to set these in certain cases + if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) { + var self = this; + setTimeout( function() { self.receiveEvent('load', null); }, 100 ); + this.ready = true; + return; + } + + this.ready = true; + this.movie.setText( this.clipText ); + this.movie.setHandCursor( this.handCursorEnabled ); + break; + + case 'mouseover': + if (this.domElement && this.cssEffects) { + this.domElement.addClass('hover'); + if (this.recoverActive) this.domElement.addClass('active'); + } + break; + + case 'mouseout': + if (this.domElement && this.cssEffects) { + this.recoverActive = false; + if (this.domElement.hasClass('active')) { + this.domElement.removeClass('active'); + this.recoverActive = true; + } + this.domElement.removeClass('hover'); + } + break; + + case 'mousedown': + if (this.domElement && this.cssEffects) { + this.domElement.addClass('active'); + } + break; + + case 'mouseup': + if (this.domElement && this.cssEffects) { + this.domElement.removeClass('active'); + this.recoverActive = false; + } + break; + } // switch eventName + + if (this.handlers[eventName]) { + for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) { + var func = this.handlers[eventName][idx]; + + if (typeof(func) == 'function') { + // actual function reference + func(this, args); + } + else if ((typeof(func) == 'object') && (func.length == 2)) { + // PHP style object + method, i.e. [myObject, 'myMethod'] + func[0][ func[1] ](this, args); + } + else if (typeof(func) == 'string') { + // name of function + window[func](this, args); + } + } // foreach event handler defined + } // user defined handler for event + } + +}; diff --git a/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.swf b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.swf new file mode 100755 index 000000000..13bf8e396 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard.swf differ diff --git a/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard10.as b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard10.as new file mode 100644 index 000000000..7b07a6a87 --- /dev/null +++ b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard10.as @@ -0,0 +1 @@ +package { // Simple Set Clipboard System // Author: Joseph Huckaby import flash.display.Stage; import flash.display.Sprite; import flash.desktop.Clipboard; import flash.desktop.ClipboardFormats; import flash.desktop.ClipboardTransferMode; import flash.display.LoaderInfo; import flash.display.StageScaleMode; import flash.events.*; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.external.ExternalInterface; import flash.system.Security; import flash.utils.*; import flash.system.System; public class ZeroClipboard10 extends Sprite { private var id:String = ''; private var button:Sprite; private var clipText:String = ''; public function ZeroClipboard10() { // constructor, setup event listeners and external interfaces stage.scaleMode = StageScaleMode.EXACT_FIT; flash.system.Security.allowDomain("*"); // import flashvars var flashvars:Object = LoaderInfo( this.root.loaderInfo ).parameters; id = flashvars.id; // invisible button covers entire stage button = new Sprite(); button.buttonMode = true; button.useHandCursor = true; button.graphics.beginFill(0xCCFF00); button.graphics.drawRect(0, 0, Math.floor(flashvars.width), Math.floor(flashvars.height)); button.alpha = 0.0; addChild(button); button.addEventListener(MouseEvent.CLICK, clickHandler); button.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event) { ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOver', null ); } ); button.addEventListener(MouseEvent.MOUSE_OUT, function(event:Event) { ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOut', null ); } ); button.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event) { ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseDown', null ); } ); button.addEventListener(MouseEvent.MOUSE_UP, function(event:Event) { ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseUp', null ); } ); // external functions ExternalInterface.addCallback("setHandCursor", setHandCursor); ExternalInterface.addCallback("setText", setText); // signal to the browser that we are ready ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'load', null ); } public function setText(newText) { // set the maximum number of files allowed clipText = newText; } public function setHandCursor(enabled:Boolean) { // control whether the hand cursor is shown on rollover (true) // or the default arrow cursor (false) button.useHandCursor = enabled; } private function clickHandler(event:Event):void { // user click copies text to clipboard // as of flash player 10, this MUST happen from an in-movie flash click event Clipboard.generalClipboard.clear(); Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, clipText); Clipboard.generalClipboard.setData(ClipboardFormats.HTML_FORMAT, clipText); ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'complete', clipText ); } } } \ No newline at end of file diff --git a/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard10.fla b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard10.fla new file mode 100755 index 000000000..b98b5b936 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard10.fla differ diff --git a/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard10.swf b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard10.swf new file mode 100644 index 000000000..bfed97f67 Binary files /dev/null and b/v/0.5.0-rc.2/style/js/zeroclipboard/ZeroClipboard10.swf differ diff --git a/v/0.5.0-rc.2/style/style.css b/v/0.5.0-rc.2/style/style.css new file mode 100644 index 000000000..63fdc5c89 --- /dev/null +++ b/v/0.5.0-rc.2/style/style.css @@ -0,0 +1,133 @@ +/* +Brooklyn minisite +*/ + +/* BASIC STYLES */ +body {margin: 0px; padding: 10px 0px 20px 0px; font-family: arial, helvetica, sans-serif; background-color: #ffffff; color: #393939; font-size: 15px;} +h1, h2, h3, h4, h5, h6 {} +input, select, textarea {} +p, li, label, td, th,input, select, textarea {} +h1 {margin: 0 0 20px 0; padding: 0; font-size: 32px; font-weight: normal; color: #4d9d3a; border-bottom: 1px solid #e9e9e9;} +h2 {margin: 1.25em 0 20px 0; font-size: 20px; font-weight: normal; color: #4f8243} +h3 {margin: 1.1em 0 20px 0; font-size: 17px; font-weight: bold; color: #111111;} +h4 {margin: 1.1em 0 20px 0; font-size: 15px; font-weight: bold;} +textarea {width: 500px; padding: 2px 5px;} +p, input, label, li {} +p { margin: 0.75em 0; line-height: 1.4em;} +form {padding: 0; margin: 0;} +img {border: 0;} +a {color: #4f9d3c;} +a:hover {text-decoration: none;} + +/*ACCESSIBILITY*/ +#shortcuts {display: block; position: absolute; top: -100px; z-index: 0} +#shortcuts a {padding: 0 0.5em; left: 0; z-index: 0} +#shortcuts a:focus, #shortcuts a:active {display: inline; z-index: 2; background-color: #ffff00; color: #000000; text-decoration: none; position: absolute; top: 100px;} + +/* STRUCTURE */ +#container {width: 980px; padding: 0; margin: 0 auto;} +#contentcontainer {clear: both; width: 980px; overflow: hidden;} +#maincontent {width: 710px; float: left; padding: 10px 0px 25px 10px; background-color: #ffffff;} +#sidebar {width: 155px; float: right; background: #ffffff url(images/bridge.png) no-repeat 0 12px; padding: 112px 5px 20px 0;} + +/* HEADER */ +#header {padding: 0;} +#identity {float: left; margin: 0; padding: 30px 0 15px 10px;} +#identity a {text-decoration: none; display: block; margin: 0; color: #4d9d3a; font-size: 2.5em; padding: 0; background: transparent url(images/brooklyn.gif) no-repeat 0 0; width: 206px; height: 44px; text-indent: -1000px; overflow: hidden;} +.searchform {float: right; width: 160px; margin: 0; padding: 5px 5px 0 0; overflow: hidden; text-align: right;} +.searchinput {width: 147px; background: #ffffff; border: 1px solid #b1b7c2; -moz-border-radius: 5px; border-radius: 5px; color: #c8ccd5; padding: 3px;} +.searchinput:focus {color: #333333;} + +/*MENUS*/ +#header #quicklinks {float: right; list-style: none; margin: 0; padding: 0 10px 0 0;} +#header #quicklinks li {margin: 0; padding: 0 5px 0 7px; text-transform: uppercase; font-size: 10px; float: left; background: #ffffff url(images/divider-quicklinks.gif) no-repeat left center;} +#header #quicklinks li:first-child {background-image: none;} +#header #quicklinks a {text-decoration: none; color: #4f8243;} +#menubar {clear: both; width: 978px; height: 34px; background-color: #e8eded; border: 1px solid #d5dade; -moz-border-radius: 8px; border-radius: 8px;} +#mainmenu {list-style: none; margin: 0; padding: 4px 0 0 2px; width: 765px; display: block; float: left; font-size: 15px;} +#mainmenu li {float: left; position: relative; margin: 0; padding: 0; } +#mainmenu>li {border: 1px solid transparent; border-top-left-radius: 5px; -moz-border-radius-topleft: 5px; border-top-right-radius: 5px; -moz-border-radius-topright: 5px; border-bottom: 0;} +#mainmenu a {display: block; text-decoration: none; color: #508243;} +#mainmenu>li>a {padding: 0 8px 5px 8px; line-height: 25px;} +#mainmenu>li:hover {background-color: #ffffff; border: 1px solid #dbe0e4; border-bottom: 0;} +#mainmenu .current a {color: #838a8b;} +#mainmenu ul {display: none; position: absolute; top: 30px; left: -1px; float: left; background-color: #f5f5f5; border: 1px solid #dbe0e4; border-top: 0; list-style: none; margin: 0; padding: 5px; width: 185px;} +#mainmenu ul ul {left: 100%; margin-left: 6px; top: -1px; border-top: 1px solid #dbe0e4;} +#mainmenu ul li {width: 183px; padding: 0; border: 1px solid transparent;} +#mainmenu ul li:hover {border: 1px solid #dbe0e4; background-color: #ffffff;} +#mainmenu ul a {font-size: 14px; padding: 7px;} +#mainmenu li:hover > ul, #mainmenu li.sfHover > ul {display: block;} + +/* MAIN CONTENT */ +#breadcrumb {font-size: 12px; margin: 0 0 2em 0; color: #636363;} +#breadcrumb a {color: #636363; text-decoration: none;} +#breadcrumb a:hover {color: #636363; text-decoration: underline;} +#breadcrumb span {color: #9e9e9e;} +#maincontent ul {margin: 0.75em 0; padding: 0 0 0 25px;} +#maincontent li {line-height: 1.5em; margin: 0 0 0.25em 0; padding: 0;} +table {width: 100%; border: 1px solid #dbe0e4; border-bottom-left-radius: 10px; -moz-border-radius-bottomleft: 10px; border-bottom-right-radius: 10px; -moz-border-radius-bottomright: 10px;} +th, td {text-align: center; padding: 5px;} +th {background-color: #f2f3f5; font-weight: bold; color: #121212; border-right: 1px solid #dbe0e4;} +td {border-top: 1px solid #dbe0e4; border-right: 1px solid #dbe0e4; padding: 5px;} +th:last-child, td:last-child {border-right: 0;} + +/* PAGE ELEMENTS */ +div.warning{ + background-color: #F8CB9C; + border: 1px solid #FFAB7C; + padding-left: 0.75em; + -moz-border-radius: 8px; + border-radius: 8px; +} +#page_notes{ + display: none; + background-color: #4D9D3A; + border: 3px solid orange; + -moz-border-radius: 8px; + border-radius: 8px; + padding: 0.3em; + padding-left: 0.75em; + margin-top: -0.5em; + margin-bottom: 1em; +} +#page_notes .warning_banner_image img { + width: 64px; padding-top: 8px; padding-right: 12px; + float: left; +} +#page_notes p { line-height: 100%; color: white; } +#page_notes p.warning_banner_buttons {padding-right: 24px; } +#page_notes p.warning_banner_buttons a, #page_notes p.warning_banner_buttons a:visited { + color: orange; font-weight: bold; padding-right: 1em; text-decoration: none; } +#page_notes p.warning_banner_buttons a:hover { color: #FFC31E; font-weight: bold; } + + +/* SIDEBAR */ +#sidebar {font-size: 13px;} +#sidebar h2 {text-transform: uppercase; font-size: 12px; color: #111111; margin: 15px 0 5px 0;} +#sidebar ul {list-style: none; margin: 0; padding: 0;} +#sidebar li {margin: 0 0 5px; padding: 0;} +#sidebar li a {text-decoration: none;} +#sidebar li a:hover {text-decoration: underline;} + +/* FOOTER */ +#footer {color: #9aa2a6; margin: 0; height: auto; margin: 0 10px; overflow: hidden; border-top: 1px solid #cbcbcb; font-size: 10px;} +#footer p {padding: 0; line-height: 12px; font-size: 10px;} +#footer p#copyright {float: right; text-align: right; color: #6c6c6c;} +#footer p#linklove {float: left; text-align: left; color: #b6b6b6;} +#footer p#linklove a {color: #b6b6b6; text-decoration: none;} +#footer p#linklove a:hover {text-decoration: underline;} + +/* CODE */ +pre { + font-family: Consolas, Lucida Console, Monaco, monospace; + background-color:#e8eded; + padding: 1em; + font-size: 12px; + overflow-y: auto; /* horizontal scroll bar if line length is too long */ +} +code { + font-family: Consolas, Lucida Console, Monaco, monospace; + font-size: 13px; +} +pre code { font-size: 12px; } +.highlight { background-color:#e8eded; } /* clipboard icon should have the same background color as the code */ diff --git a/v/0.5.0-rc.2/style/toc.css b/v/0.5.0-rc.2/style/toc.css new file mode 100644 index 000000000..b4cc2b19b --- /dev/null +++ b/v/0.5.0-rc.2/style/toc.css @@ -0,0 +1,70 @@ + + +#sidebar_toc { padding-top: 6px; } +#sidebar_toc a { text-decoration: none; } + +#sidebar_toc div.toc-1 { padding: 8px; margin: 4px 0px 0px 0px; } +#sidebar_toc div.toc-1-item {text-transform: uppercase; font-size: 12px; color: #111111; margin: 15px 0 5px 0;} +#sidebar_toc div.toc-1-item.toc-1-header { margin: 0px 0px 2px 0px; } +#sidebar_toc div.toc-1-item:hover { color: #003800; } + +#sidebar_toc div.toc-2-item { color: #282; padding-top: 3px; } +#sidebar_toc div.toc-2-item:hover { color: #010; } + +#sidebar_toc div.toc-1.toc-active { background: #C6D0D8; border-radius: 5px; } +#sidebar_toc div.toc-1.toc-active div.toc-1-item { color: #222; } +#sidebar_toc div.toc-2.toc-active div.toc-2-item { font-weight: bold; } +#sidebar_toc div.toc-3.toc-active div.toc-3-item { font-weight: bold; } + +/* level 3 menu is displayed in the list, indented, if parent is active */ +#sidebar_toc div.toc-2.toc-active div.toc-2-children { margin: 2px 0px 3px 0px; } +#sidebar_toc div.toc-2.toc-active div.toc-3-item { + padding: 1px 0px 1px 12px; +} +#sidebar_toc div.toc-2.toc-active div.toc-3-item:hover { color: #060; } + +/* otherwise level 3 menu is popup */ +#sidebar_toc div.toc-2:not(.toc-active) div.toc-3-item { color: #262; background: #C6D0D8; + text-align: right; padding: 2px 6px 2px 6px; + border-width: 1px; border-style: solid; border-radius: 0px; border-color: #464; +} +#sidebar_toc div.toc-2:not(.toc-active) div.toc-3-item:hover { color: #030; border-color: #353; background: #e8eded; } + +#sidebar_toc div.toc-2:not(.toc-active) div.toc-2-children-popup { + display: none; +} +#sidebar_toc div.toc-2:not(.toc-active):hover div.toc-2-children-popup { + display: block; + position: relative; + height: 0px; +/* right: -180px; to make appear at right */ + left: -180px; + width: 180px; + top: -17px; +} +#sidebar_toc div.toc-2:not(.toc-active) div.toc-2-children { + display: block; + width: 160px; + padding: 0px 10px 0px 10px; +} + +/* old +.ui-accordion { font-size: 90% } +.ui-accordion .left-menu-body { + padding: 0; + overflow:hidden; +} +.ui-accordion .toc1 { margin: 14px 0px 0px 0px; } + +#sidebar_toc .toc1 { background: #f8f8f8; } +#sidebar_toc .toc2 { background: #f0f0f0; } +#sidebar_toc .toc3 { background: #e8e8e8; padding: 0px 0px 0px 20px; } + +#sidebar_toc .ui-accordion-header-active { background: #d8d8d8; } + +#sidebar_toc .toc-active { background: #68aa70; } +#sidebar_toc .toc-active a { color: #103010; } + +#sidebar_toc .ui-state-hover { background: #c8d0c8; } +*/ + diff --git a/v/0.5.0-rc.2/tests/jsonball/test_jsonball.html b/v/0.5.0-rc.2/tests/jsonball/test_jsonball.html new file mode 100644 index 000000000..9a47db2a0 --- /dev/null +++ b/v/0.5.0-rc.2/tests/jsonball/test_jsonball.html @@ -0,0 +1,327 @@ + + + + + Test Jsonball + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Test Jsonball

    + +

    from data: j.a is data (should be data)

    + +

    from var: j.a is var (should be var)

    + +

    from file: j.a is file (should be file)

    + +

    from page: j.a is page (should be page)

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/tests/jsonball/test_jsonball_file.json b/v/0.5.0-rc.2/tests/jsonball/test_jsonball_file.json new file mode 100644 index 000000000..e566a2080 --- /dev/null +++ b/v/0.5.0-rc.2/tests/jsonball/test_jsonball_file.json @@ -0,0 +1 @@ +{ "a": "file" } diff --git a/v/0.5.0-rc.2/tests/jsonball/test_jsonball_page.json b/v/0.5.0-rc.2/tests/jsonball/test_jsonball_page.json new file mode 100644 index 000000000..bb08f70bb --- /dev/null +++ b/v/0.5.0-rc.2/tests/jsonball/test_jsonball_page.json @@ -0,0 +1,2 @@ +{% assign x = "page" %} +{ "a": "{{ x }}" } diff --git a/v/0.5.0-rc.2/tests/jsonball/toc.json b/v/0.5.0-rc.2/tests/jsonball/toc.json new file mode 100644 index 000000000..4e129aebb --- /dev/null +++ b/v/0.5.0-rc.2/tests/jsonball/toc.json @@ -0,0 +1,6 @@ +[ +{ "title": "Test Jsonball", + "file": "test_jsonball.html" }, +{ "title": "Home", + "file": "{{ site.url }}/index.html" } +] diff --git a/v/0.5.0-rc.2/toc-menu.json b/v/0.5.0-rc.2/toc-menu.json new file mode 100644 index 000000000..824bbbed9 --- /dev/null +++ b/v/0.5.0-rc.2/toc-menu.json @@ -0,0 +1,20 @@ +[ +{ "title": "Overview", + "file": "{{ site.url }}/index.html" }, +{ "title": "Download", + "file": "{{ site.url }}/start/download.html" }, +{ "title": "Getting Started", + "file": "{{ site.url }}/use/guide/quickstart/index.html" }, +{ "title": "Walkthrough", + "file": "{{ site.url }}/start/walkthrough/index.html" }, +{ "title": "User Guide", + "file": "{{ site.url }}/use/guide/index.html", + "children": {% readj ./use/guide/toc.json %} }, +{ "title": "Examples", + "file": "{{ site.url }}/use/examples/index.html", + "children": {% readj ./use/examples/toc.json %} }, +{ "title": "Contributing", + "file": "{{ site.url }}/dev/code/index.html", + "exclude": true, + "children": {% readj /dev/toc.json %} } +] diff --git a/v/0.5.0-rc.2/toc.json b/v/0.5.0-rc.2/toc.json new file mode 100644 index 000000000..79f9e5ddf --- /dev/null +++ b/v/0.5.0-rc.2/toc.json @@ -0,0 +1,21 @@ +[ +{ "title": "Start", + "file": "{{ site.url }}/start/index.html", + "exclude": true, + "children": {% readj /start/toc.json %} }, +{ "title": "Using brooklyn", + "file": "{{ site.url }}/use/index.html", + "children": {% readj /use/toc.json %} }, +{ "title": "Contributing", + "file": "{{ site.url }}/dev/code/index.html", + "exclude": true, + "children": {% readj /dev/toc.json %} }, +{ "title": "License", + "file": "{{ site.url }}/license/index.html", + "exclude": true, + "children": {% readj /license/toc.json %} }, +{ "title": "Meta", + "file": "{{ site.url }}/meta/versions.html", + "exclude": true, + "children": {% readj /meta/toc.json %} } +] diff --git a/v/0.5.0-rc.2/use/api/index.html b/v/0.5.0-rc.2/use/api/index.html new file mode 100644 index 000000000..dcdf34d64 --- /dev/null +++ b/v/0.5.0-rc.2/use/api/index.html @@ -0,0 +1,828 @@ + + + + + API Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    API Reference

    + +

    Javadoc is not available as part of this build.

    + +

    Please see the source code to view javadoc.

    + + + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/contact.html b/v/0.5.0-rc.2/use/contact.html new file mode 100644 index 000000000..2270200f0 --- /dev/null +++ b/v/0.5.0-rc.2/use/contact.html @@ -0,0 +1,850 @@ + + + + + Contact + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Contact

    + +

    Contact us on the discussion groups:

    + + + + + + + + + +

    Additionally look for us on:

    + + + + +
      +
    • IRC: #brooklyncentral
    • +
    • Twitter: @brooklyncentral #brooklyncentral
    • +
    + + + + +

    We'd love to hear from you!

    + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/examples/before-begin.include.md b/v/0.5.0-rc.2/use/examples/before-begin.include.md new file mode 100644 index 000000000..b1535480d --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/before-begin.include.md @@ -0,0 +1,57 @@ +{% include fields.md %} + +## Before You Begin + +To use the examples, you'll need ``curl``, ``git``, ``java`` (1.6+), and ``maven`` (v3) installed. + +### Installing Brooklyn + +(If you followed the [Getting Started](/use/guide/quickstart/index.html) instructions, you can skip to Installing the Examples.) + +{% if SNAPSHOT %} + +First, grab a copy of the Brooklyn snapshot distribution you wish to use from +[the Sonatype snapshot repo]({{ sonatype_repo_groupid_url }}brooklyn-dist/) +(or build it yourself following instructions [here]({{ site.url }}/dev/build/)), +unpack it to your favourite location (e.g. `$(pwd)`), +and export `BROOKLYN_HOME`: + +{% highlight bash %} +% curl -L -o brooklyn-dist-{{ site.brooklyn-version }}-dist.tar.gz {{ this_dist_tgz_url }} +% tar xvzf brooklyn-dist-{{ site.brooklyn-version }}-dist.tar.gz +% export BROOKLYN_HOME=$(pwd)/brooklyn-{{ site.brooklyn-version }}/ +{% endhighlight %} + +{% else %} + +Grab a copy of the Brooklyn distribution and set up `BROOKLYN_HOME`: + +{% highlight bash %} +% curl -LO {{ this_dist_url_tgz }} +% tar xvzf brooklyn-dist-{{ site.brooklyn-version }}-dist.tar.gz +% export BROOKLYN_HOME=$(pwd)/brooklyn-{{ site.brooklyn-version }}/ +{% endhighlight %} + +{% endif %} + +### Installing the Examples + +Grab a copy of the brooklyn-examples source code and build with Maven: + +{% highlight bash %} +% git clone https://github.com/brooklyncentral/brooklyn-examples.git +% cd brooklyn-examples +{% if brooklyn_examples_branch == 'master' %}{% else %}% git checkout {{ brooklyn_examples_branch }} +{% endif %}% mvn clean install +{% endhighlight %} + +{% if SNAPSHOT %} +Please note, these instructions are for a SNAPSHOT release of Brooklyn, +so proceed with caution. +For the latest stable version, go [here](/meta/versions.html). +{% endif %} + +For more information on ways to download Brooklyn please +see the [download page]({{site.url}}/start/download.html). +For more information on the Brooklyn CLI and launching apps, +please visit [this section of the user guide]({{site.url}}/use/guide/management/index.html#cli). diff --git a/v/0.5.0-rc.2/use/examples/global-web-fabric/console-geoscaling-details-w700.png b/v/0.5.0-rc.2/use/examples/global-web-fabric/console-geoscaling-details-w700.png new file mode 100644 index 000000000..bf7523fe2 Binary files /dev/null and b/v/0.5.0-rc.2/use/examples/global-web-fabric/console-geoscaling-details-w700.png differ diff --git a/v/0.5.0-rc.2/use/examples/global-web-fabric/console-geoscaling-details.png b/v/0.5.0-rc.2/use/examples/global-web-fabric/console-geoscaling-details.png new file mode 100644 index 000000000..25ebba474 Binary files /dev/null and b/v/0.5.0-rc.2/use/examples/global-web-fabric/console-geoscaling-details.png differ diff --git a/v/0.5.0-rc.2/use/examples/global-web-fabric/console-map-w700.png b/v/0.5.0-rc.2/use/examples/global-web-fabric/console-map-w700.png new file mode 100644 index 000000000..3303667ef Binary files /dev/null and b/v/0.5.0-rc.2/use/examples/global-web-fabric/console-map-w700.png differ diff --git a/v/0.5.0-rc.2/use/examples/global-web-fabric/console-map.png b/v/0.5.0-rc.2/use/examples/global-web-fabric/console-map.png new file mode 100644 index 000000000..27f7c0219 Binary files /dev/null and b/v/0.5.0-rc.2/use/examples/global-web-fabric/console-map.png differ diff --git a/v/0.5.0-rc.2/use/examples/global-web-fabric/geopaas-deployed-app-w700.png b/v/0.5.0-rc.2/use/examples/global-web-fabric/geopaas-deployed-app-w700.png new file mode 100644 index 000000000..bc1c6eca2 Binary files /dev/null and b/v/0.5.0-rc.2/use/examples/global-web-fabric/geopaas-deployed-app-w700.png differ diff --git a/v/0.5.0-rc.2/use/examples/global-web-fabric/geopaas-deployed-app.png b/v/0.5.0-rc.2/use/examples/global-web-fabric/geopaas-deployed-app.png new file mode 100644 index 000000000..d55a87f34 Binary files /dev/null and b/v/0.5.0-rc.2/use/examples/global-web-fabric/geopaas-deployed-app.png differ diff --git a/v/0.5.0-rc.2/use/examples/global-web-fabric/index.html b/v/0.5.0-rc.2/use/examples/global-web-fabric/index.html new file mode 100644 index 000000000..e05ac65c5 --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/global-web-fabric/index.html @@ -0,0 +1,1300 @@ + + + + + Global Web Fabric + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Global Web Fabric

    + +

    This example shows how to build a multi-site web application fabric +with DNS configured on the front-end to combine the sites, +routing users to the location closest to them.

    + +

    It can combine with the Simple Web Cluster example +or the Portable Cloud Foundry example, +but does not assume knowledge of either of these.

    + + + + + + + + + + + +

    + + + + +

    Before You Begin

    + + + + +

    To use the examples, you'll need curl, git, java (1.6+), and maven (v3) installed.

    + + + + +

    Installing Brooklyn

    + + + + +

    (If you followed the Getting Started instructions, you can skip to Installing the Examples.)

    + + + + +

    First, grab a copy of the Brooklyn snapshot distribution you wish to use from +the Sonatype snapshot repo +(or build it yourself following instructions here), +unpack it to your favourite location (e.g. $(pwd)), +and export BROOKLYN_HOME:

    + + + + +
    % curl -L -o brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz 
    +% tar xvzf brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz
    +% export BROOKLYN_HOME=$(pwd)/brooklyn-0.6.0-SNAPSHOT/
    +
    + + + + +

    Installing the Examples

    + + + + +

    Grab a copy of the brooklyn-examples source code and build with Maven:

    + + + + +
    % git clone https://github.com/brooklyncentral/brooklyn-examples.git
    +% cd brooklyn-examples
    +% mvn clean install
    +
    + + + + +

    Please note, these instructions are for a SNAPSHOT release of Brooklyn, +so proceed with caution. +For the latest stable version, go here.

    + + + + +

    For more information on ways to download Brooklyn please +see the download page. +For more information on the Brooklyn CLI and launching apps, +please visit this section of the user guide.

    + + +

    Now, go to this particular example's directory:

    + +
    % cd global-web-fabric
    +
    + + +

    The CLI needs to know where to find your compiled examples. You can set this up by exporting +the BROOKLYN_CLASSPATH environment variable in the following way:

    + +
    % export BROOKLYN_CLASSPATH=$(pwd)/target/classes
    +
    + + +

    The project global-web-fabric contains the code used +in this example under src/main/java.

    + +

    Setting Up Geographic DNS

    + +

    This example uses geoscaling.com to provide free geographic-dependent DNS services. +This will forward a domain name of your choice to various IPs depending on a script, +e.g. computing the nearest IP based on latitude and longitude of the requester and the targets. +Brooklyn will automatically generate and update this script, but you do need to +create and configure a Geoscaling account:

    + +
      +
    1. Create the free account here.
    2. +
    3. Click the link in the email you receive.
    4. +
    5. Enter the domain name you wish to use into geoscaling (see below).
    6. +
    + + +

    The simplest domain name to choose is something unique under geopaas.org, e.g. yourname.geopaas.org, +which we have already configured for Geoscaling to manage. +If you are using your own domain name, +set its nameservers as advised by geoscaling (e.g. ns{1,2,3,4}.geoscaling.com).

    + +

    Next we need to supply this information to Brooklyn at runtime. +The simplest way is to create or add the following fields to ~/.brooklyn/brooklyn.properties:

    + +
    brooklyn.geoscaling.username=yourname
    +brooklyn.geoscaling.password=s3cr3t
    +brooklyn.geoscaling.primaryDomain=yourname.geopaas.org
    +
    + + +

    Replace the values of these fields as appropriate, of course! +You can, if you prefer, supply (or override) these values in your Brooklyn application.

    + +

    Setting Up the Locations Database

    + +

    In order to generate the "closest-IP" script, +Brooklyn needs a way to find out the latitude and longitude of the +servers you are using. +The simplest way to do this is do download the free GeoCityLite binary flatfile +from MaxMind, +unpack it, and copy it to ~/.brooklyn/MaxMind-GeoLiteCity.dat.

    + +

    This will be picked up automatically if it is installed. +You can instead specify to use an online lookup service, such as +utrace.de by specifying +-Dbrooklyn.location.geo.HostGeoLookup=brooklyn.location.geo.UtraceHostGeoLookup; +but note this has a cap of 100 per day.

    + +

    This information is also used to display locations on the map +in the Brooklyn dashboard. +Note however that these free services are not 100% accurate; +they are handy for dev/test but in a production system +you may wish to specify the geographical information manually in your application, +or purchase a commercial locations-database subscription.

    + +

    The Code

    + +

    Now let's start writing our application. +The heavy lifting will be done by off-the-shelf Brooklyn classes:

    + +
      +
    • DynamicFabric will create the entity specified by factory in each location it is given
    • +
    • GeoscalingDnsService monitors children of a specified entity (the DynamicFabric) +and adds them as DNS targets for the region they are in
    • +
    + + +

    First, however, let's create the Java class -- call it GlobalWebFabricExample. +This will extend the Brooklyn AbstractApplication:

    + +
    package brooklyn.demo;
    +
    +import static com.google.common.base.Preconditions.checkNotNull;
    +import brooklyn.entity.basic.AbstractApplication;
    +
    +public class GlobalWebFabricExample extends AbstractApplication {
    +    @Override
    +    public void init() {
    +         // TODO create our app!
    +    }
    +}
    +
    + + +

    The Fabric

    + +

    The DynamicFabric by default has no knowledge of what it will build, +other than the factory it is given to create an entity in each region. +We'll use the class ElasticJavaWebAppService.Factory which creates +an elastic Java Web App service, +such as the ControlledDynamicWebAppCluster used in the +Simple Web Cluster example, if deploying to VMs, +or perhaps a CloudFoundryJavaWebAppCluster if deploying to a Cloud Foundry location +(see below).

    + +
            DynamicFabric webFabric = addChild(EntitySpecs.spec(DynamicFabric.class)
    +                .displayName("Web Fabric")
    +                .configure(DynamicFabric.FACTORY, new ElasticJavaWebAppService.Factory())
    +                .configure(ElasticJavaWebAppService.ROOT_WAR, WAR_PATH));
    +
    + + +

    Here we have specified the WAR to use with setConfig. +The war: convenience flag used in the previous example is only available on web-aware entities; +configuration specified with a named key can be done on any entity, +and is inherited at runtime, so this provides a useful way to specify the WAR to use +even though the web-aware entities are only constructed at runtime.

    + +

    Stitching the Fabric together with DNS

    + +

    To stitch these together seamlessly, another entity will run a policy +which collects the public-facing IP address of each cluster created by the fabric, +as it comes online, by watching for SERVICE_UP sensors. +First, however, let's make sure any load-balancer proxies (e.g. nginx) in these clusters +are listening on port 80:

    + +
            DynamicFabric webFabric = addChild(EntitySpecs.spec(DynamicFabric.class)
    +                .displayName("Web Fabric")
    +                .configure(DynamicFabric.FACTORY, new ElasticJavaWebAppService.Factory())
    +                .configure(ElasticJavaWebAppService.ROOT_WAR, WAR_PATH)
    +                .configure(AbstractController.PROXY_HTTP_PORT, PortRanges.fromInteger(80)));
    +
    + + +

    Let's now define the Geoscaling entity which does the stitching. +We need to supply the username, password, and primaryDomainName for Geoscaling; +we'll take this from the brooklyn.properties file mentioned above. +We'll also specify a smartSubdomainName, to use Geoscaling's facility for +lightweight sub-domains to prevent DNS caching and multiple instances of our application +from confusing us -- e.g. brooklyn-1234.yourname.geopaas.org.

    + +
            StringConfigMap config = getManagementContext().getConfig();
    +        
    +        GeoscalingDnsService geoDns = addChild(EntitySpecs.spec(GeoscalingDnsService.class)
    +                .displayName("GeoScaling DNS")
    +                .configure("username", checkNotNull(config.getFirst("brooklyn.geoscaling.username"), "username"))
    +                .configure("password", checkNotNull(config.getFirst("brooklyn.geoscaling.password"), "password"))
    +                .configure("primaryDomainName", checkNotNull(config.getFirst("brooklyn.geoscaling.primaryDomain"), "primaryDomain")) 
    +                .configure("smartSubdomainName", "brooklyn"));
    +
    + + +

    Lastly we need to tell this instance what entity it should monitor +for children to include as targets:

    + +
            geoDns.setTargetEntityProvider(webFabric);
    +
    + + +

    Cloud Foundry and other PaaS Targets

    + +

    At this point our core application is ready, and can be deployed to AWS or another VM cloud. +This may take between 15 and 30 minutes to run, +mainly spent downloading software +(unless of course you specify a pre-configured imageId which contains the software).

    + +

    A quicker alternative is to deploy to a Java Web App platform-as-a-service +such as Cloud Foundry. A major advantage here is that they can provision very quickly, +in a matter of seconds.

    + +

    However most of these services use a shared load-balancer, meaning that the +hostname requested in the URL has to match what is set up at the PaaS. +The hostname for geo-balancing is chosen at runtime by Geoscaling +when we are using a smartSubdomainName, and we need to configure this in +any target PaaS we are using. +At present the ability to configure URL's is disabled in cloudfoundry.com accounts. +It has been tested and confirmed to work in AppFog's hosted Cloud Foundry.

    + +

    We will use the DependentConfiguration.attributeWhenReady convenience to +listen for the HOSTNAME sensor on geoDns and set the relevant Cloud Foundry +config parameter on the webFabric. +Other PaaS targets may expose a similar config key. +Add the following configuration line in the construction of the webFabric (which must +come after construction of the geoDns).

    + +
                    .configure(CloudFoundryJavaWebAppCluster.HOSTNAME_TO_USE_FOR_URL,
    +                        DependentConfiguration.attributeWhenReady(geoDns, Attributes.HOSTNAME)));
    +
    + + +

    This config key will only apply to Cloud Foundry targets, +so it is safe to include in your class whether or not you are deploying there.

    + +

    Imports

    + +

    Your imports should look as follows:

    + +
    import static com.google.common.base.Preconditions.checkNotNull;
    +
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import brooklyn.config.StringConfigMap;
    +import brooklyn.entity.basic.AbstractApplication;
    +import brooklyn.entity.basic.Attributes;
    +import brooklyn.entity.dns.geoscaling.GeoscalingDnsService;
    +import brooklyn.entity.group.DynamicFabric;
    +import brooklyn.entity.proxy.AbstractController;
    +import brooklyn.entity.proxying.BasicEntitySpec;
    +import brooklyn.entity.webapp.ElasticJavaWebAppService;
    +import brooklyn.event.basic.DependentConfiguration;
    +import brooklyn.extras.cloudfoundry.CloudFoundryJavaWebAppCluster;
    +import brooklyn.location.basic.PortRanges;
    +
    + + +

    Use of main method (optional)

    + +

    In this example, we will use the brooklyn CLI launcher. However, it is possible to write your own main method.

    + +

    The following static constants are assumed (most of these as in the Simple Web Cluster example and others):

    + +
      +
    • WAR_PATH, pointing to the webapp to deploy (a default supplied as part of the Brooklyn examples is used here)
    • +
    • DEFAULT_LOCATIONS, containing a string spec of the locations to deploy to if none are supplied on the command-line; +for this example localhost will frequently not work unless Geoscaling can see it +(i.e. it has a public IP and appropriate firewall settings)
    • +
    + + +

    The code (which can safely be omitted) is as follows:

    + +
        public static final Logger log = LoggerFactory.getLogger(GlobalWebFabricExample.class);
    +    
    +    // points to the webapp to deploy (a default supplied as part of the Brooklyn examples is used here)
    +    public static final String WAR_PATH = "classpath://hello-world-webapp.war";
    +    
    +    // locations to deploy to if none are supplied on the command-line; for this example `localhost` will 
    +    // frequently not work unless Geoscaling can see it (i.e. it has a public IP and appropriate firewall settings)
    +    static final List<String> DEFAULT_LOCATIONS = [
    +            "aws-ec2:eu-west-1",
    +            "aws-ec2:ap-southeast-1",
    +            "aws-ec2:us-west-1", 
    +        ];
    +        
    +    public static void main(String[] argv) {
    +        List<String> args = Lists.newArrayList(argv);
    +        String port =  CommandLineUtil.getCommandLineOption(args, "--port", "8081+");
    +        String locations = CommandLineUtil.getCommandLineOption(args, "--locations", Joiner.on(",").join(DEFAULT_LOCATIONS));
    +
    +        BrooklynServerDetails server = BrooklynLauncher.newLauncher()
    +                .webconsolePort(port)
    +                .launch();
    +
    +        List<Location> locs = new LocationRegistry().getLocationsById(Arrays.asList(locations));
    +
    +        StartableApplication app = new GlobalWebFabricExample()
    +                .appDisplayName("Brooklyn Global Web Fabric Example")
    +                .manage(server.getManagementContext());
    +        
    +        app.start(locs);
    +        
    +        Entities.dumpInfo(app);
    +    }
    +
    + + +

    Running the Example

    + +

    Now let's run this example. You will need to specify increased heap size and memory limits, +as well as the appropriate classpath.

    + +
    export BROOKLYN_CLASSPATH=/path/to/your/project/target/classes
    +${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.GlobalWebFabricExample \
    +    --location jclouds:aws-ec2:eu-west-1,jclouds:aws-ec2:ap-southeast-1,jclouds:aws-ec2:us-west-1 
    +
    + + +

    The management web console will start, +followed by the web-app services in the locations specified +creating the VM's as needed. +Let's look at the management web console, on port 8081 (default credentials are admin/password):

    + +

    Web Console Map

    + +

    This shows the targets in Seattle (AppFog's Cloud Foundry), Ireland (AWS eu-west-1), +and Singapore (AWS ap-southeast-1), +as well as a few other places (wrong locations picked up for some AWS IP's!). +This also shows the progress of the most recent tasks.

    + +

    Navigating to the "applications" tab, we can view sensors, invoke effectors, control policies, +and track activity, +for instance if a cluster is slow to start and you want to find out what is going on +(you'll find additional information in the brooklyn.log file). +Let's drill down on the Geoscaling DNS entity's sensors:

    + +

    Web Console Geoscaling Details

    + +

    Here we see it has chosen brooklyn-csgFCzTM.geopaas.org as the geo-load-balanced domain name. +(Yours will be under yourname.geopaas.org, unless you chose a different domain earlier.) +We can also see the hosts it is forwarding to, one for each cluster, corresponding to the +children of the Web Fabric (propagated from the nginx hostnames, in the case of the ControlledDynamicWebAppCluster instances).

    + +

    Checking the Web App

    + +

    Once Geoscaling reports at least one target, you should be able to access it on the geo-load-balanced domain name:

    + +

    Our Deployed Application

    + +

    Under the covers you are being routed to one of the clusters that has been deployed -- +whichever one is closest to you. +(Due to DNS caching, at your machine or your ISP, clusters which come online after your first lookup +will not be picked up until TTL expires, typically 10m, although often more if DNS services don't respect TTL.)

    + +

    Checking DNS Information

    + +

    Let's find out exactly where we were routed:

    + +
    % dig brooklyn-csgFCzTm.geopaas.org
    +
    +; <<>> DiG 9.4.3-P3 <<>> brooklyn-csgFCzTm.geopaas.org
    +
    +;; QUESTION SECTION:
    +;brooklyn-csgFCzTm.geopaas.org. IN      A
    +
    +;; ANSWER SECTION:
    +brooklyn-csgFCzTm.geopaas.org. 120 IN   CNAME   ec2-46-137-138-4.eu-west-1.compute.amazonaws.com.
    +ec2-46-137-138-4.eu-west-1.compute.amazonaws.com. 215 IN A 46.137.138.4
    +
    + + +

    This was run from Scotland so it seems a sensible choice. +(Some portions of the output from dig have been removed for readability.)

    + +

    We can get more information by looking at the TXT records:

    + +
    % dig +trace @ns1.geoscaling.com TXT brooklyn-csgFCzTm.geopaas.org
    +
    +; <<>> DiG 9.4.3-P3 <<>> +trace @ns1.geoscaling.com TXT brooklyn-csgFCzTm.geopaas.org
    +
    +...
    +
    +geopaas.org.            86400   IN      NS      ns1.geoscaling.com.
    +geopaas.org.            86400   IN      NS      ns2.geoscaling.com.
    +geopaas.org.            86400   IN      NS      ns3.geoscaling.com.
    +geopaas.org.            86400   IN      NS      ns4.geoscaling.com.
    +;; Received 133 bytes from 199.249.112.1#53(a2.org.afilias-nst.info) in 45 ms
    +
    +brooklyn-csgFCzTm.geopaas.org. 300 IN   TXT     "Request from [54,-2]-(GB) directed to Ireland (IE)"
    +brooklyn-csgFCzTm.geopaas.org. 300 IN   TXT     "GeoScaling config auto-updated by Brooklyn 2012-04-26 12:27:25 UTC"
    +;; Received 189 bytes from 80.87.128.195#53(ns3.geoscaling.com) in 60 ms
    +
    + + +

    Next Steps

    + +

    This example has shown how to create a multi-region fabric, using the abstractions from +jclouds under the covers to make it easy to access different hosting providers +simultaneously, and using higher-level abstractions in Brooklyn to mix PaaS systems with +bare-VM (or even bare-metal, if you specify fixed IPs).

    + +

    This is meant as just the beginning however.
    +Here are some questions to think about and code challenges to give you a steer for what to explore next.

    + +
      +
    1. The routines used at Geoscaling optimize for latency between the user and the location of the web-cluster. +What other strategies might be used? Cost? Compliance? How would you code these?

    2. +
    3. This example ignores data, but you clearly can't do that in the real world. +When big-data is involved, does this introduce other considerations for optimizing geo-location?

    4. +
    5. Add a data tier to this system, such as MySQL or Mongo, or even Hadoop. +You might start with a single instance or cluster, +but the real fun starts with a fabric, and defining the synchronization/replication strategies +between the different clusters. +This isn't for the faint-hearted, but whatever you create will certainly be of interest +to people in the Brooklyn community. +Please let us know what you've built!

    6. +
    + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/examples/index.html b/v/0.5.0-rc.2/use/examples/index.html new file mode 100644 index 000000000..a23c68916 --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/index.html @@ -0,0 +1,835 @@ + + + + + Examples + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Examples

    + +

    We currently have the following examples on the site:

    + + + + +

    There are examples in the code also, just check out the examples/ project.

    + +

    Have one of your own? Add it here!

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/examples/messaging/index.html b/v/0.5.0-rc.2/use/examples/messaging/index.html new file mode 100644 index 000000000..3c131977b --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/messaging/index.html @@ -0,0 +1,1083 @@ + + + + + Publish-Subscribe Messagiung + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Publish-Subscribe Messagiung

    + +

    This example shows how a simple messaging application can be build +in brooklyn, starting with configuring and launching a broker. For +these examples we will use the Apache Qpid +Java AMQP message broker and clients using the +JMS API.

    + + + + + + + + + + + +

    + + + + +

    Before You Begin

    + + + + +

    To use the examples, you'll need curl, git, java (1.6+), and maven (v3) installed.

    + + + + +

    Installing Brooklyn

    + + + + +

    (If you followed the Getting Started instructions, you can skip to Installing the Examples.)

    + + + + +

    First, grab a copy of the Brooklyn snapshot distribution you wish to use from +the Sonatype snapshot repo +(or build it yourself following instructions here), +unpack it to your favourite location (e.g. $(pwd)), +and export BROOKLYN_HOME:

    + + + + +
    % curl -L -o brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz 
    +% tar xvzf brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz
    +% export BROOKLYN_HOME=$(pwd)/brooklyn-0.6.0-SNAPSHOT/
    +
    + + + + +

    Installing the Examples

    + + + + +

    Grab a copy of the brooklyn-examples source code and build with Maven:

    + + + + +
    % git clone https://github.com/brooklyncentral/brooklyn-examples.git
    +% cd brooklyn-examples
    +% mvn clean install
    +
    + + + + +

    Please note, these instructions are for a SNAPSHOT release of Brooklyn, +so proceed with caution. +For the latest stable version, go here.

    + + + + +

    For more information on ways to download Brooklyn please +see the download page. +For more information on the Brooklyn CLI and launching apps, +please visit this section of the user guide.

    + + +

    Now, go to this particular example's directory:

    + +
    % cd simple-messaging-pubsub
    +
    + + +

    The CLI needs to know where to find your compiled examples. You can set this up by exporting +the BROOKLYN_CLASSPATH environment variable in the following way:

    + +
    % export BROOKLYN_CLASSPATH=$(pwd)/target/classes
    +
    + + +

    The project simple-messaging-pubsub includes a deployment +descriptor for our example messaging application and simple Publish +and Subscribe JMS test client scripts.

    + +

    Single Broker

    + +

    The first example will include a Qpid broker, which we will customize +to use the Oracle BDB +message store as an example of a typical production setup. We will +also create a queue for use by a pair of test clients.

    + +

    The QpidBroker entity is created like this, which uses the +default configuration, specifying only the AMQP port and creates +no queues or topics:

    + +
    public class StandaloneBrokerExample extends AbstractApplication {
    +    @Override
    +    public void init() {
    +        // Configure the Qpid broker entity
    +        QpidBroker broker = addChild(EntitySpecs.spec(QpidBroker.class)
    +                .configure("amqpPort", 5672));
    +    }
    +}
    +
    + + +

    To install the custom configuration files and extra libraries for +BDB, we specify some files to copy to the broker installation, using +the runtimeFiles property. These files should be available in +the classpath of the application when it is running, usually by +copying them to the src/main/resources directory. For example, +here we copy a custom XML configuration file and a new password +file:

    + +
            final String CUSTOM_CONFIG_PATH = "classpath://custom-config.xml";
    +        final String PASSWD_PATH = "classpath://passwd";
    +
    +        QpidBroker broker = addChild(EntitySpecs.spec(QpidBroker.class)
    +                .configure("amqpPort", 5672)
    +                .configure("amqpVersion", AmqpServer.AMQP_0_10)
    +                .configure("runtimeFiles", ImmutableMap.builder()
    +                        .put(QpidBroker.CONFIG_XML, CUSTOM_CONFIG_PATH)
    +                        .put(QpidBroker.PASSWD, PASSWD_PATH)
    +                        .build()));
    +
    + + +

    Finally, we come to the complete configuration of our QpidBroker +entity using the BDB store. The additional properties here specify +the AMQP version and that a queue named testQueue should be created +on startup.

    + +
            final String CUSTOM_CONFIG_PATH = "classpath://custom-config.xml";
    +        final String PASSWD_PATH = "classpath://passwd";
    +        final String QPID_BDBSTORE_JAR_PATH = "classpath://qpid-bdbstore-0.14.jar";
    +        final String BDBSTORE_JAR_PATH = "classpath://je-5.0.34.jar";
    +
    +        QpidBroker broker = addChild(EntitySpecs.spec(QpidBroker.class)
    +                .configure("amqpPort", 5672)
    +                .configure("amqpVersion", AmqpServer.AMQP_0_10)
    +                .configure("runtimeFiles", ImmutableMap.builder()
    +                        .put(QpidBroker.CONFIG_XML, CUSTOM_CONFIG_PATH)
    +                        .put(QpidBroker.PASSWD, PASSWD_PATH)
    +                        .put("lib/opt/qpid-bdbstore-0.14.jar", QPID_BDBSTORE_JAR_PATH)
    +                        .put("lib/opt/je-5.0.34.jar", BDBSTORE_JAR_PATH)
    +                        .build())
    +                .configure("queue", "testQueue"));
    +
    + + +

    Running the Example

    + +

    You can build and run the example (on *nix or Mac) after checking +out the Brooklyn repository +as follows:

    + +
    % ${BROOKLYN_HOME}/bin/brooklyn -v launch --app brooklyn.demo.StandaloneBrokerExample --location localhost
    +
    + + +

    Now, visit the Brooklyn web console on port 8081 using credentials +admin/password. This allows you to view the Brooklyn entities and +their current state for debugging.

    + +

    Note that the installation may take some time, because the default +deployment downloads the software from the official repos. You can +monitor start-up activity for each entity in the Activity pane +in the management console, and see more detail by tailing the log +file (tail -f brooklyn.log).

    + +

    After starting up, the demo script should display a summary of all +the Brooklyn managed entities and their attributes. This will show +both the Qpid broker and its child entity, the queue testQueue +which was created at startup. The queue entity has sensors that +monitor the depth of unread messages, which you can check while +running the test client scripts later.

    + +

    If the -v flag is passed to the startup command, all configured +entity and sensor details will be output. This includes the broker URL, +which is used to configure JMS clients to connect to this broker. +This URL can also be viewed as a sensor attribute in the web console, +named broker.url.

    + +

    This sensor is common to all messaging brokers that Brooklyn +provides, and is usually accessed by applications to allow them to +provide it as a parameter to other entities, as shown in the code +fragment below.

    + +
    String url = broker.getAttribute(MessageBroker.BROKER_URL)
    +
    + + +

    Using the URL the demo script printed, you can run the test Subscribe +and then Publish classes, to send messages using the broker. Simply +run the commands in another window, with the provided URL as the +only argument. Note that the URLs may be different to those printed +below, and that any unquoted & characters must be escaped, +if present.

    + +
    % URL="amqp://guest:guest@/localhost?brokerlist='tcp://localhost:5672'"
    +% java -cp "./resources/lib/*:./target/classes" brooklyn.demo.Subscribe ${URL}
    +% java -cp "./resources/lib/*:./target/classes" brooklyn.demo.Publish ${URL}
    +
    + + +

    In the Publish window you should see a log message every time a +message is sent, like this:

    + +
    2012-05-02 14:04:38,521 INFO  Sent message 65
    +2012-05-02 14:04:39,522 INFO  Sent message 66
    +
    + + +

    Similarly, the Subscribe windows should log on reciept of these +messages, as follows:

    + +
    2012-05-02 14:04:32,522 INFO  got message 41 test message 41
    +2012-05-02 14:04:33,523 INFO  got message 42 test message 42
    +
    + + +

    Cloud Deployment

    + +

    With appropriate setup (as described +here) +this can also be deployed to your favourite cloud, let's pretend +it's Amazon Ireland, as follows:

    + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.StandaloneBrokerExample --location aws-ec2:eu-west-1
    +
    + + +

    If you encounter any difficulties, please +tell us and we'll do our best +to help.

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/examples/simple-web-cluster.html b/v/0.5.0-rc.2/use/examples/simple-web-cluster.html new file mode 100644 index 000000000..14dd82667 --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/simple-web-cluster.html @@ -0,0 +1,1096 @@ + + + + + Elastic Web Cluster + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Elastic Web Cluster

    + + + + + + + + + + + + + + + + +

    + + + + +

    Before You Begin

    + + + + +

    To use the examples, you'll need curl, git, java (1.6+), and maven (v3) installed.

    + + + + +

    Installing Brooklyn

    + + + + +

    (If you followed the Getting Started instructions, you can skip to Installing the Examples.)

    + + + + +

    First, grab a copy of the Brooklyn snapshot distribution you wish to use from +the Sonatype snapshot repo +(or build it yourself following instructions here), +unpack it to your favourite location (e.g. $(pwd)), +and export BROOKLYN_HOME:

    + + + + +
    % curl -L -o brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz 
    +% tar xvzf brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz
    +% export BROOKLYN_HOME=$(pwd)/brooklyn-0.6.0-SNAPSHOT/
    +
    + + + + +

    Installing the Examples

    + + + + +

    Grab a copy of the brooklyn-examples source code and build with Maven:

    + + + + +
    % git clone https://github.com/brooklyncentral/brooklyn-examples.git
    +% cd brooklyn-examples
    +% mvn clean install
    +
    + + + + +

    Please note, these instructions are for a SNAPSHOT release of Brooklyn, +so proceed with caution. +For the latest stable version, go here.

    + + + + +

    For more information on ways to download Brooklyn please +see the download page. +For more information on the Brooklyn CLI and launching apps, +please visit this section of the user guide.

    + + + + +

    Simple Web Server

    + + + + +

    Go to this particular example's directory:

    + + + + +
    % cd simple-web-cluster
    +
    + + + + +

    The CLI needs to know where to find your compiled examples. You can set this up by exporting +the BROOKLYN_CLASSPATH environment variable in the following way:

    + + + + +
    % export BROOKLYN_CLASSPATH=$(pwd)/target/classes
    +
    + + + + +

    The project simple-web-cluster includes several deployment descriptors +for rolling out a web application, under src/main/java.

    + + + + +

    The simplest of these, SingleWebServerExample, starts JBoss on a single machine with a "Hello World" war deployed, +with a single line:

    + + + + +
    public class SingleWebServerExample extends AbstractApplication {
    +    private static final String WAR_PATH = "classpath://hello-world-webapp.war";
    +
    +    @Override
    +    public void init() {
    +        addChild(EntitySpecs.spec(JBoss7Server.class)
    +                .configure("war", WAR_PATH)
    +                .configure("httpPort", 8080));
    +    }
    +}
    +
    + + + + +

    You can run this as follows (on *nix or Mac, assuming ssh localhost requires no password or passphrase):

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample \
    +  --location localhost
    +
    + + + + +

    Then visit the webapp on port 8080, or the Brooklyn console on 8081. (Default credentials are admin/password.) +Note that the installation may take some time, because the default deployment downloads the software from +the official repos. You can monitor start-up activity for each entity in the Activity pane in the management console, +and see more detail by tailing the log file (tail -f brooklyn.log).

    + + + + +

    With appropriate setup (as described here) +this can also be deployed to your favourite cloud, let's pretend it's Amazon Ireland, as follows:

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample \
    +  --location aws-ec2:eu-west-1
    +
    + + + + +

    Elastic Three-Tier

    + + + + +

    Ready for something more interesting? Try this:

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.WebClusterDatabaseExample \
    +  --location localhost
    +
    + + + + +

    This launches the class WebClusterDatabaseExample (also described in the walkthrough) +which launches a pool of web-servers -- of size 1 initially, +but manually configurable (if you stop the policy first, in the GUI, then use the resize effector) -- +with an Nginx load-balancer set up in front of them, and backed by a MySQL database.

    + + + + +

    The essential code fragment looks like this:

    + + + + +
    public class WebClusterDatabaseExample extends AbstractApplication {
    +    public static final String WAR_PATH = "classpath://hello-world-sql-webapp.war";
    +    
    +    public static final String DB_SETUP_SQL_URL = "classpath://visitors-creation-script.sql";
    +    
    +    public static final String DB_TABLE = "visitors";
    +    public static final String DB_USERNAME = "brooklyn";
    +    public static final String DB_PASSWORD = "br00k11n";
    +
    +    @Override
    +    public void init() {
    +        MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class)
    +                .configure("creationScriptUrl", DB_SETUP_SQL_URL));
    +        
    +        ControlledDynamicWebAppCluster web = addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class)
    +                .configure("memberSpec", EntitySpecs.spec(JBoss7Server.class)
    +                        .configure("httpPort", "8080+")
    +                        .configure("war", WAR_PATH)
    +                        .configure(javaSysProp("brooklyn.example.db.url"), 
    +                                formatString("jdbc:%s%s?user=%s\\&password=%s", 
    +                                        attributeWhenReady(mysql, MySqlNode.MYSQL_URL), DB_TABLE, DB_USERNAME, DB_PASSWORD))));
    +        
    +        web.getCluster().addPolicy(AutoScalerPolicy.builder().
    +                        metric(DynamicWebAppCluster.AVERAGE_REQUESTS_PER_SECOND).
    +                        sizeRange(1, 5).
    +                        metricRange(10, 100).
    +                        build());
    +    }
    +}
    +
    + + + + +

    You can, of course, try this with your favourite cloud, +tweak the database start script, or drop in your favourite WAR.

    + + + + +

    A Few Other Things

    + + + + +

    The project includes variants of the examples shown here, +including alternative syntax (the *Alt* files), +and a web-only cluster (no database) in `WebClusterExample``.

    + + + + +

    The webapp that is used is included under examples/hello-world-webapp.

    + + + + +

    You may wish to check out the Global Web Fabric example next.

    + + + + +

    If you encounter any difficulties, please tell us and we'll do our best to help.

    + + + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/examples/toc.json b/v/0.5.0-rc.2/use/examples/toc.json new file mode 100644 index 000000000..92f3208f4 --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/toc.json @@ -0,0 +1,10 @@ +[ +{ "title": "Elastic Web Cluster", + "file": "{{ site.url }}/use/examples/webcluster/index.html" }, +{ "title": "Global Web Fabric", + "file": "{{ site.url }}/use/examples/global-web-fabric/index.html" }, +{ "title": "Whirr Hadoop Cluster", + "file": "{{ site.url }}/use/examples/whirrhadoop/index.html" }, +{ "title": "Publish-Subscribe Messaging", + "file": "{{ site.url }}/use/examples/messaging/index.html" } +] diff --git a/v/0.5.0-rc.2/use/examples/webcluster.html b/v/0.5.0-rc.2/use/examples/webcluster.html new file mode 100644 index 000000000..9f03188c9 --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/webcluster.html @@ -0,0 +1,1096 @@ + + + + + Elastic Web Cluster + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Elastic Web Cluster

    + + + + + + + + + + + + + + + + +

    + + + + +

    Before You Begin

    + + + + +

    To use the examples, you'll need curl, git, java (1.6+), and maven (v3) installed.

    + + + + +

    Installing Brooklyn

    + + + + +

    (If you followed the Getting Started instructions, you can skip to Installing the Examples.)

    + + + + +

    First, grab a copy of the Brooklyn snapshot distribution you wish to use from +the Sonatype snapshot repo +(or build it yourself following instructions here), +unpack it to your favourite location (e.g. $(pwd)), +and export BROOKLYN_HOME:

    + + + + +
    % curl -L -o brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz 
    +% tar xvzf brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz
    +% export BROOKLYN_HOME=$(pwd)/brooklyn-0.6.0-SNAPSHOT/
    +
    + + + + +

    Installing the Examples

    + + + + +

    Grab a copy of the brooklyn-examples source code and build with Maven:

    + + + + +
    % git clone https://github.com/brooklyncentral/brooklyn-examples.git
    +% cd brooklyn-examples
    +% mvn clean install
    +
    + + + + +

    Please note, these instructions are for a SNAPSHOT release of Brooklyn, +so proceed with caution. +For the latest stable version, go here.

    + + + + +

    For more information on ways to download Brooklyn please +see the download page. +For more information on the Brooklyn CLI and launching apps, +please visit this section of the user guide.

    + + + + +

    Simple Web Server

    + + + + +

    Go to this particular example's directory:

    + + + + +
    % cd simple-web-cluster
    +
    + + + + +

    The CLI needs to know where to find your compiled examples. You can set this up by exporting +the BROOKLYN_CLASSPATH environment variable in the following way:

    + + + + +
    % export BROOKLYN_CLASSPATH=$(pwd)/target/classes
    +
    + + + + +

    The project simple-web-cluster includes several deployment descriptors +for rolling out a web application, under src/main/java.

    + + + + +

    The simplest of these, SingleWebServerExample, starts JBoss on a single machine with a "Hello World" war deployed, +with a single line:

    + + + + +
    public class SingleWebServerExample extends AbstractApplication {
    +    private static final String WAR_PATH = "classpath://hello-world-webapp.war";
    +
    +    @Override
    +    public void init() {
    +        addChild(EntitySpecs.spec(JBoss7Server.class)
    +                .configure("war", WAR_PATH)
    +                .configure("httpPort", 8080));
    +    }
    +}
    +
    + + + + +

    You can run this as follows (on *nix or Mac, assuming ssh localhost requires no password or passphrase):

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample \
    +  --location localhost
    +
    + + + + +

    Then visit the webapp on port 8080, or the Brooklyn console on 8081. (Default credentials are admin/password.) +Note that the installation may take some time, because the default deployment downloads the software from +the official repos. You can monitor start-up activity for each entity in the Activity pane in the management console, +and see more detail by tailing the log file (tail -f brooklyn.log).

    + + + + +

    With appropriate setup (as described here) +this can also be deployed to your favourite cloud, let's pretend it's Amazon Ireland, as follows:

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample \
    +  --location aws-ec2:eu-west-1
    +
    + + + + +

    Elastic Three-Tier

    + + + + +

    Ready for something more interesting? Try this:

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.WebClusterDatabaseExample \
    +  --location localhost
    +
    + + + + +

    This launches the class WebClusterDatabaseExample (also described in the walkthrough) +which launches a pool of web-servers -- of size 1 initially, +but manually configurable (if you stop the policy first, in the GUI, then use the resize effector) -- +with an Nginx load-balancer set up in front of them, and backed by a MySQL database.

    + + + + +

    The essential code fragment looks like this:

    + + + + +
    public class WebClusterDatabaseExample extends AbstractApplication {
    +    public static final String WAR_PATH = "classpath://hello-world-sql-webapp.war";
    +    
    +    public static final String DB_SETUP_SQL_URL = "classpath://visitors-creation-script.sql";
    +    
    +    public static final String DB_TABLE = "visitors";
    +    public static final String DB_USERNAME = "brooklyn";
    +    public static final String DB_PASSWORD = "br00k11n";
    +
    +    @Override
    +    public void init() {
    +        MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class)
    +                .configure("creationScriptUrl", DB_SETUP_SQL_URL));
    +        
    +        ControlledDynamicWebAppCluster web = addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class)
    +                .configure("memberSpec", EntitySpecs.spec(JBoss7Server.class)
    +                        .configure("httpPort", "8080+")
    +                        .configure("war", WAR_PATH)
    +                        .configure(javaSysProp("brooklyn.example.db.url"), 
    +                                formatString("jdbc:%s%s?user=%s\\&password=%s", 
    +                                        attributeWhenReady(mysql, MySqlNode.MYSQL_URL), DB_TABLE, DB_USERNAME, DB_PASSWORD))));
    +        
    +        web.getCluster().addPolicy(AutoScalerPolicy.builder().
    +                        metric(DynamicWebAppCluster.AVERAGE_REQUESTS_PER_SECOND).
    +                        sizeRange(1, 5).
    +                        metricRange(10, 100).
    +                        build());
    +    }
    +}
    +
    + + + + +

    You can, of course, try this with your favourite cloud, +tweak the database start script, or drop in your favourite WAR.

    + + + + +

    A Few Other Things

    + + + + +

    The project includes variants of the examples shown here, +including alternative syntax (the *Alt* files), +and a web-only cluster (no database) in `WebClusterExample``.

    + + + + +

    The webapp that is used is included under examples/hello-world-webapp.

    + + + + +

    You may wish to check out the Global Web Fabric example next.

    + + + + +

    If you encounter any difficulties, please tell us and we'll do our best to help.

    + + + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/examples/webcluster/index.html b/v/0.5.0-rc.2/use/examples/webcluster/index.html new file mode 100644 index 000000000..8efda655c --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/webcluster/index.html @@ -0,0 +1,1097 @@ + + + + + Elastic Web Cluster + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Elastic Web Cluster

    + + + + + + + + + + + + + +

    + + + + +

    Before You Begin

    + + + + +

    To use the examples, you'll need curl, git, java (1.6+), and maven (v3) installed.

    + + + + +

    Installing Brooklyn

    + + + + +

    (If you followed the Getting Started instructions, you can skip to Installing the Examples.)

    + + + + +

    First, grab a copy of the Brooklyn snapshot distribution you wish to use from +the Sonatype snapshot repo +(or build it yourself following instructions here), +unpack it to your favourite location (e.g. $(pwd)), +and export BROOKLYN_HOME:

    + + + + +
    % curl -L -o brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz 
    +% tar xvzf brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz
    +% export BROOKLYN_HOME=$(pwd)/brooklyn-0.6.0-SNAPSHOT/
    +
    + + + + +

    Installing the Examples

    + + + + +

    Grab a copy of the brooklyn-examples source code and build with Maven:

    + + + + +
    % git clone https://github.com/brooklyncentral/brooklyn-examples.git
    +% cd brooklyn-examples
    +% mvn clean install
    +
    + + + + +

    Please note, these instructions are for a SNAPSHOT release of Brooklyn, +so proceed with caution. +For the latest stable version, go here.

    + + + + +

    For more information on ways to download Brooklyn please +see the download page. +For more information on the Brooklyn CLI and launching apps, +please visit this section of the user guide.

    + + + + +

    Simple Web Server

    + + + + +

    Go to this particular example's directory:

    + + + + +
    % cd simple-web-cluster
    +
    + + + + +

    The CLI needs to know where to find your compiled examples. You can set this up by exporting +the BROOKLYN_CLASSPATH environment variable in the following way:

    + + + + +
    % export BROOKLYN_CLASSPATH=$(pwd)/target/classes
    +
    + + + + +

    The project simple-web-cluster includes several deployment descriptors +for rolling out a web application, under src/main/java.

    + + + + +

    The simplest of these, SingleWebServerExample, starts JBoss on a single machine with a "Hello World" war deployed, +with a single line:

    + + + + +
    public class SingleWebServerExample extends AbstractApplication {
    +    private static final String WAR_PATH = "classpath://hello-world-webapp.war";
    +
    +    @Override
    +    public void init() {
    +        addChild(EntitySpecs.spec(JBoss7Server.class)
    +                .configure("war", WAR_PATH)
    +                .configure("httpPort", 8080));
    +    }
    +}
    +
    + + + + +

    You can run this as follows (on *nix or Mac, assuming ssh localhost requires no password or passphrase):

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample \
    +  --location localhost
    +
    + + + + +

    Then visit the webapp on port 8080, or the Brooklyn console on 8081. (Default credentials are admin/password.) +Note that the installation may take some time, because the default deployment downloads the software from +the official repos. You can monitor start-up activity for each entity in the Activity pane in the management console, +and see more detail by tailing the log file (tail -f brooklyn.log).

    + + + + +

    With appropriate setup (as described here) +this can also be deployed to your favourite cloud, let's pretend it's Amazon Ireland, as follows:

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample \
    +  --location aws-ec2:eu-west-1
    +
    + + + + +

    Elastic Three-Tier

    + + + + +

    Ready for something more interesting? Try this:

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.WebClusterDatabaseExample \
    +  --location localhost
    +
    + + + + +

    This launches the class WebClusterDatabaseExample (also described in the walkthrough) +which launches a pool of web-servers -- of size 1 initially, +but manually configurable (if you stop the policy first, in the GUI, then use the resize effector) -- +with an Nginx load-balancer set up in front of them, and backed by a MySQL database.

    + + + + +

    The essential code fragment looks like this:

    + + + + +
    public class WebClusterDatabaseExample extends AbstractApplication {
    +    public static final String WAR_PATH = "classpath://hello-world-sql-webapp.war";
    +    
    +    public static final String DB_SETUP_SQL_URL = "classpath://visitors-creation-script.sql";
    +    
    +    public static final String DB_TABLE = "visitors";
    +    public static final String DB_USERNAME = "brooklyn";
    +    public static final String DB_PASSWORD = "br00k11n";
    +
    +    @Override
    +    public void init() {
    +        MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class)
    +                .configure("creationScriptUrl", DB_SETUP_SQL_URL));
    +        
    +        ControlledDynamicWebAppCluster web = addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class)
    +                .configure("memberSpec", EntitySpecs.spec(JBoss7Server.class)
    +                        .configure("httpPort", "8080+")
    +                        .configure("war", WAR_PATH)
    +                        .configure(javaSysProp("brooklyn.example.db.url"), 
    +                                formatString("jdbc:%s%s?user=%s\\&password=%s", 
    +                                        attributeWhenReady(mysql, MySqlNode.MYSQL_URL), DB_TABLE, DB_USERNAME, DB_PASSWORD))));
    +        
    +        web.getCluster().addPolicy(AutoScalerPolicy.builder().
    +                        metric(DynamicWebAppCluster.AVERAGE_REQUESTS_PER_SECOND).
    +                        sizeRange(1, 5).
    +                        metricRange(10, 100).
    +                        build());
    +    }
    +}
    +
    + + + + +

    You can, of course, try this with your favourite cloud, +tweak the database start script, or drop in your favourite WAR.

    + + + + +

    A Few Other Things

    + + + + +

    The project includes variants of the examples shown here, +including alternative syntax (the *Alt* files), +and a web-only cluster (no database) in `WebClusterExample``.

    + + + + +

    The webapp that is used is included under examples/hello-world-webapp.

    + + + + +

    You may wish to check out the Global Web Fabric example next.

    + + + + +

    If you encounter any difficulties, please tell us and we'll do our best to help.

    + + + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/examples/webcluster/webcluster.include.md b/v/0.5.0-rc.2/use/examples/webcluster/webcluster.include.md new file mode 100644 index 000000000..0de16cd8e --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/webcluster/webcluster.include.md @@ -0,0 +1,124 @@ + +{% readj ../before-begin.include.md %} + +## Simple Web Server + +Go to this particular example's directory: + +{% highlight bash %} +% cd simple-web-cluster +{% endhighlight %} + +The CLI needs to know where to find your compiled examples. You can set this up by exporting +the ``BROOKLYN_CLASSPATH`` environment variable in the following way: + +{% highlight bash %} +% export BROOKLYN_CLASSPATH=$(pwd)/target/classes +{% endhighlight %} + +The project ``simple-web-cluster`` includes several deployment descriptors +for rolling out a web application, under ``src/main/java``. + + + +The simplest of these, ``SingleWebServerExample``, starts JBoss on a single machine with a "Hello World" war deployed, +with a single line: + +{% highlight java %} +public class SingleWebServerExample extends AbstractApplication { + private static final String WAR_PATH = "classpath://hello-world-webapp.war"; + + @Override + public void init() { + addChild(EntitySpecs.spec(JBoss7Server.class) + .configure("war", WAR_PATH) + .configure("httpPort", 8080)); + } +} +{% endhighlight %} + +You can run this as follows (on *nix or Mac, assuming `ssh localhost` requires no password or passphrase): + +{% highlight bash %} +% ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample \ + --location localhost +{% endhighlight %} + + +Then visit the webapp on port 8080, or the Brooklyn console on 8081. (Default credentials are admin/password.) +Note that the installation may take some time, because the default deployment downloads the software from +the official repos. You can monitor start-up activity for each entity in the ``Activity`` pane in the management console, +and see more detail by tailing the log file (``tail -f brooklyn.log``). + +With appropriate setup (as described [here]({{ site.url }}/use/guide/management/index.html#startup-config)) +this can also be deployed to your favourite cloud, let's pretend it's Amazon Ireland, as follows: + +{% highlight bash %} +% ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample \ + --location aws-ec2:eu-west-1 +{% endhighlight %} + + +## Elastic Three-Tier + +Ready for something more interesting? Try this: + +{% highlight bash %} +% ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.WebClusterDatabaseExample \ + --location localhost +{% endhighlight %} + +This launches the class ``WebClusterDatabaseExample`` (also described in the [walkthrough]({{ site.url }}/start/walkthrough/index.html)) +which launches a pool of web-servers -- of size 1 initially, +but manually configurable (if you stop the policy first, in the GUI, then use the ``resize`` effector) -- +with an Nginx load-balancer set up in front of them, and backed by a MySQL database. + +The essential code fragment looks like this: + +{% highlight java %} +public class WebClusterDatabaseExample extends AbstractApplication { + public static final String WAR_PATH = "classpath://hello-world-sql-webapp.war"; + + public static final String DB_SETUP_SQL_URL = "classpath://visitors-creation-script.sql"; + + public static final String DB_TABLE = "visitors"; + public static final String DB_USERNAME = "brooklyn"; + public static final String DB_PASSWORD = "br00k11n"; + + @Override + public void init() { + MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class) + .configure("creationScriptUrl", DB_SETUP_SQL_URL)); + + ControlledDynamicWebAppCluster web = addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) + .configure("memberSpec", EntitySpecs.spec(JBoss7Server.class) + .configure("httpPort", "8080+") + .configure("war", WAR_PATH) + .configure(javaSysProp("brooklyn.example.db.url"), + formatString("jdbc:%s%s?user=%s\\&password=%s", + attributeWhenReady(mysql, MySqlNode.MYSQL_URL), DB_TABLE, DB_USERNAME, DB_PASSWORD)))); + + web.getCluster().addPolicy(AutoScalerPolicy.builder(). + metric(DynamicWebAppCluster.AVERAGE_REQUESTS_PER_SECOND). + sizeRange(1, 5). + metricRange(10, 100). + build()); + } +} +{% endhighlight %} + +You can, of course, try this with your favourite cloud, +tweak the database start script, or drop in your favourite WAR. + + +## A Few Other Things + +The project includes variants of the examples shown here, +including alternative syntax (the `*Alt*` files), +and a web-only cluster (no database) in `WebClusterExample``. + +The webapp that is used is included under ``examples/hello-world-webapp``. + +You may wish to check out the [Global Web Fabric example]({{ site.url }}/use/examples/global-web-fabric/) next. + +If you encounter any difficulties, please [tell us]({{ site.url }}/meta/contact.html) and we'll do our best to help. diff --git a/v/0.5.0-rc.2/use/examples/whirrhadoop.html b/v/0.5.0-rc.2/use/examples/whirrhadoop.html new file mode 100644 index 000000000..840b460a3 --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/whirrhadoop.html @@ -0,0 +1,1107 @@ + + + + + Whirr Hadoop Cluster + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Whirr Hadoop Cluster

    + + + + + + + + + + + + + + + + +

    + + + + +

    Before You Begin

    + + + + +

    To use the examples, you'll need curl, git, java (1.6+), and maven (v3) installed.

    + + + + +

    Installing Brooklyn

    + + + + +

    (If you followed the Getting Started instructions, you can skip to Installing the Examples.)

    + + + + +

    First, grab a copy of the Brooklyn snapshot distribution you wish to use from +the Sonatype snapshot repo +(or build it yourself following instructions here), +unpack it to your favourite location (e.g. $(pwd)), +and export BROOKLYN_HOME:

    + + + + +
    % curl -L -o brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz 
    +% tar xvzf brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz
    +% export BROOKLYN_HOME=$(pwd)/brooklyn-0.6.0-SNAPSHOT/
    +
    + + + + +

    Installing the Examples

    + + + + +

    Grab a copy of the brooklyn-examples source code and build with Maven:

    + + + + +
    % git clone https://github.com/brooklyncentral/brooklyn-examples.git
    +% cd brooklyn-examples
    +% mvn clean install
    +
    + + + + +

    Please note, these instructions are for a SNAPSHOT release of Brooklyn, +so proceed with caution. +For the latest stable version, go here.

    + + + + +

    For more information on ways to download Brooklyn please +see the download page. +For more information on the Brooklyn CLI and launching apps, +please visit this section of the user guide.

    + + + + +

    Now, go to this particular example's directory:

    + + + + +
    % cd hadoop-and-whirr
    +
    + + + + +

    The CLI needs to know where to find your compiled examples. You can set this up by exporting +the BROOKLYN_CLASSPATH environment variable in the following way:

    + + + + +
    % export BROOKLYN_CLASSPATH=$(pwd)/target/classes
    +
    + + + + +

    The project hadoop-and-whirr includes deployment descriptors +showing how to provision Whirr-based clusters from Brooklyn, +including setting up a Hadoop recipe.

    + + + + +

    Background

    + + + + +

    Apache Whirr is an open-source project providing +a set of libraries for launching cloud services in an easy, repeatable, and reliable way.

    + + + + +

    Brooklyn can use Whirr to launch a wide variety of services +and integrate them as part of bespoke applications.

    + + + + +

    Whirr Hadoop

    + + + + +

    The class WhirrHadoopExample shows how a Hadoop cluster can be started +with an arbitrary size, using the WhirrHadoopCluster entity.

    + + + + +
    public class WhirrHadoopExample extends AbstractApplication {
    +    @Override
    +    public void init() {
    +        WhirrCluster cluster = addChild(EntitySpecs.spec(WhirrHadoopCluster.class)
    +                .configure("size", 2)
    +                .configure("memory", 2048));
    +    }
    +}
    +
    + + + + +

    You can run this by running:

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.extras.whirr.WhirrHadoopExample --stopOnKeyPress --location aws-ec2:eu-west-1
    +
    + + + + +

    This targets aws-ec2:eu-west-1 (using jclouds), +so you will need to set your AWS credentials as described here.

    + + + + +

    Web Console Showing Whirr-launched Hadoop Cluster

    + + + + +

    Once it is running, navigate to the Brooklyn web console to see the NAME_NODE_URL sensor. +(And not that using attributeWhenReady, +you can easily configure a larger application to use its own dedicated Hadoop cluster.)

    + + + + +

    + + + + +

    Custom Whirr Recipe

    + + + + +

    The class WhirrExample shows how an arbitrary Whirr recipe +can be run from within Brooklyn:

    + + + + +
    public class WhirrExample extends AbstractApplication {
    +    public static final String RECIPE =
    +            "whirr.cluster-name=brooklyn-whirr"+"\n"+
    +            "whirr.hardware-min-ram=1024"+"\n"+
    +            "whirr.instance-templates=1 noop, 1 elasticsearch"+"\n";
    +
    +    @Override
    +    public void init() {
    +        WhirrCluster cluster = addChild(EntitySpecs.spec(WhirrCluster.class)
    +                .configure("recipe", RECIPE));
    +    }
    +}
    +
    + + + + +

    This can be launched by running:

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.extras.whirr.WhirrExample --stopOnKeyPress --location aws-ec2:eu-west-1
    +
    + + + + +

    In the provided example this will deploy to AWS.

    + + + + +

    If you would like to deploy to localhost, you can do this by running the same command and replacing aws-ec2:eu-west-1 with localhost. However, please note that currently there are some limitations when deploying to localhost:

    + + + + +
      +
    • You can not deploy more than one server (noop doesn't count in the above case).
    • +
    • This has only been tested on Ubuntu 10.04 and might cause problems on other operating systems.
    • +
    • Your user will need to be configured for passwordless ssh and passwordless sudo on localhost.
    • +
    + + + + +

    Feel free to experiment with the instance template parameter, +trying out other recipes from Whirr.

    + + + + +

    With this mechanism, you can roll out Whirr-supported systems, +ranging from Cassandra to Voldemort, including integrating +Chef and Puppet scripts you may wish to use. +The Whirr state is loaded into Brooklyn, as well as saved to disk in the usual Whirr way. +This means it is available for programmatic extensions (as is used for Hadoop), +including defining sensors and effectors and applying policy: +stop is available, with resize expected soon +(making it easy -- or at least much easier -- to write custom elasticity policies).

    + + + + +

    Integrating with Other Entities

    + + + + +

    The real interest of Brooklyn working with Whirr, of course, is to combine systems such as Hadoop +with your custom applications which use these systems. +One example, combining the Global Web Fabric example +with the Whirr Hadoop entity, is included in this example project. +A Hadoop-based chatroom web app, performing map-reduce (and a few necessary contortions to work with private subnets) +is in WebFabricWithHadoopExample.

    + + + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/examples/whirrhadoop/index.html b/v/0.5.0-rc.2/use/examples/whirrhadoop/index.html new file mode 100644 index 000000000..4ff7fbcd6 --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/whirrhadoop/index.html @@ -0,0 +1,1108 @@ + + + + + Whirr Hadoop Cluster + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Whirr Hadoop Cluster

    + + + + + + + + + + + + + +

    + + + + +

    Before You Begin

    + + + + +

    To use the examples, you'll need curl, git, java (1.6+), and maven (v3) installed.

    + + + + +

    Installing Brooklyn

    + + + + +

    (If you followed the Getting Started instructions, you can skip to Installing the Examples.)

    + + + + +

    First, grab a copy of the Brooklyn snapshot distribution you wish to use from +the Sonatype snapshot repo +(or build it yourself following instructions here), +unpack it to your favourite location (e.g. $(pwd)), +and export BROOKLYN_HOME:

    + + + + +
    % curl -L -o brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz 
    +% tar xvzf brooklyn-dist-0.6.0-SNAPSHOT-dist.tar.gz
    +% export BROOKLYN_HOME=$(pwd)/brooklyn-0.6.0-SNAPSHOT/
    +
    + + + + +

    Installing the Examples

    + + + + +

    Grab a copy of the brooklyn-examples source code and build with Maven:

    + + + + +
    % git clone https://github.com/brooklyncentral/brooklyn-examples.git
    +% cd brooklyn-examples
    +% mvn clean install
    +
    + + + + +

    Please note, these instructions are for a SNAPSHOT release of Brooklyn, +so proceed with caution. +For the latest stable version, go here.

    + + + + +

    For more information on ways to download Brooklyn please +see the download page. +For more information on the Brooklyn CLI and launching apps, +please visit this section of the user guide.

    + + + + +

    Now, go to this particular example's directory:

    + + + + +
    % cd hadoop-and-whirr
    +
    + + + + +

    The CLI needs to know where to find your compiled examples. You can set this up by exporting +the BROOKLYN_CLASSPATH environment variable in the following way:

    + + + + +
    % export BROOKLYN_CLASSPATH=$(pwd)/target/classes
    +
    + + + + +

    The project hadoop-and-whirr includes deployment descriptors +showing how to provision Whirr-based clusters from Brooklyn, +including setting up a Hadoop recipe.

    + + + + +

    Background

    + + + + +

    Apache Whirr is an open-source project providing +a set of libraries for launching cloud services in an easy, repeatable, and reliable way.

    + + + + +

    Brooklyn can use Whirr to launch a wide variety of services +and integrate them as part of bespoke applications.

    + + + + +

    Whirr Hadoop

    + + + + +

    The class WhirrHadoopExample shows how a Hadoop cluster can be started +with an arbitrary size, using the WhirrHadoopCluster entity.

    + + + + +
    public class WhirrHadoopExample extends AbstractApplication {
    +    @Override
    +    public void init() {
    +        WhirrCluster cluster = addChild(EntitySpecs.spec(WhirrHadoopCluster.class)
    +                .configure("size", 2)
    +                .configure("memory", 2048));
    +    }
    +}
    +
    + + + + +

    You can run this by running:

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.extras.whirr.WhirrHadoopExample --stopOnKeyPress --location aws-ec2:eu-west-1
    +
    + + + + +

    This targets aws-ec2:eu-west-1 (using jclouds), +so you will need to set your AWS credentials as described here.

    + + + + +

    Web Console Showing Whirr-launched Hadoop Cluster

    + + + + +

    Once it is running, navigate to the Brooklyn web console to see the NAME_NODE_URL sensor. +(And not that using attributeWhenReady, +you can easily configure a larger application to use its own dedicated Hadoop cluster.)

    + + + + +

    + + + + +

    Custom Whirr Recipe

    + + + + +

    The class WhirrExample shows how an arbitrary Whirr recipe +can be run from within Brooklyn:

    + + + + +
    public class WhirrExample extends AbstractApplication {
    +    public static final String RECIPE =
    +            "whirr.cluster-name=brooklyn-whirr"+"\n"+
    +            "whirr.hardware-min-ram=1024"+"\n"+
    +            "whirr.instance-templates=1 noop, 1 elasticsearch"+"\n";
    +
    +    @Override
    +    public void init() {
    +        WhirrCluster cluster = addChild(EntitySpecs.spec(WhirrCluster.class)
    +                .configure("recipe", RECIPE));
    +    }
    +}
    +
    + + + + +

    This can be launched by running:

    + + + + +
    % ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.extras.whirr.WhirrExample --stopOnKeyPress --location aws-ec2:eu-west-1
    +
    + + + + +

    In the provided example this will deploy to AWS.

    + + + + +

    If you would like to deploy to localhost, you can do this by running the same command and replacing aws-ec2:eu-west-1 with localhost. However, please note that currently there are some limitations when deploying to localhost:

    + + + + +
      +
    • You can not deploy more than one server (noop doesn't count in the above case).
    • +
    • This has only been tested on Ubuntu 10.04 and might cause problems on other operating systems.
    • +
    • Your user will need to be configured for passwordless ssh and passwordless sudo on localhost.
    • +
    + + + + +

    Feel free to experiment with the instance template parameter, +trying out other recipes from Whirr.

    + + + + +

    With this mechanism, you can roll out Whirr-supported systems, +ranging from Cassandra to Voldemort, including integrating +Chef and Puppet scripts you may wish to use. +The Whirr state is loaded into Brooklyn, as well as saved to disk in the usual Whirr way. +This means it is available for programmatic extensions (as is used for Hadoop), +including defining sensors and effectors and applying policy: +stop is available, with resize expected soon +(making it easy -- or at least much easier -- to write custom elasticity policies).

    + + + + +

    Integrating with Other Entities

    + + + + +

    The real interest of Brooklyn working with Whirr, of course, is to combine systems such as Hadoop +with your custom applications which use these systems. +One example, combining the Global Web Fabric example +with the Whirr Hadoop entity, is included in this example project. +A Hadoop-based chatroom web app, performing map-reduce (and a few necessary contortions to work with private subnets) +is in WebFabricWithHadoopExample.

    + + + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/examples/whirrhadoop/whirrhadoop-w750.png b/v/0.5.0-rc.2/use/examples/whirrhadoop/whirrhadoop-w750.png new file mode 100644 index 000000000..a3fa9e88a Binary files /dev/null and b/v/0.5.0-rc.2/use/examples/whirrhadoop/whirrhadoop-w750.png differ diff --git a/v/0.5.0-rc.2/use/examples/whirrhadoop/whirrhadoop.include.md b/v/0.5.0-rc.2/use/examples/whirrhadoop/whirrhadoop.include.md new file mode 100644 index 000000000..932299e5b --- /dev/null +++ b/v/0.5.0-rc.2/use/examples/whirrhadoop/whirrhadoop.include.md @@ -0,0 +1,118 @@ +{% readj ../before-begin.include.md %} + +Now, go to this particular example's directory: + +{% highlight bash %} +% cd hadoop-and-whirr +{% endhighlight %} + +The CLI needs to know where to find your compiled examples. You can set this up by exporting +the ``BROOKLYN_CLASSPATH`` environment variable in the following way: + +{% highlight bash %} +% export BROOKLYN_CLASSPATH=$(pwd)/target/classes +{% endhighlight %} + +The project ``hadoop-and-whirr`` includes deployment descriptors +showing how to provision Whirr-based clusters from Brooklyn, +including setting up a Hadoop recipe. + +## Background + +[Apache Whirr](http://whirr.apache.org) is an open-source project providing +a set of libraries for launching cloud services in an easy, repeatable, and reliable way. + +Brooklyn can use Whirr to launch a wide variety of services +and integrate them as part of bespoke applications. + + +## Whirr Hadoop + +The class ``WhirrHadoopExample`` shows how a Hadoop cluster can be started +with an arbitrary size, using the ``WhirrHadoopCluster`` entity. + +{% highlight java %} +public class WhirrHadoopExample extends AbstractApplication { + @Override + public void init() { + WhirrCluster cluster = addChild(EntitySpecs.spec(WhirrHadoopCluster.class) + .configure("size", 2) + .configure("memory", 2048)); + } +} +{% endhighlight %} + +You can run this by running: + +{% highlight bash %} +% ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.extras.whirr.WhirrHadoopExample --stopOnKeyPress --location aws-ec2:eu-west-1 +{% endhighlight %} + +This targets ``aws-ec2:eu-west-1`` (using jclouds), +so you will need to set your AWS credentials as described [here]({{site.url}}/use/guide/management/index.html#startup-config). + +[![Web Console Showing Whirr-launched Hadoop Cluster](whirrhadoop-w750.png "Web Console Showing Whirr-launched Hadoop Cluster")](whirrhadoop.png) + +Once it is running, navigate to the Brooklyn web console to see the ``NAME_NODE_URL`` sensor. +(And not that using [``attributeWhenReady``]({{ site.url }}/use/guide/defining-applications/advanced-concepts.html#dependent), +you can easily configure a larger application to use its own dedicated Hadoop cluster.) + + + +## Custom Whirr Recipe + +The class ``WhirrExample`` shows how an arbitrary [Whirr](http://whirr.apache.org) recipe +can be run from within Brooklyn: + +{% highlight java %} +public class WhirrExample extends AbstractApplication { + public static final String RECIPE = + "whirr.cluster-name=brooklyn-whirr"+"\n"+ + "whirr.hardware-min-ram=1024"+"\n"+ + "whirr.instance-templates=1 noop, 1 elasticsearch"+"\n"; + + @Override + public void init() { + WhirrCluster cluster = addChild(EntitySpecs.spec(WhirrCluster.class) + .configure("recipe", RECIPE)); + } +} +{% endhighlight %} + +This can be launched by running: + +{% highlight bash %} +% ${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.extras.whirr.WhirrExample --stopOnKeyPress --location aws-ec2:eu-west-1 +{% endhighlight %} + +In the provided example this will deploy to AWS. + +If you would like to deploy to localhost, you can do this by running the same command and replacing ``aws-ec2:eu-west-1`` with ``localhost``. However, please note that currently there are some limitations when deploying to localhost: + +* You can not deploy more than one server (noop doesn't count in the above case). +* This has only been tested on Ubuntu 10.04 and might cause problems on other operating systems. +* Your user will need to be configured for [passwordless ssh and passwordless sudo](http://docs.outerthought.org/lilyenterprise-docs-trunk/539-lily/541-lily.html) on localhost. + + +Feel free to experiment with the instance template parameter, +trying out other recipes from Whirr. + +With this mechanism, you can roll out Whirr-supported systems, +ranging from Cassandra to Voldemort, including integrating +Chef and Puppet scripts you may wish to use. +The Whirr state is loaded into Brooklyn, as well as saved to disk in the usual Whirr way. +This means it is available for programmatic extensions (as is used for Hadoop), +including defining sensors and effectors and applying policy: +stop is available, with [resize](https://issues.apache.org/jira/browse/WHIRR-214) expected soon +(making it easy -- or at least much easier -- to write custom **elasticity policies**). + + +## Integrating with Other Entities + +The real interest of Brooklyn working with Whirr, of course, is to combine systems such as Hadoop +with your custom applications which use these systems. +One example, combining the [Global Web Fabric example]({{ site.url }}/use/examples/global-web-fabric) +with the Whirr Hadoop entity, is included in this example project. +A Hadoop-based chatroom web app, performing map-reduce (and a few necessary contortions to work with private subnets) +is in ``WebFabricWithHadoopExample``. + \ No newline at end of file diff --git a/v/0.5.0-rc.2/use/examples/whirrhadoop/whirrhadoop.png b/v/0.5.0-rc.2/use/examples/whirrhadoop/whirrhadoop.png new file mode 100644 index 000000000..d464bb34f Binary files /dev/null and b/v/0.5.0-rc.2/use/examples/whirrhadoop/whirrhadoop.png differ diff --git a/v/0.5.0-rc.2/use/guide/defining-applications/advanced-concepts.html b/v/0.5.0-rc.2/use/guide/defining-applications/advanced-concepts.html new file mode 100644 index 000000000..6bf62cada --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/defining-applications/advanced-concepts.html @@ -0,0 +1,869 @@ + + + + + Advanced Concepts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Advanced Concepts

    + +

    Lifecycle and ManagementContext

    + +

    Under-the-covers, at heart of the brooklyn management plane is the ManagementContext. +This is started automatically when using launching an application using the brooklyn CLI. For programmatic use, see +BrooklynLauncher.newLauncher().launch().

    + +

    A Brooklyn deployment consists of many entities in a hierarchical tree, with the privileged application entity at the top level.

    + +

    An application entity (Application class) is responsible for starting the deployment of all its child entities (i.e. the entire entity tree under its ownership).

    + +

    An Application's start() method begins provisioning the child entities of the application (and their entities, recursively).

    + +

    Provisioning of entities typically happens in parallel automatically, +although this can be customized. This is implemented as tasks which are tracked by the management plane and is visible in the web-based management console.

    + +

    Customized provisioning can be useful where two starting entities depend on each other. For example, it is often necessary to delay start of one entity until another entity reaches a certain state, and to supply run-time information about the latter to the former.

    + + + + +

    When new entities are created, the entity is wired up to an application by giving it a parent. The entity is then explicitly "managed", which allows other entities to discover it.

    + +

    Typically a Brooklyn deployment has a single management context which records:

    + +
      +
    • all entities under management that are reachable by the application(s) via the parent-child relationships,
    • +
    • the state associated with each entity,
    • +
    • subscribers (listeners) to sensor events arising from the entities,
    • +
    • active tasks (jobs) associated with any the entity,
    • +
    • which Brooklyn management node is mastering (managing) each entity.
    • +
    + + + + + +

    In a multi-location deployment, management operates in all regions, with brooklyn entity instances being mastered in the relevant region.

    + +

    When management is distributed a Brooklyn deployment may consist of multiple Brooklyn management nodes each with a ManagementContext instance.

    + + + + +

    + +

    Dependent Configuration

    + +

    Under the covers Brooklyn has a sophisticated sensor event and subscription model, but conveniences around this model make it very simple to express cross-entity dependencies. Consider the example where Tomcat instances need to know the URL of a database (or a set of URLs to connect to a Monterey processing fabric, or other entities)

    + +
    setConfiguration(UsesJava.JAVA_OPTIONS, ImmutableMap.of("mysql.url", 
    +        attributeWhenReady(mysql, MySqlNode.MY_SQL_URL) ))
    +
    + + +

    The attributeWhenReady(Entity, Sensor) call (a static method on the class DependentConfiguration) +causes the configuration value to be set when that given entity's attribue is ready. +In the example, attributeWhenReady() causes the JVM system property mysql.url to be set to the value of the MySqlNode.MY_SQL_URL sensor from mysql when that value is ready. As soon as the database URL is announced by the MySql entity, the configuration value will be available to the Tomcat cluster.

    + +

    By default "ready" means being set (non-null) and, if appropriate, non-empty (for collections and strings) or non-zero (for numbers). Formally the interpretation of ready is that of "Groovy truth" defined by an asBoolean() method on the class and in the Groovy language extensions.

    + +

    You can customize "readiness" by supplying a Predicate (Google common) or Closure (Groovy) in a third parameter. +This evaluates candidate values reported by the sensor until one is found to be true. +For example, passing { it.size()>=3 } as the readiness argument would require at least three management plane URLs.

    + +

    More information on this can be found in the javadoc for DependentConfiguration, +along with a few other methods such as valueWhenAttributeReady which allow post-processing of an attribute value.

    + +

    Note that if the value of CONFIG_KEY passed to Entity.getConfig is a Closure or Task (such as returned by attributeWhenReady), +the first access of Entity.getConfig(CONFIG_KEY) will block until the task completes. +Typically this does the right thing, blocking when necessary to generate the right start-up sequence +without the developer having to think through the order, but it can take some getting used to. +Be careful not to request config information until really necessary (or to use non-blocking "raw" mechanisms), +and in complicated situations be ready to attend to circular dependencies. +The management console gives useful information for understanding what is happening and resolving the cycle.

    + +

    Location

    + + + + +

    Entities can be provisioned/started in the location of your choice. Brooklyn transparently uses jclouds to support different cloud providers and to support BYON (Bring Your Own Nodes).

    + +

    The implementation of an entity (e.g. Tomcat) is agnostic about where it will be installed/started. When writing the application definition specify the location or list of possible locations (Location instances) for hosting the entity.

    + +

    Location instances represent where they run and indicate how that location (resource or service) can be accessed.

    + +

    For example, a JBoss7Server will usually be running in an SshMachineLocation, which contains the credentials and address for sshing to the machine. A cluster of such servers may be running in a MachineProvisioningLocation, capable of creating new SshMachineLocation instances as required.

    + + + + +

    Policies

    + +

    Policies perform the active management enabled by Brooklyn. Entities can have zero or more Policy instances attached to them.

    + +

    Policies can subscribe to sensors from entities or run periodically, and +when they run they can perform calculations, look up other values, and if deemed necessary invoke effectors or emit sensor values from the entity with which they are associated.

    + +

    Execution

    + +

    All processing, whether an effector invocation or a policy cycle, are tracked as tasks. This allows several important capabilities:

    + +
      +
    • active and historic processing can be observed by operators
    • +
    • the invocation context is available in the thread, to check entitlement (permissions) and maintain a +hierarchical causal chain even when operations are run in parallel
    • +
    • processing can be managed across multiple management nodes
    • +
    + + +

    Some executions create new entities, which can then have tasks associated with them, and the system will record, for example, that a start efector on the new entity is a task associated with that entity, with that task +created by a task associated with a different entity.

    + +

    The execution of a typical overall start-up sequence is shown below:

    + +

    Brooklyn Flow Diagram

    + +

    Integration

    + +

    One vital aspect of Brooklyn is its ability to communicate with the systems it starts. This is abstracted using a driver facility in Brooklyn, where a +driver describes how a process or service can be installed and managed using a particular technology.

    + +

    For example, a TomcatServer may implement start and other effectors using a TomcatSshDriver which inherits from JavaSoftwareProcessSshDriver (for JVM and JMX start confguration), inheriting from AbstractSoftwareProcessSshDriver +(for SSH scripting support).

    + +

    Particularly for sensors, some technologies are used so frequently that they are +packaged as feeds which can discover their configuration (including from drivers). These include JMX and HTTP (see JmxFeed and HttpFeed).

    + +

    Brooklyn comes with entity implementations for a growing number of commonly used systems, including various web application servers, databases and NoSQL data stores, and messaging systems. See: Extras.

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/guide/defining-applications/basic-concepts.html b/v/0.5.0-rc.2/use/guide/defining-applications/basic-concepts.html new file mode 100644 index 000000000..fa4ed6874 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/defining-applications/basic-concepts.html @@ -0,0 +1,821 @@ + + + + + Basic Concepts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Basic Concepts

    + +

    This introduces brooklyn and describes how it simplifies the deployment and management of big applications. It is +intended for people who are using brooklyn-supported application components (such as web/app servers, data stores) +to be able to use brooklyn to easily start their application in multiple locations with off-the-shelf management +policies.

    + +

    Entities

    + +

    The central concept in a Brooklyn deployment is that of an entity. +An entity represents a resource under management, either base entities (individual machines or software processes) +or logical collections of these entities.

    + +

    Fundamental to the processing model is the capability of entities to be the parent of other entities (the mechanism by which collections are formed), +with every entity having a single parent entity, up to the privileged top-level application entity.

    + +

    Entities are code, so they can be extended, overridden, and modified. Entities can have events, operations, and processing logic associated with them, and it is through this mechanism that the active management is delivered.

    + +

    The main responsibilities of an entity are:

    + +
      +
    • Provisioning the entity in the given location or locations
    • +
    • Holding configuration and state (attributes) for the entity
    • +
    • Reporting monitoring data (sensors) about the status of the entity
    • +
    • Exposing operations (effectors) that can be performed on the entity
    • +
    • Hosting management policies and tasks related to the entity
    • +
    + + +

    Application, Parent and Membership

    + +

    All entities have a parent entity, which creates and manages it, with one important exception: applications. +Application entities are the top-level entities created and managed externally, manually or programmatically.

    + +

    Applications are typically defined in Brooklyn as an application descriptor. +This is a Java class specifying the entities which make up the application, +by extending the class AbstractApplication, and specifying how these entities should be configured and managed.

    + +

    All entities, including applications, can be the parent of other entities. +This means that the "child" is typically started, configured, and managed by the parent. +For example, an application may be the parent of a web cluster; that cluster in turn is the parent of web server processes. +In the management console, this is represented hierarchically in a tree view.

    + +

    A parallel concept is that of membership: in addition to one fixed parent, +and entity may be a member of any number of special entities called groups. +Membership of a group can be used for whatever purpose is required; +for example, it can be used to manage a collection of entities together for one purpose +(e.g. wide-area load-balancing between locations) even though they may have been +created by different parents (e.g. a multi-tier stack within a location).

    + +

    Configuration, Sensors and Effectors

    + +

    Configuration

    + +

    All entities contain a map of config information. This can contain arbitrary values, typically keyed under static ConfigKey fields on the Entity sub-class. These values are inherited, so setting a configuration value at the +application level will make it available in all entities underneath unless it is overridden.

    + +

    Configuration is propagated when an application "goes live" (i.e. it becomes "managed", either explicitly or when its start() method is invoked), so config values must be set before this occurs.

    + +

    Configuration values can be specified in a configuration file (~/.brooklyn/brooklyn.properties) +to apply universally, and/or programmatically to a specific entity and its descendants +by calling .configure(KEY, VALUE) in the entity spec when creating it. +There is also an entity.setConfig(KEY, VALUE) method.

    + +

    Additionally, many common configuration parameters are available as "flags" which can be supplied as Strings when constructing +then entity, in the form +EntitySpecs.specË™(MyEntity.class).configure("config1", "value1").configure("config2", "value2").

    + +

    Documentation of the flags available for individual entities can normally be found in the javadocs. +The @SetFromFlag annotations on ConfigKey static field definitions +in the entity's interface is the recommended mechanism for exposing configuration options.

    + +

    Sensors and Effectors

    + +

    Sensors (activity information and notifications) and effectors (operations that can be invoked on the entity) are defined by entities as static fields on the Entity subclass.

    + +

    Sensors can be updated by the entity or associated tasks, and sensors from an entity can be subscribed to by its parent or other entities to track changes in an entity's activity.

    + +

    Effectors can be invoked by an entity's parent remotely, and the invoker is able to track the execution of that effector. Effectors can be invoked by other entities, but use this functionality with care to prevent too many managers!

    + +

    An entity consists of a Java interface (used when interacting with the entity) and a Java class. For resilience. it is recommended to store +the entity's state in attributes (see `getAttribute(AttributeKey)``). If internal fields can be used then the data will be lost on brooklyn +restart, and may cause problems if the entity is to be moved to a different brooklyn management node.

    + +

    Next: Advanced Concepts. +See also: Management > Sensors and Effectors.

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/guide/defining-applications/brooklyn-flow-websequencediagrams.com-w400.png b/v/0.5.0-rc.2/use/guide/defining-applications/brooklyn-flow-websequencediagrams.com-w400.png new file mode 100644 index 000000000..c2b48bae3 Binary files /dev/null and b/v/0.5.0-rc.2/use/guide/defining-applications/brooklyn-flow-websequencediagrams.com-w400.png differ diff --git a/v/0.5.0-rc.2/use/guide/defining-applications/brooklyn-flow-websequencediagrams.com.png b/v/0.5.0-rc.2/use/guide/defining-applications/brooklyn-flow-websequencediagrams.com.png new file mode 100644 index 000000000..78eb5c8ec Binary files /dev/null and b/v/0.5.0-rc.2/use/guide/defining-applications/brooklyn-flow-websequencediagrams.com.png differ diff --git a/v/0.5.0-rc.2/use/guide/defining-applications/common-usage.html b/v/0.5.0-rc.2/use/guide/defining-applications/common-usage.html new file mode 100644 index 000000000..732a2e84b --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/defining-applications/common-usage.html @@ -0,0 +1,865 @@ + + + + + Common Usage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Common Usage

    + +

    Entity Class Hierarchy

    + +

    By convention in Brooklyn the following words have a particular meaning, both as types (which extend Group, which extends Entity) and when used as words in other entities (such as TomcatFabric):

    + +
      +
    • Cluster - a homogeneous collection of entities
    • +
    • Fabric - a multi-location collection of entities, with one per location; often used with a cluster per location
    • +
    • Stack - heterogeneous (mixed types of children)
    • +
    • Application - user's entry point
    • +
    + + + + + +
      +
    • entity spec defines an entity, so that one or more such entities can be created; often used by clusters/groups to define how to instantiate new children.
    • +
    • entity factories are often used by clusters/groups to define how to instantiate new children.
    • +
    • traits (mixins) providing certain capabilities, such as Resizable and Balanceable
    • +
    • Resizable entities can re-sized dynamically, to increase/decrease the number of child entities.
    • +
    • Movable entities can be migrated between balanceable containers.
    • +
    • Balanceable containers can contain movable entities, where each contained entity is normally associated with + a piece of work within that container.
    • +
    + + +

    Off-the-Shelf Entities

    + +

    brooklyn includes a selection of entities already available for use in applications, +including appropriate sensors and effectors, and in some cases include Cluster and Fabric variants. +(These are also useful as templates for writing new entities.)

    + +

    These include:

    + +
      +
    • Web: Tomcat, JBoss, Jetty (external), Play (external); nginx; GeoScaling
    • +
    • Data: MySQL, Redis, MongoDB, Infinispan, GemFire (external)
    • +
    • Containers: Karaf
    • +
    • Messaging: ActiveMQ, Qpid, Rabbit MQ
    • +
    • PaaS: Cloud Foundry, Stackato; OpenShift
    • +
    + + +

    Off-the-Shelf Locations

    + +

    Brooklyn supports deploying to any machine which admits SSH access, as well as to +a huge variety of external and on-premise clouds. You can also connect to services, +or use whatever technique for deployment suits you best (such as Xebia Overthere, in development!).

    + +

    Configuration is typically set in ~/.brooklyn/brooklyn.properties using keys such as the following:

    + +
        # use this key for localhost (this is the default, although if you have a passphrase you must set it)
    +    brooklyn.localhost.privateKeyFile=~/.ssh/id_rsa
    +    
    +    brooklyn.localhost.privateKeyPassphrase=s3cr3tPASSPHRASE
    +       
    +    # use a special key when connecting to public clouds, and a particularly special one for AWS
    +    brooklyn.jclouds.privateKeyFile=~/.ssh/public_clouds/id_rsa
    +    brooklyn.jclouds.aws-ec2.privateKeyFile=~/.ssh/public_clouds/aws_id_rsa
    +        
    +    # AWS credentials (when deploying to location jclouds:aws-ec2)
    +    brooklyn.jclouds.aws-ec2.identity=ABCDEFGHIJKLMNOPQRST      
    +    brooklyn.jclouds.aws-ec2.credential=s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l
    +    
    +    # credentials for 'geoscaling' service
    +    brooklyn.geoscaling.username=cloudsoft                      
    +    brooklyn.geoscaling.password=xxx
    +
    + + +

    These can also be set as environment variables (in the shell) or system properties (java command line). +(There are also BROOKLYN_JCLOUDS_PRIVATE_KEY_FILE variants accepted.)

    + +

    For any jclouds provider you will typically need to set identity and credential +in the brooklyn.jclouds.provider namespace.

    + +

    To deploy to sets of machines with known IP's, assuming you have the credentials, +use the syntax byon:(hosts="user@10.9.1.1,user@10.9.1.2,user@10.9.1.3") +(this requires your default private key to have access; +see the prod1 example below for specifying other credentials).

    + +

    A wide range of other fields is available, because in the real world sometimes things do get complicated. +The following is supported from the configuration file (with whatever customization you might want available in code):

    + +
      +
    • If there is a passphrase on the key file being used, you must supply it to Brooklyn for it to work, of course! +privateKeyPassphrase does the trick (as in brooklyn.jclouds.privateKeyPassphrase, or other places +where privateKeyFile is valid). If you don't like keys, you can just use a plain old password.

    • +
    • Hardware requirements such as minRam and minCores can be supplied, or a hardwareId (jclouds only)

    • +
    • Specific VM images can be specified using imageId or imageNameRegex (jclouds only)

    • +
    • User metadata can be attached, using the syntax userMetadata=key=value,key2="value 2" (jclouds only)

    • +
    • A user can be specified, with the property that -- in a jclouds world -- the user will be created on the machine, +with admin rights, authorizing the relevant public key (corresponding to the private key, or as described below). +Login for the root account will be disabled, as will login by password if a public key is supplied. +(This is skipped if user is the root or other initial login user.)

    • +
    • You can specify the user account to use to login to jclouds initially with the loginUser property. +Typically this is auto-detected by jclouds +(often root, or ubuntu or ec2-user for known Ubuntu or Amazon Linux images), +but the strategy isn't foolproof, particularly in some private cloud setups. (jclouds only)

    • +
    • Public keys can be specified using publicKeyFile, +although these can usually be omitted if they follow the common pattern of being +the private key file with the suffix .pub appended. +(It is useful in the case of loginUser.publicKeyFile, where you shouldn't need, +or might not even have, the private key of the root user in order to log in.)

    • +
    + + +

    You can also define named locations for commonly used groups of properties, +with the syntax brooklyn.location.named.your-group-name. +followed by the relevant properties. +These can be accessed at runtime using the syntax named:your-group-name as the deployment location.

    + +

    Some more advanced examples showing the syntax and properties above are as follows:

    + +
        # Production pool of machines for my application (deploy to named:prod1)
    +    brooklyn.location.named.prod1=byon:(hosts="10.9.1.1,10.9.1.2,produser2@10.9.2.{10,11,20-29}")
    +    brooklyn.location.named.prod1.user=produser1
    +    brooklyn.location.named.prod1.privateKeyFile=~/.ssh/produser_id_rsa
    +    brooklyn.location.named.prod1.privateKeyPassphrase=s3cr3tCOMPANYpassphrase
    +    
    +    # AWS using my company's credentials and image standard, then labelling images so others know they're mine
    +    brooklyn.location.named.company-jungle=jclouds:aws-ec2:us-west-1
    +    brooklyn.location.named.company-jungle.identity=BCDEFGHIJKLMNOPQRSTU      
    +    brooklyn.location.named.company-jungle.privateKeyFile=~/.ssh/public_clouds/company_aws_id_rsa
    +    brooklyn.location.named.company-jungle.imageId=ami-12345
    +    brooklyn.location.named.company-jungle.minRam=2048
    +    brooklyn.location.named.company-jungle.userMetadata=application=my-jungle-app,owner="Bob Johnson"
    +
    + + + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/guide/defining-applications/example_files/tomcat_multi-location.java b/v/0.5.0-rc.2/use/guide/defining-applications/example_files/tomcat_multi-location.java new file mode 100644 index 000000000..70d404f99 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/defining-applications/example_files/tomcat_multi-location.java @@ -0,0 +1,15 @@ +// TODO Untested code; see brooklyn-example for better maintained examples! +public class TomcatFabricApp extends AbstractApplication { + @Override + public void init() { + addChild(EntitySpecs.spec(DynamicFabric.class) + .configure("displayName", "WebFabric") + .configure("displayNamePrefix", "") + .configure("displayNameSuffix", " web cluster") + .configure("memberSpec", EntitySpecs.spec(ControlledDynamicWebAppCluster.class) + .configure("initialSize", 2) + .configure("memberSpec", : EntitySpecs.spec(TomcatServer.class) + .configure("httpPort", "8080+") + .configure("war", "/path/to/booking-mvc.war")))); + } +} diff --git a/v/0.5.0-rc.2/use/guide/defining-applications/example_files/tomcat_nginx.java b/v/0.5.0-rc.2/use/guide/defining-applications/example_files/tomcat_nginx.java new file mode 100644 index 000000000..cf7651601 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/defining-applications/example_files/tomcat_nginx.java @@ -0,0 +1,17 @@ +// TODO Untested code; see brooklyn-example for better maintained examples! +public class TomcatClusterWithNginxApp extends AbstractApplication { + @Override + public void init() { + addChild(EntitySpecs.spec(NginxController.class) + .configure("domain", "brooklyn.geopaas.org") + .configure("port", "8000+") + .configure("portNumberSensor", Attributes.HTTP_PORT)); + + addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) + .configure("controller", nginxController) + .configure("memberSpec", : EntitySpecs.spec(TomcatServer.class) + .configure("httpPort", "8080+") + .configure("war", "/path/to/booking-mvc.war")) + .configure("initialSize", 2)); + } +} diff --git a/v/0.5.0-rc.2/use/guide/defining-applications/example_files/tomcat_simple.java b/v/0.5.0-rc.2/use/guide/defining-applications/example_files/tomcat_simple.java new file mode 100644 index 000000000..498545433 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/defining-applications/example_files/tomcat_simple.java @@ -0,0 +1,9 @@ +// TODO Untested code; see brooklyn-example for better maintained examples! +public class TomcatServerApp extends AbstractApplication { + @Override + public void init() { + addChild(EntitySpecs.spec(TomcatServer.class) + .configure("httpPort", "8080+") + .configure("war", "/path/to/booking-mvc.war"))); + } +} diff --git a/v/0.5.0-rc.2/use/guide/defining-applications/examples.html b/v/0.5.0-rc.2/use/guide/defining-applications/examples.html new file mode 100644 index 000000000..6bf601a5f --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/defining-applications/examples.html @@ -0,0 +1,880 @@ + + + + + Examples + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Examples

    + +

    TODO: this examples page is deprecated; +code is out-of-date, and better examples are described on the web site. +need to figure out if this page should be kept at all +(indeed if the "guide" is even still relevant)

    + +

    Integrating with a Maven project

    + +

    If you have a Maven-based project, integrate this XML fragment with your pom.xml:

    + + + + + + +
    <dependencies>
    +    <dependency>
    +        <groupId>io.brooklyn</groupId>
    +        <artifactId>brooklyn-all</artifactId>
    +        <version>0.6.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
    +    </dependency>
    +</dependencies>
    + 
    +<repository>
    +    <id>cloudsoft-releases</id>
    +    <url>http://developers.cloudsoftcorp.com/download/maven2/</url>
    +</repository>
    +<repository>
    +    <id>libs-snapshot-local</id>
    +    <url>http://ccweb.cloudsoftcorp.com/maven/libs-snapshot-local/</url>
    +    <snapshots>
    +        <enabled>true</enabled>
    +        <updatePolicy>never</updatePolicy>
    +        <checksumPolicy>fail</checksumPolicy>
    +    </snapshots>
    +</repository>
    +
    + + +

    Starting a Tomcat Server

    + +

    The code below starts a Tomcat server on the local machine.

    + +

    The main method defines the application, and passes it to the BrooklynLauncher to be managed. +It is then started in a localhost location (other locations are shown in the next section).

    + +

    The Tomcat's configuration indicates that the given WAR should be deployed to the Tomcat server when it is started.

    + +
    // TODO Untested code; see brooklyn-example for better maintained examples!
    +public class TomcatServerApp extends AbstractApplication {
    +    @Override
    +    public void init() {
    +        addChild(EntitySpecs.spec(TomcatServer.class)
    +                .configure("httpPort", "8080+")
    +                .configure("war", "/path/to/booking-mvc.war")));
    +    }
    +}
    +
    + + +

    The wars config is also supported (with config keys ROOT_WAR and NAMED_WARS the long-hand syntax); +they accept EARs and other common archives, and can be described as files or as URLs (as Strings), +with URLs supporting an optional classpath://org/acme/resources/xxx.war syntax.

    + +

    Starting Tomcat in Amazon EC2

    + +

    To start a tomcat node or cluster in Amazon EC2, the application is identical to that for localhost. +The only difference is the location supplied.

    + +

    The Brooklyn CLI can be used to launch the application in your choice of location, such as:

    + +
    brooklyn launch --app TomcatServerApp --location localhost
    +brooklyn launch --app TomcatServerApp --location aws-ec2:eu-west-1
    +
    + + +

    Starting a Tomcat Cluster with Nginx

    + +

    The code below starts a Tomcat cluster along with an Nginx instance, where each Tomcat server in the cluster is registered with the Nginx instance.

    + +
    // TODO Untested code; see brooklyn-example for better maintained examples!
    +public class TomcatClusterWithNginxApp extends AbstractApplication {
    +    @Override
    +    public void init() {
    +        addChild(EntitySpecs.spec(NginxController.class)
    +                .configure("domain", "brooklyn.geopaas.org")
    +                .configure("port", "8000+")
    +                .configure("portNumberSensor", Attributes.HTTP_PORT));
    +        
    +        addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class)
    +                .configure("controller", nginxController)
    +                .configure("memberSpec", : EntitySpecs.spec(TomcatServer.class)
    +                        .configure("httpPort", "8080+")
    +                        .configure("war", "/path/to/booking-mvc.war"))
    +                .configure("initialSize", 2));
    +    }
    +}
    +
    + + +

    This creates a cluster that of Tomcat servers, along with an Nginx instance. The NginxController instance +is notified whenever a member of the cluster joins or leaves; the entity is configured to look at the HTTP_PORT +attribute of that instance so that the Nginx configuration can be updated with the ip:port of the cluster member.

    + + + + +

    Starting a Multi-location Tomcat Fabric

    + + + + + + + + + +

    The ControlledDynamicWebAppCluster entity used above can also be used with a DynamicFabric to start +a web-cluster in each location.

    + +
    // TODO Untested code; see brooklyn-example for better maintained examples!
    +public class TomcatFabricApp extends AbstractApplication {
    +    @Override
    +    public void init() {
    +        addChild(EntitySpecs.spec(DynamicFabric.class)
    +                .configure("displayName", "WebFabric")
    +                .configure("displayNamePrefix", "")
    +                .configure("displayNameSuffix", " web cluster")
    +                .configure("memberSpec", EntitySpecs.spec(ControlledDynamicWebAppCluster.class)
    +                        .configure("initialSize", 2)
    +                        .configure("memberSpec", : EntitySpecs.spec(TomcatServer.class)
    +                                .configure("httpPort", "8080+")
    +                                .configure("war", "/path/to/booking-mvc.war"))));
    +    }
    +}
    +
    + + +

    Examples Source

    + +

    Source code for (more up-to-date!) examples is available for download from GitHub. To retrieve the source, execute the following command:

    + +
    git clone git@github.com:brooklyncentral/brooklyn-examples.git
    +
    + +

    You can also browse the code on the web.

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/guide/defining-applications/toc.json b/v/0.5.0-rc.2/use/guide/defining-applications/toc.json new file mode 100644 index 000000000..714af87cb --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/defining-applications/toc.json @@ -0,0 +1,7 @@ +[{ "title": "Basic Concepts", + "file": "{{ site.url }}/use/guide/defining-applications/basic-concepts.html" }, +{ "title": "Advanced Concepts", + "file": "{{ site.url }}/use/guide/defining-applications/advanced-concepts.html" }, +{ "title": "Common Usage", + "file": "{{ site.url }}/use/guide/defining-applications/common-usage.html" } +] diff --git a/v/0.5.0-rc.2/use/guide/entities/index.html b/v/0.5.0-rc.2/use/guide/entities/index.html new file mode 100644 index 000000000..aef3552da --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/entities/index.html @@ -0,0 +1,872 @@ + + + + + Custom Entity Development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Custom Entity Development

    + +

    This section details how to create new custom application components or groups as brooklyn entities.

    + +

    + +

    The Entity Lifecycle

    + +
      +
    • Importance of serialization, ref to How mananagement works
    • +
    • Parents and Membership (groups)
    • +
    + + +

    + +

    What to Extend -- Implementation Classes

    + +
      +
    • entity implementation class hierarchy

      + +
        +
      • SoftwareProcess as the main starting point for base entities (corresponding to software processes), +and subclasses such as VanillaJavaApp
      • +
      • DynamicCluster (multiple instances of the same entity in a location) and +DynamicFabric (clusters in multiple location) for automatically creating many instances, +supplied with an EntityFactory (e.g. BaseEntityFactory) in the factory flag
      • +
      • abstract Group for collecting entities which are parented elsewhere in the hierachy
      • +
      • AbstractEntity if nothing else fits
      • +
      +
    • +
    • traits (mixins, otherwise known as interfaces with statics) to define available config keys, sensors, and effectors; + and conveniences e.g. StartableMethods.{start,stop} is useful for entities which implement Startable

    • +
    • the Entities class provides some generic convenience methods; worth looking at it for any work you do

    • +
    + + +

    A common lifecycle pattern is that the start effector (see more on effectors below) is invoked, +often delegating either to a driver (for software processes) or children entities (for clusters etc).

    + +

    See JBoss7Server and MySqlNode for exemplars.

    + +

    + +

    Configuration

    + + + + +
      +
    • AttributeSensorAndConfigKey fields can be automatically converted for SoftwareProcess. +This is done in preStart(). This must be done manually if required for other entities, +often with ConfigToAttributes.apply(this).

    • +
    • Setting ports is a special challenge, and one which the AttributeSensorAndConfigKey is particularly helpful for, +cf PortAttributeSensorAndConfigKey (a subclass), +causing ports automatically get assigned from a range and compared with the target PortSupplied location.

      + +

      Syntax is as described in the PortRange interface. For example, "8080-8099,8800+" will try port 8080, try sequentially through 8099, then try from 8800 until all ports are exhausted.

      + +

      This is particularly useful on a contended machine (localhost!). Like ordinary configuration, the config is done by the user, and the actual port used is reported back as a sensor on the entity.

    • +
    + + +

    + +

    Implementing Sensors

    + +
      +
    • e.g. HTTP, JMX
    • +
    + + +

    Sensors at base entities are often retrieved by feeds which poll the entity's corresponding instance in the real world. +The SoftwareProcess provides a good example; by subclassing it and overriding the connectSensors() method +you could wire some example sensors using the following:

    + +
    public void connectSensors() {
    +    super.connectSensors()
    +    
    +    httpFeed = HttpFeed.builder()
    +            .entity(this)
    +            .period(200)
    +            .baseUri(mgmtUrl)
    +            .poll(new HttpPollConfig<Boolean>(SERVICE_UP)
    +                    .onSuccess(HttpValueFunctions.responseCodeEquals(200))
    +                    .onError(Functions.constant(false)))
    +            .poll(new HttpPollConfig<Integer>(REQUEST_COUNT)
    +                    .onSuccess(HttpValueFunctions.jsonContents("requestCount", Integer.class)))
    +            .build();
    +}
    +    
    +@Override
    +protected void disconnectSensors() {
    +    super.disconnectSensors();
    +    if (httpFeed != null) httpFeed.stop();
    +}
    +
    + + +

    In this example (a simplified version of JBoss7Server), the url returns metrics in JSON. +We report the entity as up if we get back an http response code of 200, or down if any other response code or exception. +We retrieve the request count from the response body, and convert it to an integer.

    + +

    Note the first line (super.connectSensors()); as one descends into specific convenience subclasses (such as for Java web-apps), the work done by the parent class's overridden methods may be relevant, and will want to be invoked or even added to a resulting list.

    + +

    For some sensors, and often at compound entities, the values are obtained by monitoring values of other sensors on the same (in the case of a rolling average) or different (in the case of the average of children nodes) entities. This is achieved by policies, described below.

    + +

    + +

    Implementing Effectors

    + +

    The Entity interface defines the sensors and effectors available. The entity class provides +wiring for the sensors, and the effector implementations. In simple cases it may be straightforward +to capture the behaviour of the effectors in a simple methods. +For example deploying a WAR to a cluster can be done as follows:

    + +

    This section is not complete. Feel free to fork the docs and lend a hand.

    + + + + +

    For some entities, specifically base entities, the implementation of effectors might need other tools (such as SSH), and may vary by location, so having a single implementation is not appropriate.

    + +

    The problem of multiple inheritance (e.g. SSH functionality and entity inheritance) and multiple implementations (e.g. SSH versus Windows) is handled in brooklyn using delegates called drivers.

    + +

    In the implementations of JavaWebApp entities, the behaviour which the entity always does is captured in the entity class (for example, breaking deployment of multiple WARs into atomic actions), whereas implementations which is specific to a particular entity and driver (e.g. using scp to copy the WARs to the right place and install them, which of course is different among appservers, or using an HTTP or JMX management API, again where details vary between appservers) is captured in a driver class.

    + +

    Routines which are convenient for specific drivers can then be inherited in the driver class hierarchy. For example, when passing JMX environment variables to Java over SSH, JavaSoftwareProcessSshDriver extends AbstractSoftwareProcessSshDriver and parents JBoss7SshDriver.

    + + + + +

    + +

    Testing

    + +
      +
    • Run in a mock SimulatedLocation, defining new metaclass methods to be able to start there and assert the correct behaviour when that is invoked
    • +
    + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/guide/entities/toc.json b/v/0.5.0-rc.2/use/guide/entities/toc.json new file mode 100644 index 000000000..c6c68dd4f --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/entities/toc.json @@ -0,0 +1,12 @@ +[{ "title": "Entity Lifecycle", + "file": "{{ site.url }}/use/guide/entities/index.html#entity-lifestyle" }, +{ "title": "What to Extend", + "file": "{{ site.url }}/use/guide/entities/index.html#implementation-classes" }, +{ "title": "Configuration", + "file": "{{ site.url }}/use/guide/entities/index.html#configuration" }, +{ "title": "Implementing Sensors", + "file": "{{ site.url }}/use/guide/entities/index.html#implementing-sensors" }, +{ "title": "Implementing Effectors", + "file": "{{ site.url }}/use/guide/entities/index.html#implementing-effectors" }, +{ "title": "Testing", + "file": "{{ site.url }}/use/guide/entities/index.html#testing" }] \ No newline at end of file diff --git a/v/0.5.0-rc.2/use/guide/extras/index.html b/v/0.5.0-rc.2/use/guide/extras/index.html new file mode 100644 index 000000000..591dc285c --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/extras/index.html @@ -0,0 +1,836 @@ + + + + + Systems Available Out-of-the-Box + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Systems Available Out-of-the-Box

    + +

    brooklyn comes bundled with support for a large number of systems and entities.

    + +

    In this pre-release version not all entities are fully functional and that the documentation is incomplete.

    + +

    Please contact the Brooklyn Project for assistance and clarification.

    + + + + +

    + +

    Web

    + +

    Clusters and Interfaces

    + +

    The class ControlledDynamicWebAppCluster creates a load-balanced cluster of web servers. +It defaults to Nginx and JBoss 7, but this is configurable with the controller and +either the factory or memberSpec configuration options.

    + +

    Most web app server processes, and some clusters and PaaS implementations, +support the interface WebAppService which defines many sensors including requests per second. +This allows app server metrics to interoperable across implementations in many cases.

    + +

    JBoss Application Server

    + +

    Brooklyn supports JBoss 7 in the calss JBoss7Server, with a wide range of +monitoring.

    + +

    JBoss 6 is also supported using the different class JBoss6Server. +(The different implementation is needed due to major differences between 6 and 7, +including switching from JMX to HTTP/JSON as the preferred metrics mechanism.)

    + +

    Apache Tomcat

    + +

    Apache Tomcat is supported in the class TomcatServer. +(Note that this currently uses a legacy Brooklyn class hierarchy, +and could benefit from being ported to the JavaSoftwareProcessSshDriver implementation.)

    + +

    Nginx Load Balancer

    + +

    Nginx provides clustering support for several web/app servers.

    + +

    The install process downloads the sources for both the service and the sticky session module, configures them using GNI +autoconf and compiles them. This requires gcc and autoconf to be installed. The install script also uses the yum package manager (if available) to install openssl-devel which is required to build the service. This will only work on RHEL or CentOS Linux systems, but the install process should proceed on a vanilla system with development tools available.

    + +

    On debian/ubuntu to build nginx you can get the required libraries with: +apt-get install zlib1g-dev libdigest-sha-perl libssl-dev. +(The entity install script will attempt to do this with sudo, +but that may fail if sudo access is not available.)

    + +

    + +

    Database

    + +

    MySQL

    + +

    MySQL is one of the most popular relational databases. +Brooklyn supports setting up individual MySQL nodes with arbitrary configuration, +which may be used to create multiple nodes using back-up and synchronization processes as desired. +(If certain patterns for configuring multiple nodes become popular, these could be +added as Brooklyn entities.)

    + +

    Apache Derby

    + +

    This entity is in the sandbox.

    + +

    Brooklyn supports Apache Derby, a pure-Java SQL database. For setting up an instance of a server see DerbySetup.

    + +

    + +

    NoSQL

    + +

    The NoSQL entities may not be complete.

    + +

    Redis

    + +

    Redis is a distributed key-value store, supporting master/slave replication of a store as a clustered cache. This gives +a series of read-only slaves and a single read-write master, which propagates to the slaves with eventual consistency.

    + +

    Infinispan

    + +

    Infinispan is a distributed in-memory datagrid.

    + +

    + +

    Messaging

    + +

    Qpid

    + +

    Qpid support provides a JMS broker, running over AMQP. This exposes JMS queues and topics as entities as well. +See QpidSetup for instantiating a broker.

    + +

    ActiveMQ

    + +

    ActiveMQ support provides a JMS broker. This exposes JMS queues and topics as entities as well. See ActiveMQSetup for +instantiating a broker.

    + +

    + +

    Provisioning

    + +

    Apache Whirr

    + +

    Whirr allows running a variety of services on cloud providers and on localhost. This is done by providing a recipe which describes what services to launch. You can find an example of how Brooklyn integrates with Whirr here.

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/guide/extras/toc.json b/v/0.5.0-rc.2/use/guide/extras/toc.json new file mode 100644 index 000000000..edf5cc7df --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/extras/toc.json @@ -0,0 +1,11 @@ +[{ "title": "Web", + "file": "{{ site.url }}/use/guide/extras/index.html#web" }, +{ "title": "Database", + "file": "{{ site.url }}/use/guide/extras/index.html#database" }, +{ "title": "NoSQL", + "file": "{{ site.url }}/use/guide/extras/index.html#nosql" }, +{ "title": "Messaging", + "file": "{{ site.url }}/use/guide/extras/index.html#messaging" }, +{ "title": "Provisioning", + "file": "{{ site.url }}/use/guide/extras/index.html#provisioning" } +] diff --git a/v/0.5.0-rc.2/use/guide/guide_toc.json b/v/0.5.0-rc.2/use/guide/guide_toc.json new file mode 100644 index 000000000..bbe4fa45f --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/guide_toc.json @@ -0,0 +1,25 @@ +[ +{ "title": "Start", + "file": "{{ site.url }}/start/index.html" }, + +{ "title": "User Guide", + "file": "{{ site.url }}/use/guide/index.html", + "children": {% readj ./toc.json %} }, +{ "title": "Elsewhere", + "file": "{{ site.url }}/start/index.html", + "children": [ + +{ "title": "Examples", + "file": "{{ site.url }}/use/examples/index.html", + "children": {% readj ../examples/toc.json %} }, +{ "title": "API Reference", + "file": "{{ site.url }}/use/api/index.html" }, + +{ "title": "Contributing", + "file": "{{ site.url }}/dev/code/index.html", + "children": {% readj /dev/toc.json %} }, +{ "title": "License", + "file": "{{ site.url }}/license/index.html" } +]} + +] diff --git a/v/0.5.0-rc.2/use/guide/index.html b/v/0.5.0-rc.2/use/guide/index.html new file mode 100644 index 000000000..447db7e37 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/index.html @@ -0,0 +1,850 @@ + + + + + User Guide + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    User Guide

    + +

    Table of Contents

    + + + + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/guide/management/index.html b/v/0.5.0-rc.2/use/guide/management/index.html new file mode 100644 index 000000000..11aaad4ca --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/management/index.html @@ -0,0 +1,1094 @@ + + + + + Runtime Management + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Runtime Management

    + +

    +brooklyn uses many of the ideas from autonomic computing to implement management of entities in a structured and reusable fashion (including provisioning, +healing, and optimising).

    + +

    Each external system, process or service is represented as an entity within brooklyn, with collections of these being represented and +managed by other entities, and so forth through a hierarchy rooted in entities referred to as "Applications". Each entity has:

    + +
      +
    • provisioning and tear-down logic for the external system(s) it represents
    • +
    • sensors which it publishes to report on its state and activity
    • +
    • effectors which can be invoked to change it
    • +
    • policies which perform analysis, enrichment (sensors), and execution (effectors). It is the policies in brooklyn which +perform the self-management (in autonomic terms) by monitoring sensors and invoking effectors.
    • +
    + + +

    There are several ways to launch applications with brooklyn, and useful configuration options, +as well as a debug-view web console. +This chapter describes these high-level runtime concepts, then proceeds to present more +detailed information on the underlying implementation of management within brooklyn.

    + +

    + +

    Startup Configuration

    + +

    brooklyn can read configuration from a variety of places:

    + +
      +
    • the file ~/.brooklyn/brooklyn.properties
    • +
    • -D defines on the brooklyn (java) command-line
    • +
    • shell environment variables
    • +
    + + +

    Default properties are described in the Javadoc and code of classes CredentialsFromEnv and BrooklynSystemProperties, +but some of the most common ones are:

    + +
    brooklyn.jclouds.aws-ec2.identity=AKA50M30N3S1DFR0MAW55
    +brooklyn.jclouds.aws-ec2.credential=aT0Ps3cr3tC0D3wh1chAW5w1llG1V3y0uTOus333
    +brooklyn.jclouds.private-key-file=~/my/id_rsa       # use specified key (default is ~/.ssh/id_rsa)
    +brooklyn.jclouds.public-key-file=~/my/id_rsa.pub    # (optional, inferred from previous if omitted)
    +
    + + +

    These can be specified as a shell environment variable or as a Java system property, +although in those contexts the conventional format BROOKLYN_JCLOUDS_AWS_EC2_IDENTITY +is supported and recommended.

    + +

    + +

    Command Line Interface

    + +

    Brooklyn comes with a Command Line Interface (cli) that makes it easier to launch an application.

    + +

    In order to have easy access to the cli it is useful to configure the PATH environment variable to also point to the cli's bin directory:

    + +
    BROOKLYN_HOME=/path/to/brooklyn/
    +export PATH=$PATH:$BROOKLYN_HOME/usage/dist/target/brooklyn-dist/bin/
    +
    + + +

    If you have set this up correctly you should be able to invoke the brooklyn command:

    + +
    brooklyn
    +
    + + +

    To get information about all the supported cli options just run:

    + +
    brooklyn help
    +usage: brooklyn [(-q | --quiet)] [(-v | --verbose)] <command> [<args>]
    +
    +The most commonly used brooklyn commands are:
    +    help     Display help information about brooklyn
    +    launch   Starts a brooklyn application. Note that a BROOKLYN_CLASSPATH environment variable needs to be set up beforehand to point to the user application classpath.
    +
    +See 'brooklyn help <command>' for more information on a specific command.
    +
    + + +

    Here is an example of the commands you might run to get the Brooklyn code, compile it and launch an application:

    + +
    git clone https://github.com/brooklyncentral/brooklyn.git
    +cd brooklyn
    +mvn clean install -DskipTests
    +BROOKLYN_HOME=$(pwd)
    +export PATH=${PATH}:${BROOKLYN_HOME}/usage/dist/target/brooklyn-dist/bin/
    +export BROOKLYN_CLASSPATH=${BROOKLYN_HOME}/examples/simple-web-cluster/target/classes
    +brooklyn launch --app brooklyn.demo.SingleWebServerExample --location localhost
    +
    + + +

    + +

    Management Web Console

    + +

    The web-based management console that comes with brooklyn serves as a way to observe and manage brooklyn entities. +It provides low-level details of activity (including stack-traces), sensor values, and policies, +and some visual widgets for observing what is happening. +This console is not designed as a management dashboard or portal -- +many good options exist in that space -- +but what could be useful is to embed widgets from the brooklyn portal for selected high-level views.

    + + + + +

    To start a management console from your own code, use BrooklynLaucher.launch:

    + +
    public static void main(String[] argv) {
    +    Application app = new MyApplicationExample(displayName:"myapp")
    +    BrooklynServerDetails server = BrooklynLauncher.newLauncher()
    +            .managing(app)
    +            .launch();
    +    // ...
    +}
    +
    + + +

    This will start an embedded brooklyn management node, including the web console. +The URL for the web console defaults to http://localhost:8081, +with credentials admin/password.

    + +

    The mechanism for launching brooklyn management will change in a future release. For this release, the brooklyn management node is embedded.

    + +

    The console contains two main views: Dashboard and Detail. These update in real-time.

    + +

    Dashboard

    + +

    The dashboard is a high level overview of the state of the application:

    + +

    Screenshot of the Webconsole Dashboard

    + +

    Detail

    + +

    The Detail view gives an in-depth view of the application and its entities. +Child-parent relationships between entities are navigable using the entity tree; +each entity is shown with its children (or, in the case of childless group entities, the members). +Selecting a specific entity allows you to access detailed information about that entity.

    + +

    Screenshot of the Webconsole Detail

    + +

    The Detail view contains a breadcrumb trail, showing the current entitiy's position in the heirarchy, and six tabs:

    + +

    Summary: Description of the selected entity.

    + +

    Sensors: Lists the attribute sensors that the entity has and their values.

    + +

    Effectors: Lists the effectors that can be invoked on the selected entity.

    + +

    Activity: Current and historic activity of the entity, currently running effectors, finished effectors.

    + +

    Location: The geographical location of the selected entity.

    + +

    Policies: Lists the policies associated with the current entity. Policies can be suspended, resumed and removed through the UI.

    + +

    Security

    + +

    Security providers can be configured by specifying brooklyn.webconsole.security.provider equal +to the name of a class implementing SecurityProvider. +An implementation of this could point to Spring, LDAP, OpenID or another identity management system.

    + +

    The default implementation, ExplicitUsersSecurityProvider, reads from a list of users and passwords +which should be specified as configuration parameters e.g. in brooklyn.properties. +This configuration could look like:

    + +
    brooklyn.webconsole.security.explicit.users=admin
    +brooklyn.webconsole.security.explicit.user.admin=password
    +
    + + +

    The users line should contain a comma-separated list. The special value * is accepted to permit all users. +If no values are specified at all the above setting (admin/password) is used by default.

    + +

    If not using the web console, you should specify +brooklyn.webconsole.security.provider=brooklyn.rest.security.provider.BlackholeSecurityProvider to prevent inadvertant logins. +During dev/test you can specify brooklyn.webconsole.security.provider=brooklyn.rest.security.provider.AnyoneSecurityProvider +to allow logins with no credentials.

    + +

    + +

    Other Ways to Observe Activity

    + +

    Java API

    + +

    ManagementContext provides a Java programmatic API.

    + +

    More information can be found in the javadoc for ManagementContext.

    + +

    Command-line Console

    + +

    Not available yet.

    + +

    Management REST API

    + +

    Brooklyn does not yet expose a REST API. This was to allow the APi to be designed to align with emerging standards.

    + +

    Selected management operations are possible remotely using links exposed by the GUI (after authenticating with the GUI).

    + +

    Logging

    + +

    Brooklyn uses the SLF4J logging facade, which allows use of many popular frameworks including java.util.logging, log4j, and logback.

    + +

    The convention for log levels is as follows: +* ERROR and above: exceptional situations which indicate that something has unexpectedly failed or +some other problem has occured which the user is expected to attend to +* WARN: exceptional situations which the user may which to know about but which do not necessarily indicate failure or require a response +* INFO: a synopsis of activity, but which should not generate large volumes of events nor overwhelm a human observer +* DEBUG and lower: detail of activity which is not normally of interest, but which might merit closer inspection under certain circumstances.

    + +

    Loggers follow the package.ClassName naming standard.

    + +

    It is possible for entities to emit logging activity sensors so that an operator can observe what is occurring within their application through the web console or via programmatic means.

    + +

    Examples for testing can be found in some of the poms.

    + + + + + + + + + +

    + +

    Key APIs

    + + + + +

    This section still needs to be written. Feel free to fork the docs and lend a hand.

    + +
      +
    • ManagementContext (Java management API)
    • +
    • EntityLocal (used by policies)
    • +
    + + + + + +

    + +

    Sensors and Effectors

    + +

    Sensors

    + +

    Sensors are typically defined as static named fields on the Entity subclass. These define the channels of events and activity that interested parties can track remotely. For example:

    + +
    /** a sensor for saying hi (illustrative), carrying a String value 
    +   which is typically the name of the person to whom we are saying hi */
    +public static final Sensor<String> HELLO_SENSOR = ...
    +
    + + +

    If the entity is local (e.g. to a policy) these can be looked up using get(Sensor). If it may be remote, you can subscribe to it through various APIs.

    + + + + +

    Sensors are used by operators and policies to monitor health and know when to invoke the effectors. The sensor data forms a nested map (i.e. JSON), which can be subscribed to through the ManagementContext.

    + +

    Often Policy instances will subscribe to sensor events on their associated entity or its children; these events might be an AttributeValueEvent – an attribute value being reported on change or periodically – or something transient such as LogMessage or a custom Event such as "TOO_HOT".

    + + + + +

    Sensor values form a map-of-maps. An example of some simple sensor information is shown below in JSON:

    + +
    {
    +  config : {
    +    url : "jdbc:mysql://ec2-50-17-19-65.compute-1.amazonaws.com:3306/mysql"
    +    status : "running"
    +  }
    +  workrate : {
    +    msgsPerSec : 432
    +  }
    +}
    +
    + +

    Sensor values are defined as statics, which can be used to programmatically drive the subscription.

    + + + + +

    SubscriptionManager

    + +

    This section is not complete. Feel free to fork the docs and lend a hand.

    + +

    See the SubscriptionManager class.

    + + + + +

    Effectors

    + +

    Like sensors and config info, effectors are also static fields on the Entity class. These describe actions available on the entity, similar to methods. Their implementation includes details of how to invoke them, typically this is done by calling a method on the entity. Effectors are typically defined as follows:

    + +
    /** an effector which returns no value,
    +   but which causes the entity to emit a HELLO sensor event */
    +public static Effector<Void> SAY_HI = ...
    +
    + + +

    Effectors are invoked by calling invoke(SAY_HI, name:"Bob") or similar. The method may take an entity if context is not clear, and it takes parameters as named parameters or a Map.

    + +

    Invocation returns a Task object (extending Future). This allows the caller to understand progress and errors on the task, as well as Task.get() the return value. Be aware that task.get() is a blocking function that will wait until a value is available before returning.

    + +

    The management framework ensures that execution occurs on the machine where the Entity is mastered, with progress, result, and/or any errors reported back to the caller. It does this through the ExecutionManager which, where necessary, creates proxy Task instances. The ExecutionManager associates Tasks with the corresponding Entity so that these can be tracked externally (and relocated if the Entity is remastered to a different location).

    + +

    It is worth noting that where a method corresponds to an effector, direct invocation of that method on an Entity will implicitly generate the Task object as though the effector had been invoked. For example, invoking Cluster.resize(int), where resize provides an Effector RESIZE, will generate a Task which can be observed remotely.

    + +

    ExecutionManager

    + +

    The ExecutionManager is responsible for tracking simultaneous executing tasks and associating these with given tags. +Arbitrary tasks can be run by calling Task submit(Runnable) (similarly to the standard Executor, although it also supports Callable arguments including Groovy closures, and can even be passed Task instances which have not been started). submit also accepts a few other named parameters, including description, which allow additional metadata to be kept on the Task. The main benefit then is to have rich metadata for executing tasks, which can be inspected through methods on the Task interface.

    + +

    By using the tag or tags named parameters on submit (or setting tags in a Task that is submitted), execution can be associated with various categories. This allows easy viewing can be examined by calling +ExecutionManager.getTasksWithTag(...).

    + +

    The following example uses Groovy, with time delays abused for readability. brooklyn's test cases check this using mutexes, which is recommended.

    + +
    ExecutionManager em = []
    +em.submit(tag:"a", description:"One Mississippi", { Thread.sleep(1000) })
    +em.submit(tags:["a","b"], description:"Two Mississippi", { Thread.sleep(1000) })
    +assert em.getTasksWithTag("a").size()==2
    +assert em.getTasksWithTag("a").every { Task t -> !t.isDone() }
    +Thread.sleep(1500)
    +assert em.getTasksWithTag("a").size()==2
    +assert em.getTasksWithTag("a").every { Task t -> t.isDone() }
    +
    + +

    It is possible to define ParallelTasks and SequentialTasks and to specify inter-task relationships with TaskPreprocessors. This allows building quite sophisticated workflows relatively easily.

    + +

    Continuing the example above, submitting a SequentialTasks or specifying em.setTaskPreprocessorForTag("a", SingleThreadedExecution.class) will cause Two Mississippi to run after One Mississippi completes.

    + +

    For more information consult the javadoc on these classes and associated tests.

    + +

    Note that it is currently necessary to prune dead tasks, either periodically or by the caller. By default they are kept around for reference. It is expected that an enhancement in a future release will allow pruning completed and failed tasks after a specified amount of time.

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/guide/management/toc.json b/v/0.5.0-rc.2/use/guide/management/toc.json new file mode 100644 index 000000000..f470c2d35 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/management/toc.json @@ -0,0 +1,18 @@ +[{ "title": "Introduction", + "file": "{{ site.url }}/use/guide/management/index.html#introduction" }, +{ "title": "Startup Configuration", + "file": "{{ site.url }}/use/guide/management/index.html#startup-config" }, +{ "title": "Command Line Interface", + "file": "{{ site.url }}/use/guide/management/index.html#cli" }, +{ "title": "Management Web Console", + "file": "{{ site.url }}/use/guide/management/index.html#console" }, +{ "title": "Observation APIs", + "file": "{{ site.url }}/use/guide/management/index.html#observation-other" }, +{ "title": "Distributed Management", + "file": "{{ site.url }}/use/guide/management/index.html#distributed-management" }, +{ "title": "Resilience", + "file": "{{ site.url }}/use/guide/management/index.html#resilience" }, +{ "title": "Key APIs", + "file": "{{ site.url }}/use/guide/management/index.html#key-apis" }, +{ "title": "Sensors and Effectors", + "file": "{{ site.url }}/use/guide/management/index.html#sensors-and-effectors" }] \ No newline at end of file diff --git a/v/0.5.0-rc.2/use/guide/management/webconsole-dashboard-w400.png b/v/0.5.0-rc.2/use/guide/management/webconsole-dashboard-w400.png new file mode 100644 index 000000000..6364dc5d5 Binary files /dev/null and b/v/0.5.0-rc.2/use/guide/management/webconsole-dashboard-w400.png differ diff --git a/v/0.5.0-rc.2/use/guide/management/webconsole-dashboard.png b/v/0.5.0-rc.2/use/guide/management/webconsole-dashboard.png new file mode 100644 index 000000000..cac5567ec Binary files /dev/null and b/v/0.5.0-rc.2/use/guide/management/webconsole-dashboard.png differ diff --git a/v/0.5.0-rc.2/use/guide/management/webconsole-detail-w400.png b/v/0.5.0-rc.2/use/guide/management/webconsole-detail-w400.png new file mode 100644 index 000000000..b372e5557 Binary files /dev/null and b/v/0.5.0-rc.2/use/guide/management/webconsole-detail-w400.png differ diff --git a/v/0.5.0-rc.2/use/guide/management/webconsole-detail.png b/v/0.5.0-rc.2/use/guide/management/webconsole-detail.png new file mode 100644 index 000000000..17829cdb3 Binary files /dev/null and b/v/0.5.0-rc.2/use/guide/management/webconsole-detail.png differ diff --git a/v/0.5.0-rc.2/use/guide/policies/index.html b/v/0.5.0-rc.2/use/guide/policies/index.html new file mode 100644 index 000000000..f683ca794 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/policies/index.html @@ -0,0 +1,864 @@ + + + + + Policies + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Policies

    + +

    + +

    Policies perform the active management enabled by Brooklyn.
    +They can subscribe to entity sensors and be triggered by them or they can run periodically.

    + + + + +

    Policies can add subscriptions to sensors on any entity. Normally a policy will subscribe to its related entity, to the child entities, and/or those entities which are members.

    + +

    When a policy runs it can:

    + +
      +
    • perform calculations,
    • +
    • look up other values,
    • +
    • invoke efectors (management policies) or,
    • +
    • cause the entity associated with the policy to emit sensor values (enricher policies).
    • +
    + + +

    Entities can have zero or more Policy instances attached to them.

    + +

    + +

    Writing Policies

    + +

    Sample Policy

    + + + + +

    This section is not complete. Feel free to fork the docs and lend a hand.

    + +

    Best Practice

    + +

    The following recommendations should be considered when designing policies:

    + +

    Management should take place as "low" as possible in the hierarchy

    + +
      +
    • place management responsibility in policies at the entity, as much as possible ideally management should take run as a policy on the relevant entity

    • +
    • place escalated management responsibility at the parent entity. Where this is impractical, perhaps because two aspects of an entity are best handled in two different places, ensure that the separation of responsibilities is documented and there is a group membership relationship between secondary/aspect managers.

    • +
    + + +

    Policies should be small and composable

    + + + + +

    e.g. one policy which takes a sensor and emits a different, enriched sensor, and a second policy which responds to the enriched sensor of the first (e.g. a policy detects a process is maxed out and emits a TOO_HOT sensor; a second policy responds to this by scaling up the VM where it is running, requesting more CPU)

    + +

    Where a policy cannot resolve a situation at an entity, the issue should be escalated to a manager with a compatible policy.

    + +

    Typically escalation will go to the entity parent, and then cascade up. +e.g. if the earlier VM CPU cannot be increased, the TOO_HOT event may go to the parent, a cluster entity, which attempts to balance. If the cluster cannot balance, then to another policy which attempts to scale out the cluster, and should the cluster be unable to scale, to a third policy which emits TOO_HOT for the cluster.

    + +

    Management escalation should be carefully designed so that policies are not incompatible

    + +

    Order policies carefully, and mark sensors as "handled" (or potentially "swallow" them locally), so that subsequent policies and parent entities do not take superfluous (or contradictory) corrective action.

    + +

    For this release, some of the mechanisms for implementing the above practices are still being developed.

    + +

    Implementation Classes

    + +

    This section is not complete. Feel free to fork the docs and lend a hand.

    + +
      +
    • extend AbstractPolicy, or override an existing policy
    • +
    + + +

    + +

    Off-the-Shelf Policies

    + +

    Policies are highly reusable as their inputs, thresholds and targets are customizable.

    + +

    Management Policies

    + +
      +
    • Resizer Policy

      + +

      Increases or decreases the size of a Resizable entity based on an aggregate sensor value, the current size of the entity, and customized high/low watermarks.

      + +

      A Resizer policy can take any sensor as a metric, have its watermarks tuned live, and target any resizable entity - be it an application server managing how many instances it handles, or a tier managing global capacity.

      + +

      e.g. if the average request per second across a cluster of Tomcat servers goes over the high watermark, it will resize the cluster to bring the average back to within the watermarks.

    • +
    + + + + + +

    Enricher Policies

    + +
      +
    • Delta

      + +

      Converts absolute sensor values into a delta.

    • +
    • Time-weighted Delta

      + +

      Converts absolute sensor values into a delta/second.

    • +
    • Rolling Mean

      + +

      Converts the last N sensor values into a mean.

    • +
    • Rolling Time-window Mean

      + +

      Converts the last N seconds of sensor values into a weighted mean.

    • +
    • Custom Aggregating

      + +

      Aggregates multiple sensor values (usually across a tier, esp. a cluster) and performs a supplied aggregation method to them to return an aggregate figure, e.g. sum, mean, median, etc.

    • +
    + + +

    + +

    Implementing Policies

    + + + + +

    This section is not yet complete. Feel free to fork the docs and lend a hand.

    + +

    Please see the class brooklyn.policy.Policy and implementations.

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/guide/policies/toc.json b/v/0.5.0-rc.2/use/guide/policies/toc.json new file mode 100644 index 000000000..7257dd702 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/policies/toc.json @@ -0,0 +1,8 @@ +[{ "title": "Introduction", + "file": "{{ site.url }}/use/guide/policies/index.html#introduction" }, +{ "title": "Writing Policies", + "file": "{{ site.url }}/use/guide/policies/index.html#writing-policies" }, +{ "title": "Off-the-Shelf Policies", + "file": "{{ site.url }}/use/guide/policies/index.html#off-the-shelf-policies" }, +{ "title": "Implementing Policies", + "file": "{{ site.url }}/use/guide/policies/index.html#implementing-policies" }] \ No newline at end of file diff --git a/v/0.5.0-rc.2/use/guide/quickstart/brooklyn.properties b/v/0.5.0-rc.2/use/guide/quickstart/brooklyn.properties new file mode 100644 index 000000000..9edaa1132 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/quickstart/brooklyn.properties @@ -0,0 +1,72 @@ +# This is Brooklyn's .properties file. +# It should be located at "~/.brooklyn/brooklyn.properties" +# A format guide is included at the bottom. + +# SSH key for localhost (btw, ~/.ssh/id_rsa is Brooklyn's default location.) +brooklyn.localhost.privateKeyFile = ~/.ssh/id_rsa +# Does your private key require a passphrase? +# brooklyn.localhost.privateKeyPassphrase = s3cr3tpassphrase + +## AWS EC2 Cloud Oregon +brooklyn.location.named.AWS\ EC2\ Oregon = jclouds:aws-ec2:us-west-2 +brooklyn.location.named.AWS\ EC2\ Oregon.identity = AK__________6A +brooklyn.location.named.AWS\ EC2\ Oregon.credential = O9_____________________________6A +brooklyn.location.named.AWS\ EC2\ Oregon.private-key-file = ~/.ssh/id_rsa +brooklyn.location.named.AWS\ EC2\ Oregon.public-key-file = ~/.ssh/id_rsa.pub +brooklyn.location.named.AWS\ EC2\ Oregon.userMetadata = application=my-oregon-app,owner="Awesome Brooklyn User" + +## Rackspace US - Debian (for Drupal) +brooklyn.location.named.Rackspace\ US\ -\ Debian = jclouds:cloudservers-us +brooklyn.location.named.Rackspace\ US\ -\ Debian.identity = username +brooklyn.location.named.Rackspace\ US\ -\ Debian.credential = 3d______________________cd +brooklyn.location.named.Rackspace\ US\ -\ Debian.private-key-file = ~/.ssh/id_rsa +brooklyn.location.named.Rackspace\ US\ -\ Debian.image-name-regex = Debian +# No Public Key!! Don't worry. Brooklyn will try ~/.ssh/id_rsa.pub + +## Rackspace UK +brooklyn.location.named.Rackspace\ UK = jclouds:cloudservers-uk +brooklyn.location.named.Rackspace\ UK.identity = username +brooklyn.location.named.Rackspace\ UK.credential = dc______________________43 +# No Keys! Brooklyn will try brooklyn.localhost.privateKeyFile + +# credentials for 'geoscaling' service +brooklyn.geoscaling.username = USERNAME +brooklyn.geoscaling.password = PASSWORD +brooklyn.geoscaling.primaryDomain = DOMAIN + + +## Production pool of machines for my application (deploy to named:prod1) +# brooklyn.location.named.prod1=byon:(hosts="10.9.1.1,10.9.1.2,produser2@10.9.2.{10,11,20-29}") +# brooklyn.location.named.prod1.user=produser1 +# brooklyn.location.named.prod1.privateKeyFile=~/.ssh/produser_id_rsa +# brooklyn.location.named.prod1.privateKeyPassphrase=s3cr3tpassphrase + + + +# Beware of trailing spaces on your cloud credentials. +# If you are receiving unexpected 401: unauthorized responses, check this first. + +### Formatting guide. + +! Both # and ! mark lines as comments +# The follow syntax are ALL valid. +# example_key example_value +# example_key : example_value +# example_key = example_value +# example_key=example_value + +# The backslash below tells Brooklyn to continue reading the value onto the next line. +# example_key = A very \ +# long string! +# Note all white space before 'long...' is ignored. Also '!' is kept as part of the string + + +# Keys with spaces should be escaped with backslashes. +# This is useful for named locations, as the name displayed in Brooklyn's web +# interface is derived from the key name. +# key\ with\ spaces = some\ value + +# Encoding for .properties must be ISO-8859-1, aka Latin-1. +# All non-latin1 characters must be entered using unicode escape characters +# polish_pangram = P\u00F3jd\u017A\u017Ce, ki\u0144 \ +# t\u0119 chmurno\u015B\u0107 w g\u0142\u0105b flaszy! diff --git a/v/0.5.0-rc.2/use/guide/quickstart/catalog.xml b/v/0.5.0-rc.2/use/guide/quickstart/catalog.xml new file mode 100644 index 000000000..c40a743b5 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/quickstart/catalog.xml @@ -0,0 +1,22 @@ + + Brooklyn Demos + + + + + + + + https://oss.sonatype.org/service/local/artifact/maven/redirect?r=releases&g=io.brooklyn.example&a=brooklyn-example-simple-web-cluster&v=0.6.0-SNAPSHOT&e=jar + https://oss.sonatype.org/service/local/artifact/maven/redirect?r=releases&g=io.brooklyn.example&a=brooklyn-example-global-web-fabric&v=0.6.0-SNAPSHOT&e=jar + + + + + diff --git a/v/0.5.0-rc.2/use/guide/quickstart/index.html b/v/0.5.0-rc.2/use/guide/quickstart/index.html new file mode 100644 index 000000000..ad5b9c620 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/quickstart/index.html @@ -0,0 +1,898 @@ + + + + + Getting Started + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Getting Started

    + + + + + + + + + + + +

    + +

    This guide will get you up and running with Brooklyn quickly. You will become familiar with launching Brooklyn from the command line, using the web interface and deploying an application (to a public cloud).

    + +

    Before We Start

    + +

    You are going to need some basic tools (that are normally installed by default). You will need curl, wget, tar, ssh and ssh-keygen.

    + +

    Download Brooklyn

    + +

    Download the Brooklyn distribution. This contains Brooklyn, ready to run.

    + +

    Save the Distro tgz file to your home directory ~/, or a location of your choice. (Other download options are available.)

    + +

    Expand the tar.gz archive. Each Distro is timestamped, so your filename will be different.

    + +
    $ tar -zxf brooklyn-dist--timestamp-dist.tar.gz
    +
    + +

    This will create a brooklyn- folder.

    + +

    Let's setup some paths for easy commands.

    + +
    $ cd brooklyn-
    +$ BROOKLYN_HOME=$(pwd)
    +$ export PATH=$PATH:$BROOKLYN_HOME/bin/
    +
    + +

    A Quick Test Drive

    + +

    Running Brooklyn now will launch the web interface, but there will be little to do, as we haven't configured any deployment locations or added a service catalog. Check your progress by running:

    + +
    $ brooklyn launch
    +
    + +

    Brooklyn will output the address of the management interface:

    + +

    ... Started Brooklyn console at http://127.0.0.1:8081/ (link)

    + +

    Login with default credentials: admin:password

    + +

    Stop Brooklyn with ctrl-c.

    + +

    Setting up Locations and Applications

    + +

    By default Brooklyn loads configuration parameters from ~/.brooklyn/brooklyn.properties and a service catalog from ~/.brooklyn/catalog.xml.

    + +

    Create a .brooklyn folder:

    + +
    $ mkdir ~/.brooklyn
    +
    + +

    Then download the following default/template files.

    + +

    brooklyn.properties

    + +

    Download the template brooklyn.properties (to ~/.brooklyn).

    + +

    brooklyn.properties is a standard java .properties file.

    + +

    Edit this file (in any text editor) to add credentials for your favorite cloud.

    + +

    catalog.xml

    + +

    Download the template catalog.xml (to ~/.brooklyn).

    + +

    catalog.xml is catalog of application or service blueprints. The example file contains two demos which will be automatically downloaded from the web if you run them.

    + +

    Edit this file (in any text editor) and check that the links to the demo applications' .jars are valid. At the time of writing these were for version 0.5.0-SNAPSHOT, but if this has changed you may need to update the links.

    + +

    SSH Key

    + +

    If this is a new machine, or you haven't used SSH before, you will need to create keys for Brooklyn to use. (Accept all default options, as this will setup password-less keys in the default location and Brooklyn will find them.)

    + +
    $ ssh-keygen -t rsa
    +
    + +

    It is advisable not to set a password for this key. If you are using an existing key that already has a password please add it to your brooklyn.properties file.

    + +

    3-2-1 Go!

    + +

    Now when we launch Brooklyn:

    + +
    $ brooklyn launch
    +
    + +

    Brooklyn will use the brooklyn.properties and catalog.xml files. There will be more locations available in the management interface at localhost:8081, and the blueprints from the service catalog will be available for deployment.

    + +

    Click "add application". The Create Application dialog will appear.

    + +

    Select the "Demo Web Cluster with DB", then "Next".

    + +

    For the time being we'll use "localhost" as our deployment location. Click "Finish" and the Create Application dialog will close.

    + +

    You will see Brooklyn create an Application with status "STARTING".

    + +

    It make take some time for Brooklyn to download everything and configure the application's initial topography, so lets have a look at the web interface while we wait.

    + +

    Exploring the Hierarchy of Web Cluster with DB

    + +

    Clicking on an application listed on the home page, or the Applications tab, will show you the management hierarchy.

    + +

    Exploring the hierarchy tree, you will see that the Demo Web Cluster with DB is a classic three tier web application, consisting of a ControlledDynamicWebAppCluster and a MySqlNode. The ControlledDynamicWebAppCluster contains an nginx software loadbalancer (NginxController) and as many JBoss7Servers as required (it autoscales).

    + +

    Clicking on the ControlledDynamicWebAppCluster and then the Sensor tab will show if the cluster is ready to serve and, when ready, will provide a web address for the front of the loadbalancer.

    + +

    If the service.isUp, you can view the demo web application in your browser at the webapp.url.

    + +

    Testing the Policies

    + +

    Brooklyn at its heart is a policy driven management plane. After codifying your technical and business policies, Brooklyn can implement them automatically.

    + +

    Brooklyn's policies work autonomically: they are like a nervous system. The need for action, and the correct action to take, are observed, decided and implemented as low down the management hierarchy (as close to the 'problem') as possible.

    + +

    The Web Cluster with DB demo comes pre-configured with an AutoScalerPolicy, attached to the cluster of JBoss7 servers and a targets policy attached to the loadbalancer. You can observe policies this in the management console using the Policy tab of the relevant entity (e.g. DynamicWebAppCluster shows the AutoScalerPolicy.

    + +

    The cluster autoscaler policy will automatically scale the cluster up or down to be the right size for the current load. ('One server' is the minimum size allowed by the policy.) +The loadbalancer will automatically be updated by the targets policy as the cluster size changes.

    + +

    Sitting idle, your cluster will only contain one server, but you can check that the policy works using a tool like jmeter pointed at the nginx endpoint to create load on the cluster.

    + +

    Brooklyn's policies are configurable, customizable, and can be completely bespoke to your needs. As an example, the AutoScalerPolicy is tunable, can be applied to any relevant metric (here, average requests per second), and is a sufficiently complex piece of math that it understand hysteresis and prevents thrashing.

    + +

    REST API Browser

    + +

    Click on the Script tab at the top of the web interface and select REST API. Brooklyn supports a REST, JSON and Java API to allow you to integrate it with (pretty much) anything.

    + +

    The Script tab allows you to explore the API.

    + +

    Try: Locations > GET:/v1/locations > Try it out!

    + +

    You will be presented with a json response of the currently configured locations.

    + +

    Stopping the Web Cluster with DB

    + +

    By now the Web Cluster with DB should have started, and you will have been able to view the application in your browser.

    + +

    Returning to the "Applications" tab, and selecting the WebClusterDatabaseExample's Effectors, we can Invoke the Stop Effector. This will cleanly shutdown the Web Cluster with DB example.

    + +

    Deploying to Cloud

    + +

    The user experience of using the service catalog to deploy an application to a cloud is exactly the same as deploying to localhost. Brooklyn transparently handles the differences between locations and environments.

    + +

    Return to the Create Application dialog, reselect the Web Cluster with DB Demo, and select your public cloud of choice.

    + +

    (If you have added credentials to your brooklyn.properties file,) Brooklyn will request VMs in the public cloud, provision the application components, and wire them together, returning a cloud IP from which the demo application will be available.

    + +

    Remember to invoke the stop method when you are finished.

    + +

    Closing Thoughts

    + +

    This guide has shown two aspects of Brooklyn in action: policy driven management capability, and the service catalog/web interface. Additionally, we briefly explored Brooklyn's API.

    + +

    It is worth noting that Brooklyn could be included as a library in your own applications (no command line required), or it could be used just as a management plane (without a service catalog).

    + +

    During this guide we have been using Brooklyn's web interface, but Brooklyn's APIs are extensive and powerful. Brooklyn can be used with (controlled by and make data available to) your existing management UI. Brooklyn is intended to complement (not replace) your existing technologies and tooling.

    + +

    Next

    + +

    The Elastic Web Cluster Example page details how to build the demo application from scratch. It shows how Brooklyn can complement your application with policy driven management, and how an application can be run without using the service catalog.

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/guide/toc.json b/v/0.5.0-rc.2/use/guide/toc.json new file mode 100644 index 000000000..8bdb955f7 --- /dev/null +++ b/v/0.5.0-rc.2/use/guide/toc.json @@ -0,0 +1,19 @@ +[ +{ "title": "Quick Start", + "file": "{{ site.url }}/use/guide/quickstart/index.html" }, +{ "title": "Defining Applications", + "file": "{{ site.url }}/use/guide/defining-applications/basic-concepts.html", + "children": {% readj ./defining-applications/toc.json %} }, +{ "title": "Management", + "file": "{{ site.url }}/use/guide/management/index.html" , + "children": {% readj ./management/toc.json %} }, +{ "title": "Policies", + "file": "{{ site.url }}/use/guide/policies/index.html", + "children": {% readj ./policies/toc.json %} }, +{ "title": "Custom Entities", + "file": "{{ site.url }}/use/guide/entities/index.html", + "children": {% readj ./entities/toc.json %} }, +{ "title": "Extras", + "file": "{{ site.url }}/use/guide/extras/index.html", + "children": {% readj ./extras/toc.json %} } +] \ No newline at end of file diff --git a/v/0.5.0-rc.2/use/index.html b/v/0.5.0-rc.2/use/index.html new file mode 100644 index 000000000..073092582 --- /dev/null +++ b/v/0.5.0-rc.2/use/index.html @@ -0,0 +1,832 @@ + + + + + Using Brooklyn + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Using Brooklyn

    + +

    To learn about Brooklyn, here are some recommended starting points:

    + + + + + + + +

    Beyond this, just come chat to us.

    + + +
    + + + +
    + + + +
    + + + diff --git a/v/0.5.0-rc.2/use/toc.json b/v/0.5.0-rc.2/use/toc.json new file mode 100644 index 000000000..1a5e3c963 --- /dev/null +++ b/v/0.5.0-rc.2/use/toc.json @@ -0,0 +1,12 @@ +[ +{ "title": "User Guide", + "file": "{{ site.url }}/use/guide/index.html", + "children": {% readj ./guide/toc.json %} }, +{ "title": "Examples", + "file": "{{ site.url }}/use/examples/index.html", + "children": {% readj ./examples/toc.json %} }, +{ "title": "API Reference (javadoc)", + "file": "{{ site.url }}/use/api/index.html" }, +{ "title": "Discuss", + "file": "{{ site.url }}/use/contact.html" } +]