Index: quintagroup.portlet.pfg/tags/1.0/MANIFEST.in
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/MANIFEST.in	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/MANIFEST.in	(revision 3634)
@@ -0,0 +1,4 @@
+recursive-include docs *
+recursive-include quintagroup *
+global-exclude *.pyc
+global-exclude *.mo
Index: quintagroup.portlet.pfg/tags/1.0/README.txt
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/README.txt	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/README.txt	(revision 3634)
@@ -0,0 +1,4 @@
+Introduction
+============
+
+Render form created by PloneFormGen package.
Index: quintagroup.portlet.pfg/tags/1.0/docs/HISTORY.txt
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/docs/HISTORY.txt	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/docs/HISTORY.txt	(revision 3634)
@@ -0,0 +1,7 @@
+Changelog
+=========
+
+1.0 (xxxx-xx-xx)
+----------------
+
+* Initial release
Index: quintagroup.portlet.pfg/tags/1.0/quintagroup/__init__.py
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/__init__.py	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/__init__.py	(revision 3634)
@@ -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.portlet.pfg/tags/1.0/quintagroup/portlet/__init__.py
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/__init__.py	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/__init__.py	(revision 3634)
@@ -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.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/configure.zcml
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/configure.zcml	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/configure.zcml	(revision 3634)
@@ -0,0 +1,33 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+           xmlns:browser="http://namespaces.zope.org/browser"
+           xmlns:plone="http://namespaces.plone.org/plone"
+           i18n_domain="quintagroup.portlet.pfg">
+
+
+  <!-- Register the installation GenericSetup extension profile -->
+  <genericsetup:registerProfile
+     name="default"
+     title="quintagroup.portlet.pfg"
+     directory="profiles/default"
+     description=""
+     provides="Products.GenericSetup.interfaces.EXTENSION"
+     />
+
+  <browser:resource
+    name="enableinputlabel.js"
+    image="enableinputlabel.js"
+    />
+    
+    <include package="plone.app.portlets" />
+
+    <plone:portlet
+        name="quintagroup.portlet.pfg.PFGPortlet"
+        interface=".pfg.IPFGPortlet"
+        assignment=".pfg.Assignment"
+        renderer=".pfg.Renderer"
+        addview=".pfg.AddForm"
+        editview=".pfg.EditForm"
+        />
+
+</configure>
Index: quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/enableinputlabel.js
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/enableinputlabel.js	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/enableinputlabel.js	(revision 3634)
@@ -0,0 +1,3 @@
+jq(document).ready(function() {
+    jq('.portletPFG .ArchetypesStringWidget').each(function(){jq('input',this).attr('title',jq('label',this).text()).addClass('inputLabel')})
+});
Index: quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/pfg.pt
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/pfg.pt	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/pfg.pt	(revision 3634)
@@ -0,0 +1,13 @@
+<dl class="portlet portletPFG"
+    tal:condition="view/available">
+  <dt class="portletHeader">
+    <span class="portletTitle"
+          tal:content="view/pfgTitle">
+    </span>
+  </dt>
+  <dd class="portletItem">
+    <tal:block tal:replace="structure view/render_form"/>
+    <span class="portletBottomLeft"></span>
+    <span class="portletBottomRight"></span>
+  </dd>
+</dl>
Index: quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/pfg.py
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/pfg.py	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/pfg.py	(revision 3634)
@@ -0,0 +1,93 @@
+from zope import schema
+from zope.component import getMultiAdapter
+from zope.formlib import form
+from zope.interface import implements
+
+from plone.app.portlets.portlets import base
+from plone.memoize.compress import xhtml_compress
+from plone.portlets.interfaces import IPortletDataProvider
+
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+from Products.CMFPlone import PloneMessageFactory as _
+from Products.CMFCore.utils import getToolByName
+
+from Products.PloneFormGen.interfaces import  IPloneFormGenForm
+from plone.app.vocabularies.catalog import SearchableTextSourceBinder
+from plone.app.form.widgets.uberselectionwidget import UberSelectionWidget
+
+class IPFGPortlet(IPortletDataProvider):
+
+    target_form = schema.Choice(
+                    title=_(u"Target form"),
+                    description=_(u"Find the form which you want to be",
+                                   "displayed in portlet."),
+                    required=True,
+                    source=SearchableTextSourceBinder(
+                        {'object_provides':IPloneFormGenForm.__identifier__},
+                        default_query='path:'))
+
+class Assignment(base.Assignment):
+    implements(IPFGPortlet)
+
+    def __init__(self, target_form=''):
+        self.target_form = target_form
+
+    @property
+    def title(self):
+        return _(u"PFG Portlet")
+
+class Renderer(base.Renderer):
+
+    _template = ViewPageTemplateFile('pfg.pt')
+
+    def __init__(self, *args):
+        base.Renderer.__init__(self, *args)
+        self.portal_state = getMultiAdapter((self.context, self.request),
+                                       name=u'plone_portal_state')
+        self.portal = self.portal_state.portal()
+
+
+    def render(self):
+        return xhtml_compress(self._template())
+
+    def pfg_object(self):
+        pfg_path = self.data.target_form
+        if pfg_path.startswith('/'):
+            pfg_path = pfg_path[1:]
+
+        return self.portal.restrictedTraverse(pfg_path, default=None)
+
+    def pfgTitle(self):
+        form = self.pfg_object()
+        if form is not None:
+            return form.Title()
+
+    def available(self):
+        return self.pfg_object() and True or False
+
+    def render_form(self):
+        form = self.pfg_object()
+        if form is not None:
+            form_path = '/'.join(form.getPhysicalPath()[2:])
+            form_view = self.portal.restrictedTraverse('%s/@@embedded' % form_path)
+            form_view.prefix = 'pfgportlet'
+            return form_view()
+
+class AddForm(base.AddForm):
+
+    form_fields = form.Fields(IPFGPortlet)
+    form_fields['target_form'].custom_widget = UberSelectionWidget
+
+    label = _(u"Add PFG Portlet")
+    description = _(u"This portlet displays pfg content.")
+
+    def create(self, data):
+        return Assignment(target_form=data.get('target_form', ''))
+
+class EditForm(base.EditForm):
+
+    form_fields = form.Fields(IPFGPortlet)
+    form_fields['target_form'].custom_widget = UberSelectionWidget
+
+    label = _(u"Edit PFG Portlet")
+    description = _(u"This portlet displays pfg content.")
Index: quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/profiles/default/jsregistry.xml
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/profiles/default/jsregistry.xml	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/profiles/default/jsregistry.xml	(revision 3634)
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<object name="portal_javascripts">
+<javascript
+    id="++resource++enableinputlabel.js"
+    cacheable="True" compression="safe" cookable="False"
+    enabled="False" expression=""  inline="False"
+    insert-before="input-label.js"/>
+</object>
Index: quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/profiles/default/metadata.xml
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/profiles/default/metadata.xml	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/profiles/default/metadata.xml	(revision 3634)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>0.1</version>
+  <dependencies>
+    <dependency>profile-Products.PloneFormGen:default</dependency>
+  </dependencies>
+</metadata>
Index: quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/profiles/default/portlets.xml
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/profiles/default/portlets.xml	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/profiles/default/portlets.xml	(revision 3634)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<portlets>
+ <portlet
+   title="PFG Portlet"
+   addview="quintagroup.portlet.pfg.PFGPortlet"
+   description="A portlet that display your pfg content">
+   <for interface="plone.app.portlets.interfaces.IColumn"/>
+   </portlet>
+</portlets>
+
Index: quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/tests/base.py
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/tests/base.py	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/tests/base.py	(revision 3634)
@@ -0,0 +1,45 @@
+from Products.Five import zcml
+from Products.Five import fiveconfigure
+
+from Testing import ZopeTestCase as ztc
+
+from Products.PloneTestCase import PloneTestCase as ptc
+from Products.PloneTestCase.layer import onsetup
+
+ztc.installProduct('PloneFormGen')
+
+@onsetup
+def setup_product():
+    """Set up additional products and ZCML required to test this product.
+
+    The @onsetup decorator causes the execution of this body to be deferred
+    until the setup of the Plone site testing layer.
+    """
+
+    # Load the ZCML configuration for this package and its dependencies
+
+    fiveconfigure.debug_mode = True
+    import quintagroup.portlet.pfg
+    zcml.load_config('configure.zcml', quintagroup.portlet.pfg)
+    fiveconfigure.debug_mode = False
+
+    # We need to tell the testing framework that these products
+    # should be available. This can't happen until after we have loaded
+    # the ZCML.
+
+    ztc.installPackage('quintagroup.portlet.pfg')
+
+# The order here is important: We first call the deferred function and then
+# let PloneTestCase install it during Plone site setup
+
+setup_product()
+ptc.setupPloneSite(products=['Products.PloneFormGen',
+                             'quintagroup.portlet.pfg'])
+
+class TestCase(ptc.PloneTestCase):
+    """Base class used for test cases
+    """
+
+class FunctionalTestCase(ptc.FunctionalTestCase):
+    """Test case class used for functional (doc-)tests
+    """
Index: quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/tests/test_portlet.py
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/tests/test_portlet.py	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/tests/test_portlet.py	(revision 3634)
@@ -0,0 +1,96 @@
+from zope.component import getUtility, getMultiAdapter
+
+from plone.portlets.interfaces import IPortletType
+from plone.portlets.interfaces import IPortletManager
+from plone.portlets.interfaces import IPortletAssignment
+from plone.portlets.interfaces import IPortletDataProvider
+from plone.portlets.interfaces import IPortletRenderer
+
+from plone.app.portlets.storage import PortletAssignmentMapping
+
+from quintagroup.portlet.pfg import pfg
+
+from quintagroup.portlet.pfg.tests.base import TestCase
+
+
+from Products.CMFCore.utils import getToolByName
+
+class TestPFGPortlet(TestCase):
+
+    def afterSetUp(self):
+        self.setRoles(('Manager',))
+        self.portal.invokeFactory('FormFolder', 'test_form')
+
+    def testPortletTypeRegistered(self):
+        portlet = getUtility(IPortletType, name='quintagroup.portlet.pfg.PFGPortlet')
+        self.assertEquals(portlet.addview, 'quintagroup.portlet.pfg.PFGPortlet')
+
+    def testInterfaces(self):
+        portlet = pfg.Assignment(target_form=u"/test_form")
+        self.failUnless(IPortletAssignment.providedBy(portlet))
+        self.failUnless(IPortletDataProvider.providedBy(portlet.data))
+
+    def testInvokeAddview(self):
+        portlet = getUtility(IPortletType, name='quintagroup.portlet.pfg.PFGPortlet')
+        mapping = self.portal.restrictedTraverse('++contextportlets++plone.leftcolumn')
+        for m in mapping.keys():
+            del mapping[m]
+        addview = mapping.restrictedTraverse('+/' + portlet.addview)
+
+        addview.createAndAdd(data={'target_form' : u"/test_form"})
+
+        self.assertEquals(len(mapping), 1)
+        self.failUnless(isinstance(mapping.values()[0], pfg.Assignment))
+
+    def testInvokeEditView(self):
+        mapping = PortletAssignmentMapping()
+        request = self.folder.REQUEST
+
+        mapping['foo'] = pfg.Assignment(target_form=u"/test_form")
+        editview = getMultiAdapter((mapping['foo'], request), name='edit')
+        self.failUnless(isinstance(editview, pfg.EditForm))
+
+    def testRenderer(self):
+        context = self.folder
+        request = self.folder.REQUEST
+        view = self.folder.restrictedTraverse('@@plone')
+        manager = getUtility(IPortletManager, name='plone.rightcolumn', context=self.portal)
+        assignment = pfg.Assignment(target_form=u"/test_form")
+
+        renderer = getMultiAdapter((context, request, view, manager, assignment), IPortletRenderer)
+        self.failUnless(isinstance(renderer, pfg.Renderer))
+
+class TestPFGPortletRenderer(TestCase):
+
+    def afterSetUp(self):
+        self.loginAsPortalOwner()
+        self.setRoles(('Manager',))
+        self.portal.invokeFactory('FormFolder', 'test_form')
+
+    def renderer(self, context=None, request=None, view=None, manager=None, assignment=None):
+        context = context or self.folder
+        request = request or self.folder.REQUEST
+        view = view or self.folder.restrictedTraverse('@@plone')
+        manager = manager or getUtility(IPortletManager, name='plone.rightcolumn', context=self.portal)
+        assignment = assignment or pfg.Assignment(target_form="/test_form")
+
+        return getMultiAdapter((context, request, view, manager, assignment), IPortletRenderer)
+
+
+    def test_portletStyle(self):
+        renderer = self.renderer(context=self.portal,
+                                 request=self.portal.REQUEST,
+                                 assignment=pfg.Assignment(target_form="/test_form"))
+        renderer = renderer.__of__(self.portal)
+        renderer.update()
+
+        self.failUnless('Your E-Mail Address' in renderer.render())
+        self.failUnless('Subject' in renderer.render())
+        self.failUnless('Comments' in renderer.render())
+
+def test_suite():
+    from unittest import TestSuite, makeSuite
+    suite = TestSuite()
+    suite.addTest(makeSuite(TestPFGPortlet))
+    suite.addTest(makeSuite(TestPFGPortletRenderer))
+    return suite
Index: quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/versions.txt
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/versions.txt	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/quintagroup/portlet/pfg/versions.txt	(revision 3634)
@@ -0,0 +1,1 @@
+0.1
Index: quintagroup.portlet.pfg/tags/1.0/setup.cfg
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/setup.cfg	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/setup.cfg	(revision 3634)
@@ -0,0 +1,3 @@
+[egg_info]
+tag_build = dev
+tag_svn_revision = true
Index: quintagroup.portlet.pfg/tags/1.0/setup.py
===================================================================
--- quintagroup.portlet.pfg/tags/1.0/setup.py	(revision 3634)
+++ quintagroup.portlet.pfg/tags/1.0/setup.py	(revision 3634)
@@ -0,0 +1,33 @@
+from setuptools import setup, find_packages
+import os
+
+version = '1.0'
+
+setup(name='quintagroup.portlet.pfg',
+      version=version,
+      description="Render form created by PloneFormGen package.",
+      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='portlet pfg',
+      author='Quintagroup',
+      author_email='support@quintagroup.com',
+      url='http://projects.quintagroup.com/products',
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['quintagroup', 'quintagroup.portlet'],
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=[
+          'setuptools',
+          'Products.PloneFormGen',
+          # -*- Extra requirements: -*-
+      ],
+      entry_points="""
+      # -*- Entry points: -*-
+      """,
+      )
