Пример #1
0
class ILockType(Interface):
    """Representation of a type of lock
    """

    __name__ = schema.TextLine(title=u"Name",
                               description=u"The unique name of the lock type")

    stealable = schema.Bool(
        title=u"Stealable",
        description=u"Whether this type of lock is stealable")
    user_unlockable = schema.Bool(
        title=u"User unlockable",
        description=
        u"Whether this type of lock should be unlockable immediately")
    timeout = schema.Int(title=u"lock timeout",
                         description=u"Locking timeout in minutes")
Пример #2
0
class IParty(component.Interface):
    partyno = HiddenInt(title=u'')
    owner = schema.Int(title=u'Owner ID: ')
    party_name = schema.TextLine(title=u'Party Name: ')
    type = schema.Choice(title=u'Type: ',
                         values=[u'WvW', u'PvE', u'PvP'],
                         default=u'WvW')
    view = schema.Choice(title=u'View: ',
                         values=[
                             u'Summary', u'Stats', u'Gear', u'Skills', u'CCs',
                             u'Conditions', u'Boons', u'Traits'
                         ])
    members = schema.List(title=u'Members',
                          value_type=schema.Object(schema=IUser),
                          unique=True,
                          default=[])
Пример #3
0
class ISuperfishSettings(Interface):
    """ """

    add_portal_tabs = schema.Bool(
        title=u'Add portal_tabs from portal_actions',
        default=False,
    )

    menu_depth = schema.Int(
        title=u'Menu depth',
        default=2,
    )

    superfish_options = schema.Text(
        title=u'Options for Superfish call',
    )
Пример #4
0
class IClassroom(model.Schema):
    """ Marker interface and Dexterity Python Schema for Classroom
    """

    seat = schema.Int(
        title=_(u"Seat"),
        description=_(u"Number of seats."),
        required=True
    )

    seatState = schema.TextLine(
        title=_(u'Seat State'),
        default=u'3|4|3',
        description=_(u'For example, 3|4|3 or 4|3|3 ext.'),
        required=True
    )
Пример #5
0
class IAgendaVilaixPortlet(IPortletDataProvider):

    count = schema.Int(title=_(u'Number of items to display'),
                       description=_(u'How many items to list.'),
                       required=True,
                       default=5,
                       min=5,
                       max=7)

    state = schema.Tuple(
        title=_(u"Workflow state"),
        description=_(u"Items in which workflow state to show."),
        default=('published', ),
        required=True,
        value_type=schema.Choice(
            vocabulary="plone.app.vocabularies.WorkflowStates"))
Пример #6
0
class ITokenRoleMailerAdapter(Interface):
    """Token role mailer adapter"""

    # -*- schema definition goes here -*-
    private_doc = schema.Object(
        title=_(u"Private doc"),
        required=True,
        description=_(u"Choose the private item you are going to share"),
        schema=Interface,  # specify the interface(s) of the addable types here
    )
    #
    minutes = schema.Int(
        title=_(u"Validity (minutes)"),
        required=True,
        description=_(u"Type the token validity in minutes"),
    )
Пример #7
0
class IClassInformation(Interface):
    """Information concerning a class
    """

    class_id = schema.Int(title=_(u"Class identifier"),
                          description=_(u"A unique id for a class"),
                          required=True,
                          readonly=True)
    schoolinformation = schema.Object(title=_(u"School"),
                                      schema=ISchoolInformation,
                                      required=True,
                                      readonly=True)
    class_name = schema.TextLine(title=_(u"Class name"),
                                 required=True,
                                 readonly=True)
    email = schema.TextLine(title=_(u"Email"), required=True, readonly=True)
Пример #8
0
class IRepositoryFolderRecords(Interface):
    """ Configuration for repository folder
    """

    maximum_repository_depth = schema.Int(title=u'Maximum Repository Depth',
                                          default=DEFAULT_REPOSITORY_DEPTH)

    show_documents_tab = schema.Bool(title=u'Show documents tab on repository folder',
                                     default=True)

    show_tasks_tab = schema.Bool(title=u'Show tasks tab on repository folder',
                                 default=True)

    show_proposals_tab = schema.Bool(
        title=u'Show proposals tab on repository folder',
        default=True)
Пример #9
0
class IRecentVideos(IPortletDataProvider):
    """A portlet

    It inherits from IPortletDataProvider because for this portlet, the
    data that is being rendered and the portlet assignment itself are the
    same.
    """

    tag = schema.TextLine(title=_(u'Tag'),
                          description=_(u"Tag to filter the videos "),
                          required=True)

    limit = schema.Int(title=_(u'Limit'),
                       description=_(u"The maximum results number."),
                       required=True,
                       default=5)
