Management of collections

From Armarius

Jump to: navigation, search

Return to development documentation [[1]]

[edit] Introduction

(Elod)

Having read these specifications sere are some introductive ideas and precisions:

We will distinguish 2 types of collections:

- Physical collections these collections correspond to the real file structure of documents and basic rights are defined upon them. Only administrators will see these collections and they are there in order to facilitate the importation of new documents in the Armarius system. Normal users will not see these structures.

- Virtual collections these collections contain images in a certain order but with no hierarchical orders among them. From a practical point of view: when importing physical collections, the system can create automatically their mirror virtual collection. Users will be able to create collections: gather documents as they wish and put them in a given list.

Another idea can be the association of virtual collections to special meta types. So if a set of documents are described with a given metadata type they belong to the same collection. Things are getting complicated....

What follows refers basically on physical collections.

[edit] Functionnalities

There are now collections composed by sub-collections and pages. A sub-collection can be composed by pages or by sub-collections (like files (=> pages) and folders (=>collections/sub-collections) in an Operating System).

The operations that can be done on a collection are :

  • To create a collection or sub collection by affecting it a title and by positioning it within the tree of collections.
  • To edit the title of the selected collection and/or to move it within the tree of collections.
  • To remove a sub collection (or even all collections on the system) and all the content inside it (in a recursive way).
  • To create a set of sub collections and put it all inside a parent collection.
  • To remove a set of collections and all the content inside them by selecting those collections on the interface.
  • Add a page to a collection or sub-collection
  • Delete a page
  • Edit the page information
  • Move the page to another collection or sub-collection
  • Delete a page from a collection/sub-collection

[edit] Details of programmation

  • The table armarius_volumes,armarius_page_orders,armarius_orderings have been removed.

A table armarius_collections_content has been created such as : armarius_collections_content(cc_col_id,cc_content,cc_content_type). cc_content is an id for a page or for a subcollection. To know if cc_content indicates a page or a subcollection, we use the field cc_content_type containig "2" for a page and "1" for a subcollection.
Therefore, to list the content of a collection, we have to look at the table and where there is cc_col_id which corresponds to the collection we want to show, we look at the cc_content associated. If it's a page (cc_content_type ="2"), we show it ; if it's a subcollection (cc_content_type ="1"), we start again, replacing cc_col_id by the id of the subcollection and we continue in a recursive way.

Here you can see the new structure of the database of Armarius [[2]]

3 PHP classes have been created :

  • Collection which is a simple class to facilitate the collection management
  • CollecTionManagement to facilitate the management of the collections
  • Page representing one page.

=> Here you can see the Doxygen documentation of these classes [[3]]

We have thought that it was necessary to do a Javascript presentation of the content of the collections to facilitate the access and the browsing in the content and the operations to do on it. Thus, we have programmed a tree with nodes which are collections, subcollections and pages. There's a button near to each node and clicking on it, allows to see the subcollections and pages (if they exist) which there are in it.

Image:Vis_collections.png
Personal tools