But ok, in
<mm:listcontainer path="mmbaseusers" fields="mmbaseusers.defaultcontext">
<mm:constraint field="mmbaseusers.defaultcontext" operator="EQUAL" value="default" />
</mm:listcontainer>
there's no other nifty trick for NODE-fields to have access to ANOTHER field in a query (in this case, the 'defaultcontext'-field) than the number?
What I basically have to do is:
Example 1.
<mm:listnodes path="mmbaseusers">
<c:set var="context"><mm:field name="defaultcontext" /></c:set>
<mm:node number="${context}">
<c:set var="name"><mm:field name="name" /></c:set>
<c:if test="${name == 'default'}">
// do the stuff we wanted to do with our user
</c:if>
</mm:node>
</mm:listnodes >or
Example 2.
<mm:listnodes type="mmbasecontexts" constraints="name = 'default'" max="1"> <c:set var="defaultnodenumber"><mm:field name="number" /></c:set> </mm:listnodes>
<mm:listnodes type="mmbaseusers" constraints="defaultcontext = '${defaultnodenumber}'">
// now we can do stuff with our context
</mm:listnodes>
which seems two darn inefficient queries to get mmbaseusers with a certain defaultcontext of which we know only the contextname upfront.
Any suggestions or are my examples as good as it gets?
Ted
Michiel Meeuwissen wrote:
Ted Vinke wrote:
The question: is there an easy way to alter this query so I can match on name? I do not know the nodenumber of the context upfront to compare with and I was hoping I didn't have to add another query inside for performance-reasons.
Perhaps you can assign an alias to the context, and use that in the value attribute. Since you hardcoded the name, you can as well hard-code the alias. The JSP would remain unchanged, and the performance penalty would be very little, because the node will be fetched from memory cache by it's alias.
Atctually that may be faster than a deeper path, because chances are that that would also make the query slower.
Michiel
-- Ted Vinke Software Developer First8 BV / Ewycksgroep
Groenestraat 294 | Postbus 31006 6531 JC Nijmegen | 6503 CA Nijmegen
t +31 (0)24 348 35 70 f +31 (0)24 348 35 71
[EMAIL PROTECTED] http://www.first8.nl _______________________________________________ Developers mailing list [email protected] http://lists.mmbase.org/mailman/listinfo/developers
