Hello everyone,
I'm a newbie in the ofbiz world and I am so excited to take part in its development! Right now, I would like to add the category feature in the blog component. * First, I thought to use the DataCategory table like this: Content (parent) (Blog) => Content (Article) => DataResource => DataCategory But the problem of this solution is that it does not allow us to link several categories per article. * Second, I tryed with the ContentPurpose table Content (parent) (Blog) => Content (Article) => ContentPurpose => ContentPurposeType With a ContentPurposeType : BLOG_CATEGORY But the problem of this is the primary key of ContentPurpose which is composed of contentId and contentPurposeType, so we come back to the same problem. How do you think I should manage article categories within the blog? Looking at the ofbiz data model, the solution might be to store the categories in the ContentPurposeType table adding a "Parent" field within the table. What do you think and how would you make this? Thanks, Antoine O |
Hi Antoine,
One other solution is to use ContentMetaData and MetaDataPredicate. Create a MetaDataPredicateId corresponding to category and create records with this predicate for each category you want to associate to this content. Pierre On 24/06/2015 15:04, Antoine Ouvrard wrote: Hello everyone, --
|
Ok, thank Pierre.
And I can put "BLOG_CATEGORY" on metaDataValue? Antoine Le 24/06/2015 15:17, pierre.gaudin a
écrit :
|
Hi Antoine,
Yes, in field metaDataPredicateId. Regards Pierre On 24/06/2015 15:39, Antoine Ouvrard wrote: Ok, thank Pierre. --
|
Hi Pierre,
Forgive me, but I was talking about metaDataValue on ContentMetaData table. I think it's mandatory in case we want list all categories. Every category will have a type "Blog_Category". That's correct? Regards Antoine Le 24/06/2015 15:54, pierre.gaudin a
écrit :
|
Hi Antoine,
No i really mean "BLOG_CATEGORY" as a new metaDataPredicateId. For example, imagine you want to create a new blog entry and associate it to the category "DAY_JOKE", you should create an new record into ContentMetaData like this : metaDataPredicateId = BLOG_CATEGORY metaDataValue = DAY_JOKE Pierre On 24/06/2015 16:19, Antoine Ouvrard wrote: Hi Pierre, --
|
Hi Pierre,
Thank for details but for me this soluce is not possible because primary key ContentMetaData is composed by contentId and metaDataPredicateId. Ok for one category but the second you will get an error "primarykey already exist" on ContentMetaData table. So how you add several categories? Antoine Le 24/06/2015 17:30, pierre.gaudin a
écrit :
|
Hi,
Unfortunately you're right... That could be an evolution to support several values for the same predicate id by adding the value in the primary key ? Pierre On 24/06/2015 17:44, Antoine Ouvrard wrote: Hi Pierre, --
|
Hi everyone,
I always look for a solution to my problem. Help me please I depress ;-) For you, what it would be the best way to manage categories of Blog? Thank you for your ideas. Antoine Le 24/06/2015 18:09, pierre.gaudin a
écrit :
|
Hi Check ContentDataResource view entity. Contains both content and data category. Gavin On 01 Jul 2015 11:47 AM, "Antoine Ouvrard" <[hidden email]> wrote:
|
Hi Gavin,
Thank you for your answer, but DataResource is actually already used by template of article (BLOG_TPL_TOPCENTER or BLOG_TPL_TOPLEFT). Maybe I could create a new content with ownerContentId=contentId of article and use new DataResource? I'm really not sure... Antoine Le 01/07/2015 12:26, Gavin Mabie a
écrit :
|
Use the DataResource record associated with the Article content associated with the Blog entry. On 02 Jul 2015 10:36 AM, "Antoine Ouvrard" <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |