I have to say, I have been using xwiki for a month or so now, so I am no big
expert either.
yes, template is duplicated and instantiated with the new object.
Because the template is duplicated, if the renderer code (the sheet) were in
the template, you would end up having lot of documents with the same code
repeated over and over, and of course if you need to change something, you
would have to update every single document.
For the different type of users, if the underlying object is still
XWikiUser, I would rather still have a single sheet and template with some
velocity code to differentiate the behavior. Otherwise yes, have multiple
templates and sheets.
Best regards
Vito Impagliazzo
On Wed, Feb 2, 2011 at 4:02 PM, Lukapt <lukapt(a)gmail.com> wrote:
Hi,
Thank you for the swift answer.
So, let's say that I want to create an xwiki user. What really happen is
that the XWikiUserTemplate is duplicated and instantiated with the new
object. Am I right?
If I want to have different templates for different kind of users I'll have
to create a Sheet for each Template?
I hope not to be misunderstanding your explanation.
Luís Braga
vimpagliazzo wrote:
The sheet defines a way to render an object. The template is a page which
gets duplicated as is every time we create a new document associated with
a
certain class, and normally just contains an include statement of the
sheet
document plus an empty instance (object) of the selected class.
I have to say, the only difference is then the sheet does not have an
object
attached to it, and potentially could be used in other places as well.
Therefore the separation, but I guess you could build a template which
does
not depend on a sheet, and not create the sheet at all, you then loose
the
document-view design, since the same document is
holding the data (the
document) and the view (the renderer).
Hope that helps
Vito Impagliazzo
www.olsen.ch
---
Please consider the environment before printing this email.
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
View this message in context:
http://xwiki.475771.n2.nabble.com/Question-about-Sheet-and-Template-tp59846…
Sent from the XWiki- Dev mailing list archive at
Nabble.com.
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Vito Impagliazzo
---
Please consider the environment before printing this email.