class PoiTask(Task):
    portal_type = meta_type = 'PoiTask'
    archetype_name = 'Issue Tracker Task'
    implements(IIssueTask)

    schema = Task.schema.copy() + atapi.Schema((atapi.ReferenceField(
        'issues',
        multiValued=1,
        relationship='task_issues',
        allowed_types=('PoiIssue', ),
        vocabulary='vocabulary_issues',
    ), ))

    schema.moveField('issues', after='title')
    schema['mainText'].widget.visible = dict(edit=0, view=0)
    schema['assignees'].widget.visible = dict(edit=0, view=1)

    def vocabulary_issues(self):
        pairs = []
        poiview = self.restrictedTraverse('@@xm-poi')
        for brain in poiview.get_open_issues_in_project():
            issue = brain.getObject()
            label = '#%s: %s' % (issue.getId(), issue.Title())
            pairs.append((issue.UID(), label))
        # Guard against losing our issues when they are closed and we
        # still want to edit this PoiTask.  See
        # http://plone.org/products/extreme-management-tool/issues/58/
        keys = [key for key, value in pairs]
        for issue in self.getIssues():
            if issue.UID() not in keys:
                label = '#%s: %s' % (issue.getId(), issue.Title())
                pairs.append((issue.UID(), label))
        pairs = sorted(pairs, lambda a, b: cmp(a[1], b[1]))
        return atapi.DisplayList(pairs)

    def getAssignees(self):
        managers = set()
        for issue in self.getRefs('task_issues'):
            managers.add(issue.getResponsibleManager())
        return sorted(list(managers))

    def view(self):
        """
        """
        return self.poitask_view()
Пример #2
0
            description=_(u"Each driver given below should correspond to this year."),
        ),
        required=True,
        default=_(u"2010"),
        validators=('isInt'),
    ),


    atapi.ReferenceField(
        'tdm',
        storage=atapi.AnnotationStorage(),
        widget=ReferenceBrowserWidget(
            allow_browse=1,
            allow_search=1,
            startup_directory='/luc/drivers/transportation',
            label=_(u"TDM Transportation Network"),
            #description=_(u""),
        ),
        required=True,
        relationship='probmap_tdm',
        allowed_types=('SimMap'),
        multiValued=False,
    ),

    atapi.IntegerField(
        'trans_w',
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u"Transportation Weight"),
            description=_(u"Weight for transportation. From 0.5 to 5"),
        ),
Пример #3
0
 atapi.StringField(
     'commentType',
     widget=atapi.SelectionWidget(
         label="Type",
         description=
         "Describe correctly the type of comment. Different types will be visible for different users.",
         label_msgid="gcommons_comment_type",
         description_msgid="gcommons_help_comment_type",
     ),
     required=True,
     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,
Пример #4
0
              ),

    atapi.IntegerField("number",
                 index="FieldIndex",
                 default=42,
                 validators=('isInt',),
                 ),

    atapi.ImageField('image',
               default_output_type='image/jpeg',
               allowable_content_types=('image/*',),
               widget=atapi.ImageWidget()),

    atapi.ReferenceField('related',
                   relationship='related',
                   multiValued=True,
                   widget=atapi.ReferenceWidget(),
                   keepReferencesOnCopy=True),

    atapi.ReferenceField('rel2',
                   relationship='rel2',
                   multiValued=True,
                   widget=atapi.ReferenceWidget(),
                   keepReferencesOnCopy=True),
    ),

    marshall=PrimaryFieldMarshaller()) + TemplateMixin.schema


class DDocument(TemplateMixin, atapi.BaseContent):
    """An extensible Document (test) type"""
