SlideShare a Scribd company logo
Feature SDK / APIPresentation By:Kumar Pratikpratikk@langoor.net
Overview: Feature DevelopmentWhat a developer should know before coding?How widgets work on editor?How to create your own feature?Creating your first feature ( Hello World! )Adding components (widget) to your featureSDK / API – Quick OverviewResponse from feature/widgets to editor & websiteForm Html Code framework functionsInstallsetPropertygetPropertyhasPropertyZend DB API
What should you know before coding?HTML & CSSJavaScript (Jqueryframework)PHP 5.3MySQL ZendDB
Youtube widget
Creating your first feature (hello world)
Feature DatabaseEvery feature has its own databaseWhen a feature is installed on a domain, it creates a new database (copying from the feature master database)Developer can access the database using phpMyAdminA feature can have multiple widgets in it, and all the widgets will use the same database for accessing its data.
Feature Database Access database using phpMyAdmin
Feature Database Access database using phpMyAdmin
Extend sdk
Extend sdk
Extend sdk
// feature.php  - Feature Main Installer Class// Class pratikHelloWorld extends baseFeature {	private $key = ‘d21a868268f8a43b268ee4937a1d8161';var $db;var $instance_id;	public function __construct($db, $instance_id = -1){		$this->db = $db;		$this->instance_id = $instance_id;	}	public function setInstanceId($instance_id){		$this->instance_id = $instance_id;	}	public function install($data = array()){    if(LFeature::setupComplete($this->key,$this->instance_id)){$response['done'] = 1;		$response['action'] = "openWidgetPopup";		$response['new_widgets'] = LWidget::getWidgetIdsByFeatureKey($this->key);	    }else{	          	throw new Exception('Unable to Complete setup');	    }	return $response;	}//---------------- Developer Code ----------------// }
// pratikHelloWorldView/widget.php  - Feature Main Installer Class// Class pratikHelloWorldView extends baseWidget {//---------------- Developer Code ----------------var $id;public function __construct($id, $params=array(), $db){	$this->db = $db;	$this->id = $id;}public function getId()		{	return $this->id;	}public function hasProperty()	{	return 0; 		}public function delete()		{			}private function get()		{			}public function getData()		{			}public static function install($params = array()){	$response['done'] =  1;	$response['widget_instance_id'] = -1;	return $response;}		  public functiongetHtml($extra_class=array(),$extra_in_line_style=''){    $html = '<div style="width:100%; padding-bottom:10px;">';    $html .= "Hello world!";    $html .= '</div>';    return $html;}public functiongetEditorHtml($extra_class=array(),$extra_in_line_style=''){	return $this->getHtml($extra_class,$extra_in_line_style);}// }
Extend sdk
Extend sdk
Extend sdk
Extend sdk
SDK / API -  Response formatcreating a form response (install/getProperty function)$response = array();$response['done'] = 0;$response['action'] = "openDialog";$response['dialogContent'] = array(								"title"=>'User Comment Widget',							"contentType"=>'form',						"formaction"=>'install',						"content" => array(							  "fields" => array(								array(								     "label" => 'Name',							     "name" => 'name',							     "value" => '',							    "inputType" => 'input',						    "class" => 'required' // jQuery Validators												 )																)					),								"buttonLabel"=>"Install",						"type" => "centered“);
SDK / API -  Responsecreating a html response (install/getProperty function)$response = array();$response['done'] = 0;$response['action'] = "openDialog";$response['dialogContent'] = array(								"title"=>'User Comment Widget',						"contentType"=>‘html',							"content" => “<h2>html content</h2><br /> This is a test content”,			"buttonLabel"=>"Install",						"type" => "centered“	);
SDK / API -  Responsefor opening widget panel (install/getProperty function)$response = array();$response['done'] =  1;$response['step'] = ++$step;$response['widget_instance_id'] = $this->db->lastInsertId();
SDK / API  -  Responsecreating a html response with form (install/getProperty function)$html = “<h2>html content</h2><br /> This is a test content <form action=“addcomment”><table>	<tr>	<td>Name</td>		<td><input type = “text” name=“name”></td>	</tr><tr>		<td>Age</td>		<td><input type = “text” name=“age” class=“requirednumber”></td>	</tr></table></form>“;$response = array();$response['done'] = 0;$response['action'] = "openDialog";$response['dialogContent'] = array(								"title"=>'User Comment Widget',						"contentType"=>‘html',							"content“ => $html,		"buttonLabel"=>“Add Entry",							"type" => "centered“	);
Creating a form handler for widget// widget.phpPublic function addcomment($params){	$params= $params[0];	$name = $params['name'];	$age= $params[‘age'];	$sql = "insert into `l_w_pratikHelloWorld_entry` (`name`, `age`) values (?,?)";$res = $this->db->query($sql,array($name,$age));	return true;}
Zend DB Sample Query$stmt = $db->query(            'SELECT * FROM bugs WHERE reported_by = ? AND bug_status = ?',            array('goofy', 'FIXED')        );$stmt = $db->query('SELECT * FROM bugs'); while ($row = $stmt->fetch()) {    echo $row['bug_description'];}$stmt = $db->query('SELECT * FROM bugs'); $rows = $stmt->fetchAll(); echo $rows[0]['bug_description'];
Thank you!Kumar  Pratikpratikk@langoor.net

More Related Content

PDF
Turbocharge your API strategy with SDK
PPT
APIs And SDKs Breaking Into And Succeeding In A Specialty Market
PDF
Introduction to Apigility
PPTX
Apigility & Restfull APIs
PDF
Apigility introduction v2 (glasgow php)
PDF
How to help your editor love your vue component library
PPTX
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
PPTX
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
Turbocharge your API strategy with SDK
APIs And SDKs Breaking Into And Succeeding In A Specialty Market
Introduction to Apigility
Apigility & Restfull APIs
Apigility introduction v2 (glasgow php)
How to help your editor love your vue component library
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova

What's hot (20)

PPT
Creation&imitation
PDF
Documenting your REST API with Swagger - JOIN 2014
PPTX
Introduction to Apache Cordova (Phonegap)
PPTX
Cucumber_Capybara
PPTX
React Native
PPTX
Flash Testing with Selenium RC
PPTX
Apache Cordova In Action
PDF
Google cloud endpoints
PDF
OpenAPI development with Python
PPTX
Writer APIs in Java faster with Swagger Inflector
PDF
Apache Cordova: Overview and Introduction
PDF
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
PPTX
Plugin architecture (Extensible Application Architecture)
PPTX
Building strong foundations apex enterprise patterns
ODP
Introduction to Swagger
PPT
Plugins 2.0: The Overview
PPTX
Test Automation with Twist and Sahi
PDF
Crystal clear service interfaces w/ Swagger/OpenAPI
PDF
ACL in CodeIgniter
PPTX
REST API Best Practices & Implementing in Codeigniter
Creation&imitation
Documenting your REST API with Swagger - JOIN 2014
Introduction to Apache Cordova (Phonegap)
Cucumber_Capybara
React Native
Flash Testing with Selenium RC
Apache Cordova In Action
Google cloud endpoints
OpenAPI development with Python
Writer APIs in Java faster with Swagger Inflector
Apache Cordova: Overview and Introduction
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Plugin architecture (Extensible Application Architecture)
Building strong foundations apex enterprise patterns
Introduction to Swagger
Plugins 2.0: The Overview
Test Automation with Twist and Sahi
Crystal clear service interfaces w/ Swagger/OpenAPI
ACL in CodeIgniter
REST API Best Practices & Implementing in Codeigniter
Ad

Viewers also liked (8)

PDF
Platform - Technical architecture
PDF
PIXNET iOS SDK @OSDC 2014
PPTX
Creating personalized cross platform mobile apps with the Sitecore Mobile SDK
PDF
Intro to Salesforce Mobile SDK: Building Hybrid Apps Webinar
PPT
The Marketing Playbook for API & SDK Adoption
PPTX
Unleash the Power of Apex Realtime Debugger
PPTX
Building apps faster with lightning and winter '17
PPTX
Building a Single Page App with Lightning Components
Platform - Technical architecture
PIXNET iOS SDK @OSDC 2014
Creating personalized cross platform mobile apps with the Sitecore Mobile SDK
Intro to Salesforce Mobile SDK: Building Hybrid Apps Webinar
The Marketing Playbook for API & SDK Adoption
Unleash the Power of Apex Realtime Debugger
Building apps faster with lightning and winter '17
Building a Single Page App with Lightning Components
Ad

Similar to Extend sdk (20)

PPTX
Extend sdk
ODP
Best practices tekx
PDF
Intro To Mvc Development In Php
PDF
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
PPTX
Building Large Scale PHP Web Applications with Laravel 4
PDF
presentation
PDF
Add-On Development: EE Expects that Every Developer will do his Duty
PDF
Little gems in the upcoming version 13 of TYPO3
PDF
Dependency Injection for PHP
PDF
Migrating to dependency injection
PPT
PHP - Procedural To Object-Oriented
KEY
Future of PHP
PDF
Domain-driven Design in PHP and Symfony - Drupal Camp Wroclaw!
PPT
Zend framework 05 - ajax, json and j query
PDF
Add-On Development: EE Expects that Every Developer will do his Duty
PDF
presentation
ODP
What's new, what's hot in PHP 5.3
PDF
GraphQL-PHP: Dos and don'ts
PDF
Modernizing Legacy Applications in PHP, por Paul Jones
PPT
DPC 2007 My First Mashup (Cal Evans)
 
Extend sdk
Best practices tekx
Intro To Mvc Development In Php
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Building Large Scale PHP Web Applications with Laravel 4
presentation
Add-On Development: EE Expects that Every Developer will do his Duty
Little gems in the upcoming version 13 of TYPO3
Dependency Injection for PHP
Migrating to dependency injection
PHP - Procedural To Object-Oriented
Future of PHP
Domain-driven Design in PHP and Symfony - Drupal Camp Wroclaw!
Zend framework 05 - ajax, json and j query
Add-On Development: EE Expects that Every Developer will do his Duty
presentation
What's new, what's hot in PHP 5.3
GraphQL-PHP: Dos and don'ts
Modernizing Legacy Applications in PHP, por Paul Jones
DPC 2007 My First Mashup (Cal Evans)
 

More from Harsha Nagaraj (6)

PPT
Designer toolkit demo
PPT
Designer toolkit
PPT
Designer toolkit demo
PPT
Designer toolkit demo
PPT
Designer toolkit
PPTX
Extend overview
Designer toolkit demo
Designer toolkit
Designer toolkit demo
Designer toolkit demo
Designer toolkit
Extend overview

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
KodekX | Application Modernization Development
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Cloud computing and distributed systems.
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Big Data Technologies - Introduction.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
MYSQL Presentation for SQL database connectivity
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Review of recent advances in non-invasive hemoglobin estimation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
sap open course for s4hana steps from ECC to s4
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
KodekX | Application Modernization Development
Chapter 3 Spatial Domain Image Processing.pdf
Empathic Computing: Creating Shared Understanding
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Cloud computing and distributed systems.
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Machine learning based COVID-19 study performance prediction
The Rise and Fall of 3GPP – Time for a Sabbatical?
Programs and apps: productivity, graphics, security and other tools
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MYSQL Presentation for SQL database connectivity

Extend sdk

  • 1. Feature SDK / APIPresentation By:Kumar Pratikpratikk@langoor.net
  • 2. Overview: Feature DevelopmentWhat a developer should know before coding?How widgets work on editor?How to create your own feature?Creating your first feature ( Hello World! )Adding components (widget) to your featureSDK / API – Quick OverviewResponse from feature/widgets to editor & websiteForm Html Code framework functionsInstallsetPropertygetPropertyhasPropertyZend DB API
  • 3. What should you know before coding?HTML & CSSJavaScript (Jqueryframework)PHP 5.3MySQL ZendDB
  • 5. Creating your first feature (hello world)
  • 6. Feature DatabaseEvery feature has its own databaseWhen a feature is installed on a domain, it creates a new database (copying from the feature master database)Developer can access the database using phpMyAdminA feature can have multiple widgets in it, and all the widgets will use the same database for accessing its data.
  • 7. Feature Database Access database using phpMyAdmin
  • 8. Feature Database Access database using phpMyAdmin
  • 12. // feature.php - Feature Main Installer Class// Class pratikHelloWorld extends baseFeature { private $key = ‘d21a868268f8a43b268ee4937a1d8161';var $db;var $instance_id; public function __construct($db, $instance_id = -1){ $this->db = $db; $this->instance_id = $instance_id; } public function setInstanceId($instance_id){ $this->instance_id = $instance_id; } public function install($data = array()){ if(LFeature::setupComplete($this->key,$this->instance_id)){$response['done'] = 1; $response['action'] = "openWidgetPopup"; $response['new_widgets'] = LWidget::getWidgetIdsByFeatureKey($this->key); }else{ throw new Exception('Unable to Complete setup'); } return $response; }//---------------- Developer Code ----------------// }
  • 13. // pratikHelloWorldView/widget.php - Feature Main Installer Class// Class pratikHelloWorldView extends baseWidget {//---------------- Developer Code ----------------var $id;public function __construct($id, $params=array(), $db){ $this->db = $db; $this->id = $id;}public function getId() { return $this->id; }public function hasProperty() { return 0; }public function delete() { }private function get() { }public function getData() { }public static function install($params = array()){ $response['done'] = 1; $response['widget_instance_id'] = -1; return $response;} public functiongetHtml($extra_class=array(),$extra_in_line_style=''){ $html = '<div style="width:100%; padding-bottom:10px;">'; $html .= "Hello world!"; $html .= '</div>'; return $html;}public functiongetEditorHtml($extra_class=array(),$extra_in_line_style=''){ return $this->getHtml($extra_class,$extra_in_line_style);}// }
  • 18. SDK / API - Response formatcreating a form response (install/getProperty function)$response = array();$response['done'] = 0;$response['action'] = "openDialog";$response['dialogContent'] = array( "title"=>'User Comment Widget', "contentType"=>'form', "formaction"=>'install', "content" => array( "fields" => array( array( "label" => 'Name', "name" => 'name', "value" => '', "inputType" => 'input', "class" => 'required' // jQuery Validators ) ) ), "buttonLabel"=>"Install", "type" => "centered“);
  • 19. SDK / API - Responsecreating a html response (install/getProperty function)$response = array();$response['done'] = 0;$response['action'] = "openDialog";$response['dialogContent'] = array( "title"=>'User Comment Widget', "contentType"=>‘html', "content" => “<h2>html content</h2><br /> This is a test content”, "buttonLabel"=>"Install", "type" => "centered“ );
  • 20. SDK / API - Responsefor opening widget panel (install/getProperty function)$response = array();$response['done'] = 1;$response['step'] = ++$step;$response['widget_instance_id'] = $this->db->lastInsertId();
  • 21. SDK / API - Responsecreating a html response with form (install/getProperty function)$html = “<h2>html content</h2><br /> This is a test content <form action=“addcomment”><table> <tr> <td>Name</td> <td><input type = “text” name=“name”></td> </tr><tr> <td>Age</td> <td><input type = “text” name=“age” class=“requirednumber”></td> </tr></table></form>“;$response = array();$response['done'] = 0;$response['action'] = "openDialog";$response['dialogContent'] = array( "title"=>'User Comment Widget', "contentType"=>‘html', "content“ => $html, "buttonLabel"=>“Add Entry", "type" => "centered“ );
  • 22. Creating a form handler for widget// widget.phpPublic function addcomment($params){ $params= $params[0]; $name = $params['name']; $age= $params[‘age']; $sql = "insert into `l_w_pratikHelloWorld_entry` (`name`, `age`) values (?,?)";$res = $this->db->query($sql,array($name,$age)); return true;}
  • 23. Zend DB Sample Query$stmt = $db->query(            'SELECT * FROM bugs WHERE reported_by = ? AND bug_status = ?',            array('goofy', 'FIXED')        );$stmt = $db->query('SELECT * FROM bugs'); while ($row = $stmt->fetch()) {    echo $row['bug_description'];}$stmt = $db->query('SELECT * FROM bugs'); $rows = $stmt->fetchAll(); echo $rows[0]['bug_description'];
  • 24. Thank you!Kumar Pratikpratikk@langoor.net