Part 4 - Creating the document library page

Overview

The document library holds all the attachments in the project management space. Important documents such as invoices, resumes, quotations can be uploaded to the respective subprojects.

Using Reporting, all the attachments uploaded to any subproject can be reported in one table along with other relevant details.

Suppliers used

content-reporter can be further edited to filter attachments that are listed here, using options such as Space, Label and Scope.

When to use the Collection Supplier

Use the object supplier if you are unsure of the object type.

Pair any key with an object:class keychain and it will return the type of object, for example:

data:Project Members > object:class returns

class java.util.ArrayList

This means the Project Members Scaffolding data is stored as an Array List.

This keychain is useful for debugging purposes.

Structure and Content

First, set the main structure of our report, which is a table

  • create a report-table macro

Next, define what to report by adding a content-reporter block

  • nest the content-reporter block inside the report-table block

  • edit the content-reporter block

    • type attachment in Types

This means Reporting only fetches attachments within this space.

In the content-reporter block

  • insert a text-sort block

  • edit the text-sort block

    • type content:title for Key

    • choose 'ascending' for Order

This sorts the attachments in ascending order based on the attachment file name.

The content supplier or attachment supplier can be used interchangeably here, as the attachment is a form of content.

Now we are ready to setup the report columns.

Attachment Name

Within the report-table block

  • insert a report-column macro underneath the content-reporter block

    • name this column File Name

  • insert a report-info block inside this report-column

  • edit the report-info block

    • name the Key attachment:title

    • check Link To Item

Page

  • insert a report-column block

    • name this column Page or Source

  • insert a report-info block inside this report-column

  • edit the report-info block

    • name the Key attachment:attached to

    • check Link To Item

File Size

  • insert a report-column block

    • name this column File Size

  • insert a report-info block inside this report-column

  • edit the report-info block

    • name the Key attachment:nice file size

Creator

  • insert a report-column block,

    • name this column Creator, Owner or Uploaded by

  • insert a report-info block inside this report-column

  • edit the report-info block

    • name the Key attachment:creator

Additionally, you can opt to check Link To Item to return a link to the user's profile page.

Modification Date

  • insert a report-column block

    • name this column Last modified

  • insert a report-info block inside this report-column

  • edit the report-info block

    • name the Key attachment:modification date > date: dd MMMM yyyy (hh:mm a)

No Attachments

  • insert a report-empty block

  • enter a message to display when no attachments have been uploaded to the space

Macro structure

Full source

<ac:structured-macro ac:macro-id="bdc29079-6e57-41c2-a380-5419595c5fe7" ac:name="report-table" ac:schema-version="1"> <ac:rich-text-body> <ac:structured-macro ac:macro-id="9fa9a93e-5f41-4438-a73a-cda85f2fc340" ac:name="content-reporter" ac:schema-version="1"> <ac:parameter ac:name="types">attachment</ac:parameter> <ac:rich-text-body> <ac:structured-macro ac:macro-id="df47573d-e0f0-4513-8de8-6238d2065f16" ac:name="text-sort" ac:schema-version="1"> <ac:parameter ac:name="">attachment:title</ac:parameter> </ac:structured-macro> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="dc9419b6-0054-415e-93ec-c6036412a6b6" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">File Name</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="1bda2e75-d80a-4bf5-ba61-4ddfb3fe0c6d" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="">attachment:title</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="611720bd-d51f-43ef-b4fe-2a7fbb60f0ed" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Page</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="0c328b11-d065-4384-9c35-8107b5b9a91a" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="">attachment:attached to</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="1322c656-63f5-4bf8-985e-5d5343af0ef4" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Size</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="8854b230-e8d9-4021-b741-0bf7eb36b874" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">attachment:nice file size</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="641339ca-edba-4668-a659-7c0e54e63841" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Uploaded by</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="9921458f-db5e-4830-98b8-d47564420569" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">attachment:creator</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="8a408e2f-090b-469e-9dfd-e2eb61b228bc" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Last modified</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="5caa0d8d-5641-47ea-89c3-b8c8359f1c06" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">attachment:modification date &gt; date: dd MMMM yyyy (hh:mm a)</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="a96c15de-f95c-4cf7-8256-cbc11b6c33f2" ac:name="report-empty" ac:schema-version="1"> <ac:rich-text-body> <p> <em>No files have been attached to this space.</em> </p> </ac:rich-text-body> </ac:structured-macro> </ac:rich-text-body> </ac:structured-macro>

Next

Part 5 - Creating the project status and budget page

Â