Пример #5
0
 ATFolderSchema.copy() + \
 atapi.Schema(
     (atapi.ReferenceField('playlistVideos',
                           relationship = 'playlist_videos',
                           allowed_types=('KalturaVideo',),
                           multiValued = True,
                           isMetadata = False,
                           accessor = 'getPlaylistVideos',
                           mutator = 'setPlaylistVideos',
                           required=False,
                           default=(),
                           widget = ReferenceBrowserWidget(
                               addable = False,
                               destination = [],
                               allow_search = True,
                               allow_browse = True,
                               allow_sorting = True,
                               show_indexes = False,
                               force_close_on_insert = True,
                               label = "Videos (Add Manually)",
                               label_msgid = "label_kvideos_msgid",
                               description = "Choose manually which videos are "
                               "included in this playlist",
                               description_msgid = "desc_kvideos_msgid",
                               i18n_domain = "kaltura_video",
                               visible = {'edit' : 'visible',
                                          'view' : 'visible',
                                          }
                               ),
                           ),
      )
 )
Пример #6
0
        sizes=None,
        widget=atapi.ImageWidget(
            label=u'Profile Image',
            label_msgid='isaw.facultycv_label_ProfileImage',
            il8n_domain='isaw.facultycv',
        ),
        required=False,
        searchable=True,
        accessor='profileImage',
    ),

    atapi.ReferenceField(
        name = 'ProfileRef',

        widget = atapi.ReferenceWidget(
            label = u'Profile reference',
        ),
        relationship = 'owned_profile',
        multiValued=False,
    ),

    atapi.TextField(
        name = 'Titles',
        default_output_type='text/x-html-safe',
        widget = atapi.RichWidget(
            label=u'Faculty Titles',
            label_msgid='isaw.facultycv_label_Titles',
            il8n_domain='isaw.facultycv',
            ),

        required = False,
Пример #7
0
@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.

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

schemata.finalizeATCTSchema(GroupSchema, moveDiscussion=False)
Пример #8
0
            description=_(
                u"EasyNewsletter_help_testEmail",
                default=u"Default for the test email address."),
            i18n_domain='EasyNewsletter',
        ),
    ),

    atapi.ReferenceField(
        'contentAggregationSources',
        multiValued=1,
        referencesSortable=1,
        relationship='contentAggregationSource',
        allowed_types_method="get_allowed_content_aggregation_types",
        widget=ReferenceBrowserWidget(
            allow_sorting=1,
            label=_(
                u"ENL_content_aggregation_sources_label",
                default=u"Content aggregation sources"),
            description=_(
                u"ENL_content_aggregation_sources_desc",
                default=u"Choose sources to aggregate newsletter content from."
            ),
        ),
    ),

    atapi.LinesField(
        'salutations',
        default=("mr|Dear Mr.", "ms|Dear Ms.", "default|Dear"),
        schemata='personalization',
        widget=atapi.LinesWidget(
            label=_(
Пример #9
0
from Products.ATBackRef import BackReferenceField
from Products.ATBackRef import BackReferenceWidget

from archetypes.referencebrowserwidget.widget import ReferenceBrowserWidget

from pcp.contenttypes.interfaces import IResource
from pcp.contenttypes.config import PROJECTNAME
from pcp.contenttypes.content.common import CommonFields
from pcp.contenttypes.content.common import CommonUtilities

ResourceSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    atapi.ReferenceField(
        'managed_by',
        relationship='managed_by',
        allowed_types=('Person', ),
        widget=ReferenceBrowserWidget(
            label='Managed by',
            allow_browse=1,
            startup_directory='/people',
        ),
    ),
    atapi.ReferenceField(
        'hosted_by',
        relationship='hosted_by',
        allowed_types=('Provider', ),
        widget=ReferenceBrowserWidget(
            label='Hosted by',
            allow_browse=1,
            startup_directory='/providers',
        ),
    ),
    atapi.ReferenceField(
Пример #10
0
           ),
     ),
 ),
 atapi.TextField(
     'comments',
     storage=atapi.AnnotationStorage(),
     widget=atapi.TextAreaWidget(
         label=_(u"Comments"),
         description=_(u"to this task here."),
     ),
 ),
 atapi.ReferenceField(
     'milestone',
     widget=atapi.ReferenceWidget(
         label=_(u"Milestone"),
         description=_(u"The milestone set for this task."),
         format="select",
     ),
     allowed_types=('Milestone'),
     relationship='task_milestone',
 ),
 atapi.StringField('priority',
                   storage=atapi.AnnotationStorage(),
                   widget=atapi.SelectionWidget(
                       label=_(u"Priority"),
                       description=_(u"The priority of this task."),
                       format="select",
                   ),
                   default=_(u"Medium"),
                   vocabulary=["High", "Medium", "Low"]),
 atapi.DateTimeField(
     'dueDate',
Пример #11
0
from Products.ATBackRef import BackReferenceWidget

from archetypes.referencebrowserwidget.widget import ReferenceBrowserWidget

from pcp.contenttypes.interfaces import IProject
from pcp.contenttypes.config import PROJECTNAME
from pcp.contenttypes.content.common import CommonFields
from pcp.contenttypes.content.common import CommonUtilities


ProjectSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    ateapi.UrlField('website'),
    atapi.ReferenceField('community',
                         relationship='done_for',
                         allowed_types=('Community',),
                         widget=ReferenceBrowserWidget(label='Community',
                                                       allow_browse=1,
                                                       startup_directory='/communities',
                                                       ),
                         ),
    atapi.ReferenceField('community_contact',
                         relationship='community_contact',
                         allowed_types=('Person',),
                         widget=ReferenceBrowserWidget(label='Community contact',
                                                       allow_browse=1,
                                                       startup_directory='/people',
                                                       ),
                         ),
    atapi.ReferenceField('service_provider',
                         relationship='provided_by',
                         allowed_types=('Provider',),
                         widget=ReferenceBrowserWidget(label='Service provider',
Пример #12
0
            description=_(u'help_civility_title',
                          default=u"Mister, Mr, Sir, Miss, Mrs, ..."))),
    atapi.StringField('job_title',
                      required=False,
                      searchable=True,
                      storage=atapi.AnnotationStorage(),
                      widget=atapi.StringWidget(
                          label=_(u'label_job_title', default=u"Job Title"),
                          description=_(u'help_job_title', default=u""))),

    #
    atapi.ReferenceField(
        'organization',
        required=False,
        searchable=True,
        storage=atapi.AnnotationStorage(),
        vocabulary_factory='atreal.contacts.vocabularies.organizations',
        relationship='isEmployeeOf',
        widget=atapi.ReferenceWidget(
            label=_(u'label_organization', default=u"Organization"),
            description=_(u'help_organization', default=u""))),
    atapi.StringField('department',
                      required=False,
                      searchable=True,
                      storage=atapi.AnnotationStorage(),
                      widget=atapi.StringWidget(
                          label=_(u'label_department', default=u"Department"),
                          description=_(u'help_department', default=u""))),

    #
    atapi.StringField('address',
                      required=False,
            description=_(
                u"help_casestudy_logo",
                default=
                u"Add a logo for the case study (normally the customer logo). Max 150x75 pixels (will be resized if bigger)."
            ),
            i18n_domain='ploneservicescenter',
        ),
    ),
    atapi.ReferenceField(
        'provider',
        relationship='providerToCaseStudy',
        allowed_types=('Provider', ),
        vocabulary_display_path_bound=-1,
        vocabulary="getProvidersReferences",
        widget=atapi.ReferenceWidget(
            label=_(u"label_psc_provider_cat", default=u"Provider"),
            description=_(
                u"help_casestudy_provider",
                default=
                u"Select a provider from the below listing for the case study."
            ),
            i18n_domain='ploneservicescenter',
        ),
    ),
))


