SlideShare una empresa de Scribd logo
1 de 25
Feature SDK / API Presentation By: Kumar Pratikpratikk@langoor.net
Overview: Feature Development What 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 feature SDK / API – Quick Overview Response from feature/widgets to editor & website Form  Html  Code framework functions Install setProperty getProperty hasProperty Zend DB API
What should you know before coding? HTML & CSS JavaScript (Jqueryframework) PHP 5.3 MySQL  ZendDB
Youtube widget
Login using your  sign-up crendentials
After logging in, you will be re-directed to Dashboard as shown below. Click on Features Manager to start Development of features
Creating your first feature (hello world) Since widgets constitute a feature, a widget should be added only after adding the feature click to add the details of the new feature
Feature Database Every feature has its own database When a feature is installed on a domain, it creates a new database (copying from the feature master database) Developer can access the database using phpMyAdmin A 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 Once a feature is created, a new database is created for the feature with its credentials being displayed on features manager as shown.
Select the feature for the new widget Click to create the new widget. Clicking on the create button re-directs to the feature manager dashboard
Public: Feature is visible to all the subdomains on extend.langoor.net Private: features visible only to the owner of the subdomain. Click edit to go to feature manager editor.
All the error log information associated with the feature can be accessed here All the files related to the widgets are stored in the widgets folder  Thumbnail image for the feature which appears on the feature panel in langoor.net editor. Main feature class
// feature.php  - Feature Main Installer Class // Class pratikHelloWorld extends baseFeature { -- You should not write the class name in your code this is added automatically 	private $key = ‘d21a868268f8a43b268ee4937a1d8161'; // key of the feature var $db; // variable for storing database object var $instance_id; // instance id of the feature 	public function __construct($db, $instance_id = -1){ // feature should have 2 params in constructor, 1st database object (zendDb) & 2nd Instance Id 	$this->db = $db;  		$this->instance_id = $instance_id; 	} 	public function setInstanceId($instance_id){ 		$this->instance_id = $instance_id; 	} 	public function install($data = array()){ // this function is called once the install action is performed from the feature panel on the editor.     if(LFeature::setupComplete($this->key,$this->instance_id)){ // making the feature as installed to the editor / backend framework 	$response = array();	// response array is the main message which is passed to the editor to perform the required steps, please refer the response format for different type of possible message. $response['done'] = 1;  		$response['action'] = "openWidgetPopup"; 		$response['new_widgets'] = LWidget::getWidgetIdsByFeatureKey($this->key); // API for getting the widget ids from the feature 	    }else{ 	          	throw new Exception('Unable to Complete setup'); 	    } 	return $response; 	} //---------------- Developer Code ------------------  // } Please read the comments for understanding the code better.
// pratikHelloWorldView/widget.php  - Feature Main Installer Class // Class pratikHelloWorldView extends baseWidget {  - same as the feature class you should not write the class starting and ending. //---------------- 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; 		} // to enable / disable the setting button on the widget public function delete()		{			} // this function will be called, if widget is being delete from the page. private function get()		{			} public function getData()		{			} public static function install($params = array()){ // this function is called when a user click on the widget to install on the page, currently this function is returning done = 1, ie installation completed. 	$response['done'] =  1; 	$response['widget_instance_id'] = -1; 	return $response; }		   public functiongetHtml($extra_class=array(),$extra_in_line_style=''){  // this is called after once the user click on preview/publish to display the page on the browser  $html = '<div style="width:100%; padding-bottom:10px;">';     $html .= "Hello world!";     $html .= '</div>';     return $html; } public functiongetEditorHtml($extra_class=array(),$extra_in_line_style=''){	 // its acts exactly as the above the only difference is editor will always call getEditorHtml for getting the widget data on the page. You can just call the gethtml function to send the same data. If you do not want a difference in live and preview version of the widget. return $this->getHtml($extra_class,$extra_in_line_style);} // }
Once the feature is saved, it appears in the feature panel of the editor.
Once the feature is installed, its constituent widgets appear in the widget panel.
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.php Public 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  Pratik pratikk@langoor.net

