Exemple #1
0
class IItem(IZopeObject, IManageable,
            ICopySource, ITraversable, IOwned):

    __name__ = NativeStringLine(title=u"Name")

    title = NativeStringLine(title=u"Title")

    def getId():
        """Return the id of the object as a string.

        This method should be used in preference to accessing an id
        attribute of an object directly. The getId method is public.
        """

    def title_or_id():
        """Return the title if it is not blank and the id otherwise.
        """

    def title_and_id():
        """Return the title if it is not blank and the id otherwise.

        If the title is not blank, then the id is included in parens.
        """

    def manage_editedDialog(REQUEST, **args):
        """Show an 'edited' dialog.
        """

    def raise_standardErrorMessage(client=None, REQUEST={},
                                   error_type=None, error_value=None, tb=None,
                                   error_tb=None, error_message='',
                                   tagSearch=None, error_log_url=''):
        """Raise standard error message.
Exemple #2
0
class IAttributeConsumingServiceSchema(IItemSchema):
    # override "title" to make it required
    title = TextLine(
        title=_(u"title_title", u"Title"),
        required=True,
        default=u"",
    )

    index = Int(
        title=_(u"attribute_consuming_service_index_title", u"Index"),
        description=_(
            u"attribute_consuming_service_index_description",
            u"Unique integer index identifying this service.",
        ),
        required=True,
        default=0,
    )

    is_default = Bool(
        title=_(u"attribute_consuming_service_is_default_title", u"Default?"),
        description=_(
            u"attribute_consuming_service_is_default_description",
            u"Is this the default service. Only one service must be the default!.",
        ),
        required=True,
        default=False,
    )

    language = NativeStringLine(
        title=_(u"attribute_consuming_service_language_title", u"Language"),
        description=_(
            u"attribute_consuming_service_language_description",
            u"The language of the service description (e.g. `en`, `de`, `fr` ...)."
        ),
        required=True,
        default="en",
    )

    description = Text(
        title=_(u"service_description_title", u"Description"),
        description=_(
            u"service_description_description",
            u"Information describing the service.",
        ),
        required=False,
    )

    extends = NativeStringLine(
        title=_(u"attribute_consuming_service_extends_title", u"Extends"),
        description=_(
            u"attribute_consuming_service_extends_description",
            u"blank separated sequence of service ids this service extends (not yet supported)"
        ),
        required=False,
        default="",
    )
class IOnlineHelpTopicDirective(Interface):
    """Register an online topic.

    Optionally you can register a topic for a component and view.
    """

    id = NativeStringLine(
        title=u"Topic Id",
        description=u"Id of the topic as it will appear in the URL.",
        required=True)

    title = MessageID(
        title=u"Title",
        description=u"Provides a title for the online Help Topic.",
        required=True)

    parent = NativeStringLine(title=u"Parent Topic",
                              description=u"Id of the parent topic.",
                              default="",
                              required=False)

    for_ = GlobalInterface(
        title=u"Object Interface",
        description=u"Interface for which this Help Topic is registered.",
        default=None,
        required=False)

    view = NativeStringLine(
        title=u"View Name",
        description=u"The view name for which this Help Topic is registered.",
        default="",
        required=False)

    doc_path = Path(
        title=u"Path to File",
        description=u"Path to the file that contains the Help Topic content.",
        required=True)

    class_ = GlobalObject(
        title=u"Factory",
        description=u"""
        The factory is the topic class used for initializeing the topic""",
        required=False,
    )

    resources = Tokens(title=u"A list of resources.",
                       description=u"""
        A list of resources which shall be used for the Help Topic.
        The resources must be located in the same directory as
        the Help Topic definition.
        """,
                       value_type=TextLine(),
                       required=False)
Exemple #4
0
class IInclude(Interface):
    """The `include`, `includeOverrides` and `exclude`
    directives.

    These directives allows you to include or preserve including of
    another ZCML file in the configuration. This enables you to write
    configuration files in each package and then link them together.
    """

    file = NativeStringLine(
        title=u"Configuration file name",
        description=(u"The name of a configuration file to be included/"
                     u"excluded, relative to the directive containing the "
                     u"including configuration file."),
        required=False,
    )

    files = NativeStringLine(
        title=u"Configuration file name pattern",
        description=u"""
        The names of multiple configuration files to be included/excluded,
        expressed as a file-name pattern, relative to the directive
        containing the including or excluding configuration file.
        The pattern can include:

        - ``*`` matches 0 or more characters

        - ``?`` matches a single character

        - ``[<seq>]`` matches any character in seq

        - ``[!<seq>]`` matches any character not in seq

        The file names are included in sorted order, where sorting is
        without regard to case.
        """,
        required=False,
    )

    package = GlobalObject(
        title=u"Include or exclude package",
        description=u"""
        Include or exclude the named file (or configure.zcml) from the
        directory of this package.
        """,
        required=False,
    )
Exemple #5
0
class IPreferenceAnnotationFactory(zope.interface.Interface):
    """A factory returning the object to be annotated for a preference group and the annotation key
    """
    def annotations():
        """Returns an IAnnotations object to be used for this PreferenceGroup
        """

    __annotation_key__ = NativeStringLine(
        title=u'The annotation key for this PreferenceGroup', required=True)
Exemple #6
0
class IIncludePluginsDirective(Interface):
    """Auto-include any ZCML in the dependencies of this package."""

    target = NativeStringLine(
        title="Package to auto-include for",
        description="Auto-include all plugins to this package.",
        # Note: z3c.autoinclude has required=True
        required=False,
    )

    file = NativeStringLine(
        title="ZCML filename to look for",
        description="""
        Name of a particular ZCML file to look for.
        If omitted, autoinclude will scan for standard filenames
        (e.g. meta.zcml, configure.zcml, overrides.zcml)
        """,
        required=False,
    )
Exemple #7
0
class IZopeObject(Interface):

    isPrincipiaFolderish = Bool(
        title=u"Is a folderish object",
        description=u"Should be false for simple items",
    )

    meta_type = NativeStringLine(
        title=u"Meta type",
        description=u"The object's Zope2 meta type",
    )
class IFile(Interface):

    contentType = NativeStringLine(
        title=_(u'Content Type'),
        description=_(u'The content type identifies the type of data.'),
        default='',
        required=False,
        missing_value='')

    data = Bytes(
        title=_(u'Data'),
        description=_(u'The actual content of the object.'),
        default=b'',
        missing_value=b'',
        required=False,
    )

    def getSize():
        """Return the byte-size of the data of the object."""
Exemple #9
0
class IFieldInfo(Interface):

    name = NativeStringLine(title=u"The field name", )

    title = TextLine(
        title=u"Title",
        description=u"A short summary or label",
        default=u"",
        required=False,
    )

    required = Bool(title=u"Required",
                    description=u"Determines whether a value is required.",
                    default=True)

    readonly = Bool(title=u"Read Only",
                    description=u"Can the value be modified?",
                    required=False,
                    default=False)
class IPermission(Interface):
    """A permission object.

    Note that the ZCML ``<permission>`` directive restricts the ``id`` to
    be an identifier (a dotted name or a URI), but this interface allows
    any native string.
    """

    id = NativeStringLine(
        title=_("Id"),
        description=_("Id as which this permission will be known and used."),
        readonly=True,
        required=True)

    title = TextLine(title=_("Title"),
                     description=_("Provides a title for the permission."),
                     required=True)

    description = Text(
        title=_("Description"),
        description=_("Provides a description for the permission."),
        required=False)
Exemple #11
0
class IPropertyManager(Interface):
    """
    The PropertyManager mixin class provides an object with
    transparent property management. An object which wants to
    have properties should inherit from PropertyManager.

    An object may specify that it has one or more predefined
    properties, by specifying an _properties structure in its
    class::

      _properties=({'id':'title', 'type': 'string', 'mode': 'w'},
                   {'id':'color', 'type': 'string', 'mode': 'w'},
                   )

    The _properties structure is a sequence of dictionaries, where
    each dictionary represents a predefined property. Note that if a
    predefined property is defined in the _properties structure, you
    must provide an attribute with that name in your class or instance
    that contains the default value of the predefined property.

    Each entry in the _properties structure must have at least an 'id'
    and a 'type' key. The 'id' key contains the name of the property,
    and the 'type' key contains a string representing the object's type.
    The 'type' string must be one of the values: 'float', 'int', 'long',
    'string', 'lines', 'text', 'date', 'tokens', 'selection', or
    'multiple section'.

    For 'selection' and 'multiple selection' properties, there is an
    addition item in the property dictionay, 'select_variable' which
    provides the name of a property or method which returns a list of
    strings from which the selection(s) can be chosen.

    Each entry in the _properties structure may *optionally* provide a
    'mode' key, which specifies the mutability of the property. The 'mode'
    string, if present, must contain 0 or more characters from the set
    'w','d'.

    A 'w' present in the mode string indicates that the value of the
    property may be changed by the user. A 'd' indicates that the user
    can delete the property. An empty mode string indicates that the
    property and its value may be shown in property listings, but that
    it is read-only and may not be deleted.

    Entries in the _properties structure which do not have a 'mode' key
    are assumed to have the mode 'wd' (writeable and deleteable).

    To fully support property management, including the system-provided
    tabs and user interfaces for working with properties, an object which
    inherits from PropertyManager should include the following entry in
    its manage_options structure::

      {'label':'Properties', 'action':'manage_propertiesForm',}

    to ensure that a 'Properties' tab is displayed in its management
    interface. Objects that inherit from PropertyManager should also
    include the following entry in its __ac_permissions__ structure::

      ('Manage properties', ('manage_addProperty',
                             'manage_editProperties',
                             'manage_delProperties',
                             'manage_changeProperties',)),
    """

    manage_propertiesForm = Attribute(""" """)
    manage_propertyTypeForm = Attribute(""" """)

    title = NativeStringLine(title=u"Title")

    _properties = Tuple(title=u"Properties")

    propertysheets = Attribute(" ")

    def valid_property_id(id):
        """
        """

    def hasProperty(id):
        """Return true if object has a property 'id'.
        """

    def getProperty(id, d=None):
        """Get the property 'id'.

        Returns the optional second argument or None if no such property is
        found.
        """

    def getPropertyType(id):
        """Get the type of property 'id'.

        Returns None if no such property exists.
        """

    def _wrapperCheck(object):
        """Raise an error if an object is wrapped.
        """

    def _setPropValue(id, value):
        """
        """

    def _delPropValue(id):
        """
        """

    def _setProperty(id, value, type='string'):
        """Set property.

        For selection and multiple selection properties the value argument
        indicates the select variable of the property.
        """

    def _updateProperty(id, value):
        """Update the value of an existing property.

        If value is a string, an attempt will be made to convert the value to
        the type of the existing property.
        """

    def _delProperty(id):
        """
        """

    def propertyIds():
        """Return a list of property ids.
        """

    def propertyValues():
        """Return a list of actual property objects.
        """

    def propertyItems():
        """Return a list of (id,property) tuples.
        """

    def _propertyMap():
        """Return a tuple of mappings, giving meta-data for properties.
        """

    def propertyMap():
        """Return a tuple of mappings, giving meta-data for properties.

        Return copies of the real definitions for security.
        """

    def propertyLabel(id):
        """Return a label for the given property id
        """

    def propdict():
        """
        """

    # Web interface

    def manage_addProperty(id, value, type, REQUEST=None):
        """Add a new property via the web.

        Sets a new property with the given id, type, and value.
        """

    def manage_editProperties(REQUEST):
        """Edit object properties via the web.

        The purpose of this method is to change all property values,
        even those not listed in REQUEST; otherwise checkboxes that
        get turned off will be ignored.  Use manage_changeProperties()
        instead for most situations.
        """

    def manage_changeProperties(REQUEST=None, **kw):
        """Change existing object properties.

        Change object properties by passing either a REQUEST object or
        name=value parameters
        """

    def manage_changePropertyTypes(old_ids, props, REQUEST=None):
        """Replace one set of properties with another

        Delete all properties that have ids in old_ids, then add a
        property for each item in props.  Each item has a new_id,
        new_value, and new_type.  The type of new_value should match
        new_type.
        """

    def manage_delProperties(ids=None, REQUEST=None):
        """Delete one or more properties specified by 'ids'."""
Exemple #12
0
class ISimpleSpSchema(ISamlRoleSchema):

    default_authn_context_class = Choice(
        title=_(u"default_authn_context_class_title",
                "Default authentication context class"),
        description=_(
            u"default_auth_context_class_description",
            u"The default authentication context class required by this service provider."
            u" The value is likely either `Password` (HTTP username/password authentication) or `PasswordProtectedTransport` (HTTPS username/password authentication)."
        ),
        vocabulary=vocab_from_urns(SAML_CLASSES),
        required=False,
    )

    cookie_path = ItemPath(title=_(u"cookie_path_title", u"Cookie path"),
                           description=_(u"cookie_path_description",
                                         u"Path used for all cookies"),
                           required=True,
                           default="/")

    cookie_domain = NativeStringLine(
        title=_(u"cookie_domain_title", u"Cookie domain"),
        description=_(u"cookie_domain_description",
                      u"Domain used for all cookies"),
        required=False,
    )

    session_cookie_name = NativeStringLine(
        title=_(u"session_cookie_name_title", u"Session cookie name"),
        description=_(
            u"session_cookie_name_description",
            u"The name of the cookie representing the authentication information"
        ),
        required=True,
        default="_saml2_session",
    )

    attribute_cookie_name = NativeStringLine(
        title=_(u"attribute_cookie_name_title", u"Attribute cookie name"),
        description=_(
            u"attribute_cookie_name_description",
            u"The name of the cookie holding SAML2 attribute information"),
        required=False,
        default="_saml2_attributes",
    )

    encrypt_cookies = Bool(
        title=_(u"encrypt_cookies_title", u"should cookies be encrypted"),
        description=_(u"encrypt_cookies_description",
                      u"controls whether cookie values are encrypted"),
        required=False,
        default=False,
    )

    nameid_formats = Tuple(
        title=_(u"nameid_formats_title", u"Nameid formats"),
        description=_(
            u"name_id_formats_description",
            u"Specifies which nameid formats are acceptable. If left empty, any nameid format is acceptable."
        ),
        value_type=Choice(vocabulary=vocab_from_urns(NAMEID_FORMATS), ),
        required=False,
        default=(),
    )

    allow_create = Bool(
        title=_(u"allow_create_title", u"Allow identifier creation"),
        description=_(
            u"allow_create_description",
            u"Allows the identity provider to create/associate a new identifier for the authenticated user."
        ),
        required=False,
        default=True,
    )
class Ik(Interface):
    for_ = NativeStringLine()
    class_ = NativeStringLine()
    x = NativeStringLine()
class ISimple(Interface):

    a = Text()
    b = Text(required=False)
    c = NativeStringLine()