Exemple #1
0
def finalizeConferenceSchema(schema):
    schema['title'].storage = atapi.AnnotationStorage()
    schema['description'].storage = atapi.AnnotationStorage()
    schema['description'].required = True
    schema['description'].widget.label = _('Abstract')
    schema['description'].widget.description = _('A short summary of your article.')
    schema['subject'].storage = atapi.AnnotationStorage()
    schema['subject'].widget.label = _('Keywords')
    schema['subject'].widget.description  = _('Please select among the existing keywords or add new ones to describe the subjects of your submission.')

    
    # Hide this fields
    for field in ('effectiveDate', 'expirationDate',):
        schema[field].widget.visible = {'edit': 'invisible', 'view': 'invisible'}
    
    # Call ATContentTypes
    schemata.finalizeATCTSchema(
        schema,
        folderish=True,
        moveDiscussion=False
    )
    
    # Fix after ATContentTypes
    # Reorder
    schema.moveField('description', before='specialRequirements')
    schema.moveField('subject', after='description')
    # Schematas
    schema.changeSchemataForField('subject', 'default')
    return schema
def finalizeConferenceEventSchema(schema):
    schema['title'].storage = atapi.AnnotationStorage()
    schema['description'].storage = atapi.AnnotationStorage()

    # Call ATContentTypes
    schemata.finalizeATCTSchema(schema, folderish=True, moveDiscussion=False)
    return schema
Exemple #3
0
def finalizeJournalSchema(schema):
    schema['title'].storage = atapi.AnnotationStorage()
    schema['title'].widget.label = 'Name'
    schema['title'].widget.description = 'Type the name of the Journal'
    schema['description'].storage = atapi.AnnotationStorage()
    schemata.finalizeATCTSchema(schema, folderish=True, moveDiscussion=False)
    return schema
Exemple #4
0
def finalizeDraftSchema(schema):
    schema['title'].storage = atapi.AnnotationStorage()
    schema['description'].storage = atapi.AnnotationStorage()
    schema['description'].widget.label = "Comments"
    schema['description'].widget.description = "Additional notes about this specific draft, such as known problems or issues fixed"
    schemata.finalizeATCTSchema(schema, moveDiscussion=False)
    return schema
Exemple #5
0
def finalizeConferenceSchema(schema):
    schema['title'].storage = atapi.AnnotationStorage()
    schema['description'].storage = atapi.AnnotationStorage()

    # Call ATContentTypes
    schemata.finalizeATCTSchema(schema, folderish=True, moveDiscussion=False)

    # finalizeATCTSchema moves 'location' into 'categories', we move it back to default
    schema.changeSchemataForField('location', 'default')
    schema.moveField('location', before='startDate')
    return schema
Exemple #6
0
def finalizegcPersonSchema(Schema):
    Schema['title'].storage = atapi.AnnotationStorage()
    Schema['description'].storage = atapi.AnnotationStorage()

    # Hide this fields
    for field in ('effectiveDate', 'expirationDate', 'allowDiscussion',
                  'description', 'excludeFromNav'):
        Schema[field].widget.visible = {
            'edit': 'invisible',
            'view': 'invisible'
        }

    schemata.finalizeATCTSchema(Schema, moveDiscussion=False)

    Schema.changeSchemataForField('description', 'metadata')
    return Schema
