Index: /quintagroup.mobileextender/tags/1.1/MANIFEST.in
===================================================================
--- /quintagroup.mobileextender/tags/1.1/MANIFEST.in	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/MANIFEST.in	(revision 1384)
@@ -0,0 +1,2 @@
+include *.txt
+recursive-include quintagroup *.zcml *.txt *.py *.xml *.pt *.cpy *.jpg *.css *.js *.png
Index: /quintagroup.mobileextender/tags/1.1/README.txt
===================================================================
--- /quintagroup.mobileextender/tags/1.1/README.txt	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/README.txt	(revision 1384)
@@ -0,0 +1,4 @@
+Introduction
+============
+
+
Index: /quintagroup.mobileextender/tags/1.1/docs/HISTORY.txt
===================================================================
--- /quintagroup.mobileextender/tags/1.1/docs/HISTORY.txt	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/docs/HISTORY.txt	(revision 1384)
@@ -0,0 +1,37 @@
+Changelog
+=========
+
+1.1 (unreleased)
+------------------
+
+- For plone-3 version use plone.app.vocabularies
+  in mobile_control configlet
+  [mylan]
+
+
+1.0.2 (2009-03-12)
+------------------
+
+- Added handlers for automatically mark object
+  with IMobile interface on editing mobile_conten field
+
+
+1.0.1 (2009-03-12)
+------------------
+
+* Fix problem with rendering page after submit search
+
+* Add 'Demark' action for clear IMobile interface from 
+  already marked objects
+
+* Add information about currently marked objects.
+
+* Cleanup, remove debugging code. Optimize view
+
+
+1.0 (2009-03-11)
+----------------
+
+* Initial release copied from 
+  http://svn.quintagroup.com/elaw/dui.mobileextender/branches/generalize@988
+
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/__init__.py
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/__init__.py	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/__init__.py	(revision 1384)
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/README.txt
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/README.txt	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/README.txt	(revision 1384)
@@ -0,0 +1,4 @@
+Introduction
+============
+
+
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/__init__.py
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/__init__.py	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/__init__.py	(revision 1384)
@@ -0,0 +1,10 @@
+"""Main product initializer
+"""
+
+from zope.i18nmessageid import MessageFactory
+
+# Define a message factory for when this product is internationalised.
+# This will be imported with the special name "_" in most modules. Strings
+# like _(u"message") will then be extracted by i18n tools for translation.
+
+mobileextenderMessageFactory = MessageFactory('quintagroup.mobileextender')
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/adapters.py
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/adapters.py	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/adapters.py	(revision 1384)
@@ -0,0 +1,41 @@
+from zope.component import adapts
+from zope.interface import implements
+
+from archetypes.schemaextender.interfaces import ISchemaExtender
+from archetypes.schemaextender.field import ExtensionField
+
+from Products.Archetypes.atapi import RichWidget, ComputedWidget
+from Products.Archetypes.public import TextField, ComputedField
+from Products.Archetypes.atapi import AnnotationStorage
+#from Products.ATContentTypes.content.document import ATDocument
+from Products.ATContentTypes.interface import IATDocument
+
+
+from quintagroup.mobileextender import mobileextenderMessageFactory as _
+
+
+class MobileField(ExtensionField, TextField):
+   """A mobile field content mobile version of content."""
+
+class MobileExtender(object):
+
+    fields = [
+        MobileField('mobile_content',
+                  #required=False,
+                  #storage = AnnotationStorage(migrate=True),
+                  #default_output_type = 'text/x-html-safe',
+                  schemata = 'mobile',
+                  default = "",
+                  widget = RichWidget(
+                            label = _(u'label_mobile_content', default=u'Mobile Content'),
+                            rows = 25,
+                            allow_file_upload = True),
+        ),
+    ]
+
+    def __init__(self, context):
+        self.context = context
+
+    def getFields(self): 
+        return self.fields
+
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/__init__.py
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/__init__.py	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/__init__.py	(revision 1384)
@@ -0,0 +1,1 @@
+#
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/configure.zcml
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/configure.zcml	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/configure.zcml	(revision 1384)
@@ -0,0 +1,37 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    xmlns:five="http://namespaces.zope.org/five"
+    i18n_domain="Products.qPloneGoogleSitemaps">
+
+    <!-- -*- extra stuff goes here -*- -->
+
+    <browser:page
+        for="Products.CMFPlone.interfaces.IPloneSiteRoot"
+        name="mobile_control"
+        class=".mobilecontrol.MobileControlView"
+        permission="cmf.ManagePortal"
+        allowed_attributes="currentlyMarked"
+        />
+
+    <browser:resource
+        name="mobile.png"
+        file="mobile.png"
+        />
+
+    <vocabulary
+        name="quintagroup.mobileextender.ptypes"
+        factory=".vocabularies.getPortalTypes"
+        />
+    <vocabulary
+        name="quintagroup.mobileextender.sortindices"
+        factory=".vocabularies.getSortIndices"
+        />
+    <vocabulary
+        name="quintagroup.mobileextender.wfstates"
+        factory=".vocabularies.getWFStates"
+        />
+
+    <adapter factory=".mobilecontrol.MobileControl" />
+
+</configure>
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/interfaces.py
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/interfaces.py	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/interfaces.py	(revision 1384)
@@ -0,0 +1,74 @@
+from zope import interface, schema
+from zope.schema import vocabulary
+
+from Products.CMFCore.utils import getToolByName
+from quintagroup.mobileextender import mobileextenderMessageFactory as _
+
+try:
+    from plone.app import vocabularies
+except:
+    PT_VOCABULARY = "quintagroup.mobileextender.ptypes"
+    WF_VOCABULARY = "quintagroup.mobileextender.wfstates"
+else:
+    PT_VOCABULARY = "plone.app.vocabularies.PortalTypes"
+    WF_VOCABULARY = "plone.app.vocabularies.WorkflowStates"
+    
+
+
+class IMobileConfiglet(interface.Interface):
+    """A portlet which can render a classic Plone portlet macro
+    """
+
+    path = schema.TextLine(
+        title=_(u"label_path", default=u"Path"),
+        description=_(u"help_path",
+            default=u"The Physical path for objects found. "
+            "Leave blank to ignore this criterion."),
+        default=u"",
+        required=False,
+    )
+    ptypes = schema.List(
+        title=_(u'Portal Types'),
+        description=_(u"You may search for and choose portal type(s) "
+            "of object(s) to find. Leave blank to ignore this criterion."),
+        default=[],
+        value_type = schema.Choice( title=u"ptypes", source=PT_VOCABULARY ),
+        required=False,
+    )
+    wfstates = schema.List(
+        title=_(u'Workflow States'),
+        description=_(u"You may search for and choose workflow review state(s) "
+            "of object(s) to find. Leave blank to ignore this criterion."),
+        default=[],
+        value_type = schema.Choice( title=u"review_states", source=WF_VOCABULARY ),
+        required=False,
+    )
+    excludeids = schema.Text(
+        title=_(u'Exclude Ids'),
+        description=_(u"List ids, for exclude from mobile content marking. Ids must be separated "
+            "by new line. Leave blank to ignore this criterion."),
+        default=u"",
+        #value_type = schema.TextLine(),
+        required=False
+    )
+    excludepaths = schema.Text(
+        title=_(u'Exclude by Physical Paths'),
+        description=_(u"All objects, which physical path starts with one of specified one - will "
+            "be excluded from mobile content marking. Paths must start with portal id "
+            "(as in 'Path' field), and seaprated by new line. Leave blank to ignore this criterion."),
+        default=u"",
+        required=False
+    )
+    #sorton = schema.Choice(
+        #title=_(u'Sort index'),
+        #description=_(u"Check sort index."),
+        #vocabulary = "quintagroup.mobileextender.sortindices",
+        #default='',
+        #required=False
+    #)
+
+    #@interface.invariant
+    #def checkForACriterion(formdata):
+        #if not formdata.ptypes \
+           #and not formdata.path:
+            #raise interface.Invalid("Path of portal type(s) must be entered")
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/mobilecontrol.pt
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/mobilecontrol.pt	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/mobilecontrol.pt	(revision 1384)
@@ -0,0 +1,209 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      xmlns:tal="http://xml.zope.org/namespaces/tal"
+      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+      xml:lang="en" lang="en"
+      tal:omit-tag=""
+      metal:define-macro="controlpanel"
+      i18n:domain="plone">
+
+<metal:block use-macro="context/prefs_main_template/macros/master">
+
+<metal:block metal:fill-slot="top_slot"
+             tal:define="dummy python:request.set('disable_border', 1)" />
+
+<body>
+
+<div metal:fill-slot="prefs_configlet_main">
+
+    <div metal:define-macro="form">
+
+        <div id="viewspace" metal:define-slot="viewspace">
+
+            <metal:block define-macro="header">
+
+                <dl tal:define="status view/status"
+                     tal:condition="status"
+                     class="portalMessage info">
+                    <dt i18n:translate="">
+                        Info
+                    </dt>
+                    <dd tal:content="view/status" />
+                </dl>
+
+            </metal:block>
+
+            <h1 class="documentFirstHeading"
+                i18n:translate=""
+                tal:condition="view/label"
+                tal:content="view/label"
+                metal:define-slot="heading">
+                Do something
+            </h1>
+
+            <a href=""
+               class="link-parent"
+               tal:attributes="href string:$portal_url/plone_control_panel"
+               i18n:translate="label_up_to_plone_setup">
+                Up to Site Setup
+            </a>
+
+            <form action="."
+                  metal:define-macro="master"
+                  tal:define="is_fieldsets view/is_fieldsets | nothing"
+                  tal:attributes="action request/URL;
+                                  class python: is_fieldsets and 'edit-form enableFormTabbing enableUnloadProtection' or default"
+                  method="post"
+                  class="edit-form enableUnloadProtection"
+                  enctype="multipart/form-data"
+                  id="zc.page.browser_form">
+
+                <input type="hidden"
+                       name="fieldset.current"
+                       value=""
+                       tal:attributes="value request/fieldset.current | string:" />
+
+                <div metal:define-slot="extra_info" tal:replace="nothing">
+                </div>
+
+		<p class="documentDescription"
+		     tal:define="description view/description|nothing"
+		     tal:condition="description"
+		     tal:content="description">Form description</p>
+
+		<div class="error"
+		     tal:content="string:Currently marked as mobile content ${view/currentlyMarked} objects">
+		    Currently marked as mobile content 7 objects
+		</div>
+
+                <fieldset tal:condition="not: is_fieldsets">
+                    <tal:block tal:repeat="widget view/widgets">
+
+                        <div class="field"
+                             tal:define="description widget/hint;
+                                         error widget/error"
+                             tal:attributes="class python:'field'+(error and ' error' or '')">
+			  
+                            <label i18n:translate=""
+                                   tal:attributes="for widget/name"
+                                   tal:content="widget/label">
+                                label
+                            </label>
+
+                            <span class="fieldRequired"
+                                  title="Required"
+                                  i18n:attributes="title title_required;"
+                                  i18n:translate="label_required"
+                                  tal:condition="widget/required">
+                                (Required)
+                            </span>
+
+                            <div class="formHelp"
+                                 i18n:translate=""
+                                 tal:content="description"
+                                 tal:condition="description">
+                                field description
+                            </div>
+
+                            <div tal:condition="error"
+                                 tal:content="structure error">
+                                The Error
+                            </div>
+
+                            <div class="widget" tal:content="structure widget">
+                                <input type="text" />
+                            </div>
+                        </div>
+
+                    </tal:block>
+
+                </fieldset>
+
+                <fieldset tal:attributes="id python:'fieldset-%s' % fieldset.id"
+                          tal:condition="is_fieldsets"
+                          tal:repeat="fieldset view/form_fields/fieldsets">
+                    <legend tal:define="form_name fieldset/label"
+                            tal:condition="form_name"
+                            tal:attributes="id python:'fieldsetlegend-%s' % fieldset.id"
+                            tal:content="form_name">Form name</legend>
+
+                    <p i18n:translate=""
+                       tal:condition="fieldset/description"
+                       tal:content="fieldset/description">
+                        Description
+                    </p>
+
+                    <tal:block tal:repeat="widget fieldset/widgets">
+
+                        <div class="field"
+                             tal:define="description widget/hint;
+                                         error widget/error"
+                             tal:attributes="class python:'field'+(error and ' error' or '')">
+
+                            <label i18n:translate=""
+				   tal:define="name widget/name"
+                                   tal:attributes="for widget/associateLabelWithInputControl|name"
+				   tal:content="widget/label">
+                                label
+                            </label>
+
+                            <span class="fieldRequired"
+                                  title="Required"
+                                  i18n:attributes="title title_required;"
+                                  i18n:translate="label_required"
+                                  tal:condition="widget/required">
+                                (Required)
+                            </span>
+
+                            <div class="formHelp"
+                                 i18n:translate=""
+                                 tal:content="description"
+                                 tal:condition="description">
+                                field description
+                            </div>
+
+                            <div tal:condition="error"
+                                 tal:content="structure error">
+                                The Error
+                            </div>
+
+                            <div class="widget" tal:content="structure widget">
+                                <input type="text" />
+                            </div>
+                        </div>
+
+                    </tal:block>
+
+                </fieldset>
+
+                <metal:block define-slot="above_buttons" />
+
+                <div class="visualClear"><!-- --></div>
+
+                <div id="actionsView" class="formControls">
+                    <span class="actionButtons"
+                          tal:condition="view/availableActions"
+                          metal:define-slot="bottom_buttons">
+                        <input tal:repeat="action view/actions"
+                               tal:replace="structure action/render" />
+                    </span>
+                </div>
+
+                <!-- input tal:replace="structure context/@@authenticator/authenticator" / -->
+
+            </form>
+        </div>
+
+        <script type="text/javascript"
+            tal:define="extra_script view/extra_script | nothing"
+            tal:condition="extra_script"
+            tal:content="structure extra_script">
+        </script>
+
+    </div>
+
+</div>
+</body>
+
+</metal:block>
+</html>
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/mobilecontrol.py
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/mobilecontrol.py	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/mobilecontrol.py	(revision 1384)
@@ -0,0 +1,151 @@
+#from zope.component import queryMultiAdapter
+from zope.interface import implements, alsoProvides, noLongerProvides, Interface
+from zope.component import adapts, getMultiAdapter
+
+
+
+from zope.formlib import form
+from zope.app.form.browser import MultiSelectWidget, TextAreaWidget
+from Products.Five.formlib import formbase
+
+from Products.Five import BrowserView
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+from Products.CMFCore.utils import getToolByName
+
+from quintagroup.mobileextender import mobileextenderMessageFactory as _
+from quintagroup.mobileextender.interfaces import IMobile
+from interfaces import IMobileConfiglet
+
+def SelectWidgetFactory( field, request ):
+    vocabulary = field.value_type.vocabulary
+    return MultiSelectWidget( field, vocabulary, request )
+
+def ListTextAreaWidgetFactory( field, request ):
+    taw = TextAreaWidget( field, request )
+    taw.width = 20
+    taw.height = 5
+    return taw
+
+class MobileControl(object):
+    implements(IMobileConfiglet)
+    adapts(Interface)
+
+    ptypes = []
+    excludeids = []
+    wfstates = []
+    excludepaths = []
+
+    def __init__(self, context):
+        self.context = context
+        self.path = getToolByName(context, 'portal_url').getPortalPath()
+
+
+class MobileControlView(formbase.FormBase):
+    """
+    Configlet settings browser view
+    """
+    template = ViewPageTemplateFile('mobilecontrol.pt')
+
+    form_fields = form.Fields(IMobileConfiglet)
+
+    label = _(u"Define mobile content")
+    form_name = _(u"Define mobile content")
+    description = _(u"This configlet allows you to define content, " \
+                    u"which should be identified as mobile content")
+
+    form_fields["ptypes"].custom_widget = SelectWidgetFactory
+    form_fields["wfstates"].custom_widget = SelectWidgetFactory
+    form_fields["excludeids"].custom_widget = ListTextAreaWidgetFactory
+    form_fields["excludepaths"].custom_widget = ListTextAreaWidgetFactory
+    form_fields["path"].render_context = True
+
+    def setUpWidgets(self, ignore_request=False):
+        self.adapters = {}
+        self.adapters[IMobileConfiglet] = MobileControl(self.context)
+
+        self.widgets = form.setUpWidgets(self.form_fields, self.prefix,
+             self.context, self.request, form=self, adapters=self.adapters,
+             ignore_request=ignore_request)
+
+    def is_fieldsets(self):
+        # We need to be able to test for non-fieldsets in templates.
+        return False
+
+    @form.action(_(u"label_mark", default=u"Mark"), name=u'Mark')
+    def handle_mark(self, action, data):
+        res = self.getFilteredContent(data)
+        if res:
+            exclids = data.get('excludeids', '')
+            if exclids:
+                exclids = filter(None, [i.strip() for i in exclids.split('\n')])
+                res = filter(lambda b:not b.getId in exclids, res)
+
+            exclpaths = data.get('excludepaths', '')
+            if exclpaths:
+                exclpaths = filter(None, [i.strip() for i in exclpaths.split('\n')])
+                res = filter(lambda b:not [1 for ep in exclpaths if b.getPath().startswith(ep)], res)
+
+            # Mark objects with interface
+            marked = 0
+            for b in res:
+                ob = b.getObject()
+                if not IMobile.providedBy(ob):
+                    alsoProvides(ob, IMobile)
+                    marked += 1
+
+            if marked:
+                catalog = getToolByName(self.context, 'portal_catalog')
+                catalog.manage_reindexIndex(ids=['object_provides'])
+
+            self.status = "Marked %d objects" % marked
+        else:
+            self.status = "No objects found for given criterion"
+
+    @form.action(_(u"label_demark", default=u"DeMark"), name=u'DeMark')
+    def handle_demark(self, action, data):
+        res = self.getFilteredContent(data)
+        if res:
+            exclids = data.get('excludeids', '')
+            if exclids:
+                exclids = filter(None, [i.strip() for i in exclids.split('\n')])
+                res = filter(lambda b:not b.getId in exclids, res)
+
+            exclpaths = data.get('excludepaths', '')
+            if exclpaths:
+                exclpaths = filter(None, [i.strip() for i in exclpaths.split('\n')])
+                res = filter(lambda b:not [1 for ep in exclpaths if b.getPath().startswith(ep)], res)
+
+            # DeMark objects with interface
+            demarked = 0
+            for b in res:
+                ob = b.getObject()
+                if IMobile.providedBy(ob):
+                    noLongerProvides(ob, IMobile)
+                    demarked += 1
+
+            if demarked:
+                catalog = getToolByName(self.context, 'portal_catalog')
+                catalog.manage_reindexIndex(ids=['object_provides'])
+
+            self.status = "DeMarked %d objects" % demarked
+        else:
+            self.status = "No objects found for given criterion"
+
+
+    def getFilteredContent(self, data):
+        purl = getToolByName(self.context, 'portal_url')
+        catalog = getToolByName(self.context, 'portal_catalog')
+
+        ptypes = data.get('ptypes',[])
+        sorton = data.get('sorton',None)
+        wfstates = data.get('wfstates', [])
+
+        query = {'path' : data.get('path', purl.getPortalPath()),}
+        if ptypes: query.update({'portal_type':ptypes})
+        if wfstates: query.update({'review_state':wfstates})
+
+        return catalog(**query)
+
+    def currentlyMarked(self):
+        catalog = getToolByName(self.context, 'portal_catalog')
+        return len(catalog(object_provides='quintagroup.mobileextender.interfaces.IMobile'))
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/vocabularies.py
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/vocabularies.py	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/browser/vocabularies.py	(revision 1384)
@@ -0,0 +1,30 @@
+from zope.schema.vocabulary import SimpleVocabulary
+
+from Products.PluginIndexes.FieldIndex import FieldIndex
+from Products.PluginIndexes.KeywordIndex import KeywordIndex
+from Products.PluginIndexes.DateIndex import DateIndex
+from Products.PluginIndexes.DateRangeIndex import DateRangeIndex
+from Products.CMFCore.utils import getToolByName
+
+SORT_INDICES = (FieldIndex, KeywordIndex, DateIndex, DateRangeIndex)
+#SORT_INDICES = ('DateIndex', 'DateRangeIndex', 'FieldIndex', 'KeywordIndex')
+def getSortIndices( context ):
+    catalog = getToolByName(context, 'portal_catalog')
+    return SimpleVocabulary.fromValues(
+        [k for k,v in catalog._catalog.indexes.items() if type(v) in SORT_INDICES])
+
+def getPortalTypes( context ):
+    pt = getToolByName(context, 'portal_types')
+    return SimpleVocabulary.fromValues(pt.listContentTypes())
+
+
+def getPortalPath( context ):
+    return getToolByName(context, 'portal_url').getPortalPath()
+
+def getWFStates( context ):
+    pwf = getToolByName(context, 'portal_workflow')
+    utokens = {}
+    [utokens.update({k:v}) for k,v in pwf.listWFStatesByTitle() if k not in utokens.keys()]
+    return SimpleVocabulary.fromItems(utokens.items())
+
+
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/configure.zcml
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/configure.zcml	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/configure.zcml	(revision 1384)
@@ -0,0 +1,62 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:five="http://namespaces.zope.org/five"
+    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+    xmlns:cmf="http://namespaces.zope.org/cmf"
+    i18n_domain="quintagroup.mobileextender">
+
+   <!-- File System Directory Views registration -->
+   <cmf:registerDirectory
+       name=""
+       directory="skins"
+       recursive="True"
+       />
+
+    <!-- five:registerPackage package="." initialize=".initialize" / -->
+
+    <!-- -*- extra stuff goes here -*- -->
+    <!-- extend [ATDocument] portal type with mobile_content field -->
+    <include package="archetypes.schemaextender" />
+    <include package=".browser" />
+    <adapter 
+        for="Products.ATContentTypes.interface.IATDocument"
+        provides="archetypes.schemaextender.interfaces.ISchemaExtender"
+        factory=".adapters.MobileExtender" 
+        />
+    <adapter 
+        for="Products.ATContentTypes.interface.IATEvent"
+        provides="archetypes.schemaextender.interfaces.ISchemaExtender"
+        factory=".adapters.MobileExtender" 
+        />
+    <adapter 
+        for="Products.Archetypes.interfaces.IBaseFolder"
+        provides="archetypes.schemaextender.interfaces.ISchemaExtender"
+        factory=".adapters.MobileExtender" 
+        />
+
+    <interface
+      interface=".interfaces.IMobile"
+      />
+
+    <!-- Register the installation GenericSetup extension profile -->
+    <genericsetup:registerProfile
+      name="default"
+      title="Mobile Extender"
+      directory="profiles/default"
+      description=""
+      provides="Products.GenericSetup.interfaces.EXTENSION"
+      />
+
+    <subscriber
+        for="Products.ATContentTypes.interface.IATContentType
+             Products.Archetypes.interfaces.IObjectInitializedEvent"
+        handler=".handlers.markAsMobile"
+        />
+
+    <subscriber
+        for="Products.ATContentTypes.interface.IATContentType
+             Products.Archetypes.interfaces.IObjectEditedEvent"
+        handler=".handlers.markAsMobile"
+        />
+
+</configure>
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/handlers.py
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/handlers.py	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/handlers.py	(revision 1384)
@@ -0,0 +1,8 @@
+from zope.interface import alsoProvides
+from interfaces import IMobile
+
+def markAsMobile(object, event):
+    mobfield = object.Schema().get('mobile_content',None)
+    if mobfield and mobfield.get(object):
+        alsoProvides(object, IMobile)
+        object.reindexObject(idxs=['object_provides'])
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/interfaces.py
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/interfaces.py	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/interfaces.py	(revision 1384)
@@ -0,0 +1,5 @@
+from zope.interface import Interface
+
+class IMobile(Interface):
+   """Marker interface for mobile contetn.
+   """
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/actionicons.xml
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/actionicons.xml	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/actionicons.xml	(revision 1384)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<action-icons>
+ <action-icon category="controlpanel"
+              action_id="mobileControl"
+              title="Control Mobile Content" priority="0"
+              icon_expr="++resource++mobile.png"/>
+</action-icons>
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/controlpanel.xml
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/controlpanel.xml	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/controlpanel.xml	(revision 1384)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<object name="portal_controlpanel" meta_type="Plone Control Panel Tool">
+ <configlet title="Manage Mobile Content" action_id="mobileControl"
+    appId="quintagroup.mobileextender" category="Products" condition_expr=""
+    url_expr="string:${portal_url}/mobile_control"
+    visible="True">
+  <permission>Manage portal</permission>
+ </configlet>
+</object>
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/metadata.xml
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/metadata.xml	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/metadata.xml	(revision 1384)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>1.0.2 dev</version>
+</metadata>
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/skins.xml
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/skins.xml	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/profiles/default/skins.xml	(revision 1384)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<object name="portal_skins" allow_any="False" cookie_persistence="False">
+
+ <object name="mobile_extender"
+    meta_type="Filesystem Directory View"
+    directory="quintagroup.mobileextender:skins/mobile_extender"/>
+
+
+ <skin-path name="*">
+   <layer name="mobile_extender"
+          insert-after="custom"/>
+
+ </skin-path>
+
+</object>
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/skins/mobile_extender/document_view.pt
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/skins/mobile_extender/document_view.pt	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/skins/mobile_extender/document_view.pt	(revision 1384)
@@ -0,0 +1,32 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
+      lang="en"
+      metal:use-macro="here/main_template/macros/master"
+      i18n:domain="plone">
+<body><metal:main fill-slot="main"><tal:main-macro metal:define-macro="main"
+           tal:define="mobile_text here/mobile_content | string:;">
+
+      <div tal:condition="mobile_text"
+           tal:replace="structure mobile_text" />
+
+      <tal:block condition="not:mobile_text"
+                 on-error="string:">
+        <h1 tal:content="object_title" class="documentFirstHeading">
+          Title or id
+        </h1>
+        <p class="documentDescription"
+           tal:content="here/Description"
+           tal:condition="here/Description">
+            Description
+        </p>
+        <div class="stx"
+             tal:define="text python: here.CookedBody(stx_level=2)"
+             tal:condition="text"
+             tal:attributes="class python:test(here.Format() in ('text/structured',
+                                                   'text/x-rst', ), 'stx', 'plain')">
+            <div tal:replace="structure text" />
+        </div>
+      </tal:block>
+
+</tal:main-macro></metal:main>
+</body>
+</html>
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/skins/mobile_extender/event_view.pt
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/skins/mobile_extender/event_view.pt	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/skins/mobile_extender/event_view.pt	(revision 1384)
@@ -0,0 +1,100 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
+      xmlns:tal="http://xml.zope.org/namespaces/tal"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+      lang="en"
+      metal:use-macro="here/main_template/macros/master"
+      i18n:domain="plone">
+
+<body><metal:main fill-slot="main"><tal:main-macro metal:define-macro="main"
+           tal:define="mobile_text here/mobile_content | string:;">
+
+      <div tal:condition="mobile_text"
+           tal:replace="structure mobile_text" />
+
+      <tal:block condition="not:mobile_text">
+        <h1 class="documentFirstHeading summary"> 
+            <metal:field use-macro="python:here.widget('title', mode='view')">
+            Title
+            </metal:field>
+        </h1>
+        <p class="documentDescription"
+           tal:content="here/Description"
+           tal:condition="here/Description">
+            Description
+        </p>
+        <div class="eventDetails vcard">
+          <dl>
+            <tal:what define="subj here/getSubject|string:"
+                      condition="subj">
+            <dt i18n:translate="event_what">What</dt>
+            <dd tal:content="subj"></dd>
+            </tal:what>
+            <dt>When:</dt>
+            <dd>
+                <tal:differentday tal:condition="python:not here.start().Date() == here.end().Date()">
+                    <abbr id="parent-fieldname-startDate" class="dtstart"
+                          tal:attributes="title python:here.end().ISO8601()"><span class="explain"
+                          tal:content="python:here.toLocalizedTime(here.start(), long_format=1)">Start Date Time</span>
+                    </abbr>
+                    <span i18n:translate="event_to">to</span><br />
+                    <abbr id="parent-fieldname-endDate" class="dtend"
+                          tal:attributes="title python:here.end().ISO8601()"><span class="explain"
+                          tal:content="python:here.toLocalizedTime(here.end(), long_format=1)">End Date Time</span>
+                    </abbr>
+                </tal:differentday>
+                <tal:sameday tal:condition="python:here.start().Date() == here.end().Date()"
+                             tal:define="ampm python:site_properties.getProperty('localLongTimeFormat').find('%p') >= 0">
+                    <span tal:replace="python:toLocalizedTime(here.start())">Start Date Time</span><br />
+                    <span i18n:translate="event_from">from</span>
+                    <abbr class="dtstart" id="parent-fieldname-startDate"
+                          tal:define="ampm python:site_properties.getProperty('localLongTimeFormat').find('%p') >= 0;"
+                          tal:attributes="title python:here.start().ISO8601()"><span
+                          tal:replace="python:test(ampm, here.start().AMPMMinutes(), here.start().TimeMinutes())">Start Time</span>
+                    </abbr>
+                    <span i18n:translate="event_to">to</span>
+                    <abbr id="parent-fieldname-endDate" class="dtend"
+                          tal:define="ampm python:site_properties.getProperty('localLongTimeFormat').find('%p') >= 0;"
+                          tal:attributes="title python:here.end().ISO8601()"><span
+                          tal:replace="python:test(ampm, here.end().AMPMMinutes(), here.end().TimeMinutes())">End Time</span>
+                    </abbr>
+                </tal:sameday>
+            </dd>
+            <tal:where define="locat here/location|nothing"
+                       condition="locat">
+            <dt i18n:translate="event_where">Where</dt>
+            <dd tal:content="locat">Location</dd>
+            </tal:where>
+
+            <tal:contact
+              define="contact_email here/contact_email|nothing;
+                      contact_name python:context.contact_name() or None;
+                      contact_phone here/contact_phone|nothing"
+                tal:condition="python:contact_name or contact_email or contact_phone">
+            <dt i18n:translate="contact">Contact</dt>
+            <dd tal:condition="python:contact_name and contact_email" tal:content="structure python: here.spamProtect(mailaddress=contact_email, mailname=contact_name)">someone@somewhere.com</dd>
+            <dd tal:condition="python:contact_name and not contact_email" tal:content="contact_name">someone</dd>
+            <dd tal:condition="python:contact_email and not contact_name" tal:content="structure python: here.spamProtect(mailaddress=contact_email)">someone@somewhere.com</dd>
+            <dd tal:condition="contact_phone" tal:content="contact_phone">33333333</dd>
+            </tal:contact>
+          </dl>
+
+        </div>
+        <div class="stx"
+             tal:define="text here/getText|nothing"
+             tal:condition="text"
+             tal:attributes="class python:test(here.Format() in ('text/structured',
+                                                   'text/x-rst', ), 'stx', 'plain')">
+            <div tal:replace="structure text" />
+        </div>
+        <p tal:condition="here/event_url|nothing"><a class="url" id="parent-fieldname-eventUrl" href="event_url"
+           i18n:translate="event_more_information"
+           tal:define="field python:context.getField('eventUrl');"
+           tal:attributes="href here/event_url">More information about this event&hellip;</a>
+        </p>
+
+      </tal:block>
+
+</tal:main-macro></metal:main>
+</body>
+</html>
Index: /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/skins/mobile_extender/newsitem_view.pt
===================================================================
--- /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/skins/mobile_extender/newsitem_view.pt	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/quintagroup/mobileextender/skins/mobile_extender/newsitem_view.pt	(revision 1384)
@@ -0,0 +1,55 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
+      xmlns:tal="http://xml.zope.org/namespaces/tal"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+      lang="en"
+      metal:use-macro="here/main_template/macros/master"
+      i18n:domain="plone">
+
+<body><metal:main fill-slot="main"><tal:main-macro metal:define-macro="main"
+           tal:define="mobile_text here/mobile_content | string:;">
+
+      <div tal:condition="mobile_text"
+           tal:replace="structure mobile_text" />
+
+      <tal:block condition="not:mobile_text"
+                 on-error="string:">
+        <h1 tal:content="object_title" class="documentFirstHeading">
+          Title or id
+        </h1>
+        <p class="documentDescription"
+           tal:content="here/Description"
+           tal:condition="here/Description">
+            Description
+        </p>
+        <div tal:condition="here/image_tile|nothing">
+            <a href="#"
+               tal:define="href_thumb here/image_thumb|string:;
+                           href_mini here/image_mini|string:;
+                           thumb_pref python:test(href_thumb, 'thumb', '');
+                           mini_pref python:test(href_mini, 'mini', '');
+                           url_pref python:test(href_mini, mini_pref, thumb_pref);"
+               tal:condition="url_pref"
+               tal:attributes="href string:$here_url/image_${url_pref}"
+               tal:omit-tag="not:url_pref">
+               <img tal:replace="structure python: here.tag(scale='tile')" src="" alt="" />
+            </a>
+            <p class="discreet">
+              <metal:field use-macro="python:here.widget('imageCaption', mode='view')">
+              Image Caption
+              </metal:field>
+            </p>
+        </div>
+        <div class="stx"
+             tal:define="text python: here.CookedBody(stx_level=2)"
+             tal:condition="text"
+             tal:attributes="class python:test(here.Format() in ('text/structured',
+                                                   'text/x-rst', ), 'stx', 'plain')">
+            <div tal:replace="structure text" />
+        </div>
+      </tal:block>
+
+</tal:main-macro></metal:main>
+</body>
+</html>
+
Index: /quintagroup.mobileextender/tags/1.1/setup.cfg
===================================================================
--- /quintagroup.mobileextender/tags/1.1/setup.cfg	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/setup.cfg	(revision 1384)
@@ -0,0 +1,3 @@
+[egg_info]
+tag_build = dev
+tag_svn_revision = true
Index: /quintagroup.mobileextender/tags/1.1/setup.py
===================================================================
--- /quintagroup.mobileextender/tags/1.1/setup.py	(revision 1384)
+++ /quintagroup.mobileextender/tags/1.1/setup.py	(revision 1384)
@@ -0,0 +1,32 @@
+from setuptools import setup, find_packages
+import os
+
+version = '1.1'
+
+setup(name='quintagroup.mobileextender',
+      version=version,
+      description="Extend some AT content types with mobile_text field and overlap appropriate content types views",
+      long_description=open("README.txt").read() + "\n" +
+                       open(os.path.join("docs", "HISTORY.txt")).read(),
+      # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[
+        "Programming Language :: Python",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+        ],
+      keywords='plone mobile quintagroup',
+      author='Quintagroup',
+      author_email='support@quintagroup.com',
+      url='http://svn.quintagroup.com/products/quintagroup.mobileextender',
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['quintagroup'],
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=[
+          'setuptools',
+          'archetypes.schemaextender',
+      ],
+      entry_points="""
+      # -*- Entry points: -*-
+      """,
+      )
