source: main/trunk/docs/devel/publication.rst @ 1191

Revision 1191, 4.8 KB checked in by pcosquer, 7 years ago (diff)

docs: publication

Publication

System Message: ERROR/3 (<string>, line 7)

Unknown directive type "versionadded".

.. versionadded:: 1.1

This document describes how the :doc:`Publication specification </specs/publication>` is implemented.

System Message: ERROR/3 (<string>, line 9); backlink

Unknown interpreted text role "doc".

Publishers

A new boolean field :attr:`.UserProfile.can_publish` is added to each :class:`.UserProfile`. By default, this field is set to False. If this field is set to True, the user can publish an object (if all other rules are respected).

System Message: ERROR/3 (<string>, line 15); backlink

Unknown interpreted text role "attr".

System Message: ERROR/3 (<string>, line 15); backlink

Unknown interpreted text role "class".

The migration :file:`plmapp/migrations/0014_auto__add_field_userprofile_can_publish.py` adds this field (set to False) to all existing users.

System Message: ERROR/3 (<string>, line 20); backlink

Unknown interpreted text role "file".

This field is neither a creation field nor a modification field. Only an admin can modify this field via the admin interface.

Model

PLMObject

A new boolean field :attr:`.PLMObject.published` is added to each :class:`.PLMObject`. By default, this field is set to False. If this field is set to True, it means the object has been published and is accessible to anonymous users.

System Message: ERROR/3 (<string>, line 32); backlink

Unknown interpreted text role "attr".

System Message: ERROR/3 (<string>, line 32); backlink

Unknown interpreted text role "class".

The migration :file:`plmapp/migrations/0015_auto__add_field_plmobject_published.py` adds this field (set to False) to all existing plmobjects.

System Message: ERROR/3 (<string>, line 37); backlink

Unknown interpreted text role "file".

A new property named :attr:`.PLMObject.published_attributes` returns the list of published attributes. By default, it returns the following attributes:

System Message: ERROR/3 (<string>, line 41); backlink

Unknown interpreted text role "attr".
  1. type
  2. reference
  3. revision
  4. name

This property can be overriden by a custom model to add more attributes.

History

All publication and unpublication are stored in the :class:`.History` table.

System Message: ERROR/3 (<string>, line 55); backlink

Unknown interpreted text role "class".

A publication is stored with the :attr:`.AbstractHistory.action` field set to Publish.

System Message: ERROR/3 (<string>, line 57); backlink

Unknown interpreted text role "attr".

A unpublication is stored with the :attr:`.AbstractHistory.action` field set to Unpublish.

System Message: ERROR/3 (<string>, line 60); backlink

Unknown interpreted text role "attr".

Controller

Publishing a document

Methods

The following methods are available to publish a PLMObject and test if a PLMObject can be published:

Tests

Unpublishing a document

Methods

The following methods are available to unpublish a PLMObject and test if a PLMObject can be unpublished:

Tests

Views

Lifecycle

:func:`.display_object_lifecycle` handles the publication and unpublication of a PLMObject.

System Message: ERROR/3 (<string>, line 135); backlink

Unknown interpreted text role "func".

Tests

Public

:func:`.public` view renders a published PLMObject. If the given object is not published, it redirects to the login page. If the given object is neither a part nor a document, it raises an :exc:`.Http404` exception.

System Message: ERROR/3 (<string>, line 156); backlink

Unknown interpreted text role "func".

System Message: ERROR/3 (<string>, line 156); backlink

Unknown interpreted text role "exc".

Tests

Public download

:func:`.public_download` handles the download of a published file.

System Message: ERROR/3 (<string>, line 173); backlink

Unknown interpreted text role "func".

Browse

:func:`.browse` allows an anonymous user to browse all published parts and documents.

System Message: ERROR/3 (<string>, line 179); backlink

Unknown interpreted text role "func".

Templates

lifecycle.html

If an object has been published, this template displays a link to its publish page.

If the user can publish the object, it adds a form named form-publish that prompts the user password and warns the user that a published object is accessible to anonymous user.

If the user can unpublish the object, it adds a form named form-unpublish that prompts the user password and warns the user that a unpublished object is no more accessible to anonymous user.

public.html

If the object has been published, this template displays:

  • all non deprecated files
  • all published attributes
  • the state of the object
  • all published revisions
  • all published attached parts and documents

browse.html

If the user is not authenticated, it hides all unaccessible objects (users, groups, unpublished object).

Note: See TracBrowser for help on using the repository browser.