ploneintranet.workspace.browser.tiles package

Submodules

ploneintranet.workspace.browser.tiles.navigation module

interface ploneintranet.workspace.browser.tiles.navigation.INavigationTile

Bases: zope.interface.Interface

Marker interface for the navigation tile

class ploneintranet.workspace.browser.tiles.navigation.NavigationTile(context, request)

Bases: plone.tiles.tile.Tile

index = <BoundPageTemplateFile of None>
items()
render()
class ploneintranet.workspace.browser.tiles.navigation.WorkspaceQueryBuilder(context, root)

Bases: Products.CMFPlone.browser.navtree.SitemapQueryBuilder

ploneintranet.workspace.browser.tiles.sidebar module

class ploneintranet.workspace.browser.tiles.sidebar.BaseTile(context, request)

Bases: zope.publisher.browser.BrowserView

Shared baseclass for the sidebar tiles.

Cave: many of the actual sidebar templates also bind to ploneintranet.workspace.browser.workspace.WorkspaceView to use methods defined there…

_basic_save()

Performs a simple save of entered attributes. Not all sidebars need this

_batch_size = 20
_grouping_options = [{'value': 'folder', 'title': u'label_grouping_short_folder'}, {'value': 'label', 'title': u'label_grouping_short_tag'}, {'value': 'type', 'title': u'label_grouping_short_document_type'}, {'value': 'author', 'title': u'label_grouping_short_author'}, {'value': 'date', 'title': u'label_grouping_short_date'}, {'value': 'first_letter', 'title': u'label_grouping_short_first_letter'}]
_user_groupings_key = 'ploneintranet.workspace.user_groupings'
can_add()

Is this user allowed to add content? Cave. We don’t use the plone.app.contenttypes per-type permissions. Our workflows don’t map those, only cmf.AddPortalContent.

can_change_label()

Is this user allowed to change a label, and can the label be edited?

can_delete(obj=None)

Is this user allowed to delete an object?

can_edit()

Is this user allowed to add content?

can_subscribe()

Check if we see the subscribe feature in the bulk actions

current_user

Return the current authenticated user id

current_userid

Return the current authenticated user id

date_as_datetime(date)

The content items in the sidebar have a DateTime as their modification date. But search results have a datetime.

default_grouping_option

Override this one: the default can be set in the site settings, per context, per user or whatever

form_submitted = False
general_settings_autoload = 'trigger: autoload;'
get_default_grouping(*args, **kwargs)

Get the default grouping for document navigation in the sidebar

get_query_start()

Fills the start parameter of the search query, i.e. the first element of the batch

grouping_options

Options to set the sidebar grouping

index = None
is_trashed

Check if the current document is in the trash can

next_page_number()

Get page number for next page of search results

next_page_url()

Get url for the next page of results

notify_errors(errors)

Notify errors upon save

notify_success()

Notify success

page_number()

Get current page number from the request

render()
root

The root object for the sidebar, typically a workspace, but the sidebar can also be used for apps, e.g. quaive.app.slides.

selected_grouping_option

Override this one: the selected value can be set in in the context, in the user or whatever

site_default_grouping

The site default grouping as specified in the registry

status_messages()

Returns status messages if any

workspace(*args, **kwargs)

Acquire the workspace of the current context

workspace_view

Acquire the workspace of the current context

