Skip to end of banner
Go to start of banner

Part 6 - Creating the team members 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 2 Next »

The team members page lists all the users that belong to the project. This is done by filtering and displaying a list of users based on a user group.

For this project, 2 user groups are created: pmd-project-leaders and pmd-project-members.

pmd-project-leaders include all the project leaders involved in the project.

pmd-project-members include all the project members involved in the project.

Using Reporting, all the users that belong is these two groups will be listed here along with other relevant details, like below:

Suppliers used


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.

Content and Structure

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

  2. Make sure to check Injected as we will use parameter injection later in the report.

  3. Next, define who to report using a user-reporter block. Nest this block inside the report-table block.

  4. Edit the user-reporter block, and type pmd-project-members, pmd-project-leaders in Groups. This means Reporting will only fetch users from those groups.

  5. In the user-reporter block, insert a text-sort block. 

  6. Edit the text-sort block and type user:full name  for Key.

  7. Next, choose 'ascending' for Order.

  8. This will sort the users in ascending order based on their full name.


Now we are ready to setup the report columns.

User Name

  1. Still within the report-table block, insert a report-column macro underneath the user-reporter block.
     
  2. Name this column Name. Insert a report-info block inside this report-column.

  3. Edit the report-info block, name the Key user:full name

  4. Reporting will fetch the user's full name.

Email

  1. Insert a report-column block, name this column Email

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

  3. Edit the report-info block, name the Key user:email.

  4. Reporting will fetch the user's email.

Department

  1. Insert a report-column block, name this column Department

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

  3. Edit the report-info block, name the Key user:department.

  4. Reporting will fetch the user's department.

Position

  1. Insert a report-column block, name this column Position

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

  3. Edit the report-info block, name the Key user:position.

  4. Reporting will fetch the user's position.

Project Lead

This column will show a list of projects that the user is involved in as a leader.

  1. Insert a report-column block, name this column Project Lead or Leading Projects

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

  3. We will now report a list within the current report's column.

  4. Insert a content-reporter block within the report-list block.

  5. Edit the content-reporter block, set Type to pages and Labels to subproject, as we'd like to collect pages that are subprojects.

  6. Inside the content-reporter block, insert a text-filter block. This is used to fetch subprojects that belong to the reporting user.

  7. Edit the text-filter block, name the Key data:Project Leader > collection:first > user:full name

  8. Next, set Exact Value to %user:full name%.

  9. Now that we have the content and structure, insert a report-body block under content-reporter.

  10. Insert 2 report-info blocks inside report-body.

  11. For the first report-info block, name the Key page:title and check Link To Item.

  12. Next, nest the second report-info block with a pair of parentheses and name the Key data:Project Status

  13. Finally, insert a report-empty block under report-body and enter a message to display when the user is not leading any projects.
What does this mean?

Notice that the key data:Project Leader is fetching data from a Scaffolding block we used in our subprojects, like this one:

The Project Leader Scaffold data block happens to be returned in a list, so we use the Collection Supplier to fetch the first item in the list, and then finally converting it to the user's full name.

Now that we have the name of the project leader from the subproject, Exact Value can match the user in this current report to the full name returned from the content-reporter.

Hence, the reporter will find a list of subprojects with the Project Leader as a particular user and report it based on the current user in the table. Based on the report-info blocks we used, the page title and subproject status is shown in the fifth column:

Projects Involved In

This column will show a list of projects that the user is involved in as a member.

  1. Insert a report-column block, name this column Projects Involved In

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

  3. We will now report a list within the current report's column.

  4. Insert a content-reporter block within the report-list block.

  5. Edit the content-reporter block, set Type to pages and Labels to subproject, as we'd like to collect pages that are subprojects.

  6. Inside the content-reporter block, insert a text-filter block. This is used to fetch subprojects that belong to the reporting user.

  7. Edit the text-filter block, name the Key data:Project Members > collection:first > user:full name

  8. Next, set Exact Value to %user:full name%.

  9. Now that we have the content and structure, insert a report-body block under content-reporter.

  10. Insert 2 report-info blocks inside report-body.

  11. For the first report-info block, name the Key page:title and check Link To Item.

  12. Next, nest the second report-info block with a pair of parentheses and name the Key data:Project Status

  13. Finally, insert a report-empty block under report-body and enter a message to display when the user is not leading any projects.


Macro Structure

Full source

