Philip Newton (pne) wrote in suggestions,
Philip Newton

Provide jitemid in comment_meta mode of export_comments.bml

Provide jitemid in comment_meta mode of export_comments.bml

Short, concise description of the idea
/export_comments.bml currently has two modes, a "light" one and a "heavy" one. Currently, the information about which entry a comment is attached to is only output in the "heavy" mode; it should be in the "light" mode as well.

Full description of the idea

/export_comments.bml has two modes -- comment_meta and comment_body. comment_meta is lighter on the server and gives you back more items, each with less information; comment_body is harder on the servers, returns more data (byte-wise), and returns fewer items.

One piece of information that is returned only in the comment_body mode is the jitemid: the journal item ID of the entry associated with a given comment. It would be nice if this information were returned in the comment_meta mode as well.

The information is already available at the point when comment_meta information is written, so no extra database hits would be required.

Information about the parent ID (0, or the ID of the comment that this comment is in reply to) is also present at this point, but whether to add this information as well is outside the scope of this suggestion.

An ordered list of benefits

  • Allows users of the export_comments.bml tool to find out more easily which journal entry has new comments.
  • Allows users to find out more easily how many comments a given journal entry has received.
  • Reduce server load if all that is required is a list of journal entry-comment number pairings (and not, for example, comment subjects or bodies), since only the comment_meta mode needs to be used, and only talk2 needs to be hit, not talktext2.

An ordered list of problems/issues involved

  • None (except the obvious: changing the code [trivial] and updating the documentation).
  • Well, maybe breaking tools which try to parse the returned data with regular expressions or substr() or the like and can't handle new attributes appearing. Tools that use XML and that ignore unknown/unexpected attributes should be fine, though.

An organized list, or a few short paragraphs detailing suggestions for implementation

  • Add an attribute jitemid='$data->{nodeid}' to the "comment" element when writing out the data for the comment_meta mode. (htdocs/export_comments.bml, around line 82 in the current version.)
Tags: comments, ~ submitted - needs retagging
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded