An interesting project proposal using Wireit

31 views
Skip to first unread message

鑫 安

unread,
Jun 18, 2009, 1:18:20 PM6/18/09
to WireIt
Hi,

I'm currectly doing a project in workflow analysis. I found Wireit is
quite useful for visualizing workflows. There, I have a simple plan
and also some questions, can anyone give me some suggestions or ideas
for each proposal step.

1. I have a set of workflow files written in xml formate, I'm going to
tanslate them into JSON format using XSLT or Xsugar (any suggestions?)
2. Use a WireitEditor to load the workflow (is workflow stored as a
JSON file?)
3. If I load two workflows in one page, is that possible to make them
interactable with each other using kinds of javascript language or
library? (e.g. click on one container in workflow A, then highlight
the container which has the same id or name as the previous container
in workflow B)
4. If there is no database needed, all files are loaded from the local
folder, how do I edit the backend program.

Appreciate for your help!!

neyric

unread,
Jun 25, 2009, 8:18:28 PM6/25/09
to WireIt
Hi,

1 & 2. You could also customize the backend (in the backend/php
folder) to parse the JSON and save it to XML, then feed the editor
with JSON from your XML data

LeifW added to his branch a prototype of a XProc editor using the
WiringEditor.
http://github.com/LeifW/wireit/tree/master
I think the last needed step to produce a runnable XProc workflow is
to convert the JSON to the XProc format...

(He uses XSLT to convert the XProc XML definition to the WiringEditor
JSON definition)

3. You'll have to customize the WiringEditor for that.
Javascript will be heavily required. Javascript and notions of the
WireIt and YUI library will be required...

4. A database is needed for the WiringEditor

Leif Warner

unread,
Jul 13, 2009, 3:56:21 AM7/13/09
to WireIt
1.
I wrote some XSLT to translate the W3C definitition of XProc (
http://www.w3.org/TR/xproc/langspec.xml ) into the JSON language
format the WiringEditor can load.
You can see it up at http://github.com/LeifW/pipescape/, I've called
it "Steps2Wires.xsl" (or a running example at http://feedscape.appspot.com
).
Though this is special purpose just for this task. For general XML -
> JSON conversion, there's stuff like this JsonML XSLT stylesheet:
http://jsonml.org/XML/
And there oughtta be XML->JSON stuff in the Javascript libraries...

2. (kinda)
That part was just the language definition. I still want to write
something that'll convert arbitrary workflow files (XProc programs
written in XML) into JSON for the Wiring Editor to load. Most likely
I'll use XSLT again. If you don't want to involve the server, the
browser is perfectly capable of running XSLT; perhaps using something
like http://johannburkard.de/software/xsltjs/

-Leif

Eric Abouaf

unread,
Jul 13, 2009, 6:23:28 AM7/13/09
to wir...@googlegroups.com
Hi,

I pushed my latest modifications to the trunk. The WiringEditor don't use SMD and YUI-RPC anymore.

Instead, you might create an "adapter" object and pass it as the  "adapter" option to the WiringEditor.
An WiringEditor adapter is a javascript object that must contain 3 methods called:
   saveWiring, deleteWiring, and listWirings.

Here is how the default adapter looks like:

/**
 * JsonRpc Adapter (using ajax)
 * @static
 */
WireIt.WiringEditor.adapters.JsonRpc = {
   
    saveWiring: function(val, callbacks) {
        this._sendJsonRpcRequest("saveWiring", val, callbacks);
    },
   
    deleteWiring: function(val, callbacks) {
        this._sendJsonRpcRequest("deleteWiring", val, callbacks);
    },
   
    listWirings: function(val, callbacks) {
        this._sendJsonRpcRequest("listWirings", val, callbacks);
    },
   
    // private method to send a json-rpc request using ajax
    _sendJsonRpcRequest: function(method, value, callbacks) {
        var postData = YAHOO.lang.JSON.stringify({"id":(this._requestId++),"method":method,"params":value,"version":"json-rpc-2.0"});

        YAHOO.util.Connect.asyncRequest('POST', '../../backend/php/WiringEditor.php', {
            success: function(o) {
                var s = o.responseText,
                     r = YAHOO.lang.JSON.parse(s);
                 callbacks.success.call(callbacks.scope, r);
            },
            failure: function() {
                callbacks.failure.call(callbacks.scope, r);
            }
        },postData);
    },
    _requestId: 1
};
--
Eric Abouaf
eric....@gmail.com
Tél: 06 29 86 37 89
Reply all
Reply to author
Forward
0 new messages