Пример #1
0
def initialize(context):
    from Products.Marshall import registry
    from Products.Marshall import predicates

    context.registerClass(
        registry.Registry,
        permission='Add Marshaller Registry',
        constructors=(registry.manage_addRegistry,),
        icon='www/registry.png',
        )

    context.registerClass(
        instance_class=predicates.Predicate,
        permission='Add Marshaller Predicate',
        constructors=predicates.constructors,
        icon='www/registry.png')

    # Load marshallers registered by the way of egg entry points.
    for ep in pkg_resources.iter_entry_points('marshall.component'):
        component = ep.load()
        registry.registerComponent(
            ep.name, getattr(component, '__name__', ep.name), component)
Пример #2
0
def initialize(context):
    from Products.Marshall import registry
    from Products.Marshall import predicates

    context.registerClass(
        registry.Registry,
        permission='Add Marshaller Registry',
        constructors=(registry.manage_addRegistry, ),
        icon='www/registry.png',
    )

    context.registerClass(instance_class=predicates.Predicate,
                          permission='Add Marshaller Predicate',
                          constructors=predicates.constructors,
                          icon='www/registry.png')

    # Load marshallers registered by the way of egg entry points.
    for ep in pkg_resources.iter_entry_points('marshall.component'):
        component = ep.load()
        registry.registerComponent(ep.name,
                                   getattr(component, '__name__', ep.name),
                                   component)
    packages = os.path.join(package_home(globals()), 'lib', 'dateutil')
    log('DateUtil python package not found in your system. '
        'Using internal copy at: %s' % packages)
    sys.path.append(packages)

from Products.Calendaring.marshaller import CalendarMarshaller
from Products.Calendaring.marshaller import EventMarshaller

# Kickstart Extensions.
from Products.Calendaring.Extensions import Install as _Install
del _Install

# If Marshall is available, register the marshallers.
try:
    from Products.Marshall.registry import registerComponent
    registerComponent('calendaring_calendar', 'Calendar Marshaller',
                      CalendarMarshaller)
    registerComponent('calendaring_event', 'Event Marshaller',
                      EventMarshaller)
except ImportError:
    pass

def initialize(context):
    from Products.Calendaring.tools import calendar
    from Products.Calendaring.common import DT2dt

    try:
        from Products.ATContentTypes.content import event
        event.DT2dt = DT2dt
        log('Patching ATContentTypes to return UTC datetime.')
    except ImportError:
        pass
Пример #4
0
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
"""
"""

from Products.Marshall.registry import registerComponent

# Register default Archetypes marshallers
from Products.Archetypes.Marshall import PrimaryFieldMarshaller
from Products.Archetypes.Marshall import RFC822Marshaller

registerComponent('primary_field', 'Primary Field Marshaller',
                  PrimaryFieldMarshaller)
registerComponent('rfc822', 'RFC822 Marshaller', RFC822Marshaller)

from Products.Marshall.handlers.atxml import ATXMLMarshaller
registerComponent('atxml', 'ATXML Marshaller', ATXMLMarshaller)
Пример #5
0
""" eea.rdfmarshaller package """

from Products.Marshall.registry import registerComponent
from eea.rdfmarshaller import marshaller
from eea.rdfmarshaller import config

registerComponent('surfrdf', 'RDF Marshaller', marshaller.RDFMarshaller)

registerComponent('surfrdfs', 'RDF Schema Marshaller',
                  marshaller.RDFMarshaller)

__all__ = [
    config.__name__,
]
Пример #6
0
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
"""
"""

from Products.Marshall.config import hasLibxml2
from Products.Marshall.registry import registerComponent

# Register default Archetypes marshallers
from Products.Archetypes.Marshall import PrimaryFieldMarshaller
from Products.Archetypes.Marshall import RFC822Marshaller

registerComponent('primary_field', 'Primary Field Marshaller',
                  PrimaryFieldMarshaller)
registerComponent('rfc822', 'RFC822 Marshaller', RFC822Marshaller)

if hasLibxml2:
    # Now register our own xml marshallers
    from Products.Marshall.handlers.simple import SimpleXMLMarshaller

    registerComponent('simple_xml', 'Simple XML Marshaller',
                      SimpleXMLMarshaller)

from Products.Marshall.handlers.atxml import ATXMLMarshaller
registerComponent('atxml', 'ATXML Marshaller', ATXMLMarshaller)