Exemplo n.º 1
0
class IPay2PloneUtility(IOrderedContainer):
    """ contract interface for the pay2plone utility
    """
    contains("eastofeaton.pay2plone.interfaces.IPay2PloneUserRecord")

    def get_user_record(member_id):
        """ return existing, or create and return new user record for member_id
Exemplo n.º 2
0
class IBiomarkerFolder(IKnowledgeFolder):
    '''Biomarker folder.'''
    contains('eke.biomarker.interfaces.IBiomarker',
             'eke.biomarker.interfaces.IBiomarkerFolder',
             'eke.biomarker.interfaces.IReviewListing')
    bmoDataSource = schema.TextLine(
        title=_(u'Biomarker-Organ RDF Data Source'),
        description=
        _(u'URL to a source of RDF data that supplements the RDF data source with biomarker-organ data.'
          ),
        required=True)
    bmuDataSource = schema.TextLine(
        title=_(u'Biomarker-BioMuta RDF Data Source'),
        description=
        _(u'URL to a source of RDF data that supplements the RDF data source with biomarker-biomuta data.'
          ),
        required=True)
    idDataSource = schema.TextLine(
        title=_(u'biomarker id external resource API link'),
        description=
        _(u'URL to a api that allows querying biomarker ids for links and alternative ids of external resources.'
          ),
        required=True)
    dataSummary = schema.TextLine(title=_(u'Biomarker Statistics'),
                                  description=_(u'Biomarker statistics.'),
                                  required=False)
    disclaimer = schema.Text(
        title=_(u'Disclaimer'),
        description=_(
            u'Legal disclaimer to display on Biomarker Folder pages.'),
        required=False,
    )
Exemplo n.º 3
0
class IUsersFolderPlugin(IAuthenticationPlugin, IDirectorySearchPlugin):
    """Local users folder interface"""

    contains('pyams_security.interfaces.ILocalUser')

    def check_login(self, login):
        """Check for existence of given login"""
class IUniformTitleContainerContainer(IContainer):
    """The container part of the container for uniform titles. We have
    split this into to interfaces.

    Let's test if the constraints are handle correctly: Implement a
    conainer and test some dummy objects.

        >>> from quotationtool.referatory import interfaces
        >>> import zope.interface
        >>> class UniformTitleContainer:
        ...     zope.interface.implements(
        ...         interfaces.IUniformTitleContainer,
        ...         interfaces.IUniformTitleContainerContainer)

        >>> uc = UniformTitleContainer()
        >>> bad = object()
        >>> from zope.container.constraints import checkObject
        >>> checkObject(uc, 'bad', bad)
        Traceback (most recent call last):
        ...
        InvalidItemType: (<quotationtool.referatory.interfaces.UniformTitleContainer instance at ...>, <object object at ...>, [<InterfaceClass quotationtool.referatory.interfaces.IUniformTitle>])
        
        >>> class UniformTitle:
        ...     zope.interface.implements(
        ...         interfaces.IUniformTitle)

        >>> title = UniformTitle()
        >>> checkObject(uc, 'title', title)
        >>> 
    
    """

    contains('.IUniformTitle')
class IReferatoryContainer(IContainer):
    """This interface defines the container part of the referatory.

    Testing:

        >>> from quotationtool.referatory.interfaces import \
                IReferatory, IReferatoryContainer
        >>> import zope.interface
        >>> class Referatory(object):
        ...     zope.interface.implements(IReferatory,
        ...         IReferatoryContainer)

        >>> referatory = Referatory()
        >>> from quotationtool.referatory.interfaces import IReference
        >>> class Reference(object):
        ...     zope.interface.implements(IReference)

        >>> reference = Reference()
        >>> from zope.container.constraints import checkObject
        >>> checkObject(referatory, 'reference', reference)
        >>> bad = object()
        >>> checkObject(referatory, 'bad', bad)
        Traceback (most recent call last):
        ...
        InvalidItemType: (<quotationtool.referatory.interfaces.Referatory object at ...>, <object object at ...>, [<InterfaceClass quotationtool.referatory.interfaces.IReference>])

    """

    contains('.IReference')
Exemplo n.º 6
0
class IMessage(IContained, IContainer):
    contains('.IMessage')

    title = schema.TextLine(
        title=u"Betreff",
        description=u"Der Betreff Ihrer Nachricht",
    )

    #subject = schema.TextLine(
    #    title=u"Grund",
    #    description=u"Der Grund Ihrer Nachricht",
    #)

    #message = schema.TextLine(
    message = schema.Text(
        title=u"Nachricht",
        description=u"Bitte tragen Sie hier Ihre Nachricht ein",
    )

    attachment = FileField(
        title=u"Anhang",
        required=False,
        description=
        u"Bitte waehlen Sie die Datei, die Sie uns senden moechten.",
    )

    access_token = schema.TextLine(
        title=u"   ",
        required=False,
    )

    doc_id = schema.TextLine(
        title=u"doc_id",
        required=False,
    )
Exemplo n.º 7
0
class ITaskNotificationContainer(IContainer):
    """Task notifications container interface"""

    contains(ITaskNotification)

    def get_enabled_items(self):
        """Get iterator over enabled notifications"""
Exemplo n.º 8
0
class IFundingOpportunity(IATFolder):
    '''Funding Opportunity.'''
    contains('edrnsite.funding.interfaces.IAnnouncement')
    title = schema.TextLine(
        title=_(u'Title'),
        description=_(u'Title of the opportunity.'),
        required=True,
    )
    description = schema.Text(
        title=_(u'Description'),
        description=_(u'A short summary of the opportunity.'),
        required=False,
    )
    opportunityType = schema.TextLine(
        title=_(u'Opportunity Type'),
        description=_(u'The kind of opportunity being made available'),
        required=True,
    )
    reissuable = schema.Bool(
        title=_(u'Reissuable'),
        description=
        _(u'True if this funding opportunity may be reissued, false otherwise.'
          ),
        required=False,
    )

    def getClosingDate():
        '''Get when this opportunity closes based on its announcements, if any.'''
Exemplo n.º 9
0
class IGroupsFolderPlugin(IDirectorySearchPlugin, IGroupsAwareDirectoryPlugin):
    """Principals groups folder plug-in"""

    contains('pyams_security.interfaces.ILocalGroup')

    def check_group_id(self, group_id):
        """Check for existence of given group ID"""
Exemplo n.º 10
0
class IActivityWorksheet(IWorksheet, IWorksheetAnnotatableMixin):
    '''A list of activities that must be fulfilled in a course or section.'''
    def canAverage():
        """return True if activities have scoresystems that can be averaged"""

    containers(IActivities)
    contains('.IActivity')
Exemplo n.º 11
0
class ICourseWorksheet(interfaces.IRequirement):
    '''A worksheet template to get copied into section gradebooks.'''

    contains('.IActivity')

    title = zope.schema.TextLine(
        title=_(u'Title'),
        description=_(u'Identifies the course worksheet in gradebooks.'))
Exemplo n.º 12
0
class ISchoolYearContainer(IContainer, ILocation):
    """Container for school years"""
    constraints.contains(ISchoolYear)

    def validateForOverlap(schoolyear):
        """Validate school year for overlap with other school years."""

    def getActiveSchoolYear():
        """Return the active schoolyear."""
Exemplo n.º 13
0
class IPortletStorage(IContainer):
    """A component for storing global (site-wide) portlet assignments.

    This manages one IPortletCategoryMapping for each category of portlet,
    e.g. 'user' or 'group' (the exact keys are up to the application layer).

    Some common keys are found in plone.portlets.constants.
    """
    contains('plone.portlets.interfaces.IPortletCategoryMapping')
Exemplo n.º 14
0
class IPortletCategoryMapping(IContainer, IContained):
    """A mapping of the portlets assigned to a particular categories under
    various keys.

    This manages one IPortletAssignmentMapping for each key. For example,
    if this is the 'user' category, the keys could be user ids, each of
    which would be given a particular IPortletAssignmentMapping.
    """
    contains('plone.portlets.interfaces.IPortletAssignmentMapping')
Exemplo n.º 15
0
class IScheduler(IAttributeAnnotatable):
    """Scheduler interface"""

    contains(ITask)

    zodb_name = Choice(
        title=_("ZODB connection name"),
        description=_("Name of ZODB defining scheduler connection"),
        required=False,
        default='',
        vocabulary=ZODB_CONNECTIONS_VOCABULARY_NAME)

    report_mailer = Choice(
        title=_("Reports mailer"),
        description=_("Mail delivery utility used to send mails"),
        required=False,
        vocabulary=MAILERS_VOCABULARY_NAME)

    report_source = TextLine(
        title=_("Reports source"),
        description=_("Mail address from which reports will be sent"),
        required=False)

    notified_host = TextLine(
        title=_("Notified host"),
        description=_("If websockets notifications are enabled, this is "
                      "the host (including protocol) which will "
                      "be notified"),
        required=False)

    show_home_menu = Bool(
        title=_("Access menu from home"),
        description=_("If 'yes', a menu will be displayed to get access to "
                      "tasks scheduler from site admin home page"),
        required=True,
        default=False)

    internal_id = Attribute("Internal ID")

    def get_socket(self):
        """Get ZMQ socket matching scheduler utility"""

    def get_task(self, task_id):
        """Get task matching given task ID"""

    def get_jobs(self):
        """Get text output of running jobs"""

    tasks = List(title=_("Scheduler tasks"),
                 description=_("List of tasks assigned to this scheduler"),
                 value_type=Object(schema=ITask),
                 readonly=True)

    history = List(title=_("History"),
                   description=_("Task history"),
                   value_type=Object(schema=ITaskHistory),
                   readonly=True)
Exemplo n.º 16
0
class IReportWorksheet(interfaces.IRequirement, IWorksheetAnnotatableMixin):
    '''A worksheet template to get copied into section gradebooks.'''

    containers(IGradebookTemplates, IGradebookDeployed)
    contains('.IReportActivity')

    title = zope.schema.TextLine(
        title=_(u'Title'),
        description=_(u'Identifies the report sheet in teacher gradebooks.'))
Exemplo n.º 17
0
class IWorksheet(interfaces.IRequirement):
    '''A list of requirements that must be fulfilled in a course or section.'''

    deployed = zope.schema.Bool(title=u"Deployed Worksheet", required=False)

    hidden = zope.schema.Bool(title=u"Hidden Worksheet", required=False)

    containers(IWorksheets)
    contains('interfaces.IRequirement')
Exemplo n.º 18
0
class IPersonContainer(IContainer):
    """Container of persons."""

    contains(IPerson)

    super_user = Attribute(
        """Absolute administrator for this schooltool instance.

           A user that no matter which groups he is in or is not in has the
           administrative privileges.""")
class ICollaborationsFolder(Interface):
    '''A collaborations folder contains collaborative groups.'''
    contains('edrnsite.collaborations.interfaces.ICollaborativeGroup')
    title = schema.TextLine(
        title=_(u'Title'),
        description=_(u'The name of this collaborations folder.'),
        required=True,
    )
    description = schema.Text(
        title=_(u'Description'),
        description=_(u'A short summary of this collaborations folder.'),
        required=False,
    )
Exemplo n.º 20
0
class IFundingFolder(IATFolder):
    '''Funding Folder.'''
    contains('edrnsite.funding.interfaces.IFundingOpportunity')
    title = schema.TextLine(
        title=_(u'Title'),
        description=_(u'Descriptive name of this folder.'),
        required=True,
    )
    description = schema.Text(
        title=_(u'Description'),
        description=_(u'A short summary of this folder.'),
        required=False,
    )
Exemplo n.º 21
0
class IPortletAssignmentMapping(IOrderedContainer, IContainerNamesContainer, IContained):
    """A storage for portlet assignments.

    An IPortletCategoryMapping manages one of these for each category of
    context. It may also be stored in an annotation on an object to manage
    portlets assigned to that object. In this case, a multi-adapter from
    ILocalPortletAssignable and IPortletManager will be able to obtain the
    appropriate container.
    """
    contains('plone.portlets.interfaces.IPortletAssignment')

    __manager__ = schema.TextLine(title=u"Name of the portlet manager this mapping belongs to")
    __category__ = schema.TextLine(title=u'Name of the category this mapping belongs to')
class ICommentContainer(IContainer):
    """A container for unified comments."""

    contains(IComment)

    _count = zope.schema.Int(
        title = _('icommentcontainer-count-title',
                  u"Count"),
        description = _('icommentcontainer-count-desc',
                        u"Number of comments yet added. This is used to choose the name of a comment. It is never decremented on comment deletion."),
        required = True,
        default = 0,
        )
Exemplo n.º 23
0
class IScheduleContainer(IContainer, IScheduleWithExceptions):
    """A container of schedules.

    The container itself is as a big composite schedule.
    """
    contains(ISchedule)

    first = zope.schema.Date(
        title=u"First scheduled day",
        required=False)

    last = zope.schema.Date(
        title=u"Last scheduled day",
        required=False)
Exemplo n.º 24
0
class IPay2PloneUserRecord(IOrderedContainer, IContainerNamesContainer):
    """ record of sites purchased by a user
    """
    contains("eastofeaton.pay2plone.interfaces.ISiteRecord")

    def add_site_record(site_record):
        """ insert the site_record into the user record, create new id for it
        """

    def get_site_record(id):
        """ return the site record at 'id'
        """

    def delete_site_record(id):
        """ remove the site record at 'id'
