| Create Confluence page and add the CSV macro Div |
---|
| Estimated Time: 2 min |
Create a Confluence page that will display the SalesLeads.csv file in a table so that others can easily review it. - Type in an introductory paragraph that describes the purpose of the page or anything else the viewer ought to know.
- Click the toolbar button (or choose Ctrl-M for Windows or Command-M for Mac) so that you can attach the SalesLeads.csv file to this page.
- On the Attached to this page tab, click Upload files.
- Navigate to the location to which you downloaded the SalesLeads.csv file, select the file and click Open to complete the upload.
- Click Cancel since you don't want to insert the file. (You'll be using the CSV macro to display it instead.)
- With the cursor positioned after your introductory paragraph, insert the CSV macro, which is part of the Advanced Tables for Confluence add-on.
- Click on the CSV macro container and configure with the parameters shown on the right.
- Click Save to save your changes to the CSV macro parameters.
- The page should look like the first screenshot shown to the right.
- Click Save the page.
You should see the page in the second screenshot shown to the right, after a few seconds delay. | CSV Macro parameters:Columns to show | country,state_province,job_title,first_name,last_name,email,phone | Location of CSV data | ^salesleads.csv | Auto number each row | selected | Show sort icon | selected | Auto sort column | country | Column types | S,S,M,S,S,S,S,S,S,S,S,S |
Sales Leads page, in Edit mode:
Sales Leads page, in View mode: |
| | Div |
---|
| Estimated Time: X-Y min |
If this Sales Lead page is used heavily, any performance penalty associated with showing such a large amount of data can be costly since it is incurred by each visit to the page. Therefore, you're now going to add the Cache macro of the Advanced Tables for Confluence add-on to speed up the page rendering and reduce the page's use of system resources. Edit the Sales Leads page, and do the following: - With the cursor positioned at the end of the introductory paragraph, press Enter a few times to add some blank lines above the CSV macro.
- Move to the second blank line and insert the Cache macro.
- Click on the Cache macro container and adjust its parameters as shown to the right.
- Click Save to save your changes to the Cache macro parameters.
- Click on the CSV macro container and drag it into the Cache macro container.
- Your screen should look like the first screenshot shown to the right.
- Click Save to save the page.
- It should now look like the second screenshot shown to the right and should render more quickly. More importantly, each subsequent user should see the page render nearly instantaneously as it will be be loaded from the cache until its reaches the end of its 2-day refresh period.
- The Cache macro is displaying the Refresh icon along with the date the cache was last refreshed. A user can click the refresh icon to force the cache to be immediately refreshed.
| Cache Macro parameters: Cache refresh period
| 2d | Check attachments
| selected | Show refresh icon
| selected | Show date
| EEE, MMM d, YYYY
|
Sales Leads page, in Edit mode: Image RemovedImage Added Sales Lead page, in View mode:
|
| | Bonus Tip Div |
---|
| Estimated Time: 2 min |
If you have a very complex page or one that is using many macros, you may find the use of the Cache macro helps considerably but the user still has to wait a while to see the full page rendered. This is where the Future macro can help. As explained here, the Cache macro can be enclosed within the Future macro to allow some of the page rendering to occur while the rest of the page is rendered in the background. The user will then see content as soon as it is available, making the page's full rendering time less noticeable. To continue with our example above, edit the Sales Leads page and do the following: - With the cursor positioned above the Cache macro container, press Enter to add another blank line above the Cache macro container.
- Move to that new blank line and insert the Future macro.
- Click on the Future macro container and adjust its parameters as shown to the right.
- Click Save to save your changes to the Future macro parameters.
- Click on the Cache macro container and drag it into the Future macro container.
- Your screen should look like the first screenshot shown to the right.
- Click Save to save the page.
- When the page is in the process of being rendered, you will see the "Loading" message shown in the second screenshot to the right. This is the Future macro doing its job.
- When the rendering is complete, you will see the Refresh icon and the date on which the cache was last refreshed… courtesy of the Cache macro.
| Future macro parameters:
Sales Lead page, in Edit mode:
Excerpt of Sales Lead page, while the page is being rendered:
Sales Lead page, after page is fully rendered:
|
|