Skip to main content

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

  1. Get MopageObjectLookup multiadapter

  2. Call get_brains method of MopageObjectLookup

Get Data

  1. Get MopageDataProvider multiadapter with every object

  2. Call get_data method of MopageDataProviders

Validate Data

  1. Get MopageDataValidator multiadapter of every objects dataprovider

  2. Call validate method of MopageDataValidator

Abort or Continue

  1. If the MopageDataValidator raises an error, we abort the export

  2. If the MopageDataValidator validation is valid, we continue exporting data

Create the xml string

  1. Get MopageXMLGenerator multiadapter

  2. Call generate_xml_string method of MopageXMLGenerator

Return the string

  1. 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.

Changelog

1.0 (2016-11-01)

  • Initial release

Metadata

Release files for ftw.mopage 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ftw.mopage 1.0
File Size Uploaded
ftw.mopage-1.0.tar.gz 316.3 kB Details

Release files / ftw.mopage-1.0.tar.gz

Download URL ftw.mopage-1.0.tar.gz
Size 316.3 kB
Tags Source
SHA-256 checksum
How to use checksums
eef0277bc6ec17b33c11db717ff41db71a14d63b1b763ed70b3c0f3c4f2a9221
BLAKE2b-256 checksum
How to use checksums
528869b6cf489556aab7bb21d795ab8b4fc37295e7c0334a7039f48f5f5b5ae4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page