Index: /quintagroup.gauth/trunk/quintagroup/gauth/__init__.py
===================================================================
--- /quintagroup.gauth/trunk/quintagroup/gauth/__init__.py	(revision 2578)
+++ /quintagroup.gauth/trunk/quintagroup/gauth/__init__.py	(revision 2579)
@@ -1,1 +1,5 @@
   # -*- extra stuff goes here -*- 
+
+from zope.i18nmessageid import MessageFactory
+
+GAuthMessageFactory = MessageFactory('quintagroup.gauth')
Index: /quintagroup.gauth/trunk/quintagroup/gauth/browser/__init__.py
===================================================================
--- /quintagroup.gauth/trunk/quintagroup/gauth/browser/__init__.py	(revision 2579)
+++ /quintagroup.gauth/trunk/quintagroup/gauth/browser/__init__.py	(revision 2579)
@@ -0,0 +1,1 @@
+#
Index: /quintagroup.gauth/trunk/quintagroup/gauth/browser/configlet.py
===================================================================
--- /quintagroup.gauth/trunk/quintagroup/gauth/browser/configlet.py	(revision 2579)
+++ /quintagroup.gauth/trunk/quintagroup/gauth/browser/configlet.py	(revision 2579)
@@ -0,0 +1,56 @@
+from zope.formlib import form
+from zope.interface import Interface
+from zope.interface import implements
+from zope.component import adapts
+from zope.schema import ASCII
+#from zope.schema import TextLine
+from zope.schema import Password
+from zope.app.form.browser.textwidgets import ASCIIWidget
+
+from zope.app.component.hooks import getSite
+
+from plone.app.controlpanel.form import ControlPanelForm
+
+from Products.CMFCore.utils import getToolByName
+from Products.CMFPlone.interfaces import IPloneSiteRoot
+from Products.CMFDefault.formlib.schema import SchemaAdapterBase
+from Products.CMFDefault.formlib.schema import ProxyFieldProperty
+
+from quintagroup.gauth import GAuthMessageFactory as _
+
+
+# Configlet schemas
+class IGAuthConfigletSchema(Interface):
+
+    gauth_email = ASCII(
+        title=_(u"Google Authentication email"),
+        default=None,
+        required=True)
+
+    gauth_pass = Password(
+        title=_(u'Google Authentication password'),
+        default=None,
+        required=True)
+
+class GAuthConfigletAdapter(SchemaAdapterBase):
+
+    adapts(IPloneSiteRoot)
+    implements(IGAuthConfigletSchema)
+
+    def __init__(self, context):
+        super(GAuthConfigletAdapter, self).__init__(context)
+        self.portal = getSite()
+        pprop = getToolByName(self.portal, 'portal_properties')
+        self.context = pprop.gauth_properties
+
+    gauth_email = ProxyFieldProperty(IGAuthConfigletSchema['gauth_email'])
+    gauth_pass = ProxyFieldProperty(IGAuthConfigletSchema['gauth_pass'])
+
+
+class GAuthConfiglet(ControlPanelForm):
+
+    form_fields = form.FormFields(IGAuthConfigletSchema)
+    form_fields['gauth_email'].custom_widget = ASCIIWidget
+    label = _("Google Authentication settings")
+    form_name = _("")
+    description = _("")
Index: /quintagroup.gauth/trunk/quintagroup/gauth/browser/configure.zcml
===================================================================
--- /quintagroup.gauth/trunk/quintagroup/gauth/browser/configure.zcml	(revision 2579)
+++ /quintagroup.gauth/trunk/quintagroup/gauth/browser/configure.zcml	(revision 2579)
@@ -0,0 +1,37 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    i18n_domain="quintagroup.gauth">
+
+    <!-- Registries for configlet -->
+    <adapter factory=".configlet.GAuthConfigletAdapter" />
+
+    <browser:page
+        name="gauth-controlpanel"
+        for="Products.CMFPlone.interfaces.IPloneSiteRoot"
+        class=".configlet.GAuthConfiglet"
+        permission="cmf.ManagePortal"
+        />
+
+    <browser:page
+        name="gauth-test"
+        for="*"
+        template="testview.pt"
+        class=".testview.TestView"
+        permission="zope2.Public"
+        />
+
+    <browser:page
+        name="gauth-download"
+        for="*"
+        class=".testview.TestView"
+        attribute="download"
+        permission="zope2.Public"
+        />
+
+    <browser:resource
+        name="gauth_icon.gif"
+        image="gauth_icon.gif"
+        />
+
+</configure>
Index: /quintagroup.gauth/trunk/quintagroup/gauth/browser/testview.pt
===================================================================
--- /quintagroup.gauth/trunk/quintagroup/gauth/browser/testview.pt	(revision 2579)
+++ /quintagroup.gauth/trunk/quintagroup/gauth/browser/testview.pt	(revision 2579)
@@ -0,0 +1,25 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      xmlns:tal="http://xml.zope.org/namespaces/tal"
+      metal:use-macro="here/main_template/macros/master"
+      >
+  <body>
+    <div metal:fill-slot="main">
+      <h1 tal:content="view/sh_title">Spreadsheet title</h1>
+      <dl>
+	<tal:loop tal:repeat="f view/files">
+          <dt>Worksheet: <span tal:content="string:${repeat/f/number} (${f/title})">1</span></dt>
+          <dd tal:content="structure f/html" tal:condition="f/html">
+	    <table>
+	      <tr><td>col 1 name</td><td>col 2 name</td></tr>
+	      <tr><td>col 1 value</td><td>col 2 value</td></tr>
+	    </table>
+          </dd>
+          <dd><a href="file://"
+		 tal:attributes="href string:${view/base_download_url}&i=${repeat/f/index};">Download</a>
+          </dd>
+	  </tal:loop>
+      </dl>
+    </div>
+  </body>
+</html>
Index: /quintagroup.gauth/trunk/quintagroup/gauth/browser/testview.py
===================================================================
--- /quintagroup.gauth/trunk/quintagroup/gauth/browser/testview.py	(revision 2579)
+++ /quintagroup.gauth/trunk/quintagroup/gauth/browser/testview.py	(revision 2579)
@@ -0,0 +1,61 @@
+import re
+from zope.component import queryAdapter
+from zope.component import queryMultiAdapter
+from Products.Five.browser import BrowserView
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+
+from quintagroup.gauth.interfaces import IGAuthUtility
+
+REBODY = re.compile("<body\s[^\>]*>(.*)</body>", re.I|re.S)
+
+class TestView( BrowserView ):
+
+    def __init__(self, *args, **kwargs):
+        super(TestView, self).__init__(*args, **kwargs)
+        self.gauth = queryAdapter(self.context, IGAuthUtility)
+
+    @property
+    def sh_title(self):
+        return self.request.get("title", "mylan test")
+
+    @property
+    def base_download_url(self):
+        return "%s/gauth-download?title=%s" % (
+            self.context.absolute_url(), self.sh_title)
+
+    def files(self):
+        return [{"title": fn, "html": self.getWSheetHTML(f)} \
+                for fn, f in self.gauth.downloadSpreadSheetByTitle(self.sh_title)]
+
+    def getWSheetHTML(self, fpath):
+        fulltext = self.getHTML(fpath)
+        body = REBODY.search(fulltext)
+        return body and body.groups()[0] or ""
+
+    def getHTML(self, fpath):
+        res = ""
+        try:
+            f = file(fpath, 'rb')
+            res = f.read()
+        except:
+            pass
+        if "f" in locals().keys():
+            f.close()
+        return res
+        
+    def download(self):
+        index = int(self.request.get("i", -1))
+        if index < 0:
+            return
+        
+        files = self.gauth.downloadSpreadSheetByTitle(self.sh_title)
+        data = self.getHTML(files[index][1])
+        if not data:
+            return ""
+        response = self.request.RESPONSE
+        response.setHeader('Content-Type', "text/html")
+        response.setHeader('Content-Length', len(data))
+        response.setHeader('Accept-Ranges', 'bytes')
+
+        response.setBase(None)
+        return data
Index: /quintagroup.gauth/trunk/quintagroup/gauth/configure.zcml
===================================================================
--- /quintagroup.gauth/trunk/quintagroup/gauth/configure.zcml	(revision 2578)
+++ /quintagroup.gauth/trunk/quintagroup/gauth/configure.zcml	(revision 2579)
@@ -5,4 +5,6 @@
     xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
     i18n_domain="quintagroup.gauth">
+
+  <include package=".browser" />
 
   <genericsetup:registerProfile
