Skip to end of banner
Go to start of banner

Part 4 - Creating the document library page

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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, like below:

Suppliers used

Pro Tip

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

Pro Tip

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

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

This keychain is useful for debugging purposes.

Structure and Content

  1. First, create a report-table macro. This will be the main structure of our report, which is a table. 

  2. Next, define what to report using a content-reporter block. Nest this block inside the report-table block.

  3. Edit the content-reporter block, and type attachment in Types. This means Reporting will only fetch attachments within this space.

  4. In the content-reporter block, insert a text-sort block. 

  5. Edit the text-sort block and type content:title for Key.

  6. Note that content supplier or attachment supplier can be used interchangeably here, since attachment is a form of content.

  7. Next, choose 'ascending' for Order.

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

Now we are ready to setup the report columns.

Attachment Name

  1. Still within the report-table block, insert a report-column macro underneath the content-reporter block. 

  2. Name this column File Name. Insert a report-info block inside this report-column.

  3. Edit the report-info block, name the Key attachment:title and check Link To Item. 

  4. Reporting will fetch the attachment's title or file name and provide a link to the attachment. 

Page

  1. Insert a report-column block, name this column Page or Source

  2. Insert a report-info block inside this report-column.

  3. Edit the report-info block, name the Key attachment:attached to and check Link To Item.

  4. Reporting will fetch the source of this attachment (which page it belongs to) and provide a link to that page.

File Size

  1. Insert a report-column block, name this column File Size.

  2. Insert a report-info block inside this report-column.

  3. Edit the report-info block, name the Key attachment:nice file size.

  4. Note that nice file size returns the most suitable metric for file size, compared to file size which only returns the length in bytes.

Creator

  1. Insert a report-column block, name this column CreatorOwner or Uploaded by.

  2. Insert a report-info block inside this report-column.

  3. Edit the report-info block, name the Key attachment:creator.

  4. This column returns the user that uploaded the attachment.

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

Modification Date

  1. Insert a report-column block, name this column Last modified.

  2. Insert a report-info block inside this report-column.

  3. Edit the report-info block, name the Key attachment:modification date > date: dd MMMM yyyy (hh:mm a).

  4. Note that a keychain is used to format the modification date in the following example: 04 January 2017 (08:27 AM).

No Attachments

Finally, insert a report-empty block and enter a message to display when no attachments have been uploaded to the space.

This message will appear when the space has no attachments.

Macro structure

Full source

Documents Library 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>

  • No labels