Пример #10
0
class IParaText(Interface):

    title = schema.TextLine(
        title=_(u'Parameter title'),
        required=True,
    )

    showName = schema.TextLine(
        title=_(u'Parameter show name'),
        required=True,
    )

    price = schema.Int(
        title=_(u'Price'),
        required=True,
    )
Пример #11
0
class ICheckboxSchema(ISchema):
    """ Schema
    """
    default = schema.List(
        title=_(u'Default value'),
        description=_(u'Default items (one per line)'),
        required=False,
        unique=True,
        value_type=schema.TextLine(title=u'Item'),
    )

    operator = schema.Choice(
        title=_(u'Default operator'),
        description=_(u'Search with AND/OR between elements'),
        vocabulary=SimpleVocabulary([
            SimpleTerm(u'or', u'or', u'OR'),
            SimpleTerm(u'and', u'and', u'AND')
        ]),
        default=u'or')

    operator_visible = schema.Bool(
        title=_(u"Operator visible"),
        description=_(u"Let the end-user choose to search with "
                      u"AND or OR between elements"),
        required=False,
        default=False)

    vocabulary = schema.Choice(
        title=_(u"Vocabulary"),
        description=_(u'Vocabulary to use to render widget items'),
        vocabulary=u'eea.faceted.vocabularies.PortalVocabularies',
        required=False)

    catalog = schema.Choice(title=_(u'Catalog'),
                            description=_(u"Get unique values from catalog "
                                          u"as an alternative for vocabulary"),
                            vocabulary=u'eea.faceted.vocabularies.UseCatalog',
                            required=False)

    maxitems = schema.Int(title=_(u"Maximum items"),
                          description=_(u'Number of items visible in widget'),
                          default=0,
                          required=False)

    sortreversed = schema.Bool(title=_(u"Reverse options"),
                               description=_(u"Sort options reversed"),
                               required=False)
Пример #12
0
class ISQLMultiplexControlPanel(Interface):
    """Control panel Settings
    """

    enabled = schema.Bool(
        title=_(u"Enabled"),
        default=False,
        required=False,
    )

    host = schema.TextLine(
        title=_(u"Server"),
        default=u"localhost",
        required=False,
    )

    port = schema.Int(
        title=_(u"Port"),
        min=0,
        max=65535,
        default=3306,
        required=False,
    )

    database = schema.TextLine(
        title=_(u"Database name"),
        default=u"senaite",
        required=False,
    )

    user = schema.TextLine(
        title=_(u"Database user"),
        default=u"root",
        required=False,
    )

    password = schema.Password(
        title=_(u"Database user password"),
        default=u"",
        required=False,
    )

    content_types = schema.List(
        title=_(u"Tables"),
        required=False,
        value_type=schema.Choice(
            source="senaite.sqlmultiplex.vocabularies.portal_types"))
Пример #13
0
class ISlider(IPortletDataProvider):

    show_transitions = schema.Choice(title=u"Image Transitions?",
                                     vocabulary=transitions,
                                     required=True,
                                     default=0)

    random_start = schema.Choice(title=u"Pick random image to start with?",
                                 vocabulary=yesno,
                                 required=True,
                                 default=0)

    show_title = schema.Choice(title=u"Show Image Title?",
                               vocabulary=yesno,
                               required=True,
                               default=0)

    show_description = schema.Choice(title=u"Show Image Description?",
                                     vocabulary=yesno,
                                     required=True,
                                     default=0)

    show_dots = schema.Choice(title=u"Show Image Dots?",
                              vocabulary=yesno,
                              required=True,
                              default=1)

    show_arrows = schema.Choice(title=u"Show Image Arrows?",
                                vocabulary=yesno,
                                required=True,
                                default=0)

    transition_time = schema.Int(title=u"Seconds between transitions?",
                                 description=u"Please specify an integer.",
                                 required=True,
                                 default=30)

    folder_id = schema.TextLine(
        title=u"ADVANCED: Folder Storage ID",
        description=u"Do not change unless the main folder is moved or renamed",
        required=True,
        default=u"slider-images")

    show_images = schema.Text(title=u"ADVANCED: List of images to show",
                              description=u"Do not change",
                              required=False,
                              default=u"")
Пример #14
0
class IContentListingTile(Schema):
    """A tile that displays a listing of content items"""

    title = schema.TextLine(title=_(u'label_title', default=u'Title'),
                            required=False)

    description = schema.Text(
        title=_(u'label_description', default=u'Summary'),
        description=_(u'help_description',
                      default=u'Used in item listings and search results.'),
        required=False,
        missing_value=u'',
    )

    widget(query=QueryStringFieldWidget)
    query = schema.List(
        title=_(u"Search terms"),
        value_type=schema.Dict(value_type=schema.Field(),
                               key_type=schema.TextLine()),
        description=_(u'Define the search terms for the items '
                      u'you want to list by choosing what to match on. The '
                      u'list of results will be dynamically updated'),
        required=False)

    sort_on = schema.TextLine(
        title=_(u'label_sort_on', default=u'Sort on'),
        description=_(u'Sort the collection on this index'),
        required=False,
    )

    sort_reversed = schema.Bool(
        title=_(u'label_sort_reversed', default=u'Reversed order'),
        description=_(u'Sort the results in reversed order'),
        required=False,
    )

    limit = schema.Int(
        title=_(u'Limit'),
        description=_(u'Limit Search Results'),
        required=False,
        default=100,
        min=1,
    )

    view_template = schema.Choice(title=_(u'Display mode'),
                                  source=_(u'Available Listing Views'),
                                  required=True)
