Hi Ludovic.
I am sure it is something obvious, but I can't see it.
I have an object with structured data that I display with the following ClassSheet. When you look directly at a page that has #includeForm("XWiki.ExampleClassSheet") and an object attached, it displays correctly with all the object properties filling in the right spaces.
But then if you have another page that wants to include these pages, or a macro as described in the previous post (renderedContent), then only ClassSheet is displayed with the properties (eg ${doc.nameOfStep}) rather than the information from the included pages' object.
I am thinking that it is because the template is using the $doc object methods and in the composite page no attached object exists, so I need to change the references in the template to reference the included pages' object but I am not sure how to do that.
Hope that make sense and thanks for your help.
Have a great day.
Mark
## Multiversion "XWiki.ExampleClassSheet" template depending on action
## Inline for edit form
## View and PDF in the same format
## Everything else in a catchall
#if($context.action == "inline")
1 Document $doc.name
## Change class name to your class name
#set($class = $doc.getObject("XWiki.StepClass").xWikiClass)
<table border="1" cellspacing="0" cellpadding="2">
#foreach($prop in $class.properties)
<tr><td> *${prop.prettyName}* </td>
<td>$doc.display($prop.getName())</td>
</tr>
#end
</table>
#*
This is the end of the "inline" template
that we use to edit in the form on the wiki
Below is the viewing and pdf template
*#
#elseif($context.action == "view" || $context.action == "pdf")
1.1 ${doc.nameOfStep}
*Process Owner* : ${doc.processOwner}
#if($doc.shortDescription == "")
#else
1.1.1 Summary
$doc.shortDescription
#end
#if($doc.objectives == "")
#else
1.1.1 Objectives
$doc.objectives
#end
#if($doc.policies == "")
#else
1.1.1 Policies Relating To This Step
$doc.policies
#end
{table}
INPUTS
${doc.inputs}
{table}
<table class="wiki-table" cellpadding="0" cellspacing="0" border="0">
<tr><td bgcolor="#FFD100">
<strong>PROCESS</strong>
</td></tr>
<tr><td>
${doc.processStep}
</td></tr>
</table>
{table}
OUTPUTS
${doc.outputs}
{table}
#if($doc.keyControls == "")
#else
1.1.1 Key Controls
$doc.keyControls
#end
#if($doc.bpControls == "")
#else
1.1.1 Best Practice Controls
$doc.bpControls
#end
#if($doc.itsystems == "")
#else
1.1.1 IT Systems Used
$doc.itsystems
#end
<table class="wiki-table" cellpadding="0" cellspacing="0" border="0">
<tr><td bgcolor="#FFD100">
<strong>EXECUTORS</strong>
</td><td bgcolor="#FFD100">
<strong>REVIEWERS</strong>
</td><td bgcolor="#FFD100">
<strong>APPROVERS</strong>
</td></tr>
<tr><td>
${doc.executors}
</td><td>
${doc.reviewers}
</td><td>
${doc.approvers}
</td></tr>
</table>
{table}
CYCLE|PROCESS|SUBPROCESS
${doc.cycle}|${doc.process}|${doc.subprocess}
{table}
#foreach($attach in $doc.AttachmentList)
<img class="wiki-table" src="$doc.getAttachmentURL($attach.Filename,"download")" />
#end
#*
This is the end of the "view" template
There is a catch all below this
*#
#else
This is everything apart from view and inline
#end
On 7 Jan 2006, at 6:56 AM, Ludovic Dubost wrote:
Hi mark,
What you are doing doesn't look wrong.. It seems to me it should work.
getRenderedContent() is the most recursive API. The page is fully rendered (velocity, groovy and radeox) in the context of the included page. So objects should be rendered properly and other includes should also be done (classsheet and so on).
Do you have and exemple of the page + sheet that fails ?
Ludovic
Hi Again.
I know it is bad form to reply to your own post, but this is what I am thinking so far.
Unfortunately I can't see how to display the included pages object information with the template page.
End result : Repeated empty templates
<< Snip
## Set the list of pages to be included
#set($pages = ["WebSpace.Page1", "WebSpace.Page2", "WebSpace.Page3"])
## Create the macro to display all the included pages with their object information rather than just the template
## Note : Move it to somewhere later we can use it rather than inline
#macro( includePage $pagelist ) #foreach( $page in $pagelist )
#set($displaypage = $xwiki.getDocument($page))
$displaypage.getRenderedContent()
#end #end
## Run the macro
#includePage($pages)
End Snip>>
Thanks in advance.
Cheers,
Mark Robinson
------------------------------------------------------------------------
--
--
Ludovic Dubost
Skype: ldubost AIM: nvludo Yahoo: ludovic
--