Notes PHP Connector zwei Welten verbinden Abstract Fr
Notes PHP Connector zwei Welten verbinden
Abstract Für die Erzeugung dynamischer Webauftritte - sind neben den verfügbaren sehr guten Notes Lösungen - auch verschiedene andere Technologien im Einsatz. Insbesondere in Verbindung mit dem Apache Webserver - laut Netcraft Statistik ca. 70 % der weltweiten Webserver - ist PHP eine weit verbreitete Entwicklungssprache für die Entwicklung dynamischer Browseranwendungen. Die Referenten stellen im ersten Teil die PHP Technologie im Kontext der IBM Software vor. Hierzu gehören neben Domino auch DB 2 und Cloudescape sowie die Sametime Technologie. Im zweiten Teil stellen sie den von Visual Solutions entwickelten PHP to Notes Connector vor. Der im Rahmen des Open Source CMS e. Z Publish entwickelte Connector besteht aus zwei Teilen. Einer Komponente für Lotus Domino und einer Komponente für e. Z Publish und damit PHP. Zur eigentlichen Datenübertragung zwischen diesen beiden Komponenten wird XML als Datenformat und HTTP als Übertragungsprotokoll verwendet. Das Konzept verfolgt dabei einen serviceorientierten Ansatz. Vorgestellt wird die derzeit verfügbare Funktionssammlung und ihre Anwendungsmöglichkeiten. 1
Disclaimer IBM, the IBM logo, DB 2 Universal Database, Domino, Everyplace, Lotus, the On Demand Business logo, Notes, Web. Sphere, Workplace and the Workplace family of marks are trademarks of International Business Machines Corporation in the United States, other countries, or both. Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both. Linux is a trademark of Linus Torvalds in the United States, other countries, or both. Other company, product or service names may be trademarks or service marks of others. The information contained in this documentation is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this documentation, it is provided “as is” without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this documentation or any other documentation. Nothing contained in this documentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM (or its suppliers or licensors), or altering the terms and conditions of the applicable license agreement governing the use of IBM software. 2
Referenten Stefan Weber (Dipl. -Inf. ) – Visual Solutions, Iserlohn – www. visol. de – weber@visol. de Andreas Schulte – IBM Partnership Solution Center Nord. West – www. ibm. com/de/mittelstand/psc/ – andreas. schulte@de. ibm. com 3
Unternehmens Info Visual Solutions . . . entwickelt Kommunikationslösungen für mittelständische Unternehmen und gestaltet Kommunikationsschnittstellen zu Marktpartnern. – Lotus/IBM Business Partner seit 1997 – Schwerpunkt Web-Entwicklung: Content-Management, E-Commerce, Barrierefreie Gestaltung – Database Publishing, Medienneutrale Datenbanken IBM Partnership Solution Center Nord. West – Teil der IBM Mittelstands- und Developer Relations Organisation – PSCs in: Berlin, Hamburg, Düsseldorf, Frankfurt, Stuttgart, München – Unterstützung für IBM Business Partner durch: • • • Consulting Workshops & Enablement Porting Testing Unterstützung et al 4
Agenda • Notes – Geschichte & Basisinformationen • PHP im Kontext der IBM Software • DB 2 / Cloudscape, Sametime, Domino • PHP Notes Connector • Funktionsübersicht • Beispiel 5
Agenda • Notes – Geschichte & Basisinformationen • PHP im Kontext der IBM Software • DB 2 / Cloudscape, Sametime, Domino • PHP Notes Connector • Funktionsübersicht • Beispiel 6
communicate, collaborate, coordinate Maske View Feld 9 -Boxen-Modell Grundideen . nsf Lotus Notes Domino Server Anwendungsserver e. Mail & PIM Anwendungs-Templates . ntf 7
Reichweite 9 -Boxen-Modell Extern Unternehmen Team Kommunikation Zusammenarbeit Koordination Komplexität 8
9 -Boxen-Modell Reichweite Extern Unternehmen Team Mail Sametime Blog Diskussion RSS Feeds Notes Anwendung mit Web-Frontend Mail Sametime Blog Diskussion RSS Feeds Teamroom Office-Bibl. Notes/SAP Mail Sametime Blog Diskussion RSS Feeds Teamroom Office-Bibl. Power-User Anwendung Kommunikation Zusammenarbeit Koordination Komplexität 9
Die Geschichte von Notes • 1973 PLATO Notes Entwicklung am Computerbased Education Reserch Laboratory (CERL) der Universität Illinois • 1976 PLATO Group Notes (Unterscheidung zwischen privaten und öffentlichen Inhalten) • 1984 Ray Ozzie, Tim Halvorsen und Len Kawell entwickeln die Basis von Lotus Notes bei Iris Associates Inc. • 1986 Vor-Version von Lotus Notes im internen Einsatz • 1987 Lotus Development kauft die Rechte an Notes • 1989 Version 1 wird in den USA ausgeliefert • Anfang der 90 iger Version 2. x in Deutschland • 1994 Lotus kauft Iris Associates Inc. – Iris bleibt aber Entwicklungslabor für Notes • 1995 IBM kauft Lotus – insbesondere wegen der Notes Technologie 10
Lotus Notes & Domino Roadmap …continuing long into the future Organizational Productivity ND 8 Expanding the reach of the “Team Productivity” era, with tools to extend collaboration into Web sites, portals and work spaces, mobile devices, and more… 2005 – Notes/Domino 7 IBM Workplace Collaboration Services 2004 – Notes and Domino 6. 5. 1; IBM Workplace products, technologies, solutions Team Productivity Instant messaging, Web conferences, team discussions, document and Web content management, e-learning, … Personal Productivity Groupware and Collaboration 2003 – Notes and Domino 6. 5 2002 – Notes and Domino 6. 0 1999 – Notes and Domino R 5 em b rac ed J 2 E E 1996 - Notes R 4 Notes/Domino R 4. 5 1993 - Notes R 3 e 1991 – Notes R 2 1989 –Notes R 1 mb rac ed the we b 11
Notes Begriffe • • • . nsf Feld Maske / Form View Replikation 12
Notes Datenbank (. nsf) • NSF = Notes Storage Facility • keine relationale Datenbank • speichert ALLE Inhalte einer Notes Anwendung: • vom Datensatz bis zur Zugriffskontrolliste • Datenstruktur am ehesten zu vergleichen mit XML (Namens-Werte-Paar) ist aber kein XML (siehe hierzu DXL) • mehr später. . . 13
Notes Feld • • • Text Date/Time Number Dialog Liste Checkbox Radio button Listbox Combobox Rich Text • • Authors Names Readers Password Formula Time zone Rich Text Lite Color 14
Maske • Notes speichert Daten in losem Schema • Masken geben Vorgabe bei der Erstellung von Dokumenten 15
View 16
Replikation • Synchronisation von Notes Datenbanken • zwischen Notes Client und Domino Server • zwischen Domino Servern • Abgleich von Teilmengen möglich • selektive Replikation • Client kann Teildokumente abrufen • . nsf-Datei macht Replikation möglich • Übertragung erfolgt verschlüsselt 17
Domino Server • Domino Server (seit Version 4. 5 vorher Notes Server) • Lotus Domino Server ist eine Entwicklerplattform für Groupware. Anwendung in verteilten Umgebungen mit Werkzeugen für Rapid Application Development (RAP). Domino bringt eine Benutzerverwaltung mit entsprechenden Sicherheitsmechanismen (Private- & Public-Key) und eine komplette verteilte Objekt-Datenbank (Object Store) als Grundfunktionalität mit. • Auf dem Domino Server können die Standardsoftware- Komponenten der Lotus Domino Family unter Zugriff auf die Benutzerverwaltung und die Objekt-Datenbanken implementiert werden. • Plattformunabhängigkeit: • Windows, Linux, AIX, HP-UX, i 5/OS, z. OS, Solaris • Keine strikte Abhängigkeit von Betriebssystemversionen und Verzeichnisdiensten 18
offene Strukturen Open Client Access SMTP, IMAP, MAPI, POP, LDAP Open Development HTTP & XML Webservices CGI, PERL, SSI, DSAPI Java Servlet Engine NNTP OBJECT SERVICES API WORKFLOW MESSAGING ROUTING C&S FREE TIME SEARCH Infrastructure Services VIEW INDEXING DIRECTORY SEARCH ENGINE Enterprise Services Cross Platform Notes (OLE, COM, Java. Script, LS, C++, XML, CORBA) Application Services Dual Security Notes & Web Databases & Templates IIOP ACCESS CONTROL ROLES BASED ACCESS NSF CLUSTERING NOTES & WEB SECURITY OBJECT STORE ADVANCED SERVICES DECS APPLICATION LOGIC SCH & TRIGGERED AGENTS REPLICATION RSA & S/MIME ENCRYPTION NTF BILLING DIGITAL SIGNATURES NTF PARTITIONING NT, OS/2, AS/400, S/390, AIX, HP-UX, Solaris, LINUX 19
Domino Zugriffs-Steuerung Notes-ID-Datei Notes Client Datenbank Dokument Feld Prüfung des Serverzugriffs Prüfung der Notes ID Prüfung des Serverzugriffs Prüfung des Internet-Passworts Browser Domino Prüfung der ACL Prüfung der Rollen Prüfung von Leserund Autorenfeldern Feldverschlüsselungen 20
Anwendungsentwicklung • • @Funktions Lotus Script Java • PHP 21
Schnittstellen (-Standards) • • SMTP, NNTP, POP 3, IMAP v. Card i. Cal CORBA Web. Services XML-Import/Export (DXL) Datenpumpen Support für RIM & mobile Endgeräte 22
Domino Clients • • Lotus Notes (Win & Mac, ab 7. 0. 1 Linux) Domino Web Access Domino Access for Outlook PDAs Web. Sphere Portal Version 9: auf Basis der Eclipse RCP externer Zugriff aus Java / PHP Apps 23
PIM & Standard-Anwendungen • • • e. Mail, Kalender & Aufgabenverwaltung Diskussion Teamroom Dokumenten-Bibliothek RSS-Feed-Generator Blog-Template 24
Architektur – Domino zentrierte Betrachtung Eclipse Rich Client Lotus Notes HTML Browser WMC WPS Everyplace Web Service DXL Anmerkung: Sametime PHP-Java Integration Excel ist nicht PDF dargestellt Zend Core . NSFDB 2 / Cloudscape (RDBMS) Windows, AIX, i 5, Unix, Linux 25
Domino & PHP • single Server (Domino & Apache) • multi Server (Domino & Apache) • PHP Integration Kit for Web. Sphere Application Server Community Edition • siehe Artikel auf alpha. Works: • http: //www. alphaworks. ibm. com/tech/phpintwasce 26
Single Server Konfiguration 1. Möglichkeit zwei httpd mit diff. Ports Abarbeitung des php Scripts kommt später! Configuring Apache, PHP, My. SQL and Domino for Windows 2000 (. . . ) 1. Edit httpd. conf 2. Add the following lines to the end of the file Apache Load. Module proxy_modules/mod_proxy. so Load. Module proxy_http_modules/mod_proxy_http. so Load. Module rewrite_modules/mod_rewrite. so Rewrite. Engine on Rewrite. Rule ^(. *). nsf(. *) http: //localhost: 81$1. nsf$2 [P] Quelle: http: //www. notestips. com/80256 B 3 A 007 F 2692/1/NAMO 5 RX 3 PX mod_rewrite Domino Httpd Port 81 Httpd Port 80 Browser Request 27
PROBLEM: die Lösung funktioniert nur für anonymen – read only - Zugriff (. . . ) In this configuration Port 81 can be blocked on your firewall as traffic to port 81 is only carried internally to the server. However this configuration has problems if you want to use it for more than Read Only pages. When you authenticate with the Domino server the server returns you to the URL it authenticated you with, which is the URL that was passed from Apache, which results in the browser displaying the internal port after login (see below), of course if this port is blocked by your firewall you will get a 404, however, as you are now authenticated with Domino we can remove the : 81 from the URL (the blocked port) and the page will display fine. This is because at this point Domino is simply serving the page and not authenticating you. This behaviour is "as expected" and Apache has a method of dealing with such returning URLs. (. . . ) Quelle: http: //www. notestips. com/80256 B 3 A 007 F 2692/1/NAMO 5 RX 3 PX Domino_PHP_Install. pdf 28
Single Server Konfiguration 2. Möglichkeit Domino httpd mit PHP via cgi Domino cgi PHP runtime Httpd Port 80 Windows Browser Request Quelle: http: //www 10. lotus. com/ldd/nd 6 forum. nsf/0/f 4833 adee 01587 cb 85257048007 8 f 52 d? Open. Document Su. SE 8. 2 - Domino 6. 5. 4 - PHP - can work! Posted by Alfa browser Tecnologias on 24. Jul. 05 at 06: 01 PM using a Web Category: Domino Server. Release: 6. 5. 4 Platform: Linux - Su. SE (. . . ) 1. Schritt Installation PHP (. . . ) 3. With Domino Administrator Open your server, Select your Server Document and create a "Web URL mapping/redirection" ( or a Internet Site Rule) Specify the following: - "URL --> Directory" - incoming: /php-bin - Target: /usr/bin - Access: Execute Save and close Restart HTTP (tell http restart) (. . . ) DOMINO_PHP_CGI. pdf 29
Dual Server Installation Apache PHP-Script <? PHP. . . Autorisierung via Notes User (Funktionsuser). . . Abfrage Daten. . . Verarbeitung Ergebnis ? > Httpd Port 80 Domino DXL DSAPI Web. Serv Httpd Port 80 Browser Request 30
Dual Server Installation Apache PHP-Script <? PHP. . . Autorisierung. . . Abfrage Daten. . . Verarbeitung Ergebnis ? > DB 2 / Cloudscape API Domino Httpd Port 80 DSAPI DXL Web. Serv Browser Request Httpd Port 80 31
Agenda • Domino – Geschichte & Basisinformationen • PHP im Kontext der IBM Software • DB 2 / Cloudscape, Sametime, Domino • PHP Notes Connector • Funktionsübersicht • Beispiel 32
PHP & DB 2 / Cloudscape • Zend Core for IBM • einfache Installation / Setup • liefert alle benötigten DB 2 UDB, Cloudescape und 3 rd party libraries • NEU: mit kostenloser DB 2 -C • Cloudescape Anwendungen können problemlos auf DB 2 umgestellt werden (gleiche API) • Webserver & Betriebssysteme • Apache 1. 3. x, 2. 0. x • AIX 5. 2, 5. 3 • Linux RHEL 3, SLES 9 • PHP, DB 2 UDB und Cloudescape online Dokumentation • Integriert mit Zend Platform. TM 33
PHP & Sametime • Integration via STLinks • Java Script Code wird in PHP Script integriert • Namensfeld notwendig für Awarnes-Funktion • Login am Sametime Server aus PHP Anwendung • Apache & Sametime Login ? >>> LDAP Authentifizierung • STLinks Ergänzung für Sametime Server notwendig (kostenlose Erweiterung) • IBM Redpaper verfügbar • behandelt die Nutzung von STLinks in HTML Websites • Lotus Instant Messaging/Web Conferencing (Sametime): Building Sametime-Enabled Applications • http: //www. redbooks. ibm. com/redbooks/pdfs/sg 247037. pdf 34
PHP & Domino • ab Domino 5 • PHP kann zunächst einmal jeden XML Output des Domino Servers verarbeiten • mit Domino 7 • Nutzung der Domino Webservices durch PHP • mit PHP 5 • wurde das XML Handling und die Arbeit mit Webservices erweitert und verbessert 35
LAMP & Domino Single Server Installation • Nicht mit Standardkonfiguration möglich • Mod_rewrite notwendig • Veranlast Apache. nsf Anfrage durchzuleiten • Domino Server Konfig: • HTTP Port ungleich Apache Port • . . • (Google liefert eine (englische? ) Website mit guter Erklärung) 36
Agenda • Domino – Geschichte & Basisinformationen • PHP im Kontext der IBM Software • DB 2 / Cloudscape, Sametime, Domino • PHP Notes Connector 37
Agenda • Interner Aufbau von Lotus Notes • Zugriff auf Notes Daten • Datenbanktreiber, Objekte • HTTP, XML • Notes Connector • Besonderheiten, Bewertung 38
Interner Aufbau von Lotus Notes • Notes Datenbank : Container für Datensätze • enthält beliebig viele verschiedene Notes • Note : Datensatz • enthält beliebig viele verschiedene Items • Item : Container für Daten • speichert Daten (z. B. Zahl, Text oder Richtext) • Alle Informationen einer Datenbank werden als Notes gespeichert, Notes mit Nutzdaten werden als Dokumente bezeichnet • Gesamte Applikation in einer Datenbankdatei, auch Gestaltung und Sicherheit 39
Notes - Dokument/Form/View Dokument: Items Form: Anzeige/Bearbeitung View: 40
Interner Aufbau von Lotus Notes Sicherheit • Personen, Gruppen, Rollen und Richtlinien • Zugriffsrechte für Datenbanken, Dokumente und Felder • Verschlüsselung für Datenbanken und Felder 41
Zugriff auf Notes Daten - Topologie 42
Zugriff auf Notes Datenbanktreiber • Lotus Notes ist keine relationale Datenbank • ODBC Treiber für Windows Anwendungen verfügbar • DB 2 als Datenspeicher für Lotus Notes befindet sich im Test Stadium. • Werkzeuge zum Datenabgleich zwischen Lotus Notes und relationalen Datenbanken verfügbar z. B. LEI • Kein aktueller JDBC Treiber verfügbar 43
Zugriff auf Notes Daten Objekte • Lotus Notes bildet Daten und Funktionen intern in einem Objektmodell ab. • Front-End Klassen: nur im Notes Client verwendbar • Back-End Klassen: • Notes. Session, Notes. Database, • Notes. Document, Notes. Item, • Notes. Document. Collection, Notes. View • Notes Objekte können in diversen Programmiersprachen verwendet werden 44
Zugriff auf Notes Daten Objekte • COM Schnittstelle: Verwendung von Notes Client Funktionen in anderen Windows Anwendungen • JAVA Schnittstelle: Local oder Remote über CORBA verwendbar, Domino Internet Inter. Orb Protocol läuft als eigener Task im Domino Server Achtung! Threading, Sessionhandling, Recycle 45
Zugriff auf Notes Daten Objekte • Notes API: Plattformabhängige C/C++ Programme und Server Erweiterungen • Fast alles ist möglich, DSAPI Programme laufen z. B. als "Filter" im HTTP Stack des Servers • Achtung! Kleinste Fehler können katastrophale Folgen haben 46
Zugriff auf Notes Daten HTTP • Domino Server kann standardmäßig HTML Code erzeugen, eigener oder fremder HTTP Stack • Mail Anwendung (Domino Web Access) sehr leistungsfähig • Mit Domino Off. Line Service kann eine Notes Maildatenbank über Webbrowser in eine Lokale Cloudscape Datenbank repliziert werden • HTTP Zugriffe lassen sich für Datenbanken und Designelemente generell sperren 47
Zugriff auf Notes Daten Domino XML Language • Ziel: Abbildung aller Notes Datenstrukturen als XML Code • Read. View. Entries: URL Parameter die Daten in einem View als DXL Code liefert Demo 48
Domino XML Language Read. View. Entries http: //www. visol. de/ezdemo. nsf/menuflat? Read. View. Entries 49
Domino XML Language - Dokument 50
Zugriff auf Notes Daten Domino XML Language • Ziel: Abbildung aller Notes Datenstrukturen als XML Code • Read. View. Entries: URL Parameter die Daten in einem View als DXL Code liefert • Problem: Es existiert kein URL Parameter der Dokumente als DXL Code liefert. • Lösung: Selbst ein Programm schreiben das die Notes Objekte anspricht • Einfacher: Notes. Connector verwenden 51
Notes. Connector - Architektur 52
Notes. Connector - Eigenschaften • Generische Lösung zum Zugriff auf Lotus Notes Daten • ermöglicht den lesenden und schreibenden Zugriff auf Text-, Datum- und Zahlen-Felder in beliebigen Notes-Datenbanken. • Keine Veränderungen in den Notes Anwendungen • für den Zugriff auf Ihre Notes-Daten sind keine speziellen Ansichten in Notes erforderlich – der Zugriff kann direkt auf Dokumente erfolgen. • Kein direkter Webzugriff auf Zieldatenbanken • Zieldatenbanken müssen nicht für den Webzugriff geöffnet werden. 53
Notes. Connector - Eigenschaften • Unterstützt anonyme und authentifizierte Zugriffe • Durch die Unterstützung authentifizierter Zugriffe können Sie die komplette Notes-Security für Ihre Notes-Anwendungen auch weiterhin nutzen. • Nutzbar für beliebige PHP-Anwendungen • Spezielle Version für e. Z Publish • Die Extension wird einfach in e. Z Publish aktiviert und ermöglicht so die komfortable Nutzung der leistungsfähigen e. Z publish Templatesprache für Zugriffe auf Notes Daten. • Verfügbar als Script-Lösung in einer Notes Datenbank oder als DSAPI-Filter 54
Notes Connector - Funktionen • Datenzugriff • Dokumentenmodus • Viewmodus • Dokumentenselektion • Einzelselektion • Mehrfachselektion • über Notes-View • über @Function • über Volltext-Suche • Feldselektion 55
Notes Connector - Funktionen • Unterstützte Notes Datentypen • • Text / Text-List Number / Number-List Date/Time / Date/Time-List Attachments • Lesender und schreibender Zugriff • Allen Daten werden als Array übertragen: erlaubt einfaches durchloopen in PHP • Notes Rich. Text (formatierter Text, eingebettete Objekte) nur als Abstract bzw. mit zusätzlichen Mitteln 56
Notes Connector - Demo • Einfache PHP-Beispiele • Bistro, Mensa, etc. • Kalender • Integration in e. Z publish • Kalender • Mitarbeiter 57
Zugriff auf Notes Daten Besonderheiten • Jedes Dokument kann völlig unterschiedliche Items enthalten • Items mit gleichem Namen können unterschiedlichen Types sein • Leere Items sind immer Text Items • Items können eine Liste von Texten, Zahlen oder Datum/Uhrzeitwerten enthalen • Notes Richtext ist nicht gleich RTF 58
Zugriff auf Notes Daten Bewertung • Datenbankorientiert: Domino als Datenbankserver • ODBC - Windows Standardprotokoll • Notes auf DB 2 / LEI - Notes Daten in Relationalen Datenbanken • Objekt- / Funktionsorientiert: Domino als Applikationsserver • COM -> Windows Client Anwendungen • JAVA / CORBA -> Königsweg der IBM • C/C++ API -> (fast) alles Geht, hoher Aufwand 59
Zugriff auf Notes Daten Bewertung • HTTP Zugriff: Domino als Webserver • Plain HTML -> schnell und einfach (parsen oder einbetten) • DWA -> leistungsfähig, als Frame einbetten (nur Mail) • XML / DXL: Domino als Datenquelle • • Read. View. Entries -> performant aber eingeschränkt nutzbar Notes. Connector -> universell RSS Datenbank -> wie Notes. Connector(LS) für RSS Feeds SOAP -> selbst programmieren oder Notes. Connector verwenden 60
Notes Connector - Resourcen • Q+A: Fragen zum Vortrag? • Fragen, Anregungen, Projektanfragen: php@visol. de • Sonstige Vi. Sol-Leistungen: Beratung, Integrationssupport, Projektlösungen • Weitere Informationen / Downloads unter http: //www. visol. de/php • • Produktflyer als PDF Artikel aus PHP-Magazin 4/2006 Kostenlose PHP-Klasse (View-Connector) Notes Connector Demo Version 61
IBM Resourcen • IBM Partnership Solution Center • Anlaufstelle für Developer • Informationen zum IBM Business Partner Programm • www. ibm. com/developerworks/ • www. redbooks. ibm. com 62
- Slides: 63