Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Home en

Eko Yunianto edited this page Sep 25, 2013 · 4 revisions

IGN SDK API#

Content

  • About IGN SDK API
  • Structure IGN SDK API
  • IGN SDK Application Creator and Builder
  • How to use IGN SDK API
  • Function of IGN SDK API
  • State of IGN SDK API
  • IGN SDK Widget Config Parser

Tentang IGN SDK API

IGN SDK API is a collection of some command function that integrated on IGN operating system. This API has several facilities in order to access multiple systems and also other facilities. This API was created to simplify the creation of applications on IGN.

Structure of IGN SDK API

The structure of IGN SDK API is as follows: ign.name_of_function()

  • .ign use to call the facility of IGN SDK.
  • .name_of_function() is the name of function that provided of IGN SDK.

IGN SDK Application Creator and Builder

IGN SDK Application Creator

IGN SDK Application Creator is an API command on IGN are used to build an application or project from IGN SDK.

IGN SDK Format Application Builder use the following directions:

ignsdk-app-creator [OPTION]

Several options on IGN SDK Application Creator :

  • -p, --pkgname =[PACKAGE NAME]

Example :

ignsdk-app-creator -p control-panel

IGN SDK Application Builder

IGN SDK Application Builder is an API command on IGN are used for build an application from the application project package that has been created.

Format of IGN SDK Application Builder uses as below:

ignsdk-app-builder [OPTION] [PACKAGE NAME or PROJECT DIRECTORY]

Some options that IGN SDK Application Builder uses are :

  • -p, --pkgname is used to creating an packet of application project according to project name
  • -d, --dir is used to making a branch or project directory

Example :

$ignsdk-app-builder --pkgname control-panel

$ignsdk-app-builder --dir /home/igos/IGNSDK-APP/control-panel.ign

How to use IGN SDK API

IGN SDK API can be used on 2 condition, that is:

  • Placed on the line in the script, like this: <script>ign.name_of_function();</script>
  • Placed on the function in element <input class="btn btn-primary" type="submit" onclick="ign.name_of_function()">

Fungsi pada IGN SDK API

API Message

IGN API Message is an IGN SDK API that used to making an access a message box on IGN

  • .showMessage() is used to showing a message box. Format to using API like this ign.showMessage('content_of_message')

IGN API Developer Mode

IGN API Developer Mode is an API from IGN SDK that used to activating an inspection to show debugging mode on application of IGN SDK. This API can be used to look about wrong source code.

  • .setDev(true) is used to show additional debugging menu. Format to using API like this ign.setDev(true)

IGN API Signal

IGN API is the API of the IGN SDK that can be used to provide signal interruption in IGN SDK applications

  • .quit() is used to close from the application frame. Used like this ign.quit()
  • .back() is used to back to frame before application. Used like this ign.back()
  • .forward() is used to forward the frame to the destination application. Used like this ign.forward()
  • .reload() is used to activated right click to reload. Used like this ign.reload()
  • .stop() is used to stop a process. Used like this ign.stop()

API Window Function

API IGN Windows Function is an API from IGN SDK that can be used to manage desktop view of application.

  • .windowMaximized(bool) is used to make maximizing desktop. Used like this ign.windowsMaximized(bool)
  • .widgetSizeMax(width,height) is used to set a maximized custom desktop. Used like this ign.widgetSizeMax(300,100)
  • .widgetSizeMin(width,height) is used to set a minimized custom desktop. Used like this ign.widgetSizeMin(300,100)
  • .widgetSize(width,height) is used to set custom default desktop. Used like this ign.widgetSize(300,100)
  • .getFullScreen(bool) is used to get a fullscreen desktop. Uset like this ign.getFullScreen(bool)
  • .getToggleFullScreen() is used to get a fullscreen desktop with toggle. Used like this ign.getToggleFullScreen()
  • .showMaximized() is used to maximized desktop. Used like this ign.showMaximized()
  • .showMinimized() is used to minimized desktop. Used like this ign.showMinimized()

IGN API Sistem

IGN API Sistem is a API from IGN SDK that can used on application script to relationship with some system access functions.

  • .cliOut() is used to get output from system comment. Used like this ign.cliOut('perintah_sistem')
  • .loadBin(name_of_file) is used to execution of a binary file (give a return path from app.ign/bin/scriptbash). Used like this ign.loadBin("bashscript-example")
  • .exec(name_of_file) is used to execution a binary file from another resource. Used like this ign.exec(file_to_execution)

API IGN Security

API IGN Security is API from IGN SDK that used to activate some application configure.

  • .websecurity() is used to activate websecurity in javascript with taking into account the circumstances and this also can be used to allow or not cross domain XHR request. Used like this ign.websecurity(bool)

API File System

API File System is API from IGN SDK that used to access file system on application

  • .homePath() is used to get path form home (home path). Used like this ign.homePath()
  • .createFile() is used to create a file. Used like this ign.createFile()
  • .readFile() is used to read a file. Used like this ign.readFile()
  • .mkdir() is used to create a directory. Used like this ign.mkdir()
  • .dirExist() is used to check status of a directory. Used like this ign.dirExist()
  • .fileExist() is used to check status of a file. Used like this ign.fileExist()
  • .fileRemove() is used to remove a file. Used like this ign.fileRemove()
  • .rmdir() is used to remove a directory. Used like this ign.rmdir()

