Softwarekonfiguration mit Drupal

54
Softwareentwicklung mit Drupal Referent: Manuel Pistner

description

Dieser Vortrag wurde an der FH Darmstadt gehalten. Das vollsändige Video ist unter

Transcript of Softwarekonfiguration mit Drupal

Page 1: Softwarekonfiguration mit Drupal

Softwareentwicklung mit Drupal

Referent: Manuel Pistner

Page 2: Softwarekonfiguration mit Drupal

Wasist Software-Konfiguration

2/54

● Basis-System (Core aktuell Version 7.25)

● Abstrakte Komponenten (Module / Plugins)

● konfigurierbare Schnittstellen

Page 3: Softwarekonfiguration mit Drupal

Wasist Software-Konfiguration

=> Abstrakte Module werden zu konkreten Use-Cases konfiguriert

- Bildergalerie- Addressdatenbank- Terminverwaltung- Aufgabenverwaltung- ...

3/54

Page 4: Softwarekonfiguration mit Drupal

Wasist Software-Konfiguration

Modul A Modul B Modul C

Plugin 1 Plugin 2

Konfigurationsebene

Use-Case

4/54

Page 5: Softwarekonfiguration mit Drupal

WarumSoftwarekonfiguration

● Wiederverwendbare Komponenten (spart Zeit)

● Keine Programmierung (reduziert Fehler)

● Dennoch API für individuelle Module

5/54

Page 6: Softwarekonfiguration mit Drupal

Wasist zu beachten

● Konfiguration wird Programmierung vorgezogen

● Best-Practises sind in Konfiguration zu finden

● Wenn eigener Code dann wiederverwendbar = Konfigurierbar

6/54

Page 7: Softwarekonfiguration mit Drupal

Wasist Drupal

● Ursprung als Community-Framework

● Später Web-CMS

● Heute Application-Framework

7/54

Page 8: Softwarekonfiguration mit Drupal

Wasist Drupal außerdem

● größtes internationales Community getriebenes Open-Source Projekt

