Related Objects - tsgrp/hpi GitHub Wiki

This page is being moved to the alfresco documentation

Relation Types

Relation Based

Relation-based related objects should be used when you want to display related content based on an actual repository relationship or association. For example:

  • When displaying a document, also display the emails that the document has been attached to.
  • When displaying an email, display the list of documents that were attached to the email.

Since HPI creates a relationship between the email (parent) and the attached documents (children), a relation-based Related Objects module makes sense.

There are three types of relation-based Related Objects:

  • Parent - show the parent(s) of a relationship, where the current document or folder is the child. Using the email example, this relationship would show the emails that a document was attached to.

  • Child - show the child(ren) of a relationship where the current document or folder is the parent. Using the email example, when viewing an email, it would show the documents attached to the email.

  • Sibling - show other objects that share a parent with the current document or folder. Using the email example, if looking an a document that was attached to an email (or emails), it would show any other documents attached to the same email (or emails).

Query Based

Query-based related objects should be used when no repository relationship is available, but you can construct a simple query to find related objects. For example, say we have in our OTC:

  • A folder subtype called 'Policy' that has a policy_number attribute
  • A folder subtype called 'Claim' that has claim_number and policy_number attributes

In the above case, we could setup a query based relationship to show related claims. You would set up a query-based relationship that looks for 'Claim' objects that have a policy_number equal to the policy_number of the current folder loaded in the stage.

Folder Tags

Folder tags (also known as categories) sort child documents on the stage based on a repeating attribute on documents. Tags can be used in View All Documents to filter documents by category as well as in related objects to list documents under fake sub folders keyed by the values of the 'folder tags' attribute. The default attribute is 'keywords' for Documentum and 'hpi_folderTags' for Alfresco.

If you want to change the folder tags attribute from the default attribute, edit your property overrides file in OC and set the attribute hpi.tags.trackingattr to the desired attribute. Defaults can be found in dctm-defaults.propertes and alfresco-defaults.properties for Documentum and Alfresco, respectively.

Note - to get Folder Tags to work properly, you must:

  • The base Folder type configured in the Object Type Config (OTC)
  • The case 'Folder' (or whatever folder type you are using in your trac) must be configured to be a container in the OTC. This defaults to false for all types as of Dec 2013, so you must be sure to update it to true.
  • In Alfresco, you must add hpi:folderTaggable as a mandatory aspect on your target document type(s). This sets up the default repeating attribute expected by hpi.tags.trackingattr.

External Relation

This configuration should be used when a relation is stored in an external service. It requires the development of a custom OpenContent endpoint. The current implementation assumes that the endpoint configured is an endpoint in OpenContent that returns an array of OpenContentObjects. The custom OpenContent endpoint makes a call to one or more external services and uses information from the response to determine which respository objects to display.

Options

Enable Auto Expand

Automatically load this relation when the stage loads. If this is set to 'false' the user must click an expand button to load the results of the relation.

Enable Info Block

Next to each result, show an infoblock with the attributes configured in admin.

Enable Show Annotations

Next to each result, have a link to OpenAnnotate for that document.

Enable Object Icon

Show an icon next to each object that matches the content type.

Enable Dual Screen

Have a button next to each result to view it in 'dual screen' mode with the current doc.

Number of Results Displayed

Set the number of results visible on loading of the relation, if there are more than this, a user must click to see them.

Expand With Folder Tags

When a subfolder expands, sort its contents using folder tags.

Export Doc

Show an icon next to document objects to download them directly without having to navigate to the document in the stage. Defaults to false.