make catalog addable
garden
Merge branch 'master' into feature.serviceaddition
- ``substanced.content.find_content_type`` renamed to
  ``substanced.content.find_content``

- The ``substanced.service`` package was removed.  All of the functions it
  used to contain are now in ``substanced.content`` (e.g. ``find_service``,
  ``find_services``).

- The ``substanced.content.service`` decorator was added.  It's a slight
  variant on ``substanced.content.content``.

- The ``substanced.content.add_service_type`` configurator directive was
  added.  It's a slight variant on ``substanced.content.add_content_type``.

- The Substance D root factory is now in charge of adding an objectmap
  service and a principals service instead of the ``substanced.root.Root``
  constructor.

- The ``__addable__`` attribute is now named ``__sd_addable__``.

- The ``__sd_addable__`` attribute may now be a callable, which accepts a
  Pyramid introspectable representing a content type, and which returns true
  or false.

- The folder contents view now honors the ``__sd_deletable__`` attribute of
  subobjects.  If False (or called, and results in False), the ``deletable``
  member of the folder contents ``show`` view result will be False.
  Previously this was only true if the user did not have
  ``sdi.manage-contents`` permission.  Rationale: we need a way to prevent
  users from deleting certain subobjects such as the root services folder and
  the principals and objectmap services they contain, even if they would
  otherwise have the permission to do so.

- The folder contents template now requires a ``deletable`` value for each
  content object instead of one named ``modifiable``.

- Folder contents items that are not viewable are no longer returned in the
  sequence of folder items within the guts of the contents view.  This means
  that the ``visible`` flag in each content dict is vestigial.  All items
  returned from the view are visible.

- The substanced.util.Batch machinery can now accept a generator as a
  sequence if a ``seqlen`` is passed to its constructor.

- The guts of the computation of the folder contents view was moved to a
  function ``substanced.sdi.sdi_folder_contents`` (might be useful to reuse
  by alternate folder implementers).

- The ``substanced.sdi.get_mgmt_views`` API is now named
  ``substanced.sdi.sdi_mgmt_views``.

- The ``substanced.sdi.get_add_views`` API is now named
  ``substanced.sdi.sdi_add_views``.

- The root factory now uses registry.content.create to create the root
  object, the objectmap and the principals service.  This allows extendors to
  override what kind of object will be created for each type.

- The default services folder at the root no longer sets a NO_INHERIT at the
  end of its ACL.

- The RootCreated event now accepts ``request`` rather than ``registry`` as
  its second argument.

- Removed a stray redefinition of ``objectmap`` from the ``acl_edit_view``.

- It is now possible to add a services folder TTW.

- A services folder now has its own icon separate from the normal folder
  icon.

- It is now possible to add a Catalog service to a services folder TTW.

- Services with add views no longer appear in the dropdown list within
  non-service folders.

- Services which provide a ``service_name`` are not addable to service
  folders which already contain services with that service name.

- The ``add_service``, ``add`` and ``_notify`` methods of
  substanced.folder.Folder now each accept an optional registry argument.

- The ``allow_services`` flag that was accepted by the ``check_name`` and
  ``add`` methods of ``substanced.folder.Folder`` has been removed.  In its
  place is a ``reserved_names`` value.  It defaults to ``('__services__',)``
  but can be overridden as necessary.

- The ``add_service`` method of substanced.folder.Folder now uses
  registry.content.create to create a services folder rather than creating
  one directly via an object constructor.

- The subobjects within a principals service (users, groups, resets) are now
  marked __sd_deletable__ = False.