Context provider to templates of structural pages that need not to be created individually. This is usually the case for pages like the space homepage. It is created once and edited by the user. There is no need to create this page in an existing page, like it may be the case for a doctype homepage.
Prior to version 1.11 the name of the class has been de.smartics.projectdoc.atlassian.confluence.
ProjectDocSpaceContextProvider
.
Description
The main purpose of this context provider is to create pages with a space blueprint. Those pages are not created outside this context and therefore do not need additional handling.
Provided Context Parameters
Page Title and Document Name Handling
If the targetLocation
or adjustTitleAfterMoveRequest
is not set by the wizard (soy template), the placeholder @parentPageTitle
be replaced with the parent page's name. The sort key property will also be set to the next higher number according to the current siblings of the new page, if at least one placeholder is used.
Otherwise the title of the page is set to the name of the document.
The space key is accessible by the key spaceKey
from the blueprint context.
Since it is sometimes convenient to render a complete XML tag, this XML fragment is also generated and stored by the key spaceKeyElement
:
<ri:space ri:space-key="spaceKey" />
Here is an example on how to use the XML element with the Create from Template Macro:
<structured-macro name="create-from-template">
<parameter name="blueprintModuleCompleteKey">someKey</parameter>
<parameter name="buttonLabel">Some Label</parameter>
<parameter name="spaceKey"><at:var at:name="spaceKeyElement" at:rawxhtml="true"/></parameter>
</structured-macro>
This example shows how the spaceKeyElement
property is used to render the complete element.
The following properties are added to the blueprint context.
Parameter | Description |
---|
projectdoc.doctype.common.creationDate | The date of the creation formatted by the user's preferences. |
projectdoc.doctype.common.creationTime | The time of the creation formatted by the user's preferences. |
de.smartics.projectdoc.creationDateInstance | The date instance for access by the Java API. |
Example Usage
The context provider is used for space homepage templates. These pages will not be generated by page wizards, only by space wizards.
The following fragment registers your template as a Content Template Module:
<content-template
key="my-template-key"
i18n-name-key="projectdoc.content.my-template-key.title">
<description key="projectdoc.content.my-template-key.description" />
<resource
name="template"
type="download"
location="/my/path/to/my-template-key.xml" />
<context-provider class="de.smartics.projectdoc.atlassian.confluence.ProjectDocSpaceContextProvider" />
</content-template>