Ok. So I am using Option #1 and now I need to add objects to the document at
the click of a button.
I am able to successfully add the objects to the document but NOT able to
display them on the page (because the template of teh class is not getting
copied)
Thats becuase, I am nto sure how to set the template for that page.
I tried:
1) $doc.setDefaultTemplate..but this did not work
2) I also tried
$response.sendRedirect($projDoc.getURL("view","template=${etemplate}"))
(where etemplate is the encoded template name)
but this gives the error that the document already exists !
3) The only thing that works is when I manually copy
#includeForm("Classsheet") in the wiki editor of my page.
Q: How can I set the template once, so it is used for all objects of that
class.
Thanks
On 5/5/08, Kamna Jain <kammy.scorpi(a)gmail.com> wrote:
Thanks Sergiu.
Your response was very helpful!
On 5/5/08, Kamna Jain <kammy.scorpi(a)gmail.com> wrote:
Hi All,
This question "might" be related to the thread that has been active in
the past couple of days about the data model.
We have a similar situation with the only difference being that we want
to create lists or collections (like Groups) of certain pre- created
Objects.
The Object as a whole may/will belong to more than one such collection -
which means that if we were to use a Document to link a Collection and its
contents, then every document will have a COPY of the same object and this
is definitely not desirable for good performance - Right?
So, in that case, we have 2 alternatives:
1) Use the techiniques used in XWiki to create Groups: each group has
objects of class XWikiGroup with just one field that refers to the Member
name. OR
2) Use XWiki.getHashmap() and add the Collection and its members to the
hashmap (as the Key and Value resp.)
The XWiki API indicates that the option #2 must be used in xwiki when
Objects can not be created.
My Question is:
-> Even though I could use option #1 and create objects and add them to
the document that would represent the Collection, can I still use option #2
because I think that it will provide better performance. Am I right in my
assumption? What should I do?
Thanks a lot for all help!