ploneintranet.workspace.browser.tiles package¶
Submodules¶
ploneintranet.workspace.browser.tiles.sidebar module¶
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…
Performs a simple save of entered attributes. Not all sidebars need this
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.
Is this user allowed to change a label, and can the label be edited?
Is this user allowed to delete an object?
Is this user allowed to add content?
Check if we see the subscribe feature in the bulk actions
Return the current authenticated user id
Return the current authenticated user id
The content items in the sidebar have a DateTime as their modification date. But search results have a datetime.
Override this one: the default can be set in the site settings, per context, per user or whatever
Get the default grouping for document navigation in the sidebar
Fills the start parameter of the search query, i.e. the first element of the batch
Options to set the sidebar grouping
Check if the current document is in the trash can
Get page number for next page of search results
Get url for the next page of results
Notify errors upon save
Notify success
Get current page number from the request
The root object for the sidebar, typically a workspace, but the sidebar can also be used for apps, e.g. quaive.app.slides.
Override this one: the selected value can be set in in the context, in the user or whatever
The site default grouping as specified in the registry
Returns status messages if any
Acquire the workspace of the current context
Acquire the workspace of the current context
Bases:
ploneintranet.workspace.browser.tiles.sidebar.BaseTile
A view to serve as a sidebar navigation for workspaces
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
Transform a catalog query into a solr query
XXX: This is a compatibility method that has to die. Use it at your own risk
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
Tell if we should show archived documents or not
Tell if we should show archived tags or not
This is the base query for searching inside a workspace
Helper method to return a value from either request or fallback to cookie
Return all the children for the selected grouping and grouping value
Get the children from the given label
Get the grouping from the grouping storage given a name If no name is given default to the one returned by self.get_groupings()
Return the whole grouping storage
Return the entries according to a particular grouping (e.g. label, author, type, first_letter)
The classes that we should apply to the item
item can be a dictionary or a search result
Item data-pat-inject options
Item data-pat-switch options
Try to get the item portal_type for every possible thing that arrives here (a dict, a brain, a search result, …)
Item url
Return the homonymous method from the workspace view
Return the url for this group
First look in the request, then in the ws annotations, then return the default (for the ws or the site)
Return the user selected grouping value
Check if this item is folderish
- 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)
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)
Needed for the back button in the sidebar. Depending on the selected grouping, this returns the information needed to get one step back.
Return all the documents in the group for the given query
Make a result out of an item, item should be a dict
Check if the user asked for a new grouping and persist his choice in the workspace annotations
Return the user selected sorting
Get the values in grouping
name is something like: ‘label’, ‘author’, … value is something like ‘tag1’, ‘john.doe’, …
Update the query with the values from show_extra cookie
Item url
Bases:
ploneintranet.workspace.browser.tiles.sidebar.SidebarDocuments
The document sidedar contents
XXX: This is not really smart but it is needed because we cannot always rely on solr for batching things
Bases:
ploneintranet.workspace.browser.tiles.sidebar.SidebarEvents
Customized tile that shows only the content in the event sidebar
Valid values are upcoming or older
Depending on the event_category request parameter return upcoming or older events
Bases:
ploneintranet.workspace.browser.tiles.sidebar.SidebarTrash
The trash sidebar items
Bases:
ploneintranet.workspace.browser.tiles.sidebar.Sidebar
Customized tile that shows only the Documents
Check if we should activate the autotag feature on the bulk uploaded files
Return the label (aka tag or subject) that we are exploring
In the settings the default is defined in the registry
In the document sidebar this is probably in the request or in the user preferences
The trash will be shown only when browsing by folder and at the workspace root
Bases:
ploneintranet.workspace.browser.tiles.sidebar.Sidebar
Customized tile that shows only the Events
Return the events in this workspace to be shown in the events section of the sidebar
This is the base query for searching inside a workspace
This one will not return any item
Bases:
ploneintranet.workspace.browser.tiles.sidebar.SidebarDocuments
The document sidedar contents
Reuse the cart-paste homonymous method
Bases:
ploneintranet.workspace.browser.tiles.sidebar.BaseTile
A view to serve as the advanced config in the sidebar
Check if this object can be a division, i.e. has a division field in the schema or in a behavior
In the settings the default is defined in the registry
return available divisions
identify all groups in the invitees
This is triggered when the remote admin is changed.
In that case we need to reindex the allowedRolesAndUsers
In the settings the selected grouping is stored in the root
Get old relations and new relations and update the targets to point to self.context.
Bases:
ploneintranet.workspace.browser.tiles.sidebar.BaseTile
A view to serve as the member roster in the sidebar
Check if we should display this principal
We do not want to display the “All intranet user group” if he has no particular roles
Bases:
ploneintranet.workspace.browser.tiles.sidebar.Sidebar
Customized tile that shows only the Todos
Bases:
ploneintranet.workspace.browser.tiles.sidebar.SidebarDocuments
The trash sidebar
The trash items contained in this workspace
Needed to render the back button to a normal sidebar
ploneintranet.workspace.browser.tiles.workspace_tabs module¶
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
-