Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Div
idProductTOC

On this page

Table of Contents
maxLevel1
excludeOn this page
typeflat
separator |

...

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
enableSortingfalse
classingredients_table
enableHighlightingfalse


Image Modified


Ingredients

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
enableSortingfalse
classingredients_table
enableHighlightingfalse



Preparation

  • Download the attached SalesLeads.csv file to your computer. The file contains contact information for 3,000 potential sales leads. It was randomly generated using an online tool called Mockaroo so it does not reflect real people or companies. Here is an excerpt from that file, with the first row identifying each field.

    Panel
    first_name,last_name,job_title,email,company,address,state_province,country,postal_code,phone
    Aaron,Baker,Analyst Programmer,abakerny@mysql.com,Edgeify,22 Tony Crossing,Florida,US,33777,9-(109)171-6690
    Aaron,Chapman,Compensation Analyst,achapman5e@weather.com,Twitterlist,7 Basil Circle,Florida,US,34949,7-(568)437-0309
    Aaron,Christopher,Senior Editor,achristopher@bloglovin.com,Jabberbean,5 Arapahoe Lane,Stockholm,SE,100 73,8-(598)183-3882
    Aaron,Collins,Structural Engineer,acollins1a@theguardian.com,Avamba,8569 Old Gate Alley,,TN,,2-(467)631-4826
    Aaron,George,Senior Developer,ageorgero@odnoklassniki.ru,Roodel,777 Hallows Trail,New York,US,10079,7-(581)862-9457
    ...


...

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
idsteps_table
enableSortingfalse
enableHighlightingfalse


Create Confluence page and add the CSV macro

Div
classtime

Image Modified 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.

  1. Type in an introductory paragraph that describes the purpose of the page or anything else the viewer ought to know.
  2. Click the Image Modified
toolbar
  1.  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.
    1. On the Attached to this page tab, click Upload files.
    2. Navigate to the location to which you downloaded the SalesLeads.csv file, select  the file and click Open to complete the upload.
    3. Click Cancel since you don't want to insert the file. (You'll be using the CSV macro to display it instead.)
  2. With the cursor positioned after your introductory paragraph, insert the CSV macro, which is part of the Advanced Tables for Confluence add-on.
    1. Click on the CSV macro container and configure with the parameters shown on the right.
    2. Click Save to save your changes to the CSV macro parameters.
    3. The page should look like the first screenshot shown to the right.
  3. Click Save the page.

You should see the page in the second screenshot shown to the right, after a few seconds delay.


Info
titleOther Ways to Supply the CSV File

You can also reference a CSV file that is stored on an external server or web site, by using the CSV macro's URL parameter.

You can also leverage the power of the Run CLI Actions in Confluence add-on and other Command Line Interface (CLI) add-ons to have your CSV file created and attached to the desired Confluence page automatically or on a scheduled basis. The How to Monitor Language in Public Chat Rooms (Advanced) recipe provides an example of this.



Anchor
step1
step1
CSV Macro parameters:

Columns to showcountry,state_province,job_title,first_name,last_name,email,phone
Location of CSV data^salesleads.csv
Auto number each rowselected
Show sort iconselected
Auto sort columncountry
Column typesS,S,M,S,S,S,S,S,S,S,S,S


Sales Leads page, in Edit mode:

Image Removed

Image Added

Sales Leads page, in View mode:

Image Removed
Image Added

Image Modified

Tune performance by adding the Cache macro

Div
classtime

Image Modified Estimated Time: 2 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:

  1. 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.
  2. Move to the second blank line and insert the Cache macro.
    1. Click on the Cache macro container and adjust its parameters as shown to the right.
    2. Click Save to save your changes to the Cache macro parameters.
  3. Click on the CSV macro container and drag it into the Cache macro container.
  4. Your screen should look like the first screenshot shown to the right.
  5. Click Save to save the page.
  6. 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.
  7. 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.


Anchor
step2
step2
Cache Macro parameters:

Cache refresh period
2d
Check attachments
selected
Show refresh icon
selected
Show dateselected
Date format
EEE, MMM d, YYYY


Sales Leads page, in Edit mode:

Image Removed

Image Added


Sales Lead page, in View mode:

Image Removed

Image Added


Bonus Tip

Div
classtime

Status
titleOptional
Image Modified 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:

  1. With the cursor positioned above the Cache macro container, press Enter to add another blank line above the Cache macro container.
  2. Move to that new blank line and insert the Future macro.
    1. Click on the Future macro container and adjust its parameters as shown to the right.
    2. Click Save to save your changes to the Future macro parameters.
  3. Click on the Cache macro container and drag it into the Future macro container.
  4. Your screen should look like the first screenshot shown to the right.
  5. Click Save to save the page.
  6. 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. (wink)
  7. 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.


Info

If your Confluence instance is using the Macro Security for Confluence add-on and your Confluence Administrator has restricted use of a macro security managed macro such as Future or Cache, you may see an error after saving the page.

If this is the case, you will need to add a page-level Edit restriction that conforms to the restriction implemented in the Macro Security configuration. More information is available in the Macro Security User's Guide.


Anchor
step3
step3
Future macro parameters:

Delay in seconds5


Sales Lead page, in Edit mode:

Image Removed

Image Added

Excerpt of Sales Lead page, while the page is being rendered:

Image Removed

Image Added


Sales Lead page, after page is fully
rendered:Image Modified


Include Page
recipes:_RecipeTemplateFooter
recipes:_RecipeTemplateFooter

...