class CaseStudy(Services.BaseServicesContent):
    """Shows off a Plone site or project built for a customer."""

    implements(ICaseStudy)
    schema = schema
from archetypes.referencebrowserwidget.widget import ReferenceBrowserWidget

from pcp.contenttypes.interfaces import IServiceComponentOffer
from pcp.contenttypes.config import PROJECTNAME
from pcp.contenttypes.content.common import ConditionsFields
from pcp.contenttypes.content.common import CommonFields
from pcp.contenttypes.content.common import OfferUtilities
from pcp.contenttypes.content.common import CommonUtilities

ServiceComponentOfferSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    atapi.ReferenceField('service_component',
                         relationship='service_component_offered',
                         allowed_types=('ServiceComponent',),
                         widget=ReferenceBrowserWidget(label='Service component offered',
                                                       description='Reference to the catalog entry of the service component being offered.',
                                                       allow_browse=1,
                                                       startup_directory='/catalog',
                                                       ),
                         ),
    atapi.ReferenceField('implementations',
                         relationship='service_component_implementations_offered',
                         allowed_types=('ServiceComponentImplementation',),
                         multiValued=True,
                         widget=ReferenceBrowserWidget(label='Implementations offered',
                                                       description='Reference to the catalog entry of the implementations(s) of the service component being offered.',
                                                       allow_browse=1,
                                                       startup_directory='/catalog',
                                                       ),
                         ),
    atapi.ReferenceField('slas',
Пример #15
0
    from plone.app.collection.field import QueryField

PROJECTNAME = "plone.restapi.tests"

ATTestDocumentSchema = ATDocumentSchema.copy() + atapi.Schema((
    atapi.StringField("testStringField"),
    atapi.BooleanField("testBooleanField"),
    atapi.IntegerField("testIntegerField"),
    atapi.FloatField("testFloatField"),
    atapi.FixedPointField("testFixedPointField"),
    atapi.DateTimeField("testDateTimeField"),
    atapi.LinesField("testLinesField"),
    atapi.FileField("testFileField"),
    atapi.TextField("testTextField"),
    atapi.ImageField("testImageField"),
    atapi.ReferenceField("testReferenceField", relationship="testrelation"),
    atapi.ReferenceField(
        "testMVReferenceField", relationship="testrelation", multiValued=True),
    BlobField("testBlobField"),
    FileField("testBlobFileField"),
    ImageField("testBlobImageField"),
    QueryField("testQueryField"),
    atapi.StringField("testRequiredField", required=True),
    atapi.StringField("testReadonlyField", mode="r"),
    atapi.StringField("testWriteonlyField", mode="w"),
    atapi.StringField("testReadPermissionField",
                      read_permission=permissions.ManagePortal),
    atapi.StringField("testWritePermissionField",
                      write_permission=permissions.ManagePortal),
    atapi.StringField("testURLField", validators=("isURL", )),
))
Пример #16
0
ResourceRequestSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.DateTimeField('startDate',
                        widget=atapi.CalendarWidget(label='Start date',
                                                    show_hm=False),
                        ),
    atapi.DateTimeField('endDate',
                        widget=atapi.CalendarWidget(label='End date',
                                                    show_hm=False),
                        ),
    atapi.StringField('ticketid'),
    atapi.ReferenceField('preferred_providers',
                         relationship='preferred_providers',
                         multiValued=True,
                         allowed_types=('Provider',),
                         widget=atapi.ReferenceWidget(label="Preferred providers",
                                                      ),
                         ),
    ateapi.RecordsField('compute_resources',
                        required=0,
                        minimalSize=2,
                        subfields = ('cpus', 'memory', 'disk', 
                                     'virtualization', 'software'),
                        subfield_types = {'virtualization': 'selection'},
                        subfield_labels ={'cpus':'CPUs',
                                          'virtualization':'virtualization OK?',
                                          'software':'requires OS/software',
                                          },
                        subfield_vocabularies = {'virtualization': 'yesno'},
                        widget=ateapi.RecordsWidget(label='Compute resources'),
Пример #17
0
 atapi.ImageField(
     'Signature',
     widget=atapi.ImageWidget(
         label=_("Signature"),
         description=_(
             "Upload a scanned signature to be used on printed analysis "
             "results reports. Ideal size is 250 pixels wide by 150 high"),
     )),
 atapi.ReferenceField(
     'Departments',
     required=0,
     vocabulary_display_path_bound=sys.maxint,
     allowed_types=('Department', ),
     relationship='LabContactDepartment',
     vocabulary='_departmentsVoc',
     referenceClass=HoldingReference,
     multiValued=1,
     widget=atapi.ReferenceWidget(
         checkbox_bound=0,
         label=_("Departments"),
         description=_("The laboratory departments"),
     ),
 ),
 StringField(
     'DefaultDepartment',
     required=0,
     vocabulary_display_path_bound=sys.maxint,
     vocabulary='_defaultDepsVoc',
     widget=SelectionWidget(
         visible=True,
         format='select',
Пример #18
0
     'request_procedures',
     searchable=1,
     widget=atapi.StringWidget(
         label='Request procedures',
         macro_view='trusted_string',
     ),
 ),
 ateapi.UrlField(
     'helpdesk',
     searchable=1,
 ),
 atapi.ReferenceField(
     'managed_by',
     relationship='managed_by',
     allowed_types=('Person', ),
     widget=ReferenceBrowserWidget(
         label='Managed by',
         allow_browse=1,
         startup_directory='/people',
     ),
 ),
 atapi.ReferenceField(
     'service_owner',
     relationship='owned_by',
     allowed_types=('Person', ),
     widget=ReferenceBrowserWidget(
         label='Service owner',
         allow_browse=1,
         startup_directory='/people',
     ),
 ),
 atapi.ReferenceField(
Пример #19
0
            'mini': (200, 200),
            'thumb': (128, 128),
            'tile': (64, 64),
            'icon': (32, 32),
            'listing': (16, 16),
        },
    ),
    atapi.ReferenceField(
        'provider',
        widget=atapi.ReferenceWidget(
            label=_(u"label_psc_provider_cat", default=u"Provider"),
            description=_(
                u"help_buzz_provider",
                default=
                u"Select a provider from the below listing for the media coverage."
            ),
            checkbox_bound=0,
            i18n_domain='ploneservicescenter',
        ),
        relationship='providerToBuzz',
        allowed_types=('Provider', ),
        vocabulary_display_path_bound=-1,
        vocabulary="getProvidersReferences",
    ),
))


