Permalink
Browse files

Initial import

  • Loading branch information...
0 parents commit 8129aa0d9ede38b739f46912008e8e57cf9c7afb @aclark4life aclark4life committed Sep 8, 2012
Showing with 1,077 additions and 0 deletions.
  1. +2 −0 MANIFEST.in
  2. +2 −0 Products/__init__.py
  3. +91 −0 Products/ifQuotes/__init__.py
  4. 0 Products/ifQuotes/browser/__init__.py
  5. +24 −0 Products/ifQuotes/browser/configure.zcml
  6. +15 −0 Products/ifQuotes/browser/quote.py
  7. +39 −0 Products/ifQuotes/browser/templates/quote_view.pt
  8. +54 −0 Products/ifQuotes/config.py
  9. +12 −0 Products/ifQuotes/configure.zcml
  10. +83 −0 Products/ifQuotes/content/Quote.py
  11. +65 −0 Products/ifQuotes/content/QuoteFolder.py
  12. +44 −0 Products/ifQuotes/content/__init__.py
  13. +17 −0 Products/ifQuotes/content/interfaces.py
  14. BIN Products/ifQuotes/model/ifQuotes.zargo
  15. 0 Products/ifQuotes/portlets/__init__.py
  16. +20 −0 Products/ifQuotes/portlets/configure.zcml
  17. +86 −0 Products/ifQuotes/portlets/quotes.py
  18. +36 −0 Products/ifQuotes/portlets/templates/randomquote.pt
  19. +22 −0 Products/ifQuotes/profiles.zcml
  20. +18 −0 Products/ifQuotes/profiles/default/cssregistry.xml
  21. +7 −0 Products/ifQuotes/profiles/default/factorytool.xml
  22. +4 −0 Products/ifQuotes/profiles/default/ifQuotes_marker.txt
  23. +27 −0 Products/ifQuotes/profiles/default/import_steps.xml
  24. +16 −0 Products/ifQuotes/profiles/default/jsregistry.xml
  25. +7 −0 Products/ifQuotes/profiles/default/portlets.xml
  26. +28 −0 Products/ifQuotes/profiles/default/skins.xml
  27. +11 −0 Products/ifQuotes/profiles/default/types.xml
  28. +52 −0 Products/ifQuotes/profiles/default/types/Quote.xml
  29. +53 −0 Products/ifQuotes/profiles/default/types/QuoteFolder.xml
  30. 0 Products/ifQuotes/refresh.txt
  31. +53 −0 Products/ifQuotes/setuphandlers.py
  32. BIN Products/ifQuotes/skins/ifquotes_images/Quote.gif
  33. BIN Products/ifQuotes/skins/ifquotes_images/QuoteFolder.gif
  34. 0 Products/ifQuotes/tests/__init__.py
  35. +44 −0 Products/ifQuotes/tests/base.py
  36. +24 −0 Products/ifQuotes/tests/test_doctest.py
  37. +101 −0 Products/ifQuotes/tests/test_portlet_promotions.py
  38. +1 −0 Products/ifQuotes/version.txt
  39. +19 −0 setup.py
