Provides moPage integration for Plone.
Project description
Introduction
ftw.mopage provides a plone xml interface for the moPage CMS of anthrazit.
The package registers tree views:
mopage_news.xml
mopage_events.xml
mopage_geolocations.xml
If you call a view, a new xml will be generated on the filesystem and will be downloaded.
Requirements
The package is compatible with Plone 4.x.
Installing
Add ftw.mopage to your buildout configuration:
[instance] eggs = ftw.mopage
Marker Interfaces
IMopageExporter
IMopageEvent
IMopageGeolocation
IMopageNews
Adapters Interfaces
IMopageObjectLookup (context, request)
IMopageEventObjectLookup
IMopageNewsObjectLookup
IMopageGeolocationObjectLookup
IMopageDataProvider (context, request)
IMopageGeolocationDataProvider
IMopageEventDataProvider
IMopageNewsDataProvider
IMopageDataValidator (context, request, dataprovider)
IMopageGeolocationDataValidator
IMopageEventDataValidator
IMopageNewsDataValidator
IMopageXMLGenerator (context, request)
IMopageGeolocationXMLGenerator
IMopageEventXMLGenerator
IMopageNewsXMLGenerator
Implementation
If you call export view, the following steps will be execute in the given order:
Get Objects
Get MopageObjectLookup multiadapter
Call get_brains method of MopageObjectLookup
Get Data
Get MopageDataProvider multiadapter with every object
Call get_data method of MopageDataProviders
Validate Data
Get MopageDataValidator multiadapter of every objects dataprovider
Call validate method of MopageDataValidator
Abort or Continue
If the MopageDataValidator raises an error, we abort the export
If the MopageDataValidator validation is valid, we continue exporting data
Create the xml string
Get MopageXMLGenerator multiadapter
Call generate_xml_string method of MopageXMLGenerator
Return the string
Return the xml string as xml download file
Usage
You need to mark your content types as MopageExporters.
To get the data of a MopageExporter, you need to override the specific MopageDataProvider to implement the dataexport.
Mark new content type as a specific MopageExporter
>>> from zope.interface import implements >>> from Products.ATContentTypes.content.file import ATFile >>> from ftw.mopage.interfaces import IMopageNews >>> class File(ATFile): ... implements(IFile, IMopageNews)
Mark existing content type as a specific MopageExporter
configure.zcml:
<configure xmlns="http://namespaces.zope.org/zope" xmlns:five="http://namespaces.zope.org/five"> <five:implements class="Products.ATContentTypes.content.file.ATFile" interface="ftw.mopage.interfaces.IMopageNews" /> </configure>
Override specific MopageDataProvider
configure.zcml:
<configure xmlns="http://namespaces.zope.org/zope"> <adapter for="ftw.mopage.interfaces.IMopageNews example.customization.browser.interfaces.IExampleCustomizatio" factory=".data_provider.NewsDataProvider" provides="ftw.mopage.interfaces.IMopageNewsDataProvider" /> </configure>
data_provider.py:
>>> from ftw.mopage.data_provider import MopageNewsDataProvider >>> class NewsDataProvider(MopageNewsDataProvider): ... def get_data(self): ... ... data = { ... 'id': 'äxx', ... 'titel': 'abc123', ... 'textmobile': 'abc123', ... 'datumvon': 'abc123', ... 'mutationsdatum': 'abc123', ... } ... ... return data
Additional information
In the docs-directory you find the official moPage interface documentation on Anthrazit-side.
Links
Continuous integration: https://jenkins.4teamwork.ch/search?q=ftw.mopage
Copyright
This package is copyright by 4teamwork.
ftw.mopage is licensed under GNU General Public License, version 2.
Changelog
1.0 (2016-11-01)
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ftw.mopage-1.0.tar.gz
.
File metadata
- Download URL: ftw.mopage-1.0.tar.gz
- Upload date:
- Size: 316.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eef0277bc6ec17b33c11db717ff41db71a14d63b1b763ed70b3c0f3c4f2a9221 |
|
MD5 | 7079cb3892e62c837207c2f323c3af2a |
|
BLAKE2b-256 | 528869b6cf489556aab7bb21d795ab8b4fc37295e7c0334a7039f48f5f5b5ae4 |