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

Difference between revisions of "App-data vocabulary"

(Classes)
(JavaScriptApp (and subClasses) Attributes)
Line 35: Line 35:
 
An AppParams instance is the value of an AppData's <code>params</code> attribute. It is a set of attributes and values used to initialize the app. Note: these attribute/values are combined with those derived from the AppData's <code>entityParam</code>.
 
An AppParams instance is the value of an AppData's <code>params</code> attribute. It is a set of attributes and values used to initialize the app. Note: these attribute/values are combined with those derived from the AppData's <code>entityParam</code>.
  
== JavaScriptApp (and subClasses) Attributes ==
+
== JavaScript (and subClasses) Attributes ==
  
 
=== adminURL ===
 
=== adminURL ===
 
The URL of a admin page to load into PDS portal.
 
The URL of a admin page to load into PDS portal.
  
* domain: AppData
+
* domain: JavaScript
 
* value: xsd:anyURI
 
* value: xsd:anyURI
  
Line 47: Line 47:
 
Uniquely identifies the app within the "developerId" namespace. In other words the combination of the <code>devID</code> and the <code>appId</code> is globally unique. When using Kynetx KNS this is the ruleID with special constraint that this ruleID is globally unique.  
 
Uniquely identifies the app within the "developerId" namespace. In other words the combination of the <code>devID</code> and the <code>appId</code> is globally unique. When using Kynetx KNS this is the ruleID with special constraint that this ruleID is globally unique.  
  
* domain: AppData
+
* domain: JavaScript
 
* value: string
 
* value: string
  
Line 54: Line 54:
 
A human readable description of the app. Note: If appServer == http(s)://init.kobj.net, then the KNS "describe" API can be used by a context provider implementation to provide this attribute value.  
 
A human readable description of the app. Note: If appServer == http(s)://init.kobj.net, then the KNS "describe" API can be used by a context provider implementation to provide this attribute value.  
  
* domain: AppData
+
* domain: JavaScript
 
* value: string
 
* value: string
  
Line 61: Line 61:
 
The name of an attribute (e.g. <code>p:postal-code</code>) of a Person within a context associated with this App-data object. The value of this named attribute of the person is used as a parameter to the app-card's app.  
 
The name of an attribute (e.g. <code>p:postal-code</code>) of a Person within a context associated with this App-data object. The value of this named attribute of the person is used as a parameter to the app-card's app.  
  
* domain: AppData
+
* domain: Overlay
 
* value: URI
 
* value: URI
  
 
=== eventHandlerURL ===
 
=== eventHandlerURL ===
 
The URL of JS that provides specific handlers for certain events in a context’s lifecycle including: onImport, onDelete, onEnable, onDisable, onExport
 
The URL of JS that provides specific handlers for certain events in a context’s lifecycle including: onImport, onDelete, onEnable, onDisable, onExport
* domain: AppData
+
 
 +
* domain: JavaScript
 
* value: URI
 
* value: URI
  
=== homePage ===
 
URI of home page
 
* domain: RoboConnector
 
* value: owl:Thing
 
  
 
=== hbxFunctionsEnabled ===
 
=== hbxFunctionsEnabled ===
  
 
The list of HBX functions that the JS functions associated with this app-data are allowed to call.
 
The list of HBX functions that the JS functions associated with this app-data are allowed to call.
* domain: AppData
+
* domain: JavaScript
 
* value: string one of: {"delExAttrbutes" , "getExAttributes" , "getSuggestions" , "setExAttributes"}
 
* value: string one of: {"delExAttrbutes" , "getExAttributes" , "getSuggestions" , "setExAttributes"}
 
=== loginPath ===
 
Login form submit URI. Is relative to homepage URI
 
* domain: RoboConnector
 
* value: xsd:string
 
  
 
=== params ===
 
=== params ===
  
 
A set of attributes used to initialize the app.  
 
A set of attributes used to initialize the app.  
* domain: AppData
+
* domain: Overlay
 
* value: AppParams
 
* value: AppParams
 
=== profilePath ===
 
Profile edit form submit URI. Is relative to homepage URI
 
* domain: RoboConnector
 
* value: xsd:string
 
  
 
=== serviceURL  ===
 
=== serviceURL  ===
Line 105: Line 92:
  
 
If value is "kynetx" then the browser extension that will inject the Javascript for this app-card should construct a Kynetx-compatible &lt;script&gt; block and call an initialization URL based on the value of the <code>appService</code> attribute.  
 
If value is "kynetx" then the browser extension that will inject the Javascript for this app-card should construct a Kynetx-compatible &lt;script&gt; block and call an initialization URL based on the value of the <code>appService</code> attribute.  
* domain: AppData
+
* domain: JavaScript
 
* value: string whose value is one of ("kynetx", "higgins").
 
* value: string whose value is one of ("kynetx", "higgins").
  