Exemple #7
0
    def test_textField(self):
        dummy = self._dummy
        field = dummy.getField('text')

        self.assertTrue(ILayerContainer.providedBy(field))
        self.assertTrue(field.required == 0, 'Value is %s' % field.required)
        self.assertTrue(field.default == '', 'Value is %s' %
                        str(field.default))
        self.assertTrue(field.searchable == 1, 'Value is %s' %
                        field.searchable)
        self.assertTrue(field.vocabulary == (),
                        'Value is %s' % str(field.vocabulary))
        self.assertTrue(field.enforceVocabulary == 0,
                        'Value is %s' % field.enforceVocabulary)
        self.assertTrue(field.multiValued == 0,
                        'Value is %s' % field.multiValued)
        self.assertTrue(field.isMetadata == 0, 'Value is %s' %
                        field.isMetadata)
        self.assertTrue(field.accessor == 'getText',
                        'Value is %s' % field.accessor)
        self.assertTrue(field.mutator == 'setText',
                        'Value is %s' % field.mutator)
        self.assertTrue(field.read_permission == View,
                        'Value is %s' % field.read_permission)
        self.assertTrue(field.write_permission ==
                        ModifyPortalContent,
                        'Value is %s' % field.write_permission)
        self.assertTrue(field.generateMode == 'veVc',
                        'Value is %s' % field.generateMode)
        self.assertTrue(field.force == '', 'Value is %s' % field.force)
        self.assertTrue(field.type == 'text', 'Value is %s' % field.type)
        self.assertTrue(isinstance(field.storage, atapi.AnnotationStorage),
                        'Value is %s' % type(field.storage))
        self.assertTrue(
            field.getLayerImpl('storage') ==
            atapi.AnnotationStorage(migrate=True),
            'Value is %s' % field.getLayerImpl('storage'))
        self.assertTrue(ILayerContainer.providedBy(field))
        self.assertTrue(field.validators == NotRequiredTidyHTMLValidator,
                        'Value is %s' % repr(field.validators))
        self.assertTrue(isinstance(field.widget, atapi.TinyMCEWidget),
                        'Value is %s' % id(field.widget))
        vocab = field.Vocabulary(dummy)
        self.assertTrue(isinstance(vocab, atapi.DisplayList),
                        'Value is %s' % type(vocab))
        self.assertTrue(tuple(vocab) == (), 'Value is %s' % str(tuple(vocab)))

        self.assertTrue(field.primary == 1, 'Value is %s' % field.primary)
        self.assertTrue(field.default_content_type is None,
                        'Value is %s' % field.default_content_type)
        self.assertTrue(field.default_output_type == 'text/x-html-safe',
                        'Value is %s' % field.default_output_type)
        self.assertTrue('text/html' in field.getAllowedContentTypes(dummy))
Exemple #8
0
    def test_imageField(self):
        dummy = self._dummy
        field = dummy.getField('image')

        self.assertTrue(ILayerContainer.providedBy(field))
        self.assertTrue(field.required == 1, 'Value is %s' % field.required)
        self.assertTrue(field.default is None, 'Value is %s' %
                        str(field.default))
        self.assertTrue(field.searchable == 0, 'Value is %s' %
                        field.searchable)
        self.assertTrue(field.vocabulary == (),
                        'Value is %s' % str(field.vocabulary))
        self.assertTrue(field.enforceVocabulary == 0,
                        'Value is %s' % field.enforceVocabulary)
        self.assertTrue(field.multiValued == 0,
                        'Value is %s' % field.multiValued)
        self.assertTrue(field.isMetadata == 0, 'Value is %s' %
                        field.isMetadata)
        self.assertTrue(field.accessor == 'getImage',
                        'Value is %s' % field.accessor)
        self.assertTrue(field.mutator == 'setImage',
                        'Value is %s' % field.mutator)
        self.assertTrue(field.read_permission == View,
                        'Value is %s' % field.read_permission)
        self.assertTrue(field.write_permission == ModifyPortalContent,
                        'Value is %s' % field.write_permission)
        self.assertTrue(field.generateMode == 'veVc',
                        'Value is %s' % field.generateMode)
        self.assertTrue(field.force == '', 'Value is %s' % field.force)
        self.assertTrue(field.type == 'blob', 'Value is %s' % field.type)
        self.assertTrue(isinstance(field.storage, atapi.AnnotationStorage),
                        'Value is %s' % type(field.storage))
        self.assertTrue(
            field.getLayerImpl('storage') ==
            atapi.AnnotationStorage(migrate=True),
            'Value is %s' % field.getLayerImpl('storage'))
        self.assertTrue(ILayerContainer.providedBy(field))
        self.assertTrue(
            field.validators ==
            "(('isNonEmptyFile', V_REQUIRED), " +
            "('checkImageMaxSize', V_REQUIRED))",
            'Value is %s' % str(field.validators))
        self.assertTrue(isinstance(field.widget, atapi.ImageWidget),
                        'Value is %s' % id(field.widget))
        vocab = field.Vocabulary(dummy)
        self.assertTrue(isinstance(vocab, atapi.DisplayList),
                        'Value is %s' % type(vocab))
        self.assertTrue(tuple(vocab) == (), 'Value is %s' % str(tuple(vocab)))
        self.assertTrue(field.primary == 1, 'Value is %s' % field.primary)
