Download presentation
Presentation is loading. Please wait.
Published byBennett Reed Modified over 8 years ago
1
Application Integration With Zope/Plone Sankalp Agarwal Member IntraGOV Team
2
Agenda Integration of Relational Databases. External Application Integration. Advance ZMI Options.
3
Integration of Relational Databases Zope Can Be connected to following RDBMS -Oracle-DB2-PostgreSQL -MYSQL-SAP DB-Sybase -SQL Server-Gadfly
4
Adapters for Connecting Databases PostgreSQL-ZPsycopgDA Oracle- DCOracle2 package from Zope Corporation includes the ZoracleDA DB2- ZDB2DA MySQL -ZMySQLDA SAP DB - ZsapdbDA Sybase -SybaseDA SQLServer - ZODBC DA Gadfly -The Gadfly Database Adapter is built into Zope.
5
Integration of Relational Databases Integration of Gadfly Database. Integration of PostgreSQL. Integration of MySQL.
6
Gadfly Gadfly is a relational database written in Python. Gadfly is included with Zope for demonstration purposes and small data sets. Gadfly is fast, but is not intended for large amounts of information since it reads its entire data set into memory.
7
Creating Gadfly Database To Create a gadfly database add a folder with having name as the database name in your {plone instance}/var/gadfly Eg: Create a folder employee In windows C:\Program Files\Plone 2\Data\var\gadfly In Linux: /home/ZI/var/gadfly A Gadfly database employee will be created.
8
Connection String To create a connection to gadfly database – Navigate to ZMI – Add a Z Gadfly Database Connection – Provide a connection name as id – Select the database as Data Source – Click Add
9
Add a SQL To Run a SQL command – Navigate to ZMI – Add a Z SQL Method – Provide a id to it – Select the connection id – Provide arguments if any – Provide SQL Statement like select, insert etc. – Click Add
10
Display Result of Z SQL Add a Page Template with the following code <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" metal:use-macro="here/main_template/macros/master" i18n:domain="plone"> FILL IN YOUR XHTML/TAL TO DISPLAY RESULTS
11
Demo
12
Limitation of Gadfly Database. It is dependent on Python Can’t Handle large amount of data since it reads its entire data set into memory. Can’t Handle Large relations.
13
PostgreSQL Connectivity PostgreSQL is a leading open source relational database with good support for SQL standards. Database Adopter used for Connecting Zope with PostgreSQL is Psycopg. Psycopg dependency PostgreSQL mxDateTime module for python.
14
Psycopg Installation Download MxDateTime Module from http://www.egenix.com/products/python/mxBase/mxDateTime/ Untar(Unzip) the module. Run the following command./{python-path} setup.py build./{python-path} setup.py install where { python-path} is the python installation directory. Eg. /home/ZopeSetup/Python/bin/python
15
Psycopg Installation Download the psycopg2-latest.tar file from www.initd.org/ Untar ( Unzip) the file. Change the directory to the extracted directory Edit the following Configuration in setup.cfg – Uncomment and set the “mx_include_dir=“ to the mxdatetime installation path Eg: /home/ZopeSetup/Python/lib/site-packages/mx – Uncomment and set pgconfig and include_dir if custom postgreSQL installation is used.
16
Psycopg Installation Run the following command./{python-path} setup.py build./{python-path} setup.py install where { python-path} is the python installtion directory. Eg. /home/ZopeSetup/Python/bin/python Copy the Zpsycopg Folder in Zope/lib/Python/Products Change the permissions if necessary. Restart Zope.
17
Connection String To create a connection to postgreSQL database – Navigate to ZMI – Add a Psycopg2_database_connection – Provide a id – Provide a connection string with following credentials host dbname port user password Eg: host=localhost port=5432 dbname=employee user=xyz passwd=xyz – Click Add
18
Add a SQL To Run a SQL command – Navigate to ZMI – Add a Z SQL Method – Provide a id to it – Select the connection id – Provide arguments if any – Provide SQL Statement like select, insert etc. – Click Add
19
Demo
20
MySQL Connectivity MySQL is a leading open source relational database with good support for SQL standards. Database Adopter used for Connecting Zope with MySQL is zmysqlda. Zmysqlda dependency MySQL mysql-python module for python.
21
Zmysqlda Installation Install mysql-python to your Python. Most Linux- distributions are offering this packaged. Download zmysqlda from source forge and extract it to your Products directory. Restart Zope, login as manager, go to your Plone ZMI.
22
Connection String To Create a Connection String – Navigate to ZMI – Add a Z MySQL Database Connection Provide a id – Provide a connection string with following credentials host dbname port user password Eg: host=localhost port=5432 dbname=employee user=xyz passwd=xyz – Click Add
23
Add a SQL To Run a SQL command – Navigate to ZMI – Add a Z SQL Method – Provide a id to it – Select the connection id – Provide arguments if any – Provide SQL Statement like select, insert etc. – Click Add
24
Passing Parameters in ZSQL <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" metal:use-macro="here/main_template/macros/master" i18n:domain="plone"> FILL IN YOUR XHTML/TAL TO DISPLAY RESULTS
25
External Application Integration Introduction to PHParser/PHPGateway. Installation of PHParser/PHPGateway. Creating Scripts with PHParser. Linking External Application. Single Sign on.
26
PHParser/PHPGateway PHParser/PHPGateway aims to combine Zope and PHP together. It provides you a possibility to run PHP scripts under Zope and Plone. PHParser is a DTML-Document-like object. Its content when being published is first rendered by the DTML engine and then passed to PHP CGI. The result from PHP CGI will be finally displayed. PHPGateway is a Folder-like object. When its docroot property is pointed to a real directory in the file system, the entire directory can be published by Zope, even as a virtual host. Especially, the.php files under that directory will be directly passed to PHP CGI without DTML rendering. Latest Stable version is 1.1.15
27
Installating PHParser/PHPGateway Prerequisites – PHP 4.0 or above with CGI Module. Download – http://www.zope.org/Members/hewei/PHParser
28
Installation on Linux Untar ( Unzip ) the PHParser-x.y.z.tar.gz file in {Zope Home}/lib/python/Products – {Zope Home} is the zope installation directory eg: /home/zope/lib/python/Products Edit the phparser.py file in PHParser folder – PHPath with the php installtion directory eg: PHPath = "/var/www/cgi-bin/php" – Note: Perform this only in case for customized php. If Default php is been used do not perform this step. Restart Zope.
29
Installation on Windows Untar ( Unzip ) the PHParser-x.y.z.tar.gz file in {Plone Home}/lib/python/Products – {plone Home} is the plone installation directory eg: /C:/Program Files/Plone 2/Zope/lib/python/Products Edit the phparser.py file in PHParser folder – PHPath with the php installtion directory eg: PHPath = "c:\\php\\php-cgi.exe“ Note: Perform this only in case for customized php. If Default php is been used do not perform this step. Restart plone.
30
Adding a PHParser Navigate to ZMI Add A PHParser Provide a id Click Save
31
Adding A PHPGateway Navigate to ZMI Add a PHPGateway Provide a id Provide docroot as the root web directory of php. – Eg: /var/www/html
32
Demo
33
Single Sign On For Single sign on User id has to be passed in application with /without encryption. PHParser gets the login user id by $ZOPE_VARS[AUTHENTICATED_USER];
34
Advance ZMI Options Restrict User to change password on login. Error Logs Portal Catelog Syndication & RSS feeds
35
Restrict User to change password Navigate to ZMI Edit or add the Boolean field “must_change_password “ Note: User will be restricted only before first login.
36
Error Log Error log provides debugging and error logging information in real time. When the site encounters an error, it will be logged in the site error log, allowing the administrator to review the error. For more specific details on error Install Plone error reporting from quick installer.
37
Error Log Navigate to ZMI Click error_log Click on error to view details. Properties of error log – No. of exception to keep – Ignored exception type
38
Error Log
39
Portal Catalog Catalog is used for indexing and faster access to the content. Metadata is stored in Catalog. To Search in catalog 'portal_catalog' is used. By Default ZCatelog is used which is ZOPE’s built in search engine. It allows you to categorize and search all kinds of ZOPE objects.
40
Syndication in Plone RSS- Really Simple Syndication/ Rich Site Summary. RSS Feeds are based on XML. Plone has had a syndication tool but it's not turned on by default To Enable Syndication – Navigate to ZMI – Open Portal_syndication – Check the visible box – Click Save This means now a syndication tab is visible in the content view of plone.
41
Syndication in Plone
42
Setting Syndication Properties – Click the syndication tab – Enable/ disable syndication – Setting the number of item to be syndicated – Update Period – Update frequency – Click save.
43
RSS Feeds To Add RSS Feeds from other sites we have to use a RSS Aggregator RSS Aggregator in Plone – CMFSin – CMFFeed – Pod Channel Demo
44
Questions
45
Thank You
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.