ploneintranet.workspace.browser package¶
Subpackages¶
Submodules¶
ploneintranet.workspace.browser.add_content module¶
-
class
ploneintranet.workspace.browser.add_content.
AddBase
(context, request)¶ Bases:
ploneintranet.layout.browser.base.BasePanel
Basic stuff for adding contents
-
_form_data_pat_inject_parts
= ('#document-body', '#workspace-documents', "#global-statusmessage; loading-class: ''")¶
-
allow_video_uploads
¶
-
allusers_json_url
¶ Return @@allusers.json in the proper context
-
can_edit
= True¶
-
content_helper_view
¶ Use the content_helper_view
-
create
(container=None)¶ Create content in the given container and return url. Uses dexterity_update to set the appropriate fields after creation.
-
form_data_pat_validation
¶ Proper pat-validation options. We need to match the timestamp of the create button.
-
get_data_pat_autosuggest
(fieldname)¶ Return the data-pat-autosuggest for a fieldname
-
get_new_object
(container=None)¶ This will create a new object
-
get_new_unique_id
(container)¶ This will get a new unique id according to the request
-
is_add_form
= True¶
-
parent_workspace
¶ Return the parent workspace
-
portal
¶ Return the portal
-
redirect
(url)¶ Has its own method to allow overriding
-
suppress_messages
= False¶
-
template
= <BoundPageTemplateFile of None>¶
-
title
= u'Create document'¶
-
update
(obj)¶ Update the object and returns the modified fields and errors
-
user
¶ The currently authenticated ploneintranet user profile (if any)
-
validate
()¶ Validate input and return a truish
-
workspace_container
¶ Return the workspace container
-
-
class
ploneintranet.workspace.browser.add_content.
AddContent
(context, request)¶ Bases:
ploneintranet.workspace.browser.add_content.AddBase
-
tabs
= [{'css_class': 'icon-doc-text current', 'id': 'sheet-text', 'label': u'Rich text'}, {'css_class': 'icon-file-image', 'id': 'sheet-image', 'label': u'Image'}, {'css_class': 'icon-video', 'label': u'Video', 'id': 'sheet-video', 'is_formless': True}]¶
-
-
class
ploneintranet.workspace.browser.add_content.
AddEvent
(context, request)¶ Bases:
ploneintranet.workspace.browser.add_content.AddBase
-
_add_calendar_tab
= {'css_class': 'icon-calendar-1', 'id': 'sheet-calendar', 'label': u'Calendar'}¶
-
_add_event_tab
= {'css_class': 'icon-calendar', 'id': 'sheet-event', 'label': u'Event'}¶
-
_form_data_pat_inject_parts
¶ Returns the correct dpi config
-
app_calendar_view
¶
-
calendar_container
¶
-
can_add_calendars
(*args, **kwargs)¶
-
can_add_events
(*args, **kwargs)¶ Check if we can add events. Start first checking the current context and then see if we can add them somewhere else
-
default_datetime
¶ Return the default date (the requested one or now)
The request may come from several sources, e.g.:
- from the sidebar
- from the calendar month view
- from the calendar day and week views
Each of this cases may have a date parameter in different formats. We try to convert it to a DateTime.
-
default_end
¶ Like default_start, but add a time interval (in hours)
We will have a ‘T’ in the request parameter if the request comes from the day or the week calendar view
-
default_start
¶ The rounded default_datetime.
-
fix_start_end
()¶ If the start date is lower than the end one, modify the request setting end = start + 1 hour
-
get_selection_classes
(field, default=None)¶ identify all groups in the invitees
-
intranet_users_group_id
= 'All Intranet Users'¶
-
redirect
(url)¶ Try to find the proper redirect context.
-
round_date
(dt)¶ Round the datetime minutes and seconds to the next quarter, i.e. ‘2000/01/01 00:35:21’ becomes ‘2000/01/01 00:30:00’
-
tabs
¶
-
template
= <BoundPageTemplateFile of None>¶
-
title
= u'Create event'¶
-
validate
()¶ Override base content validation
Return truish if valid
-
-
class
ploneintranet.workspace.browser.add_content.
AddFolder
(context, request)¶ Bases:
ploneintranet.workspace.browser.add_content.AddBase
-
_form_data_pat_inject_parts
= ('#workspace-documents', 'nav.breadcrumbs')¶
-
template
= <BoundPageTemplateFile of None>¶
-
title
= u'Create folder'¶
-
-
class
ploneintranet.workspace.browser.add_content.
AddLink
(context, request)¶ Bases:
ploneintranet.workspace.browser.add_content.AddBase
The add link view
-
extra_fields
()¶ BBB: this should be done in a cleaner way…
-
form_input_title_placeholder
= u'Link name'¶
-
form_portal_type
= 'Link'¶
-
template
= <BoundPageTemplateFile of None>¶
-
title
= u'Create link'¶
-
-
class
ploneintranet.workspace.browser.add_content.
EditCalendar
(context, request)¶ Bases:
ploneintranet.workspace.browser.add_content.AddEvent
-
template
= <BoundPageTemplateFile of None>¶
-
title
= u'Edit calendar'¶
-
-
class
ploneintranet.workspace.browser.add_content.
EditEvent
(context, request)¶ Bases:
ploneintranet.workspace.basecontent.event.EventView
,ploneintranet.workspace.browser.add_content.AddEvent
Base class for editing events
-
is_add_form
= False¶
-
template
= <BoundPageTemplateFile of None>¶
-
title
= u'Edit event'¶
-
ploneintranet.workspace.browser.forms module¶
-
interface
ploneintranet.workspace.browser.forms.
IInviteForm
¶ Bases:
plone.supermodel.model.Schema
invite form schema
-
message
= <zope.schema._bootstrapfields.Text object>¶ Message
-
user
= <zope.schema._bootstrapfields.TextLine object>¶ User
-
-
interface
ploneintranet.workspace.browser.forms.
ITransferMembershipForm
¶ Bases:
plone.supermodel.model.Schema
the form to handle transferring membership
-
move
= <zope.schema._bootstrapfields.Bool object>¶ Move
If checked, users will be removed from workspace
-
workspace
= <zope.schema._field.Choice object>¶ Select workspace
-
-
class
ploneintranet.workspace.browser.forms.
InviteForm
(context, request)¶ Bases:
plone.autoform.form.AutoExtensibleForm
,z3c.form.form.Form
handle invite form submission
-
handleApply
= <Handler for <Button 'ok' u'Ok'>>¶
-
handlers
= <Handlers [<Handler for <Button 'ok' u'Ok'>>]>¶
-
ignoreContext
= True¶
-
label
= u'invititations'¶
-
schema
¶ alias of
IInviteForm
-
-
class
ploneintranet.workspace.browser.forms.
TransferMembershipForm
(context, request)¶ Bases:
plone.autoform.form.AutoExtensibleForm
,z3c.form.form.Form
handle transfer membership form submission
-
handleApply
= <Handler for <Button 'ok' u'Ok'>>¶
-
handlers
= <Handlers [<Handler for <Button 'ok' u'Ok'>>]>¶
-
ignoreContext
= True¶
-
label
= u'Transfer membership'¶
-
schema
¶ alias of
ITransferMembershipForm
-
-
ploneintranet.workspace.browser.forms.
user_has_email
(userid)¶ make sure, that given user has an email associated
-
ploneintranet.workspace.browser.forms.
workspaces_provider
(context)¶ create a vocab of all workspaces in this site
ploneintranet.workspace.browser.portlets module¶
ploneintranet.workspace.browser.roster module¶
-
class
ploneintranet.workspace.browser.roster.
WorkspaceChangeRole
(context, request)¶ Bases:
ploneintranet.workspace.browser.workspace.BaseWorkspaceView
A modal for changing the roles of users
-
roles
()¶
-
-
class
ploneintranet.workspace.browser.roster.
WorkspaceMemberPicker
(context, request)¶ Bases:
ploneintranet.workspace.browser.workspace.BaseWorkspaceView
A modal with a user picker to select new members
ploneintranet.workspace.browser.viewlets module¶
-
class
ploneintranet.workspace.browser.viewlets.
JoinViewlet
(context, request, view, manager=None)¶ Bases:
plone.app.layout.viewlets.common.ViewletBase
Allows users to join a self-joining workspace
-
in_workspace
()¶ Are we currently in a workspace?
-
join_url
()¶ Get url of the join action
-
visible
()¶ Join viewlet is shown if: * In a ‘self-join’ workspace * User is not already a member
-
-
class
ploneintranet.workspace.browser.viewlets.
SharingViewlet
(context, request, view, manager=None)¶ Bases:
plone.app.layout.viewlets.common.ViewletBase
Provides information about the default policy when viewing the sharing tab on a workspace.
-
active_participant_policy
()¶ Get the title of the current participation policy
-
visible
()¶ Only shown on the sharing view
-
ploneintranet.workspace.browser.views module¶
-
class
ploneintranet.workspace.browser.views.
ContentHistoryView
(context, request)¶ Bases:
plone.app.layout.viewlets.content.ContentHistoryView
Customised so that we can provide more info about the revisions in our history.
-
revisionHistory
()¶
-
-
class
ploneintranet.workspace.browser.views.
FileUploadView
(context, request)¶ Bases:
plone.app.content.browser.file.FileUploadView
Redirect to the workspace view so we can inject.
-
create_dx_file
(filename, content_type, filedata, portal_type)¶ Inspired by plone.app.dexterity.factories.IDXFileFactory
-
create_file_from_request
(name)¶
-
groupname
¶ Return the groupname
-
post_factory
(obj)¶ Things to do after the object has been created in this form
-
process_request
()¶
-
set_filedata
(obj, filedata, filename, content_type)¶ Try to understand what is the primary field and store the data there
-
-
interface
ploneintranet.workspace.browser.views.
IObjectUploadedEvent
¶ Bases:
zope.interface.interfaces.IObjectEvent
An object has been uploaded
-
object
= <zope.interface.interface.Attribute object>¶ The subject of the event.
-
-
class
ploneintranet.workspace.browser.views.
JoinView
(context, request)¶ Bases:
Products.Five.browser.BrowserView
adds a user to the team on a self-join workspace
-
class
ploneintranet.workspace.browser.views.
ObjectUploadedEvent
(object)¶ Bases:
zope.interface.interfaces.ObjectEvent
An object has been uploaded
-
class
ploneintranet.workspace.browser.views.
RenderMarkdown
(context, request)¶ Bases:
Products.Five.browser.BrowserView
-
autosave_enabled
¶ Look up the registry to check if autosave should be enabled for this portal_type
-
-
class
ploneintranet.workspace.browser.views.
SharingView
(context, request)¶ Bases:
plone.app.workflow.browser.sharing.SharingView
override the sharing tab
-
can_edit_inherit
()¶ Disable “inherit permissions” checkbox
-
role_settings
()¶ Filter out unwanted to show groups
-
user_search_results
()¶ Add [member] to a user title if user is a member of current workspace
-
ploneintranet.workspace.browser.workspace module¶
-
class
ploneintranet.workspace.browser.workspace.
AllGroupsGlobalJSONView
(context, request)¶ Bases:
Products.Five.browser.BrowserView
Return a filtered list of groups for pat-autosuggest. Any group can be found, not only members of the current workspace
-
class
ploneintranet.workspace.browser.workspace.
AllGroupsJSONView
(context, request)¶ Bases:
Products.Five.browser.BrowserView
Return all groups in JSON for use in picker TODO: consolidate AllGroupsJSONView with AllUsersJSONView
-
get_groups
()¶ Return all the groups
-
only_membrane_groups
¶
-
-
class
ploneintranet.workspace.browser.workspace.
AllUsersAndGroupsJSONView
(context, request)¶ Bases:
Products.Five.browser.BrowserView
-
class
ploneintranet.workspace.browser.workspace.
AllUsersJSONView
(context, request)¶ Bases:
Products.Five.browser.BrowserView
Return a filtered list of users for pat-autosuggest. Any user can be found, not only members of the current workspace
-
class
ploneintranet.workspace.browser.workspace.
BaseWorkspaceView
(context, request)¶ Bases:
Products.Five.browser.BrowserView
Base view class for workspace related view
-
can_add_status_updates
(*args, **kwargs)¶ Does this user have the permission to add status updates
-
can_add_users
(*args, **kwargs)¶ Does this user have permission to add other members to this workspace? 1. A user who can edit the roster will always have this permission.
This is usually the workspace admin.- On a team-managed workspace, any member of the team will have this permission.
-
can_manage_roster
(*args, **kwargs)¶ does this user have permission to manage the workspace’s roster
-
can_manage_workspace
(*args, **kwargs)¶ does this user have permission to manage the workspace
-
division_classes
¶ if workspace has a division, return workspace-division-<id> if workspace is a division, additionally return workspace-division-name-<id>
-
get_principal_description
(*args, **kwargs)¶ Get the description for this principal
-
get_principal_information
(*args, **kwargs)¶ Get the information about number of users and groups for this principal
-
get_principal_roles
(*args, **kwargs)¶ Get the human readable policy role title for this principal as a list of one element (e.g. [u’Consume’]).
If omit_default_policy_role is True (the default value), the default role for the policy is skipped and an empty list is returned.
-
get_principal_title
(*args, **kwargs)¶ Get the title for this principal
-
get_principal_url
(principal)¶ Get a suitable URL for viewing this principal
Resolve the related workspaces brains
-
get_sorted_principals
(sort_by='last_name')¶
-
get_workspace_security_icon
()¶ We have an icon that display the security status of the workspace
-
groupids_key_mapping
¶ Return the set of the group ids knows by portal_groups
-
groups_container
¶ Returns the group container (if found) or an empty dictionary
-
guest_ids
¶ Get the valid member ids through IWorkspace
-
guests
(*args, **kwargs)¶ Return the list of principals which are guests in this context By design they are assigned through the sharing view
-
include_clicktracker
¶
-
is_ajax
¶
-
member_ids
¶ Get the valid member ids through IWorkspace
-
percent_complete
(*args, **kwargs)¶ Return the percentage of completed tasks as text, e.g. 33%
-
principal_sorting_key
(principal)¶ First we want the groups, the we want alphabetical sorting
-
principals
¶ Return the list of principals which are assigned to this context
-
resolve_principalid
(*args, **kwargs)¶ Given a principal id, tries to get him for profile or groups folder and then look for him with pas.
-
show_activity_stream
¶
-
subspaces_qs
()¶ Prepare the right query string to show subspaces
-
superspace
¶ Return the associated superspace object
-
task_brains
¶
-
task_objs
¶
-
tasks
(*args, **kwargs)¶ Get the context tasks
-
users_container
¶ Returns the group container (if found) or an empty dictionary
-
workspace
(*args, **kwargs)¶ Acquire the root workspace of the current context
-
workspaces_container
¶ Returns the workspaces container (if found) or an empty dictionary
-
workspaces_container_keys
¶ Return the set of workspace ids known by the toplevel workspaces container
-
-
class
ploneintranet.workspace.browser.workspace.
BrainToGroupAdapter
(context)¶ Bases:
object
Make a brain behave like a group
-
getId
()¶ Return this group id
-
getProperty
(key, fallback='')¶ Mimic getProperty, remapping some keys
-
-
class
ploneintranet.workspace.browser.workspace.
RelatedWorkspacesJSONView
(context, request)¶ Bases:
ploneintranet.workspace.browser.workspace.WorkspacesJSONView
Return a filtered list of workspaces for pat-autosuggest. Current workspace and its related workspaces are excluded.
-
get_skip
()¶
-
-
class
ploneintranet.workspace.browser.workspace.
ReorderTags
(context, request)¶ Bases:
Products.Five.browser.BrowserView
Lets the workspace manager re-order the tags inside a workspace
-
class
ploneintranet.workspace.browser.workspace.
SuperspaceView
(context, request)¶ Bases:
ploneintranet.workspace.browser.workspace.BaseWorkspaceView
Default View of the superspace
-
allowed_parent_superspaces
¶ Return the list of superspaces that can be selected as a parent superspace of the current superspace. Discard the current superspace itself and all its children.
-
container_view
¶
-
do_post
()¶ Do something when the user is posting
-
has_subspaces
(*args, **kwargs)¶ Check if this object has subspace, even hidden ones
-
subspaces
¶
-
-
class
ploneintranet.workspace.browser.workspace.
WorkspaceCalendarView
(context, request)¶ Bases:
ploneintranet.workspace.browser.workspace.BaseWorkspaceView
Wrapper to include the fullcalendar tile on workspaces
-
class
ploneintranet.workspace.browser.workspace.
WorkspaceMembersJSONView
(context, request)¶ Bases:
Products.Five.browser.BrowserView
Return workspace members in JSON for use with pat-autosuggest. Only members of the current workspace are found.
-
class
ploneintranet.workspace.browser.workspace.
WorkspaceVideoConferenceView
(context, request)¶ Bases:
ploneintranet.workspace.browser.workspace.BaseWorkspaceView
Wrapper to include the video conference view in a workspace
-
video_url
¶ The URL of the video meeting
-
-
class
ploneintranet.workspace.browser.workspace.
WorkspaceView
(context, request)¶ Bases:
ploneintranet.workspace.browser.workspace.BaseWorkspaceView
Default View of the workspace
-
class
ploneintranet.workspace.browser.workspace.
WorkspacesJSONView
(context, request)¶ Bases:
Products.Five.browser.BrowserView
Return a filtered list of workspaces for pat-autosuggest. Any workspace can be found.
-
get_filters
()¶
-
get_skip
()¶
-
-
ploneintranet.workspace.browser.workspace.
format_users_json
(users)¶ Format a list of users as JSON for use with pat-autosuggest
Parameters: users (list) – A list of user brains Rtype string: JSON {“user_id1”: “user_title1”, …}
-
ploneintranet.workspace.browser.workspace.
format_workspaces_json
(workspaces, skip=[])¶ Format a list of workspaces as JSON for use with pat-autosuggest
Parameters: - workspaces (list) – A list of brains
- skip (lis) – A list of UIDs to skip
Rtype string: JSON {“ws_id1”: “ws_title1”, …}