Differential Sync

From ADF Docs
Revision as of 14:18, 6 October 2011 by Rkahn (talk | contribs)
Jump to: navigation, search

The differentialSync function will optimally update a large set of data based on a comparison of existing data. The function takes many arguments, most notably the newOverride, updateOverride and deleteOverride; those 3 parameters can allow you to write custom code that will handle new, updates or deletions.

Parameters

  • elementName - String (Required)
    • The element name that we are going to sync.
  • newElements - Array (Required)
    • The elements that you would like to have as the result after the sync is complete
  • preformDelete - Boolean
    • default: false
    • This will call the delete function if set to true, otherwise deletions will not be processed. This can be helpful if you want old elements to remain.
  • primaryKeys - String
    • List of primary keys to use in the comparision
    • _pageID is a reserved word and will compare the elements pageID if it exists in the source data
    • Example: "links,title" or "_pageID,title"
  • ignoreFields - String
    • A list of fields to ignore in the comparison.
    • Example: "id,title"
  • newOverride - Structure
    • default:
      • newOverride.bean = "csContent_1_0"
      • newOverride.method = "populateContent_1_0"
    • You can override this to handle all new items with your own bean/method argument. It will get called with the parameter of "data" which is a structure of the element data
  • updateOverride - Structure
    • default:
      • newOverride.bean = "csContent_1_0"
      • newOverride.method = "populateContent_1_0"
    • You can override this to handle all items that changed with your own bean/method argument. It will get called with the parameter of "data" which is a structure ot the element data
  • deleteOverride
  • syncSourceContent
  • elementCCAPIName