Exemple #9
0
class BaseExtensionField(object):
    """Mix-in class to make Archetypes fields not depend on generated
    accessors and mutators, and use AnnotationStorage by default.

    See README.txt for more information.
    """

    storage = atapi.AnnotationStorage()

    def getAccessor(self, instance):
        def accessor(**kw):
            return self.get(instance, **kw)

        return accessor

    def getEditAccessor(self, instance):
        if not hasattr(self, 'getRaw'):
            return None

        def edit_accessor(**kw):
            return self.getRaw(instance, **kw)

        return edit_accessor

    def getMutator(self, instance):
        def mutator(value, **kw):
            self.set(instance, value, **kw)

        return mutator

    def getIndexAccessor(self, instance):
        name = getattr(self, 'index_method', None)
        if name is None or name == '_at_accessor':
            return self.getAccessor(instance)
        elif name == '_at_edit_accessor':
            return self.getEditAccessor(instance)
        elif not isinstance(name, basestring):
            raise ValueError('Bad index accessor value: %r', name)
        else:
            return getattr(instance, name)
Exemple #10
0
from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content import schemata

from uwosh.timeslot import timeslotMessageFactory as _
from uwosh.timeslot.interfaces import ISignupSheet
from uwosh.timeslot.config import PROJECTNAME
from uwosh.timeslot.utilities import getAllExtraFields

import csv
from StringIO import StringIO
from DateTime import DateTime

SignupSheetSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    atapi.BooleanField(
        'allowSignupForMultipleSlots',
        storage=atapi.AnnotationStorage(),
        widget=atapi.BooleanWidget(
            label=_(u'Allow Signup For Multiple Slots'),
            description=_(
                u'Allow the user to signup for more than one slot.'))),
    atapi.StringField(
        'showSlotNames',
        storage=atapi.AnnotationStorage(),
        widget=atapi.BooleanWidget(
            label=_(u'Show Individual Time Slot Names'),
            description=_(u'Whether or not to show individual slot names.'))),
    atapi.LinesField(
        'extraFields',
        storage=atapi.AnnotationStorage(),
        vocabulary="getExtraFieldsVocabulary",
        widget=atapi.MultiSelectionWidget(
Exemple #11
0
    widget=atapi.ImageWidget(
        label=u'Event Sponsor Logo',
        label_msgid='ISAW_Event_Sponsor_Logo',
        il8n_domain='ISAW_Event',
        ),
        
    required=False,
    searchable=True),


))

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

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

#override finalizeATCTSchema
def finalizeATCTSchema(schema, folderish=False, moveDiscussion=True):
    """Finalizes an ATCT type schema to alter some fields
       for the event type. This had to be overrided - cwarner
    """
    schema.moveField('relatedItems', pos='bottom')
    if folderish:
        schema['relatedItems'].widget.visible['edit'] = 'invisible'
    schema.moveField('excludeFromNav', after='allowDiscussion')
    if moveDiscussion:
        schema.moveField('allowDiscussion', after='relatedItems')

Exemple #12
0
        vocabulary="getCommentTypesVocabulary",
        searchable=True),
    atapi.ReferenceField('refDraft',
                         relationship='refDraft',
                         multiValued=False,
                         default_method='getDefaultRefDraft',
                         widget=ReferenceBrowserWidget(visible={
                             'edit': 'invisible',
                             'view': 'visible'
                         })),
    atapi.TextField(
        'text',
        required=False,
        searchable=True,
        primary=True,
        storage=atapi.AnnotationStorage(),
        validators=('isTidyHtmlWithCleanup', ),
        default_output_type='text/x-html-safe',
        widget=atapi.RichWidget(
            description='',
            label=_(u'label_body_text', default=u'Body Text'),
            rows=25,
            allow_file_upload=True,
        ),
    ),
))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.
CommentSchema['title'].storage = atapi.AnnotationStorage()
CommentSchema['description'].storage = atapi.AnnotationStorage()
Exemple #13
0
# -*- coding: utf-8 -*-
from Products.ATContentTypes.content import document
from Products.ATContentTypes.content.schemata import finalizeATCTSchema
from Products.Archetypes import atapi
from collective.portletpage.config import PROJECTNAME
from collective.portletpage.interfaces import IPortletPage
from zope.interface import implements

PortletPageSchema = document.ATDocumentSchema.copy()
PortletPageSchema['title'].storage = atapi.AnnotationStorage()
PortletPageSchema['title'].required = False
PortletPageSchema['description'].storage = atapi.AnnotationStorage()
PortletPageSchema['text'].storage = atapi.AnnotationStorage()
finalizeATCTSchema(PortletPageSchema)


