Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "App-Card"

(Making parameters/values available to the app (Javascript))
Line 40: Line 40:
  
 
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.
 
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.
 +
 +
[[Category:Higgins 2]]

Revision as of 17:22, 25 April 2011

{{#eclipseproject:technology.higgins|eclipse_custom_style.css}}
Higgins logo 76Wx100H.jpg

An app-card is a special kind of R-Card that is associated with a Javascript program that is run within a browser. See the Persona Data Model 2.0 for a description of the internal structure of an app-card.

Example App-Card

Appcard.png

Processing Model

Invoking Javascript

The browser extension is responsible for invoking the app/Javascript for all active app-cards. This is done three ways. If appJS is not nil, then its value IS the app to invoke. If 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 HBX 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:

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