IGN API Network

IGN API Network is API from IGN SDK that used to manage communication with network.

  • .saveFile().download(url,path,id selector feedbask) is used to download a file from url. Used like this ign.download(url,ign.homePath()+"/dl","meter1")

IGN API Hash

IGN API Hash is API from IGN SDK that used to create a hashing with IGN SDK

  • .hash(string:md4,md5,sha1) is use to hashing a string. Support with md4, md5 and sha1. Used like this hash("string_yang_di_hash","md5")

IGN API Database

IGN API Database is API from IGN SDK that used to communicated and get an interaction with database management system.

  • .sql() used to call IGN SDK API sql. used like this ign.sql()
  • .driver("name_database","server_location:user_database:password:_password_database") is used to connect to database. used like this sql.driver (“mysql”, “localhost: root: password: ignsdk”)
  • .query ("query_that_you_need") is used to make query from database. used like this ign.query ("select * from participants")
  • console.log(query.status) is used to check database connection status. The output can be true or false. used like this console.log ($. parseJSON (sql.query (“select * from participants”)).status) or query can be split to new variable.
  • console.log (query.content); is used to show data record. used like this console.log ($. parseJSON (sql.query (“select * from participants”)).content) or query can be split to new variable.

Note how to use spesific database

  • set driver : sql.driver("sql_driver ex:sqlite2/sqlite3/mysql","connection")
  • connection :
mysql = "hostname:user:password:database";
sqlite2 or sqlite3 = "database file";

Example Of SQL Database uses

/ / call IGNSDK sql API
var sql = ign.sql();
/ / connect to database
var driver = sql.driver (“mysql”, “localhost: root: password: ignsdk”);
/ / query
var query = $. parseJSON (sql.query (“select * from participants”));
/ / check connection status
console.log (query.status); / / false or true
/ / get data record
console.log (query.content);
  • Example complete project can open on https://github.com/anak10thn/ignsdk-example/tree/master/mysql.ign

API Options

API Options is API from IGN SDK that used to running application that make from IGN SDK.

Generic Options

  • -p refers to accessing project in IGN SDK. Used like this $ ignsdk -p <project_location>. Example: $ ignsdk -p /usr/share/ign-sdk/test/widget.ign.
  • -f refers to make a custom main file on IGN SDK application that default is indek.html. Used like this $ ignsdk -p <project_location> -f <name_of_main_file>. Example $ ignsdk -p /usr/share/ign-sdk/test/widget.ign -f main.html.
  • -d or --dev refers to debugging function on IGN SDK Application. Debugging mode is used by right click and then select a choice inspect. Used like this $ ignsdk -p <project_location> -d. Example: $ ignsdk -p /usr/share/ign-sdk/test/widget.ign -d.
  • -v or --version refers to information about IGN SDK version. Example: $ ignsdk --v or $ ignsdk --version.

Window Options

  • -t or --transparent refers to make a transparent widget on IGN SDK. This API can be used if xcomgr or compiz activated. Used like this $ ignsdk -p <project_location> -t or $ ignsdk -p <project_location> --transparent. Example: $ ignsdk -p /usr/share/ign-sdk/test/widget.ign --transparent or $ ignsdk -p /usr/share/ign-sdk/test/widget.ign -t.
  • --noFrame refers to disable Frame widget IGN SDK. Used like this $ ignsdk -p <lokasi_project> -noFrame. Example: $ ignsdk -p /usr/share/ign-sdk/test/widget.ign --noFrame.

Status IGN SDK API

  • python di IGNSDK (FIX)
  • cliOut() or spwan (FIX)
  • exec() (FIX)
  • transparant widget (FIX)
  • widget config parser (FIX)
  • none frame option (Experiment)
  • toggle fullscreen() mode (FIX)
  • json parser (Experiment)
  • Sqlite (FIX)
  • web storage HTML5 (FIX)
  • geolocation (Experiment)
  • Application creator (on progress)
  • Aplication builder
  • Template (experiment)
  • Check network connection (experiment code)
  • SQL Driver (FIX)

IGN SDK Widget Config Parser

IGN SDK Widget Config Parser can be found on ignsdk.json file on project directory of IGN SDK Application. false for disable function and true to enable function.

Example :

{
"config" : { 
              "debug" : true , 
              "websecurity" : true, 
              "name" : "tes ign config"  
              },
"window" : { 
              "transparent" : true, 
              "maximize" : true,
              "noframe" : false, 
              "fullscreen" : false,
              "width" : 200,
              "height" : 100
              },
"button" : [
              "back",
              "forward",
              "stop",
              "reload"
	       ]
}

Note:

  • "config" : { "debug" : true } refers to run debugging mode.
  • "config" : {"websecurity" : true } refers to activated websecurity in javascript and can be used to setting XHR request cross domain
  • "config" : {"name" : "tes ign config"} refers to change default name of window manifest. On this statement name of manifest will be change from ignsdk to be "tes ign config".
  • "window" : { "transparent":true, "noframe":false, "fullscreen":false "width":200, "height":100} refers to widget configuration. Some configuration are transparent mode, noFrame mode and fulscreen mode and make a manual size of desktop.
  • "button" : { "back", "forward", "stop", "reload" } refers to custom button on IGN SDK Application.