The automatic citation dilemma
Research Management
Written by Luis Galárraga   

It is time to face the inline citing problem. I identified it as the most difficult part of the project where community feedback will be vital. Reading of "Mastering Joomla! 1.5" book helped me understand editors-xtd plugin group approach which gave me several ideas. In general the plugin will have two functionalities: the first one is related to automatic citing, that means the editor adds the correct cite text in response to a key (the citekey field of publications) based on the configured citation style. My idea was to do it in LateX way through commands like \cite{citekey} but with an important difference: the right text is replaced immediately after the user finishes writing the command (auto replace functionality in advanced text editors). This is the hardest problem as this implies to go deep into TinyMCE code structure. Writing plugins for TinyMCE is not difficult as information about how to do it, can be easily found in http://wiki.moxiecode.com/index.php/TinyMCE:Creating_Plugin. However the interface exposed there, shows that TinyMCE architecture does not support what I want to do in a easygoing way. By studying other TinyMCE plugins, I identified it might be possible, but with an extreme and undesirable performance sacrifice. This is because as plugin my deepest access is at DOM level. This is done in handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) method where I can access the DOM node (part of the background representation of the editor document) where cursor is located. This method is called every time the cursor changes its state. At this point you should be asking why not to continue, I have the DOM node where cursor is located so I can extract the text and look for \cite{} patterns which must be replaced with the correct cite text through an asynchronous HTTP request. This exposes two additional problems: what happens if the user decides to erase the command or part of it? or if the connection is not good at this moment? The first question arises as the second functionality of the plugin is to generate the bibliography section at the end of the document based on the cited records. Due to that fact, the server needs to be reported when a cite has been deleted. What happens if erases just one character of the command and puts the cursor in another node?. Manageable but will lead me to complex and hardly tunable handleNodeChange method which should handle a wide variety of scenarios.

Implementing handleEvent method of TinyMCE plugins interface is another option with some loss of my proposal's essence. In this case the user would have to indicate explicitly through a button or keyboard combination that has written/erased a cite command which, in the addition case, would trigger the process of evaluating all \cite{} occurrences and notifying the server those references must be considered in the bibliography section. But why bothering with TinyMCE API if I can do it via editors-xtd plugins in Joomla?. This represents and advantage when installing the plugin because when checking TinyMCE editor plugin I realized that native TinyMCE extensions are not dynamically selected when creating an editor instance (TinyMCE instances need a list of the plugins that will be loaded; by the way, is there another way of loading an additional native plugin apart from modifying TinyMCE source code?).

The second idea must be discussed as I believe the user needs information and control over the cited records before generating the bibliography section. I think (not sure) Editors-xtd plugins just allow to add buttons. In that case, I have to think in a way of providing this functionality (maybe through a popup).

A third idea is to do the evaluation process when saving the information, but this is not inline citing at all.

The fourth approach is to do the citation process through native TinyMCE dialogs (like in BibShare plugin, refer to ). I simply dislike this approach because it means too many clicks when citing a record but it is also feasible. Its main advantage is that provides good feedback (like in TinyMCE native image plugin).

The last option is to implement the previous one with an editors-xtd plugin. I am not sure if there can be problems with large bibliographical databases.

As you can see, I have several ideas. I have not discarded any yet, but I would really appreciate yours opinions as I believe usability is an important requirement for this plugin.

Finally, my pending activities summary:

  • Study more options for the automatic citation dilemma. It also means to analyze again with more detail each possibility.
  • Continue the reading of Mastering Joomla 1.5 book
  • Continue my knowledge refreshment of DHTML (finally I am doing something in that)
 

Show other articles of this author

30 Votes

3 Comments

Feed
  1. Maybe you can make the citing a simple content plungin like:

    {cite AuthorName AuthorURL}The text to be cited, bla bla bla blabl{/cite}

    so this plugin will automaticaly create the citation in a stardard way:

    "he text to be cited, bla bla bla blabl"Author Name

    You can also add more info that will be dynamically generated, and define default style css in the pluging params
  2. Hi everyone, I tried smiles example in a Joomla installation and looks interesting. I had to modify file tinymce.php to load the plugin and the buttons but I am satisfied with the progress. The next step is to implement an AJAX request to get some text from the server. I will also simulate latency in response to evaluate the real impact in user interaction. Then, I will have to manage the popup which allow to control the records that will be considered when generating bibliography.
  3. I have just found an example of automatic replacement of :) for smile images by implementing handleEvent method. This solves the problem of replacing \cite{} ocurrences (AJAX request is unavoidable). The next step would be to implement a message dialog that allows the user to manage the records that will be put in the bibliography section (for example if the editor made the replacement but the user then decides not to cite the reference). This question persists: how to include the plugin without altering Joomla TinyMCE editor plugin code?

Add Comment


    • >:o
    • :-[
    • :'(
    • :-(
    • :-D
    • :-*
    • :-)
    • :P
    • :\
    • 8-)
    • ;-)



    Click to get a new image.