class Buzz(Services.BaseServicesContent):
    """A link to media coverage of Plone."""

    implements(IBuzz)
Пример #20
0
from archetypes.referencebrowserwidget.widget import ReferenceBrowserWidget

from pcp.contenttypes.interfaces import IServiceOffer
from pcp.contenttypes.config import PROJECTNAME
from pcp.contenttypes.content.common import ConditionsFields
from pcp.contenttypes.content.common import CommonFields
from pcp.contenttypes.content.common import OfferUtilities
from pcp.contenttypes.content.common import CommonUtilities

ServiceOfferSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((
    atapi.ReferenceField('service',
                         relationship='service_offered',
                         allowed_types=('Service',),
                         widget=ReferenceBrowserWidget(label='Service offered',
                                                       description='Reference to the catalog entry of '\
                                                       'the service being offered.',
                                                       allow_browse=1,
                                                       startup_directory='/catalog',
                                                       visible={
                                                           'edit': 'invisible'},
                                                       ),
                         ),
    atapi.ReferenceField('service_option',
                         relationship='service_option_offered',
                         allowed_types=('Document',),
                         widget=ReferenceBrowserWidget(label='Service option offered',
                                                       allow_search=1,
                                                       base_query={
                                                           'Subject': ["Service option"]},
                                                       show_results_without_query=1,
                                                       ),
                         ),
Пример #21
0
            widget=atapi.TextAreaWidget(
                label='TextArea',
                maxlength=20,
            ),
        ),
        atapi.TextField(
            'richtextfield',
            allowable_content_types=('text/plain', 'text/structured',
                                     'text/restructured', 'text/html',
                                     'application/msword'),
            widget=atapi.RichWidget(label='rich'),
        ),
        atapi.ReferenceField(
            'referencefield',
            relationship='complextype',
            widget=atapi.ReferenceWidget(addable=1),
            allowed_types=('ComplexType', ),
            multiValued=1,
        ),
    )) + atapi.ExtensibleMetadata.schema


