[MAGNOLIA-3101] Allowing mixed content/contentNode query results in QueryImpl Created: 24/Feb/10 Updated: 23/Jan/13 Resolved: 24/Feb/10 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 4.3 |
| Fix Version/s: | 4.3 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Fabrizio Giustina | Assignee: | Fabrizio Giustina |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Description |
|
There may be several cases where you want to query for something that may be a content or a contentNode (page or paragraphs) and you want results of both types. At the moment you can only specify a single nodeType in query, so there is no way to handle a similar case. Also using the single query twice with different nodeType is not enough... <cms:query nodeType="mgnl:content" ..../> ... since the first query will also returns pages containing paragraphs that matches the xpath expression (QueryImpl iterates on parents till it founds the requested nodetype)... you will have to create two different queries with the nodetype used also for the xpath condition. After that, you may need to merge and sort the results. With a trivial change in QueryImpl we may allow specifying more than one node type, so that users can simply do: <cms:query nodeType="mgnl:content mgnl:contentNode" ..../> |
| Comments |
| Comment by Fabrizio Giustina [ 24/Feb/10 ] |
|
done as described, the patch doesn't change any interface method since it relies on a space separated list of nodetypes. |