Data Management Applications with Drupal as Your Framework

Similar documents
Drupal Module Development

Entites in Drupal 8. Sascha Grossenbacher Christophe Galli

How does Drupal 7 Work? Tess Flynn, KDØPQK

DIPLOMA IN WEBDEVELOPMENT

Omniprise ERP Overview. User guide

Certified PHP/MySQL Web Developer Course

Webforms on a Drupal 7 Website 3/20/15

5 Mistakes to Avoid on Your Drupal Website

Elgg 1.8 Social Networking

Drupal 8. Core and API Changes Shabir Ahmad MS Software Engg. NUST Principal Software Engineser PHP/Drupal

Drupal CMS for marketing sites

Introduction to Module Development

INFORMATION BROCHURE Certificate Course in Web Design Using PHP/MySQL

Secure Application Development with the Zend Framework

Trainer name is P. Ranjan Raja. He is honour of and he has 8 years of experience in real time programming.

Everything you ever wanted to know about Drupal 8*

UNIVERSITY OF CALGARY Information Technologies WEBFORMS DRUPAL 7 WEB CONTENT MANAGEMENT

How We Did It. Unique data model abstraction layer to integrate, but de-couple EHR data from patient website design.

LEARNING DRUPAL. Instructor : Joshua Owusu-Ansah Company : e4solutions Com. Ltd.

Web Development using PHP (WD_PHP) Duration 1.5 months

Drupal and ArcGIS Yes, it can be done. Frank McLean Developer

Shop by Manufacturer Custom Module for Magento

Visual Basic Programming. An Introduction

Using your Drupal Website Book 1 - Drupal Basics

Commerce Services Documentation

A MODEL FOR THE AUTOMATION OF HTML FORM CREATION AND VALIDATION. Keywords: html, form, web, automation, validation, class, model.

MHC Drupal User Manual: Webforms

Bulk . What s Inside this Guide. Bulk and How To Get There 2. Bulk Setup 4. Bulk Details 7

Get post program 7 W.a.p. that Enter two numbers from user and do arithmetic operation

Module - Facebook PS Connect

Magento Certified Developer What, Why & How

Bazaarvoice for Magento Extension Implementation Guide v6.3.4

Hack-proof Your Drupal App. Key Habits of Secure Drupal Coding

Configuring Data Masking

Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY

Drupal 8 The site builder's release

CRM Global Search: Installation & Configuration

NETWRIX EVENT LOG MANAGER

Save Actions User Guide

CMS and e-commerce Solutions. version 1.0. Please, visit us at: or contact directly by

Form And List. SuperUsers. Configuring Moderation & Feedback Management Setti. Troubleshooting: Feedback Doesn't Send

FormAPI, AJAX and Node.js

BF Survey Plus User Guide

This section describes how to set up, find and delete community strings.

Rochester Institute of Technology. Finance and Administration. Drupal 7 Training Documentation

UF Health SharePoint 2010 Document Libraries

INTRODUCTION TO THE PROJECT TRACKING WEB APPLICATION

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

HTML Forms. Pat Morin COMP 2405

Custom Apps A Beginners Guide

Customer Relationship Management Overview Document. for Sage 100 ERP

Section Transaction Codes. Contents. Transaction Codes... 2 Procedures Tab... 3 Adjustments Tab... 5 Non-billing Codes Tab...

AVOIDING THE GIT OF DESPAIR

Developers Guide version 1.1

Faichi Solutions. The Changing Face of Drupal with Drupal 8

Save Actions User Guide

Drupal + Formulize. A Step-by-Step Guide to Integrating Drupal with XOOPS/ImpressCMS, and installing and using the Formulize module

Things Made Easy: One Click CMS Integration with Solr & Drupal

Research Electronic Data Capture (REDCap)

Dreamweaver Tutorials Creating a Web Contact Form

Configuration Manager

SuiteBuilder (Customization) Guide September 3, 2013 Version 2013 Release 2

Bazaarvoice for Magento

Symfony vs. Integrating products when to use a framework

Order Manager Toolkit

KEYSTONE JS FOR DRUPAL DEVELOPERS

Managed App Configuration for App Developers. February 22, 2016

IRF2000 IWL3000 SRC1000 Application Note - Apps with OSGi - Condition Monitoring with WWH push

Certified PHP Developer VS-1054

Resco CRM Server Guide. How to integrate Resco CRM with other back-end systems using web services

FORM-ORIENTED DATA ENTRY

skype ID: store.belvg US phone number:

Working with forms in PHP

Getting Content into Drupal Using Migrate

Overview of Databases On MacOS. Karl Kuehn Automation Engineer RethinkDB

Kaseya 2. Quick Start Guide. for VSA 6.3

BT Cloud Voice. Call Forward Selective. What is it? How do I set up a rule?

Salesforce Opportunities Portlet Documentation v2

Using SQL Server Management Studio

BT CONTENT SHOWCASE. JOOMLA EXTENSION User guide Version 2.1. Copyright 2013 Bowthemes Inc.

DocAve 6 Quickr Migrator

How To Fix A Bug In Drupal 8.Dev

PassMark Software BurnInTest Management Console. Quick start guide

WEB DESIGN COURSE CONTENT

Custom fields validation

Further web design: HTML forms

Salesforce.com Integration Guide

Magento Extension Developer s Guide

SAP InfiniteInsight Explorer Analytical Data Management v7.0

Facebook Twitter YouTube Google Plus Website

