Difference between revisions of "Differential Sync"

From ADF Docs
Jump to: navigation, search
(Created page with '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, u…')
 
Line 2: Line 2:
  
 
Parameters
 
Parameters
*elementName - String (Required)
+
*'''elementName''' - String (Required)
 
**The element name that we are going to sync.
 
**The element name that we are going to sync.
*newElements - Array (Required)
+
*'''newElements''' - Array (Required)
 
**The elements that you would like to have as the result after the sync is complete
 
**The elements that you would like to have as the result after the sync is complete
*preformDelete - Boolean
+
*'''preformDelete''' - Boolean
 
**default: false
 
**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.
 
**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
+
*'''primaryKeys''' - String
 
**List of primary keys to use in the comparision
 
**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
 
**_pageID is a reserved word and will compare the elements pageID if it exists in the source data
 
**Example: "links,title" or "_pageID,title"
 
**Example: "links,title" or "_pageID,title"
*ignoreFields - String
+
*'''ignoreFields''' - String
 
**A list of fields to ignore in the comparison.
 
**A list of fields to ignore in the comparison.
 
**Example: "id,title"
 
**Example: "id,title"
*newOverride - Structure
+
*'''newOverride''' - Structure
 
**default:
 
**default:
 
***newOverride.bean = "csContent_1_0"
 
***newOverride.bean = "csContent_1_0"
 
***newOverride.method = "populateContent_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
 
**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
+
*'''updateOverride''' - Structure
 
**default:
 
**default:
 
***newOverride.bean = "csContent_1_0"
 
***newOverride.bean = "csContent_1_0"
 
***newOverride.method = "populateContent_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
 
**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
+
*'''deleteOverride'''
*syncSourceContent
+
*'''syncSourceContent'''
*elementCCAPIName
+
*'''elementCCAPIName'''

Revision as of 14:18, 6 October 2011

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