15-Apr-05 (Created: 15-Apr-05) | More in 'Howto'

Customizing the views of displaying a document in AKC

If you have a document in akc, akc allows you paint the document in a variety of ways. Multiple urls are used to paint this document. Some of these are

Printing Mode
Master page mode

Masterpage mode

Consider a document identified by a reportId 1320. This can be deplayed in a master page mode using the url


/akc/display?url=DisplayNoteMPURL&reportId=1320&ownerUserId=document-owner

Where the document owner is the id to which this document belongs. This will display the document inside the master page with a title for the document at the top. In addition this URL will also display "akc" related menu items at the top of the page. This may not be good for a standalone website like experience.

Masterpage mode with a webview

In this mode the document is displayed inside the master page by removing the title of the document and also the menu items that belong to the akc. This can be done using the following url


/akc/display?url=DisplayNoteWebViewMPURL&reportId=1320&ownerUserId=document-owner

Printing mode

In the print mode the document is displayed with out a master page using the akc's default style sheet. This is a reasonable approximation for a print view of the document. At the moment there is no special master page for a print view. A future release may provide this. The URL For this is


/akc/display?url=DisplayNoteURL&reportId=1320&ownerUserId=document-owner

Custome mode

If none of the provided variations satisfy the need you can create your own view for this document by providing an html template. For this you need to create a separate document representing your template. Here is an example of such a template


<html>
<head>
<title>AKC: {{report_short_name}}</title>
<link rel="STYLESHEET" type="text/css" href="http://your-site/style/style.css" />
</head>

<body >
{{statement}}
</body>

</html>

See how the two properties of the document namely report_short_name, and statement, are embedded in a template. Using this template you can control the styles or anything else that is needed. Once this template is created make a note of its report id. Using the template report id, you can display your original document using the following url


/akc/display?url=DisplayNoteURL&reportId=1320
	&ownerUserId=document-owner
	&aspire_output_format=user-aspire-templates
	&akc_templateReportId=1326

See the two additional arguments on the url.

Special note

This custom rendering is not only limited to displaying single documents. This facility is available for any aspire url where the data can be rendered using your own templates irrespective of the data content. For example you can do the same for a folder view where multiple documents are displayed.