Line 111: Line 98:
  
 
This is not a list of specific URIs, it is a list of strings to match in the domain name part of a URI. So urn:google would fire on maps.google.com, www.google.com, www.googleismyfavoritesite.com. For Kynetx-powered cards (i.e. if appServer = http[s]://init.kobj.net"), the values of this attribute should be dynamically fetched using the 'dispatch' method at URL: [http://init.kobj.net/js/dispatch/]&lt;appId&gt;.  
 
This is not a list of specific URIs, it is a list of strings to match in the domain name part of a URI. So urn:google would fire on maps.google.com, www.google.com, www.googleismyfavoritesite.com. For Kynetx-powered cards (i.e. if appServer = http[s]://init.kobj.net"), the values of this attribute should be dynamically fetched using the 'dispatch' method at URL: [http://init.kobj.net/js/dispatch/]&lt;appId&gt;.  
* domain: AppData
+
* domain: Overlay
 
* value: string
 
* value: string
  
Line 117: Line 104:
  
 
A human readable version of the app. Note: If appServer == http(s)://init.kobj.net, then the Kynetx KNS "describe" API can be used by a context Provider implementation to provide this attribute value.  
 
A human readable version of the app. Note: If appServer == http(s)://init.kobj.net, then the Kynetx KNS "describe" API can be used by a context Provider implementation to provide this attribute value.  
* domain: AppData
+
* domain: JavaScript
 
* value: string
 
* value: string
  

Revision as of 21:20, 14 August 2011

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

Vocabulary used by TemplateContext to describe JavaScript to be invoked by the browser extension either on the page the browser user is currently looking at, or in a background thread. Used by Template vocabulary. Part of the Persona Data Model 2.0

Files

UML Overview

App-data 2.0.104.png

Classes

JavaScriptApp

Description of a JavaScript application to be executed in the user's browser by the browser extension.

  • 1..1 description
  • 1..1 version
  • 1..1 eventHandlerURL
  • 1..1 adminURL
  • 1..1 serviceType
  • 1..1 serviceURL
  • 0..N hbxFunctionsEnabled

Overlay

JavaScript app that does web augmentation as an overlay to the current page the user is looking at in their browser.

  • subClassOf JavaScriptApp
  • 0..N sites
  • 0..1 params
  • 0..N entityParam

AppParams

An AppParams instance is the value of an AppData's params attribute. It is a set of attributes and values used to initialize the app. Note: these attribute/values are combined with those derived from the AppData's entityParam.

JavaScript (and subClasses) Attributes

adminURL

The URL of a admin page to load into PDS portal.

  • domain: JavaScript
  • value: xsd:anyURI

appId

Uniquely identifies the app within the "developerId" namespace. In other words the combination of the devID and the appId is globally unique. When using Kynetx KNS this is the ruleID with special constraint that this ruleID is globally unique.

  • domain: JavaScript
  • value: string

description

A human readable description of the app. Note: If appServer == http(s)://init.kobj.net, then the KNS "describe" API can be used by a context provider implementation to provide this attribute value.

  • domain: JavaScript
  • value: string

entityParam

The name of an attribute (e.g. p:postal-code) of a Person within a context associated with this App-data object. The value of this named attribute of the person is used as a parameter to the app-card's app.

  • domain: Overlay
  • value: URI

eventHandlerURL

The URL of JS that provides specific handlers for certain events in a context’s lifecycle including: onImport, onDelete, onEnable, onDisable, onExport

  • domain: JavaScript
  • value: URI


hbxFunctionsEnabled

The list of HBX functions that the JS functions associated with this app-data are allowed to call.

  • domain: JavaScript
  • value: string one of: {"delExAttrbutes" , "getExAttributes" , "getSuggestions" , "setExAttributes"}

params

A set of attributes used to initialize the app.

  • domain: Overlay
  • value: AppParams

serviceURL

The URL of the JS to fetch and execute.

  • domain: AppData
  • value: URI

serviceType

If value is "kynetx" then the browser extension that will inject the Javascript for this app-card should construct a Kynetx-compatible <script> block and call an initialization URL based on the value of the appService attribute.

  • domain: JavaScript
  • value: string whose value is one of ("kynetx", "higgins").

sites

This is not a list of specific URIs, it is a list of strings to match in the domain name part of a URI. So urn:google would fire on maps.google.com, www.google.com, www.googleismyfavoritesite.com. For Kynetx-powered cards (i.e. if appServer = http[s]://init.kobj.net"), the values of this attribute should be dynamically fetched using the 'dispatch' method at URL: [1]<appId>.

  • domain: Overlay
  • value: string

version

A human readable version of the app. Note: If appServer == http(s)://init.kobj.net, then the Kynetx KNS "describe" API can be used by a context Provider implementation to provide this attribute value.

  • domain: JavaScript
  • value: string

Related Person attributes

As we've mentioned, an AppData instance is the value of an appData attribute of a TemplateContext. For example we might have AppData1 as the value of appData on TemplateContext TC1. A context, C1, might be based on TC1. Within C1 usually exists a Person node. The following attribute are optional attributes of this Person node.

enabledSites

The URLs of sites that the user has enabled the app to run on. Note that this augments the appSites value provided by the app developer which indicates the set of sites the app was designed to run on.

  • value: boolean

disabledSites

The URLs of sites that the user has disabled the app from running on.

  • value: xsd:anyURI

appEnabled

If true run this app

  • value: xsd:anyURI

Example AppData

Example of a TemplateContext with an AppData object:

App-data-examplev8.png

Notes:

  1. Of particular interest is the app-card:params attribute whose value is the AppParams_1 object. The AppParams_1 in turn has two app initialization attributes, randomAttribute1 and 2.

Processing Model

Invoking Javascript

The Higgins browser extension is responsible for invoking the app/Javascript for all app-data contexts. 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) Higgins-style invocation from some Higgins-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 AppDataContext if the current page is one that matches one or more card's site list.

Gather parameters to the Javascript

The browser 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.).
  • Get the value of all attributes of the main p:Person entity that are named in the context object's entityParam attribute value(s).

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.

Links

Back to the top