예제 #1
0
class FileExtender(object):
    """Extends default File content type."""
    adapts(IATFile)
    implements(ISchemaExtender, IBrowserLayerAwareExtender)
    layer = IDownloadtrackerInstalled

    fields = [
        _MyLinesField(
            "download_records",
            widget=LinesWidget(
                label=u"Download Records",
                description=u"When was this file downloaded from whom",
                modes=('view', ),
                read_permission=ReviewPortalContent,
            ),
            default=[],
        ),
    ]

    def __init__(self, context):
        self.context = context

    def getFields(self):
        return self.fields
예제 #2
0
                 schemata="display",
                 default=0,
                 widget=IntegerWidget(
                     label=_(u"Maximum items"),
                     description=_(u'Number of items visible in widget'),
                 )),
    BooleanField('sortreversed',
                 schemata="display",
                 widget=BooleanWidget(
                     label=_(u"Reverse options"),
                     description=_(u"Sort options reversed"),
                 )),
    LinesField('default',
               schemata="default",
               widget=LinesWidget(
                   label=_(u'Default value'),
                   description=_(u'Default items (one per line)'),
                   i18n_domain="eea")),
))


class Widget(CountableWidget):
    """ Widget
    """
    # Widget properties
    widget_type = 'checkbox'
    widget_label = _('Checkboxes')
    view_js = '++resource++eea.facetednavigation.widgets.checkbox.view.js'
    edit_js = '++resource++eea.facetednavigation.widgets.checkbox.edit.js'
    view_css = '++resource++eea.facetednavigation.widgets.checkbox.view.css'
    edit_css = '++resource++eea.facetednavigation.widgets.checkbox.edit.css'
예제 #3
0
            i18n_domain="SimpleBlog",
            description='Breve descripción para este folder.'),
    ),
    ComputedField('existingCats',
                  expression='here.getInheritedCategories()',
                  widget=ComputedWidget(
                      label='Existing categories.',
                      label_msgid="label_blogfolder_existing_cats",
                      i18n_domain="SimpleBlog",
                  )),
    LinesField(
        'categories',
        widget=LinesWidget(
            label='Additional categories',
            label_msgid="label_additional_categories",
            description_msgid="help_additional_categories",
            i18n_domain="SimpleBlog",
            description=
            'Supply a list of possible additional categories that will be available to BlogEntries inside this folder or in sub folders.'
        ),
    )))


class BlogFolder(ATCTFolder):
    """
    A folder object to store BlogEntries in
    """

    schema = schema

    def canSetDefaultPage(self):
        return False
예제 #4
0
            SelectColumn('Sample Point', vocabulary='Vocabulary_SamplePoint'),
            'SampleMatrix':
            SelectColumn('Sample Matrix',
                         vocabulary='Vocabulary_SampleMatrix'),
            'SampleType':
            SelectColumn('Sample Type', vocabulary='Vocabulary_SampleType'),
            'ContainerType':
            SelectColumn('Container', vocabulary='Vocabulary_ContainerType'),
            'Analyses':
            LinesColumn('Analyses'),
            'Profiles':
            LinesColumn('Profiles'),
        }))

Errors = LinesField('Errors', widget=LinesWidget(
    label=_('Errors'),
    rows=10,
))

schema = BikaSchema.copy() + Schema((
    OriginalFile,
    Filename,
    NrSamples,
    ClientName,
    ClientID,
    ClientOrderNumber,
    ClientReference,
    Contact,
    CCContacts,
    Batch,
    SampleData,
    Errors,
예제 #5
0
파일: user.py 프로젝트: seanchen/plonexp
         description=
         "A short overview of who you are and what you do. Will be displayed on the your author page, linked from the items you create."
     ),
 ),
 StringField(
     'location',
     languageIndependent=1,
     user_property=True,
     widget=StringWidget(label="Location", description="User's Location."),
 ),
 LinesField(
     'sites',
     languageIndependent=1,
     user_property=True,
     widget=LinesWidget(
         label="Sites",
         description="How user associate with sites",
     ),
 ),
 LinesField(
     # not 'roles' b/c 'validate_roles' exists; stoopid Archetypes
     name="roles_",
     accessor='getRoles',
     mutator='setRoles',
     languageIndependent=1,
     vocabulary='getRoleSet',
     multiValued=1,
     widget=MultiSelectionWidget(
         label="Roles",
         description="Roles that member has.",
         modes=(),
     ),
예제 #6
0
              required=False,
              searchable=True,
              storage=AnnotationStorage(),
              validators=('isTidyHtmlWithCleanup',),
              default_output_type='text/x-html-safe',
              widget=RichWidget(
                        i18n_domain="ploneboard",
                        label="Text",
                        label_msgid="label_text",
                        rows=25),
    ),
    LinesField('categories',
        widget = LinesWidget(
            description = \
                "Enter the categories you want to have available for "
                "forums, one category on each line.",
            description_msgid = "help_categories_board",
            label = "Categories",
            label_msgid = "label_categories_board",
            i18n_domain = "ploneboard")),
    ))

utils.finalizeSchema(schema)


class Ploneboard(BrowserDefaultMixin, ATBTreeFolder):
    """Ploneboard is the outmost board object, what shows up in your site."""
    implements(IPloneboard)
    meta_type = 'Ploneboard'
    schema = schema
    _at_rename_after_creation = True
예제 #7
0
from ZODB.POSException import ConflictError

from Products.XPointContactManagement.config import PROJECTNAME
from Products.XPointContactManagement.content.base import XPCMBase

