This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.urlMap = function(map, nextApp){ | |
| return function(request){ | |
| for (var i = 0; i<map.length; i++){ | |
| var match = map[i][0]; | |
| var ctor = map[i][1]; | |
| var returnRequest = map[i][2]; | |
| if (request.pathInfo.match(match)){ | |
| print("found match:", match); | |
| var res = ctor(request, match); | |
| if (res && returnRequest) return res; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var session = new Session({url: "http://192.168.5.16:4444/wd/hub"}) | |
| var capabilities = session.startSession({browserName: "internet explorer"}); | |
| var url = "http://google.com"; | |
| when(capabilities,function(capabilities){ | |
| print("Connected to Session"); | |
| print("sessionId: " + capabilities.sessionId); | |
| print("Session Props: " + json.stringify(capabilities)); | |
| pshallow(capabilities); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // check to see if this loaded module already exists. Returns a deferred that will already be resolved or | |
| // or will resolve with an addOnLoad after the require | |
| var dynrequire = function(names){ | |
| var def = new dojo.Deferred(); | |
| var loading=false; | |
| dojo.forEach(names, function(n){ | |
| if (!dojo._loadedModules[n]){ | |
| dojo.require(n); | |
| loading=true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var getChildren = function(model, item){ | |
| children = []; | |
| if (model.mayHaveChildren(item){ | |
| var ch = model.getChildren(item); | |
| dojo.forEach(ch, function(child){ | |
| children.push(child) | |
| children = children.concat(getChildren(model, child)); | |
| }); | |
| } | |
| return children; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #content { | |
| border: 3px solid gray; | |
| height: 300px; | |
| width: 150px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <profile> | |
| <id>docs</id> | |
| <build> | |
| <plugins> | |
| <plugin> | |
| <groupId>org.codehaus.mojo</groupId> | |
| <artifactId>exec-maven-plugin</artifactId> | |
| <version>1.2</version> | |
| <executions> | |
| <execution> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Here are some examples for an idea i had for the depth resolution of items in persevere using rql. | |
| On the clientside, we could translate these functions into a resolve property of the store.get()'s option | |
| parameter (store.get("something", {resolve:[1]}) for example). It would be nice if on the client side we | |
| could decide upon a way to resolve references that will be consistent across implementations, but I'm | |
| still thinking about it. In the mean time, here is the resolve() idea. | |
| Resolutions - These RQL expressions resolve any links contained in an object to the depth identified | |
| by the first parameter. Subsequent parameters are array of properties that should be the | |
| only properties that get resolved at a particular level. ?resolve(depth,depth1list,depth2list,depth3list,...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define("dojo/store/MultiRest", ["dojo","dojo/store/JsonRest","dojo/store/Cache", "dojo/store/Memory"], function(dojo) { | |
| var MultiRest=function(options){ | |
| // summary: | |
| // MultiRest store is provided with a targetUrl and schemaUrl to allow multiple JsonRest stores/data | |
| // types to be treated as a single dojo.store and to manage json-schema relationships. Requests to | |
| // standard api calls (get,query,put,delete,etc) require a schema or schemaId to be passed in the | |
| // directives to know how to interpret the items / requests. Requests can also include a resolve | |
| // array to tell a get() or query() request to recursively retrieve and add in related objects | |
| // available on the schema.links and requested in the resolve array. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return dojo.when(app.persevere.getStore("Project"), | |
| function(store){ | |
| return dojo.when(store.get(data,{resolve: [["triggers"],["destination"],["jobs"]]}), | |
| function(data){ | |
| var triggers=[]; | |
| var queues=[]; | |
| var activity=[]; | |
| if(!data|| !data.triggers){ | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "properties": { | |
| "state": { | |
| "type": "string", | |
| "indexed": true | |
| }, | |
| "description": { | |
| "type": "string", | |
| "optional": true | |
| }, |