Index: ploneorg.kudobounty/trunk/CHANGES.txt
===================================================================
--- ploneorg.kudobounty/trunk/CHANGES.txt	(revision 3129)
+++ ploneorg.kudobounty/trunk/CHANGES.txt	(revision 3129)
@@ -0,0 +1,8 @@
+Changelog
+=========
+
+0.1 (xxxx-xx-xx)
+----------------
+
+- Created recipe with ZopeSkel
+  [mylan at quintagroup.com]
Index: ploneorg.kudobounty/trunk/CONTRIBUTORS.txt
===================================================================
--- ploneorg.kudobounty/trunk/CONTRIBUTORS.txt	(revision 3129)
+++ ploneorg.kudobounty/trunk/CONTRIBUTORS.txt	(revision 3129)
@@ -0,0 +1,2 @@
+mylan at quintagroup.com, Author
+
Index: ploneorg.kudobounty/trunk/MANIFEST.in
===================================================================
--- ploneorg.kudobounty/trunk/MANIFEST.in	(revision 3129)
+++ ploneorg.kudobounty/trunk/MANIFEST.in	(revision 3129)
@@ -0,0 +1,2 @@
+recursive-include ploneorg *
+global-exclude *pyc
Index: ploneorg.kudobounty/trunk/README.txt
===================================================================
--- ploneorg.kudobounty/trunk/README.txt	(revision 3129)
+++ ploneorg.kudobounty/trunk/README.txt	(revision 3129)
@@ -0,0 +1,17 @@
+.. contents::
+
+.. Note!
+   -----
+   Update the following URLs to point to your:
+
+   - code repository
+   - bug tracker
+   - questions/comments feedback mail
+   (do not set a real mail, to avoid spams)
+
+   Or remove it if not used.
+
+- Code repository: http://svn.somewhere.com/...
+- Questions and comments to somemailing_list
+- Report bugs at http://bug.somewhere.com/..
+
Index: ploneorg.kudobounty/trunk/docs/HISTORY.txt
===================================================================
--- ploneorg.kudobounty/trunk/docs/HISTORY.txt	(revision 3129)
+++ ploneorg.kudobounty/trunk/docs/HISTORY.txt	(revision 3129)
@@ -0,0 +1,7 @@
+Changelog
+=========
+
+0.1dev (unreleased)
+-------------------
+
+- Initial release
Index: ploneorg.kudobounty/trunk/docs/INSTALL.txt
===================================================================
--- ploneorg.kudobounty/trunk/docs/INSTALL.txt	(revision 3129)
+++ ploneorg.kudobounty/trunk/docs/INSTALL.txt	(revision 3129)
@@ -0,0 +1,52 @@
+ploneorg.kudobounty Installation
+--------------------------------
+
+To install ploneorg.kudobounty into the global Python environment (or a workingenv),
+using a traditional Zope 2 instance, you can do this:
+
+* When you're reading this you have probably already run 
+  ``easy_install ploneorg.kudobounty``. Find out how to install setuptools
+  (and EasyInstall) here:
+  http://peak.telecommunity.com/DevCenter/EasyInstall
+
+* If you are using Zope 2.9 (not 2.10), get `pythonproducts`_ and install it 
+  via::
+
+    python setup.py install --home /path/to/instance
+
+into your Zope instance.
+
+* Create a file called ``ploneorg.kudobounty-configure.zcml`` in the
+  ``/path/to/instance/etc/package-includes`` directory.  The file
+  should only contain this::
+
+    <include package="ploneorg.kudobounty" />
+
+.. _pythonproducts: http://plone.org/products/pythonproducts
+
+
+Alternatively, if you are using zc.buildout and the plone.recipe.zope2instance
+recipe to manage your project, you can do this:
+
+* Add ``ploneorg.kudobounty`` to the list of eggs to install, e.g.:
+
+    [buildout]
+    ...
+    eggs =
+        ...
+        ploneorg.kudobounty
+       
+* Tell the plone.recipe.zope2instance recipe to install a ZCML slug:
+
+    [instance]
+    recipe = plone.recipe.zope2instance
+    ...
+    zcml =
+        ploneorg.kudobounty
+      
+* Re-run buildout, e.g. with:
+
+    $ ./bin/buildout
+        
+You can skip the ZCML slug if you are going to explicitly include the package
+from another package's configure.zcml file.
Index: ploneorg.kudobounty/trunk/docs/LICENSE.GPL
===================================================================
--- ploneorg.kudobounty/trunk/docs/LICENSE.GPL	(revision 3129)
+++ ploneorg.kudobounty/trunk/docs/LICENSE.GPL	(revision 3129)
@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
Index: ploneorg.kudobounty/trunk/docs/LICENSE.txt
===================================================================
--- ploneorg.kudobounty/trunk/docs/LICENSE.txt	(revision 3129)
+++ ploneorg.kudobounty/trunk/docs/LICENSE.txt	(revision 3129)
@@ -0,0 +1,16 @@
+  ploneorg.kudobounty is copyright mylan at quintagroup.com
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
+  MA 02111-1307 USA.
Index: ploneorg.kudobounty/trunk/ploneorg/__init__.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/__init__.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/__init__.py	(revision 3129)
@@ -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: ploneorg.kudobounty/trunk/ploneorg/kudobounty/README.txt
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/README.txt	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/README.txt	(revision 3129)
@@ -0,0 +1,174 @@
+Introduction
+============
+
+This is a full-blown functional test. The emphasis here is on testing what
+the user may input and see, and the system is largely tested as a black box.
+We use PloneTestCase to set up this test as well, so we have a full Plone site
+to play with. We *can* inspect the state of the portal, e.g. using 
+self.portal and self.folder, but it is often frowned upon since you are not
+treating the system as a black box. Also, if you, for example, log in or set
+roles using calls like self.setRoles(), these are not reflected in the test
+browser, which runs as a separate session.
+
+Being a doctest, we can tell a story here.
+
+First, we must perform some setup. We use the testbrowser that is shipped
+with Five, as this provides proper Zope 2 integration. Most of the 
+documentation, though, is in the underlying zope.testbrower package.
+
+    >>> from Products.Five.testbrowser import Browser
+    >>> browser = Browser()
+    >>> portal_url = self.portal.absolute_url()
+
+The following is useful when writing and debugging testbrowser tests. It lets
+us see all error messages in the error_log.
+
+    >>> self.portal.error_log._ignored_exceptions = ()
+
+With that in place, we can go to the portal front page and log in. We will
+do this using the default user from PloneTestCase:
+
+    >>> from Products.PloneTestCase.setup import portal_owner, default_password
+
+Because add-on themes or products may remove or hide the login portlet, this test will use the login form that comes with plone.  
+
+    >>> browser.open(portal_url + '/login_form')
+    >>> browser.getControl(name='__ac_name').value = portal_owner
+    >>> browser.getControl(name='__ac_password').value = default_password
+    >>> browser.getControl(name='submit').click()
+
+Here, we set the value of the fields on the login form and then simulate a
+submit click.  We then ensure that we get the friendly logged-in message:
+
+    >>> "You are now logged in" in browser.contents
+    True
+
+Finally, let's return to the front page of our site before continuing
+
+    >>> browser.open(portal_url)
+
+-*- extra stuff goes here -*-
+The Bounty Program Submission content type
+===============================
+
+In this section we are tesing the Bounty Program Submission content type by performing
+basic operations like adding, updadating and deleting Bounty Program Submission content
+items.
+
+Adding a new Bounty Program Submission content item
+--------------------------------
+
+We use the 'Add new' menu to add a new content item.
+
+    >>> browser.getLink('Add new').click()
+
+Then we select the type of item we want to add. In this case we select
+'Bounty Program Submission' and click the 'Add' button to get to the add form.
+
+    >>> browser.getControl('Bounty Program Submission').click()
+    >>> browser.getControl(name='form.button.Add').click()
+    >>> 'Bounty Program Submission' in browser.contents
+    True
+
+Now we fill the form and submit it.
+
+    >>> browser.getControl(name='title').value = 'Bounty Program Submission Sample'
+    >>> browser.getControl('Save').click()
+    >>> 'Changes saved' in browser.contents
+    True
+
+And we are done! We added a new 'Bounty Program Submission' content item to the portal.
+
+Updating an existing Bounty Program Submission content item
+---------------------------------------
+
+Let's click on the 'edit' tab and update the object attribute values.
+
+    >>> browser.getLink('Edit').click()
+    >>> browser.getControl(name='title').value = 'New Bounty Program Submission Sample'
+    >>> browser.getControl('Save').click()
+
+We check that the changes were applied.
+
+    >>> 'Changes saved' in browser.contents
+    True
+    >>> 'New Bounty Program Submission Sample' in browser.contents
+    True
+
+Removing a/an Bounty Program Submission content item
+--------------------------------
+
+If we go to the home page, we can see a tab with the 'New Bounty Program Submission
+Sample' title in the global navigation tabs.
+
+    >>> browser.open(portal_url)
+    >>> 'New Bounty Program Submission Sample' in browser.contents
+    True
+
+Now we are going to delete the 'New Bounty Program Submission Sample' object. First we
+go to the contents tab and select the 'New Bounty Program Submission Sample' for
+deletion.
+
+    >>> browser.getLink('Contents').click()
+    >>> browser.getControl('New Bounty Program Submission Sample').click()
+
+We click on the 'Delete' button.
+
+    >>> browser.getControl('Delete').click()
+    >>> 'Item(s) deleted' in browser.contents
+    True
+
+So, if we go back to the home page, there is no longer a 'New Bounty Program Submission
+Sample' tab.
+
+    >>> browser.open(portal_url)
+    >>> 'New Bounty Program Submission Sample' in browser.contents
+    False
+
+Adding a new Bounty Program Submission content item as contributor
+------------------------------------------------
+
+Not only site managers are allowed to add Bounty Program Submission content items, but
+also site contributors.
+
+Let's logout and then login as 'contributor', a portal member that has the
+contributor role assigned.
+
+    >>> browser.getLink('Log out').click()
+    >>> browser.open(portal_url + '/login_form')
+    >>> browser.getControl(name='__ac_name').value = 'contributor'
+    >>> browser.getControl(name='__ac_password').value = default_password
+    >>> browser.getControl(name='submit').click()
+    >>> browser.open(portal_url)
+
+We use the 'Add new' menu to add a new content item.
+
+    >>> browser.getLink('Add new').click()
+
+We select 'Bounty Program Submission' and click the 'Add' button to get to the add form.
+
+    >>> browser.getControl('Bounty Program Submission').click()
+    >>> browser.getControl(name='form.button.Add').click()
+    >>> 'Bounty Program Submission' in browser.contents
+    True
+
+Now we fill the form and submit it.
+
+    >>> browser.getControl(name='title').value = 'Bounty Program Submission Sample'
+    >>> browser.getControl('Save').click()
+    >>> 'Changes saved' in browser.contents
+    True
+
+Done! We added a new Bounty Program Submission content item logged in as contributor.
+
+Finally, let's login back as manager.
+
+    >>> browser.getLink('Log out').click()
+    >>> browser.open(portal_url + '/login_form')
+    >>> browser.getControl(name='__ac_name').value = portal_owner
+    >>> browser.getControl(name='__ac_password').value = default_password
+    >>> browser.getControl(name='submit').click()
+    >>> browser.open(portal_url)
+
+
+
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/__init__.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/__init__.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/__init__.py	(revision 3129)
@@ -0,0 +1,54 @@
+"""Main product initializer
+"""
+import logging
+from zope.i18nmessageid import MessageFactory
+from ploneorg.kudobounty import config
+
+from Products.Archetypes import atapi
+from Products.CMFCore import utils
+
+# 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.
+
+kudobountyMessageFactory = MessageFactory('ploneorg.kudobounty')
+logger = logging.getLogger('ploneorg.kudobounty')
+
+
+print "%%%% in Bounty.__init__ %%%%%%"
+
+
+def initialize(context):
+    """Initializer called when used as a Zope 2 product.
+
+    This is referenced from configure.zcml. Regstrations as a "Zope 2 product"
+    is necessary for GenericSetup profiles to work, for example.
+
+    Here, we call the Archetypes machinery to register our content types
+    with Zope and the CMF.
+    """
+
+    # Retrieve the content types that have been registered with Archetypes
+    # This happens when the content type is imported and the registerType()
+    # call in the content type's module is invoked. Actually, this happens
+    # during ZCML processing, but we do it here again to be explicit. Of
+    # course, even if we import the module several times, it is only run
+    # once.
+
+    content_types, constructors, ftis = atapi.process_types(
+        atapi.listTypes(config.PROJECTNAME),
+        config.PROJECTNAME)
+
+    # Now initialize all these content types. The initialization process takes
+    # care of registering low-level Zope 2 factories, including the relevant
+    # add-permission. These are listed in config.py. We use different
+    # permissions for each content type to allow maximum flexibility of who
+    # can add which content types, where. The roles are set up in rolemap.xml
+    # in the GenericSetup profile.
+
+    for atype, constructor in zip(content_types, constructors):
+        utils.ContentInit('%s: %s' % (config.PROJECTNAME, atype.portal_type),
+            content_types=(atype, ),
+            permission=config.ADD_PERMISSIONS[atype.portal_type],
+            extra_constructors=(constructor,),
+            ).initialize(context)
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/__init__.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/__init__.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/__init__.py	(revision 3129)
@@ -0,0 +1,1 @@
+#
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/bounty_viewlet.pt
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/bounty_viewlet.pt	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/bounty_viewlet.pt	(revision 3129)
@@ -0,0 +1,16 @@
+<div id="portal-bounty-program"
+     i18n:domain="plone"
+     tal:condition="view/available">
+  <ul>
+    <li tal:repeat="item view/bounty_submissions">
+      <a href="http://submission.url"
+	 title="Title of the submission"
+	 tal:attributes="href item/url;
+			 title item/title;">
+        <img src="http://"
+	     alt="Alternate text for the image"
+	     tal:attributes="src item/img_url;
+                             alt item/alt;"/></a>
+    </li>
+  </ul>
+</div>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/configure.zcml
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/configure.zcml	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/configure.zcml	(revision 3129)
@@ -0,0 +1,31 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    i18n_domain="ploneorg.kudobounty">
+
+  <include package="plone.app.contentmenu" />
+
+  <!-- -*- extra stuff goes here -*- -->
+
+  <!-- <browser:viewlet -->
+  <!--     name="ploneorg.bounty.submission"  -->
+  <!--     manager="plone.app.layout.viewlets.interfaces.IPortalFooter" -->
+  <!--     for="*" -->
+  <!--     class=".viewlets.BountyViewlet" -->
+  <!--     permission="zope.Public"  -->
+  <!--     /> -->
+
+  <browser:resource
+     name="ploneorg_bounty.css"
+     file="ploneorg_bounty.css"
+     />
+
+  <browser:page
+     name="processBountyForm"
+     for="*"
+     permission="zope.Public"
+     class=".views.BountyFormProcessorView"
+     />
+
+
+</configure>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/ploneorg_bounty.css
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/ploneorg_bounty.css	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/ploneorg_bounty.css	(revision 3129)
@@ -0,0 +1,1 @@
+# Bounty CSS resource
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/viewlets.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/viewlets.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/viewlets.py	(revision 3129)
@@ -0,0 +1,29 @@
+from Products.CMFCore.utils import getToolByName
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+from plone.app.layout.viewlets import common
+
+from ploneorg.kudobounty.config import TOPIC_PATH
+
+# -*- extra stuff goes here -*-
+
+class BountyViewlet(common.ViewletBase):
+    render = ViewPageTemplateFile('bounty_viewlet.pt')
+
+    def topic(self):
+        try:
+            return self.portal_state.portal().restrictedTraverse(TOPIC_PATH)
+        except KeyError:
+            return None
+
+    def available(self):
+        return bool(self.topic())
+
+    def bounty_submissions(self):
+        #import pdb;pdb.set_trace()
+        query = self.topic().queryCatalog()
+        res = [{'url':b.getRemoteUrl,
+                'title': b.Title,
+                'alt': b.Description,
+                'img_url': "%s/image_bounty" % b.getURL()} \
+                 for b in query]
+        return res
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/views.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/views.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/browser/views.py	(revision 3129)
@@ -0,0 +1,93 @@
+from DateTime import DateTime
+from zope.interface import implements, Interface
+from zope.component import queryUtility
+from zope.component import getMultiAdapter
+from plone.i18n.normalizer.interfaces import IURLNormalizer
+
+from Products.Five import BrowserView
+from Products.CMFCore.utils import getToolByName
+from Products.Archetypes.config import RENAME_AFTER_CREATION_ATTEMPTS
+
+
+from ploneorg.kudobounty import kudobountyMessageFactory as _
+from ploneorg.kudobounty.config import *
+
+
+class BountyFormProcessorView(BrowserView):
+    """
+    test_view browser view
+    """
+
+    @property
+    def portal(self):
+        return getMultiAdapter((self.context, self.request),
+                               name='plone_portal_state').portal()
+
+    @property
+    def wftool(self):
+        return getMultiAdapter((self.context, self.request),
+                               name='plone_tools').workflow()
+
+    def __call__(self):
+        """
+        test method
+        """
+        try:
+            container = self.portal.restrictedTraverse(SUBMISSION_CONTAINER_ID)
+        except:
+            logger.warn("Can't find bounty submission container " \
+               "with '%s' path" % SUBMISSION_CONTAINER_ID)
+        else:
+            # Create Bounty Program Submission object
+            form = self.request.form
+            title = ' '.join(filter(None,
+                        [form['firstName'], form['lastName'], form['organization']]))
+            id = self.getUniqueId(container, title)
+            container.invokeFactory("Bounty Program Submission", id)
+            bps = getattr(container, id)
+            # Update Submission with data from the PFG form
+            form['image'] = form['image_file']
+            form['description'] = form['altText']
+            effd, expd = self.getEffExpDates()
+            form['effectiveDate'] = effd
+            form['expirationDate'] = expd
+            
+            bps.update(**form)
+            bps.unmarkCreationFlag()
+            bps.reindexObject()
+            # Change wf state
+            self.wftool.doActionFor(bps, "submit")
+
+        return {}
+
+    def getEffExpDates(self):
+        now = DateTime()
+        month = now.month()
+        year = now.year()
+        if month == 12:
+            month = 1
+            year = year + 1
+        else:
+            month = month + 1
+        effd = DateTime(year, month, 1, 0, 0)
+        expd = DateTime(year, month + 1, 1, 23, 55) - 1
+        return effd, expd
+        
+
+    def getUniqueId(self, container, title):
+        id = queryUtility(IURLNormalizer).normalize(title)
+        container_ids = container.objectIds()
+        check_id = lambda id, required: id in container_ids
+
+        invalid_id = check_id(id, required=1)
+        if not invalid_id:
+            return id
+
+        idx = 1
+        while idx <= RENAME_AFTER_CREATION_ATTEMPTS:
+            new_id = "%s-%d" % (id, idx)
+            if not check_id(new_id, required=1):
+                return new_id
+            idx += 1
+
+        return None
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/config.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/config.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/config.py	(revision 3129)
@@ -0,0 +1,17 @@
+"""Common configuration constants
+"""
+
+PROJECTNAME = 'ploneorg.kudobounty'
+
+ADD_PERMISSIONS = {
+    # -*- extra stuff goes here -*-
+    'BountyProgramSubmission': 'ploneorg.kudobounty: Add Bounty Program Submission',
+}
+
+SUBMISSION_CONTAINER_ID = "bounty-submissions"
+FORM_ID = "bounty-submissions-form"
+FORM_PATH = "/".join([SUBMISSION_CONTAINER_ID, FORM_ID])
+TOPIC_ID = "index_html"
+TOPIC_PATH = "/".join([SUBMISSION_CONTAINER_ID, TOPIC_ID])
+
+
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/configure.zcml
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/configure.zcml	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/configure.zcml	(revision 3129)
@@ -0,0 +1,35 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:five="http://namespaces.zope.org/five"
+    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+    xmlns:i18n="http://namespaces.zope.org/i18n"
+    i18n_domain="ploneorg.kudobounty">
+    
+  <five:registerPackage package="." initialize=".initialize" />
+
+  <!-- Include the sub-packages that use their own configure.zcml files. -->
+  <include package=".browser" />
+  <include package=".content" />
+  
+  <!-- Register the installation GenericSetup extension profile -->
+  <genericsetup:registerProfile
+      name="default"
+      title="Bounty Program"
+      directory="profiles/default"
+      description="Bounty Program logo display mechanism for the plone.org"
+      provides="Products.GenericSetup.interfaces.EXTENSION"
+      />
+
+  <genericsetup:importStep
+      name="ploneorg_kudobounty_importvarious"
+      title="Bounty Import Various"
+      description="Import Various Steps"
+      handler="ploneorg.kudobounty.setuphandlers.importVarious">
+    <depends name="content"/>
+    <depends name="typeinfo" />
+    <depends name="workflow"/>
+  </genericsetup:importStep>
+
+  <!-- -*- extra stuff goes here -*- -->
+
+</configure>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/content/__init__.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/content/__init__.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/content/__init__.py	(revision 3129)
@@ -0,0 +1,1 @@
+#
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/content/bountyprogramsubmission.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/content/bountyprogramsubmission.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/content/bountyprogramsubmission.py	(revision 3129)
@@ -0,0 +1,169 @@
+"""Definition of the Bounty Program Submission content type
+"""
+
+from zope.interface import implements
+
+from Products.Archetypes import atapi
+from Products.ATContentTypes.content import base
+from Products.ATContentTypes.content import schemata
+from Products.ATContentTypes.configuration import zconf
+from Products.validation import V_REQUIRED
+
+# -*- Message Factory Imported Here -*-
+from ploneorg.kudobounty import kudobountyMessageFactory as _
+
+from ploneorg.kudobounty.interfaces import IBountyProgramSubmission
+from ploneorg.kudobounty.config import PROJECTNAME
+
+BountyProgramSubmissionSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((
+
+    # -*- Your Archetypes field definitions here ... -*-
+    atapi.ComputedField(
+        name='title',
+        required=1,
+        searchable=1,
+        default='',
+        accessor='Title',
+        storage=atapi.AnnotationStorage(),
+        widget=atapi.ComputedWidget(
+            label=_(u'Name'),
+        ),
+        expression="' '.join(filter(None, [context.getFirstName(),context.getLastName()," \
+                   "context.getOrganization()]))"
+    ),
+
+    atapi.ImageField(
+        'image',
+        languageIndependent=True,
+        storage=atapi.AnnotationStorage(),
+        swallowResizeExceptions = zconf.swallowImageResizeExceptions.enable,
+        pil_quality = zconf.pil_config.quality,
+        pil_resize_algo = zconf.pil_config.resize_algo,
+        max_size = zconf.ATImage.max_image_dimension,
+        sizes= {'bounty': (150,100),},
+        widget=atapi.ImageWidget(
+            label=_(u"Image"),
+            description=_(u"Image or Logo"),
+        ),
+        required=True,
+        validators = (('isNonEmptyFile', V_REQUIRED),
+                      ('checkImageMaxSize', V_REQUIRED)),
+    ),
+
+    atapi.StringField(
+        'remoteUrl', # ?? for use getRemoteUrl metadata from catalog
+        storage=atapi.AnnotationStorage(),
+        widget=atapi.StringWidget(
+            label=_(u"URL"),
+            maxlength = '511',
+        ),
+        required=True,
+        validators=('isURL'),
+        default = "http://",
+    ),
+
+    atapi.StringField(
+        'description',
+        accessor='Description',
+        storage=atapi.AnnotationStorage(),
+        widget=atapi.StringWidget(
+            label=_(u"alt text"),
+        ),
+    ),
+
+    atapi.StringField(
+        'firstName',
+        storage=atapi.AnnotationStorage(),
+        widget=atapi.StringWidget(
+            label=_(u"First name"),
+            description=_(u"Field description"),
+        ),
+    ),
+
+    atapi.StringField(
+        'lastName',
+        storage=atapi.AnnotationStorage(),
+        widget=atapi.StringWidget(
+            label=_(u"Last name"),
+            description=_(u"Field description"),
+        ),
+    ),
+
+    atapi.StringField(
+        'organization',
+        storage=atapi.AnnotationStorage(),
+        widget=atapi.StringWidget(
+            label=_(u"Organization name"),
+            description=_(u"Field description"),
+        ),
+    ),
+
+    atapi.StringField(
+        'email',
+        storage=atapi.AnnotationStorage(),
+        widget=atapi.StringWidget(
+            label=_(u"Email address"),
+        ),
+        validators=('isEmail'),
+    ),
+
+    atapi.TextField(
+        'mission',
+        storage=atapi.AnnotationStorage(),
+        default_content_type = 'text/plain',
+        allowable_content_types = ('text/plain',),
+        widget=atapi.TextAreaWidget(
+            label=_(u"Bounty mission"),
+            description=_(u"Bounty mission trac ticket #"),
+        ),
+        required=True,
+    ),
+
+))
+
+# Set storage on fields copied from ATContentTypeSchema, making sure
+# they work well with the python bridge properties.
+
+BountyProgramSubmissionSchema = schemata.finalizeATCTSchema(
+    BountyProgramSubmissionSchema, moveDiscussion=False)
+BountyProgramSubmissionSchema.moveField('description', after='remoteUrl')
+
+
+class BountyProgramSubmission(base.ATCTContent):
+    """Information for Bounty Program Submission"""
+    implements(IBountyProgramSubmission)
+
+    meta_type = "BountyProgramSubmission"
+    schema = BountyProgramSubmissionSchema
+
+    title = atapi.ATFieldProperty('title')
+    description = atapi.ATFieldProperty('description')
+
+    # -*- Your ATSchema to Python Property Bridges Here ... -*-
+    image = atapi.ATFieldProperty('image')
+    remoteUrl = atapi.ATFieldProperty('remoteUrl')
+    firstName = atapi.ATFieldProperty('firstName')
+    lastName = atapi.ATFieldProperty('lastName')
+    organization = atapi.ATFieldProperty('organization')
+    email = atapi.ATFieldProperty('email')
+    mission = atapi.ATFieldProperty('mission')
+
+    def __bobo_traverse__(self, REQUEST, name):
+        """Transparent access to image scales
+        """
+        if name.startswith('image'):
+            field = self.getField('image')
+            image = None
+            if name == 'image':
+                image = field.getScale(self)
+            else:
+                scalename = name[len('image_'):]
+                if scalename in field.getAvailableSizes(self):
+                    image = field.getScale(self, scale=scalename)
+            if image is not None and not isinstance(image, basestring):
+                # image might be None or '' for empty images
+                return image
+
+        return base.ATCTContent.__bobo_traverse__(self, REQUEST, name)
+    
+atapi.registerType(BountyProgramSubmission, PROJECTNAME)
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/content/configure.zcml
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/content/configure.zcml	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/content/configure.zcml	(revision 3129)
@@ -0,0 +1,16 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:five="http://namespaces.zope.org/five"
+    i18n_domain="ploneorg.kudobounty">
+
+  <!-- configure your content components here -->
+  
+  <!-- -*- extra stuff goes here -*- -->
+  <class class=".bountyprogramsubmission.BountyProgramSubmission">
+    <require
+        permission="zope2.View"
+        interface="..interfaces.IBountyProgramSubmission"
+        />
+  </class>
+
+</configure>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/interfaces/__init__.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/interfaces/__init__.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/interfaces/__init__.py	(revision 3129)
@@ -0,0 +1,2 @@
+# -*- extra stuff goes here -*-
+from bountyprogramsubmission import IBountyProgramSubmission
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/interfaces/bountyprogramsubmission.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/interfaces/bountyprogramsubmission.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/interfaces/bountyprogramsubmission.py	(revision 3129)
@@ -0,0 +1,54 @@
+from zope.interface import Interface
+# -*- Additional Imports Here -*-
+from zope import schema
+
+from ploneorg.kudobounty import kudobountyMessageFactory as _
+
+
+class IBountyProgramSubmission(Interface):
+    """Information for Bounty Program Submission"""
+
+    # -*- schema definition goes here -*-
+    mission = schema.Text(
+        title=_(u"Bounty mission"),
+        required=True,
+        description=_(u"Bounty mission trac ticket #"),
+    )
+#
+    email = schema.TextLine(
+        title=_(u"Email address"),
+        required=False,
+    )
+#
+    organization = schema.TextLine(
+        title=_(u"Organization name"),
+        required=False,
+    )
+#
+    lastName = schema.TextLine(
+        title=_(u"Last name"),
+        required=False,
+    )
+#
+    firstName = schema.TextLine(
+        title=_(u"First name"),
+        required=False,
+    )
+#
+    # altText = schema.TextLine(
+    #     title=_(u"alt text"),
+    #     required=False,
+    #     description=_(u"Field description"),
+    # )
+#
+    remoteUrl = schema.TextLine(
+        title=_(u"URL"),
+        required=True,
+    )
+#
+    image = schema.Bytes(
+        title=_(u"Image"),
+        required=True,
+        description=_(u"Image or Logo"),
+    )
+#
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/cssregistry.xml
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/cssregistry.xml	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/cssregistry.xml	(revision 3129)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<object name="portal_css">
+
+<stylesheet title=""
+    id="++resource++ploneorg_bounty.css"
+    media="screen" rel="stylesheet" rendering="import"
+    cacheable="True" compression="safe" cookable="True"
+    enabled="1" expression=""/>
+
+</object>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/factorytool.xml
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/factorytool.xml	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/factorytool.xml	(revision 3129)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!-- This import step informs the portal_factory tool that we want it to
+     manage our content types. This tool deals with the fact that in
+     Archetypes and most CMF types, the object is actually created before
+     the first edit form is filled in. That is, there are no true "add forms".
+     The factory tool creates a temporary object in lieu of an "add form",
+     and then moves the object to the proper location after it has been
+     successfully saved.
+  -->
+<object name="portal_factory" meta_type="Plone Factory Tool">
+  <factorytypes>
+    <!-- -*- extra stuff goes here -*- -->
+    <type portal_type="Bounty Program Submission" />
+  </factorytypes>
+</object>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/metadata.xml
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/metadata.xml	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/metadata.xml	(revision 3129)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>1000</version>
+  <dependencies>
+    <dependency>profile-Products.PloneFormGen:default</dependency>
+    <dependency>profile-Products.ContentWellPortlets:default</dependency>
+    <dependency>profile-ploneorg.kudobounty:struct</dependency>
+  </dependencies>
+</metadata>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/ploneorg_kudobounty.txt
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/ploneorg_kudobounty.txt	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/ploneorg_kudobounty.txt	(revision 3129)
@@ -0,0 +1,1 @@
+#
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/rolemap.xml
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/rolemap.xml	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/rolemap.xml	(revision 3129)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<rolemap>
+  <permissions>
+    <!-- -*- extra stuff goes here -*- -->
+    <permission name="ploneorg.kudobounty: Add Bounty Program Submission" acquire="False">
+      <role name="Manager" />
+      <role name="Contributor" />
+    </permission>
+  </permissions>
+</rolemap>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/types.xml
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/types.xml	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/types.xml	(revision 3129)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!-- This file registers new types with portal_types. The types are
+     then configured with the corresponding files in types/*.xml. Note
+     that spaces are allowed in type names, but the corresponding XML file
+     uses an underscore instead. The "Factory-based Type Information with
+     dynamic views" refers to an FTI from Products.CMFDynamicViewFTI,
+     which supports Plone's "display" menu.
+  -->
+<object name="portal_types" meta_type="Plone Types Tool">
+  <!-- -*- extra stuff goes here -*- -->
+  <object name="Bounty Program Submission"
+    meta_type="Factory-based Type Information with dynamic views" />
+</object>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/types/Bounty_Program_Submission.xml
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/types/Bounty_Program_Submission.xml	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/types/Bounty_Program_Submission.xml	(revision 3129)
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<object name="Bounty Program Submission"
+   meta_type="Factory-based Type Information with dynamic views"
+   i18n:domain="ploneorg.kudobounty" xmlns:i18n="http://xml.zope.org/namespaces/i18n">
+  <property name="title" i18n:translate="">Bounty Program Submission</property>
+  <property name="description"
+    i18n:translate="">Information for Bounty Program Submission</property>
+  <property name="content_meta_type">BountyProgramSubmission</property>
+  <property name="content_icon">document_icon.gif</property>
+  <property name="product">ploneorg.kudobounty</property>
+  <property name="factory">addBountyProgramSubmission</property>
+  <property name="immediate_view">atct_edit</property>
+  <property name="global_allow">True</property>
+  <property name="filter_content_types">False</property>
+  <property name="allow_discussion">False</property>
+  <property name="default_view">base_view</property>
+  <property name="view_methods">
+    <element value="base_view" />
+  </property>
+  <alias from="(Default)" to="(dynamic view)" />
+  <alias from="edit" to="atct_edit" />
+  <alias from="sharing" to="@@sharing" />
+  <alias from="view" to="(selected layout)" />
+  <action title="View" action_id="view" category="object" condition_expr=""
+    url_expr="string:${object_url}/" visible="True">
+    <permission value="View" />
+  </action>
+  <action title="Edit" action_id="edit" category="object" condition_expr=""
+    url_expr="string:${object_url}/edit" visible="True">
+    <permission value="Modify portal content" />
+  </action>
+</object>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/viewlets.xml
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/viewlets.xml	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/profiles/default/viewlets.xml	(revision 3129)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<object>
+  <order manager="plone.portalfooter" skinname="Plone Default">
+    <viewlet name="ploneorg.bounty.submission" />
+    <viewlet name="plone.footer" />
+    <viewlet name="plone.colophon" />
+    <viewlet name="plone.site_actions" />
+  </order>
+</object>
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/setuphandlers.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/setuphandlers.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/setuphandlers.py	(revision 3129)
@@ -0,0 +1,109 @@
+from ploneorg.kudobounty.config import FORM_ID
+from ploneorg.kudobounty.config import TOPIC_ID
+from ploneorg.kudobounty.config import SUBMISSION_CONTAINER_ID
+
+from Products.CMFCore.utils import getToolByName
+from Products.GenericSetup.context import TarballExportContext, TarballImportContext
+from Products.GenericSetup.interfaces import IFilesystemExporter, IFilesystemImporter
+
+CREATE_SCRIPT_BODY = """
+portal = context.portal_url.getPortalObject()
+formProcessor = portal.restrictedTraverse('@@processBountyForm')
+formProcessor()
+return {}
+"""
+
+def createTopic(container, logger):
+    """
+    Located in: /bounty-mission/index_html
+
+    Item Type = ["Bounty Program Submission",]
+    state = ['published',]
+
+    sort_on = "creation"    
+    """
+    theCollection = getattr(container, TOPIC_ID, None)
+    ptype = getattr(theCollection, 'portal_type', None)
+    if not ptype == "Topic":
+        container.invokeFactory(id=TOPIC_ID, type_name="Topic")
+        theCollection = getattr(container, TOPIC_ID)
+        theCollection.unmarkCreationFlag()
+        theCriteria = theCollection.addCriterion('Type','ATPortalTypeCriterion')
+        theCriteria.setValue(["Bounty Program Submission",])
+        theCriteria = theCollection.addCriterion('review_state','ATSelectionCriterion')
+        theCriteria.setValue("published")
+        theCriteria = theCollection.addCriterion('created','ATSortCriterion') 
+        logger.info("To '%s' added collection, which grab all " \
+                    "'Bounty Program Submission' objects" % \
+                    '/'.join(theCriteria.getPhysicalPath()))
+    else:
+        logger.info("To '%s' collection already present in the portal" \
+                    % '/'.join(theCollection.getPhysicalPath())) 
+
+
+def createPFGForm(context, container, logger):
+    """
+    """
+    form = getattr(container, FORM_ID, None)
+    wftool = getToolByName(container, "portal_workflow")
+
+    if form is not None:
+        # Delete form if it exist
+        container.manage_delObjects(ids = FORM_ID)
+
+    # Create new form object
+    container.invokeFactory(id=FORM_ID, type_name="FormFolder",
+                           title="Form of Bounty Program")
+    form = getattr(container, FORM_ID)
+    logger.info("To '%s' added Form Folder" % \
+                '/'.join(form.getPhysicalPath()))
+    # cleanup form and import data from the archive
+    form.manage_delObjects(ids=form.objectIds())
+    pfg_data = context.readDataFile("pfg_data.tar.gz")
+    ctx = TarballImportContext(form, pfg_data)
+    IFilesystemImporter(form).import_(ctx, 'structure', True)
+    logger.info("Successfully imported PFG from data from archive into the form")
+    # Fix importing PFG via GS bug
+    #   - it adds extra indentation, wchich breaks the script.
+    create_bounty_script = form["create-bounty-submission"]
+    create_bounty_script.setScriptBody(CREATE_SCRIPT_BODY)
+    # Update form
+    form.update(**{"actionAdapter":["create-bounty-submission",],})
+    form.unmarkCreationFlag()
+    form.reindexObject()
+    # Publish the form
+    if wftool.getInfoFor(form, 'review_state') != 'published':
+        wftool.doActionFor(form, 'publish')
+        logger.info("'%s' PFG form successfully published" % form.Title())
+    else:
+        logger.info("'%s' PFG form already in 'published' state" % form.Title())
+
+
+
+def createStructure(context, logger):
+    site = context.getSite()
+
+    subcontainer = getattr(site, SUBMISSION_CONTAINER_ID, None)
+    if subcontainer is None:
+        site.invokeFactory("Folder", SUBMISSION_CONTAINER_ID)
+        subcontainer = getattr(site, SUBMISSION_CONTAINER_ID)
+        subcontainer.update(title="Bounty Submissions container")
+        logger.info("Successfully crated '%s' submissions container" \
+                    "in the portal" % SUBMISSION_CONTAINER_ID)
+    else:
+        logger.info("To '%s' container already present in the portal" \
+                    % '/'.join(subcontainer.getPhysicalPath())) 
+
+    createTopic(subcontainer, logger)
+    createPFGForm(context, subcontainer, logger)
+        
+
+
+def importVarious(context):
+    """ Various import steps
+    """
+    if context.readDataFile('ploneorg_kudobounty.txt') is None:
+        return
+    logger = context.getLogger("ploneorg.kudobounty")
+    
+    createStructure(context, logger)
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/tests/__init__.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/tests/__init__.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/tests/__init__.py	(revision 3129)
@@ -0,0 +1,1 @@
+#
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/tests/base.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/tests/base.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/tests/base.py	(revision 3129)
@@ -0,0 +1,81 @@
+"""Test setup for integration and functional tests.
+
+When we import PloneTestCase and then call setupPloneSite(), all of
+Plone's products are loaded, and a Plone site will be created. This
+happens at module level, which makes it faster to run each test, but
+slows down test runner startup.
+"""
+
+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
+
+# When ZopeTestCase configures Zope, it will *not* auto-load products
+# in Products/. Instead, we have to use a statement such as:
+#   ztc.installProduct('SimpleAttachment')
+# This does *not* apply to products in eggs and Python packages (i.e.
+# not in the Products.*) namespace. For that, see below.
+# All of Plone's products are already set up by PloneTestCase.
+
+
+@onsetup
+def setup_product():
+    """Set up the package and its dependencies.
+
+    The @onsetup decorator causes the execution of this body to be
+    deferred until the setup of the Plone site testing layer. We could
+    have created our own layer, but this is the easiest way for Plone
+    integration tests.
+    """
+
+    # Load the ZCML configuration for the example.tests package.
+    # This can of course use <include /> to include other packages.
+
+    fiveconfigure.debug_mode = True
+    import ploneorg.kudobounty
+    zcml.load_config('configure.zcml', ploneorg.kudobounty)
+    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. Thus, we do it here. Note the use of installPackage()
+    # instead of installProduct().
+    # This is *only* necessary for packages outside the Products.*
+    # namespace which are also declared as Zope 2 products, using
+    # <five:registerPackage /> in ZCML.
+
+    # We may also need to load dependencies, e.g.:
+    #   ztc.installPackage('borg.localrole')
+
+    ztc.installPackage('ploneorg.kudobounty')
+
+# The order here is important: We first call the (deferred) function
+# which installs the products we need for this product. Then, we let
+# PloneTestCase set up this product on installation.
+
+setup_product()
+ptc.setupPloneSite(products=['ploneorg.kudobounty'])
+
+
+class TestCase(ptc.PloneTestCase):
+    """We use this base class for all the tests in this package. If
+    necessary, we can put common utility or setup code in here. This
+    applies to unit test cases.
+    """
+
+
+class FunctionalTestCase(ptc.FunctionalTestCase):
+    """We use this class for functional integration tests that use
+    doctest syntax. Again, we can put basic common utility or setup
+    code in here.
+    """
+
+    def afterSetUp(self):
+        roles = ('Member', 'Contributor')
+        self.portal.portal_membership.addMember('contributor',
+                                                'secret',
+                                                roles, [])
Index: ploneorg.kudobounty/trunk/ploneorg/kudobounty/tests/test_doctest.py
===================================================================
--- ploneorg.kudobounty/trunk/ploneorg/kudobounty/tests/test_doctest.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/ploneorg/kudobounty/tests/test_doctest.py	(revision 3129)
@@ -0,0 +1,25 @@
+import unittest
+import doctest
+
+#from zope.testing import doctestunit
+#from zope.component import testing, eventtesting
+
+from Testing import ZopeTestCase as ztc
+
+from ploneorg.kudobounty.tests import base
+
+
+def test_suite():
+    return unittest.TestSuite([
+
+        # Demonstrate the main content types
+        ztc.ZopeDocFileSuite(
+            'README.txt', package='ploneorg.kudobounty',
+            test_class=base.FunctionalTestCase,
+            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE |
+                doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS),
+
+        ])
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')
Index: ploneorg.kudobounty/trunk/setup.cfg
===================================================================
--- ploneorg.kudobounty/trunk/setup.cfg	(revision 3129)
+++ ploneorg.kudobounty/trunk/setup.cfg	(revision 3129)
@@ -0,0 +1,3 @@
+[zopeskel]
+template = archetype
+
Index: ploneorg.kudobounty/trunk/setup.py
===================================================================
--- ploneorg.kudobounty/trunk/setup.py	(revision 3129)
+++ ploneorg.kudobounty/trunk/setup.py	(revision 3129)
@@ -0,0 +1,73 @@
+# -*- coding: utf-8 -*-
+"""
+This module contains the tool of ploneorg.kudobounty
+"""
+import os
+from setuptools import setup, find_packages
+
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+version = '0.1'
+
+long_description = (
+    read('README.txt')
+    + '\n' +
+    'Change history\n'
+    '**************\n'
+    + '\n' +
+    read('CHANGES.txt')
+    + '\n' +
+    'Detailed Documentation\n'
+    '**********************\n'
+    + '\n' +
+    read('ploneorg', 'kudobounty', 'README.txt')
+    + '\n' +
+    'Contributors\n'
+    '************\n'
+    + '\n' +
+    read('CONTRIBUTORS.txt')
+    + '\n' +
+    'Download\n'
+    '********\n')
+
+tests_require = ['zope.testing']
+
+setup(name='ploneorg.kudobounty',
+      version=version,
+      description="Bounty Program logo display mechanism for the plone.org",
+      long_description=long_description,
+      # Get more strings from
+      # http://pypi.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[
+        'Framework :: Plone',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: GNU General Public License (GPL)',
+        ],
+      keywords='',
+      author='mylan at quintagroup.com',
+      author_email='support@quintagroup.com',
+      url='http://svn.quintagroup.com/products/',
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['ploneorg', ],
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=['setuptools',
+                        # -*- Extra requirements: -*-
+                        'Products.PloneFormGen',
+                        'Products.ContentWellPortlets == 3.0',
+                        'redturtle.portlet.collection == 0.2.5',
+                        ],
+      tests_require=tests_require,
+      extras_require=dict(tests=tests_require),
+      test_suite='ploneorg.kudobounty.tests.test_docs.test_suite',
+      entry_points="""
+      # -*- entry_points -*-
+      [z3c.autoinclude.plugin]
+      target = plone
+      """,
+      setup_requires=["PasteScript"],
+      paster_plugins=["ZopeSkel"],
+      )
