Eradicated Flavour and PodTemplate classes (for the latter, use Pod fields instead); Added a code analyser; Groups can now be slaves in master/slaves relationships; Refs have more params (show a confirmation popup before adding an object, add an object without creation form); Code for Refs has been refactored to comply with the new way to organize Types; Added a WebDAV client library.

This commit is contained in:
Gaetan Delannay 2010-10-14 14:43:56 +02:00
parent 9f4db88bdf
commit 990e16c6e7
47 changed files with 1006 additions and 1297 deletions

View file

@ -4,7 +4,7 @@ from DateTime import DateTime
from Products.Archetypes.atapi import *
import Products.<!applicationName!>.config
from Extensions.appyWrappers import <!genClassName!>_Wrapper
from appy.gen.plone25.mixins.ClassMixin import ClassMixin
from appy.gen.plone25.mixins import BaseMixin
<!imports!>
schema = Schema((<!fields!>
@ -29,7 +29,7 @@ class <!genClassName!>(<!parents!>):
i18nDomain = '<!applicationName!>'
schema = fullSchema
wrapperClass = <!genClassName!>_Wrapper
for elem in dir(ClassMixin):
for elem in dir(BaseMixin):
if not elem.startswith('__'): security.declarePublic(elem)
<!commonMethods!>
<!methods!>

View file

@ -1,36 +0,0 @@
<!codeHeader!>
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
from Products.Archetypes.atapi import *
import Products.<!applicationName!>.config
from appy.gen.plone25.mixins.FlavourMixin import FlavourMixin
from Extensions.appyWrappers import <!wrapperClass!>
schema = Schema((<!fields!>
),)
fullSchema = OrderedBaseFolderSchema.copy() + schema.copy()
class <!flavourName!>(OrderedBaseFolder, FlavourMixin):
'''Configuration flavour class for <!applicationName!>.'''
security = ClassSecurityInfo()
__implements__ = (getattr(OrderedBaseFolderSchema,'__implements__',()),)
archetype_name = '<!flavourName!>'
meta_type = '<!flavourName!>'
portal_type = '<!flavourName!>'
allowed_content_types = []
filter_content_types = 0
global_allow = 1
immediate_view = 'skyn/view'
default_view = 'skyn/view'
suppl_views = ()
typeDescription = "<!flavourName!>"
typeDescMsgId = '<!flavourName!>_edit_descr'
i18nDomain = '<!applicationName!>'
schema = fullSchema
allMetaTypes = <!metaTypes!>
wrapperClass = <!wrapperClass!>
for elem in dir(FlavourMixin):
if not elem.startswith('__'): security.declarePublic(elem)
<!commonMethods!>
<!methods!>
registerType(<!flavourName!>, '<!applicationName!>')

View file

@ -1,34 +0,0 @@
<!codeHeader!>
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
from Products.Archetypes.atapi import *
import Products.<!applicationName!>.config
from appy.gen.plone25.mixins.PodTemplateMixin import PodTemplateMixin
from Extensions.appyWrappers import <!wrapperClass!>
schema = Schema((<!fields!>
),)
fullSchema = BaseSchema.copy() + schema.copy()
class <!applicationName!>PodTemplate(BaseContent, PodTemplateMixin):
'''POD template.'''
security = ClassSecurityInfo()
__implements__ = (getattr(BaseContent,'__implements__',()),)
archetype_name = '<!applicationName!>PodTemplate'
meta_type = '<!applicationName!>PodTemplate'
portal_type = '<!applicationName!>PodTemplate'
allowed_content_types = []
filter_content_types = 0
global_allow = 1
immediate_view = 'skyn/view'
default_view = 'skyn/view'
suppl_views = ()
typeDescription = "<!applicationName!>PodTemplate"
typeDescMsgId = '<!applicationName!>PodTemplate_edit_descr'
wrapperClass = <!wrapperClass!>
schema = fullSchema
for elem in dir(PodTemplateMixin):
if not elem.startswith('__'): security.declarePublic(elem)
<!commonMethods!>
<!methods!>
registerType(<!applicationName!>PodTemplate, '<!applicationName!>')

View file

@ -3,15 +3,13 @@
i18n:domain="<!applicationName!>">
<body>
<div metal:define-macro="portlet"
tal:define="tool python: context.<!toolInstanceName!>;
flavour python: tool.getFlavour(tool);"
tal:define="tool python: context.<!toolInstanceName!>;"
tal:condition="python: tool.showPortlet(context)">
<metal:block metal:use-macro="here/global_defines/macros/defines" />
<metal:prologue use-macro="here/skyn/page/macros/prologue"/>
<dl tal:define="rootClasses tool/getRootClasses;
appName string:<!applicationName!>;
appFolder tool/getAppFolder;
flavours tool/getFlavoursInfo" class="portlet">
appFolder tool/getAppFolder" class="portlet">
<metal:content use-macro="here/skyn/portlet/macros/portletContent"/>
</dl>
</div>

View file

@ -36,24 +36,22 @@ label { font-weight: bold; font-style: italic; line-height: 1.4em;}
border-width: thin;
text-align: center;
padding: 0.1em 1em 0.1em 1.3em;
background-position: -1px 4px;
}
.appyChanges th {
font-style: italic;
background-color: transparent;
border-bottom: 1px dashed #8CACBB;
border-top: 0 none transparent;
border-left: 0 none transparent;
border-right: 0 none transparent;
border: 0 none transparent;
padding: 0.1em 0.1em 0.1em 0.1em;
}
.appyChanges td {
padding: 0.1em 0.1em 0.1em 0.1em !important;
padding: 0.1em 0.2em 0.1em 0.2em !important;
border-top: 1px dashed #8CACBB !important;
border-right: 0 none transparent !important;
border-top: 0 none transparent;
border-left: 0 none transparent;
border-right: 0 none transparent;
border-left: 0 none transparent !important;
border-bottom: 0 none transparent !important;
}
.appyHistory {
@ -70,6 +68,12 @@ label { font-weight: bold; font-style: italic; line-height: 1.4em;}
background-repeat: no-repeat;
background-position: -1px 7px;
}
.stepDoneState {
background-color: #cde2a7;
background-image: url(&dtml-portal_url;/skyn/done.png);
background-repeat: no-repeat;
background-position: -1px 4px;
}
.stepCurrent {
background-color: #eef3f5;
@ -77,6 +81,12 @@ label { font-weight: bold; font-style: italic; line-height: 1.4em;}
background-repeat: no-repeat;
background-position: -1px 7px;
}
.stepCurrentState {
background-color: #eef3f5;
background-image: url(&dtml-portal_url;/skyn/current.png);
background-repeat: no-repeat;
background-position: -1px 4px;
}
.stepFuture {
background-color: #ffffff;

View file

@ -29,6 +29,7 @@ class <!toolName!>(UniqueObject, OrderedBaseFolder, ToolMixin):
typeDescription = "<!toolName!>"
typeDescMsgId = '<!toolName!>_edit_descr'
i18nDomain = '<!applicationName!>'
allMetaTypes = <!metaTypes!>
wrapperClass = <!wrapperClass!>
schema = fullSchema
schema["id"].widget.visible = False

View file

@ -2,15 +2,15 @@
from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
import Products.<!applicationName!>.config
from appy.gen.plone25.mixins.UserMixin import UserMixin
from appy.gen.plone25.mixins import BaseMixin
from Extensions.appyWrappers import <!wrapperClass!>
schema = Schema((<!fields!>
),)
fullSchema = BaseSchema.copy() + schema.copy()
class <!applicationName!>User(BaseContent, UserMixin):
'''Configuration flavour class for <!applicationName!>.'''
class <!applicationName!>User(BaseContent, BaseMixin):
'''User mixin.'''
security = ClassSecurityInfo()
__implements__ = (getattr(BaseContent,'__implements__',()),)
archetype_name = '<!applicationName!>User'
@ -27,7 +27,7 @@ class <!applicationName!>User(BaseContent, UserMixin):
i18nDomain = '<!applicationName!>'
schema = fullSchema
wrapperClass = <!wrapperClass!>
for elem in dir(UserMixin):
for elem in dir(BaseMixin):
if not elem.startswith('__'): security.declarePublic(elem)
<!commonMethods!>
<!methods!>

View file

@ -2,23 +2,14 @@
from appy.gen import *
from appy.gen.plone25.wrappers import AbstractWrapper
from appy.gen.plone25.wrappers.ToolWrapper import ToolWrapper
from appy.gen.plone25.wrappers.FlavourWrapper import FlavourWrapper
from appy.gen.plone25.wrappers.PodTemplateWrapper import PodTemplateWrapper
from appy.gen.plone25.wrappers.UserWrapper import UserWrapper
from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
<!imports!>
class PodTemplate(PodTemplateWrapper):
'''This class represents a POD template for this application.'''
<!podTemplateBody!>
class User(UserWrapper):
'''This class represents a user.'''
<!userBody!>
class Flavour(FlavourWrapper):
'''This class represents the Appy class used for defining a flavour.'''
folder=True
<!flavourBody!>
class Tool(ToolWrapper):
'''This class represents the tool for this application.'''
folder=True

View file

@ -42,7 +42,7 @@ ADD_CONTENT_PERMISSIONS = {
<!addPermissions!>}
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, tuple(defaultAddRoles))
# Applications classes, in various formats and flavours
# Applications classes, in various formats
rootClasses = [<!rootClasses!>]
appClasses = <!appClasses!>
appClassNames = [<!appClassNames!>]