Team Members source
 <ac:structured-macro ac:macro-id="3dd1fc83-efe2-43c3-918f-5b2e3f0c36c7" ac:name="report-table" ac:schema-version="1">
  <ac:parameter ac:name="injected">true</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="62bc44dd-330c-47cd-9541-9b059767d41b" ac:name="user-reporter" ac:schema-version="1">
      <ac:parameter ac:name="groups">pmd-project-members, pmd-project-leaders</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="cbc30ac6-45d6-4a08-9424-4cb429f635d8" ac:name="text-sort" ac:schema-version="1">
            <ac:parameter ac:name="">user:full name</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="79416bad-fe3d-4857-af96-31391061ab98" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Name</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="b704da22-9ec4-4e28-89aa-dc00edd52c2f" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">user:full name</ac:parameter>
          </ac:structured-macro>
        </p>
        <p>
          <ac:structured-macro ac:macro-id="595d52b7-7980-4e31-9f14-c9c05d3dbbdf" ac:name="report-image" ac:schema-version="1">
            <ac:parameter ac:name="height">100px</ac:parameter>
            <ac:parameter ac:name="">user:picture</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="5f78a437-49d7-42a0-a926-130f20ffe812" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Email</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="25ff4798-098f-47ef-9724-74e39c502b8b" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">user:email</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="7ee52b81-276f-4166-8b22-66675a824f51" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Department</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="2251ab03-d1a1-4bf6-ad94-03d347598a07" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">user:department</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="0ab44f48-561c-4560-a8d0-6c4cb360d724" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Position</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="14f1c80e-704e-4d9f-b26c-537490559a30" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">user:position</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="fa958852-711f-4eca-ae47-9d3827cd8ee0" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Project Lead</ac:parameter>
      <ac:rich-text-body>
        <ac:structured-macro ac:macro-id="572542d6-833b-4603-9c26-66dcac23b582" ac:name="report-list" ac:schema-version="1">
          <ac:rich-text-body>
            <ac:structured-macro ac:macro-id="cf1f6ddc-916f-4e24-a18c-6f65b20df651" ac:name="content-reporter" ac:schema-version="1">
              <ac:parameter ac:name="types">page</ac:parameter>
              <ac:parameter ac:name="labels">subproject</ac:parameter>
              <ac:rich-text-body>
                <p>
                  <ac:structured-macro ac:macro-id="f786da63-34c9-4866-b81d-006597ea943e" ac:name="text-filter" ac:schema-version="1">
                    <ac:parameter ac:name="value">%user:full name%</ac:parameter>
                    <ac:parameter ac:name="">data:Project Leader &gt; collection:first &gt; user:full name</ac:parameter>
                  </ac:structured-macro>
                </p>
              </ac:rich-text-body>
            </ac:structured-macro>
            <ac:structured-macro ac:macro-id="67bf071d-f38a-4a9b-81e9-72b4e3eef72d" ac:name="report-body" ac:schema-version="1">
              <ac:rich-text-body>
                <p>
                  <ac:structured-macro ac:macro-id="209f7b33-e209-4007-b7cf-17327f19195b" ac:name="report-info" ac:schema-version="1">
                    <ac:parameter ac:name="link">true</ac:parameter>
                    <ac:parameter ac:name="">page:title</ac:parameter>
                  </ac:structured-macro> (<ac:structured-macro ac:macro-id="024b352f-13c8-4a7c-975c-d9f618b122fa" ac:name="report-info" ac:schema-version="1">
                    <ac:parameter ac:name="">data:Project Status</ac:parameter>
                  </ac:structured-macro>)</p>
              </ac:rich-text-body>
            </ac:structured-macro>
            <ac:structured-macro ac:macro-id="f1e9abb7-931c-46dd-a49f-ee2fed8b48e6" ac:name="report-empty" ac:schema-version="1">
              <ac:rich-text-body>
                <p>-</p>
              </ac:rich-text-body>
            </ac:structured-macro>
          </ac:rich-text-body>
        </ac:structured-macro>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="533a4108-c490-4865-b8f1-f038b01970af" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Projects Involved In</ac:parameter>
      <ac:rich-text-body>
        <ac:structured-macro ac:macro-id="3291153f-0b65-4c57-bbae-7c89b8aa697f" ac:name="report-list" ac:schema-version="1">
          <ac:rich-text-body>
            <ac:structured-macro ac:macro-id="28c47ce1-f281-4929-bab7-2cf01df796a0" ac:name="content-reporter" ac:schema-version="1">
              <ac:parameter ac:name="types">page</ac:parameter>
              <ac:parameter ac:name="labels">subproject</ac:parameter>
              <ac:rich-text-body>
                <p>
                  <ac:structured-macro ac:macro-id="3e814921-5f99-4432-975c-5e02647d86c1" ac:name="text-filter" ac:schema-version="1">
                    <ac:parameter ac:name="value">%user:full name%</ac:parameter>
                    <ac:parameter ac:name="">data:Project Members &gt; collection:first &gt; user:full name</ac:parameter>
                  </ac:structured-macro>
                </p>
              </ac:rich-text-body>
            </ac:structured-macro>
            <ac:structured-macro ac:macro-id="145fc2d6-ab64-405f-bcd9-4a3d47696451" ac:name="report-body" ac:schema-version="1">
              <ac:rich-text-body>
                <p>
                  <ac:structured-macro ac:macro-id="7af69d75-5e6c-4c8a-9512-ea63ee77562c" ac:name="report-info" ac:schema-version="1">
                    <ac:parameter ac:name="link">true</ac:parameter>
                    <ac:parameter ac:name="">page:title</ac:parameter>
                  </ac:structured-macro> <span>(</span>
                  <ac:structured-macro ac:macro-id="b706d706-70bf-4f02-aaee-148d1d4ca16b" ac:name="report-info" ac:schema-version="1">
                    <ac:parameter ac:name="">data:Project Status</ac:parameter>
                  </ac:structured-macro>
                  <span>)</span>
                </p>
              </ac:rich-text-body>
            </ac:structured-macro>
            <ac:structured-macro ac:macro-id="5b95f0e8-3f2f-47c3-90ad-b7ddee1c46e1" ac:name="report-empty" ac:schema-version="1">
              <ac:rich-text-body>
                <p>-</p>
              </ac:rich-text-body>
            </ac:structured-macro>
          </ac:rich-text-body>
        </ac:structured-macro>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>

  • No labels