[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/TranslationService/Views/XMLRPC - Methods.py:1.1 __init__.py:1.1 configure.zcml:1.1

Stephan Richter srichter@cbu.edu
Thu, 11 Jul 2002 03:12:45 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/TranslationService/Views/XMLRPC
In directory cvs.zope.org:/tmp/cvs-serv24977/lib/python/Zope/App/OFS/Services/TranslationService/Views/XMLRPC

Added Files:
	Methods.py __init__.py configure.zcml 
Log Message:
I moved the OFS-specific parts of the Translation Service to 
Zope.App.OFS.Services, which is the way all the other local/placeful 
service impolementations do it.


=== Added File Zope3/lib/python/Zope/App/OFS/Services/TranslationService/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/07/11 07:12:43 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/App/OFS/Services/TranslationService/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/07/11 07:12:43 srichter Exp $
"""


=== Added File Zope3/lib/python/Zope/App/OFS/Services/TranslationService/Views/XMLRPC/configure.zcml ===
<zopeConfigure
   xmlns='http://namespaces.zope.org/zope'
   xmlns:xmlrpc='http://namespaces.zope.org/xmlrpc'
>

  <!-- Translation Service View Directives -->

  <xmlrpc:view
      name="methods"
      for="Zope.I18n.ITranslationService."
      permission="Zope.ManageContent" 
      allowed_methods="getAllLanguages getAllDomains"
      factory=".Methods." />
      
</zopeConfigure>