class PortletPage(document.ATDocument):
    """A page with some body text and a list of portlets.
    """
    implements(IPortletPage)
    portal_type = "Portlet Page"

    _at_rename_after_creation = True
    schema = PortletPageSchema

    title = atapi.ATFieldProperty('title')
    description = atapi.ATFieldProperty('description')
    text = atapi.ATFieldProperty('text')


atapi.registerType(PortletPage, PROJECTNAME)
Exemple #14
0
from archetypes.referencebrowserwidget import ReferenceBrowserWidget

# -*- Message Factory Imported Here -*-
from leam.scalds import scaldsMessageFactory as _

from leam.scalds.interfaces import ISCALDS
from leam.luc.interfaces import IModel
from leam.scalds.config import PROJECTNAME

SCALDSSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.ReferenceField(
        'template',
        storage=atapi.AnnotationStorage(),
        widget=ReferenceBrowserWidget(
            label=_(u"SCALDS Spreadsheet"),
            description=_(
                u"A SCALDS spreadsheet that will be used as a template."),
            startup_directory='/luc/impacts/scalds',
            allow_browse=True,
            allow_search=True,
        ),
        required=True,
        relationship='scalds_template',
        allowed_types=('File', 'Document'),
        multiValued=False,
    ),
    atapi.ReferenceField(
        'scenario',
from redturtle.video import videoMessageFactory as _
from redturtle.video.interfaces import IRTRemoteVideo
from redturtle.video.config import PROJECTNAME
from redturtle.video.content.default import DefaultVideo
from redturtle.video.content.video_schema import VIDEO_SCHEMA

RTRemoteVideoSchema = ATLinkSchema.copy() + VIDEO_SCHEMA.copy() + atapi.Schema((

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

))

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

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

imageField = ATImageSchema['image'].copy()
imageField.required = False
imageField.primary = False
imageField.widget.description = _(u'help_video_image',
                                  default = u'Can be used to provide splash image when needed')
imageField.validators = None
imageField.sizes = None

RTRemoteVideoSchema.addField(imageField)
RTRemoteVideoSchema.moveField('image', after = 'remoteUrl')
RTRemoteVideoSchema['remoteUrl'].widget.size = 60

schemata.finalizeATCTSchema(RTRemoteVideoSchema, moveDiscussion = False)
Exemple #16
0
    atapi.TextField(
        name = 'Profile Blurb',
        default_output_type='text/x-html-safe',
        widget = atapi.RichWidget(
            label=u'Profile Blurb',
            label_msgid='isaw.facultycv_label_Profile',
            il8n_domain='isaw.facultycv',
            ),

        required = False,
        searchable = True
    )

))

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

# We hide the Title because it isn't needed or required even though
# it is initally set at creation of a new CV and not a profile itself
# Description is null, realistically it's not needed but I may add some default stock
# in the future

#profileSchema['title'].required = 0
#profileSchema['title'].widget.visible = {"edit": "invisible",
#                                        "view": "invisible"}
profileSchema['description'].widget.visible = {"edit": "invisible"}
profileSchema['ProfileRef'].widget.visible = {"edit": "invisible"}


schemata.finalizeATCTSchema(
from collective.contacts import contactsMessageFactory as _
from collective.contacts.interfaces import IGroup
from collective.contacts.config import PROJECTNAME


@indexer(IGroup)
def members(obj):
    return len(obj.persons)


GroupSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.ReferenceField(
        name='persons',
        storage=atapi.AnnotationStorage(),
        required=False,
        widget=ReferenceBrowserWidget(
            label=_(u"Persons"),
            description=_(u"The persons that belong to this group"),
            restrict_browsing_to_startup_directory=True,
        ),
        searchable=1,
        relationship='group_person',
        allowed_types=('Person', ),
        multiValued=True,
    ), ))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.
Exemple #18
0
# -*- Message Factory Imported Here -*-

from example.electionperson.interfaces import IExamplePersonFolder
from example.electionperson.config import PROJECTNAME

ExamplePersonFolderSchema = 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.

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

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


class ExamplePersonFolder(folder.ATFolder):
    """ExamplePersonFolder"""
    implements(IExamplePersonFolder)

    meta_type = "ExamplePersonFolder"
    schema = ExamplePersonFolderSchema
Exemple #19
0
                              }),
        required=0,
    ),
    StringField(
        name='refresh_rate',
        widget=SelectionWidget(label="Refresh the results", ),
        default='Weekly',
        required=1,
        vocabulary=['Once', 'Hourly', 'Daily', 'Weekly'],
    ),
))

