[Zope-Checkins] CVS: Zope3/lib/python/Zope/I18n/Views/XMLRPC - Methods.py:1.1 __init__.py:1.1 xmlrpc.zcml:1.1
Stephan Richter
srichter@cbu.edu
Sun, 16 Jun 2002 14:25:15 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/I18n/Views/XMLRPC
In directory cvs.zope.org:/tmp/cvs-serv23163/Views/XMLRPC
Added Files:
Methods.py __init__.py xmlrpc.zcml
Log Message:
Commit part 1:
I have done quiet some work this weekend on refining and refactoring the
Translation Service and it should be ready for EP now:
- Refactored the interfaces into more standard read and write interfaces.
- Implemented an Import and Export feature using geyyexy files.
- Implemented Message Synchronisation mechanism via XML-RPC.
- Improved the overall look and feel of the LocalTranslation Service.
- Added an icon for the Translation Service.
=== Added File Zope3/lib/python/Zope/I18n/Views/XMLRPC/Methods.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
$Id: Methods.py,v 1.1 2002/06/16 18:25:14 srichter Exp $
"""
from Zope.Proxy.ProxyIntrospection import removeAllProxies
from Zope.Publisher.XMLRPC.XMLRPCView import XMLRPCView
from Zope.App.PageTemplate import ViewPageTemplateFile
class Methods(XMLRPCView):
__implements__ = XMLRPCView.__implements__
def getAllDomains(self):
return self.context.getAllDomains()
def getAllLanguages(self):
return self.context.getAllLanguages()
def getMessagesFor(self, domains, languages):
messages = []
for domain in domains:
for msg in self.context.getMessagesOfDomain(domain):
if msg['language'] in languages:
messages.append(removeAllProxies(msg))
return messages
=== Added File Zope3/lib/python/Zope/I18n/Views/XMLRPC/__init__.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
$Id: __init__.py,v 1.1 2002/06/16 18:25:14 srichter Exp $
"""
=== Added File Zope3/lib/python/Zope/I18n/Views/XMLRPC/xmlrpc.zcml ===
<zopeConfigure
xmlns='http://namespaces.zope.org/zope'
xmlns:security='http://namespaces.zope.org/security'
xmlns:xmlrpc='http://namespaces.zope.org/xmlrpc'
>
<!-- Translation Service View Directives -->
<xmlrpc:view
name="methods"
for="Zope.I18n.ITranslationService."
permission="Zope.ManageContent"
allowed_attributes="getAllLanguages getAllDomains"
factory=".Methods." />
</zopeConfigure>