2009-06-29 07:06:01 -05:00
|
|
|
<!codeHeader!>
|
2010-08-05 11:23:17 -05:00
|
|
|
import os, os.path, sys, copy
|
2011-12-05 11:15:45 -06:00
|
|
|
import appy
|
2010-08-05 11:23:17 -05:00
|
|
|
import appy.gen
|
2011-12-05 03:52:18 -06:00
|
|
|
import wrappers
|
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
|
2011-12-05 08:11:29 -06:00
|
|
|
# elements without being statically dependent on Zope packages.
|
2009-06-29 07:06:01 -05:00
|
|
|
from persistent.list import PersistentList
|
2010-09-02 09:16:08 -05:00
|
|
|
from zExceptions import BadRequest
|
|
|
|
from ZPublisher.HTTPRequest import BaseRequest
|
2009-06-29 07:06:01 -05:00
|
|
|
from OFS.Image import File
|
2010-11-26 10:30:46 -06:00
|
|
|
from ZPublisher.HTTPRequest import FileUpload
|
2011-02-01 04:09:54 -06:00
|
|
|
from AccessControl import getSecurityManager
|
2009-06-29 07:06:01 -05:00
|
|
|
from DateTime import DateTime
|
2010-09-02 09:16:08 -05:00
|
|
|
from Products.ExternalMethod.ExternalMethod import ExternalMethod
|
2011-06-10 10:20:09 -05:00
|
|
|
from Products.Transience.Transience import TransientObjectContainer
|
2010-09-02 09:16:08 -05:00
|
|
|
import appy.gen
|
2009-06-29 07:06:01 -05:00
|
|
|
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__)
|
2010-09-02 09:16:08 -05:00
|
|
|
|
2010-10-14 07:43:56 -05:00
|
|
|
# Applications classes, in various formats
|
2009-10-18 07:52:27 -05:00
|
|
|
rootClasses = [<!rootClasses!>]
|
2011-01-14 02:06:25 -06:00
|
|
|
appClasses = [<!appClasses!>]
|
2010-09-02 09:16:08 -05:00
|
|
|
appClassNames = [<!appClassNames!>]
|
|
|
|
allClassNames = [<!allClassNames!>]
|
2010-08-05 11:23:17 -05:00
|
|
|
|
2010-01-06 11:36:16 -06:00
|
|
|
# In the following dict, we store, for every Appy class, the ordered list of
|
2013-08-23 11:57:27 -05:00
|
|
|
# fields.
|
2010-01-06 11:36:16 -06:00
|
|
|
attributes = {<!attributes!>}
|
2010-09-02 09:16:08 -05:00
|
|
|
|
|
|
|
# Application roles
|
|
|
|
applicationRoles = [<!roles!>]
|
|
|
|
applicationGlobalRoles = [<!gRoles!>]
|
|
|
|
grantableRoles = [<!grRoles!>]
|
|
|
|
|
2013-07-24 08:53:19 -05:00
|
|
|
try:
|
|
|
|
appConfig = <!applicationName!>.Config
|
|
|
|
except AttributeError:
|
|
|
|
appConfig = appy.gen.Config
|
2011-12-05 11:15:45 -06:00
|
|
|
|
|
|
|
# When Zope is starting or runs in test mode, there is no request object. We
|
|
|
|
# create here a fake one for storing Appy wrappers.
|
|
|
|
fakeRequest = appy.Object()
|
2009-06-29 07:06:01 -05:00
|
|
|
# ------------------------------------------------------------------------------
|