@@ -0,0 +1,2 @@
+include *
+recursive-include Products *
@@ -0,0 +1,2 @@
+from pkg_resources import declare_namespace
+declare_namespace(__name__)
@@ -0,0 +1,91 @@
+# -*- coding: utf-8 -*-
+#
+# File: ifQuotes.py
+#
+# Copyright (c) 2008 by []
+# Generator: ArchGenXML Version 2.0
+# http://plone.org/products/archgenxml
+#
+# GNU General Public License (GPL)
+#
+# 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.
+#
+
+__author__ = """unknown <unknown>"""
+__docformat__ = 'plaintext'
+
+
+# There are three ways to inject custom code here:
+#
+# - To set global configuration variables, create a file AppConfig.py.
+# This will be imported in config.py, which in turn is imported in
+# each generated class and in this file.
+# - To perform custom initialisation after types have been registered,
+# use the protected code section at the bottom of initialize().
+
+import logging
+logger = logging.getLogger('ifQuotes')
+logger.debug('Installing Product')
+
+import os
+import os.path
+from Globals import package_home
+import Products.CMFPlone.interfaces
+from Products.Archetypes import listTypes
+from Products.Archetypes.atapi import *
+from Products.Archetypes.utils import capitalize
+from Products.CMFCore import DirectoryView
+from Products.CMFCore import permissions as cmfpermissions
+from Products.CMFCore import utils as cmfutils
+from Products.CMFPlone.utils import ToolInit
+from config import *
+
+DirectoryView.registerDirectory('skins', product_globals)
+
+
+##code-section custom-init-head #fill in your manual code here
+##/code-section custom-init-head
+
+
+def initialize(context):
+ """initialize product (called by zope)"""
+ ##code-section custom-init-top #fill in your manual code here
+ ##/code-section custom-init-top
+
+ # imports packages and types for registration
+ import content
+
+
+
+ # Initialize portal content
+ content_types, constructors, ftis = process_types(
+ listTypes(PROJECTNAME),
+ PROJECTNAME)
+
+ cmfutils.ContentInit(
+ PROJECTNAME + ' Content',
+ content_types = content_types,
+ permission = DEFAULT_ADD_CONTENT_PERMISSION,
+ extra_constructors = constructors,
+ fti = ftis,
+ ).initialize(context)
+
+ ##code-section custom-init-bottom #fill in your manual code here
+ #from Products.LTAKeywords import patches
+ #patches.apply_patches()
+ #del patches
+ ##/code-section custom-init-bottom
+
No changes.
@@ -0,0 +1,24 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ i18n_domain="ifQuote">
+
+ <include package="plone.app.contentmenu" />
+
+ <!-- Zope 3 browser resources -->
+ <browser:page
+ for="..content.interfaces.IQuote"
+ name="view"
+ class=".quote.QuoteView"
+ permission="zope2.View"
+ />
+
+ <browser:menuItem
+ for="..content.interfaces.IQuote"
+ menu="plone_displayviews"
+ title="Quote view"
+ action="@@view"
+ description="Default representation of a quote"
+ />
+
+</configure>
@@ -0,0 +1,15 @@
+from Products.CMFPlone import utils
+from zope.interface import Interface
+from zope.interface import implements
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+from Products.Five.browser import BrowserView
+
+class IQuoteView(Interface):
+ """Interface for Quote View"""
+
+class QuoteView(BrowserView):
+ implements(IQuoteView)
+
+ __call__ = ViewPageTemplateFile('templates/quote_view.pt')
+
+
@@ -0,0 +1,39 @@
+<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="context/main_template/macros/master"
+ i18n:domain="optilux.cinemacontent">
+<body>
+
+<metal:main fill-slot="main">
+ <tal:main-macro metal:define-macro="main">
+
+ <div tal:replace="structure provider:plone.abovecontenttitle" />
+
+ <h1 class="documentFirstHeading">
+ <span metal:use-macro="python:context.widget('title', mode='view')" />
+ </h1>
+
+ <div tal:replace="structure provider:plone.belowcontenttitle" />
+
+ <div class="documentDescription">
+ <span metal:use-macro="python:context.widget('description', mode='view')" />
+ </div>
+
+ <label>Title:</label>
+ <div metal:use-macro="python:context.widget('title', mode='view')" />
+ <label>Quote:</label>
+ <div metal:use-macro="python:context.widget('quote', mode='view')" />
+ <label>Author:</label>
+ <div metal:use-macro="python:context.widget('author', mode='view')" />
+
+ <div tal:replace="structure provider:plone.abovecontentbody" />
+
+ </tal:main-macro>
+</metal:main>
+
+</body>
+</html>
+
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+#
+# File: ifQuotes.py
+#
+# Copyright (c) 2008 by []
+# Generator: ArchGenXML Version 2.0
+# http://plone.org/products/archgenxml
+#
+# GNU General Public License (GPL)
+#
+
+__author__ = """unknown <unknown>"""
+__docformat__ = 'plaintext'
+
+
+# Product configuration.
+#
+# The contents of this module will be imported into __init__.py, the
+# workflow configuration and every content type module.
+#
+# If you wish to perform custom configuration, you may put a file
+# AppConfig.py in your product's root directory. The items in there
+# will be included (by importing) in this file if found.
+
+from Products.CMFCore.permissions import setDefaultRoles
+##code-section config-head #fill in your manual code here
+##/code-section config-head
+
+
+PROJECTNAME = "ifQuotes"
+
+# Permissions
+DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
+setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, ('Manager', 'Owner'))
+
+product_globals = globals()
+
+# Dependencies of Products to be installed by quick-installer
+# override in custom configuration
+DEPENDENCIES = []
+
+# Dependend products - not quick-installed - used in testcase
+# override in custom configuration
+PRODUCT_DEPENDENCIES = []
+
+##code-section config-bottom #fill in your manual code here
+##/code-section config-bottom
+
+
+# Load custom configuration not managed by archgenxml
+try:
+ from Products.ifQuotes.AppConfig import *
+except ImportError:
+ pass
@@ -0,0 +1,12 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:five="http://namespaces.zope.org/five">
+
+ <include file="profiles.zcml" />
+
+ <!-- ##code-section configure.zcml -->
+ <include package=".portlets" />
+ <include package=".browser" />
+ <!-- ##/code-section configure.zcml -->
+
+</configure>
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+#
+# File: Quote.py
+#
+# Copyright (c) 2008 by []
+# Generator: ArchGenXML Version 2.0
+# http://plone.org/products/archgenxml
+#
+# GNU General Public License (GPL)
+#
+
+__author__ = """unknown <unknown>"""
+__docformat__ = 'plaintext'
+
+from AccessControl import ClassSecurityInfo
+from Products.Archetypes.atapi import *
+from zope.interface import implements
+import interfaces
+
+from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin
+
+from Products.ifQuotes.config import *
+
+##code-section module-header #fill in your manual code here
+##/code-section module-header
+
+schema = Schema((
+
+ TextField(
+ name='quote',
+ allowable_content_types=('text/plain',),
+ widget=TextAreaWidget(
+ label='Quote',
+ label_msgid='ifQuotes_label_quote',
+ i18n_domain='ifQuotes',
+ ),
+ ),
+ StringField(
+ name='author',
+ widget=StringField._properties['widget'](
+ label='Author',
+ label_msgid='ifQuotes_label_author',
+ i18n_domain='ifQuotes',
+ ),
+ ),
+),
+)
+
+##code-section after-local-schema #fill in your manual code here
+##/code-section after-local-schema
+
+Quote_schema = BaseSchema.copy() + \
+ schema.copy()
+
+##code-section after-schema #fill in your manual code here
+##/code-section after-schema
+
+class Quote(BaseContent, BrowserDefaultMixin):
+ """
+ """
+ security = ClassSecurityInfo()
+ implements(interfaces.IQuote)
+
+ meta_type = 'Quote'
+ portal_type = 'Quote'
+ content_icon = 'document_icon.gif'
+ _at_rename_after_creation = True
+
+ schema = Quote_schema
+
+ ##code-section class-header #fill in your manual code here
+ ##/code-section class-header
+
+ # Methods
+
+registerType(Quote, PROJECTNAME)
+# end of class Quote
+
+##code-section module-footer #fill in your manual code here
+##/code-section module-footer
+
+
+
@@ -0,0 +1,65 @@
+# -*- coding: utf-8 -*-
+#
+# File: QuoteFolder.py
+#
+# Copyright (c) 2008 by []
+# Generator: ArchGenXML Version 2.0
+# http://plone.org/products/archgenxml
+#
+# GNU General Public License (GPL)
+#
+
+__author__ = """unknown <unknown>"""
+__docformat__ = 'plaintext'
+
+from AccessControl import ClassSecurityInfo
+from Products.Archetypes.atapi import *
+from zope.interface import implements
+import interfaces
+
+from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin
+
+from Products.ifQuotes.config import *
+
+##code-section module-header #fill in your manual code here
+##/code-section module-header
+
+schema = Schema((
+
+),
+)
+
+##code-section after-local-schema #fill in your manual code here
+##/code-section after-local-schema
+
+QuoteFolder_schema = BaseFolderSchema.copy() + \
+ schema.copy()
+
+##code-section after-schema #fill in your manual code here
+##/code-section after-schema
+
+class QuoteFolder(BaseFolder, BrowserDefaultMixin):
+ """
+ """
+ security = ClassSecurityInfo()
+ implements(interfaces.IQuoteFolder)
+
+ meta_type = 'QuoteFolder'
+ _at_rename_after_creation = True
+ content_icon = 'folder_icon.gif'
+
+ schema = QuoteFolder_schema
+
+ ##code-section class-header #fill in your manual code here
+ ##/code-section class-header
+
+ # Methods
+
+registerType(QuoteFolder, PROJECTNAME)
+# end of class QuoteFolder
+
+##code-section module-footer #fill in your manual code here
+##/code-section module-footer
+
+
+
Oops, something went wrong.

0 comments on commit 8129aa0

Please sign in to comment.