class ploneintranet.workspace.browser.tiles.sidebar.Sidebar(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.BaseTile

A view to serve as a sidebar navigation for workspaces

_extract_attrs(catalog_results)

The items to show in the sidebar may come from the current folder or a grouping storage for quick access. If they come from the current folder, the brains get converted to the same data structure as used in the grouping storage to allow unified handling. This extracts the attributes from brains and returns dicts

_make_solr_query(query)

Transform a catalog query into a solr query

XXX: This is a compatibility method that has to die. Use it at your own risk

_maybe_resort(results)

Make sure we first show the group-elements (= folders or similar) before any content items Note: since False==0, it gets sorted before True!

XXX: This has to go away if we want to implement proper batching

archived_documents_shown()

Tell if we should show archived documents or not

archived_tags_shown()

Tell if we should show archived tags or not

blacklisted_item_types
drop_files_label = u'drop_files_here'
folderish_types
get_base_query()

This is the base query for searching inside a workspace

Helper method to return a value from either request or fallback to cookie

get_group_children()

Return all the children for the selected grouping and grouping value

get_group_children_by_date()
get_group_children_by_label()

Get the children from the given label

get_group_children_by_type()
get_grouping_by_name(name=None)

Get the grouping from the grouping storage given a name If no name is given default to the one returned by self.get_groupings()

get_groupings()

Return the whole grouping storage

get_headers_for_group()

Return the entries according to a particular grouping (e.g. label, author, type, first_letter)

get_item_class(item)

The classes that we should apply to the item

item can be a dictionary or a search result

get_item_dpi(item)

Item data-pat-inject options

get_item_dps(item)

Item data-pat-switch options

get_item_portal_type(item)

Try to get the item portal_type for every possible thing that arrives here (a dict, a brain, a search result, …)

get_item_url(item)

Item url

get_principal_title

Return the homonymous method from the workspace view

group_url(groupname)

Return the url for this group

grouping(*args, **kwargs)

First look in the request, then in the ws annotations, then return the default (for the ws or the site)

grouping_value(*args, **kwargs)

Return the user selected grouping value

index = <BoundPageTemplateFile of None>
is_folderish(*args, **kwargs)

Check if this item is folderish

item2ctype(item)
We have an item coming from of one of those two methods:
  • self._extract_attrs
  • self.get_headers_for_group

We try to return its ctype (content type)

items(*args, **kwargs)

This is called in the template and returns a list of dicts of items in the current context. It returns the items based on the selected grouping (and later may take sorting, archiving etc into account)

logical_parent()

Needed for the back button in the sidebar. Depending on the selected grouping, this returns the information needed to get one step back.

portal_types_filter
query_items(additional_query={})

Return all the documents in the group for the given query

result2item(result)

Make a result out of an item, item should be a dict

section = 'documents'
set_grouping_choice()

Check if the user asked for a new grouping and persist his choice in the workspace annotations

show_extra
sorting()

Return the user selected sorting

uids_in_grouping(name, value)

Get the values in grouping

name is something like: ‘label’, ‘author’, … value is something like ‘tag1’, ‘john.doe’, …

update_with_show_extra(query)

Update the query with the values from show_extra cookie

view_types

Item url

class ploneintranet.workspace.browser.tiles.sidebar.SidebarContentDocuments(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.SidebarDocuments

The document sidedar contents

batched_items(*args, **kwargs)

XXX: This is not really smart but it is needed because we cannot always rely on solr for batching things

index = <BoundPageTemplateFile of None>
class ploneintranet.workspace.browser.tiles.sidebar.SidebarContentEvents(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.SidebarEvents

Customized tile that shows only the content in the event sidebar

_batch_size = 20
category

Valid values are upcoming or older

index = <BoundPageTemplateFile of None>
items(*args, **kwargs)

Depending on the event_category request parameter return upcoming or older events

class ploneintranet.workspace.browser.tiles.sidebar.SidebarContentTrash(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.SidebarTrash

The trash sidebar items

index = <BoundPageTemplateFile of None>
class ploneintranet.workspace.browser.tiles.sidebar.SidebarDocuments(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.Sidebar

Customized tile that shows only the Documents

autotag_bulk_uploaded

Check if we should activate the autotag feature on the bulk uploaded files

bulk_upload_url
can_slides = True
current_label

Return the label (aka tag or subject) that we are exploring

default_grouping_option

In the settings the default is defined in the registry

index = <BoundPageTemplateFile of None>
selected_grouping_option

In the document sidebar this is probably in the request or in the user preferences

show_trash_item

The trash will be shown only when browsing by folder and at the workspace root

class ploneintranet.workspace.browser.tiles.sidebar.SidebarEvents(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.Sidebar

Customized tile that shows only the Events

events()

Return the events in this workspace to be shown in the events section of the sidebar

get_base_query()

This is the base query for searching inside a workspace

index = <BoundPageTemplateFile of None>
items(*args, **kwargs)

This one will not return any item

class ploneintranet.workspace.browser.tiles.sidebar.SidebarPaste(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.SidebarDocuments

The document sidedar contents

do_paste()

Reuse the cart-paste homonymous method

class ploneintranet.workspace.browser.tiles.sidebar.SidebarSettingsAdvanced(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.BaseTile

A view to serve as the advanced config in the sidebar

can_be_division()

Check if this object can be a division, i.e. has a division field in the schema or in a behavior

can_delete_workspace()
default_grouping_option

In the settings the default is defined in the registry

divisions()

return available divisions

get_selection_classes(field, default=None)

identify all groups in the invitees

index = <BoundPageTemplateFile of None>
maybe_trigger_allowed_roles_and_user_reindex(modified)

This is triggered when the remote admin is changed.

In that case we need to reindex the allowedRolesAndUsers

selected_grouping_option

In the settings the selected grouping is stored in the root

update_relation_targets(old_relations)

Get old relations and new relations and update the targets to point to self.context.

class ploneintranet.workspace.browser.tiles.sidebar.SidebarSettingsGeneral(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.BaseTile

index = <BoundPageTemplateFile of None>
class ploneintranet.workspace.browser.tiles.sidebar.SidebarSettingsMembers(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.BaseTile

A view to serve as the member roster in the sidebar

describe_permissions()
display_principal(principal)

Check if we should display this principal

We do not want to display the “All intranet user group” if he has no particular roles

execute_batch_function()
index = <BoundPageTemplateFile of None>
class ploneintranet.workspace.browser.tiles.sidebar.SidebarTodos(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.Sidebar

Customized tile that shows only the Todos

index = <BoundPageTemplateFile of None>
class ploneintranet.workspace.browser.tiles.sidebar.SidebarTrash(context, request)

Bases: ploneintranet.workspace.browser.tiles.sidebar.SidebarDocuments

The trash sidebar

batched_items()
items(*args, **kwargs)

The trash items contained in this workspace

logical_parent()

Needed to render the back button to a normal sidebar

show_trash_item = False

ploneintranet.workspace.browser.tiles.workspace_tabs module

class ploneintranet.workspace.browser.tiles.workspace_tabs.WorkspaceTabsTile(context, request)

Bases: plone.tiles.tile.Tile

has_video_conference()
index = <BoundPageTemplateFile of None>
workspace(*args, **kwargs)

ploneintranet.workspace.browser.tiles.workspaces module

class ploneintranet.workspace.browser.tiles.workspaces.AdaptableWSDict(ws_dict)

Bases: object

UID()
absolute_url()
class ploneintranet.workspace.browser.tiles.workspaces.WorkspaceTile(context, request)

Bases: plone.tiles.tile.Tile

_division_ids
can_view()

Check if the user can actually view this tile

If it is a search result, check for the absolute_url, otherwise check if the user has the view permission on the context

get_css_classes()

Return the css classes for this tile

index = <BoundPageTemplateFile of None>
is_expandable(*args, **kwargs)

Check if the tile can be expanded to show subspaces

is_superspace(*args, **kwargs)
plone_view
shorten(text, length=60)
subspace_uids(*args, **kwargs)

A subspace has a superspace assigned to it.

superspace_overview_url(*args, **kwargs)

Format the qs for superspaces in order to properly expand the tile

superspace_qs(*args, **kwargs)

Format the qs for superspaces in order to properly expand the tile

tile_uid

return the tile uid

workspace_type

Return, if found the workspace type mapping

workspace_type_mapping
workspaces_view

Return the workspace container view

class ploneintranet.workspace.browser.tiles.workspaces.WorkspaceTileSmall(context, request)

Bases: ploneintranet.workspace.browser.tiles.workspaces.WorkspaceTile

index = <BoundPageTemplateFile of None>
class ploneintranet.workspace.browser.tiles.workspaces.WorkspacesTile(context, request)

Bases: plone.tiles.tile.Tile

available_workspace_types

The workspace types defined in the registry

index = <BoundPageTemplateFile of None>
shorten(text, length=60)
title

The tile title. If we have an homonymous request parameter, use it Otherwise return a default based on the workspace type

workspace_container

The object we are looking workspaces in

workspace_type

A tile should show either Workspacefolders or Cases, not both.

workspaces(*args, **kwargs)

The list of my workspaces

workspaces_url

The URL to get to the workspaces overview

Add the workspace_type parameter if it is a string

Module contents