XWiki classes question
Hello, I have the following question regarding relationing 2 classes in xwiki. I made a class Person with 2 properties (firstName, lastName) and a class Media with a prop. (title) and then I made an object "Richard Gere" of class person and 2 objects "Pretty Woman" and "Autumn at New York" of class Media. Now I would like to link somehow the 3 objects, i.e to say that Richard Gere played in "Pretty Woman" and also in the other movie (media). How can I do that? I don't seem to understand how to link the already created objects one with another. For instance, I cannot create another class with 2 properties, one of type Media and one of type Person, because these types don't appear under "Type" on "Add Property" panel. Please help me understand how can I do that in xwiki. Ps. I heard something about attachments but I don't really understand how... Thank you. Evelina Slatineanu
Hi Evelina, On Apr 28, 2007, at 10:43 PM, [email protected] wrote:
Hello,
I have the following question regarding relationing 2 classes in xwiki. I made a class Person with 2 properties (firstName, lastName) and a class Media with a prop. (title) and then I made an object "Richard Gere" of class person and 2 objects "Pretty Woman" and "Autumn at New York" of class Media. Now I would like to link somehow the 3 objects, i.e to say that Richard Gere played in "Pretty Woman" and also in the other movie (media). How can I do that? I don't seem to understand how to link the already created objects one with another. For instance, I cannot create another class with 2 properties, one of type Media and one of type Person, because these types don't appear under "Type" on "Add Property" panel. Please help me understand how can I do that in xwiki.
Not sure if it's the best solution but you could create a document containing "Richard Gere" + "Pretty Woman" and "Autumn at New York" objects. This document would answer the question: "show me the films with Richard Gere". -Vincent
Ps. I heard something about attachments but I don't really understand how... Thank you.
Evelina Slatineanu
Hi Evelina, Vincent and all Vincent Massol wrote:
Hi Evelina,
On Apr 28, 2007, at 10:43 PM, [email protected] wrote:
Hello,
I have the following question regarding relationing 2 classes in xwiki. I made a class Person with 2 properties (firstName, lastName) and a class Media with a prop. (title) and then I made an object "Richard Gere" of class person and 2 objects "Pretty Woman" and "Autumn at New York" of class Media. Now I would like to link somehow the 3 objects, i.e to say that Richard Gere played in "Pretty Woman" and also in the other movie (media). How can I do that? I don't seem to understand how to link the already created objects one with another. For instance, I cannot create another class with 2 properties, one of type Media and one of type Person, because these types don't appear under "Type" on "Add Property" panel. Please help me understand how can I do that in xwiki.
Not sure if it's the best solution but you could create a document containing "Richard Gere" + "Pretty Woman" and "Autumn at New York" objects. This document would answer the question: "show me the films with Richard Gere".
Indeed, or another possible option would be to add a property "playsIn" of type "Database list" to the class "Person". The query associated with that property would be something like the one below, for fetching all the Media titles: ====== select distinct prop.value from BaseObject as obj, StringProperty as prop where obj.className='XWiki.Media' and prop.id.id = obj.id and prop.id.name='title' order by prop.value ====== Or third possibility: simply use plain wiki links between the documents: create three documents "Richard Gere", "Pretty Woman", "Autumn in New York", attach structured objects to each of them, then add a link to "Pretty Woman" and "Autumn in New York" to the body of the document "Richard Gere". I hope this helps. By the way, this type of question should rather be submitted to the xwiki-users mailing-list! -> I propose we continue the discussion on that list instead. Cheers Stéphane
-Vincent
Ps. I heard something about attachments but I don't really understand how... Thank you.
Evelina Slatineanu
-- Stéphane Laurière [email protected] +33 6 83 04 49 03 skype: arkubb XWiki Research http://www.xwiki.com http://concerto.xwiki.com http://nepomuk.semanticdesktop.org
Hi, The property type you are looking for is Database List Class. It allows you to create a list containing items of your choice. So, what you need to do, is: - Make a class called MediaHasActor, with two DBList properties, one called Media, one called Person. - The field called "Hibernate Query" should contain something like: select prop.value from BaseObject as obj, StringProperty as prop where obj.className='XWiki.MediaClass' and (replace with ' XWiki.PersonClass' for the Person field prop.id.id = obj.id and prop.id.name='name' and obj.name <> 'XWiki.MovieTemplate' (replace with ' XWiki.PersonTemplate' for the Person field Now the relating object will display two list boxes, one with movies and the other with actors. Of course, when you'll have thousands of movies and actors, a select won't be the best option, so you will need to use an AJAX-powered Suggest input. On 4/28/07, [email protected] <[email protected]> wrote:
Hello,
I have the following question regarding relationing 2 classes in xwiki. I made a class Person with 2 properties (firstName, lastName) and a class Media with a prop. (title) and then I made an object "Richard Gere" of class person and 2 objects "Pretty Woman" and "Autumn at New York" of class Media. Now I would like to link somehow the 3 objects, i.e to say that Richard Gere played in "Pretty Woman" and also in the other movie (media). How can I do that? I don't seem to understand how to link the already created objects one with another. For instance, I cannot create another class with 2 properties, one of type Media and one of type Person, because these types don't appear under "Type" on "Add Property" panel. Please help me understand how can I do that in xwiki.
Ps. I heard something about attachments but I don't really understand how... Thank you.
Evelina Slatineanu
Sergiu -- http://purl.org/net/sergiu
Sergiu, this is great input, could you point me to something, which explains how to use the AJAX Suggest Input with XWiki? Uwe Sergiu Dumitriu wrote:
Hi,
The property type you are looking for is Database List Class. It allows you to create a list containing items of your choice.
So, what you need to do, is: - Make a class called MediaHasActor, with two DBList properties, one called Media, one called Person. - The field called "Hibernate Query" should contain something like: select prop.value from BaseObject as obj, StringProperty as prop where obj.className='XWiki.MediaClass' and (replace with ' XWiki.PersonClass' for the Person field prop.id.id = obj.id and prop.id.name='name' and obj.name <> 'XWiki.MovieTemplate' (replace with ' XWiki.PersonTemplate' for the Person field
Now the relating object will display two list boxes, one with movies and the other with actors. Of course, when you'll have thousands of movies and actors, a select won't be the best option, so you will need to use an AJAX-powered Suggest input.
On 4/28/07, [email protected] <[email protected]> wrote:
Hello,
I have the following question regarding relationing 2 classes in xwiki. I made a class Person with 2 properties (firstName, lastName) and a class Media with a prop. (title) and then I made an object "Richard Gere" of class person and 2 objects "Pretty Woman" and "Autumn at New York" of class Media. Now I would like to link somehow the 3 objects, i.e to say that Richard Gere played in "Pretty Woman" and also in the other movie (media). How can I do that? I don't seem to understand how to link the already created objects one with another. For instance, I cannot create another class with 2 properties, one of type Media and one of type Person, because these types don't appear under "Type" on "Add Property" panel. Please help me understand how can I do that in xwiki.
Ps. I heard something about attachments but I don't really understand how... Thank you.
Evelina Slatineanu
Sergiu -- http://purl.org/net/sergiu
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- View this message in context: http://www.nabble.com/XWiki-classes-question-tf3663501.html#a10237024 Sent from the XWiki- Dev mailing list archive at Nabble.com.
participants (5)
-
evelyne24@gmail.com -
Oova -
Sergiu Dumitriu -
Stéphane Laurière -
Vincent Massol