Component View
Folder Structure
<To be done>
Database Schema
Content
Code Block |
---|
|
{
document: {
"_id": "string", // content id
"previewUrl": "string",
"keywords": "string[]",
"subject": "string",
"channel": "string",
"downloadUrl": "string",
... // Complete content metadata
},
index: {
["contentType", "board", "gradeLevel", "subject", "class", "keywords"]
}
} |
Telemetry
Each telemetry event is stored as one document on telemetry database there will be no change in the event object.
View Example
Code Block |
---|
language | js |
---|
title | configurationview |
---|
|
{ "name": "content",
"typeview": { "stringname_description",: //
framework, channel, form, resource bundle { "_idmap": "string",
"data": "object"function(doc) { emit([doc.name, doc.description], doc._id); } }
}
} |
Configuration
Code Block |
---|
language | powershell |
---|
title | App config |
---|
|
PORT=9000
API_BASE_URL="https://sunbird.org/api"
CHANNEL=sunbird
COUCHDB_URL=http://admin:password@127.0.0.1:5984
TELEMETRY_SYNC_URL=data/v1/telemetry
TELEMETRY_SYNC_INTERVAL=10
DEVICE_REGISTRY_URL=/api/api-manager/v1/consumer/mobile_device/credential/registerINTERVAL_IN_SECS=30
APP_ID=prod.sunbirded-plugin.desktop |
Data Setup
Code Block |
---|
<plugin-dir>
---------/data
--------------/organizations.json
--------------/frameworks.json
--------------/resourceBundles.json
--------------/forms.json
--------------/pages.json |
Import/Export
...
Code Block |
---|
language | powershell |
---|
title | Plugin config |
---|
|
DATA_PATH=<path to data>
|
Data Setup
Download
|
// The method gets the ecar as buffer and stores in /ecars folder
import = function(File file){};
export = function(Object config) : File {};
ExportConfig = {
fileName: String, // Name of the file to be created
contents: [{
type: String, // Type of the content. One of Content/Telemetry/Log/Profile
identifier?: [String] // id's of the type to be exported. For ex: list of content ids, profile, telemetry packet id etc. If left blank all data is exported
}]
} |
Package Specification
Packaging schema is only defined for content which is "ecar". There is no export packaging specification defined for any other type of data. Hence we are proposing to define a new package format that is interoperable with any type of application.
Code Block |
---|
.ar package specification
exported_file.ar
/manifest.json // The manifest of the exported archive
/<files> // Any number of files that are exported. Should be a zip file or flat file
Manifest = {
name: String, // file name
dtCreated: Date, // Date when the file is created
source: String, // Source did from where the file is exported
size: Number, // size of the package
files: Number, // Total number of exported files
contents: [{
file: String, // relative path to file name
type: String, // Type of the file. Content/Telemetry/Log/Profile
mimeType: String, // gzip, txt
contentType: String, // ecar, json
}]
} |