Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

App-Card

Revision as of 23:17, 16 August 2010 by Unnamed Poltroon (Talk) (New page: ====Invoking Javascript==== The ABX browser extension is responsible for invoking the app/Javascript for all active. This is done three ways. If appJS is not nil, then its value IS the ap...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Invoking Javascript

The ABX browser extension is responsible for invoking the app/Javascript for all active. This is done three ways. If appJS is not nil, then its value IS the app to invoke. Since (as in the above example) the appJS is nil, then the appServiceType indicates whether a Kynetx-style KNS invocation should be done or an (as yet undefined) Azigo-style invocation from some Azigo-hosted web service should be done. In the above example the appServiceType = kynetx so a KNS invocation will be done.

App/rule Id parameter

In the non-appJS (i.e. kynetx and/or azigo cases) the appId is required to specify which app (Javascript program) should be run. In the above example the appId (called a rule id by KNS) is "1024".

Before the Javascript is invoked on a given Web page ABX must determine for each card if the current page is one that matches one or more card's site list. In the card example shown above the current page must be one of google.com, yahoo.com or bing.com.

Gather parameters to the Javascript

The ABX extension and supporting code must implement the following algorithm to gather all necessary parameters to the Javascript function:

  • Get the value of all attributes of the entity of the "appParams" attribute of the context object (ignoring rdfs:comment, rdf:label attributes, rdf:type, etc.). In the above example there is only one attribute (azigo-acard:dataset) with two values "aaawa" and "ebates".
  • Get the value of all attributes of the r-card's target entity that are named in the context object's acard:appEntityParam attribute value(s). In the above example since the context object's acard:appEntityParam value is the Attribute type URI "azigo-acard:favorite-song" then we would get the value of the "azigo-acard:favorite-song" attribute of Entity_1 ("Billy Joel: The Piano Man").

In the above example the gathered parameters are:

  1. azigo-acard:dataset = "aaawa", "ebates"
  2. azigo-acard:favorite-song = "Billy Joel: The Piano Man"

Making parameters/values available to the app (Javascript)

How parameters are inserted varies by service type. Here is how it is done for a "kynetx" serviceType:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, otj, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


var KOBJ_config ={
   "rids"  : ["1024","xyz123"],
   "1024:dataset" : "aaawa",
   "1024:dataset" : "ebates",
   "1024:favorite-song" : "Billy Joel: The Piano Man",
};

This tells kynetx to run rules 1024 and xyz123, and for rule 1024, use dataset=aaawa and dataset=ebates. Note that each appParam value is namespaced by the appId (aka rule id, or rid) to which it is associated.

Back to the top