ecm.portfolio

The ecm.portfolio namespace manages portfolios (German "Mappen"). A portfolio is a cross-user collection of DMS objects, comparable to a favourites list or a working folder. It can be handed over to a recipient and restricted to a single object type.

Method Description

search()

Find portfolios by creator, recipient, subject, creation time or object type.

get()

Read a single portfolio by its ID.

user_favorites()

Resolve the favourites portfolio of a user.

create()

Create a portfolio, optionally with initial content.

delete()

Delete a portfolio by its ID.

delete_for()

Delete a portfolio addressed by recipient and subject.

add_objects()

Put objects into a portfolio, optionally replacing its current content.

remove_objects()

Remove individual objects from a portfolio.

clear_objects()

Remove all objects from a portfolio, keeping the portfolio itself.

1. Return types

ECMPortfolio describes a portfolio, ECMPortfolioObject one of its members.

Field Type Description

id

int

Portfolio ID assigned by the server.

created

datetime | None

Creation time in installation wall clock, see Installation timezone.

creator

str

Login name of the creator.

recipient

str

Login name of the recipient; empty for a portfolio that was not handed over.

subject

str

Title of the portfolio. The backing column holds 32 characters.

object_type_id

int | None

Object type the portfolio is restricted to, otherwise None.

objects

list[ECMPortfolioObject]

Member objects, each with id and type_id.

2. Passing objects

Wherever portfolio members are expected, three notations are accepted: an ECMPortfolioObject, an (id, type_id) pair, and a typed model instance, whose system.id and system.type_id are read.

from ecmind_blue_client.ecm import ECMPortfolioObject

doc = ecm.dms.get(Unittest_DMS_Document, 83)

ecm.portfolio.add_objects(portfolio, [doc])                            # model instance
ecm.portfolio.add_objects(portfolio, [(83, 262144)])                   # pair
ecm.portfolio.add_objects(portfolio, [ECMPortfolioObject(83, 262144)]) # data class

3. Limits of the server API

  • Subject, recipient and object type of an existing portfolio cannot be changed. dms.ModPortfolio only touches the member list, so renaming means deleting and creating anew.

  • There is no job that reads exactly one portfolio; get() is a search restricted to one ID.

  • The five jobs know no permission model for portfolios.

4. Alternative via system fields

The assignment of objects to portfolios lives in the mdrel table and is also visible through the system fields MDMAP_ID, MDOBJ_ID and MDOBJTYPE. To find out which portfolios hold a given document, going through those may be quicker than searching portfolios and scanning their member lists.