Author: roman
Date: Fri Jun 23 10:07:35 2006
New Revision: 4180
Added:
teaserfolder/trunk/Extensions/
teaserfolder/trunk/Extensions/Install.py
teaserfolder/trunk/Extensions/__init__.py
teaserfolder/trunk/TeaserFolder.py
teaserfolder/trunk/__init__.py
teaserfolder/trunk/config.py
teaserfolder/trunk/model/
teaserfolder/trunk/model/teaserFolder.zargo (contents, props changed)
teaserfolder/trunk/refresh.txt
teaserfolder/trunk/skins/
teaserfolder/trunk/skins/teaserfolder/
teaserfolder/trunk/skins/teaserfolder/readme.txt
teaserfolder/trunk/skins/teaserfolder/teaser_folder.png (contents, props
changed)
teaserfolder/trunk/skins/teaserfolder_public/
teaserfolder/trunk/skins/teaserfolder_public/readme.txt
teaserfolder/trunk/version.txt
Log:
initial checkin - plone folder with image field
Added: teaserfolder/trunk/Extensions/Install.py
==============================================================================
--- (empty file)
+++ teaserfolder/trunk/Extensions/Install.py Fri Jun 23 10:07:35 2006
(at)(at) -0,0 +1,140 (at)(at)
+""" Extensions/Install.py """
+
+# Copyright (c) 2006 by
+#
+# Generated:
+# Generator: ArchGenXML Version 1.4.0-beta2
+# http://sf.net/projects/archetypes/
+#
+# GNU General Public Licence (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., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+#
+__author__ = '''unknown <unknown>'''
+__docformat__ = 'plaintext'
+__version__ = '$ Revision 0.0 $'[11:-2]
+
+import os.path
+import sys
+from StringIO import StringIO
+
+from App.Common import package_home
+from Products.CMFCore.utils import getToolByName
+from Products.CMFCore.utils import manage_addTool
+from Products.ExternalMethod.ExternalMethod import ExternalMethod
+from zExceptions import NotFound, BadRequest
+
+from Products.Archetypes.Extensions.utils import installTypes
+from Products.Archetypes.Extensions.utils import install_subskin
+try:
+ from Products.Archetypes.lib.register import listTypes
+except ImportError:
+ from Products.Archetypes.public import listTypes
+from Products.teaserfolder.config import PROJECTNAME
+from Products.teaserfolder.config import product_globals as GLOBALS
+
+def install(self):
+ """ External Method to install teaserfolder """
+ out = StringIO()
+ print >> out, "Installation log of %s:" % PROJECTNAME
+
+ # If the config contains a list of dependencies, try to install
+ # them. Add a list called DEPENDENCIES to your custom
+ # AppConfig.py (imported by config.py) to use it.
+ try:
+ from Products.teaserfolder.config import DEPENDENCIES
+ except:
+ DEPENDENCIES = []
+ portal = getToolByName(self,'portal_url').getPortalObject()
+ quickinstaller = portal.portal_quickinstaller
+ for dependency in DEPENDENCIES:
+ print >> out, "Installing dependency %s:" % dependency
+ quickinstaller.installProduct(dependency)
+ get_transaction().commit(1)
+
+ classes = listTypes(PROJECTNAME)
+ installTypes(self, out,
+ classes,
+ PROJECTNAME)
+ install_subskin(self, out, GLOBALS)
+
+
+ # try to call a workflow install method
+ # in 'InstallWorkflows.py' method 'installWorkflows'
+ try:
+ installWorkflows =
ExternalMethod('temp','temp',PROJECTNAME+'.InstallWorkflows',
'installWorkflows').__of__(self)
+ except NotFound:
+ installWorkflows = None
+
+ if installWorkflows:
+ print >>out,'Workflow Install:'
+ res = installWorkflows(self,out)
+ print >>out,res or 'no output'
+ else:
+ print >>out,'no workflow install'
+
+
+
+ # try to call a custom install method
+ # in 'AppInstall.py' method 'install'
+ try:
+ install = ExternalMethod('temp','temp',PROJECTNAME+'.AppInstall',
'install')
+ except NotFound:
+ install = None
+
+ if install:
+ print >>out,'Custom Install:'
+ res = install(self)
+ if res:
+ print >>out,res
+ else:
+ print >>out,'no output'
+ else:
+ print >>out,'no custom install'
+ return out.getvalue()
+
+def uninstall(self):
+ out = StringIO()
+
+ # try to call a workflow uninstall method
+ # in 'InstallWorkflows.py' method 'uninstallWorkflows'
+ try:
+ installWorkflows =
ExternalMethod('temp','temp',PROJECTNAME+'.InstallWorkflows',
'uninstallWorkflows').__of__(self)
+ except NotFound:
+ installWorkflows = None
+
+ if installWorkflows:
+ print >>out,'Workflow Uninstall:'
+ res = uninstallWorkflows(self,out)
+ print >>out,res or 'no output'
+ else:
+ print >>out,'no workflow uninstall'
+
+ # try to call a custom uninstall method
+ # in 'AppInstall.py' method 'uninstall'
+ try:
+ uninstall = ExternalMethod('temp','temp',PROJECTNAME+'.AppInstall',
'uninstall')
+ except:
+ uninstall = None
+
+ if uninstall:
+ print >>out,'Custom Uninstall:'
+ res = uninstall(self)
+ if res:
+ print >>out,res
+ else:
+ print >>out,'no output'
+ else:
+ print >>out,'no custom uninstall'
+
+ return out.getvalue()
Added: teaserfolder/trunk/Extensions/__init__.py
==============================================================================
--- (empty file)
+++ teaserfolder/trunk/Extensions/__init__.py Fri Jun 23 10:07:35 2006
(at)(at) -0,0 +1 (at)(at)
+# make me a python module
Added: teaserfolder/trunk/TeaserFolder.py
==============================================================================
--- (empty file)
+++ teaserfolder/trunk/TeaserFolder.py Fri Jun 23 10:07:35 2006
(at)(at) -0,0 +1,89 (at)(at)
+# File: TeaserFolder.py
+#
+# Copyright (c) 2006 by
+# Generator: ArchGenXML Version 1.4.0-beta2 http://sf.net/projects/archetypes/
+#
+# GNU General Public Licence (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., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+#
+__author__ = '''unknown <unknown>'''
+__docformat__ = 'plaintext'
+
+from AccessControl import ClassSecurityInfo
+from Products.Archetypes.atapi import *
+
+from Products.ATContentTypes.content.folder import ATFolder
+
+
+from Products.teaserfolder.config import *
+##code-section module-header #fill in your manual code here
+##/code-section module-header
+
+schema=Schema((
+ ImageField('teaserImage',
+ widget=ImageWidget(
+ label="Teaser Image",
+ description="Image which will be shown as a teaser in the standard
view of the Folder.",
+ label_msgid='teaserfolder_label_teaserImage',
+ description_msgid='teaserfolder_help_teaserImage',
+ i18n_domain='teaserfolder',
+ ),
+ storage=AttributeStorage()
+ ),
+
+),
+)
+
+
+##code-section after-schema #fill in your manual code here
+##/code-section after-schema
+
+class TeaserFolder(ATFolder):
+ security = ClassSecurityInfo()
+ __implements__ = (getattr(ATFolder,'__implements__',()),)
+
+
+ # This name appears in the 'add' box
+ archetype_name = 'TeaserFolder'
+
+ meta_type = 'TeaserFolder'
+ portal_type = 'TeaserFolder'
+ allowed_content_types = [] + list(getattr(ATFolder,
'allowed_content_types', []))
+ filter_content_types = 0
+ global_allow = 1
+ allow_discussion = 0
+ content_icon = 'teaser_folder.png'
+ immediate_view = 'base_view'
+ default_view = 'base_view'
+ typeDescription = "TeaserFolder"
+ typeDescMsgId = 'description_edit_teaserfolder'
+
+ schema = BaseSchema + \
+ getattr(ATFolder,'schema',Schema(())) + \
+ schema
+
+ ##code-section class-header #fill in your manual code here
+ ##/code-section class-header
+
+
+ #Methods
+
+registerType(TeaserFolder,PROJECTNAME)
+# end of class TeaserFolder
+
+##code-section module-footer #fill in your manual code here
+##/code-section module-footer
+
+
+
Added: teaserfolder/trunk/__init__.py
==============================================================================
--- (empty file)
+++ teaserfolder/trunk/__init__.py Fri Jun 23 10:07:35 2006
(at)(at) -0,0 +1,70 (at)(at)
+#
+# Initialise the product's module. 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().
+# - To register a customisation policy, create a file CustomizationPolicy.py
+# with a method register(context) to register the policy
+#
+
+from zLOG import LOG, INFO
+
+LOG('teaserfolder',INFO, 'Installing Product')
+
+try:
+ import CustomizationPolicy
+except ImportError:
+ CustomizationPolicy=None
+
+from Globals import package_home
+from Products.CMFCore import utils, CMFCorePermissions, DirectoryView
+from Products.CMFPlone.PloneUtilities import ToolInit
+from Products.Archetypes.public import *
+from Products.Archetypes import listTypes
+from Products.Archetypes.utils import capitalize
+
+import os, os.path
+
+from Products.teaserfolder.config import *
+
+DirectoryView.registerDirectory('skins', product_globals)
+DirectoryView.registerDirectory('skins/teaserfolder',
+ product_globals)
+
+##code-section custom-init-head #fill in your manual code here
+##/code-section custom-init-head
+
+
+def initialize(context):
+ ##code-section custom-init-top #fill in your manual code here
+ ##/code-section custom-init-top
+
+ # imports packages and types for registration
+
+ import TeaserFolder
+
+ # initialize portal content
+ content_types, constructors, ftis = process_types(
+ listTypes(PROJECTNAME),
+ PROJECTNAME)
+
+ utils.ContentInit(
+ PROJECTNAME + ' Content',
+ content_types = content_types,
+ permission = DEFAULT_ADD_CONTENT_PERMISSION,
+ extra_constructors = constructors,
+ fti = ftis,
+ ).initialize(context)
+
+ # apply customization-policy, if theres any
+ if CustomizationPolicy and hasattr(CustomizationPolicy, 'register'):
+ CustomizationPolicy.register(context)
+ print 'Customization policy for teaserfolder installed'
+
+ ##code-section custom-init-bottom #fill in your manual code here
+ ##/code-section custom-init-bottom
+
Added: teaserfolder/trunk/config.py
==============================================================================
--- (empty file)
+++ teaserfolder/trunk/config.py Fri Jun 23 10:07:35 2006
(at)(at) -0,0 +1,27 (at)(at)
+#
+# Product configuration. This contents of this module will be imported into
+# __init__.py 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. This will be included in this file if
+# found.
+#
+from Products.CMFCore.CMFCorePermissions import setDefaultRoles
+
+PROJECTNAME = "teaserfolder"
+
+DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
+setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, ('Manager', 'Owner',
'Member'))
+
+product_globals=globals()
+
+##code-section config-bottom #fill in your manual code here
+##/code-section config-bottom
+
+
+try:
+ from Products.teaserfolder.AppConfig import *
+except ImportError:
+ pass
+
+# End of config.py
Added: teaserfolder/trunk/model/teaserFolder.zargo
==============================================================================
Binary file. No diff available.
Added: teaserfolder/trunk/refresh.txt
==============================================================================
Added: teaserfolder/trunk/skins/teaserfolder/readme.txt
==============================================================================
--- (empty file)
+++ teaserfolder/trunk/skins/teaserfolder/readme.txt Fri Jun 23 10:07:35 2006
(at)(at) -0,0 +1,6 (at)(at)
+Directory 'skins/teaserfolder':
+
+This skin layer has low priority, put unique templates and scripts here.
+
+I.e. if you to want to create own unique views or forms for your product, this
+is the right place.
Added: teaserfolder/trunk/skins/teaserfolder/teaser_folder.png
==============================================================================
Binary file. No diff available.
Added: teaserfolder/trunk/skins/teaserfolder_public/readme.txt
==============================================================================
--- (empty file)
+++ teaserfolder/trunk/skins/teaserfolder_public/readme.txt Fri Jun 23 10:07:35
2006
(at)(at) -0,0 +1,8 (at)(at)
+Directory 'skins/teaserfolder_public':
+
+This skin layer has highest priority, put templates and scripts here that are
+supposed to overload existing ones.
+
+I.e. if you want to change want a site-wide change of Archetypes skins
+base_edit, base_view, etc or also Plone skins like main_template or
+document_view, put it in here.
Added: teaserfolder/trunk/version.txt
==============================================================================
--- (empty file)
+++ teaserfolder/trunk/version.txt Fri Jun 23 10:07:35 2006
(at)(at) -0,0 +1 (at)(at)
+0.1 build 7
|