Andriy Vovchyna wrote:
Hi!
We are planning to introduce "Documents" that will have a set of additional attributes besides Content as regular xwiki page has.
For example our "Document" will contain
a) Name
b) Content
c) State
d) Rating
Questions are about proper attributes distribution between xwiki page and object (instance of additional xwiki class will be designed)
Currently we see two reasonable ways. In both cases Name will be name of page where our "Document" "stored".
1) Content in page
* Content is stored in a page content * State and Rating are attributes of some class (e.g. OurDocClass), stored as an object on this page.
If you need a special method of display, you can have a single code document and use the {{include}} macro to include that code. In that case the {{include}} will pollute your content. There also may be issues with the included script reading the content correctly.
2) Content in class
* Content, State and Rating are attributes of some class * Page is just to display (may edit) properties (including Content) of the object "attached" to particular page
This is most commonly used on xwiki.org. Each entity is represented by a page which contains a single object of the class and the only thing in the document content is an {{include}} macro which points to the class sheet which handles display and editing of the object. See an example: http://code.xwiki.org/xwiki/bin/view/Applications/InvitationApplication?view... Only content is a link to the class sheet. http://code.xwiki.org/xwiki/bin/view/XWiki/ApplicationClassSheet?viewer=code... The class sheet takes the object and makes a pretty display. Note how it behaves differently if the action is 'inline' rather than 'view', this allows it to be used for viewing and editing. http://code.xwiki.org/xwiki/bin/view/XWiki/ApplicationClassTemplate?viewer=c... This document is used as a template, it's copied to make all new documents created by the CreateApplication app. What you can't see is that the template also contains an object of the ApplicationClass. http://code.xwiki.org/xwiki/bin/view/Applications/CreateApplication?viewer=c... This document is used to create new documents of this type (application). What's important is that the name of the template is included so the template can be copied to the new document.
I prefer to use first way, but there we have a dispute in our implementation team.
Questions:
a) What way is preferable?
I myself would prefer the second.
b) What benefits and disadvantages of using #1 ?
Answered above.
c) Are there possible some performance issues if we store bulky content text in object property instead of page content?
Probably not, if the system is so large that it becomes an issue you might consider looking at using custom Hibernate mappings for the objects.
I suppose in case #2 we can meet inconvenience with powerful using of other xwiki functionality which we are planning to use, such as Lucene Searching, Document Locking, Versioning, Including of page etc.
Each document only contains one set of objects, not one per translation language. I don't know much about the Lucene engine, maybe someone else can speak more on that. Caleb
It will be nice to get recommendations or references to some staff on xwiki.org.
Thank you,
Andriy
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users