class ComplexType(SimpleType):
    """A simple archetype"""
    schema = SimpleType.schema + schema
    archetype_name = meta_type = "ComplexType"
    portal_type = 'ComplexType'

    def _get_selection_vocab(self):
        return atapi.DisplayList((('Test', 'Test'), ))
Пример #22
0
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata

# -*- Message Factory Imported Here -*-

from pcp.contenttypes.interfaces import IServiceRequest
from pcp.contenttypes.config import PROJECTNAME
from pcp.contenttypes.content.common import CommonFields
from pcp.contenttypes.content.common import CommonUtilities

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

    # -*- Your Archetypes field definitions here ... -*-
    atapi.ReferenceField(
        'service',
        relationship='service',
        allowed_types=('Service', ),
    ),
    ateapi.RecordField(
        'size',
        subfields=('value', 'unit', 'type'),
        subfield_vocabularies={
            'unit': 'informationUnits',
            'type': 'storageTypes',
        },
    ),
    #    atapi.StringField('storage_type',
    #                      vocabulary='storageTypes',
    #                      widget=atapi.SelectionWidget(),
    #                      ),
)) + CommonFields.copy()
Пример #23
0
from bika.lims.utils import isActive
from bika.lims.interfaces import IContact, IClient
from bika.lims.content.person import Person
from bika.lims.config import PROJECTNAME
from bika.lims.config import ManageClients
from bika.lims import logger
from bika.lims import bikaMessageFactory as _