Exemplo n.º 25
0
class IKeyManager(IContainer):
    contains("plone.keyring.interfaces.IKeyring")

    def clear(ring=u"_system"):
        """Clear all keys on a given ring. By default the system ring
        is cleader.  If None is used as ring id all rings are cleared.
        """

    def rotate(ring=u"_system"):
        """Rotate a given ring. By default rotates the system ring.
        If None is used as ring id all rings are rotated.
        """

    def secret(ring=u"_system"):
        """Return the current secret for a given ring. If no ring
Exemplo n.º 26
0
class IBodySystemStudy(IKnowledgeObject, IResearchedObject):
    '''Study-specific information on a biomarker's effects on a single organ.'''
    contains('eke.biomarker.interfaces.IStudyStatistics')
    protocol = schema.Object(
        title=_(u'Study'),
        description=
        _(u'The study or protocol referenced by specific organ with regard to a biomarker.'
          ),
        required=True,
        schema=IProtocol)
    decisionRule = schema.Text(
        title=_(u'Decision Rule'),
        description=_(
            u'Details about the decision rule for this body system study'),
        required=False,
    )
class IWorkList(zope.interface.Interface):
    """ A list of workflow items. 

    There are some of these lists in the workflow container, one named
    'author', one 'editorialreview', one 'technicalreview'."""

    contains(IWorkItem)

    def pop():
        """ Get the next workflow item."""

    def append(obj):
        """ Append obj to list of workflow items."""

    def remove(obj):
        """ Remove obj from list of workflow items."""
Exemplo n.º 28
0
class IRequirement(IOrderedContainer, IContained):
    """Something a student can do.

    A requirement can contain further requirements that are needed to fulfill
    this requirement. You can think of those requirements as dependencies of
    this requirement. We will refer to those requirements from now on as
    dependencies or depoendency requirements.
    """

    contains('.IRequirement')
    containers('.IRequirement')

    title = zope.schema.TextLine(title=_(u"Title"),
                                 description=u'',
                                 required=True)

    def changePosition(name, pos):
        """Changes the requirement's position to the specified position."""
Exemplo n.º 29
0
class IEditorialHistory(IContainer):
    """A container that stores outdated editorial status objects.

    

    The __name__ of an editorial status object should be the datetime
    of the revision.

    This an adapter.
    """

    contains(IEditorialStatus)

    def getCurrentEditorialStatus():
        """ Returns the current editorial status, i.e. the editorial status."""

    locked = zope.interface.Attribute(
        """True if item is locked for editing, else False.""")
Exemplo n.º 30
0
class IGroupSpace(Interface):
    '''A group space is a place for members of a group to share stuff.'''
    contains('edrnsite.collaborations.interfaces.IGroupSpaceIndex')
    title = schema.TextLine(
        title=_(u'Title'),
        description=_(u'The name of this group.'),
        required=True,
    )
    description = schema.Text(
        title=_(u'Description'),
        description=_(u'A short summary of this group.'),
        required=False,
    )
    updateNotifications = schema.Bool(
        title=_(u'Update Notifications'),
        description=_(u'Enable notifying members (by email) of updates to this group.'),
        required=False,
    )