"""Definition of the AuthoringTemplatesFolder content type
"""

from zope.interface import implements, directlyProvides

from Products.Archetypes import atapi
from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content import schemata

from zopyx.authoring import authoringMessageFactory as _
from zopyx.authoring.interfaces import IAuthoringTemplatesFolder
from zopyx.authoring.config import PROJECTNAME

AuthoringTemplatesFolderSchema = folder.ATFolderSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

))

# Set storage on fields copied from ATFolderSchema, making sure
# they work well with the python bridge properties.

AuthoringTemplatesFolderSchema['title'].storage = atapi.AnnotationStorage()
AuthoringTemplatesFolderSchema['description'].storage = atapi.AnnotationStorage()

schemata.finalizeATCTSchema(
    AuthoringTemplatesFolderSchema,
    folderish=True,
    moveDiscussion=False
)

class AuthoringTemplatesFolder(folder.ATFolder):
    """Authoring Templates Folder"""
    implements(IAuthoringTemplatesFolder)

    meta_type = "AuthoringTemplatesFolder"
    schema = AuthoringTemplatesFolderSchema

    title = atapi.ATFieldProperty('title')
    description = atapi.ATFieldProperty('description')
    
    # -*- Your ATSchema to Python Property Bridges Here ... -*-

atapi.registerType(AuthoringTemplatesFolder, PROJECTNAME)