ACTIVE_STATES = ["active"]

schema = Person.schema.copy() + atapi.Schema(
    (atapi.ReferenceField('CCContact',
                          schemata='Publication preference',
                          vocabulary='getContacts',
                          multiValued=1,
                          allowed_types=('Contact', ),
                          relationship='ContactContact',
                          widget=atapi.ReferenceWidget(
                              checkbox_bound=0,
                              label=_("Contacts to CC"),
                          )), ))

schema['JobTitle'].schemata = 'default'
schema['Department'].schemata = 'default'
# Don't make title required - it will be computed from the Person's Fullname
schema['title'].required = 0
schema['title'].widget.visible = False


class Contact(Person):
    """A Contact of a Client which can be linked to a System User
    """
Пример #24
0
        default_content_type='text/html',
        validators=('isTidyHtmlWithCleanup', ),
        default_input_type='text/html',
        default_output_type='text/x-html-safe',
        widget=atapi.RichWidget(
            label=_(u'address'),
            rows=5,
            allow_file_upload=False,
        ),
    ),

    atapi.ReferenceField(
        name='orgunit',
        storage=atapi.AnnotationStorage(),
        relationship='leistung_orgunit',
        widget=ReferenceBrowserWidget(
            label=_(u'orgunit'),
            default_search_index='Title',
            allow_browse=True,
        ),
    ),

),
)


EgovLeistungSchema = schemata.ATContentTypeSchema.copy() + schema.copy()
schemata.finalizeATCTSchema(EgovLeistungSchema, folderish=0)
EgovLeistungSchema.changeSchemataForField('language', 'default')


class EgovLeistung(ATCTContent):
Пример #25
0
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',
        storage=atapi.AnnotationStorage(),
        widget=ReferenceBrowserWidget(
            label=_(u"LUC Scenario"),
            description=
            _(u"The LUC scenario that will provide spatialized inputs to the SCALDS model."
              ),
Пример #26
0
                size=4,
                format='checkbox',
                label=_(u'task_label_responsibility',
                        default=u'Responsibility'),
                description=_(u'task_help_responsibility',
                              default=u'Select the responsible person(s).'))),

        atapi.ReferenceField(
            name='related_items',
            relationship='relatesTo',
            multiValued=True,
            isMetadata=True,
            languageIndependent=False,
            index='KeywordIndex',
            schemata='default',

            widget=ATReferenceBrowserWidget.ReferenceBrowserWidget(
                allow_search=True,
                allow_browse=True,
                show_indexes=False,
                force_close_on_insert=True,
                label=_(u'task_label_related_items', default=u'Related Items'),
                description=_(u'task_help_related_items', default=u''),
                visible={'edit': 'visible', 'view': 'invisible'})),

        ))

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

