API methods and descriptions#

api.addon#

api.addon.AddonInformation

Add-on information.

api.addon.NonInstallableAddons

Set of add-ons not available for installation.

api.addon.get(addon)

Information about an Add-on.

api.addon.get_addon_ids([limit])

List add-ons ids in this Plone site.

api.addon.get_addons([limit])

List add-ons in this Plone site.

api.addon.get_version(addon)

Return the version of the product (package).

api.addon.install(addon)

Install an add-on.

api.addon.uninstall(addon)

Uninstall an add-on.

api.content#

api.content.copy(source[, target, id, safe_id])

Copy the object to the target container.

api.content.create(container, type[, id, ...])

Create a new content item.

api.content.delete([obj, objects, ...])

Delete the object(s).

api.content.disable_roles_acquisition(obj)

Disable acquisition of local roles on given obj.

api.content.enable_roles_acquisition(obj)

Enable acquisition of local roles on given obj.

api.content.find([context, depth, unrestricted])

Find content in the portal.

api.content.get([path, UID])

Get an object.

api.content.get_closest_ancestor(obj[, ...])

Get the closest ancestor that matches the criteria.

api.content.get_state(obj[, default])

Get the current workflow state of the object.

api.content.get_uuid(obj)

Get the object's Universally Unique IDentifier (UUID).

api.content.get_view(name, context[, request])

Get a BrowserView object.

api.content.get_path(obj[, relative])

Get the path of an object.

api.content.get_state(obj[, default])

Get the current workflow state of the object.

api.content.get_uuid(obj)

Get the object's Universally Unique IDentifier (UUID).

api.content.get_view(name, context[, request])

Get a BrowserView object.

api.content.iter_ancestors(obj[, function, ...])

Iterate over the object ancestors.

api.content.move(source[, target, id, safe_id])

Move the object to the target container.

api.content.rename(obj, new_id[, safe_id])

Rename the object.

api.content.transition(obj[, transition, ...])

Perform a workflow transition.

api.env#

api.env.adopt_roles([roles])

Context manager for temporarily switching roles.

api.env.adopt_user([username, user])

Context manager for temporarily switching user inside a block.

api.env.debug_mode()

Return True if your zope instance is running in debug mode.

api.env.plone_version()

Return Plone version number.

api.env.read_only_mode()

Check if the Zope instance is running on a read-only ZODB.

api.env.test_mode()

Returns True if you are running the zope test runner.

api.env.zope_version()

Return Zope 2 version number.

api.exc#

api.exc.CannotGetPortalError

Raised when the portal object cannot be retrieved.

api.exc.GroupNotFoundError

Raised when a specified or implicit group can not be retrieved.

api.exc.InvalidParameterError

Raised when a parameter is invalid.

api.exc.MissingParameterError

Raised when a parameter is missing.

api.exc.PloneApiError

Base exception class for plone.api errors.

api.exc.UserNotFoundError

Raised when a specified or implicit user can not be retrieved.

api.group#

api.group.add_user([groupname, group, ...])

Add the user to a group.

api.group.create(groupname[, title, ...])

Create a group.

api.group.delete([groupname, group])

Delete a group.

api.group.get(groupname)

Get a group.

api.group.get_groups([username, user])

Get all groups or all groups filtered by user.

api.group.get_roles([groupname, group, obj, ...])

Get group's site-wide or local roles.

api.group.grant_roles([groupname, group, ...])

Grant roles to a group.

api.group.remove_user([groupname, group, ...])

Remove the user from a group.

api.group.revoke_roles([groupname, group, ...])

Revoke roles from a group.

api.portal#

api.portal.get()

Get the Plone portal object out of thin air.

api.portal.get_current_language([context])

Return the current negotiated language.

api.portal.get_default_language()

Return the default language.

api.portal.get_localized_time(datetime[, ...])

Display a date/time in a user-friendly way.

api.portal.get_navigation_root(context)

Get the navigation root object for the context.

api.portal.get_registry_record(name[, ...])

Get a record value from plone.app.registry.

api.portal.get_tool(name)

Get a portal tool in a simple way.

api.portal.get_vocabulary(name[, context])

Return a vocabulary object with the given name.

api.portal.get_vocabulary_names()

Return a list of vocabulary names.

api.portal.send_email([sender, recipient, ...])

Send an email.

api.portal.set_registry_record(name, value)

Set a record value in the plone.app.registry.

api.portal.show_message(message[, request, type])

Display a status message.

api.portal.translate(msgid[, domain, lang])

Translate a message into a given language.

api.relation#

api.relation.create(source, target, relationship)

Create a relation from source to target using zc.relation.

api.relation.delete([source, target, ...])

Delete relation or relations.

api.relation.get([source, target, ...])

Get specific relations given a source/target/relationship.

api.user#

api.user.create([email, username, password, ...])

Create a user.

api.user.delete([username, user])

Delete a user.

api.user.get([userid, username])

Get a user.

api.user.get_current()

Get the currently logged-in user.

api.user.get_permissions([username, user, obj])

Get user's site-wide or local permissions.

api.user.get_roles([username, user, obj, ...])

Get user's site-wide or local roles.

api.user.get_users([groupname, group])

Get all users or all users filtered by group.

api.user.grant_roles([username, user, obj, ...])

Grant roles to a user.

api.user.has_permission(permission[, ...])

Check whether this user has the given permission.

api.user.is_anonymous()

Check if the currently logged-in user is anonymous.

api.user.revoke_roles([username, user, obj, ...])

Revoke roles from a user.