Commit e4b7758f202f8ae8768f9b47490e0b4f2a87ce62
1 parent
be2bb3ab
add md
Showing
1 changed file
with
94 additions
and
0 deletions
README.md
0 → 100644
1 | +# DEEPCLIENT | ||
2 | + | ||
3 | +Is a simple javascript library that allows the connection with DEEP and the inclusion of a Datalet within a HTML page developed by the [UNISA TEAM](http://www.isislab.it/) | ||
4 | +for the [ROUTE-TO-PA PROJECT](http://www.routetopa.eu/). | ||
5 | + | ||
6 | + | ||
7 | +## Table of contents | ||
8 | + | ||
9 | +* [Quick start](#quick-start) | ||
10 | +* [Bugs and feature requests](#bugs-and-feature-requests) | ||
11 | +* [Usage](#usage) | ||
12 | +* [Versioning](#versioning) | ||
13 | +* [Creators](#creators) | ||
14 | +* [Copyright and license](#copyright-and-license) | ||
15 | + | ||
16 | + | ||
17 | +## Quick start | ||
18 | + | ||
19 | +Clone the repo: `git clone http://service.routetopa.eu:7480/isislab/DEEPCLIENT.git`. | ||
20 | + | ||
21 | +### What's included | ||
22 | + | ||
23 | +Within the download you'll find the following directories and files. You'll see something like this: | ||
24 | + | ||
25 | +``` | ||
26 | +DEEPCLIENT/ | ||
27 | +├── js/ | ||
28 | +│ ├── bootstrap-3.3.4-dist | ||
29 | +│ └── deepClient.js | ||
30 | +│ ├── jquery-1.11.2.min.js | ||
31 | +└── ├── jquery-2.1.0.min.js | ||
32 | +``` | ||
33 | + | ||
34 | +## Bugs and feature requests | ||
35 | + | ||
36 | +Have a bug or a feature request? | ||
37 | +Send a mail to developers@routetopa.eu | ||
38 | + | ||
39 | +## Usage | ||
40 | + | ||
41 | +This is a minimal example of deep client usage. | ||
42 | + | ||
43 | +<html> | ||
44 | +<head> | ||
45 | +<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script> | ||
46 | +<script type="text/javascript" src="js/webcomponents.js"></script> | ||
47 | +<script type="text/javascript" src="js/deepClient.js"></script> | ||
48 | + <script type="text/javascript"> | ||
49 | + jQuery(document).ready(function($) { | ||
50 | + var datalet_params = | ||
51 | + { | ||
52 | + component : "DATALET_NAME", | ||
53 | + params : { | ||
54 | + data-url : "DATA_URL", | ||
55 | + } | ||
56 | + fields : Array("FIELD1", "FIELD2"), | ||
57 | + placeHolder : "HTML_PLACEHOLDER" | ||
58 | +}; | ||
59 | + ComponentService.deep_url = 'DEEP_URL'; | ||
60 | + ComponentService.getComponent(datalet_params); | ||
61 | + | ||
62 | + }); | ||
63 | + | ||
64 | + </script> | ||
65 | +</head> | ||
66 | +<body> | ||
67 | +<div id="HTML_PLACEHOLDER"></div> | ||
68 | +</body> | ||
69 | +</html> | ||
70 | + | ||
71 | + | ||
72 | +We create an empty HTML document with a single DIV. On document ready event we create a datalet_params object, this object contains information for Datalet retrieving and initialization. | ||
73 | + | ||
74 | +datalet_params contains : | ||
75 | +component : the Datalet name to be sent to DEEP (Eg. datatable-datalet) | ||
76 | +params.data-url : the datasource URL (Eg.http://demo.ckan.org/api/action/datastore_search?resource_id=8324a4c9-66d6-47bf-a898-94237cc39b9f&limit=50) | ||
77 | +fields : an array with user selected fields from datasource (Eg. Array("Supplier", "Amount")) | ||
78 | +placeHolder : the ID of the DOM element where place the Datalet | ||
79 | + | ||
80 | +ComponentService.getComponent function take a datalet_params object as parameter. This function is responsible for Datalet info retrieving from DEPP and Datalet code retrieving from DEEPCOMPONENTS. Once the Datalet code is available DEEPCLIENT add the Datalet to the document DOM and initialize the Datalet with the data and fields parameters. | ||
81 | +Now the Datalet is able to complete its lifecycle. | ||
82 | + | ||
83 | +The programmer must specify the DEEP endpoint through the variable ComponentService.deep_url. | ||
84 | + | ||
85 | + | ||
86 | +## Versioning | ||
87 | +v0.1 | ||
88 | + | ||
89 | +## Creators | ||
90 | +UNISA Team - Dipartimento di Informatica - Università degli studi di Salerno - Italy | ||
91 | + | ||
92 | +## Copyright and license | ||
93 | + | ||
94 | +Code released under [the MIT license](https://opensource.org/licenses/MIT). | ||
0 | \ No newline at end of file | 95 | \ No newline at end of file |