Más contenido relacionado

La actualidad más candente

Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Jeado Ko
 

La actualidad más candente (20)

Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
 
Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2
 
[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법
 
Ionic tabs template explained
Ionic tabs template explainedIonic tabs template explained
Ionic tabs template explained
 
Implementing access control with zend framework
Implementing access control with zend frameworkImplementing access control with zend framework
Implementing access control with zend framework
 
Day 5
Day 5Day 5
Day 5
 
WCMTL 15 - Create your own shortcode (Fr)
WCMTL 15 - Create your own shortcode (Fr)WCMTL 15 - Create your own shortcode (Fr)
WCMTL 15 - Create your own shortcode (Fr)
 
Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth
 
Using Renderless Components in Vue.js during your software development.
Using Renderless Components in Vue.js during your software development.Using Renderless Components in Vue.js during your software development.
Using Renderless Components in Vue.js during your software development.
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
 
Migrating from JSF1 to JSF2
Migrating from JSF1 to JSF2Migrating from JSF1 to JSF2
Migrating from JSF1 to JSF2
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
Error Reporting in ZF2: form messages, custom error pages, logging
Error Reporting in ZF2: form messages, custom error pages, loggingError Reporting in ZF2: form messages, custom error pages, logging
Error Reporting in ZF2: form messages, custom error pages, logging
 
AngularJs-training
AngularJs-trainingAngularJs-training
AngularJs-training
 
Angular js routing options
Angular js routing optionsAngular js routing options
Angular js routing options
 
Angular js-crash-course
Angular js-crash-courseAngular js-crash-course
Angular js-crash-course
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injection
 
Day 6
Day 6Day 6
Day 6
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4
 

Similar a Extend sdk

Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron
 

Similar a Extend sdk (20)

Extend sdk
Extend sdkExtend sdk
Extend sdk
 
Introduction to Zend Framework
Introduction to Zend FrameworkIntroduction to Zend Framework
Introduction to Zend Framework
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for Beginners
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
 
WordPress as a Content Management System
WordPress as a Content Management SystemWordPress as a Content Management System
WordPress as a Content Management System
 
实战Ecos
实战Ecos实战Ecos
实战Ecos
 
Building Robust jQuery Plugins
Building Robust jQuery PluginsBuilding Robust jQuery Plugins
Building Robust jQuery Plugins
 
Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
Introduction to Spring Boot.pdf
Introduction to Spring Boot.pdfIntroduction to Spring Boot.pdf
Introduction to Spring Boot.pdf
 
Empowering users: modifying the admin experience
Empowering users: modifying the admin experienceEmpowering users: modifying the admin experience
Empowering users: modifying the admin experience
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's Code
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
 
How to code to code less
How to code to code lessHow to code to code less
How to code to code less
 

Más de Harsha Nagaraj (6)

Designer toolkit demo
Designer toolkit demoDesigner toolkit demo
Designer toolkit demo
 
Designer toolkit
Designer toolkitDesigner toolkit
Designer toolkit
 
Designer toolkit demo
Designer toolkit demoDesigner toolkit demo
Designer toolkit demo
 
Designer toolkit demo
Designer toolkit demoDesigner toolkit demo
Designer toolkit demo
 
Designer toolkit
Designer toolkitDesigner toolkit
Designer toolkit
 
Extend overview
Extend overviewExtend overview
Extend overview
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Extend sdk

  • 1. Feature SDK / API Presentation By: Kumar Pratikpratikk@langoor.net
  • 2. Overview: Feature Development What 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 feature SDK / API – Quick Overview Response from feature/widgets to editor & website Form Html Code framework functions Install setProperty getProperty hasProperty Zend DB API
  • 3. What should you know before coding? HTML & CSS JavaScript (Jqueryframework) PHP 5.3 MySQL ZendDB
  • 5. Login using your sign-up crendentials
  • 6. After logging in, you will be re-directed to Dashboard as shown below. Click on Features Manager to start Development of features
  • 7. Creating your first feature (hello world) Since widgets constitute a feature, a widget should be added only after adding the feature click to add the details of the new feature
  • 8. Feature Database Every feature has its own database When a feature is installed on a domain, it creates a new database (copying from the feature master database) Developer can access the database using phpMyAdmin A feature can have multiple widgets in it, and all the widgets will use the same database for accessing its data.
  • 9. Feature Database Access database using phpMyAdmin Once a feature is created, a new database is created for the feature with its credentials being displayed on features manager as shown.
  • 10. Select the feature for the new widget Click to create the new widget. Clicking on the create button re-directs to the feature manager dashboard
  • 11. Public: Feature is visible to all the subdomains on extend.langoor.net Private: features visible only to the owner of the subdomain. Click edit to go to feature manager editor.
  • 12. All the error log information associated with the feature can be accessed here All the files related to the widgets are stored in the widgets folder Thumbnail image for the feature which appears on the feature panel in langoor.net editor. Main feature class
  • 13. // feature.php - Feature Main Installer Class // Class pratikHelloWorld extends baseFeature { -- You should not write the class name in your code this is added automatically private $key = ‘d21a868268f8a43b268ee4937a1d8161'; // key of the feature var $db; // variable for storing database object var $instance_id; // instance id of the feature public function __construct($db, $instance_id = -1){ // feature should have 2 params in constructor, 1st database object (zendDb) & 2nd Instance Id $this->db = $db; $this->instance_id = $instance_id; } public function setInstanceId($instance_id){ $this->instance_id = $instance_id; } public function install($data = array()){ // this function is called once the install action is performed from the feature panel on the editor. if(LFeature::setupComplete($this->key,$this->instance_id)){ // making the feature as installed to the editor / backend framework $response = array(); // response array is the main message which is passed to the editor to perform the required steps, please refer the response format for different type of possible message. $response['done'] = 1; $response['action'] = "openWidgetPopup"; $response['new_widgets'] = LWidget::getWidgetIdsByFeatureKey($this->key); // API for getting the widget ids from the feature }else{ throw new Exception('Unable to Complete setup'); } return $response; } //---------------- Developer Code ------------------ // } Please read the comments for understanding the code better.
  • 14. // pratikHelloWorldView/widget.php - Feature Main Installer Class // Class pratikHelloWorldView extends baseWidget { - same as the feature class you should not write the class starting and ending. //---------------- 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; } // to enable / disable the setting button on the widget public function delete() { } // this function will be called, if widget is being delete from the page. private function get() { } public function getData() { } public static function install($params = array()){ // this function is called when a user click on the widget to install on the page, currently this function is returning done = 1, ie installation completed. $response['done'] = 1; $response['widget_instance_id'] = -1; return $response; } public functiongetHtml($extra_class=array(),$extra_in_line_style=''){ // this is called after once the user click on preview/publish to display the page on the browser $html = '<div style="width:100%; padding-bottom:10px;">'; $html .= "Hello world!"; $html .= '</div>'; return $html; } public functiongetEditorHtml($extra_class=array(),$extra_in_line_style=''){ // its acts exactly as the above the only difference is editor will always call getEditorHtml for getting the widget data on the page. You can just call the gethtml function to send the same data. If you do not want a difference in live and preview version of the widget. return $this->getHtml($extra_class,$extra_in_line_style);} // }
  • 15. Once the feature is saved, it appears in the feature panel of the editor.
  • 16. Once the feature is installed, its constituent widgets appear in the widget panel.
  • 17.
  • 18.
  • 19. 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“ );
  • 20. 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“ );
  • 21. SDK / API - Responsefor opening widget panel (install/getProperty function) $response = array(); $response['done'] = 1; $response['step'] = ++$step; $response['widget_instance_id'] = $this->db->lastInsertId();
  • 22. 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“ );
  • 23. Creating a form handler for widget // widget.php Public 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; }
  • 24. 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'];
  • 25. Thank you! Kumar Pratik pratikk@langoor.net