2009-06-29 07:06:01 -05:00
|
|
|
<!codeHeader!>
|
2010-08-05 11:23:17 -05:00
|
|
|
import os, os.path, sys, copy
|
|
|
|
import appy.gen
|
|
|
|
from Products.CMFCore.permissions import setDefaultRoles
|
|
|
|
import Extensions.appyWrappers as wraps
|
2009-06-29 07:06:01 -05:00
|
|
|
<!imports!>
|
2009-11-11 13:22:13 -06:00
|
|
|
|
2009-06-29 07:06:01 -05:00
|
|
|
# The following imports are here for allowing mixin classes to access those
|
|
|
|
# elements without being statically dependent on Plone/Zope packages. Indeed,
|
|
|
|
# every Archetype instance has a method "getProductConfig" that returns this
|
|
|
|
# module.
|
|
|
|
from persistent.list import PersistentList
|
|
|
|
from OFS.Image import File
|
|
|
|
from DateTime import DateTime
|
|
|
|
from Products.CMFCore.utils import getToolByName
|
|
|
|
from Products.CMFPlone.PloneBatch import Batch
|
|
|
|
import logging
|
|
|
|
logger = logging.getLogger('<!applicationName!>')
|
|
|
|
|
|
|
|
# Some global variables --------------------------------------------------------
|
2009-10-18 07:52:27 -05:00
|
|
|
PROJECTNAME = '<!applicationName!>'
|
2009-11-11 13:22:13 -06:00
|
|
|
diskFolder = os.path.dirname(<!applicationName!>.__file__)
|
2009-06-29 07:06:01 -05:00
|
|
|
defaultAddRoles = [<!defaultAddRoles!>]
|
|
|
|
DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
|
|
|
|
ADD_CONTENT_PERMISSIONS = {
|
|
|
|
<!addPermissions!>}
|
|
|
|
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, tuple(defaultAddRoles))
|
|
|
|
product_globals = globals()
|
|
|
|
applicationRoles = [<!roles!>]
|
2009-10-18 07:52:27 -05:00
|
|
|
rootClasses = [<!rootClasses!>]
|
2010-08-05 11:23:17 -05:00
|
|
|
|
2009-06-29 07:06:01 -05:00
|
|
|
# In the following dict, we keep one instance for every Appy workflow defined
|
|
|
|
# in the application. Those prototypical instances will be used for executing
|
|
|
|
# user-defined actions and transitions. For each instance, we add a special
|
|
|
|
# attribute "_transitionsMapping" that allows to get Appy transitions from the
|
|
|
|
# names of DC transitions.
|
|
|
|
workflowInstances = {}
|
|
|
|
<!workflowInstancesInit!>
|
2010-01-06 11:36:16 -06:00
|
|
|
|
|
|
|
# In the following dict, we store, for every Appy class, the ordered list of
|
2010-08-05 11:23:17 -05:00
|
|
|
# appy types (included inherited ones).
|
2010-01-06 11:36:16 -06:00
|
|
|
attributes = {<!attributes!>}
|
2010-08-05 11:23:17 -05:00
|
|
|
# In the followinf dict, we store, for every Appy class, a dict of appy types
|
|
|
|
# keyed by their names.
|
|
|
|
attributesDict = {<!attributesDict!>}
|
2009-06-29 07:06:01 -05:00
|
|
|
# ------------------------------------------------------------------------------
|