● Über 1% aller Webseiten (https://drupal.org/project/usage/drupal)

● „Come for the Code stay for the community“

8/54

Page 9: Softwarekonfiguration mit Drupal

Wieverbreitet ist Drupal

9/54

Page 10: Softwarekonfiguration mit Drupal

Wasunterscheidet Drupal

+ Application-Framework

+ Höchste Flexibilität

+Integration mit anderen Systemen (Apps, Webservices, Clients, Server)

10/54

Page 11: Softwarekonfiguration mit Drupal

Wasunterscheidet Drupal

- Komplex

- Steile Lernkurve

- Benutzer-Interface teils schwer überschaubar

11/54

Page 12: Softwarekonfiguration mit Drupal

WelcheAnwendungsfälle gibt es

● Content- und Media-Portale

● Online-Communities

● Web-Anwendungen (CRM, Business-Apps)

12/54

Page 13: Softwarekonfiguration mit Drupal

WelcheAnwendungsfälle gibt es

● E-Commerce Portale

● Service-Backend für Apps und andere Clients

● Blogs und Online-Magazine

13/54

Page 14: Softwarekonfiguration mit Drupal

Wersetzt Drupal ein

● White House

● MTV

● AT&T

● Land Hessen (Hessen.de)

14/54

Page 15: Softwarekonfiguration mit Drupal

Wersetzt Drupal ein

● Deutschland.de

● McDonalds

● Grammy Awards

=> Weitere @ http://websites.usandv.com/

15/54

Page 16: Softwarekonfiguration mit Drupal

Wieentwickelt sich Drupal

● Aktuelle Version 7.25

● Dieses Jahr Drupal 8

● Dann Objekt-orientiert / Service-orientiert (REST)

16/54

Page 17: Softwarekonfiguration mit Drupal

Wieentwickelt man mit Drupal

● Vorraussetzung: Drupal-Core

● Erweiterungen (Module, Plugins)

● Themes

17/54

Page 18: Softwarekonfiguration mit Drupal

Wieentwickelt man mit Drupal

● Drupal API für eigene Module (api.drupal.org)

● Best Practises (Videos @ nodeone.se)

18/54

Page 19: Softwarekonfiguration mit Drupal

WelcheBereiche existieren in Software

● Datenstruktur (Model)

● Daten-Auswahl (Queries)

● Daten-Darstellung (HTML Output)

19/54

Page 20: Softwarekonfiguration mit Drupal

WelcheBereiche existieren in Software

● Layout (HTML Markup)

● Businesslogik / Workflows (Controller)

● Zugriffskontrolle (Rechte, Rollen)

20/54

Page 21: Softwarekonfiguration mit Drupal

WelcheBereiche existieren in Software

● Performance (Slow-Queries, Caching)

● Entwickler-Tools (Debugging)

21/54

Page 22: Softwarekonfiguration mit Drupal

WelcheBereiche existieren in Software

DBMySQL

Queries Darstellung

Datenstruktur

LayoutTheme

(CSS, HTML)

● Auswahl und Darstellung von Daten

Recht undRollen beachten

22/54

Page 23: Softwarekonfiguration mit Drupal

WelcheBereiche existieren in Software

DBMySQL

UserService

Input

Datenstruktur

EventsConditions

Output

● Business Logik

Recht undRollen beachten

23/54

Page 24: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

=> Datenstruktur:

● Entities (Nodes), Bundles (Kontakt, Firma)

● Fields (Integer, Text, Reference, Image)

24/54

Page 25: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

● => Aufbau von Entities und Bundles

DBEntity Type

Bundle A

Bundle B

Bundle C

Field A

Field B

Field C

Field D

25/54

Page 26: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

Content (Node) ist ein Entity mit existierenden Bundles „Article“ und „Basic Page“ mit jeweiligen Feldern

26/54

Page 27: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

Verwalten von Feldern eines Nodetypes (Node / Entities)

27/54

Page 28: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

Generiertes Formular zum Erstellen eines neuen Nodes (Entity)

28/54

Page 29: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

=> Datenselektion (Query):

● Views

● API (Entity Field Query, DB-Abstraktion)

29/54

Page 30: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

Views zum Erstellen und Anzeigen von Daten aus der Datenbank (Entities)

30/54

Page 31: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

=> Rendering / Markup / Daten-Output:

● Field-Formatter (Fields, Image, Gallery)

● View Modes (Entities, Display Suite)

● Weitere Formatter (Views Display, Row Styles)

31/54

Page 32: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

=> Layout:

● Panels, Panels everywhere, Panelizer

● Blocksystem / Contexts

● Display Suite

32/54

Page 33: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

Einstellungen für die Anzeige eines Nodetypes (Display Suite)

33/54

Page 34: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

Anzeige eines Nodes (Display Suite)

34/54

Page 35: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

Konfiguration eines Panels für eine Node-Ansicht

35/54

Page 36: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

Konfiguration eines Panels per „In-Place Editing“ und Drag&Drop

36/54

Page 37: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

Anzeige eines Panles mit View und eingebundenem Node

37/54

Page 38: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

=> Business Logik / Workflow

● Rules

● Rules-Erweiterungen (Rules Conditional)

38/54

Page 39: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

Konfiguration einer Rule nach dem Speichern eines vorhandenen Nodes

39/54

Page 40: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

=> Berechtigungskontrolle

● Content Access

● AUL (User Access List, ähnlich AUL)

● Weitere Permission Module

40/54

Page 41: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

=> Performance

● Entity Cache (Cachen der Entity Daten)

● Boost, Memcache, APC (Op-Code Cache)

● Varnish (Extern)

41/54

Page 42: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

=> Deployment

● Features (Export von Module-Konfiguration)

● Strongarm (Export von System-Einstellungen)

● Drush Make (Modul-Versionsmanagement)42/54

Page 43: Softwarekonfiguration mit Drupal

WelcheModule gibt es für die Bereiche

=> Entwicklung

● Devel

● Drush (Shell-Konsole für Drupal)

43/54

Page 44: Softwarekonfiguration mit Drupal

Wasleistet die Drupal API

● Meist prozedural in Drupal 7

● Interaktion per Hooks (_info, _alter)

● Weitere APIs durch Contrib Module

44/54

Page 45: Softwarekonfiguration mit Drupal

Wasleistet die Drupal API

● Field API (Feld-typen definieren)

● Views API (Plugins Selktion und Ausgabe)

● Rules API (Events, Actions, Conditions)

45/54

Page 46: Softwarekonfiguration mit Drupal

WasLeistet die Drupal API

● Ausblick Drupal 8 (Mitte 2014)

● Basierend auf Symfony

● Objektorientierte Architektur

46/54

Page 47: Softwarekonfiguration mit Drupal

WieWird in Drupal deployed

Zentrales Problem:

● Content

● Konfiguration

=> liegen in einer Datenbank

47/54

Page 48: Softwarekonfiguration mit Drupal

Wiewird in Drupal deployed

48/54

DBEntwicklung

Content +Konfiguration

DBLive

Content +Konfiguration

…..Kopieren der DatenbankÜberschreibt neuenContent der Live DB !

Apache (PHP-Code) Apache (PHP-Code)

Page 49: Softwarekonfiguration mit Drupal

Wiewird in Drupal deployed

Lösung:

● Konfiguration von Content trennen

● Features exportiert Konfiguration in Code (versionierbar, transportierbar)

49/54

Page 50: Softwarekonfiguration mit Drupal

Wiewird in Drupal deployed

50/54

DBEntwicklung

Content +Konfiguration

DBLive

Content +Konfiguration

…..Code-

Repository(GIT)

Apache (PHP-Code) Apache (PHP-Code)

Deploymentohne Kopierender DB sondernnur auf Datei-Ebene

Page 51: Softwarekonfiguration mit Drupal

WieWird in Drupal deployed

51/54

Page 52: Softwarekonfiguration mit Drupal

Wiekann ich schneller starten

● Mit Distributionen!

● Viele Module vorkonfiguriert

● Beinhalten Best-Practises

● Bilden oft bereits konkrete Features ab

52/54

Page 53: Softwarekonfiguration mit Drupal

WieKann ich schneller einsteigen

● http://api.drupal.org (Schnittstellen, Doku)

● Nodeone.se (Videos)

● Lullabot.com (Videos)

53/54

Page 54: Softwarekonfiguration mit Drupal

Manuel Pistner

Email: [email protected]