XPointMsgFolderSchema = ATFolderSchema.copy() + Schema((

        # the unique sequence will serve contact, contact group, and contact
        # metadata.
        LinesField(
            'xpcm_emsg_senders',
            required = True,
            # hide for view mode.
            widget = LinesWidget(
                label = "Message Senders' Emails",
                description = 'Set up the senders email addresses here, you may use format like this: <firstname secondname> [email protected]',
                ),
            ),
        )
    )

# Plone 3 will re-organize all fields' shemata by using this method.
finalizeATCTSchema(XPointMsgFolderSchema)

# customizing the schema: set visible and location of fields.

# here comes the class.
class XPointMsgFolder(XPCMBase, ATFolder):
    """XPointMsgFolder will be the folder for contact information.
    """
예제 #8
0
파일: project.py 프로젝트: seanchen/plonexp
            searchable = False,
            required = True,
            vocabulary = 'vocabulary_allMembersList',
            widget = InAndOutWidget(
                label = 'Developers',
                descrpiton = "Please select developers for this project",
                ),
            ),
        # modules
        LinesField(
            'xpproject_modules',
            searchable = False,
            required = True,
            widget = LinesWidget(
                label = 'Project Modules',
                description = 'Please specify the module for your project, one per line',
                cols = 40,
                ),
            ),
        )
    )

# customizing the schema here, set visible of some fields, location of
# some fields.

finalizeATCTSchema(XPointProjectSchema)

# here is the class.
class XPointProject(ATFolder):
    """XPointProject defines a software project following eXtreme
    Programming's idea/concept.
예제 #9
0
__author__ = 'Sean Chen'
__email__ = '*****@*****.**'

# define a PPMProject as a folder in plone site.
BKFolderSchema = ATBTreeFolderSchema.copy() + Schema((

        # modules
        LinesField(
            'bk_transaction_types',
            accessor = 'transactionTypes',
            searchable = False,
            required = True,
            default = ('Expense', 'Income'),
            widget = LinesWidget(
                label = 'Transaction Types',
                description = 'Please specify the transaction types, one per line',
                cols = 40,
                ),
            ),

        # the unique sequence will serve
        IntegerField(
            'bk_unique_sequence',
            default = 0,
            # hide for view mode.
            widget = IntegerWidget(
                label = 'Unique Sequence',
                description = 'This sequence will generate unique ids for all artifacts in this folder.',
                ),
            ),
예제 #10
0
from Products.ATContentTypes.atct import ATFolder
from Products.ATContentTypes.atct import ATFolderSchema
from Products.ATContentTypes.content.schemata import finalizeATCTSchema

from iscorpio.plonerm.config import PROJECTNAME

# define the schema...
PRMResourcesSchema = ATFolderSchema.copy() + Schema((

        # the available manufacturers.
        LinesField(
            'prmManufacturers',
            searchable = False,
            required = True,
            widget = LinesWidget(
                label = 'Avilable Manufacturers',
                description = 'Please specify available manufactures. One line for each',
                ),
            ),

        # The unique sequence will serve all resources managed under here.
        IntegerField(
            'prmUniqueSequence',
            default = 0,
            # hide for view mode.
            widget = IntegerWidget(
                label = 'Unique Sequence',
                description = 'This sequence will generate unique ids for this address book',
                ),
            ),

        ),
예제 #11
0
파일: category.py 프로젝트: rockfruit/mars
from Products.ATContentTypes.atct import ATFolder
from Products.ATContentTypes.content.folder import ATFolderSchema
from Products.CMFPlone.interfaces import IPloneSiteRoot

from field import getTitledPath
from storage import CAT_CONTAINER

BaseCategorySchema = ATFolderSchema.copy()

schema = BaseCategorySchema + Schema((LinesField(
    'synonyms',
    searchable=True,
    widget=LinesWidget(
        description='Enter a value for synonyms.',
        description_msgid='help_synonyms',
        i18n_domain='videolibrary',
        label='Synonyms',
        label_msgid='label_synonyms',
    ),
), ))


def getFullTitledPath(obj, titles=None):
    if titles is None: titles = list()
    if not hasattr(obj, 'getId') or not hasattr(obj, 'Title'):
        return ()
    if obj.getId() != CAT_CONTAINER:
        titles.insert(0, obj.Title())
        titles = getFullTitledPath(obj.aq_inner.aq_parent, titles)
    return tuple(titles)
예제 #12
0
implicitdesc = ""
implicit = BooleanField('implicit',
                        default=0,
                        index="lens_catalog/FieldIndex:brains",
                        widget=BooleanWidget(label="Also select contents?",
                                             description=implicitdesc,
                                             i18n_domain="rhaptos"))

namespace_tagsdesc = "Add words you associate with this content. Separate each tag with a space."
namespaceTags = LinesField(
    'namespaceTags',
    #required=1,
    searchable=1,
    index="lens_catalog/KeywordIndex:brains",
    widget=LinesWidget(label="Namespace Tags",
                       description=namespace_tagsdesc,
                       i18n_domain="rhaptos"),
)

# TODO: there's a TagIndex at http://svn.plone.org/svn/collective/Tags/trunk/indexes.py
tagsdesc = "Add words you associate with this content. Separate each tag with a space."
tags = LinesField(
    'tags',
    #required=1,
    searchable=1,
    index="lens_catalog/KeywordIndex:brains",
    widget=LinesWidget(
        label="Tags",  # TODO: TagsWidget?
        description=tagsdesc,
        i18n_domain="rhaptos"),
)