Пример #15
0
class IQueryPortlet(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    header = schema.TextLine(title=_(u"Portlet header"),
                             description=_(u"Title of the rendered portlet"),
                             required=True)

    query = schema.List(
        title=_(u'label_query', default=u'Search terms'),
        description=_(u"""Define the search terms for the items you want to
            list by choosing what to match on.
            The list of results will be dynamically updated"""),
        value_type=schema.Dict(value_type=schema.Field(),
                               key_type=schema.TextLine()),
        required=False)

    sort_on = schema.TextLine(
        title=_(u'label_sort_on', default=u'Sort on'),
        description=_(u"Sort the collection on this index"),
        required=False,
    )

    sort_reversed = schema.Bool(
        title=_(u'label_sort_reversed', default=u'Reversed order'),
        description=_(u'Sort the results in reversed order'),
        required=False,
    )

    limit = schema.Int(
        title=_(u"Limit"),
        description=_(u"Specify the maximum number of items to show in the "
                      u"portlet. Leave this blank to show all items."),
        required=False)

    random = schema.Bool(
        title=_(u"Select random items"),
        description=_(u"If enabled, items will be selected randomly from the "
                      u"collection, rather than based on its sort order."),
        required=True,
        default=False)

    more = schema.TextLine(
        title=_(u"Show more link"),
        description=_(
            u"Link to display in the footer, leave empty to hide it"),
        required=False)
Пример #16
0
class IJob(interface.Interface):
    """An internal job object."""

    id = schema.Int(title=u'Id', description=u'The job id.', required=True)

    task = schema.TextLine(title=u'Task',
                           description=u'The task to be completed.',
                           required=True)

    status = schema.Choice(title=u'Status',
                           description=u'The current status of the job.',
                           values=[
                               QUEUED, PROCESSING, CANCELLED, ERROR, COMPLETED,
                               DELAYED, CRONJOB, STARTLATER
                           ],
                           required=True)

    input = schema.Object(title=u'Input',
                          description=u'The input for the task.',
                          schema=interface.Interface,
                          required=False)

    output = schema.Object(title=u'Output',
                           description=u'The output of the task.',
                           schema=interface.Interface,
                           required=False,
                           default=None)

    error = schema.Object(
        title=u'Error',
        description=u'The error object when the task failed.',
        schema=interface.Interface,
        required=False,
        default=None)

    created = schema.Datetime(
        title=u'Creation Date',
        description=u'The date/time at which the job was created.',
        required=True)

    started = schema.Datetime(
        title=u'Start Date',
        description=u'The date/time at which the job was started.')

    completed = schema.Datetime(
        title=u'Completion Date',
        description=u'The date/time at which the job was completed.')
Пример #17
0
class IUser( IApplicationContent ):
    """ """
    
    login = schema.TextLine(title=_(u"User Id"))
    first_name = schema.TextLine(title=_(u"First Name"))
    last_name = schema.TextLine(title=_(u"Last Name"))
    email = schema.TextLine(title=_(u"Email Address"), constraint=check_email )
    

    
    empNum = schema.Int( title=_(u"Employee Number"))
    status = schema.Choice( title=_(u"Status"), values=["A", "I"] )
    role = schema.TextLine(title=_(u"Role") )

    actionsLead = interface.Attribute("actionsLead")
    actionsInvolved = interface.Attribute("actionsInvolved")
    offices = interface.Attribute('offices')
Пример #18
0
class IQuestionModification(Interface):
    """Information concerning a questions modification times
    """

    modification_id = schema.Int(
        title=_(u"Question modification identifier"),
        description=_(u"A unique id for the modification"),
        required=True,
        readonly=True)

    question_id = schema.TextLine(
        title=_(u"Question which was modified"),
        description=_(u"The question object which was modified"),
        required=True,
        readonly=True)
    modification_time = schema.Date(
        title=_(u"Date/Time when question with id=question_id was modified"), )
Пример #19
0
class IAutoTOCSchema(ITitledContent):
    _local_types = schema.Set(
        title=_("Types to list"),
        description=_(
            "Select here the content types you wish to see in "
            "the table of content. You need to selected container types "
            "(e.g. Folder and Publication) in order for the TOC to "
            "display their contents."),
        value_type=schema.Choice(source=silva_content_types),
        default=set(['Silva Document', 'Silva Folder', 'Silva Publication']),
        required=True)
    _toc_depth = schema.Int(
        title=_("Depth"),
        description=_(
            "The depth to which the Table of Contents will be rendered "
            "(-1 means unlimited depth.)"),
        default=-1,
        min=-1,
        max=99,
        required=True)
    _display_desc_flag = schema.Bool(
        title=_("Display description"),
        description=_(
            "If selected, each item displayed will include its title "
            "and metadata description, if available. "),
        default=False,
        required=True)
    _show_icon = schema.Bool(
        title=_("Show icon"),
        description=_(
            "If selected, each item displayed will include its icon. "),
        default=False,
        required=True)
    _show_container_link = schema.Bool(
        title=_("Show container link"),
        description=_(
            "If selected, there will be a link to the container "
            "(as an H3) before the TOC list."),
        default=False,
        required=True)
    _sort_order = schema.Choice(
        title=_("Sort order"),
        description=_("The order items in a container will be sorted"),
        source=sort_order_source,
        default='silva',
        required=True)
Пример #20
0
class ICollectionPortlet(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    header = schema.TextLine(title=_(u"Portlet header"),
                             description=_(u"Title of the rendered portlet"),
                             required=True)

    target_collection = schema.Choice(
        title=_(u"Target collection"),
        description=_(u"Find the collection which provides the items to list"),
        required=True,
        source=SearchableTextSourceBinder(
            {'object_provides': IATTopic.__identifier__},
            default_query='path:'))

    limit = schema.Int(
        title=_(u"Limit"),
        description=_(
            u"Specify the maximum number of items to show in the portlet. "
            "Leave this blank to show all items."),
        required=False)

    random = schema.Bool(
        title=_(u"Select random items"),
        description=_(
            u"If enabled, items will be selected randomly from the collection, "
            "rather than based on its sort order."),
        required=True,
        default=False)

    show_more = schema.Bool(
        title=_(u"Show more... link"),
        description=_(
            u"If enabled, a more... link will appear in the footer of the portlet, "
            "linking to the underlying Collection."),
        required=True,
        default=True)

    show_dates = schema.Bool(
        title=_(u"Show dates"),
        description=
        _(u"If enabled, effective dates will be shown underneath the items listed."
          ),
        required=True,
        default=False)
Пример #21
0
class IOfficeInfo(model.Schema):
    """Behavior schema
    """
    order_after(room='IContactInfo.phone_number')
    room = schema.TextLine(
        title=_(u'Room'),
        # description=_(u'Room Info'),
        required=False
    )

    order_after(short_number='IContactInfo.phone_number')
    widget(short_number=ShortNumberFieldWidget)
    short_number = schema.Int(
        title=_(u'Short number'),
        required=False,
        constraint=is_short_number
    )
Пример #22
0
class ISearchSettings(Interface):

    path_based_breadcrumbs = schema.Bool(
        title=_(u'Use Path for Breadcrumbs'),
        default=False,
    )

    max_breadcrumbs = schema.Int(
        title=_(u'Max. Breadcrumbs'),
        default=3,
    )

    respect_navroot = schema.Bool(
        title=_(u'Respect Navigation Root'),
        description=_(u'Constrain searches to navigation root'),
        default=False,
    )
class IProduct(model.Schema):
    """Marker for content that can be purchased."""

    product_category = schema.Choice(
        title=u'Product Category',
        required=False,
        vocabulary='jazkarta.shop.product_categories',
    )

    price = Currency(
        title=u'Unit Price',
        default=Decimal("0.00"),
        min=Decimal("0.00"),
    )

    stock_level = schema.Int(
        title=u'Stock Level',
        description=u'Number of items remaining in warehouse. '
        u'Leave blank for no limit.',
        required=False,
        min=0,
    )

    taxable = schema.Bool(
        title=u'Taxable?',
        description=u'Mark the box if this product is subject to sales tax.',
        default=True,
    )

    weight = schema.Float(
        title=u'Weight (lbs)',
        description=u'Used to calculate shipping.',
        required=False,
    )

    model.fieldset(
        'shop',
        label=u"Shop",
        fields=(
            'product_category',
            'price',
            'stock_level',
            'taxable',
            'weight',
        ),
    )
Пример #24
0
class IIPnextViewletBlogSettings(Interface):
    """Describes registry records 
    """
    allowed_types = schema.List(
        title=_(u"Content types that display blog posts"),
        description=_(u"A list of content types that should display" +
                      u" a relevant blog post in a viewlet."),
        value_type=schema.TextLine(),
        default=DEFAULT_ENABLED_TYPES,
    )

    description_maxchars = schema.Int(
        title=_(u"Maximum characters to display"),
        description=_(u"The maximum number of characters to display" +
                      u" in the blog excerpt."),
        default=500,
    )
Пример #25
0
class IPinsPortlet(IPortletDataProvider):
    """A portlet

    It inherits from IPortletDataProvider because for this portlet, the
    data that is being rendered and the portlet assignment itself are the
    same.
    """

    portlet_title = schema.TextLine(title=_(u'Title'),
                                    description=_(u'Title of the portlet.'),
                                    required=True,
                                    default=u'My Pins')

    count = schema.Int(title=_(u'Number of items to display'),
                       description=_(u'How many items to list.'),
                       required=True,
                       default=10)
Пример #26
0
class ILoggerAction(Interface):
    """Interface for the configurable aspects of a logger action.

    This is also used to create add and edit forms, below.
    """

    targetLogger = schema.ASCIILine(title=_(u'Logger name'),
                                    default='Plone')

    loggingLevel = schema.Int(title=_(u'Logging level'),
                              default=20) # INFO

    message = schema.TextLine(title=_(u"Message"),
                              description=_('help_contentrules_logger_message',
                                            default=u"&e = the triggering event, &c = the context, &u = the user"),
                              default=_('text_contentrules_logger_message',
                                        default=u"Caught &e at &c by &u"))
Пример #27
0
class PersonalPageDonation(model.Schema, ITemplate, IBaseCampaignEmail):
    amount = schema.Int(
        title=u"Amount",
        description=u"The amount of the donation",
    )
    donor_first_name = schema.TextLine(
        title=u"Donor First Name",
        description=u"The first name of the donor",
    )
    donor_last_name = schema.TextLine(
        title=u"Donor Last Name",
        description=u"The last name of the donor",
    )
    donor_email = schema.TextLine(
        title=u"The Donor's email address",
        description=u"The last name of the donor",
    )
Пример #28
0
class IRefresh(model.Schema):
    """Reload the current page after a certain amount of time."""

    model.fieldset('settings', fields=['enable_refresh', 'ttl'])

    enable_refresh = schema.Bool(
        title=_(u'Enable refresh'),
        description=_(u'Enable refresh of the current page.'),
        default=False,
    )

    ttl = schema.Int(
        title=_(u'Time to live'),
        description=_(
            u'Number of seconds after which to reload the current page.'),
        default=300,
    )
Пример #29
0
class IRelevantAceContentItemsTile(ISearchAceContentTile):

    search_type = schema.Choice(
        title=_(u"Aceitem type"),
        vocabulary="eea.climateadapt.search_types_vocabulary",
        required=True)

    nr_items = schema.Int(
        title=_(u"Nr of items to show"),
        required=True,
        default=5,
    )

    show_share_btn = schema.Bool(
        title=_(u"Show the share button"),
        default=False,
    )
Пример #30
0
class IFilter(Interface):
    """A filter that accepts raw HTML and returns a filtered version.

    Register a named multi-adapter from (context, request) to
    this interface to install a new filter.

    To control the order of filters, use the 'order' attribute. It may be
    positive or negative."""

    order = schema.Int(title=u"Order")

    def is_enabled():
        """Returns a boolean indicating whether the filter should be
        applied."""

    def __call__(data):
        """Apply the filter.