TaskSchema = finalizeATCTSchema(TaskSchema,
Пример #27
0
         'ar',
     ],
     vocabulary=EMAIL_SUBJECT_OPTIONS,
     widget=atapi.MultiSelectionWidget(
         description=_('Items to be included in email subject lines'),
         label=_("Email subject line"),
     ),
 ),
 atapi.ReferenceField(
     'DefaultCategories',
     schemata=PMF('Preferences'),
     required=0,
     multiValued=1,
     vocabulary='getAnalysisCategories',
     vocabulary_display_path_bound=sys.maxint,
     allowed_types=('AnalysisCategory', ),
     relationship='ClientDefaultCategories',
     widget=atapi.ReferenceWidget(
         checkbox_bound=1,
         label=_("Default categories"),
         description=_(
             "Always expand the selected categories in client views"),
     ),
 ),
 atapi.ReferenceField(
     'RestrictedCategories',
     schemata=PMF('Preferences'),
     required=0,
     multiValued=1,
     vocabulary='getAnalysisCategories',
     validators=('restrictedcategoriesvalidator', ),
     vocabulary_display_path_bound=sys.maxint,
Пример #28
0
from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata

from archetypes.referencebrowserwidget.widget import ReferenceBrowserWidget

from pcp.contenttypes.interfaces import IPlan
from pcp.contenttypes.config import PROJECTNAME
from pcp.contenttypes.content.common import CommonFields
from pcp.contenttypes.content.common import CommonUtilities

PlanSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((
    atapi.ReferenceField('principle_investigator',
                         relationship='principal_investigator',
                         allowed_types=('Person',),
                         widget=ReferenceBrowserWidget(label='Principal investigator',
                                                       allow_browse=1,
                                                       startup_directory='/people',
                                                       ),
                         ),
)) + CommonFields.copy()



schemata.finalizeATCTSchema(PlanSchema, moveDiscussion=False)


class Plan(base.ATCTContent, CommonUtilities):
    """The Master Plan for a community"""
    implements(IPlan)

    meta_type = "Plan"
Пример #29
0
            description="Add here proposed topics for the meeting.",
            i18n_domain='gcommons.Journal',
        ),
        searchable=True,
    ),


    atapi.ReferenceField('readingList',
        relationship = 'reading',
        multiValued = True,
        keepReferencesOnCopy = True,
        widget = ReferenceBrowserWidget(
            allow_search = True,
            allow_browse = True,
            show_indexes = False,
            force_close_on_insert = False,
            #only_for_review_states = 'eb_draft',
            base_query={'portal_type': ('Article',),        # TODO: restrict this type to journal/conf
                        'review_state':('eb_draft',)},      
            label = _(u'label_reading_list', default=u'Reading List'),
            description = "Please select all the items that will be discussed in this meeting",
            visible = {'edit' : 'visible', 'view' : 'invisible' }
        )
    ),

))

                                                
                                                 
# Set storage on fields copied from ATFolderSchema, making sure
# they work well with the python bridge properties.
         label=_(u'label_smartlink_externallink', default='External link'),
         description=_(
             u'help_smartlink_externallink',
             default=
             u"Enter the web address for a page which is not located on this server."
         ),
         size=50,
     )),
 atapi.ReferenceField(
     "internalLink",
     default=None,
     relationship="internal_page",
     multiValued=False,
     widget=ReferenceBrowserWidget(
         label=_(u'label_smartlink_internallink', default='Internal link'),
         description=
         _(u'help_smartlink_internallink',
           default=
           (u"Browse to find the internal page to which you wish to link. "
            u"If this field is used, then any entry in the external link field will be ignored. "
            u"You cannot have both an internal and external link.")),
         force_close_on_insert=True,
     )),
 atapi.BooleanField(
     'internalProxy',
     required=False,
     searchable=False,
     default=False,
     widget=atapi.BooleanWidget(
         label=_(u'label_internalProxy',
                 default=u"Use referenced content's data"),