Client-Server Data Transfer

Overall Timeline

  • by 14 March - Adding new content items completed
  • by 20 March - Editing, persisting, re-rendering created research guide completed

Decisions made about item creation process:

  • Three AHAH calls (form submissions) are made:
    1. New Item button is pressed or hint-div is clicked
      • guideId and itemId are sent to the _NewItemProducer sub-producer
      • server sends back HTML fragment containing 'new item editing area'
    2. User selects which kind of content item to create from the dropdown
      • guideId, itemId, itemType and itemLocation are sent to NewItemDispatcher
      • NewItemDispatcher creates the proper item in the database, sends back corresponding HTML fragment. This fragment contains the form to edit that content type (the form contains the actions dropdown menu).
    3. User edits the content item and submits the updates
      • guideId, itemId and item-specific content (i.e. Text: textarea; Section: section title; Link: target, label) is submitted to the content item's Backing Bean.
      • server sends back a call to Javascript functions: either srg.success( itemId, itemTimestamp ) or srg.error( itemId, itemAction ). This could be implemented by sending an HTML fragment containing <script>.


I had worked on expanding the below table, but Confluence died for a while and the edits were not preserved... what was supposed to be in the below table has been re-factored into the notes above.

data field

notes

seedId

a seed id that is rendered on the page by AuthorProducer upon new Guide creation or editing an existing guide. This is used as a base for item ids - i.e. itemId = seedId + "increment". seedId could be the same as the guideId

guideId

a guid that is rendered on the page by AuthorProducer upon new Guide creation or editing an existing guide. This is used as a unique identifier for this guide when sending requests to the server.

itemId

a unique id for content items within a research guide. itemIds are populated by the Javascript running on the client when new items are created and sent to the server. The server sends this id back to the client indicating a new item has been created.