Hi,
I'm evaluating Magnolia at the moment and have some questions about using
the data module, and what is Magnolia best practice.

I want to import data items from a catalog on another system and then apply
categories to each item. These categories will be used to generate dynamic
lists of subsets of the data based on parameters.

For example, say we have 

Item1 with categories [cat1, cat2, cat3]
Item2 with categories [cat1, cat3]
Item3 with categories [cat1]

in the catalog then we want to be able to to generate lists such as the
following on a Magnolia page

All items with cat1
All items with cat1 and cat2
All items with cat1 and cat2 and cat3 

I have defined a type, and built an import handler and module and I am able
to import my data into the repository, but I am unsure what is the best way
to represent the list of categories on the item, and the best way to build a
custom paragraph with a query that can display the dynamic list.

I believe that Magnolia does not support multi-value attributes, so I think
there are only two ways to go:

I should either represent the category list as a comma-separated list of
values and have a query something like "select * from Item where
contains(categories, 'cat1) and contains(categories, 'cat3')":

Item1
  - categories: cat1,cat2,cat3
Item2
  - categories: cat1,cat3

Or I should have a new contentCode called 'categories' which has a data node
beneath it for each of the applicable categories:

Item1
  - categories
    - cat1
    - cat2
    - cat3
Item2
  - categories
    - cat1
    - cat3

But in this case I have no idea how to write a query to get the subset I
want.

So, in summary, my questions are:

1) What is Magnolia best practice for this kind of thing.
2) What sort of query should be used to retrieve the subset if the second
approach is used.
3) Should I be using something in the categorisation module instead that
does this for me (but on items in the data repository) 
4) Should I be loading my data into the website repository instead and using
the categorisation module in some way.

Cheers,
Paul Fitchett
-- 
View this message in context: 
http://old.nabble.com/What-is-best-practice-for-categorising-and-querying-loaded-data--tp27617942p27617942.html
Sent from the Magnolia - User mailing list archive at Nabble.com.


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to