diff --git a/docs/about.md b/docs/about.md deleted file mode 100644 index e476b0b7..00000000 --- a/docs/about.md +++ /dev/null @@ -1,144 +0,0 @@ ---- -myst: - html_meta: - "description": "Inspiration for creating an API. Design decisions for an intuitive usage in common development tasks." - "property=og:description": "Inspiration for creating an API. Design decisions for an intuitive usage in common development tasks." - "property=og:title": "About" - "keywords": "inspiration, design decisions, Plone, development, API" ---- - -# About - -## Inspiration - -We want `plone.api` to be developed with [PEP 20](https://peps.python.org/pep-0020/) idioms in mind, in particular: - -> Explicit is better than implicit. -> -> Readability counts. -> -> There should be one—and preferably only one—obvious way to do it. -> -> Now is better than never. -> -> If the implementation is hard to explain, it's a bad idea. -> -> If the implementation is easy to explain, it may be a good idea. - -All contributions to `plone.api` should keep these rules in mind. - -Two libraries are especially inspiring: - -[SQLAlchemy](https://www.sqlalchemy.org/) -: Arguably, the reason for SQLAlchemy's success in the developer community lies as much in its feature set as in the fact that its API is very well-designed, is consistent, explicit, and easy to learn. - -[Requests](https://requests.readthedocs.io/en/latest/) -: If you look at the documentation for this library, or see [the comparison between the urllib2 way and the requests way](https://gist.github.com/kennethreitz/973705), you can see a parallel for Plone regarding the way we *have been* versus the way we *should be* writing code. - At the very least, we should have the option of being able to write such clean code. - -The API provides grouped functional access to otherwise distributed logic in Plone. -This distribution is a result of two historical factors: reuse of CMF- and Zope-methods, and reasonable but hard to remember splits like `acl_users` and `portal_memberdata`. -Methods defined in `plone.api` implement best-practice access to the original distributed APIs. -These methods also provide clear documentation of how best to access Plone APIs directly. - -```{note} -If you doubt those last sentences: -We had five different ways to get the portal root with different edge-cases. -We had three different ways to move an object. -With this in mind, it's obvious that even the simplest Plone tasks can't be documented in a sane way. -``` - -We do not intend to cover all possible use-cases, only the most common. -We will cover the 20% of possible tasks on which we spend 80% of our time. -If you need to do something that `plone.api` does not support, use the underlying APIs directly. -We try to document sensible use cases even when we don't provide APIs for them, though. - -## Design decisions - -### Import and usage style - -API methods are grouped according to what they affect. -For example: -{ref}`chapter-portal`, -{ref}`chapter-content`, -{ref}`chapter-users`, -{ref}`chapter-groups`, -{ref}`chapter-relation` and -{ref}`chapter-env`. -In general, importing and using an API looks something like this: - -% invisible-code-block: python -% -% from plone import api -% api.portal.set_registry_record('plone.use_email_as_login', True) - -```python -from plone import api - -portal = api.portal.get() -catalog = api.portal.get_tool(name="portal_catalog") -user = api.user.create(email='alice@plone.org') -``` - -% invisible-code-block: python -% -% self.assertEqual(portal.__class__.__name__, 'PloneSite') -% self.assertEqual(catalog.__class__.__name__, 'CatalogTool') -% self.assertEqual(user.__class__.__name__, 'MemberData') - -Always import the top-level package -(`from plone import api`) -and then use the module namespace to access the method you want -(`portal = api.portal.get()`). - -All example code should adhere to this style, to encourage one and only one preferred way of consuming API methods. - -### Prefer keyword arguments - -We prefer using keyword arguments to positional arguments. -Example code in `plone.api` will use this style, and we recommend users follow this convention. -For the curious, here are the reasons why: - -1. There will never be any doubt when writing a method whether an argument should be positional or not. - Decision already made. -2. There will never be any doubt when using the API on which argument comes first, or which ones are named/positional. - All arguments are named. -3. When using positional arguments, the method signature is dictated by the underlying implementation - (think required vs. optional arguments). - Named arguments are always optional in Python. - Using keywords allows implementation details to change while the signature is preserved. - In other words, the underlying API code can change substantially but code using it will remain valid. -4. The arguments can all be passed as a dictionary. - -```python -# GOOD -from plone import api -alice = api.user.get(username='alice@plone.org') - -# BAD -from plone.api import user -alice = user.get('alice@plone.org') -``` - -## FAQ - -### Why aren't we using wrappers? - -We could wrap an object (like a user) with an API to make it more usable right now. -That would be an alternative to the convenience methods. - -Unfortunately a wrapper is not the same as the object it wraps, and answering the inevitable questions about this difference would be confusing. Moreover, functionality provided by {mod}`zope.interface` such as annotations would need to be proxied. -This would be extremely difficult, if not impossible. - -It is also important that developers be able to ensure that their tests continue to work even if wrappers were to be deprecated. -Consider the failure lurking behind test code such as this: - -``` -if users['bob'].__class__.__name__ == 'WrappedMemberDataObject': - # do something -``` - -### Why `delete` instead of `remove`? - -- The underlying code uses method names similar to *delete* rather than to *remove*. -- The `CRUD` verb is *delete*, not *remove*. diff --git a/docs/api/content.md b/docs/api/content.md deleted file mode 100644 index be7a6b90..00000000 --- a/docs/api/content.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -myst: - html_meta: - "description": "API methods of module 'content'" - "property=og:description": "API methods of module 'content'" - "property=og:title": "plone.api.content" - "keywords": "Plone, content, development, API" ---- - -(plone-api-content)= - -# `plone.api.content` - -```{eval-rst} -.. automodule:: plone.api.content - :members: -``` diff --git a/docs/api/env.md b/docs/api/env.md deleted file mode 100644 index 13924a66..00000000 --- a/docs/api/env.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -myst: - html_meta: - "description": "API methods of module 'env'" - "property=og:description": "API methods of module 'env'" - "property=og:title": "plone.api.env" - "keywords": "Plone, mode, version, authorization, API, development" ---- - -(plone-api-env)= - -# `plone.api.env` - -```{eval-rst} -.. automodule:: plone.api.env - :members: -``` diff --git a/docs/api/exceptions.md b/docs/api/exceptions.md deleted file mode 100644 index 7a04e374..00000000 --- a/docs/api/exceptions.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -myst: - html_meta: - "description": "Exceptions raised by plone.api methods" - "property=og:description": "Exceptions raised by plone.api methods" - "property=og:title": "plone.api.exc" - "keywords": "exceptions, Plone, API, development" ---- - -(plone-api-errors)= - -# `plone.api.exc` - -```{eval-rst} -.. automodule:: plone.api.exc - :members: -``` diff --git a/docs/api/group.md b/docs/api/group.md deleted file mode 100644 index 5cc30c09..00000000 --- a/docs/api/group.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -myst: - html_meta: - "description": "API methods of module 'group'" - "property=og:description": "API methods of module 'group'" - "property=og:title": "plone.api.group" - "keywords": "groups, users, Plone, development, API" ---- - -(plone-api-group)= - -# `plone.api.group` - -```{eval-rst} -.. automodule:: plone.api.group - :members: -``` diff --git a/docs/api/index.md b/docs/api/index.md deleted file mode 100644 index 4a8727ae..00000000 --- a/docs/api/index.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -myst: - html_meta: - "description": "Overview of the API methods" - "property=og:description": "Overview of the API methods" - "property=og:title": "API methods and descriptions" - "keywords": "Plone, API, methods, development" ---- - -```{eval-rst} -.. currentmodule:: plone -``` - -# API methods and descriptions - -```{toctree} -:maxdepth: 1 -:hidden: true - -portal -content -user -group -env -relation -exceptions -``` - - -## `api.portal` - -```{eval-rst} -.. autosummary:: - - api.portal.get - api.portal.get_navigation_root - api.portal.get_tool - api.portal.get_localized_time - api.portal.send_email - api.portal.show_message - api.portal.get_registry_record - -``` - -## `api.content` - -```{eval-rst} -.. autosummary:: - - api.content.get - api.content.create - api.content.delete - api.content.copy - api.content.move - api.content.rename - api.content.get_uuid - api.content.get_state - api.content.transition - api.content.get_view - -``` - -## `api.user` - -```{eval-rst} -.. autosummary:: - - api.user.get - api.user.create - api.user.delete - api.user.get_current - api.user.is_anonymous - api.user.get_users - api.user.get_roles - api.user.get_permissions - api.user.grant_roles - api.user.revoke_roles - -``` - -## `api.group` - -```{eval-rst} -.. autosummary:: - - api.group.get - api.group.create - api.group.delete - api.group.add_user - api.group.remove_user - api.group.get_groups - api.group.get_roles - api.group.grant_roles - api.group.revoke_roles - -``` - -## `api.env` - -```{eval-rst} -.. autosummary:: - - api.env.adopt_roles - api.env.adopt_user - api.env.debug_mode - api.env.test_mode - -``` - -## `api.relation` - -```{eval-rst} -.. autosummary:: - - api.relation.get - api.relation.create - api.relation.delete - -``` - -## Exceptions and errors - -```{eval-rst} -.. autosummary:: - - api.exc.PloneApiError - api.exc.MissingParameterError - api.exc.InvalidParameterError - api.exc.CannotGetPortalError -``` diff --git a/docs/api/portal.md b/docs/api/portal.md deleted file mode 100644 index e82ed6fd..00000000 --- a/docs/api/portal.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -myst: - html_meta: - "description": "Module that provides various utility methods on the portal level." - "property=og:description": "Module that provides various utility methods on the portal level." - "property=og:title": "plone.api.portal" - "keywords": "development, Plone, global, API, portal, root" ---- - -(plone-api-portal)= - -# `plone.api.portal` - -```{eval-rst} -.. automodule:: plone.api.portal - :members: -``` diff --git a/docs/api/relation.md b/docs/api/relation.md deleted file mode 100644 index c0d9314a..00000000 --- a/docs/api/relation.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -myst: - html_meta: - "description": "API methods of module 'relation'" - "property=og:description": "API methods of module 'relation'" - "property=og:title": "plone.api.relation" - "keywords": "Plone, development, content, relations, related content, API" ---- - -(plone-api-relation)= - -# `plone.api.relation` - -```{eval-rst} -.. automodule:: plone.api.relation - :members: -``` diff --git a/docs/api/user.md b/docs/api/user.md deleted file mode 100644 index 90e5281c..00000000 --- a/docs/api/user.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -myst: - html_meta: - "description": "API methods of module 'user'" - "property=og:description": "API methods of module 'user'" - "property=og:title": "plone.api.user" - "keywords": "user, groups, Plone, development, API" ---- - -(plone-api-user)= - -# `plone.api.user` - -```{eval-rst} -.. automodule:: plone.api.user - :members: -``` diff --git a/docs/conf.py b/docs/conf.py index c20fbc67..de904057 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,13 +1,6 @@ -from pkg_resources import get_distribution - -import sys - - project = "plone.api" copyright = "2012, Plone Foundation" -version = release = get_distribution(project).version - # The suffix of source filenames. source_suffix = { @@ -17,62 +10,13 @@ extensions = [ "myst_parser", - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.coverage", - "sphinx.ext.doctest", - "sphinx.ext.intersphinx", - "sphinx.ext.todo", - "sphinx.ext.viewcode", + "sphinx_reredirects", ] master_doc = "index" -locale_dirs = ["translated/"] -language = "en" - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]) -# This enables PDF generation. -latex_documents = [ - ( - "index", - "ploneapi.tex", - "plone.api Documentation", - "", - "manual", - ) -] - - -class Mock: - def __init__(self, *args, **kwargs): - pass - - def __call__(self, *args, **kwargs): - return Mock() - - @classmethod - def __getattr__(cls, name): - if name in ("__file__", "__path__"): - return "/dev/null" - elif name[0] == name[0].upper(): - mockType = type(name, (), {}) - mockType.__module__ = __name__ - return mockType - else: - return Mock() - - -MOCK_MODULES = ["lxml"] -for mod_name in MOCK_MODULES: - sys.modules[mod_name] = Mock() - - # -- Options for MyST markdown conversion to HTML ----------------------------- myst_enable_extensions = [ - "colon_fence", - "deflist", "linkify", # Identify "bare" web URLs and add hyperlinks. ] @@ -82,9 +26,15 @@ def __getattr__(cls, name): # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = "sphinx_book_theme" +html_theme = "plone_sphinx_theme" +# -- sphinx-reredirects configuration ---------------------------------- +# https://documatt.com/sphinx-reredirects/usage.html +redirects = { + "index": "https://6.docs.plone.org/plone.api/index.html", +} + # -- Intersphinx configuration ---------------------------------- # This extension can generate automatic links to the documentation of objects diff --git a/docs/content.md b/docs/content.md deleted file mode 100644 index 6417a233..00000000 --- a/docs/content.md +++ /dev/null @@ -1,541 +0,0 @@ ---- -myst: - html_meta: - "description": "Get, modify, and delete content" - "property=og:description": "Get, modify, and delete content" - "property=og:title": "Content" - "keywords": "Plone, API, development" ---- - -```{eval-rst} -.. module:: plone -``` - -(chapter-content)= - -# Content - -(content-create-example)= - -## Create content - -To add an object, you must first have a container to put it in. -Get the portal object; it will serve nicely: - -```python -from plone import api -portal = api.portal.get() -``` - -Create your new content item using the {meth}`api.content.create` method. -The type argument will decide which content type will be created. - -```python -from plone import api -obj = api.content.create( - type='Document', - title='My Content', - container=portal) -``` - -The `id` of the new object is automatically and safely generated from its `title`. - -```python -self.assertEqual(obj.id, 'my-content') -``` - -(content-get-example)= - -## Get content object - -There are several approaches to getting your content object. -Consider the following portal structure: - -```console -plone (portal root) -├── blog -├── about -│ ├── team -│ └── contact -└── events - ├── training - ├── conference - └── sprint -``` - -% invisible-code-block: python -% -% portal = api.portal.get() -% image = api.content.create(type='Image', id='image', container=portal) -% blog = api.content.create(type='Link', id='blog', container=portal) -% about = api.content.create(type='Folder', id='about', container=portal) -% events = api.content.create(type='Folder', id='events', container=portal) -% -% api.content.create(container=about, type='Document', id='team') -% api.content.create(container=about, type='Document', id='contact') -% -% api.content.create(container=events, type='Event', id='training') -% api.content.create(container=events, type='Event', id='conference') -% api.content.create(container=events, type='Event', id='sprint') - -The following operations will get objects from the structure above, including using {meth}`api.content.get`. - -```python -# let's first get the portal object -from plone import api -portal = api.portal.get() -assert portal.id == 'plone' - -# content can be accessed directly with dict-like access -blog = portal['blog'] - -# another way is to use ``get()`` method and pass it a path -about = api.content.get(path='/about') - -# more examples -conference = portal['events']['conference'] -sprint = api.content.get(path='/events/sprint') - -# moreover, you can access content by its UID -uid = about['team'].UID() -team = api.content.get(UID=uid) - -# returns None if UID cannot be found in catalog -not_found = api.content.get(UID='notfound') -``` - -% invisible-code-block: python -% -% self.assertTrue(portal) -% self.assertTrue(blog) -% self.assertTrue(about) -% self.assertTrue(conference) -% self.assertTrue(sprint) -% self.assertTrue(team) -% self.assertEqual(not_found, None) - -(content-find-example)= - -## Find content objects - -You can use the find function to search for content. - -Finding all Documents: - -```python -from plone import api -documents = api.content.find(portal_type='Document') -``` - -% invisible-code-block: python -% -% self.assertGreater(len(documents), 0) - -Finding all Documents within a context: - -```python -from plone import api -documents = api.content.find( - context=api.portal.get(), portal_type='Document') -``` - -% invisible-code-block: python -% -% self.assertGreater(len(documents), 0) - -Limit search depth: - -```python -from plone import api -documents = api.content.find(depth=1, portal_type='Document') -``` - -% invisible-code-block: python -% -% self.assertGreater(len(documents), 0) - -Limit search depth within a context: - -```python -from plone import api -documents = api.content.find( - context=api.portal.get(), depth=1, portal_type='Document') -``` - -% invisible-code-block: python -% -% self.assertGreater(len(documents), 0) - -Search by interface: - -```python -from plone import api -from Products.CMFCore.interfaces import IContentish -documents = api.content.find(object_provides=IContentish) -``` - -% invisible-code-block: python -% -% self.assertGreater(len(documents), 0) - -Combining multiple arguments: - -```python -from plone import api -from Products.CMFCore.interfaces import IContentish -documents = api.content.find( - context=api.portal.get(), - depth=2, - object_provides=IContentish, - SearchableText='Team', -) -``` - -% invisible-code-block: python -% -% self.assertGreater(len(documents), 0) - -Find all `Document` content types, and use unrestricted search results: - -```python -from plone import api -documents = api.content.find( - context=api.portal.get(), - portal_type="Document", - unrestricted=True, -) -``` - -% invisible-code-block: python -% -% self.assertGreater(len(documents), 0) - -More information about how to use the catalog may be found in the -[Plone Documentation](https://5.docs.plone.org/develop/plone/searching_and_indexing/index.html). - -Note that the catalog returns *brains* (metadata stored in indexes) and not objects. -However, calling `getObject()` on brains does in fact give you the object. - -```python -document_brain = documents[0] -document_obj = document_brain.getObject() -``` - -(content-get-uuid-example)= - -## Get content object UUID - -A Universally Unique IDentifier (UUID) is a unique, non-human-readable identifier for a content object which remains constant for the object even if the object is moved. - -Plone uses UUIDs for storing references between content and for linking by UIDs, enabling persistent links. - -To get the UUID of any content object use {meth}`api.content.get_uuid`. -The following code gets the UUID of the `contact` document. - -```python -from plone import api -portal = api.portal.get() -contact = portal['about']['contact'] - -uuid = api.content.get_uuid(obj=contact) -``` - -% invisible-code-block: python -% -% self.assertTrue(isinstance(uuid, str)) - -(content-move-example)= - -## Move content - -To move content around the portal structure defined above use the {meth}`api.content.move` method. -The code below moves the `contact` item (with all it contains) out of the folder `about` and into the Plone portal root. - -```python -from plone import api -portal = api.portal.get() -contact = portal['about']['contact'] - -api.content.move(source=contact, target=portal) -``` - -% invisible-code-block: python -% -% self.assertFalse(portal['about'].get('contact')) -% self.assertTrue(portal['contact']) - -Actually, `move` behaves like a filesystem move. -If you pass it an `id` argument, the object will have that new ID in its new home. -By default it will retain its original ID. - -% invisible-code-block: python -% -% self.assertEqual(contact.id, "contact") -% self.assertTrue(portal['contact']) -% contact = portal['contact'] -% api.content.move(source=contact, target=portal['about'], id="new-contact") -% self.assertEqual(contact.id, "new-contact") -% self.assertTrue(portal['about']['new-contact']) - -(content-rename-example)= - -## Rename content - -To rename a content object (change its ID), use the {meth}`api.content.rename` method. - -```python -from plone import api -portal = api.portal.get() -api.content.rename(obj=portal['blog'], new_id='old-blog') -``` - -% invisible-code-block: python -% -% self.assertFalse(portal.get('blog')) -% self.assertTrue(portal['old-blog']) - -(content-copy-example)= - -## Copy content - -To copy a content object, use the {meth}`api.content.copy` method. - -```python -from plone import api -portal = api.portal.get() -training = portal['events']['training'] - -api.content.copy(source=training, target=portal) -``` - -Note that the new object will have the same ID as the old object (unless otherwise stated). -This is not a problem, since the new object is in a different container. - -% invisible-code-block: python -% -% assert portal['events']['training'].id == 'training' -% assert portal['training'].id == 'training' - -You can also set `target` to source's container and set `safe_id=True`. -This will duplicate your content object in the same container and assign it a new, non-conflicting ID. - -```python -api.content.copy(source=portal['training'], target=portal, safe_id=True) -new_training = portal['copy_of_training'] -``` - -% invisible-code-block: python -% -% self.assertTrue(portal['training']) # old object remains -% self.assertTrue(portal['copy_of_training']) - -(content-delete-example)= - -## Delete content - -To delete a content object, pass the object to the {meth}`api.content.delete` method: - -```python -from plone import api -portal = api.portal.get() -api.content.delete(obj=portal['copy_of_training']) -``` - -% invisible-code-block: python -% -% self.assertFalse(portal.get('copy_of_training')) - -To delete multiple content objects, pass the objects to the {meth}`api.content.delete` method: - -% invisible-code-block: python -% -% api.content.copy(source=portal['training'], target=portal, safe_id=True) -% api.content.copy(source=portal['events']['training'], target=portal['events'], safe_id=True) - -```python -from plone import api -portal = api.portal.get() -data = [portal['copy_of_training'], portal['events']['copy_of_training'], ] -api.content.delete(objects=data) -``` - -% invisible-code-block: python -% -% self.assertFalse(portal.get('copy_of_training')) -% self.assertFalse(portal.events.get('copy_of_training')) - -If deleting content would result in broken links you will get a `LinkIntegrityNotificationException`. To delete anyway, set the option `check_linkintegrity` to `False`: - -% invisible-code-block: python -% -% from plone.app.textfield import RichTextValue -% from zope.lifecycleevent import modified -% api.content.copy(source=portal['training'], target=portal, safe_id=True) -% api.content.copy(source=portal['events']['training'], target=portal['events'], safe_id=True) -% portal['about']['team'].text = RichTextValue('contact', 'text/html', 'text/x-html-safe') -% modified(portal['about']['team']) - -```python -from plone import api -portal = api.portal.get() -api.content.delete(obj=portal['copy_of_training'], check_linkintegrity=False) -``` - -% invisible-code-block: python -% -% self.assertNotIn('copy_of_training', portal.keys()) - -(content-manipulation-with-safe-id-option)= - -## Content manipulation with the `safe_id` option - -When you manipulate content with {meth}`api.content.create`, {meth}`api.content.move` or {meth}`api.content.copy` the `safe_id` flag is disabled by default. -This means the uniqueness of IDs will be enforced. -If another object with the same ID is already present in the target container these API methods will raise an error. - -However, if the `safe_id` option is enabled, a non-conflicting ID will be generated. - -% invisible-code-block: python -% -% api.content.create(container=portal, type='Document', id='document', safe_id=True) - -```python -api.content.create(container=portal, type='Document', id='document', safe_id=True) -document = portal['document-1'] -``` - -(content-get-state-example)= - -## Get workflow state - -To find out the current workflow state of your content, use the {meth}`api.content.get_state` method. - -```python -from plone import api -portal = api.portal.get() -state = api.content.get_state(obj=portal['about']) -``` - -% invisible-code-block: python -% -% self.assertEqual(state, 'private') - -The optional `default` argument is returned if no workflow is defined for the object. - -```python -from plone import api -portal = api.portal.get() -state = api.content.get_state(obj=portal['image'], default='Unknown') -``` - -% invisible-code-block: python -% -% self.assertEqual(state, 'Unknown') - -(content-transition-example)= - -## Transition - -To transition your content to a new workflow state, use the {meth}`api.content.transition` method. - -```python -from plone import api -portal = api.portal.get() -api.content.transition(obj=portal['about'], transition='publish') -``` - -% invisible-code-block: python -% -% self.assertEqual( -% api.content.get_state(obj=portal['about']), -% 'published' -% ) - -If your workflow accepts any additional arguments to the checkin method you may supply them via kwargs. -These arguments can be saved to your transition using custom workflow variables inside the ZMI using an expression such as "python:state_change.kwargs.get('comment', '')" - -```python -from plone import api -portal = api.portal.get() -api.content.transition(obj=portal['about'], transition='reject', comment='You had a typo on your page.') -``` - - -(content-disable-roles-acquisition-example)= - -## Disable local roles acquisition - -To disable the acquisition of local roles for an object, use the {meth}`api.content.disable_roles_acquisition` method. - -```python -from plone import api -portal = api.portal.get() -api.content.disable_roles_acquisition(obj=portal['about']) -``` - -% invisible-code-block: python -% -% ac_flag = getattr(portal['about'], '__ac_local_roles_block__', None) -% self.assertTrue(ac_flag) - -(content-enable-roles-acquisition-example)= - -## Enable local roles acquisition - -To enable the acquisition of local roles for an object, use the {meth}`api.content.enable_roles_acquisition` method. - -```python -from plone import api -portal = api.portal.get() -api.content.enable_roles_acquisition(obj=portal['about']) -``` - -% invisible-code-block: python -% -% # As __ac_local_roles_block__ is None by default, we have to set it, -% # before we can test the enabling method. -% portal['about'].__ac_local_roles_block__ = 1 -% -% api.content.enable_roles_acquisition(obj=portal['about']) -% ac_flag = getattr(portal['about'], '__ac_local_roles_block__', None) -% self.assertFalse(ac_flag) - -(content-get-view-example)= - -## Get view - -To get a {class}`BrowserView` for your content, use {meth}`api.content.get_view`. - -```python -from plone import api -portal = api.portal.get() -view = api.content.get_view( - name='plone', - context=portal['about'], - request=request, -) -``` - -% invisible-code-block: python -% -% self.assertEqual(view.__name__, 'plone') - -Since version `2.0.0`, the `request` argument can be omitted. -In that case, the global request will be used. - -```python -from plone import api -portal = api.portal.get() -view = api.content.get_view( - name='plone', - context=portal['about'], -) -``` - -% invisible-code-block: python -% -% self.assertEqual(view.__name__, u'plone') - -## Further reading - -For more information on possible flags and usage options please see the full {ref}`plone-api-content` specification. diff --git a/docs/contribute.md b/docs/contribute.md deleted file mode 100644 index cf05e211..00000000 --- a/docs/contribute.md +++ /dev/null @@ -1,234 +0,0 @@ ---- -myst: - html_meta: - "description": "Contribute to plone.api" - "property=og:description": "Contribute to plone.api" - "property=og:title": "Contribute to plone.api" - "keywords": "plone.api, contribute, Plone, API, development" ---- - -# Contribute to `plone.api` - -This section describes how to contribute to the `plone.api` project. -It extends {doc}`plone:contributing/index`. - -## Prerequisites - -Prepare your system by installing prerequisites. - -### System libraries - -You need to install system libraries, as described in {ref}`plone:plone-prerequisites-label`, with the exception of GNU make. - -### tox - -[tox](https://tox.wiki/en/stable/index.html) automates and standardizes testing in Python. -Install tox into your Python user space with the following command. - -```shell -python -m pip install --user tox -``` - -### pre-commit - -`plone.api` uses [pre-commit](https://pre-commit.com/) to automate code quality checks before every commit. - -Install pre-commit either with your system package manager. -Alternatively you can install pre-commit into your Python user. - -```shell -python -m pip install --user pre-commit -``` - -Once installed, set up the git hook scripts to run on every commit. - -```shell -pre-commit install -``` - -## Create development environment - -After satisfying the prerequisites, you are ready to create your development environment. -`plone.api` uses `tox` as a wrapper around `coredev.buildout` to simplify development, whereas Plone core uses `coredev.buildout` directly. - -Start by changing your working directory to your project folder, and download the latest `plone.api` source code. - -```shell -cd -git clone https://github.com/plone/plone.api.git -``` - -Next go into the newly created directory, and build your environment. - -```shell -cd plone.api -tox -``` - -Go make some tea while `tox` runs all tasks listed by issuing the command `tox -l`. - -Open `tox.ini` in your code editor to see all configured commands and what they do. -Some helpful `tox` commands are shown below. - -```shell -tox -e py39-plone-60 # run all tests for Python 3.9 and Plone 6 -tox -e plone6docs # build documentation -tox -e livehtml # build, serve, and reload changes to documentation -tox -l # list all tox environments -``` - -(git-workflow)= - -## git - -Use the following git branches when contributing to `plone.api`. - -feature branches -: All development for a new feature or bug fix must be done on a new branch. - -`main` -: Pull requests should be made from a feature branch against the `main` branch. -When features and bug fixes are complete and approved, they are merged into the `main` branch. - -```{seealso} -{ref}`plone:contributing-core-work-with-git-label` -``` - -## Continuous integration - -`plone.api` uses GitHub workflows for continuous integration. -On every push to the `main` branch, GitHub runs its workflows for all tests and code quality checks. -GitHub workflows are configured in the directory `.github/workflows` at the root of this package. - -## Documentation - -For every feature change or addition to `plone.api`, you must add documentation of it. -`plone.api` uses [MyST](https://myst-parser.readthedocs.io/en/latest/) for documentation syntax. - -```{seealso} -{doc}`plone:contributing/documentation/index` -``` - -After adding or modifying documentation, you can build the documentation with the following command. - -```shell -tox -e plone6docs -``` - -Alternatively, you can automatically reload changes to the documentation as you edit it in a web browser. - -```shell -tox -e livehtml -``` - -The [`plone.api` documentation](https://6.docs.plone.org/plone.api) is automatically generated from the documentation source files when its submodule is updated in the [main Plone `documentation` repository](https://github.com/plone/documentation/). - -## Add a function to an existing module - -This section describes how to add a new function `foo` to `plone.api`. - -The function would go in the module `plone.api.content`, located in the file {file}`src/plone/api/content.py`. - -% invisible-code-block: python -% -% from plone.api.validation import at_least_one_of -% from plone.api.validation import mutually_exclusive_parameters - -```python -@mutually_exclusive_parameters('path', 'UID') -@at_least_one_of('path', 'UID') -def foo(path=None, UID=None): - """Do foo. - - :param path: Path to the object we want to get, - relative to the portal root. - :type path: string - - :param UID: UID of the object we want to get. - :type UID: string - - :returns: String - :raises: - :class:`~plone.api.exc.MissingParameterError`, - :class:`~plone.api.exc.InvalidParameterError` - :Example: :ref:`content-foo-example` - """ - return "foo" -``` - -% invisible-code-block: python -% -% bar = foo('/plone/blog') -% self.assertEqual(bar,"foo") -% -% from plone.api.exc import InvalidParameterError -% self.assertRaises( -% InvalidParameterError, -% lambda: foo("/plone/blog", "abcd001") -% ) - -Add documentation in {file}`docs/api/content.md`. -Narrative documentation should describe what your function does. - -You should also write some tests in code blocks. -`TestCase` methods, such as `self.assertEqual()`, are available in `doctests`. -See [unittest.TestCase assert methods](https://docs.python.org/3/library/unittest.html#unittest.TestCase.debug) for all available methods. -The file is linked in `/src/plone/api/tests/doctests/`, which includes the doctests in `plone.api`'s test setup. -The package `manuel` allows you to write doctests as common Python code in code blocks. - -The following example shows narrative documentation and doctests. - -````markdown -(content-foo-example)= - -## Get the foo of an object - -You can use the {meth}`api.content.foo` function to get the `foo` of an object. - -```python -from plone import api -blog_foo = api.content.foo(path="/plone/blog") -``` - -% invisible-code-block: python -% -% self.assertEqual(blog_foo,"foo") -```` - -Code blocks are rendered in documentation. - -````markdown -```python -from plone import api -blog_foo = api.content.foo(path="/plone/blog") -``` -```` - -Invisible code blocks are not rendered in documentation and can be used for tests. - -```markdown -% invisible-code-block: python -% -% self.assertEqual(blog_foo,"foo") -``` - -Invisible code blocks are also handy for enriching the namespace without cluttering the narrative documentation. - -```markdown -% invisible-code-block: python -% -% portal = api.portal.get() -% image = api.content.create(type='Image', id='image', container=portal) -% blog = api.content.create(type='Link', id='blog', container=portal) -``` - -Functions and examples in documentation are mutually referenced. -The function references the narrative documentation via the label `content-foo-example`. -The narrative documentation references the API function documentation via `` {meth}`api.content.foo` ``. -The documentation is rendered with a link from the API reference to the narrative documentation, which in turn links back to the API reference. - -## Resources - -- {doc}`plone:index` -- [Source code](https://github.com/plone/plone.api) -- [Issue tracker](https://github.com/plone/plone.api/issues) diff --git a/docs/env.md b/docs/env.md deleted file mode 100644 index f0e880ae..00000000 --- a/docs/env.md +++ /dev/null @@ -1,150 +0,0 @@ ---- -myst: - html_meta: - "description": "Authorize for working in another role. Get environment information." - "property=og:description": "Authorize for working in another role. Get environment information." - "property=og:title": "Environment" - "keywords": "authorization, Plone, API, development" ---- - -```{eval-rst} -.. module:: plone - :no-index: -``` - -(chapter-env)= - -# Environment - -(env-adopt-roles-example)= - -## Switch roles inside a block - -To temporarily override the list of available roles, use {meth}`api.env.adopt_roles`. -This is especially useful in unit tests. - -```python -from plone import api -from AccessControl import Unauthorized - -portal = api.portal.get() -with api.env.adopt_roles(['Anonymous']): - self.assertRaises( - Unauthorized, - lambda: portal.restrictedTraverse("manage_propertiesForm") - ) - -with api.env.adopt_roles(['Manager', 'Member']): - portal.restrictedTraverse("manage_propertiesForm") -``` - -(env-adopt-user-example)= - -## Switch user inside a block - -To temporarily override the currently active user, use {meth}`api.env.adopt_user`. - -```python -from plone import api - -portal = api.portal.get() - -# Create a new user. -api.user.create( - username="doc_owner", - roles=('Member', 'Manager',), - email="new_owner@example.com", -) - -# Become that user and create a document. -with api.env.adopt_user(username="doc_owner"): - api.content.create( - container=portal, - type='Document', - id='new_owned_doc', - ) - -self.assertEqual( - portal.new_owned_doc.getOwner().getId(), - "doc_owner", -) -``` - -(env-debug-mode-example)= - -## Debug mode - -To know if your Zope instance is running in debug mode, use {meth}`api.env.debug_mode`. - -```python -from plone import api - -in_debug_mode = api.env.debug_mode() -if in_debug_mode: - print('Zope is in debug mode') -``` - -(env-test-mode-example)= - -## Test mode - -To know if your Plone instance is running in a test runner, use {meth}`api.env.test_mode`. - -```python -from plone import api - -in_test_mode = api.env.test_mode() -if in_test_mode: - pass # do something -``` - -(env-read-only-mode-example)= - -## Read-Only mode - -To know if your Zope / Plone instance is running on a read-only ZODB connection use {meth}`api.env.read_only_mode`. - -**Use-Case:** -If you run a ZRS or RelStorage cluster with active replication where all replicas are read-only be default. -You could check if your instance is connected to a read only ZODB or a writeable ZODB. -Therefore you could adjust the UI to prevent create, delete or update pages are shown. - -```python -from plone import api - -is_read_only = api.env.read_only_mode() -if is_read_only: - pass # do something -``` - -(env-plone-version-example)= - -## Plone version - -To know which version of Plone you are using, use {meth}`api.env.plone_version`. - -```python -from plone import api - -plone_version = api.env.plone_version() -if plone_version < '4.1': - pass # do something -``` - -(env-zope-version-example)= - -## Zope version - -To know which version of Zope 2 you are using, use {meth}`api.env.zope_version`. - -```python -from plone import api - -zope_version = api.env.zope_version() -if zope_version >= '2.13': - pass # do something -``` - -## Further reading - -For more information on possible flags and usage options please see the full {ref}`plone-api-env` specification. diff --git a/docs/group.md b/docs/group.md deleted file mode 100644 index 5522434d..00000000 --- a/docs/group.md +++ /dev/null @@ -1,363 +0,0 @@ ---- -myst: - html_meta: - "description": "Create, access, modify, and delete groups and group memberships" - "property=og:description": "Create, access, modify, and delete groups and group memberships" - "property=og:title": "Groups" - "keywords": "Plone, development, API, users, groups" ---- - -```{eval-rst} -.. module:: plone - :no-index: -``` - -(chapter-groups)= - -# Groups - -(group-create-example)= - -## Create group - -To create a new group, use {meth}`api.group.create`, providing a required string parameter of `groupname`. - -```python -from plone import api -group = api.group.create(groupname='staff') -``` - -% invisible-code-block: python -% -% self.assertEqual(group.id, 'staff') - -When you create groups, `title`, `description`, `roles` and `groups` are optional. - -```python -from plone import api - -group = api.group.create( - groupname='board_members', - title='Board members', - description='Just a description', - roles=['Reader', ], - groups=['Site Administrators', ], -) -``` - -% invisible-code-block: python -% -% self.assertEqual(group.id, 'board_members') -% self.assertEqual(group.getProperty('title'), 'Board members') -% self.assertEqual(group.getProperty('description'), 'Just a description') -% self.assertTrue('Reader' in group.getRoles()) -% self.assertTrue('Site Administrators' in group.getMemberIds()) - -(group-get-example)= - -## Get group - -To get a group by its name, use {meth}`api.group.get`. - -```python -from plone import api -group = api.group.get(groupname='staff') -``` - -% invisible-code-block: python -% -% self.assertEqual(group.id, 'staff') - -(group-edit-example)= - -## Editing a group - -Groups can be edited by using the method {meth}`api.portal.get_tool`, providing the portal tool `portal_groups` as the `name` argument. -In this example, the `title`, `description` and `roles` are updated for the group `staff`. - -```python -from plone import api -portal_groups = api.portal.get_tool(name='portal_groups') -portal_groups.editGroup( - 'staff', - roles=['Editor', 'Reader'], - title='Staff', - description='Just a description', -) -``` - -% invisible-code-block: python -% -% group = api.group.get(groupname='staff') -% -% title = group.getProperty('title') -% description = group.getProperty('description') -% roles = group.getRoles() -% -% self.assertEqual(title, 'Staff') -% self.assertEqual(description, 'Just a description') -% self.assertTrue('Editor' in roles) -% self.assertTrue('Reader' in roles) - -(group-get-all-groups-example)= - -## Get all groups - -You can also get all groups by using {meth}`api.group.get_groups`. - -```python -from plone import api -groups = api.group.get_groups() -``` - -% invisible-code-block: python -% -% self.assertEqual(groups[0].id, 'Administrators') - -(group-get-users-groups-example)= - -## Get user's groups - -Groups may be filtered by member. By passing the `username` parameter, -{meth}`api.group.get_groups` will return only the groups the user belongs to. - -% invisible-code-block: python -% -% api.user.create(email='jane@plone.org', username='jane') -% api.group.add_user(username='jane', groupname='staff') -% api.group.add_user(username='jane', groupname='Reviewers') - -```python -from plone import api -groups = api.group.get_groups(username='jane') -``` - -% invisible-code-block: python -% -% group_list = [g.id for g in groups] -% self.assertCountEqual( -% group_list, -% ['Reviewers', 'AuthenticatedUsers', 'staff'], -% ) - -You can also pass the user directly to {meth}`api.group.get_groups`: - -```python -from plone import api -user = api.user.get(username='jane') -groups = api.group.get_groups(user=user) -``` - -% invisible-code-block: python -% -% group_list = [g.id for g in groups] -% self.assertCountEqual( -% group_list, -% ['Reviewers', 'AuthenticatedUsers', 'staff'], -% ) - -## Get group members - -Use the {meth}`api.user.get_users` method to get all the users that are members of a group. - -```python -from plone import api -members = api.user.get_users(groupname='staff') -``` - -% invisible-code-block: python -% -% self.assertEqual(members[0].id, 'jane') - -(group-delete-example)= - -## Delete group - -To delete a group, use {meth}`api.group.delete` and pass in either the groupname or the group object you want to delete. - -```python -from plone import api -api.group.create(groupname='unwanted') -api.group.delete(groupname='unwanted') -``` - -% invisible-code-block: python -% -% self.assertEqual(api.group.get(groupname='unwanted'), None) - -```python -unwanted = api.group.create(groupname='unwanted') -api.group.delete(group=unwanted) -``` - -% invisible-code-block: python -% -% self.assertEqual(api.group.get(groupname='unwanted'), None) - -(group-add-user-example)= - -## Adding user to group - -To add a user to a group, use the {meth}`api.group.add_user` method. -This method accepts either the groupname or the group object for the target group and the username or the user object you want to add to the group. - -```python -from plone import api - -api.user.create(email='bob@plone.org', username='bob') -api.group.add_user(groupname='staff', username='bob') -``` - -% invisible-code-block: python -% -% self.assertTrue( -% 'staff' in [g.id for g in api.group.get_groups(username='bob')] -% ) - -(group-remove-user-example)= - -## Removing user from group - -To remove a user from a group, use the {meth}`api.group.remove_user` method. -This also accepts either the groupname or the group object for the target group and either the username or the user object you want to remove from the group. - -```python -from plone import api -api.group.remove_user(groupname='staff', username='bob') -``` - -% invisible-code-block: python -% -% self.assertFalse('staff' in [g.id for g in api.group.get_groups(username='bob')]) - -(group-get-roles-example)= - -## Get group roles - -To find the roles assigned to a group, use the {meth}`api.group.get_roles` method. -By default it returns site-wide roles. - -```python -from plone import api -roles = api.group.get_roles(groupname='staff') -``` - -% invisible-code-block: python -% -% EXPECTED_SITE_ROLES = ['Authenticated', 'Editor', 'Reader'] -% self.assertEqual(set(EXPECTED_SITE_ROLES), set(roles)) - -If you pass in a content object, it will return the local roles of the group in that particular context. - -```python -from plone import api -portal = api.portal.get() -folder = api.content.create( - container=portal, - type='Folder', - id='folder_four', - title='Folder Four', -) -roles = api.group.get_roles(groupname='staff', obj=portal['folder_four']) -``` - -% invisible-code-block: python -% -% self.assertEqual(set(EXPECTED_SITE_ROLES), set(roles)) - -If you pass in a content object and `inherit=False`, it will return only the local roles of the group on that particular object and ignore global roles. - -```python -api.group.grant_roles( - groupname='staff', roles=['Contributor'], obj=portal['folder_four']) - -roles = api.group.get_roles( - groupname='staff', obj=portal['folder_four'], inherit=False) -``` - -% invisible-code-block: python -% -% EXPECTED_OBJ_ROLES = ['Contributor'] -% self.assertEqual(set(EXPECTED_OBJ_ROLES), set(roles)) - -(group-grant-roles-example)= - -## Grant roles to group - -To grant roles to a group, use the {meth}`api.group.grant_roles` method. -By default, roles are granted site-wide. - -```python -from plone import api -api.group.grant_roles( - groupname='staff', - roles=['Reviewer, SiteAdministrator'], -) -``` - -% invisible-code-block: python -% -% EXPECTED_SITE_ROLES = ['Authenticated', 'Editor', 'Reader', 'Reviewer, SiteAdministrator'] -% roles = api.group.get_roles(groupname='staff') -% self.assertEqual(set(EXPECTED_SITE_ROLES), set(roles)) - -If you pass in a content object, roles will be assigned in that particular context. - -```python -from plone import api -portal = api.portal.get() -folder = api.content.create( - container=portal, type='Folder', id='folder_five', title='Folder Five') -api.group.grant_roles( - groupname='staff', roles=['Contributor'], obj=portal['folder_five']) -``` - -% invisible-code-block: python -% -% EXPECTED_CONTEXT_ROLES = EXPECTED_SITE_ROLES + ['Contributor'] -% roles = api.group.get_roles(groupname='staff', obj=portal['folder_five'], inherit=False) -% self.assertEqual(set(['Contributor']), set(roles)) -% roles = api.group.get_roles(groupname='staff', obj=portal['folder_five']) -% self.assertEqual(set(EXPECTED_CONTEXT_ROLES), set(roles)) - -(group-revoke-roles-example)= - -## Revoke roles from group - -To revoke roles already granted to a group, use the {meth}`api.group.revoke_roles` method. - -```python -from plone import api -api.group.revoke_roles( - groupname='staff', roles=['Reviewer, SiteAdministrator']) -``` - -% invisible-code-block: python -% -% EXPECTED_SITE_ROLES = ['Authenticated', 'Editor', 'Reader'] -% roles = api.group.get_roles(groupname='staff') -% self.assertEqual(set(EXPECTED_SITE_ROLES), set(roles)) - -If you pass in a content object, it will revoke roles granted in that particular context. - -% invisible-code-block: python -% -% EXPECTED_CONTEXT_ROLES = ['Contributor'] -% roles = api.group.get_roles(groupname='staff', obj=portal['folder_five'], inherit=False) -% self.assertEqual(['Contributor'], roles) - -```python -from plone import api -api.group.revoke_roles( - groupname='staff', roles=['Contributor'], obj=portal['folder_five']) -``` - -% invisible-code-block: python -% -% EXPECTED_CONTEXT_ROLES = [] -% roles = api.group.get_roles(groupname='staff', obj=portal['folder_five'], inherit=False) -% self.assertEqual(set(EXPECTED_CONTEXT_ROLES), set(roles)) - -## Further reading - -For more information on possible flags and complete options please see the full {ref}`plone-api-group` specification. diff --git a/docs/locale/README.txt b/docs/locale/README.txt deleted file mode 100644 index 6410b66d..00000000 --- a/docs/locale/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -Update translations -=================== - -$ cd docs -$ make gettext -$ msgfmt -c -vv --statistics "locale/es/LC_MESSAGES/about.po" -o "translated/es/LC_MESSAGES/about.mo" - -Build localized documentation -============================= - -#. change ``language`` in conf.py to your language -#. run bin/sphinxbuilder -#. your docs are in docs/html diff --git a/docs/locale/about.pot b/docs/locale/about.pot deleted file mode 100644 index 819c5222..00000000 --- a/docs/locale/about.pot +++ /dev/null @@ -1,368 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:42\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../about.rst:10 -# 2a436744b5074106a4d3c1e7db23907d -msgid "About" -msgstr "" - -#: ../about.rst:13 -# f29f9648a2c64ceab3a58837c46f84c3 -msgid "Inspiration" -msgstr "" - -#: ../about.rst:15 -# 2d3ee5a2fe0143399f5b58ba22e4eda1 -msgid "We want `plone.api` to be developed with `PEP 20 `_ idioms in mind, in particular:" -msgstr "" - -#: ../about.rst:25 -# 7d4b894e6cbb420fac9251ec2fb46d70 -msgid "All contributions to `plone.api` should keep these important rules in mind." -msgstr "" - -#: ../about.rst:27 -# cba995aac8fc43aa99709d8004865bb3 -msgid "Two libraries are especially inspiring:" -msgstr "" - -#: ../about.rst:30 -# 6084d6e706274019a8f4fb7aaa19d1d5 -msgid "Arguably, the reason for SQLAlchemy's success in the developer community lies as much in its feature set as in the fact that its API is very well designed, is consistent, explicit, and easy to learn." -msgstr "" - -#: ../about.rst:35 -# a691aa3dabd84cf28f90c99c585e1ff5 -msgid "As of this writing, this is still a very new library, but just looking at `a comparison between the urllib2 way and the requests way `_, as well as the rest of its documentation, one cannot but see a parallel between the way we *have been* and the way we *should be* writing code for Plone (or at least have that option)." -msgstr "" - -#: ../about.rst:43 -# d03775b84e504b988c0640c82a21a306 -msgid "Design decisions" -msgstr "" - -#: ../about.rst:46 -# 95ffc3de9a55416f95ea3c05afbf9a4d -msgid "Import and usage style" -msgstr "" - -#: ../about.rst:48 -# 672e9312309c43709fd6d2acc2023e2d -msgid "API methods are grouped by their field of usage: :ref:`chapter_portal`, :ref:`chapter_content`, :ref:`chapter_users` and :ref:`chapter_groups`. Hence the importing and usage of API methods look like this:" -msgstr "" - -#: ../about.rst:72 -# 349b5fd6487e40ea9dd81987978c2f5e -msgid "In other words, always import the top-level package (``from plone import api``) and then use the group namespace to access the method you want (``url = api.portal.url()``)." -msgstr "" - -#: ../about.rst:76 -# f8239b769bdf4a778da77b3c7e02bf23 -msgid "All example code should adhere to this style, so we encourage one and only one prefered way of consuming API methods." -msgstr "" - -#: ../about.rst:81 -# f21cac0fa09c473c97d47508b064c72a -msgid "Prefer keyword arguments" -msgstr "" - -#: ../about.rst:83 -# 5f321e76bf214e3cb3a72ccb2e2eb7a6 -msgid "For the following reasons the example code in the API (and hence the recommendation to people on how to use it) shall always prefer using keyword instead of positional arguments:" -msgstr "" - -#: ../about.rst:87 -# 203486d7854545f3be3181502c63f0c9 -msgid "There will never be a doubt when writing a method on whether an argument should be positional or not. Decision already made." -msgstr "" - -#: ../about.rst:89 -# 51132b05a09e422bbcd7d7d731e79a9e -msgid "There will never be a doubt when using the API on which argument comes first, or which ones are named/positional. All arguments are named." -msgstr "" - -#: ../about.rst:91 -# 94d78f7dd2284323a551bc70c1bcaccb -msgid "When using positional arguments, the method signature is dictated by the underlying implementation. Think required vs. optional arguments. Named arguments are always optional in Python. This allows us to change implementation details and leave the signature unchanged. In other words, the underlying API code can change substantially and the code using it will remain valid." -msgstr "" - -#: ../about.rst:97 -# f9101ada75c34ab4a49ac2649e2c86c6 -msgid "The arguments can all be passed as a dictionary." -msgstr "" - -#: ../about.rst:99 -# e6447bf1c1cc407980d43e369123bd3c -msgid "The API provides grouped functional access to otherwise distributed logic in Plone. Plone's original distribution of logic is a result of two things: The historic re-use of CMF- and Zope-methods and reasonable, but at first hard to understand splits like acl_users.* and portal_memberdata." -msgstr "" - -#: ../about.rst:104 -# a1ced08ad5c448ce96cf067f65e7631e -msgid "That's why we've created a set of useful methods that implement best-practice access to the original distributed APIs. In this way we also document in code how to use Plone directly." -msgstr "" - -#: ../about.rst:109 -# 6264cd574bc64f9d97dddba7f620e57b -msgid "If you doubt those last sentences: We had five different ways to get the portal root with different edge-cases. We had three different ways to move an object. With this in mind, it's obvious that even the most simple tasks can't be documented in Plone in a sane way." -msgstr "" - -#: ../about.rst:114 -# 34554f35d96445cb8cea6a18400b4f5a -msgid "Also, we don't intend to cover all possible use-cases. Only the most common ones. If you need to do something that `plone.api` does not support, just use the underlying APIs directly. We will cover 20% of tasks that are being done 80% of the time, and not one more." -msgstr "" - -#: ../about.rst:121 -# b4b07582223e44dca3469a6bc0ee6699 -msgid "FAQ" -msgstr "" - -#: ../about.rst:124 -# 99216352a3a8460187898ba11d724b9a -msgid "Why aren't we using wrappers?" -msgstr "" - -#: ../about.rst:126 -# 5d5493b748f340779cb1ddffd215fc90 -msgid "We could wrap an object (like a user) with an API to make it more usable right now. That would be an alternative to the convenience methods." -msgstr "" - -#: ../about.rst:129 -# ebc49b52ce3d43dbbaa635bd6553c1a5 -msgid "But telling developers that they will get yet another object from the API which isn't the requested object, but an API-wrapped one instead, would be very hard. Also, making this wrap transparent in order to make the returned object directly usable would be nearly impossible, because we'd have to proxy all the :mod:`zope.interface` stuff, annotations and more." -msgstr "" - -#: ../about.rst:135 -# 0d4d150359a84f0594821afc047a6809 -msgid "Furthermore, we want to avoid people writing code like this in tests or their internal utility code and failing miserably in the future if wrappers would no longer be needed and would therefore be removed::" -msgstr "" - -#: ../about.rst:144 -# 85967fd7653f425382711bd500730255 -msgid "Why ``delete`` instead of ``remove``?" -msgstr "" - -#: ../about.rst:146 -# 401809f8d97f49a08faa1f6e52254109 -msgid "The underlying code uses methods that are named more similarly to *delete* rather than to *remove*" -msgstr "" - -#: ../about.rst:148 -# 763c8c4c889d49028ba6c6a9bd7b7325 -msgid "``CRUD`` has *delete*, not *remove*." -msgstr "" - -#: ../about.rst:152 -# 0436b19cd5b041ca8b591ef5ab64d096 -msgid "Roadmap" -msgstr "" - -#: ../about.rst:155 -# 3c062a5a96b740ef8778f0e8a55ed39a -msgid "Short term" -msgstr "" - -#: ../about.rst:157 -# 5ec374a7a3f647b5a6d2859005e1f2c0 -msgid "In the short-term, we are planning to add more api methods to `plone.api`. An up-to-date list of them (and ideas for them) can be found `on GitHub `_." -msgstr "" - -#: ../about.rst:161 -# e31adb5b97d648dab373d9706e32c99c -msgid "TODO: add this to GitHub issues:" -msgstr "" - -#: ../about.rst:163 -# f8929ca807a7428b800714f7fd25deeb -msgid "descriptive error messages" -msgstr "" - -#: ../about.rst:165 -# 04d3a21173064ec3b7066d3fad50ac28 -msgid "see where code breaks with stupid messages" -msgstr "" - -#: ../about.rst:166 -# d057b078035c4066989c25d4e8ba13f0 -msgid "catch them and make them more descriptive" -msgstr "" - -#: ../about.rst:167 -# f49fae0ea7f84216a791f1a105873e74 -msgid "have a list of all possible error messages, what they mean and how to overcome them" -msgstr "" - -#: ../about.rst:172 -# 4650e9d3bd564bd7b0af72919bc37a45 -msgid "Medium- to long-term:" -msgstr "" - -#: ../about.rst:174 -# a1f8f342c2ac45ebaced9ad6f912f5a9 -msgid "Below is a collection of ideas we have for the long run, in no particular order:" -msgstr "" - -#: ../about.rst:176 -# f65e026a179346bf8b1384e3ed937b08 -msgid "api.role context manager (to use with ``with``)" -msgstr "" - -#: ../about.rst:186 -# 7e1b68bc127e4288a81ac58f89f730d2 -msgid "api.env" -msgstr "" - -#: ../about.rst:188 -# 1f4ae1500be34a828b334872383f1b53 -msgid "debug_mode, test_mode booleans (to check if you are in debug/test)" -msgstr "" - -#: ../about.rst:189 -# 2fd5bc2e3bcb44128285857362cd136b -msgid "zope/plone version info" -msgstr "" - -#: ../about.rst:191 -# 680e221b3c1b4c59816189dd5dca883f -msgid "api.system" -msgstr "" - -#: ../about.rst:193 -# 3b98c601ff9a49d2bda68a897862863d -msgid "for sysadmin tasks" -msgstr "" - -#: ../about.rst:194 -# 8eb71408396944deae13edd284d87c43 -msgid "run upgrades, stay up-to-date" -msgstr "" - -#: ../about.rst:195 -# dc6ef86847c6487a8d28abd46fa6bfcd -msgid "cleanup broken objects, interfaces, utilities, etc." -msgstr "" - -#: ../about.rst:196 -# aa5a7f885c874a84b963c78fcb46ed98 -msgid "mounting things" -msgstr "" - -#: ../about.rst:198 -# 9e22a02a18124701b38b58f9162b8715 -msgid "unify permissions" -msgstr "" - -#: ../about.rst:200 -# 1dbdc51bc8144212942b0e848840ed10 -msgid "have all different types of permission in one place and one way to use them" -msgstr "" - -#: ../about.rst:202 -# 58acee587c1f407f994bd1ee046891c5 -msgid "style guide" -msgstr "" - -#: ../about.rst:204 -# 0c10ec9c6adc467680422e88b28cb9cd -msgid "have a style guide for how Plone files should be formatted -- this needs to be finalized before we start fixing underlying APIs so new code can use the style guide" -msgstr "" - -#: ../about.rst:207 -# 059393d646df4807b6e0bf60fcded4bd -msgid "define guidelines for:" -msgstr "" - -#: ../about.rst:209 -# 4f66feaababa4915bbeae3c82ffc11ea -msgid "python" -msgstr "" - -#: ../about.rst:210 -# 4c4b33b5972a44f38fa7bf26f4bbf549 -msgid "javascript" -msgstr "" - -#: ../about.rst:211 -# 8a6d258332214849925967b682c1c96a -msgid "rst" -msgstr "" - -#: ../about.rst:212 -# 7ac71372fdd141c893ce90cc9992ebfa -msgid "zpt" -msgstr "" - -#: ../about.rst:213 -# 3ada99fc0f444c36a17ddd5efb3018f4 -msgid "xml" -msgstr "" - -#: ../about.rst:214 -# 27d5db7138d24562b926c1939cd03a0e -msgid "zcml" -msgstr "" - -#: ../about.rst:216 -# 219ad0b7744f4b148974776df461ad9d -msgid "rewrite sub-optimal underlying APIs and deprecate plone.api methods, but leave the (updated) documentation:" -msgstr "" - -#: ../about.rst:219 -# dc05069dcdb6450f8413b6e4aa112a94 -msgid "getting/setting member properties" -msgstr "" - -#: ../about.rst:220 -# 8399fc5ba7194909a459de3cb9aaff81 -msgid "tools:" -msgstr "" - -#: ../about.rst:222 -# 410d5fd4d48d40f5b2b632c2c26b5e02 -msgid "portal_groupdata, portal_groups, portal_memberdata, portal_membership" -msgstr "" - -#: ../about.rst:223 -# e4725801d2194b57b48e143190136411 -msgid "portal_quickinstaller, portal_undo" -msgstr "" - -#: ../about.rst:225 -# 3078b079855f4f41b04ab1c7794cf50c -msgid "JSON webservices" -msgstr "" - -#: ../about.rst:227 -# aff2f6b63fe242fcb418c28cfdf15328 -msgid "probably in a separate package plone.jsonapi" -msgstr "" - -#: ../about.rst:228 -# ba9d6aef442341a18631fc8f4145f334 -msgid "one view (@@jsonapi for example) that you can call in your JS and be sure it won't change" -msgstr "" - -#: ../about.rst:230 -# 36cd035b06a849a983dcbc6601e1e2d5 -msgid "easier to AJAXify stuff" -msgstr "" - -#: ../about.rst:232 -# f4f27b60ac2c44ca997c10f296883309 -msgid "Flask-type url_for_view() and view_for_url()" -msgstr "" - diff --git a/docs/locale/api.pot b/docs/locale/api.pot deleted file mode 100644 index 5937a87a..00000000 --- a/docs/locale/api.pot +++ /dev/null @@ -1,383 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:42\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../api.rst:11 -# 7212f7d42ff9489380b93dcbab0004e4 -msgid "plone.api.portal" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get:1 -# e8726e7d625c470592009865bf24e6f6 -msgid "Get the Plone portal object out of thin air without importing fancy Interfaces and doing multi adapter lookups." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get:5 -# 25d38c34344d4ed0811640baed21116e -msgid ":ref:`portal_get_example`" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get_tool:1 -# 78051cfba613403f978b0b33e35a4859 -msgid "Get a portal tool in a simple way." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get_tool:6 -# b4cb0fb1b7fb4d9eac4fc9828f56cdf8 -msgid ":ref:`portal_get_tool_example`" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:1 -# 68ad9f4e99904ad7bd0f81960e8b5c78 -msgid "Display a date/time in a user-friendly way." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:3 -# 66cad4af6bf24644acdbeda6a4e21536 -msgid "It should be localized to the user's preferred language." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:5 -# f8b11b09460944659898ef8841052afb -msgid "Note that you can specify both long_format and time_only as True (or any other value that can be converted to a boolean True value), but time_only then wins: the long_format value is ignored." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:17 -# d663cd2d6b33470badf638170ee2cb96 -msgid ":ref:`portal_localized_time_example`" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.send_email:1 -# a554cc07a27c4558b1bd5b65354fde23 -msgid "Send an email." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.send_email:12 -# af538f30c61241fd86cf775052f52525 -msgid ":ref:`portal_send_email_example`" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.show_message:1 -# f43463a66da843a987e7252120722c79 -msgid "Display a status message." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.show_message:9 -# 86f6ed75a7bd4dd3a141fbad2f646b28 -msgid ":ref:`portal_show_message_example`" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.url:1 -# 3a7518b032664e8fb9335491d72ccd85 -msgid "Get the portal url." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.url:5 -# b715ef06bb9944b491e442e206f41344 -msgid ":ref:`portal_url_example`" -msgstr "" - -#: ../api.rst:20 -# 1e580f3a1c6e47b888a2ee4652cd16eb -msgid "plone.api.content" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content:1 -# dbc4d5368f6c42f1b1084a31322ff1c4 -msgid "Module that provides functionality for content manipulation" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.copy:1 -# 63903296d780435c9dc43ee863cfe892 -msgid "Copy the object to the target container." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.copy:19 -# dfaef78f4ce144899ce6fb62e8525915 -msgid ":ref:`content_copy_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.create:1 -# 91ffe365a2aa4c848259de76c815e16d -msgid "Create a new content item." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.create:22 -# 644ca113cc06449998fad8d61bed2884 -msgid ":ref:`content_create_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.delete:1 -# 24567b010a514c0fb4c8d4fb38c6580b -msgid "Delete the object." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.delete:5 -# 522992c99cf74f5e88e0e96f40df9734 -msgid ":ref:`content_delete_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get:1 -# c986da9fdb7446498e3c6bafe61cd625 -msgid "Get an object." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get:9 -# 1aed0fc555ff4f3bb7c27d0985df44e0 -msgid ":ref:`content_get_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_state:1 -# 9b30f397331e43f7bc65e3710369d0cd -msgid "Get the current workflow state of the object." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_state:7 -# cda263eca62440a193269e2906f9bf77 -msgid ":ref:`content_get_state_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_view:1 -# 53ffbd732f6f48f1a483eee8affd2c91 -msgid "Get a BrowserView object." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_view:9 -# 0a9be8b94ab64e0f8bdece21a96b36ba -msgid ":ref:`content_get_view_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.move:1 -# 877e71c230e44ddd9c1e679cdc8b0d20 -msgid "Move the object to the target container." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.move:19 -# 399c15c8491e4befad0833b29cfd38da -msgid ":ref:`content_move_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.transition:1 -# 6e915693ec7149439a514d431ece703b -msgid "Perform a workflow transition for the object." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.transition:8 -# 72be88c7672f49d28ea9e288e8b741a2 -msgid ":ref:`content_transition_example`" -msgstr "" - -#: ../api.rst:29 -# ec3a063514014d9d9268a536a7d047e8 -msgid "plone.api.user" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user:1 -# e34f3ef83133482f98e9cb15d9b64f08 -msgid "Module that provides functionality for user manipulation" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.create:1 -# bb70541d9f5f45fd89df311abd59ca8f -msgid "Create a user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.create:16 -# d4bb459885fb49448767b1438ca37982 -msgid ":ref:`user_create_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.delete:1 -# bff423c995774c90b1e30743f529ccb2 -msgid "Delete a user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.delete:3 -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_groups:3 -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:6 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:6 -# 9f29a91ce79943a087e3469f5b5bcb67 -# 595d518abd5640bd9c61bd5138a8856e -# c5a0b0f9135a4ba9ad03864c8cace061 -# 2a9932b358804917b6a2c5fe257400d0 -msgid "Arguments ``username`` and ``user`` are mutually exclusive. You can either set one or the other, but not both." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.delete:10 -# 3c233b0917fa4261929c47be9b5c0c7f -msgid ":ref:`user_delete_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get:1 -# 9b876ab8b33042d5ad11a3e9ab4cac06 -msgid "Get a user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get:7 -# cc1528fc437b4eeb9423ec7c27d2b8e2 -msgid ":ref:`user_get_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_all:1 -# 6757efe8204c4324b6eace604f993c02 -msgid "Return all users." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_all:5 -# 0d1a073d2eb34453b75a2333ebb4d80b -msgid ":ref:`users_get_all_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_current:1 -# 85933ce39466444a9cc3bc5bf03a16f0 -msgid "Get the currently logged-in user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_current:5 -# fad797ffa76343f5b10842067b9e8655 -msgid ":ref:`user_get_current_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_groups:1 -# 5539a428600d4b8a989e9a17d4d7198f -msgid "Get a list of groups that this user is a member of." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_groups:12 -# 64824e37b7304ac2a5b03197da067748 -msgid ":ref:`get_groups_for_user_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_permission:1 -# 454f9661c1d14d5e94da4a979f53ae4b -msgid "Check if the user has the specified permission on the given object." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_permission:3 -# b9aa6d5cfcf64f7dba40f05df0dda5a5 -msgid "Arguments ``username`` and ``user`` are mutually exclusive. You can either set one or the other, but not both. If no ``username` or ``user`` are provided, check the permission for the currently logged-in user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_permission:18 -# 67977c9d86ab456abc3a589d137054b3 -msgid ":ref:`user_has_permission_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_role:1 -# 2e42d02a35dc466e91b21720db806fea -msgid "Check if the user has the specified role." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_role:3 -# 546aef755ffd4f449937a7677aeefd95 -msgid "Arguments ``username`` and ``user`` are mutually exclusive. You can either set one or the other, but not both. If no ``username` or ``user`` are provided, check the role for the currently logged-in user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_role:15 -# 3f3ceb2126c3405fb2ca2ebabe5ad584 -msgid ":ref:`user_has_role_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.is_anonymous:1 -# d91cc75b9e96491d8f3470ee1069f24b -msgid "Check if the currently logged-in user is anonymous." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.is_anonymous:5 -# 2b78dc29035e4dd8b9c60b39155352c2 -msgid ":ref:`user_is_anonymous_example`" -msgstr "" - -#: ../api.rst:38 -# 2aaf99dc20854ad8a22ea6205f0b51b9 -msgid "plone.api.group" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group:1 -# f279ae96ae344242acf6f71d9e843dd9 -msgid "Module that provides functionality for group manipulation" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:1 -# 491b276889f1430694ca4a71cb114dbf -msgid "Add the user to a group." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:3 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete:3 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:3 -# e17c7a5ea09644bda379d031b4a1853e -# b23d1dade3fc495590712c2272be40b5 -# 761e88fb8a6c4383bafb92595d353a93 -msgid "Arguments ``groupname`` and ``group`` are mutually exclusive. You can either set one or the other, but not both." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:18 -# 405177031db144b49dce1ad695065ef1 -msgid ":ref:`add_user_to_group_example`" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.create:1 -# 8bb42712d4e449e28c6cb8587eea0ec5 -msgid "Create a group." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.create:15 -# 4cf76dc7f97040ffb25ccecefa2cafb6 -msgid ":ref:`group_create_example`" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete:1 -# a0839c07fdc649029c4e65cdda5a442e -msgid "Delete a group." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete:10 -# 43b5068e017f42df9cb9ced0bb3a832a -msgid ":ref:`group_delete_example`" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:1 -# 62497e62e68346b09615dc65391e2f31 -msgid "Remove the user from a group." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:18 -# e7e863e625014319918ea3f23503d6f1 -msgid ":ref:`delete_user_from_group_example`" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.get:1 -# f098c66479734dd0b4e96a97b85dc17b -msgid "Get a group." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.get:7 -# 03ffc92f775e4c2aae1d0a9f5376859e -msgid ":ref:`group_get_example`" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.get_all:1 -# 7c6b5cf3b95d44db9a4b2d1236b2e540 -msgid "Get all groups." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.get_all:5 -# d89352a5f90b4cac982b922b7744f8ff -msgid ":ref:`groups_get_all_example`" -msgstr "" - diff --git a/docs/locale/content.pot b/docs/locale/content.pot deleted file mode 100644 index 0f920332..00000000 --- a/docs/locale/content.pot +++ /dev/null @@ -1,183 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:42\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../content.rst:13 -# 9c3684417518454c99fe7761c79fc790 -msgid "Content" -msgstr "" - -#: ../content.rst:18 -# 17d54484019a44ffb67d0c59d2ffff80 -msgid "Create content" -msgstr "" - -#: ../content.rst:20 -# 7db4ecc7a40c4fe89ea6478e5dc392aa -msgid "First get the portal object that we will use as a container for new content:" -msgstr "" - -#: ../content.rst:27 -# 45b4fca9ff4f420191062a1d9ce1a9ca -msgid "If you want to create a new content item, use the :meth:`api.content.create` method. The type attribute will automatically decide which content type (dexterity, archetype, ...) should be created." -msgstr "" - -#: ../content.rst:39 -# 028654d6a1694823bd16748df9cf07ed -msgid "The ``id`` of the object gets generated (in a safe way) from its ``title``." -msgstr "" - -#: ../content.rst:49 -# f569b47bdbd947c1b88758c46b5624cb -msgid "Get content object" -msgstr "" - -#: ../content.rst:51 -# 849f7198c8ad4839b17c6e9eff648a4c -msgid "There are several approaches of getting to your content object. Consider the following portal structure::" -msgstr "" - -#: ../content.rst:79 -# 6c2b2d93a72c46a399f46ca1767b67d2 -msgid "You can do the following operations to get to various content objects in the stucture above, including using :meth:`api.content.get`." -msgstr "" - -#: ../content.rst:116 -# a5230131c1f24fc8a85489ed110bc0ef -msgid "Find content object" -msgstr "" - -#: ../content.rst:118 -# f3ab49e7ac084684b3f2f69c4df30a54 -msgid "You can use the *catalog* to search for content. Here is a simple example:" -msgstr "" - -#: ../content.rst:130 -# be8e110355ef4e7a8d8145d1644f114c -msgid "More about how to use the catalog and what parameters it supports is written in the `Collective Developer Documentation `_. Note that the catalog returns *brains* (metadata stored in indexes) and not objects. However, calling ``getObject()`` on brains does in fact give you the object." -msgstr "" - -#: ../content.rst:146 -# 93cafdef770b45f1bbf8b93b655045c6 -msgid "Move content" -msgstr "" - -#: ../content.rst:148 -# a645dc6c09f34bd783c6a3953b281021 -msgid "To move content around the portal structure defined above use :meth:`api.content.move` The code below moves the ``contact`` item (with all objects that it contains) out of folder ``about`` into the Plone portal root." -msgstr "" - -#: ../content.rst:165 -# 1c18a2aefe7d498db1abd9f2ae8b284e -msgid "Actually, ``move`` behaves like a filesystem move. If you pass it an ``id`` argument, you can define to what target ID the object will be moved to. Otherwise it will be moved with the same ID that it had." -msgstr "" - -#: ../content.rst:173 -# f7fa7b1fe56c4ba099f0dee9a1fd614c -msgid "Rename content" -msgstr "" - -#: ../content.rst:175 -# 88d79f67e17644049a75ad123e6619de -msgid "To rename, you still use the :meth:`api.content.move` method, just pass in a new ``id`` instead and omit ``target``." -msgstr "" - -#: ../content.rst:193 -# 30798118c7504fbeaabc1a018a7bd1e8 -msgid "Copy content" -msgstr "" - -#: ../content.rst:195 -# 981e07cb9573490bb085df463711f83b -msgid "To copy a content object, use the :meth:`api.content.copy`." -msgstr "" - -#: ../content.rst:205 -# a7b23db3ddd64c51834072c1bcafd68b -msgid "Note that the new object will have the same id as the old object (if not stated otherwise). This is not a problem, since the new object is in a different container." -msgstr "" - -#: ../content.rst:215 -# 5b5b763d8b5e477e9c0da93c4e28f0a1 -msgid "You can also omit ``target`` and set ``strict=False`` which will duplicate your content object in the same container and assign it a non-conflicting id." -msgstr "" - -#: ../content.rst:232 -# 0220c029b9bc4a5995409b30edb97244 -msgid "Delete content" -msgstr "" - -#: ../content.rst:234 -# 96d6ffdde3b94dd18624adc9e607b2c9 -msgid "Deleting content works by passing the object you want to delete to the :meth:`api.content.delete` method:" -msgstr "" - -#: ../content.rst:251 -# 1b5bf975185b48659523eb9ad6f0eb3e -msgid "Content manipulation with strict option" -msgstr "" - -#: ../content.rst:253 -# e486a81e09f84444ace8317e63b44a80 -msgid "When manipulating content with :meth:`api.content.create`, :meth:`api.content.move` and :meth:`api.content.copy` the strict option is enabled by default. This means the id will be enforced, if the id is taken on the target container the API method will raise an error." -msgstr "" - -#: ../content.rst:263 -# 494dac7d405e468b85865f2983effaa0 -msgid "If the strict option is disabled a non-conflicting id will be created." -msgstr "" - -#: ../content.rst:273 -# 0a50333f296d4d4e8333f83b68f1cf9a -msgid "Get workflow state" -msgstr "" - -#: ../content.rst:275 -# 64d2dce70fda41758826aa70cd389fc2 -msgid "To find out in which workflow state your content is, use :meth:`api.content.get_state`." -msgstr "" - -#: ../content.rst:292 -# 198f3848fbed4f2bb0926f875da7f11f -msgid "Transition" -msgstr "" - -#: ../content.rst:294 -# 6fb6023eee7444d49408b42b2eef6664 -msgid "To transition your content into a new state, use :meth:`api.content.transition`." -msgstr "" - -#: ../content.rst:313 -# b091a7a16bfe4d68a826d1a38bf914d2 -msgid "Browser view" -msgstr "" - -#: ../content.rst:315 -# 2f11f40a7ab64e339db3a193e0eed079 -msgid "To get a BrowserView for your content, use :meth:`api.content.get_view`." -msgstr "" - -#: ../content.rst:333 -# e5680d75d7354752a9d5644b9794207f -msgid "Further reading" -msgstr "" - -#: ../content.rst:335 -# 61cadf5dfc7340c4a51a242d904a6b76 -msgid "For more information on possible flags and usage options please see the full :ref:`plone-api-content` specification." -msgstr "" - diff --git a/docs/locale/es/LC_MESSAGES/about.po b/docs/locale/es/LC_MESSAGES/about.po deleted file mode 100644 index 83614321..00000000 --- a/docs/locale/es/LC_MESSAGES/about.po +++ /dev/null @@ -1,368 +0,0 @@ -# plone.api Spanish localization. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# Leonardo J. Caballero G. , 2012. -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: 2012-08-26 11:43-0430\n" -"Last-Translator: Leonardo J. Caballero G. \n" -"Language-Team: Leonardo J. Caballero G.\n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Virtaal 0.7.1\n" - -# d6f22570c4df4af3a574e56e6748fc1d -#: ../about.rst:10 -msgid "About" -msgstr "Acerca" - -# 929433e6861348b4a5c173e703ed6ad9 -#: ../about.rst:13 -msgid "Inspiration" -msgstr "Inspiracion" - -# e9e8b115f6d24517a79ee891cf2297d9 -#: ../about.rst:15 -msgid "We want `plone.api` to be developed with `PEP 20 `_ idioms in mind, in particular:" -msgstr "" - -# d89823a23f6342a2975e56a77adba8f1 -#: ../about.rst:25 -msgid "All contributions to `plone.api` should keep these important rules in mind." -msgstr "" - -# 2641bc6430754b5fb8624f062cfc7db6 -#: ../about.rst:27 -msgid "Two libraries are especially inspiring:" -msgstr "" - -# f8d45704bb874e76ade8bcf31be7e9f4 -#: ../about.rst:30 -msgid "Arguably, the reason for SQLAlchemy's success in the developer community lies as much in its feature set as in the fact that its API is very well designed, is consistent, explicit, and easy to learn." -msgstr "" - -# 8c74d41d7ba8484ab11acd9df4273b16 -#: ../about.rst:35 -msgid "As of this writing, this is still a very new library, but just looking at `a comparison between the urllib2 way and the requests way `_, as well as the rest of its documentation, one cannot but see a parallel between the way we *have been* and the way we *should be* writing code for Plone (or at least have that option)." -msgstr "" - -# 87089d43ce0a44bba5af3a77e5246e8e -#: ../about.rst:43 -msgid "Design decisions" -msgstr "" - -# 5b7444cac8054ac98be671d18ad03688 -#: ../about.rst:46 -msgid "Import and usage style" -msgstr "Importar y usar estilo" - -# 005c3be7a1a04dca8d2da44040cd1d1a -#: ../about.rst:48 -msgid "API methods are grouped by their field of usage: :ref:`chapter_portal`, :ref:`chapter_content`, :ref:`chapter_users` and :ref:`chapter_groups`. Hence the importing and usage of API methods look like this:" -msgstr "" - -# c9c9a8833de44d6a97bcc4447eed8e9c -#: ../about.rst:72 -msgid "In other words, always import the top-level package (``from plone import api``) and then use the group namespace to access the method you want (``url = api.portal.url()``)." -msgstr "" - -# 7bc0a6a949bb4b758cc2ce9173cc001a -#: ../about.rst:76 -msgid "All example code should adhere to this style, so we encourage one and only one prefered way of consuming API methods." -msgstr "" - -# 2ca6fed8d167492085b39481c1047292 -#: ../about.rst:81 -msgid "Prefer keyword arguments" -msgstr "" - -# 8d0e6860ddf64b1ebe06f7769f256556 -#: ../about.rst:83 -msgid "For the following reasons the example code in the API (and hence the recommendation to people on how to use it) shall always prefer using keyword instead of positional arguments:" -msgstr "" - -# 0ea03c5859fd4e35bf0aec1212cbea9c -#: ../about.rst:87 -msgid "There will never be a doubt when writing a method on whether an argument should be positional or not. Decision already made." -msgstr "" - -# 34202755affc4163bd7a848fd6e1823a -#: ../about.rst:89 -msgid "There will never be a doubt when using the API on which argument comes first, or which ones are named/positional. All arguments are named." -msgstr "" - -# 7047864e7a7b4f839e917da7a7b5bfab -#: ../about.rst:91 -msgid "When using positional arguments, the method signature is dictated by the underlying implementation. Think required vs. optional arguments. Named arguments are always optional in Python. This allows us to change implementation details and leave the signature unchanged. In other words, the underlying API code can change substantially and the code using it will remain valid." -msgstr "" - -# 023882595fae483da4d8a3db5f4fec25 -#: ../about.rst:97 -msgid "The arguments can all be passed as a dictionary." -msgstr "" - -# 49dbb84f82924e52992aad1d0824d049 -#: ../about.rst:99 -msgid "The API provides grouped functional access to otherwise distributed logic in Plone. Plone's original distribution of logic is a result of two things: The historic re-use of CMF- and Zope-methods and reasonable, but at first hard to understand splits like acl_users.* and portal_memberdata." -msgstr "" - -# c3164f2b1a7e4b489fadd5ccfaef9201 -#: ../about.rst:104 -msgid "That's why we've created a set of useful methods that implement best-practice access to the original distributed APIs. In this way we also document in code how to use Plone directly." -msgstr "" - -# 400b235775994ab4933199094575b49b -#: ../about.rst:109 -msgid "If you doubt those last sentences: We had five different ways to get the portal root with different edge-cases. We had three different ways to move an object. With this in mind, it's obvious that even the most simple tasks can't be documented in Plone in a sane way." -msgstr "" - -# ae5bf8585cdf40a7b516c93adf28df5f -#: ../about.rst:114 -msgid "Also, we don't intend to cover all possible use-cases. Only the most common ones. If you need to do something that `plone.api` does not support, just use the underlying APIs directly. We will cover 20% of tasks that are being done 80% of the time, and not one more." -msgstr "" - -# c66864ad865744e18813061cc8ced082 -#: ../about.rst:121 -msgid "FAQ" -msgstr "Preguntas frecuentes" - -# a090827ce88b418782abd0cc46a229ba -#: ../about.rst:124 -msgid "Why aren't we using wrappers?" -msgstr "" - -# e536bc62a3e44822a2c8785c26053635 -#: ../about.rst:126 -msgid "We could wrap an object (like a user) with an API to make it more usable right now. That would be an alternative to the convenience methods." -msgstr "" - -# fc5d947c300a42d4b7c3f087a6ef9f61 -#: ../about.rst:129 -msgid "But telling developers that they will get yet another object from the API which isn't the requested object, but an API-wrapped one instead, would be very hard. Also, making this wrap transparent in order to make the returned object directly usable would be nearly impossible, because we'd have to proxy all the :mod:`zope.interface` stuff, annotations and more." -msgstr "" - -# 837bc126d553440c93c39aa43ca60189 -#: ../about.rst:135 -msgid "Furthermore, we want to avoid people writing code like this in tests or their internal utility code and failing miserably in the future if wrappers would no longer be needed and would therefore be removed::" -msgstr "" - -# bcc8254ee1b247dd813aba43f5f0ab0f -#: ../about.rst:144 -msgid "Why ``delete`` instead of ``remove``?" -msgstr "" - -# c96fb6140a9545f8980123ff9f8ec15f -#: ../about.rst:146 -msgid "The underlying code uses methods that are named more similarly to *delete* rather than to *remove*" -msgstr "" - -# 5c900c509c0b48529299e8bc94e2ab0e -#: ../about.rst:148 -msgid "``CRUD`` has *delete*, not *remove*." -msgstr "" - -# 4554d121841943098de957f2c4fc2b32 -#: ../about.rst:152 -msgid "Roadmap" -msgstr "Mapa de ruta" - -# 487b3b9fbaaf4e82ae1cc7f3bfdfc1e1 -#: ../about.rst:155 -msgid "Short term" -msgstr "Termino corto" - -# a6b64c3db42040a797cadb746b2ea05a -#: ../about.rst:157 -msgid "In the short-term, we are planning to add more api methods to `plone.api`. An up-to-date list of them (and ideas for them) can be found `on GitHub `_." -msgstr "" - -# 3b191b831a214a4eaf85c54fd5ef9692 -#: ../about.rst:161 -msgid "TODO: add this to GitHub issues:" -msgstr "" - -# e585d0d977ed404181ab3c169ebc252b -#: ../about.rst:163 -msgid "descriptive error messages" -msgstr "" - -# 35404a62561746ff999ce0c2f99bbfb9 -#: ../about.rst:165 -msgid "see where code breaks with stupid messages" -msgstr "" - -# a939473deae94fcbae4dbc5192f422d1 -#: ../about.rst:166 -msgid "catch them and make them more descriptive" -msgstr "" - -# b42f91dec6a44afc8c98eac2e40fd30f -#: ../about.rst:167 -msgid "have a list of all possible error messages, what they mean and how to overcome them" -msgstr "" - -# 83cde3bc79e74fe3a7c27e7e5fcedcb7 -#: ../about.rst:172 -msgid "Medium- to long-term:" -msgstr "" - -# 406534e02e3d4d4bb59179d67320bdf5 -#: ../about.rst:174 -msgid "Below is a collection of ideas we have for the long run, in no particular order:" -msgstr "" - -# fc9613d9d50b492aa3852904cd881fd2 -#: ../about.rst:176 -msgid "api.role context manager (to use with ``with``)" -msgstr "" - -# 175cd90565fc46e08bd3e4e4a8101a24 -#: ../about.rst:186 -msgid "api.env" -msgstr "" - -# 1db6566780284ce996487731ec2b03e3 -#: ../about.rst:188 -msgid "debug_mode, test_mode booleans (to check if you are in debug/test)" -msgstr "" - -# ce8c67593e384265bc723eca914177de -#: ../about.rst:189 -msgid "zope/plone version info" -msgstr "" - -# 163d0f7a14694be0a4c14c57d8a8a686 -#: ../about.rst:191 -msgid "api.system" -msgstr "" - -# 2c2a9ab8dd5a46f5b3280ebe52e79645 -#: ../about.rst:193 -msgid "for sysadmin tasks" -msgstr "" - -# 0fcdc7da8b9243e0ab462007a148448e -#: ../about.rst:194 -msgid "run upgrades, stay up-to-date" -msgstr "" - -# ab78f927417e45e9ac62447ea77035ca -#: ../about.rst:195 -msgid "cleanup broken objects, interfaces, utilities, etc." -msgstr "" - -# c6f6445a1629431abc0c8c506da2bfbf -#: ../about.rst:196 -msgid "mounting things" -msgstr "" - -# c164ef626e3f47119c6f1a55bba020f4 -#: ../about.rst:198 -msgid "unify permissions" -msgstr "" - -# e4513dfbe1ca4cc6bc2896d774cbcd9d -#: ../about.rst:200 -msgid "have all different types of permission in one place and one way to use them" -msgstr "" - -# de48cceafe494012b3a4e00b312869da -#: ../about.rst:202 -msgid "style guide" -msgstr "guía de estilo" - -# 3c016cfe70ca40599c0b8350d4e2291c -#: ../about.rst:204 -msgid "have a style guide for how Plone files should be formatted -- this needs to be finalized before we start fixing underlying APIs so new code can use the style guide" -msgstr "" - -# 4f9d840985b74a33aa25e0e91da3db3e -#: ../about.rst:207 -msgid "define guidelines for:" -msgstr "" - -# db52052e5bfa4ec38fdc66ec3b150c54 -#: ../about.rst:209 -msgid "python" -msgstr "" - -# b6cdd747740e414ab6f50fccbfd7254b -#: ../about.rst:210 -msgid "javascript" -msgstr "" - -# 8bb905e5282c46599265eb0a932cc9f4 -#: ../about.rst:211 -msgid "rst" -msgstr "" - -# 33e7fd9b7d534ccfbfe6f0d4c8587eb2 -#: ../about.rst:212 -msgid "zpt" -msgstr "" - -# 13360f966e55431286b579d3a7c72754 -#: ../about.rst:213 -msgid "xml" -msgstr "" - -# 140f91230bfc4a2d84080f970c617df8 -#: ../about.rst:214 -msgid "zcml" -msgstr "" - -# 9668b4e8cad9420a957e8b6df1660c99 -#: ../about.rst:216 -msgid "rewrite sub-optimal underlying APIs and deprecate plone.api methods, but leave the (updated) documentation:" -msgstr "" - -# 25328c2383a84fd6ba22535d598e395c -#: ../about.rst:219 -msgid "getting/setting member properties" -msgstr "obteniendo y definiendo propiedades del miembro" - -# 584f892ab7244865b1a2b49cb97aa68a -#: ../about.rst:220 -msgid "tools:" -msgstr "herramientas:" - -# e1d613379ffa4eb28dc4e3e501804c02 -#: ../about.rst:222 -msgid "portal_groupdata, portal_groups, portal_memberdata, portal_membership" -msgstr "" - -# a7acf5e33c8143bdbc795f91a5efb8ec -#: ../about.rst:223 -msgid "portal_quickinstaller, portal_undo" -msgstr "" - -# 6b9ef5601701414aa5ccd6b3f4341d29 -#: ../about.rst:225 -msgid "JSON webservices" -msgstr "webservices JSON" - -# 92bec24c8e07438e8f1d122ab3c92e32 -#: ../about.rst:227 -msgid "probably in a separate package plone.jsonapi" -msgstr "" - -# 367e892699c84897b09c682ed291af64 -#: ../about.rst:228 -msgid "one view (@@jsonapi for example) that you can call in your JS and be sure it won't change" -msgstr "" - -# 16d8483cf95c4e1989fc7c1a0dc42b75 -#: ../about.rst:230 -msgid "easier to AJAXify stuff" -msgstr "" - -# 2da8280a5b07495c8a7be4da287fd4de -#: ../about.rst:232 -msgid "Flask-type url_for_view() and view_for_url()" -msgstr "" diff --git a/docs/locale/es/LC_MESSAGES/api.po b/docs/locale/es/LC_MESSAGES/api.po deleted file mode 100644 index 4a5401f6..00000000 --- a/docs/locale/es/LC_MESSAGES/api.po +++ /dev/null @@ -1,386 +0,0 @@ -# plone.api Spanish localization. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# Leonardo J. Caballero G. , 2012. -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: 2012-08-26 12:13-0430\n" -"Last-Translator: Leonardo J. Caballero G. \n" -"Language-Team: Leonardo J. Caballero G.\n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Virtaal 0.7.1\n" - -# 480a38b206b2475391f2d3d79c8e9969 -#: ../api.rst:11 -msgid "plone.api.portal" -msgstr "plone.api.portal" - -# 51b11cc6c4a94ba6bd4ce7efbf19fb72 -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get:1 -#, fuzzy -msgid "Get the Plone portal object out of thin air without importing fancy Interfaces and doing multi adapter lookups." -msgstr "" -"Obtener el objeto portal Plone de la nada, sin importar las Interfaces y " -"hacer búsquedas múltiples adaptadores." - -# 9661f7993fb941e9ad8a6f77abeebc8c -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get:5 -msgid ":ref:`portal_get_example`" -msgstr "" - -# 9946f74dbe4f4942a84685c422b70204 -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get_tool:1 -msgid "Get a portal tool in a simple way." -msgstr "Obtener una herramienta del portal de una simple forma." - -# 303d4142b78643159543af2eced7d8d2 -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get_tool:6 -msgid ":ref:`portal_get_tool_example`" -msgstr "" - -# 14a5048acbf647fdab38e1d72fb93210 -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:1 -msgid "Display a date/time in a user-friendly way." -msgstr "Muestra una fecha/hora de una forma amigable al usuario." - -# 0e98e961b9b14bacad2c19c9df1f5b58 -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:3 -msgid "It should be localized to the user's preferred language." -msgstr "" - -# 538f804bfd914d93883b586bb739c98b -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:5 -msgid "Note that you can specify both long_format and time_only as True (or any other value that can be converted to a boolean True value), but time_only then wins: the long_format value is ignored." -msgstr "" - -# 313967f5c5a145e28bf9f6d9c6dc6da6 -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:17 -msgid ":ref:`portal_localized_time_example`" -msgstr "" - -# b8bf9ef5bab64ae09fdce8ea2756f83b -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.send_email:1 -msgid "Send an email." -msgstr "Enviar un correo electrónico." - -# 21d22f52555f4f6dbee4e6aa5a0a76a8 -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.send_email:12 -msgid ":ref:`portal_send_email_example`" -msgstr "" - -# 5abb28404c9a4d78883da28239200d61 -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.show_message:1 -msgid "Display a status message." -msgstr "Mostrar un mensaje de estatus." - -# 7c23da81ee494e8d925432984376b7af -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.show_message:9 -msgid ":ref:`portal_show_message_example`" -msgstr "" - -# 84a23dad8bad40eb83e5e4ff3ecb0a4d -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.url:1 -msgid "Get the portal url." -msgstr "Obtener la url del portal." - -# c78fe44107b64f0abde3b93823397f7d -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.url:5 -msgid ":ref:`portal_url_example`" -msgstr "" - -# 2848de370f5e4baca839997fec889cd1 -#: ../api.rst:20 -msgid "plone.api.content" -msgstr "" - -# 2f0a375446974867b4a6baf1dfa889c6 -#: ../../src/plone/api/content.py:docstring of plone.api.content:1 -msgid "Module that provides functionality for content manipulation" -msgstr "" - -# c8d6ede085604149bf0b8083f8e14670 -#: ../../src/plone/api/content.py:docstring of plone.api.content.copy:1 -msgid "Copy the object to the target container." -msgstr "Copia el objeto a contenedor destino." - -# 518dce2c419a40b9932cf8e27cbfd850 -#: ../../src/plone/api/content.py:docstring of plone.api.content.copy:19 -msgid ":ref:`content_copy_example`" -msgstr "" - -# 8bba347c47354866af427c267ef16883 -#: ../../src/plone/api/content.py:docstring of plone.api.content.create:1 -msgid "Create a new content item." -msgstr "Crear un nuevo elemento de contenido." - -# 4224826f335e496ba2b874e1bf7615ec -#: ../../src/plone/api/content.py:docstring of plone.api.content.create:22 -msgid ":ref:`content_create_example`" -msgstr "" - -# 10937e6316e54b749aeaf287859565d8 -#: ../../src/plone/api/content.py:docstring of plone.api.content.delete:1 -msgid "Delete the object." -msgstr "Eliminar el objeto." - -# 4052f87bbb4342a3a9d1d46a55c4cdf2 -#: ../../src/plone/api/content.py:docstring of plone.api.content.delete:5 -msgid ":ref:`content_delete_example`" -msgstr "" - -# d4c2d8a6d5c84ce782c579d4037e5908 -#: ../../src/plone/api/content.py:docstring of plone.api.content.get:1 -msgid "Get an object." -msgstr "Obtener un objeto." - -# c26cfff6cbd04cf8b12b0ea6e5e2d9ca -#: ../../src/plone/api/content.py:docstring of plone.api.content.get:9 -msgid ":ref:`content_get_example`" -msgstr "" - -# 8141774ea6104054a66a936c6f580b7c -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_state:1 -msgid "Get the current workflow state of the object." -msgstr "Obtener el actual flujo de trabajo del objeto." - -# 372de95e5ecc4d3fa6f541eb028f773a -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_state:7 -msgid ":ref:`content_get_state_example`" -msgstr "" - -# a508d86d35cd492482c3d7cab7082084 -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_view:1 -msgid "Get a BrowserView object." -msgstr "Obtener un objeto BrowserView." - -# c2a4fa03f54749aba8d081d78842f003 -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_view:9 -msgid ":ref:`content_get_view_example`" -msgstr "" - -# 6215d3c9916446c68403e1034d5a927e -#: ../../src/plone/api/content.py:docstring of plone.api.content.move:1 -msgid "Move the object to the target container." -msgstr "Mover el objeto a el contenedor destino." - -# 6fb1f02cd33342c885d78d17ec327b82 -#: ../../src/plone/api/content.py:docstring of plone.api.content.move:19 -msgid ":ref:`content_move_example`" -msgstr "" - -# aa53251f9f2f4e49902283068ac3ecbe -#: ../../src/plone/api/content.py:docstring of plone.api.content.transition:1 -msgid "Perform a workflow transition for the object." -msgstr "" - -# e6f66b38694f4959bb2b4613404b16a6 -#: ../../src/plone/api/content.py:docstring of plone.api.content.transition:8 -msgid ":ref:`content_transition_example`" -msgstr "" - -# 14a1dceb0e7a48bd89da5bd88d041212 -#: ../api.rst:29 -msgid "plone.api.user" -msgstr "" - -# 5e134ab2814f4d5db9a75ba6071f352a -#: ../../src/plone/api/user.py:docstring of plone.api.user:1 -msgid "Module that provides functionality for user manipulation" -msgstr "" - -# 8a3d40c144114f4abe0585639dc0562b -#: ../../src/plone/api/user.py:docstring of plone.api.user.create:1 -msgid "Create a user." -msgstr "Crea un usuario." - -# 66ae0183575f40b989624dc5a82cd082 -#: ../../src/plone/api/user.py:docstring of plone.api.user.create:16 -msgid ":ref:`user_create_example`" -msgstr "" - -# 21730d259f724349b488646eb197bd0d -#: ../../src/plone/api/user.py:docstring of plone.api.user.delete:1 -msgid "Delete a user." -msgstr "Eliminar un usuario." - -# 033fc14da1c84dbfbaccdc9fe680ca40 -# 95d40533be9647188c051c95a55773f7 -# de3567855b3b42c99da50b5e796fa067 -# 2d4d6a39c05b474cbcd548b409de4e66 -#: ../../src/plone/api/user.py:docstring of plone.api.user.delete:3 -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_groups:3 -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:6 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:6 -msgid "Arguments ``username`` and ``user`` are mutually exclusive. You can either set one or the other, but not both." -msgstr "" - -# 0b4127e5b1244f14b650f5457b89361c -#: ../../src/plone/api/user.py:docstring of plone.api.user.delete:10 -msgid ":ref:`user_delete_example`" -msgstr "" - -# b8379a06e39f4fd1a4243935fd6d6cb7 -#: ../../src/plone/api/user.py:docstring of plone.api.user.get:1 -msgid "Get a user." -msgstr "Obtener un usuario." - -# 8d731b07d107459ebbd9b184ee722bdc -#: ../../src/plone/api/user.py:docstring of plone.api.user.get:7 -msgid ":ref:`user_get_example`" -msgstr "" - -# 67cc68a80d4a4298930d416b4949743c -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_all:1 -msgid "Return all users." -msgstr "Devuelve todos los usuarios." - -# 186e401e18444e55bacd15cba8690780 -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_all:5 -msgid ":ref:`users_get_all_example`" -msgstr "" - -# 61b837494178416ca10271e98fada1fc -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_current:1 -msgid "Get the currently logged-in user." -msgstr "Obtiene el usuario actualmente iniciado sesión." - -# 5cbc0c81860849f6859ad5f201641cee -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_current:5 -msgid ":ref:`user_get_current_example`" -msgstr "" - -# fe8a9759d0454a4cacb32f01e8f328ba -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_groups:1 -msgid "Get a list of groups that this user is a member of." -msgstr "Obtener una lista de los grupos que el usuario es miembro." - -# 135d4af554d34a899aca449584552f3c -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_groups:12 -msgid ":ref:`get_groups_for_user_example`" -msgstr "" - -# 8eeb2b36b2f3490b8f52fbd28c9cf1c0 -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_permission:1 -msgid "Check if the user has the specified permission on the given object." -msgstr "" - -# 280dfb6f06294ee1a024c3bd6e5b1dc6 -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_permission:3 -msgid "Arguments ``username`` and ``user`` are mutually exclusive. You can either set one or the other, but not both. If no ``username` or ``user`` are provided, check the permission for the currently logged-in user." -msgstr "" - -# 3aa8154b81c441a485bf8d6f63a06578 -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_permission:18 -msgid ":ref:`user_has_permission_example`" -msgstr "" - -# 043da8f8753a473a99ac14f97ee83f9e -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_role:1 -msgid "Check if the user has the specified role." -msgstr "" - -# 096b857c8b2e4780bc7a31d32fe8db76 -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_role:3 -msgid "Arguments ``username`` and ``user`` are mutually exclusive. You can either set one or the other, but not both. If no ``username` or ``user`` are provided, check the role for the currently logged-in user." -msgstr "" - -# ef5946ed1be74b1a960f03ae3610f2bc -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_role:15 -msgid ":ref:`user_has_role_example`" -msgstr "" - -# 615f8b9f05b34c1d8dac2a8e7088a18d -#: ../../src/plone/api/user.py:docstring of plone.api.user.is_anonymous:1 -msgid "Check if the currently logged-in user is anonymous." -msgstr "" - -# 7af2eef10d65478ebf2a2edaf88ab09d -#: ../../src/plone/api/user.py:docstring of plone.api.user.is_anonymous:5 -msgid ":ref:`user_is_anonymous_example`" -msgstr "" - -# d9f0041ca1ce478590146e53900b2189 -#: ../api.rst:38 -msgid "plone.api.group" -msgstr "" - -# 64cdbec2cb454ce493214db7c1a427c1 -#: ../../src/plone/api/group.py:docstring of plone.api.group:1 -msgid "Module that provides functionality for group manipulation" -msgstr "" - -# c2d15c31611f41cba41d1910284d49b7 -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:1 -msgid "Add the user to a group." -msgstr "Agregar el usuario a un grupo" - -# 9eb142ce333c4e41b0276ab74ad7ac37 -# 09af61d0819e4826b442cfd33706e1d8 -# a7e16e93d6254c22bb0c9efc560ae2a3 -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:3 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete:3 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:3 -msgid "Arguments ``groupname`` and ``group`` are mutually exclusive. You can either set one or the other, but not both." -msgstr "" - -# 8f13dc96088443b88528f9646a707047 -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:18 -msgid ":ref:`add_user_to_group_example`" -msgstr "" - -# 3d60a49da6b94380988979c46a798e40 -#: ../../src/plone/api/group.py:docstring of plone.api.group.create:1 -msgid "Create a group." -msgstr "Crear un grupo." - -# 2ae0c92c4f0f4d97bf77fd48f5c4718d -#: ../../src/plone/api/group.py:docstring of plone.api.group.create:15 -msgid ":ref:`group_create_example`" -msgstr "" - -# f56a876af5164c4bb2d8b12850a3082e -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete:1 -msgid "Delete a group." -msgstr "Eliminar un grupo." - -# 60197691ac8547c3a458bb8f153e3e31 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete:10 -msgid ":ref:`group_delete_example`" -msgstr "" - -# 0d55877112a340ddba8b5d5036fc8b51 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:1 -msgid "Remove the user from a group." -msgstr "Eliminar el usuario desde un grupo." - -# 6b9f5d17c1b7444694463a0cfcfe4b52 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:18 -msgid ":ref:`delete_user_from_group_example`" -msgstr "" - -# a5656b2cda6f47d4bed5df1864769206 -#: ../../src/plone/api/group.py:docstring of plone.api.group.get:1 -msgid "Get a group." -msgstr "Obtener un grupo." - -# 1ae80c16441845188c1defe728d3f6bd -#: ../../src/plone/api/group.py:docstring of plone.api.group.get:7 -msgid ":ref:`group_get_example`" -msgstr "" - -# 4d0292acb5474e5e9a70dbe4eb835be1 -#: ../../src/plone/api/group.py:docstring of plone.api.group.get_all:1 -msgid "Get all groups." -msgstr "Obtener todos los grupos." - -# 69399a9ba20048a184be5a0ecdacb861 -#: ../../src/plone/api/group.py:docstring of plone.api.group.get_all:5 -msgid ":ref:`groups_get_all_example`" -msgstr "" diff --git a/docs/locale/es/LC_MESSAGES/content.po b/docs/locale/es/LC_MESSAGES/content.po deleted file mode 100644 index 5ef083e2..00000000 --- a/docs/locale/es/LC_MESSAGES/content.po +++ /dev/null @@ -1,183 +0,0 @@ -# plone.api Spanish localization. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# Leonardo J. Caballero G. , 2012. -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: 2012-08-26 11:46-0430\n" -"Last-Translator: Leonardo J. Caballero G. \n" -"Language-Team: Leonardo J. Caballero G.\n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Virtaal 0.7.1\n" - -# f9808c16c46747b79877b4e590f587ea -#: ../content.rst:13 -msgid "Content" -msgstr "Contenido" - -# f064bf432ab84f3d889e492d31b4ad7d -#: ../content.rst:18 -msgid "Create content" -msgstr "Crear contenido" - -# c38f4ce1405b405fa5edcff6f1d68034 -#: ../content.rst:20 -msgid "First get the portal object that we will use as a container for new content:" -msgstr "" - -# 57ea2a1f70a244dba586b91d3d3cf777 -#: ../content.rst:27 -msgid "If you want to create a new content item, use the :meth:`api.content.create` method. The type attribute will automatically decide which content type (dexterity, archetype, ...) should be created." -msgstr "" - -# b7195471a9314758a518d34d91fcebdb -#: ../content.rst:39 -msgid "The ``id`` of the object gets generated (in a safe way) from its ``title``." -msgstr "" - -# d9bc13c7bfd24ec2a9db5afad7aeb8de -#: ../content.rst:49 -msgid "Get content object" -msgstr "Obtener el contenido del objeto" - -# b15f9e177058456f86c049297eeaa2d4 -#: ../content.rst:51 -msgid "There are several approaches of getting to your content object. Consider the following portal structure::" -msgstr "" - -# 388e8767723947de9f5de13c84f352d0 -#: ../content.rst:79 -msgid "You can do the following operations to get to various content objects in the stucture above, including using :meth:`api.content.get`." -msgstr "" - -# e5ac677d7e9e42ecbdbedca9b8e61e94 -#: ../content.rst:116 -msgid "Find content object" -msgstr "Buscar el contenido del objeto" - -# b7ec0d1aa3144acb8e0f5ddf65276e9d -#: ../content.rst:118 -msgid "You can use the *catalog* to search for content. Here is a simple example:" -msgstr "" - -# 87821035cbff4c288418f6dc77c8f253 -#: ../content.rst:130 -msgid "More about how to use the catalog and what parameters it supports is written in the `Collective Developer Documentation `_. Note that the catalog returns *brains* (metadata stored in indexes) and not objects. However, calling ``getObject()`` on brains does in fact give you the object." -msgstr "" - -# cd37b225d62f4ada8a9c53b8a59058c2 -#: ../content.rst:146 -msgid "Move content" -msgstr "Mover contenido" - -# fdf12cc1429d4f04b2f0f7b34e7d597f -#: ../content.rst:148 -msgid "To move content around the portal structure defined above use :meth:`api.content.move` The code below moves the ``contact`` item (with all objects that it contains) out of folder ``about`` into the Plone portal root." -msgstr "" - -# edb0085b525a42178c0fac496ff20803 -#: ../content.rst:165 -msgid "Actually, ``move`` behaves like a filesystem move. If you pass it an ``id`` argument, you can define to what target ID the object will be moved to. Otherwise it will be moved with the same ID that it had." -msgstr "" - -# 1dcf5261803b493399da52b63bc3fbea -#: ../content.rst:173 -msgid "Rename content" -msgstr "Renombrar contenido" - -# faa9fcef181849569584a26275e7667c -#: ../content.rst:175 -msgid "To rename, you still use the :meth:`api.content.move` method, just pass in a new ``id`` instead and omit ``target``." -msgstr "" - -# f2e3484ddb1c483b9a6ec53b684772f3 -#: ../content.rst:193 -msgid "Copy content" -msgstr "Copiar contenido" - -# e2a2b16d6f3f49af8c353fed03e7f1bc -#: ../content.rst:195 -msgid "To copy a content object, use the :meth:`api.content.copy`." -msgstr "" - -# b3ce7ee6963342b88a852087c1d85eac -#: ../content.rst:205 -msgid "Note that the new object will have the same id as the old object (if not stated otherwise). This is not a problem, since the new object is in a different container." -msgstr "" - -# b71261866c1f4b16a0dcd9f18e38d75a -#: ../content.rst:215 -msgid "You can also omit ``target`` and set ``strict=False`` which will duplicate your content object in the same container and assign it a non-conflicting id." -msgstr "" - -# 07547cfbc8c244a382bcc2a21326db69 -#: ../content.rst:232 -msgid "Delete content" -msgstr "Borrar contenido" - -# 92e3474f9db24822a3cf4b61fc166634 -#: ../content.rst:234 -msgid "Deleting content works by passing the object you want to delete to the :meth:`api.content.delete` method:" -msgstr "" - -# 2c95b661210b42289b1162e38e253692 -#: ../content.rst:251 -msgid "Content manipulation with strict option" -msgstr "" - -# dfb38ff46fe7475085f3bdfc144ce884 -#: ../content.rst:253 -msgid "When manipulating content with :meth:`api.content.create`, :meth:`api.content.move` and :meth:`api.content.copy` the strict option is enabled by default. This means the id will be enforced, if the id is taken on the target container the API method will raise an error." -msgstr "" - -# 7739a32517b84869be510a2c329b2649 -#: ../content.rst:263 -msgid "If the strict option is disabled a non-conflicting id will be created." -msgstr "" - -# bd86a51620624dada144ac6c9e241ef1 -#: ../content.rst:273 -msgid "Get workflow state" -msgstr "Obtener estado de flujo de trabajo" - -# 46329475116d4a33b5d618f60e5eb2bd -#: ../content.rst:275 -msgid "To find out in which workflow state your content is, use :meth:`api.content.get_state`." -msgstr "" - -# fffb873c06a54e14a968609cace8589e -#: ../content.rst:292 -msgid "Transition" -msgstr "Transición" - -# 0b8c3d4abe9f41fb94aadf9efdbe8d66 -#: ../content.rst:294 -msgid "To transition your content into a new state, use :meth:`api.content.transition`." -msgstr "" - -# 5079fd47c007477b95bef5e7de5e3b2d -#: ../content.rst:313 -msgid "Browser view" -msgstr "" - -# ff2672996a6b46eea6f8df8ce3201cf1 -#: ../content.rst:315 -msgid "To get a BrowserView for your content, use :meth:`api.content.get_view`." -msgstr "" - -# 9a005ae8ef174043bd06dfcf63b69485 -#: ../content.rst:333 -msgid "Further reading" -msgstr "Más información" - -# 1f6d92cc6a984056a3ebb6150b697029 -#: ../content.rst:335 -msgid "For more information on possible flags and usage options please see the full :ref:`plone-api-content` specification." -msgstr "" diff --git a/docs/locale/es/LC_MESSAGES/groups.po b/docs/locale/es/LC_MESSAGES/groups.po deleted file mode 100644 index 4100edb9..00000000 --- a/docs/locale/es/LC_MESSAGES/groups.po +++ /dev/null @@ -1,98 +0,0 @@ -# plone.api Spanish localization. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# Leonardo J. Caballero G. , 2012. -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: 2012-08-26 11:49-0430\n" -"Last-Translator: Leonardo J. Caballero G. \n" -"Language-Team: Leonardo J. Caballero G.\n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Virtaal 0.7.1\n" - -# 9e122e7a75ac459686b27ce95ff81b2c -#: ../groups.rst:13 -msgid "Groups" -msgstr "Grupos" - -# cd6fabd9120a4f86a81fcea9cad45b5f -#: ../groups.rst:18 -msgid "Create group" -msgstr "Crear grupo" - -# da45a6ae32c54cfda3b81ded153f7c47 -#: ../groups.rst:20 -msgid "To create a new portal group, use :meth:`api.group.create`." -msgstr "" - -# 149e8a041c8744f8a37a81c03026f964 -#: ../groups.rst:31 -msgid "When creating groups ``title``, ``description``, ``roles`` and ``groups`` are optional." -msgstr "" - -# 47bc8e1452fb449bbc948322f5a674c2 -#: ../groups.rst:56 -msgid "Get group" -msgstr "Obtener grupo" - -# f3e7f6198fcf4c229c3760ec6d321b20 -#: ../groups.rst:58 -msgid "To get a group by it's name, use :meth:`api.group.get`." -msgstr "" - -# 4130edd849d0404594ca596cf49c2354 -#: ../groups.rst:73 -msgid "Editing a group" -msgstr "Editar un grupo" - -# 2f9267af057645c690cce6e99a634f8c -#: ../groups.rst:75 -msgid "Groups can be edited by using the ``group_tool``. In this example the ``title``, ``description`` and ``roles`` are updated for the group 'Staff'." -msgstr "" - -# f0352146c1a648f2aee5bc2ed06cdc87 -#: ../groups.rst:103 -msgid "Get all groups" -msgstr "Obtener todos los grupos" - -# d4a47757b5c04627b8edfcf7ccca4361 -#: ../groups.rst:105 -msgid "You can also get all groups, by using :meth:`api.group.get_all`." -msgstr "" - -# 2c387b09ea95471493a587b11d5a52f2 -#: ../groups.rst:120 -msgid "Delete group" -msgstr "Borrar grupo" - -# d35743255adc4169a5fcd366aacc4729 -#: ../groups.rst:122 -msgid "To delete a group, use :meth:`api.group.delete` and pass in either the groupname or the group object you want to delete." -msgstr "" - -# bacaba3724d14de4adc1a4afdcc88c4f -#: ../groups.rst:145 -msgid "Adding user to group" -msgstr "Agregar usuario a grupo" - -# f05d93fbc61c43f8a22fab1f34ddd0d1 -#: ../groups.rst:147 -msgid "The ``add_user`` method accepts either the groupname or the group object of the target group and the username or the user object you want to add to the group." -msgstr "" - -# 12480286674a46bfb9e16c9e03dbb9c0 -#: ../groups.rst:171 -msgid "Deleting user from group" -msgstr "Eliminando un usuario desde un grupo" - -# 33d87dcabec046e6965ba42c5189ff88 -#: ../groups.rst:173 -msgid "The ``delete_user`` method accepts either the groupname or the group object of the target group and either the username or the user object you want to remove from the group." -msgstr "" diff --git a/docs/locale/es/LC_MESSAGES/index.po b/docs/locale/es/LC_MESSAGES/index.po deleted file mode 100644 index 7c324b0f..00000000 --- a/docs/locale/es/LC_MESSAGES/index.po +++ /dev/null @@ -1,83 +0,0 @@ -# plone.api Spanish localization. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# Leonardo J. Caballero G. , 2012. -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: 2012-08-26 11:49-0430\n" -"Last-Translator: Leonardo J. Caballero G. \n" -"Language-Team: Leonardo J. Caballero G.\n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Virtaal 0.7.1\n" - -# 36a498fd29f44ea08b73a81e9575712b -#: ../index.rst:10 -msgid "A Plone API" -msgstr "Una API para Plone" - -# 2d772929e66f41f49b270dd4f9841235 -#: ../index.rst:14 -msgid "The :mod:`plone.api` is an elegant and simple API, built for humans wishing to develop with Plone." -msgstr "" - -# 8734d5794e9e4767a682abb425197da8 -#: ../index.rst:17 -msgid "It comes with *cookbook*-like documentation with step-by-step instructions for doing common development tasks in Plone. Recipes try to assume the user does not have extensive knowledge about Plone internals." -msgstr "" - -# de356adae1744fa0b7659b9861ec432b -#: ../index.rst:21 -msgid "The intention of this package is to be transitional. It points out which parts of Plone are particularly nasty -- we wish they get fixed so we can deprecate *plone.api* methods that cover them up, but leave the documentation in place." -msgstr "" - -# a77ac56676014f9383515b6ef53ac99b -#: ../index.rst:25 -msgid "Some parts of documentation already are this way: they don't use *plone.api* methods directly, but simply provide guidance on achiving a task using Plone's internals. Example: usage of the catalog in :ref:`content_find_example`." -msgstr "" - -# 08a89e1f7ffa4b0ab2348f84446a726e -#: ../index.rst:29 -msgid "The intention is to cover 20% of tasks we do 80% of the time. Keeping everything in one place helps keep the API introspectable and discoverable, which are important aspects of being Pythonic." -msgstr "" - -# a972eb56a166473b9f27f685f7f3914a -#: ../index.rst:35 -msgid "This package is still under heavy development. Do not use it yet unless you are completely sure what you are doing." -msgstr "" - -# f870fce2dcd64b0295053823ae2644c9 -#: ../index.rst:40 -msgid "Narrative documentation" -msgstr "" - -# 6729934995ca48dea471df348aebe55b -#: ../index.rst:53 -msgid "Complete API and advanced usage" -msgstr "" - -# 9dab33e814754aa3b5a95633ad02e0ab -#: ../index.rst:61 -msgid "Indices and tables" -msgstr "" - -# bfaad08851ee498d8004eb526a1dc3d1 -#: ../index.rst:63 -msgid ":ref:`genindex`" -msgstr "" - -# 08a9699e06de4c80a9c5eee2bbe5b82a -#: ../index.rst:64 -msgid ":ref:`modindex`" -msgstr "" - -# 9f6cfa3173aa4119bd9450ae352c414b -#: ../index.rst:65 -msgid ":ref:`search`" -msgstr "" diff --git a/docs/locale/es/LC_MESSAGES/portal.po b/docs/locale/es/LC_MESSAGES/portal.po deleted file mode 100644 index 468d48c3..00000000 --- a/docs/locale/es/LC_MESSAGES/portal.po +++ /dev/null @@ -1,83 +0,0 @@ -# plone.api Spanish localization. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# Leonardo J. Caballero G. , 2012. -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: 2012-08-26 11:52-0430\n" -"Last-Translator: Leonardo J. Caballero G. \n" -"Language-Team: Leonardo J. Caballero G.\n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Virtaal 0.7.1\n" - -# dadb9d29f6804082aa01070a3cfc9102 -#: ../portal.rst:13 -msgid "Portal" -msgstr "Portal" - -# 8db8368037e64f5abd7a745568aa6b8d -#: ../portal.rst:18 -msgid "Get portal url" -msgstr "Obtener la url del portal" - -# 85af7a05697d439b881952dad55b00a1 -#: ../portal.rst:20 -msgid "A shortcut for getting the url of the portal is now always at hand: :meth:`api.portal.url`." -msgstr "" - -# c50879d0a894463cb84a7cecd8726bd2 -#: ../portal.rst:36 -msgid "Get portal object" -msgstr "Obtener el objeto del portal" - -# c35120519c2547da93feb34bfbc48ba9 -#: ../portal.rst:38 -msgid "Getting the Plone portal object is easy with :meth:`api.portal.get`." -msgstr "" - -# 78a35eb7f40d4e65871768fc3e91aac1 -#: ../portal.rst:54 -msgid "Get tool" -msgstr "Obtener Herramienta" - -# 9fb34e4553644d5a8f54345bb34554f8 -#: ../portal.rst:56 -msgid "To get a portal tool in a simple way, just use :meth:`api.portal.get_tool` and pass in the name of the tool you need." -msgstr "" - -# 6fadb24e93c94912afe22067cf106701 -#: ../portal.rst:72 -msgid "Send E-Mail" -msgstr "Enviar un correo electrónico" - -# c95e4a80ccde41799a094dfba81b0b6c -#: ../portal.rst:74 -msgid "To send an e-mail use :meth:`api.portal.send_email`:" -msgstr "" - -# 9de94720386c4561bc38b37621be612a -#: ../portal.rst:122 -msgid "Localized time" -msgstr "Hola localizada" - -# 96567c9f43314ac69780a968cb283024 -#: ../portal.rst:124 -msgid "To display the date/time in a user-friendly way, localized to the user's prefered language, use :meth:`api.portal.localized_time`." -msgstr "" - -# 751fc57f5ba5410583e59c4411658178 -#: ../portal.rst:143 -msgid "Show notification message" -msgstr "Mostrar mensajes de notificación" - -# f1d4de4b58d54aca8bf17ec68128ca46 -#: ../portal.rst:145 -msgid "With :meth:`api.portal.show_message` you can show a notification message to the user." -msgstr "" diff --git a/docs/locale/es/LC_MESSAGES/users.po b/docs/locale/es/LC_MESSAGES/users.po deleted file mode 100644 index e4a77f5a..00000000 --- a/docs/locale/es/LC_MESSAGES/users.po +++ /dev/null @@ -1,138 +0,0 @@ -# plone.api Spanish localization. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# Leonardo J. Caballero G. , 2012. -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: 2012-08-26 12:03-0430\n" -"Last-Translator: Leonardo J. Caballero G. \n" -"Language-Team: Leonardo J. Caballero G.\n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Virtaal 0.7.1\n" - -# b10297c179bf4f1a9c830df3ace53479 -#: ../users.rst:13 -msgid "Users" -msgstr "Usuarios" - -# 4e3f794d26c4450ba41129671a46c2e3 -#: ../users.rst:18 -msgid "Create user" -msgstr "" - -# 3986095a924a4e13aaec287750b8f788 -#: ../users.rst:20 -msgid "To create a new user, use :meth:`api.user.create`. If your portal is configured to use emails as usernames, you just need to pass in the email of the new user." -msgstr "" - -# 516b9be860554f5fb9354b59c965bfd0 -#: ../users.rst:41 -msgid "Otherwise, you also need to pass in the username of the new user." -msgstr "" - -# b18e0d436abe4e19b1a663f7891442cb -#: ../users.rst:57 -msgid "To set user properties when creating a new user, pass in a properties dict." -msgstr "" - -# da65341ea52a492e9a38544129107a02 -#: ../users.rst:77 -msgid "Besides user properties you can also specify a password for the new user. Otherwise a random 8-char alphanumeric password will be generated." -msgstr "" - -# be1390cf5bf64aacbbb61d1dae673c0f -#: ../users.rst:92 -msgid "Get user" -msgstr "Obtener usuario" - -# d3a862a9a77147ae906fbb5118dae1bd -#: ../users.rst:94 -msgid "You can get a user with :meth:`api.user.get`." -msgstr "" - -# 0d78eb3491a849bba1ae8082f64411e0 -#: ../users.rst:109 -msgid "Get currently logged-in user" -msgstr "" - -# 5b310c5f33964819b27fd39bb934a473 -#: ../users.rst:111 -msgid "Getting the currently logged-in user is easy with :meth:`api.user.get_current`." -msgstr "" - -# 51e01ad9f9a24f9ba1282153bcea8351 -#: ../users.rst:126 -msgid "Check if current user is anonymous" -msgstr "" - -# 4db2cff962f04d898406f755dff004ba -#: ../users.rst:128 -msgid "Sometimes you need to trigger or display some piece of information only for logged-in users. It's easy to use :meth:`api.user.is_anonymous` to do a basic check for it." -msgstr "" - -# 3153968efc1f475eb70b53a0da67ee75 -#: ../users.rst:147 -msgid "Get all users" -msgstr "Obtener todos los usuarios" - -# 442af592b40847ffb973fd858845b1c9 -#: ../users.rst:149 -msgid "Get all users in your portal with :meth:`api.user.get_all`." -msgstr "" - -# b01d126846774fc9b1c635f474a2e763 -#: ../users.rst:164 -msgid "Delete user" -msgstr "Eliminar usuario" - -# 2cc9a28dd2fc43a39b13c3c859777625 -#: ../users.rst:166 -msgid "To delete a user, use :meth:`api.user.delete` and pass in either the username or the user object you want to delete." -msgstr "" - -# 1bef28537ebc49c7879224812a1f1aeb -#: ../users.rst:193 -msgid "Check for role" -msgstr "Comprobar por rol" - -# 4fa3cacefd5144c0b473554fb2e45ea8 -#: ../users.rst:195 -msgid "Again on the security aspects, checking if a user has a certain role can be done with :meth:`api.user.has_role`. If you omit the ``user`` parameter, the currently logged-in user will be used." -msgstr "" - -# a7a76e7c2a154d7192f186441c2e06bc -#: ../users.rst:208 -msgid "When user is omitted the current user is used for role lookup." -msgstr "" - -# a8172c3fef8c49c4beafef9ab74f1192 -#: ../users.rst:222 -msgid "Check for permission" -msgstr "Compruebe los permisos de la carpeta" - -# 12d6a2d8aa394309ae3c00bcefc223e6 -#: ../users.rst:224 -msgid "Likewise, you can also check if a user has a certain permission with :meth:`api.user.has_permission`. Omitting the ``user`` parameter means the currently logged-in user will be used." -msgstr "" - -# ac796486c4b749e19b944e5991d87959 -#: ../users.rst:242 -msgid "When user is omitted the current user is used for the permission check." -msgstr "" - -# 8f3f7c4e537f40e3b37a45e7c5c8f1f6 -#: ../users.rst:259 -msgid "Get groups that user is a member of" -msgstr "Obtener los grupos del cual el usuario es miembro" - -# cc57b910281d4c47bf708c04e5d1e4c9 -#: ../users.rst:261 -msgid "Use ``get_groups``, passing in either the username or the user object you want to get groups for." -msgstr "" diff --git a/docs/locale/groups.pot b/docs/locale/groups.pot deleted file mode 100644 index f70c7776..00000000 --- a/docs/locale/groups.pot +++ /dev/null @@ -1,98 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:42\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../groups.rst:13 -# 61712135fcb44d78a7992dd942074285 -msgid "Groups" -msgstr "" - -#: ../groups.rst:18 -# 4c8b0191c2a743068edb4aaf4e59ce01 -msgid "Create group" -msgstr "" - -#: ../groups.rst:20 -# 37c5fe3be98f411186ac7acb411a64fc -msgid "To create a new portal group, use :meth:`api.group.create`." -msgstr "" - -#: ../groups.rst:31 -# 64d60273470f4c59a74c88e3b8f5c5c1 -msgid "When creating groups ``title``, ``description``, ``roles`` and ``groups`` are optional." -msgstr "" - -#: ../groups.rst:56 -# b297efffe8754950a56625ec8d98cb98 -msgid "Get group" -msgstr "" - -#: ../groups.rst:58 -# f303d69452a64d6eaa8a19d65a492066 -msgid "To get a group by it's name, use :meth:`api.group.get`." -msgstr "" - -#: ../groups.rst:73 -# d0b4f62758714617aadbf0bd3e513ed0 -msgid "Editing a group" -msgstr "" - -#: ../groups.rst:75 -# 047640d319fb44b5bdfe25a53374ef00 -msgid "Groups can be edited by using the ``group_tool``. In this example the ``title``, ``description`` and ``roles`` are updated for the group 'Staff'." -msgstr "" - -#: ../groups.rst:103 -# dccbe1ecf7654d22b7961db5f9633375 -msgid "Get all groups" -msgstr "" - -#: ../groups.rst:105 -# 2b144517b8a143a09af88b3f2dedd497 -msgid "You can also get all groups, by using :meth:`api.group.get_all`." -msgstr "" - -#: ../groups.rst:120 -# 45a8821f48b4448a911fd84daedeba9a -msgid "Delete group" -msgstr "" - -#: ../groups.rst:122 -# 648e21e43f964079a8c328665dc6db3e -msgid "To delete a group, use :meth:`api.group.delete` and pass in either the groupname or the group object you want to delete." -msgstr "" - -#: ../groups.rst:145 -# 83c3da3eb6d24ea0bc1f0464ee26e135 -msgid "Adding user to group" -msgstr "" - -#: ../groups.rst:147 -# 5901bbe8f258498ca81a244a9e9ee1ac -msgid "The ``add_user`` method accepts either the groupname or the group object of the target group and the username or the user object you want to add to the group." -msgstr "" - -#: ../groups.rst:171 -# 8473615345a84c039643f433d211283c -msgid "Deleting user from group" -msgstr "" - -#: ../groups.rst:173 -# 33476754e6fe409e8cf971e4329bd82c -msgid "The ``delete_user`` method accepts either the groupname or the group object of the target group and either the username or the user object you want to remove from the group." -msgstr "" - diff --git a/docs/locale/index.pot b/docs/locale/index.pot deleted file mode 100644 index 2e2bab61..00000000 --- a/docs/locale/index.pot +++ /dev/null @@ -1,83 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:42\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../index.rst:10 -# 94cc9c90469c431380119ff169f5c40d -msgid "A Plone API" -msgstr "" - -#: ../index.rst:14 -# 85b5316070534de1bf241cd9f470ba7a -msgid "The :mod:`plone.api` is an elegant and simple API, built for humans wishing to develop with Plone." -msgstr "" - -#: ../index.rst:17 -# d508021ca8f64d74b8c21a2a61da4a86 -msgid "It comes with *cookbook*-like documentation with step-by-step instructions for doing common development tasks in Plone. Recipes try to assume the user does not have extensive knowledge about Plone internals." -msgstr "" - -#: ../index.rst:21 -# 96c131ea14754d50b6ae5b9a0012ce27 -msgid "The intention of this package is to be transitional. It points out which parts of Plone are particularly nasty -- we wish they get fixed so we can deprecate *plone.api* methods that cover them up, but leave the documentation in place." -msgstr "" - -#: ../index.rst:25 -# 06641ff2a24b4115a13b19d2fb8459b4 -msgid "Some parts of documentation already are this way: they don't use *plone.api* methods directly, but simply provide guidance on achiving a task using Plone's internals. Example: usage of the catalog in :ref:`content_find_example`." -msgstr "" - -#: ../index.rst:29 -# 7f268980a752426cb418a759e18f5349 -msgid "The intention is to cover 20% of tasks we do 80% of the time. Keeping everything in one place helps keep the API introspectable and discoverable, which are important aspects of being Pythonic." -msgstr "" - -#: ../index.rst:35 -# 4314f0aabea64403af3ef9365ae15330 -msgid "This package is still under heavy development. Do not use it yet unless you are completely sure what you are doing." -msgstr "" - -#: ../index.rst:40 -# e69af21f49fb402f8922b9526f1bfb38 -msgid "Narrative documentation" -msgstr "" - -#: ../index.rst:53 -# e50a91833b0d44f78732f117f451a48e -msgid "Complete API and advanced usage" -msgstr "" - -#: ../index.rst:61 -# 36dca8eb187842ae87beff40870c4083 -msgid "Indices and tables" -msgstr "" - -#: ../index.rst:63 -# fc1c4609849b4f3f94deaa8b92611d2e -msgid ":ref:`genindex`" -msgstr "" - -#: ../index.rst:64 -# 093dad0c4d134e9db18dad07f80edf04 -msgid ":ref:`modindex`" -msgstr "" - -#: ../index.rst:65 -# a6acd34cf147432ca5886c949d39f76f -msgid ":ref:`search`" -msgstr "" - diff --git a/docs/locale/portal.pot b/docs/locale/portal.pot deleted file mode 100644 index 96c12a1d..00000000 --- a/docs/locale/portal.pot +++ /dev/null @@ -1,83 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:42\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../portal.rst:13 -# 3d402a3d36924f869c9ff2c9abb5f488 -msgid "Portal" -msgstr "" - -#: ../portal.rst:18 -# 6294a0f9612e4123bd80074a549b1cd4 -msgid "Get portal url" -msgstr "" - -#: ../portal.rst:20 -# 251ef456730d437e98daa2c95d1062f9 -msgid "A shortcut for getting the url of the portal is now always at hand: :meth:`api.portal.url`." -msgstr "" - -#: ../portal.rst:36 -# b7323e7657554fcc9d3bcfa22c2ab9c7 -msgid "Get portal object" -msgstr "" - -#: ../portal.rst:38 -# 4b26192350a944c08975b79823285291 -msgid "Getting the Plone portal object is easy with :meth:`api.portal.get`." -msgstr "" - -#: ../portal.rst:54 -# 9ce927b85cee4a8f8461257e1973a90b -msgid "Get tool" -msgstr "" - -#: ../portal.rst:56 -# 2b767b262d28442b964658ad181bcf1f -msgid "To get a portal tool in a simple way, just use :meth:`api.portal.get_tool` and pass in the name of the tool you need." -msgstr "" - -#: ../portal.rst:72 -# e9c927e395a44b1aa06dc6819f736118 -msgid "Send E-Mail" -msgstr "" - -#: ../portal.rst:74 -# 2ed681663a224493bf8a1a99d40ec3eb -msgid "To send an e-mail use :meth:`api.portal.send_email`:" -msgstr "" - -#: ../portal.rst:122 -# 391b5f4574b9426abf7981f1d5eb8d46 -msgid "Localized time" -msgstr "" - -#: ../portal.rst:124 -# 834fe0ca871743db8ff2af57293c8bd4 -msgid "To display the date/time in a user-friendly way, localized to the user's prefered language, use :meth:`api.portal.localized_time`." -msgstr "" - -#: ../portal.rst:143 -# 8ccc2b0f907d4da9bf34242cc89b373a -msgid "Show notification message" -msgstr "" - -#: ../portal.rst:145 -# 2ac0bbe3a46442589af7d52cdaa47232 -msgid "With :meth:`api.portal.show_message` you can show a notification message to the user." -msgstr "" - diff --git a/docs/locale/pt_BR/LC_MESSAGES/about.po b/docs/locale/pt_BR/LC_MESSAGES/about.po deleted file mode 100644 index ffa783cf..00000000 --- a/docs/locale/pt_BR/LC_MESSAGES/about.po +++ /dev/null @@ -1,368 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../about.rst:10 -# d6f22570c4df4af3a574e56e6748fc1d -msgid "About" -msgstr "" - -#: ../about.rst:13 -# 929433e6861348b4a5c173e703ed6ad9 -msgid "Inspiration" -msgstr "Inspiracion" - -#: ../about.rst:15 -# e9e8b115f6d24517a79ee891cf2297d9 -msgid "We want `plone.api` to be developed with `PEP 20 `_ idioms in mind, in particular:" -msgstr "" - -#: ../about.rst:25 -# d89823a23f6342a2975e56a77adba8f1 -msgid "All contributions to `plone.api` should keep these important rules in mind." -msgstr "" - -#: ../about.rst:27 -# 2641bc6430754b5fb8624f062cfc7db6 -msgid "Two libraries are especially inspiring:" -msgstr "" - -#: ../about.rst:30 -# f8d45704bb874e76ade8bcf31be7e9f4 -msgid "Arguably, the reason for SQLAlchemy's success in the developer community lies as much in its feature set as in the fact that its API is very well designed, is consistent, explicit, and easy to learn." -msgstr "" - -#: ../about.rst:35 -# 8c74d41d7ba8484ab11acd9df4273b16 -msgid "As of this writing, this is still a very new library, but just looking at `a comparison between the urllib2 way and the requests way `_, as well as the rest of its documentation, one cannot but see a parallel between the way we *have been* and the way we *should be* writing code for Plone (or at least have that option)." -msgstr "" - -#: ../about.rst:43 -# 87089d43ce0a44bba5af3a77e5246e8e -msgid "Design decisions" -msgstr "" - -#: ../about.rst:46 -# 5b7444cac8054ac98be671d18ad03688 -msgid "Import and usage style" -msgstr "" - -#: ../about.rst:48 -# 005c3be7a1a04dca8d2da44040cd1d1a -msgid "API methods are grouped by their field of usage: :ref:`chapter_portal`, :ref:`chapter_content`, :ref:`chapter_users` and :ref:`chapter_groups`. Hence the importing and usage of API methods look like this:" -msgstr "" - -#: ../about.rst:72 -# c9c9a8833de44d6a97bcc4447eed8e9c -msgid "In other words, always import the top-level package (``from plone import api``) and then use the group namespace to access the method you want (``url = api.portal.url()``)." -msgstr "" - -#: ../about.rst:76 -# 7bc0a6a949bb4b758cc2ce9173cc001a -msgid "All example code should adhere to this style, so we encourage one and only one prefered way of consuming API methods." -msgstr "" - -#: ../about.rst:81 -# 2ca6fed8d167492085b39481c1047292 -msgid "Prefer keyword arguments" -msgstr "" - -#: ../about.rst:83 -# 8d0e6860ddf64b1ebe06f7769f256556 -msgid "For the following reasons the example code in the API (and hence the recommendation to people on how to use it) shall always prefer using keyword instead of positional arguments:" -msgstr "" - -#: ../about.rst:87 -# 0ea03c5859fd4e35bf0aec1212cbea9c -msgid "There will never be a doubt when writing a method on whether an argument should be positional or not. Decision already made." -msgstr "" - -#: ../about.rst:89 -# 34202755affc4163bd7a848fd6e1823a -msgid "There will never be a doubt when using the API on which argument comes first, or which ones are named/positional. All arguments are named." -msgstr "" - -#: ../about.rst:91 -# 7047864e7a7b4f839e917da7a7b5bfab -msgid "When using positional arguments, the method signature is dictated by the underlying implementation. Think required vs. optional arguments. Named arguments are always optional in Python. This allows us to change implementation details and leave the signature unchanged. In other words, the underlying API code can change substantially and the code using it will remain valid." -msgstr "" - -#: ../about.rst:97 -# 023882595fae483da4d8a3db5f4fec25 -msgid "The arguments can all be passed as a dictionary." -msgstr "" - -#: ../about.rst:99 -# 49dbb84f82924e52992aad1d0824d049 -msgid "The API provides grouped functional access to otherwise distributed logic in Plone. Plone's original distribution of logic is a result of two things: The historic re-use of CMF- and Zope-methods and reasonable, but at first hard to understand splits like acl_users.* and portal_memberdata." -msgstr "" - -#: ../about.rst:104 -# c3164f2b1a7e4b489fadd5ccfaef9201 -msgid "That's why we've created a set of useful methods that implement best-practice access to the original distributed APIs. In this way we also document in code how to use Plone directly." -msgstr "" - -#: ../about.rst:109 -# 400b235775994ab4933199094575b49b -msgid "If you doubt those last sentences: We had five different ways to get the portal root with different edge-cases. We had three different ways to move an object. With this in mind, it's obvious that even the most simple tasks can't be documented in Plone in a sane way." -msgstr "" - -#: ../about.rst:114 -# ae5bf8585cdf40a7b516c93adf28df5f -msgid "Also, we don't intend to cover all possible use-cases. Only the most common ones. If you need to do something that `plone.api` does not support, just use the underlying APIs directly. We will cover 20% of tasks that are being done 80% of the time, and not one more." -msgstr "" - -#: ../about.rst:121 -# c66864ad865744e18813061cc8ced082 -msgid "FAQ" -msgstr "" - -#: ../about.rst:124 -# a090827ce88b418782abd0cc46a229ba -msgid "Why aren't we using wrappers?" -msgstr "" - -#: ../about.rst:126 -# e536bc62a3e44822a2c8785c26053635 -msgid "We could wrap an object (like a user) with an API to make it more usable right now. That would be an alternative to the convenience methods." -msgstr "" - -#: ../about.rst:129 -# fc5d947c300a42d4b7c3f087a6ef9f61 -msgid "But telling developers that they will get yet another object from the API which isn't the requested object, but an API-wrapped one instead, would be very hard. Also, making this wrap transparent in order to make the returned object directly usable would be nearly impossible, because we'd have to proxy all the :mod:`zope.interface` stuff, annotations and more." -msgstr "" - -#: ../about.rst:135 -# 837bc126d553440c93c39aa43ca60189 -msgid "Furthermore, we want to avoid people writing code like this in tests or their internal utility code and failing miserably in the future if wrappers would no longer be needed and would therefore be removed::" -msgstr "" - -#: ../about.rst:144 -# bcc8254ee1b247dd813aba43f5f0ab0f -msgid "Why ``delete`` instead of ``remove``?" -msgstr "" - -#: ../about.rst:146 -# c96fb6140a9545f8980123ff9f8ec15f -msgid "The underlying code uses methods that are named more similarly to *delete* rather than to *remove*" -msgstr "" - -#: ../about.rst:148 -# 5c900c509c0b48529299e8bc94e2ab0e -msgid "``CRUD`` has *delete*, not *remove*." -msgstr "" - -#: ../about.rst:152 -# 4554d121841943098de957f2c4fc2b32 -msgid "Roadmap" -msgstr "" - -#: ../about.rst:155 -# 487b3b9fbaaf4e82ae1cc7f3bfdfc1e1 -msgid "Short term" -msgstr "" - -#: ../about.rst:157 -# a6b64c3db42040a797cadb746b2ea05a -msgid "In the short-term, we are planning to add more api methods to `plone.api`. An up-to-date list of them (and ideas for them) can be found `on GitHub `_." -msgstr "" - -#: ../about.rst:161 -# 3b191b831a214a4eaf85c54fd5ef9692 -msgid "TODO: add this to GitHub issues:" -msgstr "" - -#: ../about.rst:163 -# e585d0d977ed404181ab3c169ebc252b -msgid "descriptive error messages" -msgstr "" - -#: ../about.rst:165 -# 35404a62561746ff999ce0c2f99bbfb9 -msgid "see where code breaks with stupid messages" -msgstr "" - -#: ../about.rst:166 -# a939473deae94fcbae4dbc5192f422d1 -msgid "catch them and make them more descriptive" -msgstr "" - -#: ../about.rst:167 -# b42f91dec6a44afc8c98eac2e40fd30f -msgid "have a list of all possible error messages, what they mean and how to overcome them" -msgstr "" - -#: ../about.rst:172 -# 83cde3bc79e74fe3a7c27e7e5fcedcb7 -msgid "Medium- to long-term:" -msgstr "" - -#: ../about.rst:174 -# 406534e02e3d4d4bb59179d67320bdf5 -msgid "Below is a collection of ideas we have for the long run, in no particular order:" -msgstr "" - -#: ../about.rst:176 -# fc9613d9d50b492aa3852904cd881fd2 -msgid "api.role context manager (to use with ``with``)" -msgstr "" - -#: ../about.rst:186 -# 175cd90565fc46e08bd3e4e4a8101a24 -msgid "api.env" -msgstr "" - -#: ../about.rst:188 -# 1db6566780284ce996487731ec2b03e3 -msgid "debug_mode, test_mode booleans (to check if you are in debug/test)" -msgstr "" - -#: ../about.rst:189 -# ce8c67593e384265bc723eca914177de -msgid "zope/plone version info" -msgstr "" - -#: ../about.rst:191 -# 163d0f7a14694be0a4c14c57d8a8a686 -msgid "api.system" -msgstr "" - -#: ../about.rst:193 -# 2c2a9ab8dd5a46f5b3280ebe52e79645 -msgid "for sysadmin tasks" -msgstr "" - -#: ../about.rst:194 -# 0fcdc7da8b9243e0ab462007a148448e -msgid "run upgrades, stay up-to-date" -msgstr "" - -#: ../about.rst:195 -# ab78f927417e45e9ac62447ea77035ca -msgid "cleanup broken objects, interfaces, utilities, etc." -msgstr "" - -#: ../about.rst:196 -# c6f6445a1629431abc0c8c506da2bfbf -msgid "mounting things" -msgstr "" - -#: ../about.rst:198 -# c164ef626e3f47119c6f1a55bba020f4 -msgid "unify permissions" -msgstr "" - -#: ../about.rst:200 -# e4513dfbe1ca4cc6bc2896d774cbcd9d -msgid "have all different types of permission in one place and one way to use them" -msgstr "" - -#: ../about.rst:202 -# de48cceafe494012b3a4e00b312869da -msgid "style guide" -msgstr "" - -#: ../about.rst:204 -# 3c016cfe70ca40599c0b8350d4e2291c -msgid "have a style guide for how Plone files should be formatted -- this needs to be finalized before we start fixing underlying APIs so new code can use the style guide" -msgstr "" - -#: ../about.rst:207 -# 4f9d840985b74a33aa25e0e91da3db3e -msgid "define guidelines for:" -msgstr "" - -#: ../about.rst:209 -# db52052e5bfa4ec38fdc66ec3b150c54 -msgid "python" -msgstr "" - -#: ../about.rst:210 -# b6cdd747740e414ab6f50fccbfd7254b -msgid "javascript" -msgstr "" - -#: ../about.rst:211 -# 8bb905e5282c46599265eb0a932cc9f4 -msgid "rst" -msgstr "" - -#: ../about.rst:212 -# 33e7fd9b7d534ccfbfe6f0d4c8587eb2 -msgid "zpt" -msgstr "" - -#: ../about.rst:213 -# 13360f966e55431286b579d3a7c72754 -msgid "xml" -msgstr "" - -#: ../about.rst:214 -# 140f91230bfc4a2d84080f970c617df8 -msgid "zcml" -msgstr "" - -#: ../about.rst:216 -# 9668b4e8cad9420a957e8b6df1660c99 -msgid "rewrite sub-optimal underlying APIs and deprecate plone.api methods, but leave the (updated) documentation:" -msgstr "" - -#: ../about.rst:219 -# 25328c2383a84fd6ba22535d598e395c -msgid "getting/setting member properties" -msgstr "" - -#: ../about.rst:220 -# 584f892ab7244865b1a2b49cb97aa68a -msgid "tools:" -msgstr "" - -#: ../about.rst:222 -# e1d613379ffa4eb28dc4e3e501804c02 -msgid "portal_groupdata, portal_groups, portal_memberdata, portal_membership" -msgstr "" - -#: ../about.rst:223 -# a7acf5e33c8143bdbc795f91a5efb8ec -msgid "portal_quickinstaller, portal_undo" -msgstr "" - -#: ../about.rst:225 -# 6b9ef5601701414aa5ccd6b3f4341d29 -msgid "JSON webservices" -msgstr "" - -#: ../about.rst:227 -# 92bec24c8e07438e8f1d122ab3c92e32 -msgid "probably in a separate package plone.jsonapi" -msgstr "" - -#: ../about.rst:228 -# 367e892699c84897b09c682ed291af64 -msgid "one view (@@jsonapi for example) that you can call in your JS and be sure it won't change" -msgstr "" - -#: ../about.rst:230 -# 16d8483cf95c4e1989fc7c1a0dc42b75 -msgid "easier to AJAXify stuff" -msgstr "" - -#: ../about.rst:232 -# 2da8280a5b07495c8a7be4da287fd4de -msgid "Flask-type url_for_view() and view_for_url()" -msgstr "" - diff --git a/docs/locale/pt_BR/LC_MESSAGES/api.po b/docs/locale/pt_BR/LC_MESSAGES/api.po deleted file mode 100644 index c824e9d8..00000000 --- a/docs/locale/pt_BR/LC_MESSAGES/api.po +++ /dev/null @@ -1,383 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../api.rst:11 -# 480a38b206b2475391f2d3d79c8e9969 -msgid "plone.api.portal" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get:1 -# 51b11cc6c4a94ba6bd4ce7efbf19fb72 -msgid "Get the Plone portal object out of thin air without importing fancy Interfaces and doing multi adapter lookups." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get:5 -# 9661f7993fb941e9ad8a6f77abeebc8c -msgid ":ref:`portal_get_example`" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get_tool:1 -# 9946f74dbe4f4942a84685c422b70204 -msgid "Get a portal tool in a simple way." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.get_tool:6 -# 303d4142b78643159543af2eced7d8d2 -msgid ":ref:`portal_get_tool_example`" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:1 -# 14a5048acbf647fdab38e1d72fb93210 -msgid "Display a date/time in a user-friendly way." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:3 -# 0e98e961b9b14bacad2c19c9df1f5b58 -msgid "It should be localized to the user's preferred language." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:5 -# 538f804bfd914d93883b586bb739c98b -msgid "Note that you can specify both long_format and time_only as True (or any other value that can be converted to a boolean True value), but time_only then wins: the long_format value is ignored." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.localized_time:17 -# 313967f5c5a145e28bf9f6d9c6dc6da6 -msgid ":ref:`portal_localized_time_example`" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.send_email:1 -# b8bf9ef5bab64ae09fdce8ea2756f83b -msgid "Send an email." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.send_email:12 -# 21d22f52555f4f6dbee4e6aa5a0a76a8 -msgid ":ref:`portal_send_email_example`" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.show_message:1 -# 5abb28404c9a4d78883da28239200d61 -msgid "Display a status message." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.show_message:9 -# 7c23da81ee494e8d925432984376b7af -msgid ":ref:`portal_show_message_example`" -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.url:1 -# 84a23dad8bad40eb83e5e4ff3ecb0a4d -msgid "Get the portal url." -msgstr "" - -#: ../../src/plone/api/portal.py:docstring of plone.api.portal.url:5 -# c78fe44107b64f0abde3b93823397f7d -msgid ":ref:`portal_url_example`" -msgstr "" - -#: ../api.rst:20 -# 2848de370f5e4baca839997fec889cd1 -msgid "plone.api.content" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content:1 -# 2f0a375446974867b4a6baf1dfa889c6 -msgid "Module that provides functionality for content manipulation" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.copy:1 -# c8d6ede085604149bf0b8083f8e14670 -msgid "Copy the object to the target container." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.copy:19 -# 518dce2c419a40b9932cf8e27cbfd850 -msgid ":ref:`content_copy_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.create:1 -# 8bba347c47354866af427c267ef16883 -msgid "Create a new content item." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.create:22 -# 4224826f335e496ba2b874e1bf7615ec -msgid ":ref:`content_create_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.delete:1 -# 10937e6316e54b749aeaf287859565d8 -msgid "Delete the object." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.delete:5 -# 4052f87bbb4342a3a9d1d46a55c4cdf2 -msgid ":ref:`content_delete_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get:1 -# d4c2d8a6d5c84ce782c579d4037e5908 -msgid "Get an object." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get:9 -# c26cfff6cbd04cf8b12b0ea6e5e2d9ca -msgid ":ref:`content_get_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_state:1 -# 8141774ea6104054a66a936c6f580b7c -msgid "Get the current workflow state of the object." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_state:7 -# 372de95e5ecc4d3fa6f541eb028f773a -msgid ":ref:`content_get_state_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_view:1 -# a508d86d35cd492482c3d7cab7082084 -msgid "Get a BrowserView object." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.get_view:9 -# c2a4fa03f54749aba8d081d78842f003 -msgid ":ref:`content_get_view_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.move:1 -# 6215d3c9916446c68403e1034d5a927e -msgid "Move the object to the target container." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.move:19 -# 6fb1f02cd33342c885d78d17ec327b82 -msgid ":ref:`content_move_example`" -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.transition:1 -# aa53251f9f2f4e49902283068ac3ecbe -msgid "Perform a workflow transition for the object." -msgstr "" - -#: ../../src/plone/api/content.py:docstring of plone.api.content.transition:8 -# e6f66b38694f4959bb2b4613404b16a6 -msgid ":ref:`content_transition_example`" -msgstr "" - -#: ../api.rst:29 -# 14a1dceb0e7a48bd89da5bd88d041212 -msgid "plone.api.user" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user:1 -# 5e134ab2814f4d5db9a75ba6071f352a -msgid "Module that provides functionality for user manipulation" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.create:1 -# 8a3d40c144114f4abe0585639dc0562b -msgid "Create a user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.create:16 -# 66ae0183575f40b989624dc5a82cd082 -msgid ":ref:`user_create_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.delete:1 -# 21730d259f724349b488646eb197bd0d -msgid "Delete a user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.delete:3 -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_groups:3 -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:6 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:6 -# 033fc14da1c84dbfbaccdc9fe680ca40 -# 95d40533be9647188c051c95a55773f7 -# de3567855b3b42c99da50b5e796fa067 -# 2d4d6a39c05b474cbcd548b409de4e66 -msgid "Arguments ``username`` and ``user`` are mutually exclusive. You can either set one or the other, but not both." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.delete:10 -# 0b4127e5b1244f14b650f5457b89361c -msgid ":ref:`user_delete_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get:1 -# b8379a06e39f4fd1a4243935fd6d6cb7 -msgid "Get a user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get:7 -# 8d731b07d107459ebbd9b184ee722bdc -msgid ":ref:`user_get_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_all:1 -# 67cc68a80d4a4298930d416b4949743c -msgid "Return all users." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_all:5 -# 186e401e18444e55bacd15cba8690780 -msgid ":ref:`users_get_all_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_current:1 -# 61b837494178416ca10271e98fada1fc -msgid "Get the currently logged-in user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_current:5 -# 5cbc0c81860849f6859ad5f201641cee -msgid ":ref:`user_get_current_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_groups:1 -# fe8a9759d0454a4cacb32f01e8f328ba -msgid "Get a list of groups that this user is a member of." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.get_groups:12 -# 135d4af554d34a899aca449584552f3c -msgid ":ref:`get_groups_for_user_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_permission:1 -# 8eeb2b36b2f3490b8f52fbd28c9cf1c0 -msgid "Check if the user has the specified permission on the given object." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_permission:3 -# 280dfb6f06294ee1a024c3bd6e5b1dc6 -msgid "Arguments ``username`` and ``user`` are mutually exclusive. You can either set one or the other, but not both. If no ``username` or ``user`` are provided, check the permission for the currently logged-in user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_permission:18 -# 3aa8154b81c441a485bf8d6f63a06578 -msgid ":ref:`user_has_permission_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_role:1 -# 043da8f8753a473a99ac14f97ee83f9e -msgid "Check if the user has the specified role." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_role:3 -# 096b857c8b2e4780bc7a31d32fe8db76 -msgid "Arguments ``username`` and ``user`` are mutually exclusive. You can either set one or the other, but not both. If no ``username` or ``user`` are provided, check the role for the currently logged-in user." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.has_role:15 -# ef5946ed1be74b1a960f03ae3610f2bc -msgid ":ref:`user_has_role_example`" -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.is_anonymous:1 -# 615f8b9f05b34c1d8dac2a8e7088a18d -msgid "Check if the currently logged-in user is anonymous." -msgstr "" - -#: ../../src/plone/api/user.py:docstring of plone.api.user.is_anonymous:5 -# 7af2eef10d65478ebf2a2edaf88ab09d -msgid ":ref:`user_is_anonymous_example`" -msgstr "" - -#: ../api.rst:38 -# d9f0041ca1ce478590146e53900b2189 -msgid "plone.api.group" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group:1 -# 64cdbec2cb454ce493214db7c1a427c1 -msgid "Module that provides functionality for group manipulation" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:1 -# c2d15c31611f41cba41d1910284d49b7 -msgid "Add the user to a group." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:3 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete:3 -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:3 -# 9eb142ce333c4e41b0276ab74ad7ac37 -# 09af61d0819e4826b442cfd33706e1d8 -# a7e16e93d6254c22bb0c9efc560ae2a3 -msgid "Arguments ``groupname`` and ``group`` are mutually exclusive. You can either set one or the other, but not both." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.add_user:18 -# 8f13dc96088443b88528f9646a707047 -msgid ":ref:`add_user_to_group_example`" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.create:1 -# 3d60a49da6b94380988979c46a798e40 -msgid "Create a group." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.create:15 -# 2ae0c92c4f0f4d97bf77fd48f5c4718d -msgid ":ref:`group_create_example`" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete:1 -# f56a876af5164c4bb2d8b12850a3082e -msgid "Delete a group." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete:10 -# 60197691ac8547c3a458bb8f153e3e31 -msgid ":ref:`group_delete_example`" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:1 -# 0d55877112a340ddba8b5d5036fc8b51 -msgid "Remove the user from a group." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.delete_user:18 -# 6b9f5d17c1b7444694463a0cfcfe4b52 -msgid ":ref:`delete_user_from_group_example`" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.get:1 -# a5656b2cda6f47d4bed5df1864769206 -msgid "Get a group." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.get:7 -# 1ae80c16441845188c1defe728d3f6bd -msgid ":ref:`group_get_example`" -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.get_all:1 -# 4d0292acb5474e5e9a70dbe4eb835be1 -msgid "Get all groups." -msgstr "" - -#: ../../src/plone/api/group.py:docstring of plone.api.group.get_all:5 -# 69399a9ba20048a184be5a0ecdacb861 -msgid ":ref:`groups_get_all_example`" -msgstr "" - diff --git a/docs/locale/pt_BR/LC_MESSAGES/content.po b/docs/locale/pt_BR/LC_MESSAGES/content.po deleted file mode 100644 index 3bb629ed..00000000 --- a/docs/locale/pt_BR/LC_MESSAGES/content.po +++ /dev/null @@ -1,183 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../content.rst:13 -# f9808c16c46747b79877b4e590f587ea -msgid "Content" -msgstr "" - -#: ../content.rst:18 -# f064bf432ab84f3d889e492d31b4ad7d -msgid "Create content" -msgstr "" - -#: ../content.rst:20 -# c38f4ce1405b405fa5edcff6f1d68034 -msgid "First get the portal object that we will use as a container for new content:" -msgstr "" - -#: ../content.rst:27 -# 57ea2a1f70a244dba586b91d3d3cf777 -msgid "If you want to create a new content item, use the :meth:`api.content.create` method. The type attribute will automatically decide which content type (dexterity, archetype, ...) should be created." -msgstr "" - -#: ../content.rst:39 -# b7195471a9314758a518d34d91fcebdb -msgid "The ``id`` of the object gets generated (in a safe way) from its ``title``." -msgstr "" - -#: ../content.rst:49 -# d9bc13c7bfd24ec2a9db5afad7aeb8de -msgid "Get content object" -msgstr "" - -#: ../content.rst:51 -# b15f9e177058456f86c049297eeaa2d4 -msgid "There are several approaches of getting to your content object. Consider the following portal structure::" -msgstr "" - -#: ../content.rst:79 -# 388e8767723947de9f5de13c84f352d0 -msgid "You can do the following operations to get to various content objects in the stucture above, including using :meth:`api.content.get`." -msgstr "" - -#: ../content.rst:116 -# e5ac677d7e9e42ecbdbedca9b8e61e94 -msgid "Find content object" -msgstr "" - -#: ../content.rst:118 -# b7ec0d1aa3144acb8e0f5ddf65276e9d -msgid "You can use the *catalog* to search for content. Here is a simple example:" -msgstr "" - -#: ../content.rst:130 -# 87821035cbff4c288418f6dc77c8f253 -msgid "More about how to use the catalog and what parameters it supports is written in the `Collective Developer Documentation `_. Note that the catalog returns *brains* (metadata stored in indexes) and not objects. However, calling ``getObject()`` on brains does in fact give you the object." -msgstr "" - -#: ../content.rst:146 -# cd37b225d62f4ada8a9c53b8a59058c2 -msgid "Move content" -msgstr "" - -#: ../content.rst:148 -# fdf12cc1429d4f04b2f0f7b34e7d597f -msgid "To move content around the portal structure defined above use :meth:`api.content.move` The code below moves the ``contact`` item (with all objects that it contains) out of folder ``about`` into the Plone portal root." -msgstr "" - -#: ../content.rst:165 -# edb0085b525a42178c0fac496ff20803 -msgid "Actually, ``move`` behaves like a filesystem move. If you pass it an ``id`` argument, you can define to what target ID the object will be moved to. Otherwise it will be moved with the same ID that it had." -msgstr "" - -#: ../content.rst:173 -# 1dcf5261803b493399da52b63bc3fbea -msgid "Rename content" -msgstr "" - -#: ../content.rst:175 -# faa9fcef181849569584a26275e7667c -msgid "To rename, you still use the :meth:`api.content.move` method, just pass in a new ``id`` instead and omit ``target``." -msgstr "" - -#: ../content.rst:193 -# f2e3484ddb1c483b9a6ec53b684772f3 -msgid "Copy content" -msgstr "" - -#: ../content.rst:195 -# e2a2b16d6f3f49af8c353fed03e7f1bc -msgid "To copy a content object, use the :meth:`api.content.copy`." -msgstr "" - -#: ../content.rst:205 -# b3ce7ee6963342b88a852087c1d85eac -msgid "Note that the new object will have the same id as the old object (if not stated otherwise). This is not a problem, since the new object is in a different container." -msgstr "" - -#: ../content.rst:215 -# b71261866c1f4b16a0dcd9f18e38d75a -msgid "You can also omit ``target`` and set ``strict=False`` which will duplicate your content object in the same container and assign it a non-conflicting id." -msgstr "" - -#: ../content.rst:232 -# 07547cfbc8c244a382bcc2a21326db69 -msgid "Delete content" -msgstr "" - -#: ../content.rst:234 -# 92e3474f9db24822a3cf4b61fc166634 -msgid "Deleting content works by passing the object you want to delete to the :meth:`api.content.delete` method:" -msgstr "" - -#: ../content.rst:251 -# 2c95b661210b42289b1162e38e253692 -msgid "Content manipulation with strict option" -msgstr "" - -#: ../content.rst:253 -# dfb38ff46fe7475085f3bdfc144ce884 -msgid "When manipulating content with :meth:`api.content.create`, :meth:`api.content.move` and :meth:`api.content.copy` the strict option is enabled by default. This means the id will be enforced, if the id is taken on the target container the API method will raise an error." -msgstr "" - -#: ../content.rst:263 -# 7739a32517b84869be510a2c329b2649 -msgid "If the strict option is disabled a non-conflicting id will be created." -msgstr "" - -#: ../content.rst:273 -# bd86a51620624dada144ac6c9e241ef1 -msgid "Get workflow state" -msgstr "" - -#: ../content.rst:275 -# 46329475116d4a33b5d618f60e5eb2bd -msgid "To find out in which workflow state your content is, use :meth:`api.content.get_state`." -msgstr "" - -#: ../content.rst:292 -# fffb873c06a54e14a968609cace8589e -msgid "Transition" -msgstr "" - -#: ../content.rst:294 -# 0b8c3d4abe9f41fb94aadf9efdbe8d66 -msgid "To transition your content into a new state, use :meth:`api.content.transition`." -msgstr "" - -#: ../content.rst:313 -# 5079fd47c007477b95bef5e7de5e3b2d -msgid "Browser view" -msgstr "" - -#: ../content.rst:315 -# ff2672996a6b46eea6f8df8ce3201cf1 -msgid "To get a BrowserView for your content, use :meth:`api.content.get_view`." -msgstr "" - -#: ../content.rst:333 -# 9a005ae8ef174043bd06dfcf63b69485 -msgid "Further reading" -msgstr "" - -#: ../content.rst:335 -# 1f6d92cc6a984056a3ebb6150b697029 -msgid "For more information on possible flags and usage options please see the full :ref:`plone-api-content` specification." -msgstr "" - diff --git a/docs/locale/pt_BR/LC_MESSAGES/groups.po b/docs/locale/pt_BR/LC_MESSAGES/groups.po deleted file mode 100644 index c64e3607..00000000 --- a/docs/locale/pt_BR/LC_MESSAGES/groups.po +++ /dev/null @@ -1,98 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../groups.rst:13 -# 9e122e7a75ac459686b27ce95ff81b2c -msgid "Groups" -msgstr "" - -#: ../groups.rst:18 -# cd6fabd9120a4f86a81fcea9cad45b5f -msgid "Create group" -msgstr "" - -#: ../groups.rst:20 -# da45a6ae32c54cfda3b81ded153f7c47 -msgid "To create a new portal group, use :meth:`api.group.create`." -msgstr "" - -#: ../groups.rst:31 -# 149e8a041c8744f8a37a81c03026f964 -msgid "When creating groups ``title``, ``description``, ``roles`` and ``groups`` are optional." -msgstr "" - -#: ../groups.rst:56 -# 47bc8e1452fb449bbc948322f5a674c2 -msgid "Get group" -msgstr "" - -#: ../groups.rst:58 -# f3e7f6198fcf4c229c3760ec6d321b20 -msgid "To get a group by it's name, use :meth:`api.group.get`." -msgstr "" - -#: ../groups.rst:73 -# 4130edd849d0404594ca596cf49c2354 -msgid "Editing a group" -msgstr "" - -#: ../groups.rst:75 -# 2f9267af057645c690cce6e99a634f8c -msgid "Groups can be edited by using the ``group_tool``. In this example the ``title``, ``description`` and ``roles`` are updated for the group 'Staff'." -msgstr "" - -#: ../groups.rst:103 -# f0352146c1a648f2aee5bc2ed06cdc87 -msgid "Get all groups" -msgstr "" - -#: ../groups.rst:105 -# d4a47757b5c04627b8edfcf7ccca4361 -msgid "You can also get all groups, by using :meth:`api.group.get_all`." -msgstr "" - -#: ../groups.rst:120 -# 2c387b09ea95471493a587b11d5a52f2 -msgid "Delete group" -msgstr "" - -#: ../groups.rst:122 -# d35743255adc4169a5fcd366aacc4729 -msgid "To delete a group, use :meth:`api.group.delete` and pass in either the groupname or the group object you want to delete." -msgstr "" - -#: ../groups.rst:145 -# bacaba3724d14de4adc1a4afdcc88c4f -msgid "Adding user to group" -msgstr "" - -#: ../groups.rst:147 -# f05d93fbc61c43f8a22fab1f34ddd0d1 -msgid "The ``add_user`` method accepts either the groupname or the group object of the target group and the username or the user object you want to add to the group." -msgstr "" - -#: ../groups.rst:171 -# 12480286674a46bfb9e16c9e03dbb9c0 -msgid "Deleting user from group" -msgstr "" - -#: ../groups.rst:173 -# 33d87dcabec046e6965ba42c5189ff88 -msgid "The ``delete_user`` method accepts either the groupname or the group object of the target group and either the username or the user object you want to remove from the group." -msgstr "" - diff --git a/docs/locale/pt_BR/LC_MESSAGES/index.po b/docs/locale/pt_BR/LC_MESSAGES/index.po deleted file mode 100644 index 0d3f2596..00000000 --- a/docs/locale/pt_BR/LC_MESSAGES/index.po +++ /dev/null @@ -1,83 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../index.rst:10 -# 36a498fd29f44ea08b73a81e9575712b -msgid "A Plone API" -msgstr "" - -#: ../index.rst:14 -# 2d772929e66f41f49b270dd4f9841235 -msgid "The :mod:`plone.api` is an elegant and simple API, built for humans wishing to develop with Plone." -msgstr "" - -#: ../index.rst:17 -# 8734d5794e9e4767a682abb425197da8 -msgid "It comes with *cookbook*-like documentation with step-by-step instructions for doing common development tasks in Plone. Recipes try to assume the user does not have extensive knowledge about Plone internals." -msgstr "" - -#: ../index.rst:21 -# de356adae1744fa0b7659b9861ec432b -msgid "The intention of this package is to be transitional. It points out which parts of Plone are particularly nasty -- we wish they get fixed so we can deprecate *plone.api* methods that cover them up, but leave the documentation in place." -msgstr "" - -#: ../index.rst:25 -# a77ac56676014f9383515b6ef53ac99b -msgid "Some parts of documentation already are this way: they don't use *plone.api* methods directly, but simply provide guidance on achiving a task using Plone's internals. Example: usage of the catalog in :ref:`content_find_example`." -msgstr "" - -#: ../index.rst:29 -# 08a89e1f7ffa4b0ab2348f84446a726e -msgid "The intention is to cover 20% of tasks we do 80% of the time. Keeping everything in one place helps keep the API introspectable and discoverable, which are important aspects of being Pythonic." -msgstr "" - -#: ../index.rst:35 -# a972eb56a166473b9f27f685f7f3914a -msgid "This package is still under heavy development. Do not use it yet unless you are completely sure what you are doing." -msgstr "" - -#: ../index.rst:40 -# f870fce2dcd64b0295053823ae2644c9 -msgid "Narrative documentation" -msgstr "" - -#: ../index.rst:53 -# 6729934995ca48dea471df348aebe55b -msgid "Complete API and advanced usage" -msgstr "" - -#: ../index.rst:61 -# 9dab33e814754aa3b5a95633ad02e0ab -msgid "Indices and tables" -msgstr "" - -#: ../index.rst:63 -# bfaad08851ee498d8004eb526a1dc3d1 -msgid ":ref:`genindex`" -msgstr "" - -#: ../index.rst:64 -# 08a9699e06de4c80a9c5eee2bbe5b82a -msgid ":ref:`modindex`" -msgstr "" - -#: ../index.rst:65 -# 9f6cfa3173aa4119bd9450ae352c414b -msgid ":ref:`search`" -msgstr "" - diff --git a/docs/locale/pt_BR/LC_MESSAGES/portal.po b/docs/locale/pt_BR/LC_MESSAGES/portal.po deleted file mode 100644 index ba7b6c34..00000000 --- a/docs/locale/pt_BR/LC_MESSAGES/portal.po +++ /dev/null @@ -1,83 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../portal.rst:13 -# dadb9d29f6804082aa01070a3cfc9102 -msgid "Portal" -msgstr "" - -#: ../portal.rst:18 -# 8db8368037e64f5abd7a745568aa6b8d -msgid "Get portal url" -msgstr "" - -#: ../portal.rst:20 -# 85af7a05697d439b881952dad55b00a1 -msgid "A shortcut for getting the url of the portal is now always at hand: :meth:`api.portal.url`." -msgstr "" - -#: ../portal.rst:36 -# c50879d0a894463cb84a7cecd8726bd2 -msgid "Get portal object" -msgstr "" - -#: ../portal.rst:38 -# c35120519c2547da93feb34bfbc48ba9 -msgid "Getting the Plone portal object is easy with :meth:`api.portal.get`." -msgstr "" - -#: ../portal.rst:54 -# 78a35eb7f40d4e65871768fc3e91aac1 -msgid "Get tool" -msgstr "" - -#: ../portal.rst:56 -# 9fb34e4553644d5a8f54345bb34554f8 -msgid "To get a portal tool in a simple way, just use :meth:`api.portal.get_tool` and pass in the name of the tool you need." -msgstr "" - -#: ../portal.rst:72 -# 6fadb24e93c94912afe22067cf106701 -msgid "Send E-Mail" -msgstr "" - -#: ../portal.rst:74 -# c95e4a80ccde41799a094dfba81b0b6c -msgid "To send an e-mail use :meth:`api.portal.send_email`:" -msgstr "" - -#: ../portal.rst:122 -# 9de94720386c4561bc38b37621be612a -msgid "Localized time" -msgstr "" - -#: ../portal.rst:124 -# 96567c9f43314ac69780a968cb283024 -msgid "To display the date/time in a user-friendly way, localized to the user's prefered language, use :meth:`api.portal.localized_time`." -msgstr "" - -#: ../portal.rst:143 -# 751fc57f5ba5410583e59c4411658178 -msgid "Show notification message" -msgstr "" - -#: ../portal.rst:145 -# f1d4de4b58d54aca8bf17ec68128ca46 -msgid "With :meth:`api.portal.show_message` you can show a notification message to the user." -msgstr "" - diff --git a/docs/locale/pt_BR/LC_MESSAGES/users.po b/docs/locale/pt_BR/LC_MESSAGES/users.po deleted file mode 100644 index 01f5e852..00000000 --- a/docs/locale/pt_BR/LC_MESSAGES/users.po +++ /dev/null @@ -1,138 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:07\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../users.rst:13 -# b10297c179bf4f1a9c830df3ace53479 -msgid "Users" -msgstr "" - -#: ../users.rst:18 -# 4e3f794d26c4450ba41129671a46c2e3 -msgid "Create user" -msgstr "" - -#: ../users.rst:20 -# 3986095a924a4e13aaec287750b8f788 -msgid "To create a new user, use :meth:`api.user.create`. If your portal is configured to use emails as usernames, you just need to pass in the email of the new user." -msgstr "" - -#: ../users.rst:41 -# 516b9be860554f5fb9354b59c965bfd0 -msgid "Otherwise, you also need to pass in the username of the new user." -msgstr "" - -#: ../users.rst:57 -# b18e0d436abe4e19b1a663f7891442cb -msgid "To set user properties when creating a new user, pass in a properties dict." -msgstr "" - -#: ../users.rst:77 -# da65341ea52a492e9a38544129107a02 -msgid "Besides user properties you can also specify a password for the new user. Otherwise a random 8-char alphanumeric password will be generated." -msgstr "" - -#: ../users.rst:92 -# be1390cf5bf64aacbbb61d1dae673c0f -msgid "Get user" -msgstr "" - -#: ../users.rst:94 -# d3a862a9a77147ae906fbb5118dae1bd -msgid "You can get a user with :meth:`api.user.get`." -msgstr "" - -#: ../users.rst:109 -# 0d78eb3491a849bba1ae8082f64411e0 -msgid "Get currently logged-in user" -msgstr "" - -#: ../users.rst:111 -# 5b310c5f33964819b27fd39bb934a473 -msgid "Getting the currently logged-in user is easy with :meth:`api.user.get_current`." -msgstr "" - -#: ../users.rst:126 -# 51e01ad9f9a24f9ba1282153bcea8351 -msgid "Check if current user is anonymous" -msgstr "" - -#: ../users.rst:128 -# 4db2cff962f04d898406f755dff004ba -msgid "Sometimes you need to trigger or display some piece of information only for logged-in users. It's easy to use :meth:`api.user.is_anonymous` to do a basic check for it." -msgstr "" - -#: ../users.rst:147 -# 3153968efc1f475eb70b53a0da67ee75 -msgid "Get all users" -msgstr "" - -#: ../users.rst:149 -# 442af592b40847ffb973fd858845b1c9 -msgid "Get all users in your portal with :meth:`api.user.get_all`." -msgstr "" - -#: ../users.rst:164 -# b01d126846774fc9b1c635f474a2e763 -msgid "Delete user" -msgstr "" - -#: ../users.rst:166 -# 2cc9a28dd2fc43a39b13c3c859777625 -msgid "To delete a user, use :meth:`api.user.delete` and pass in either the username or the user object you want to delete." -msgstr "" - -#: ../users.rst:193 -# 1bef28537ebc49c7879224812a1f1aeb -msgid "Check for role" -msgstr "" - -#: ../users.rst:195 -# 4fa3cacefd5144c0b473554fb2e45ea8 -msgid "Again on the security aspects, checking if a user has a certain role can be done with :meth:`api.user.has_role`. If you omit the ``user`` parameter, the currently logged-in user will be used." -msgstr "" - -#: ../users.rst:208 -# a7a76e7c2a154d7192f186441c2e06bc -msgid "When user is omitted the current user is used for role lookup." -msgstr "" - -#: ../users.rst:222 -# a8172c3fef8c49c4beafef9ab74f1192 -msgid "Check for permission" -msgstr "" - -#: ../users.rst:224 -# 12d6a2d8aa394309ae3c00bcefc223e6 -msgid "Likewise, you can also check if a user has a certain permission with :meth:`api.user.has_permission`. Omitting the ``user`` parameter means the currently logged-in user will be used." -msgstr "" - -#: ../users.rst:242 -# ac796486c4b749e19b944e5991d87959 -msgid "When user is omitted the current user is used for the permission check." -msgstr "" - -#: ../users.rst:259 -# 8f3f7c4e537f40e3b37a45e7c5c8f1f6 -msgid "Get groups that user is a member of" -msgstr "" - -#: ../users.rst:261 -# cc57b910281d4c47bf708c04e5d1e4c9 -msgid "Use ``get_groups``, passing in either the username or the user object you want to get groups for." -msgstr "" - diff --git a/docs/locale/users.pot b/docs/locale/users.pot deleted file mode 100644 index eea905b6..00000000 --- a/docs/locale/users.pot +++ /dev/null @@ -1,138 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012, Plone Foundation -# This file is distributed under the same license as the plone.api package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plone.api 0.1a1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-08-25 18:42\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../users.rst:13 -# 3565c3e8ccd64beb889ce1d1771dca5e -msgid "Users" -msgstr "" - -#: ../users.rst:18 -# 8c5f6f3a679e495cba1dd683ceebaa79 -msgid "Create user" -msgstr "" - -#: ../users.rst:20 -# 386ea27b406c4e83add7c09713829ccd -msgid "To create a new user, use :meth:`api.user.create`. If your portal is configured to use emails as usernames, you just need to pass in the email of the new user." -msgstr "" - -#: ../users.rst:41 -# e79289b09aed4a2d82fdcef2e37e04c1 -msgid "Otherwise, you also need to pass in the username of the new user." -msgstr "" - -#: ../users.rst:57 -# fa472e389de441bb940d0593c891b02f -msgid "To set user properties when creating a new user, pass in a properties dict." -msgstr "" - -#: ../users.rst:77 -# d5686899cb6748e8b2113f18dbdb1027 -msgid "Besides user properties you can also specify a password for the new user. Otherwise a random 8-char alphanumeric password will be generated." -msgstr "" - -#: ../users.rst:92 -# 9be09ba9d7f545c4a3253d4f0bf0a832 -msgid "Get user" -msgstr "" - -#: ../users.rst:94 -# 9e5872576759469e87495c14e4eeede7 -msgid "You can get a user with :meth:`api.user.get`." -msgstr "" - -#: ../users.rst:109 -# 2a97c324480f49188f66a6267a048c7e -msgid "Get currently logged-in user" -msgstr "" - -#: ../users.rst:111 -# 05a5186544d741aaaa376673edb20826 -msgid "Getting the currently logged-in user is easy with :meth:`api.user.get_current`." -msgstr "" - -#: ../users.rst:126 -# 115e5b52683540109d2f554462c3cbe0 -msgid "Check if current user is anonymous" -msgstr "" - -#: ../users.rst:128 -# 99dce21e6ef24cabb504fa07b535c524 -msgid "Sometimes you need to trigger or display some piece of information only for logged-in users. It's easy to use :meth:`api.user.is_anonymous` to do a basic check for it." -msgstr "" - -#: ../users.rst:147 -# 07553fc6d01640bda0b832224151f982 -msgid "Get all users" -msgstr "" - -#: ../users.rst:149 -# 4021de5b6bf34639a15f2c997764f186 -msgid "Get all users in your portal with :meth:`api.user.get_all`." -msgstr "" - -#: ../users.rst:164 -# 117a802fc5794117816ea7bfc674a587 -msgid "Delete user" -msgstr "" - -#: ../users.rst:166 -# 93bf27443cc348c28b43573e58e5322b -msgid "To delete a user, use :meth:`api.user.delete` and pass in either the username or the user object you want to delete." -msgstr "" - -#: ../users.rst:193 -# ecf0f638b7a74dc89acc3d13288fd339 -msgid "Check for role" -msgstr "" - -#: ../users.rst:195 -# 42d260f6e3414db084acb99be459c7fb -msgid "Again on the security aspects, checking if a user has a certain role can be done with :meth:`api.user.has_role`. If you omit the ``user`` parameter, the currently logged-in user will be used." -msgstr "" - -#: ../users.rst:208 -# 63a66c4ea451423c9a342cdeda2cc8b6 -msgid "When user is omitted the current user is used for role lookup." -msgstr "" - -#: ../users.rst:222 -# fd2e445a63ab405fb8b0d43cf2a649d9 -msgid "Check for permission" -msgstr "" - -#: ../users.rst:224 -# 1f3f3ef6e2cb4ad58cecb5be19d494a9 -msgid "Likewise, you can also check if a user has a certain permission with :meth:`api.user.has_permission`. Omitting the ``user`` parameter means the currently logged-in user will be used." -msgstr "" - -#: ../users.rst:242 -# 0295b0be51a746a790f31d22acc1d3af -msgid "When user is omitted the current user is used for the permission check." -msgstr "" - -#: ../users.rst:259 -# 1c8ca70d23524c619ac766419e0c9e18 -msgid "Get groups that user is a member of" -msgstr "" - -#: ../users.rst:261 -# 086a87d242ba4dcea61062803f1308d9 -msgid "Use ``get_groups``, passing in either the username or the user object you want to get groups for." -msgstr "" - diff --git a/docs/portal.md b/docs/portal.md deleted file mode 100644 index ae2d6003..00000000 --- a/docs/portal.md +++ /dev/null @@ -1,421 +0,0 @@ ---- -myst: - html_meta: - "description": "Access tools and global settings. Send e-mails and raise notifications." - "property=og:description": "Access tools and global settings. Send e-mails and raise notifications." - "property=og:title": "Portal" - "keywords": "Plone, development, API, global, task, " ---- - -```{eval-rst} -.. module:: plone - :no-index: -``` - -(chapter-portal)= - -# Portal - -(portal-get-example)= - -## Get portal object - -Getting the Plone portal object is easy with {meth}`api.portal.get`. - -```python -from plone import api -portal = api.portal.get() -``` - -% invisible-code-block: python -% -% self.assertEqual(portal.getPortalTypeName(), 'Plone Site') -% self.assertEqual(portal.getId(), 'plone') - -(portal-get-navigation-root-example)= - -## Get navigation root - -In multilingual or multi-site Plone installations, you probably want to get the language-specific navigation root object, not the top portal object. - -You do this with {meth}`api.portal.get_navigation_root()`. - -Assuming there is a document `english_page` in a folder `en`, which is the navigation root: - -% invisible-code-block: python -% -% from plone import api -% from plone.app.layout.navigation.interfaces import INavigationRoot -% from zope.interface import alsoProvides -% -% portal = api.portal.get() -% english_folder = api.content.create( -% type='Folder', -% title='en', -% container=portal, -% ) -% alsoProvides(english_folder, INavigationRoot) -% english_page = api.content.create( -% type='Document', -% title='English Page', -% container=english_folder, -% ) - -```python -from plone import api -nav_root = api.portal.get_navigation_root(english_page) -``` - -% invisible-code-block: python -% -% self.assertEqual(nav_root.id, 'en') - -Returns the folder `en`. If the folder `en` is not a navigation root, it would return the portal. - -## Get portal url - -Since we now have the portal object, it's easy to get the portal URL. - -```python -from plone import api -url = api.portal.get().absolute_url() -``` - -% invisible-code-block: python -% -% self.assertEqual(url, 'http://nohost/plone') - -(portal-get-tool-example)= - -## Get tool - -To get a portal tool easily, use {meth}`api.portal.get_tool` and pass in the name of the tool you need. - -```python -from plone import api -catalog = api.portal.get_tool(name='portal_catalog') -``` - -% invisible-code-block: python -% -% self.assertEqual(catalog.__class__.__name__, 'CatalogTool') - -(portal-get-localized-time-example)= - -## Get localized time - -To display the date/time in a user-friendly way, localized to the user's preferred language, use {meth}`api.portal.get_localized_time`. - -```python -from plone import api -from DateTime import DateTime -today = DateTime() -localized = api.portal.get_localized_time(datetime=today) -``` - -% invisible-code-block: python -% -% # assert that the result is in fact a datetime -% self.assertEqual(DateTime(localized).__class__, DateTime) - -(portal-get-default-language-example)= - -## Get default language - -To get the default language, use {meth}`api.portal.get_default_language`. - -```python -from plone import api -lang = api.portal.get_default_language() -``` - -% invisible-code-block: python -% -% # assert that the result is 'en' -% self.assertEqual(lang, 'en') - -(portal-get-current-language-example)= - -## Get current language - -To get the currently negotiated language, use {meth}`api.portal.get_current_language`. - -```python -from plone import api -lang = api.portal.get_current_language() -``` - -% invisible-code-block: python -% -% # assert that the result is 'en' -% self.assertEqual(lang, 'en') - -(portal-translate-example)= - -## Translate - -To translate a message in a given language, use {meth}`api.portal.translate`. - -```python -from plone import api -msg = api.portal.translate('Edited', lang='es') -``` - -% invisible-code-block: python -% -% # assert that the translation is correct -% self.assertEqual(msg, 'Editado') - -(portal-send-email-example)= - -## Send E-Mail - -To send an e-mail use {meth}`api.portal.send_email`: - -% invisible-code-block: python -% -% # Mock the mail host so we can test sending the email -% from plone import api -% from Products.CMFPlone.tests.utils import MockMailHost -% from Products.CMFPlone.utils import getToolByName -% from Products.MailHost.interfaces import IMailHost -% api.portal.PRINTINGMAILHOST_ENABLED = True -% -% mockmailhost = MockMailHost('MailHost') -% if not hasattr(mockmailhost, 'smtp_host'): -% mockmailhost.smtp_host = 'localhost' -% portal = api.portal.get() -% portal.MailHost = mockmailhost -% sm = portal.getSiteManager() -% sm.registerUtility(component=mockmailhost, provided=IMailHost) -% mailhost = getToolByName(portal, 'MailHost') -% mailhost.reset() - -```python -from plone import api -api.portal.send_email( - recipient="bob@plone.org", - sender="noreply@plone.org", - subject="Trappist", - body="One for you Bob!", -) -``` - -% invisible-code-block: python -% -% self.assertEqual(len(mailhost.messages), 1) -% -% try: -% # Python 3 -% from email import message_from_bytes -% except ImportError: -% # Python 2 -% from email import message_from_string as message_from_bytes -% msg = message_from_bytes(mailhost.messages[0]) -% self.assertEqual(msg['To'], 'bob@plone.org') -% self.assertEqual(msg['From'], 'noreply@plone.org') -% self.assertEqual(msg['Subject'], '=?utf-8?q?Trappist?=') -% self.assertEqual(msg.get_payload(), 'One for you Bob!') - -If you need to add other fields not supported on send_email signature, -Python's standard [email module](https://docs.python.org/2.7/library/email.message.html#email.message.Message) can also be used: - -```python -from email.mime.multipart import MIMEMultipart -from email.mime.text import MIMEText - -message = MIMEMultipart() -message.attach(MIMEText("One for you Bar!")) - -part = MIMEText('', 'xml') -part.add_header( - 'Content-Disposition', - 'attachment; filename="report.xml"' -) -message.attach(part) - -message['Reply-To'] = "community@plone.org" - -api.portal.send_email( - recipient="bob@plone.org", - sender="noreply@plone.org", - subject="Trappist", - body=message, -) -``` - -% invisible-code-block: python -% -% self.assertEqual(len(mailhost.messages), 2) -% -% msg = message_from_bytes(mailhost.messages[1]) -% payloads = msg.get_payload() -% self.assertEqual(len(payloads), 2) -% self.assertEqual(msg['Reply-To'], 'community@plone.org') -% self.assertEqual(payloads[0].get_payload(), 'One for you Bar!') -% self.assertIn( -% 'attachment; filename="report.xml', -% payloads[1]['Content-Disposition'] -% ) -% api.portal.PRINTINGMAILHOST_ENABLED = False -% mailhost.reset() - -(portal-show-message-example)= - -## Show notification message - -With {meth}`api.portal.show_message` you can show a notification message to the user. - -```python -from plone import api -api.portal.show_message(message='Blueberries!', request=request) -``` - -% invisible-code-block: python -% -% from Products.statusmessages.interfaces import IStatusMessage -% messages = IStatusMessage(request) -% show = messages.show() -% self.assertEqual(len(show), 1) -% self.assertTrue('Blueberries!' in show[0].message) - -Since version `2.0.0`, the `request` argument can be omitted. -In that case, the global request will be used. - -```python -api.portal.show_message(message='Cranberries!') -``` - -% invisible-code-block: python -% -% from Products.statusmessages.interfaces import IStatusMessage -% messages = IStatusMessage(request) -% show = messages.show() -% self.assertTrue('Cranberries!' in show[-1].message) - -(portal-get-registry-record-example)= - -## Get plone.app.registry record - -Plone comes with a package `plone.app.registry` that provides a common way to store configuration and settings. -{meth}`api.portal.get_registry_record` provides an easy way to access these. - -% invisible-code-block: python -% -% from plone.registry.interfaces import IRegistry -% from plone.registry.record import Record -% from plone.registry import field -% from zope.component import getUtility -% registry = getUtility(IRegistry) -% registry.records['my.package.someoption'] = Record(field.Bool( -% title=u"Foo")) -% registry['my.package.someoption'] = True - -```python -from plone import api -api.portal.get_registry_record('my.package.someoption') -``` - -% invisible-code-block: python -% -% self.assertTrue(api.portal.get_registry_record('my.package.someoption')) - -One common pattern when using registry records is to define an interface with all the settings. -{meth}`api.portal.get_registry_record` also allows you to use this pattern. - -% invisible-code-block: python -% -% from plone.registry.interfaces import IRegistry -% from plone.api.tests.test_portal import IMyRegistrySettings -% -% registry = getUtility(IRegistry) -% registry.registerInterface(IMyRegistrySettings) -% records = registry.forInterface(IMyRegistrySettings) -% records.field_one = 'my text' - -```python -from plone import api -api.portal.get_registry_record('field_one', interface=IMyRegistrySettings) -``` - -% invisible-code-block: python -% -% self.assertEqual( -% api.portal.get_registry_record('field_one', interface=IMyRegistrySettings), -% 'my text' -% ) - -It is possible to provide a default value that will be returned by {meth}`api.portal.get_registry_record`, if the queried record is not found. - -```python -from plone import api -api.portal.get_registry_record('foo', interface=IMyRegistrySettings, default='bar') -api.portal.get_registry_record('foo', default='baz') -``` - -% invisible-code-block: python -% self.assertEqual( -% api.portal.get_registry_record( -% 'foo', -% interface=IMyRegistrySettings, -% default='bar' -% ), -% 'bar', -% ) -% self.assertEqual( -% api.portal.get_registry_record('foo', default='baz'), -% 'baz', -% ) - -(portal-set-registry-record-example)= - -## Set plone.app.registry record - -{meth}`api.portal.set_registry_record` provides an easy way to change `plone.app.registry` configuration and settings. - -% invisible-code-block: python -% -% from plone.registry.interfaces import IRegistry -% from plone.registry.record import Record -% from plone.registry import field -% from zope.component import getUtility -% registry = getUtility(IRegistry) -% registry.records['my.package.someoption'] = Record(field.Bool( -% title=u"Foo")) -% registry['my.package.someoption'] = True - -```python -from plone import api -api.portal.set_registry_record('my.package.someoption', False) -``` - -% invisible-code-block: python -% -% self.assertFalse(registry['my.package.someoption']) - -{meth}`api.portal.set_registry_record` allows you to define an interface with all the settings. - -% invisible-code-block: python -% -% from plone.registry.interfaces import IRegistry -% from plone.api.tests.test_portal import IMyRegistrySettings -% -% registry = getUtility(IRegistry) -% registry.registerInterface(IMyRegistrySettings) -% records = registry.forInterface(IMyRegistrySettings) - -```python -from plone import api -api.portal.set_registry_record('field_one', 'new value', interface=IMyRegistrySettings) -``` - -% invisible-code-block: python -% -% self.assertEqual( -% api.portal.get_registry_record('field_one', interface=IMyRegistrySettings), -% 'new value' -% ) - -## Further reading - -For more information on possible flags and usage options please see the full {ref}`plone-api-portal` specification. diff --git a/docs/relation.md b/docs/relation.md deleted file mode 100644 index e06fb5bf..00000000 --- a/docs/relation.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -myst: - html_meta: - "description": "Create, access, modify, and delete relations of Plone content" - "property=og:description": "Create, access, modify, and delete relations of Plone content" - "property=og:title": "Relations" - "keywords": "Plone, development, API, relations, related content" ---- - -```{eval-rst} -.. module:: plone - :no-index: -``` - -(chapter-relation)= - -# Relations - - -(relation-get-example)= - -## Get relations - -% invisible-code-block: python -% -% from plone import api -% portal = api.portal.get() -% bob = api.content.create(type='Document', id='bob', container=portal) -% bobby = api.content.create(type='Document', id='bobby', container=portal) -% -% source = bob -% target = bobby -% api.relation.create(source=source, target=target, relationship="friend") - -```python -from plone import api - -friendship = api.relation.get( - source=source, target=target, relationship="friend", unrestricted=False, as_dict=False - ) -``` - -% invisible-code-block: python -% -% self.assertTrue(friendship) - -You must provide either source, target, or relationship, or a combination of those, to {meth}`api.relation.get`. -`unrestricted` and `as_dict` are optional. - -By default the result is a list of {class}`z3c.relationfield.RelationValue` objects. -If you set `as_dict=True` {meth}`api.relation.get` will return a dictionary with the names of the relations as keys and lists of objects as values. - -By default the View permission is checked on the relation objects. -You only get objects that you are allowed to see. -Use the `unrestricted` parameter if you want to bypass this check. - -To get back relations, so relations pointing to an item, use: - -```python -friendships = api.relation.get(target=target) -``` - -% invisible-code-block: python -% -% self.assertEqual([friendship.from_object for friendship in friendships], [source]) - -To get the objects connected by relations you can use the api of these return values: - -```python -for relation in api.relation.get(source=source): - source = relation.from_object - target = relation.to_object - relationship = relation.from_attribute -``` - - -(relation-create-example)= - -## Create relation - -To create a relation between source object and target object, use {meth}`api.relation.create`. - -```python -from plone import api - -portal = api.portal.get() -source = portal.bob -target = portal.bobby -api.relation.create(source=source, target=target, relationship="friend") -``` - -If the relation is based on a `RelationChoice` or `RelationList` field on the source object, the value of that field is created/updated accordingly. - -(relation-delete-example)= - -## Delete relation - -Delete one or more relations: - -```python -api.relation.delete(source=source, target=target, relationship="friend") -``` - -In order to delete relation(s), you must provide either `source`, `target`, or `relationship` to {meth}`api.relation.delete`. -You can mix and match. - -Delete all relations from source to any target: - -```python -api.relation.delete(source=source) -``` - -Delete all relations from any source to this target: - -```python -api.relation.delete(target=target) -``` - -Delete relations with name "friend" from source to any target: - -```python -api.relation.delete(source=source, relationship="friend") -``` - -Delete relations with name "uncle" from any source to this target: - -```python -api.relation.delete(target=target, relationship="uncle") -``` - -Delete relations with name "enemy" from any source to any target: - -```python -api.relation.delete(relationship="enemy") -``` - -If a deleted relation is based on a `RelationChoice` or `RelationList` field on the source object, the value of the field is removed/updated accordingly. - -## Further reading - -For more information on possible flags and usage options please see the full {ref}`plone-api-relation` specification. -For more information on relations read the relevant [chapter in the Mastering Plone training](https://training.plone.org/mastering-plone/relations.html). diff --git a/docs/user.md b/docs/user.md deleted file mode 100644 index 94731c9d..00000000 --- a/docs/user.md +++ /dev/null @@ -1,404 +0,0 @@ ---- -myst: - html_meta: - "description": "Access, create, modify, and delete users" - "property=og:description": "Access, create, modify, and delete users" - "property=og:title": "Users" - "keywords": "users, groups, Plone, development, API" ---- - -```{eval-rst} -.. module:: plone - :no-index: -``` - -(chapter-users)= - -# Users - -(user-create-example)= - -## Create user - -To create a new user, use {meth}`api.user.create`. -If your portal is configured to use emails as usernames, you just need to pass in the email of the new user. - -% invisible-code-block: python -% -% from plone import api -% api.portal.set_registry_record('plone.use_email_as_login', True) - -```python -from plone import api -user = api.user.create(email='alice@plone.org') -``` - -% invisible-code-block: python -% -% self.assertEqual(user.id, 'alice@plone.org') -% self.assertEqual(user.getProperty('email'), 'alice@plone.org') - -Otherwise, you also need to pass in the username of the new user. - -% invisible-code-block: python -% -% api.portal.set_registry_record('plone.use_email_as_login', False) - -```python -user = api.user.create(email='jane@plone.org', username='jane') -``` - -% invisible-code-block: python -% -% self.assertEqual(user.id, 'jane') -% self.assertEqual(user.getProperty('email'), 'jane@plone.org') - -To set user properties when creating a new user, pass in a `properties` dict. - -```python -properties = dict( - fullname='Bob', - location='Munich', -) -user = api.user.create( - username='bob', - email='bob@plone.org', - properties=properties, -) -``` - -% invisible-code-block: python -% -% self.assertEqual(user.getProperty('fullname'), 'Bob') -% self.assertEqual(user.getProperty('location'), 'Munich') - -Beside user properties, you can also specify a password for the new user. -Otherwise a random 8-character alphanumeric password will be generated. - -```python -user = api.user.create( - username='noob', - email='noob@plone.org', - password='secretpw', -) -``` - -(user-get-example)= - -## Get user - -You can get a user with {meth}`api.user.get`. - -```python -from plone import api -user = api.user.get(username='bob') -``` - -% invisible-code-block: python -% -% self.assertEqual(user.id, 'bob') - -## User properties - -Users have various properties set on them. -This is how you get and set them, using the underlying APIs: - -```python -from plone import api -user = api.user.get(username='bob') -user.setMemberProperties(mapping={ 'location': 'Neverland', }) -location = user.getProperty('location') -``` - -% invisible-code-block: python -% -% self.assertEqual(location, 'Neverland') - -(user-get-current-example)= - -## Get currently logged-in user - -Getting the currently logged-in user is easy with {meth}`api.user.get_current`. - -```python -from plone import api -current = api.user.get_current() -``` - -% invisible-code-block: python -% -% self.assertEqual(current.id, 'test_user_1_') - -(user-is-anonymous-example)= - -## Check if current user is anonymous - -Sometimes you need to trigger or display some piece of information only for logged-in users. -It's easy to use {meth}`api.user.is_anonymous` to do a basic check for it. - -```python -from plone import api -if not api.user.is_anonymous(): - trigger = False -trigger = True -``` - -% invisible-code-block: python -% -% self.assertTrue(trigger) - -(user-get-all-users-example)= - -## Get all users - -Get all users in your portal with {meth}`api.user.get_users`. - -```python -from plone import api -users = api.user.get_users() -``` - -% invisible-code-block: python -% -% self.assertTrue('test_user_1_' in [user.id for user in users]) - -(user-get-groups-users-example)= - -## Get group's users - -If you set the `groupname` parameter, then {meth}`api.user.get_users` will return only users that are members of this group. - -% invisible-code-block: python -% -% api.group.create(groupname='staff') -% api.group.add_user(username='jane', groupname='staff') - -```python -from plone import api -users = api.user.get_users(groupname='staff') -``` - -% invisible-code-block: python -% -% self.assertEqual(users[0].id, 'jane') - -(user-delete-example)= - -## Delete user - -To delete a user, use {meth}`api.user.delete` and pass in either the username or the user object you want to delete. - -```python -from plone import api -api.user.create(username='unwanted', email='unwanted@example.org') -api.user.delete(username='unwanted') -``` - -% invisible-code-block: python -% -% self.assertEqual(api.user.get(username='unwanted'), None) - -```python -unwanted = api.user.create(username='unwanted', email='unwanted@example.org') -api.user.delete(user=unwanted) -``` - -% invisible-code-block: python -% -% self.assertEqual(api.user.get(username='unwanted'), None) - -(user-get-roles-example)= - -## Get user roles - -The {meth}`api.user.get_roles` method is used for getting a user's roles. -By default it returns site-wide roles. - -```python -from plone import api -roles = api.user.get_roles(username='jane') -``` - -% invisible-code-block: python -% -% self.assertEqual(set(roles), set(['Member','Authenticated'])) - -If you pass in a content object, it will return local roles of the user in that particular context. - -```python -from plone import api -portal = api.portal.get() -blog = api.content.create(container=portal, type='Document', id='blog', title='My blog') -roles = api.user.get_roles(username='jane', obj=portal['blog']) -``` - -% invisible-code-block: python -% -% self.assertEqual(set(roles), set(['Member','Authenticated'])) - -(user-get-permissions-example)= - -## Get user permissions - -The {meth}`api.user.get_permissions` method is used for getting user's permissions. -By default it returns site root permissions. - -```python -from plone import api -mike = api.user.create(email='mike@plone.org', username='mike') -permissions = api.user.get_permissions(username='mike') -``` - -% invisible-code-block: python -% -% PERMISSIONS = { -% 'View': True, -% 'Manage portal': False, -% 'Modify portal content': False, -% 'Access contents information': True, -% } -% -% for k, v in PERMISSIONS.items(): -% self.assertTrue(v == api.user.get_permissions(username='mike').get(k, None)) -% self.assertTrue(v == api.user.get_permissions(user=mike).get(k, None)) - -If you pass in a content object, it will return local permissions of the user in that particular context. - -```python -from plone import api -portal = api.portal.get() -folder = api.content.create(container=portal, type='Folder', id='folder_two', title='Folder Two') -permissions = api.user.get_permissions(username='mike', obj=portal['folder_two']) -``` - -% invisible-code-block: python -% -% PERMISSIONS = { -% 'View': False, -% 'Manage portal': False, -% 'Modify portal content': False, -% 'Access contents information': False, -% } -% -% for k, v in PERMISSIONS.items(): -% self.assertTrue(v == api.user.get_permissions(username='mike', obj=portal['folder_two']).get(k, None)) -% self.assertTrue(v == api.user.get_permissions(user=mike, obj=portal['folder_two']).get(k, None)) - -(user-has-permission-example)= - -## Check user permission - -Instead of getting all user permissions, you can check a single permission using the {meth}`api.user.has_permission` method. -By default it checks the permission on the site root. - -```python -from plone import api -adam = api.user.create(email='adam@plone.org', username='adam') -can_view = api.user.has_permission('View', username='adam') -``` - -% invisible-code-block: python -% -% self.assertTrue(can_view) - -If you pass in a content object, it will check the permission in that particular context. - -```python -from plone import api -portal = api.portal.get() -folder = api.content.create(container=portal, type='Folder', id='folder_hp', title='Folder') -can_view = api.user.has_permission('View', username='adam', obj=folder) -``` - -% invisible-code-block: python -% -% self.assertFalse(can_view) - -(user-grant-roles-example)= - -## Grant roles to user - -The {meth}`api.user.grant_roles` allows us to grant a list of roles to the user. - -```python -from plone import api -api.user.grant_roles(username='jane', - roles=['Reviewer', 'SiteAdministrator'] -) -``` - -% invisible-code-block: python -% -% EXPECTED_ROLES_SITE = ['Member', 'Reviewer', 'SiteAdministrator', 'Authenticated'] -% roles = api.user.get_roles(username='jane') -% self.assertEqual(set(EXPECTED_ROLES_SITE), set(roles)) - -If you pass a content object or folder, -the roles are granted only on that context and not site-wide. -But all site-wide roles will also be returned by {meth}`api.user.get_roles` for this user on the given context. - -```python -from plone import api -folder = api.content.create(container=portal, type='Folder', id='folder_one', title='Folder One') -api.user.grant_roles(username='jane', - roles=['Editor', 'Contributor'], - obj=portal['folder_one'] -) -``` - -% invisible-code-block: python -% -% EXPECTED_ROLES_CONTEXT = EXPECTED_ROLES_SITE + ['Editor', 'Contributor'] -% roles = api.user.get_roles(username='jane', obj=portal['folder_one']) -% self.assertEqual(set(EXPECTED_ROLES_CONTEXT), set(roles)) -% roles = api.user.get_roles(username='jane') -% self.assertEqual(set(EXPECTED_ROLES_SITE), set(roles)) - -(user-revoke-roles-example)= - -## Revoke roles from user - -The {meth}`api.user.revoke_roles` allows us to revoke a list of roles from the user. - -```python -from plone import api -api.user.revoke_roles(username='jane', roles=['SiteAdministrator']) -``` - -% invisible-code-block: python -% -% EXPECTED_ROLES_SITE = ['Member', 'Authenticated', 'Reviewer'] -% roles = api.user.get_roles(username='jane') -% self.assertEqual(set(EXPECTED_ROLES_SITE), set(roles)) - -If you pass a context object the local roles for that context will be removed. - -```python -from plone import api -folder = api.content.create( - container=portal, - type='Folder', - id='folder_three', - title='Folder Three' -) -api.user.grant_roles( - username='jane', - roles=['Editor', 'Contributor'], - obj=portal['folder_three'], -) -api.user.revoke_roles( - username='jane', - roles=['Editor'], - obj=portal['folder_three'], -) -``` - -% invisible-code-block: python -% -% EXPECTED_ROLES_CONTEXT = EXPECTED_ROLES_SITE + ['Contributor'] -% roles = api.user.get_roles(username='jane', obj=portal['folder_three']) -% self.assertEqual(set(EXPECTED_ROLES_CONTEXT), set(roles)) - -## Further reading - -For more information on possible flags and usage options please see the full {ref}`plone-api-user` specification. diff --git a/requirements-docs.txt b/requirements-docs.txt index 694c282c..6c4616e1 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,12 +1,5 @@ -lesscpy linkify-it-py myst-parser plone-sphinx-theme sphinx-autobuild -sphinx-copybutton -sphinx-sitemap -sphinx-togglebutton -sphinxcontrib-spelling -sphinxext-opengraph -sphinxcontrib-video -vale==2.30.0 +sphinx-reredirects