Transcription:

Data Management Applications with Drupal as Your Framework John Romine UC Irvine, School of Engineering UCCSC, IR37, August 2013 jromine@uci.edu

What is Drupal? Open-source content management system PHP, MySQL, jquery 2%+ of all websites run Drupal Drupal 6: 2/2008 Drupal 7: 1/2011 Drupal 8: 1Q14? Rapid growth whitehouse.gov examiner.com

Why use Drupal? Content Management Framework built-in features user accounts profiles preferences access control permissions roles single-sign-on integration display of content actions templates lists of stuff (views) themeing forms processing validation database schema definition

What s a node? nid (String, 1 characters ) 5 vid (String, 2 characters ) 73 type (String, 4 characters ) page uid (String, 1 characters ) 1 title (String, 58 characters ) Data Management Applications with Drupal as Your Framework body (String, 31459 characters ) teaser (String, 0 characters )...

Data apps with Drupal: without code Fields: Content Constuction Kit (CCK) Views: Text field Select list Checkbox Radio buttons List Table Pager Filters Example: Cal State Monterey Bay Student CRM

Development approach: code A collection of related Drupal modules framework with different features for different areas rapidly deploy and update with Drupal tools built-in schema update drush make Data source/uplink: links to outside data sources financial academic data upload/import with cron & batch read-only data mirrors

Access Control control what actions a user can take modules define permissions edit blurfl content view blurfl content administer blurfl settings users assigned to roles collections of permissions each activity can check permissions exception: lists of stuff (performance) user_access( edit blurfl content )

Content access Drupal built-in: realms & grants per-node array of: realm grant id permissions (bool) view edit delete per-user array of: realm array of grant ids can be overridden by modules (allow/deny)

Content & Forms nodes represented as structured object form represented as structured array textfield checkbox radio button select / checkboxes textarea fieldset file upload per-field access check validation submit handler avoids CSRF XSS SQL-injections

Strategy: Aspect-Oriented (vs. MVC) modules fully implement their data no top-level integration control flow through "hooks" (actions) modules notified of activity through event callbacks: load data save data display content edit content update (save) content

Code: Permissions definition function student_activity_perm() { return array( 'edit student activity content', 'view student activity content', ); }

Code: schema definition $schema['student_activity'] = array( 'fields' => array( 'nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'vid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ),

Code: schema (continued) 'activity_type' => array( 'type' => 'char', 'length' => 32, 'not null' => FALSE, 'default' => '', ) 'activity_date' => array( 'type' => 'datetime', 'mysql_type' => 'date', 'not null' => FALSE, ), core schema update hook provided easily update existing site s schema to current

Code: Data load, insert function student_activity_load($node) { return student_fetch_record('student_activity', $node); } function student_activity_insert($node) { student_write_record('student_activity', $node); } student_write_record() a NULL-friendly version of drupal_write_record()

Code: Data update function student_activity_update($node) { if ($node->revision) { // treat it as a new record. student_activity_insert($node); } else { student_write_record('student_activity', $node, array('nid', 'vid')); } } similar functions for delete, delete revision

Code: form definition: text field $form['activity_date'] = array( '#type' => 'textfield', '#size' => 12, '#maxlength' => 10, '#title' => t('activity Date'), '#default_value' => isset($node->activity_date)? $node->activity_date : '', '#description' => t('mm/dd/yyyy'), );

Code: form definition: select list $form['activity_type'] = array( '#type' => 'select', '#title' => t('activity type'), #options => $activity_type_options, // assoc array '#default_value' => isset($node->activity_type)? $node->activity_type : '', );

Code: form validation (example) function mymodule_validate($node, &$form) { if (isset($node->end_time) && isset($node->start_time)) { if ($node->start_time > $node->end_time) { form_set_error('end_time', } } } t('an event may not end before it starts.'));

Code: routing & access control function student_menu() { $items['admin/settings/student'] = array( 'title' => 'Student', 'description' => 'Configure student module settings.', 'access callback' => 'user_access', 'access arguments' => array('administer student configuration'), 'page callback' => 'drupal_get_form', 'page arguments' => array('student_admin_settings'), 'type' => MENU_NORMAL_ITEM, ); Specify: URL/path, access control, page/form callback

Code: views integration $data['student_plan']['plan_notes'] = array( 'title' => t('plan notes'), 'help' => t("progress plan notes"), 'field' => array( 'handler' => 'student_handler_field', 'click sortable' => TRUE, 'access callback' => 'student_check_field_access', 'access arguments' => array('view', 'student plan', 'plan_notes'), ), Specify how this field is displayed per-field access control possible

Code: views integration (2) 'filter' => array( 'handler' => 'views_handler_filter_string', 'access callback' => 'student_check_field_access', 'access arguments' => array('view', 'student plan', 'plan_notes'), ), 'argument' => array( 'handler' => 'views_handler_argument_string', ), 'sort' => array( 'handler' => 'views_handler_sort', ),

Typical data handling module: lines chars 11 290 student_petition/student_petition.css 8 170 student_petition/student_petition.info 126 3159 student_petition/student_petition.install 15 489 student_petition/student_petition.js 465 14551 student_petition/student_petition.module 625 18659 total 300 lines of actual code in student_petition.module implements 6 petition fields database load/save/update form handling data display

Going forward: Drupal 7 & 8 Database layer: PDO Fields in core (table for each field!) Entities Templates: twig Framework: Symfony 2 Views in core