Source code for ploneintranet.workspace.interfaces

# coding=utf-8
from plone.app.contenttypes.interfaces import IFolder
from plone.namedfile.field import NamedBlobImage
from plone.namedfile.interfaces import IImageScaleTraversable
from plone.supermodel import model
from ploneintranet.core import ploneintranetCoreMessageFactory as _
from ploneintranet.layout import interfaces as ilayout
from ploneintranet.layout.interfaces import INoBarcelonetaLayer
from zope import schema
from zope.component.interfaces import IObjectEvent
from zope.interface import Attribute
from zope.interface import Interface


[docs]class IPloneintranetWorkspaceLayer(Interface): """Zope 3 browser layer which is active regardless of themeswitching"""
[docs]class IThemedWorkspaceLayer(IPloneintranetWorkspaceLayer, INoBarcelonetaLayer): """Zope 3 browser layer which is *not* present in Barceloneta fallback"""
[docs]class IWorkspaceAppContentLayer(ilayout.IPloneintranetContentLayer, ilayout.IAppLayer): """Marker interface for content within a workspace app."""
[docs]class IWorkspaceAppFormLayer(ilayout.IPloneintranetFormLayer, ilayout.IAppLayer): """Marker interface for forms within a workspace app."""
[docs]class IParticipationPolicyChangedEvent(Interface): """ Event, which is fired once the participation policy of the workspace has changed """ old_policy = Attribute(u"Policy we are moving away from") new_policy = Attribute(u"Policy we are moving to")
[docs]class IWorkspaceRosterChangedEvent(Interface): """ Event, which is fired once the roster of a workspace had changed """
[docs]class IWorkspaceCreatedFromTemplateEvent(Interface): """ A workspace has been created by copying a template. This event allows us to disable the auditlog while the other events are fired and then create only one entry via this event. Otherwise all items contained in the template trigger audit entries when copied. """
[docs]class IObjectModifiedAfterCreationEvent(IObjectEvent): """ Event which is fired in the special case where we set the fields of an object after first creating it empty. """
[docs]class ICaseManagerAware(Interface): """ Marker interface for classes that are aware of the case manager app """
[docs]class IBaseWorkspaceFolder(model.Schema, IImageScaleTraversable): """ Interface for WorkspaceFolder """ calendar_visible = schema.Bool( title=_( u"label_workspace_calendar_visibility", u"Calendar visible in central calendar", ), required=False, default=False, ) division = schema.TextLine( title=_(u"label_workspace_division", u"Belongs to this Division"), required=False, default=u"", ) email = schema.TextLine( title=_(u"label_workspace_email", u"E-mail address"), required=False, default=u"", ) archival_date = schema.Datetime( title=_("label_archived", u"Archived"), required=False, default=None ) related_workspaces = schema.List( value_type=schema.ASCIILine( title=_(u"label_workspace_uid", u"UID of a workspace"), required=False, default="", ), title=_(u"label_related_workspaces", u"Related workspaces"), required=False, default=[], ) hero_image = NamedBlobImage(title=_(u"Hero Image"), required=False) default_grouping = schema.TextLine( title=_("label_default_grouping", u"Default grouping for this workspace"), required=False, default=u"", ) remote_admin = schema.TextLine(title=u"Remote admin", required=False, default=u"") show_activity_stream = schema.Bool( title=_(u"label_show_activity_stream", u"Show activity stream"), description=_( u"help_show_activity_stream", u"Show or hide the activity stream on the workspace landing page.", ), required=False, default=True, )
[docs]class IWorkspaceFolder(IBaseWorkspaceFolder): """ A workspace folder can be a division, while other objects inheriting from IBaseWorkspaceFolder cannot, e.g. cases """ is_division = schema.Bool( title=_( u"label_workspace_is_division", u"Is this workspace representing a division?", ), description=_( u"Divisions represent sections of the overall " u"organisation and appear " u"as groupings on the workspace overview." ), required=False, default=False, )
[docs]class IMetroMap(Interface): """Methods required to display a metromap """ def metromap_sequence(): """An ordered dict with the structure required for displaying tasks in the metromap and in the sidebar of a Case item. This is used to determine which states have been finished, and which transitions are currently available. OrderedDict([( "new", { "is_current": False, "transition_id": "transfer_to_department", "finished": True, }), ( "in_progress", { "is_current": False, "transition_id": "transfer_to_department", "finished": True, }), ]) """
[docs]class IGroupingStoragable(Interface): """marker interface for things that can have a GroupingStorage """
[docs]class IGroupingStorage(Interface): def update_groupings(obj): """ Update the groupings dict with the values stored on obj. """ def remove_from_groupings(obj): """ Remove obj's grouping relevant information to its workspace. """ def reset_order(): """ Reset the order for all groupings to default, i.e. same order as the keys of the OOBTree """ def get_order_for(grouping, include_archived=False, alphabetical=False): """ Get order for a given grouping """ def set_order_for(grouping, order): """ Set order for a given grouping """ def get_groupings(): """ Return groupings """
[docs]class IMail(IFolder): """ Marker interface for the ploneintranet.workspace.mail content type """
[docs]class ITrashable(Interface): """ Marker interface for objects that can be trashed """
[docs]class ITrashed(ITrashable): """ Marker interface for objects that are trashed """
[docs]class IVisibleToIntranetUsersWorkspace(Interface): """ Marker interface for workspaces that should be visible by all the intranet users """