SparqlSchema = getattr(base.ATCTContent, 'schema', Schema(())).copy() + \
        SparqlBaseSchema.copy()

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

schemata.finalizeATCTSchema(SparqlSchema, moveDiscussion=False)

SparqlBookmarksFolderSchema = getattr(ATFolder, 'schema', Schema(())).copy() + \
        SparqlBaseSchema.copy()
SparqlBookmarksFolderSchema['sparql_query'].widget.description = \
        'The query should return label, bookmark url, query'
SparqlBookmarksFolderSchema['sparql_static'].widget.visible['edit'] = \
        'invisible'


class Sparql(base.ATCTContent, ZSPARQLMethod):
    """Sparql"""
    implements(ISparql, IVersionEnhanced)
Exemple #20
0
from datetime import datetime

from zope.interface import implements

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

from slc.tasks import tasksMessageFactory as _
from slc.tasks.interfaces import ITaskRequest
from slc.tasks.config import PROJECTNAME

TaskRequestSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    atapi.StringField(
        'agencyContact',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Agency contact person"),
            description=
            _(u"The contact details of people within the agency who can be contacted regarding this task."
              ),
        ),
    ),
    atapi.StringField('priority',
                      storage=atapi.AnnotationStorage(),
                      widget=atapi.SelectionWidget(
                          label=_(u"Priority"),
                          description=_(u"The priority of this task."),
                          format="select",
                      ),
                      default=_(u"Medium"),
from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata

from collective.contacts import contactsMessageFactory as _
from collective.contacts.interfaces import IOrganization
from collective.contacts.config import PROJECTNAME
from collective.contacts.content import DeprecatedATFieldProperty

OrganizationSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.StringField(
        'address',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Address"),
            description=_(u"Organization's address"),
        ),
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'country',
        storage=atapi.AnnotationStorage(),
        widget=atapi.SelectionWidget(
            label=_(u"Country"),
            description=_(u"Organization's country"),
        ),
        vocabulary_factory='contacts.countries',
Exemple #22
0
            description=u"IFrame Map Height",
        ),
    ),
    atapi.StringField(
        name="mapstyle",
        widget=atapi.StringWidget(
            label=u"Map Style",
            description=u"Add some inline-styles",
        ),
    ),
))

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

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

schemata.finalizeATCTSchema(DssContactSchema, moveDiscussion=False)
# finalizeATCTSchema moves 'location' into 'categories', we move it back:
# IssEventSchema.changeSchemataForField('location', 'default')

#Hide the lodation Field since we're not using it


class DssContact(base.ATCTContent):
    """Event for ISS website"""
    implements(IDssContact)

    meta_type = "DssContact"
    schema = DssContactSchema
Exemple #23
0
# -*- Message Factory Imported Here -*-

from isaw.events.content import general
from isaw.events.interfaces import IExhibition
from isaw.events.config import PROJECTNAME

ExhibitionSchema = general.GeneralSchema.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.

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

#override finalizeATCTSchema
def finalizeATCTSchema(schema, folderish=False, moveDiscussion=True):
    """Finalizes an ATCT type schema to alter some fields
       for the event type. This had to be overrided - cwarner
    """
    schema.moveField('relatedItems', pos='bottom')
    if folderish:
        schema['relatedItems'].widget.visible['edit'] = 'invisible'
    schema.moveField('excludeFromNav', after='allowDiscussion')
    if moveDiscussion:
        schema.moveField('allowDiscussion', after='relatedItems')

    schema.moveField('event_Image', after='title')
Exemple #24
0
from rg.prenotazioni import prenotazioniMessageFactory as _
from rg.prenotazioni.config import PROJECTNAME
from rg.prenotazioni.interfaces import IPrenotazione, IPrenotazioniFolder
from zope.interface import implements

OVERBOOKED_MESSAGE = _(
    'overbook_message',
    default=u"Siamo spiacenti, è già stato preso un appuntamento "
    u"nella stessa fascia oraria, premere il pulsante "
    u"ANNULLA per effettuare una nuova richiesta di "
    u"prenotazione")

PrenotazioneSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((
    atapi.StringField(
        'tipologia_prenotazione',
        storage=atapi.AnnotationStorage(),
        vocabulary='getElencoTipologie',
        widget=atapi.SelectionWidget(
            label=_(u"Tipologia della prenotazione"),
            condition='object/getElencoTipologie',
        ),
        required=False,
    ),
    atapi.DateTimeField(
        'data_prenotazione',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u'Data prenotazione'),
            visible={
                'edit': 'hidden',
                'view': 'visible'
Exemple #25
0
from zope.interface import implements

from Products.Archetypes import atapi

from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content.schemata import finalizeATCTSchema

from atreal.contacts.interfaces import IDirectory
from atreal.contacts.config import PROJECTNAME

from atreal.contacts import ContactsMessageFactory as _

DirectorySchema = folder.ATFolderSchema.copy ()

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

finalizeATCTSchema (DirectorySchema, folderish=True, moveDiscussion=False)

class Directory (folder.ATFolder):
    """ Contains multiple contacts.
    """
    implements(IDirectory)
    
    portal_type = "Directory"
    _at_rename_after_creation = True
    schema = DirectorySchema
    
    title = atapi.ATFieldProperty('title')
    description = atapi.ATFieldProperty('description')
from zope.interface import implements

from Products.Archetypes import atapi

from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content.schemata import finalizeATCTSchema

from eduintelligent.courses.interfaces import ILessons
from eduintelligent.courses.config import PROJECTNAME
from eduintelligent.courses.utility import hideMetadataSchema
from eduintelligent.courses import coursesMessageFactory as _

LessonsSchema = folder.ATBTreeFolderSchema.copy()


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

finalizeATCTSchema(LessonsSchema, folderish=True, moveDiscussion=False)
hideMetadataSchema(LessonsSchema, excludeFromNav=True)

class Lessons(folder.ATBTreeFolder):
    """Contains multiple lessons.
    """
    implements(ILessons)
    
    portal_type = "Lessons"
    _at_rename_after_creation = True
    schema = LessonsSchema
    
    title = atapi.ATFieldProperty('title')
from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata

from uwosh.itdocs import itdocsMessageFactory as _
from uwosh.itdocs.interfaces import IComponentInstruction
from uwosh.itdocs.config import PROJECTNAME

from Products.ATContentTypes.configuration import zconf

ComponentInstructionSchema = schemata.ATContentTypeSchema.copy(
) + atapi.Schema((
    atapi.StringField(
        'Project',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Component"),
            description=_(u"Component name or label"),
        ),
        default=_(''),
    ),
    atapi.TextField(
        'questions',
        storage=atapi.AnnotationStorage(),
        widget=atapi.RichWidget(
            label=_(u"Function"),
            description=_(u"Describe the function of the component"),
            rows=10,
        ),
        default='',
Exemple #28
0
from Products.ATContentTypes.content import schemata

# -*- Message Factory Imported Here -*-

from bungenicms.workspaces.interfaces import IPublicFolder
from bungenicms.workspaces.config import PROJECTNAME

PublicFolderSchema = 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.

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

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


class PublicFolder(folder.ATFolder):
    """A public folder for use by a principal. Content can be published, private or pending review."""
    implements(IPublicFolder)

    meta_type = "PublicFolder"
    schema = PublicFolderSchema

    title = atapi.ATFieldProperty('title')
# Event support
from DateTime import DateTime
from Products.ATContentTypes.utils import DT2dt
from Products.ATContentTypes.lib.calendarsupport import CalendarSupportMixin
from Products.ATContentTypes.interfaces import ICalendarSupport



EditorsMeetingSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    # -*- Your Archetypes field definitions here ... -*-
    atapi.StringField(
        name='venue',
        required=False,
        searchable=1,
        #default='',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Venue"),
            description=_(u"Description of the venue(s)"),
        ),
    ),

    #
    # Dates
    atapi.DateTimeField(
        name='startDate',                  
        required=True,                  
        searchable=False,                  
        accessor='start',                  
#TODO                  write_permission = ChangeEvents,                  
        default_method=DateTime,                  
Exemple #30
0
# -*- Message Factory Imported Here -*-
from bungenicms.repository import repositoryMessageFactory as _

from bungenicms.repository.interfaces import IRepositoryCollection, IRepositoryItemBrowser
from bungenicms.repository.config import PROJECTNAME

from Products.ATVocabularyManager import NamedVocabulary
from collective.dynatree.atwidget import DynatreeWidget

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

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

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

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


class RepositoryCollection(folder.ATFolder):
    """Repository Collection"""
    implements(IRepositoryCollection, IRepositoryItemBrowser)

    meta_type = "RepositoryCollection"
    schema = RepositoryCollectionSchema

    title = atapi.ATFieldProperty('title')