Login  Register

Re: NAML Feedback

Posted by Hugo <Nabble> on Apr 03, 2012; 5:25am
URL: https://support.nabble.com/NAML-Feedback-tp7377071p7431831.html

DavidJCobb wrote
Hugo <Nabble> wrote
This is possible, but we need a way to select arbitrary nodes in the database and retrieve them as a list. We believe the solution is to use our tag table, which is pretty much like a label that is applied to a node or user (think of labels in Gmail). So somehow you would stick a label in some nodes and then use a filter to retrieve them. Would this solve your problem?
That could work for persistent storage, and could help to solve the issue, yes.

I don't know much about databases, but that does sound like it could be hard to keep efficient -- retrieving the nodes would require looping through every node on the site, no? I think a simpler solution might be to add a function that'll take a comma-delimited list of IDs as a string, and return a nodelist that could then be sorted. Given a safe storage area for the comma-separated list (i.e. as a property on the root_node), I think this would accomplish the same thing as a tag table, but with the benefit of being able to grab nodes directly by ID rather than having to check all of them for a property.

Either way'll get the job done. I propose the alternative simply because I think it could have a performance advantage, though I've no clue how large the difference would be.
Selecting nodes by ID is certainly a good and flexible solution. Do you expect the number of nodes to be very high? Our idea is to retrieve all nodes with just one SQL. So basically we would build the SQL with all node IDs in the "where" clause and this could become a problem if the number of nodes is very high (e.g., > 200). We want to do this with just one SQL because sorting the nodes would be much easier. The command would look more or less like this:
<n.custom_node_list
     node_ids="11, 12, 13, 14, 15, 16, 17"
     sort_by="subject asc, last_node_date desc">
          <n.loop.>
               <n.current_node....>
          </n.loop.>
</n.custom_node_list>
As you can see, there would be a "sort_by" parameter that follows the SQL syntax. You would be able to sort nodes by any column in that table. This is why we need just one SQL. Does that work for you? Suggestions?