variables.ElementName = getFacebookPagesCEName();
variables.CCAPIName = getCCAPIName(ceName=variables.ElementName);
variables.ElementIDfield = "uniqueID";
variables.FilterElementName = getPostFilteringCEName();
variables.FilterCCAPIName = getCCAPIName(ceName=variables.FilterElementName);
variables.excludeListField = "facebookExcludedList";
variables.includeListField = "facebookIncludedList";
var ceArray = Application.ptSocialMedia.CEData.getCEData(variables.ElementName);
return ceArray;
var fieldName = "feedActive";
var fieldValue = 1;
return Application.ptSocialMedia.CEData.getCEData(variables.ElementName,fieldName,fieldValue);
var dataStruct = StructNew();
var ceArray = Application.ptSocialMedia.CEData.getCEData(variables.ElementName,variables.ElementIDfield,arguments.uniqueID);
if ( ArrayLen(ceArray) )
dataStruct = ceArray[1];
return dataStruct;
var ceArray = ArrayNew(1);
var newArray = ArrayNew(1);
// if idList has values, get the values that match items in the list from the element
if ( ListLen(arguments.idList) )
ceArray = Application.ptSocialMedia.CEData.getCEData(variables.ElementName,variables.ElementIDfield,arguments.idList);
// Check to see is a filter field and filter value has been passed
if ( LEN(TRIM(arguments.filterField)) AND LEN(TRIM(arguments.filterValue)) ) {
for ( itm=1; itm LTE ArrayLen(ceArray); itm=itm+1 ) {
// - Filter out records that do not match the 'FilterValue'
if ( StructKeyExists(ceArray[itm].values,arguments.filterField) AND TRIM(ceArray[itm].values[arguments.filterField]) EQ arguments.filterValue )
arrayAppend(newArray, ceArray[itm]);
}
// Convert newArray back the ceArray for the return
ceArray = newArray;
}
return ceArray;
var retStatusStruct = StructNew();
var dataValues = StructNew();
var status = "";
var filteredPostData = StructNew();
var excludedList = "";
retStatusStruct['MSG'] = "failed";
retStatusStruct['CONTENTUPDATED'] = false;
retStatusStruct['STATUS'] = status;
// Get the excluded post ID list
filteredPostData = application.ptsocialmedia.socialMediaCacheDAO.getFilteredPostData();
if ( StructKeyExists(filteredPostData,"values") ) {
// Copy existing values and dataPageID to the dataValues struct
dataValues = filteredPostData.values;
dataValues.dataPageID = filteredPostData.PageID;
if ( StructKeyExists(filteredPostData.values,"facebookExcludedList") ) {
if ( ListFindNoCase(filteredPostData.values.facebookExcludedList,arguments.postID) EQ 0 ) {
dataValues.facebookExcludedList = ListAppend(filteredPostData.values.facebookExcludedList,arguments.postID);
status = "updated";
}
} else {
dataValues.facebookExcludedList = arguments.postID;
status = "updated";
}
}
if ( status EQ "updated" ) {
// Call the CCAPI to update the element
retStatusStruct = facebookCCAPI(dataValues);
}
if ( retStatusStruct['CONTENTUPDATED'] IS true ) {
retStatusStruct['MSG'] = 'success';
retStatusStruct['STATUS'] = status;
// automatically rebuild the Facebook Feed Cache.
application.ptsocialmedia.socialMediaCacheController.buildFacebookFeedCache();
}
return retStatusStruct;
var retStatusStruct = StructNew();
var dataValues = StructNew();
var status = "";
var filteredPostData = StructNew();
var includedList = "";
retStatusStruct['MSG'] = "failed";
retStatusStruct['CONTENTUPDATED'] = false;
retStatusStruct['STATUS'] = status;
// Get the included post ID list
filteredPostData = application.ptsocialmedia.socialMediaCacheDAO.getFilteredPostData();
if ( StructKeyExists(filteredPostData,"values") ) {
// Copy existing values and dataPageID to the dataValues struct
dataValues = filteredPostData.values;
dataValues.dataPageID = filteredPostData.PageID;
if ( StructKeyExists(filteredPostData.values,"facebookIncludedList") ) {
if ( ListFindNoCase(filteredPostData.values.facebookIncludedList,arguments.postID) EQ 0 ) {
dataValues.facebookIncludedList = ListAppend(filteredPostData.values.facebookIncludedList,arguments.postID);
status = "updated";
}
} else {
dataValues.facebookIncludedList = arguments.postID;
status = "updated";
}
}
if ( status EQ "updated" ) {
// Call the CCAPI to update the element
retStatusStruct = facebookCCAPI(dataValues);
}
if ( retStatusStruct['CONTENTUPDATED'] IS true ) {
retStatusStruct['MSG'] = 'success';
retStatusStruct['STATUS'] = status;
// automatically rebuild the Facebook Feed Cache.
application.ptsocialmedia.socialMediaCacheController.buildFacebookFeedCache();
}
return retStatusStruct;
var retStatusStruct = StructNew();
var dataValues = StructNew();
var status = "";
var filteredPostData = StructNew();
var excludedList = "";
retStatusStruct['MSG'] = "failed";
retStatusStruct['CONTENTUPDATED'] = false;
retStatusStruct['STATUS'] = status;
// Get the excluded post ID list
filteredPostData = application.ptsocialmedia.socialMediaCacheDAO.getFilteredPostData();
if ( StructKeyExists(filteredPostData,"values") ) {
// Copy existing values and dataPageID to the dataValues struct
dataValues = filteredPostData.values;
dataValues.dataPageID = filteredPostData.PageID;
if ( StructKeyExists(filteredPostData.values,"facebookExcludedList") ) {
postPos = ListFindNoCase(filteredPostData.values.facebookExcludedList,arguments.postID);
if ( postPos ) {
dataValues.facebookExcludedList = listDeleteAt(filteredPostData.values.facebookExcludedList,postPos);
status = "updated";
}
} else {
dataValues.facebookExcludedList = arguments.postID;
status = "updated";
}
}
if ( status EQ "updated" ) {
// Call the CCAPI to update the element
retStatusStruct = facebookCCAPI(dataValues);
}
if ( retStatusStruct['CONTENTUPDATED'] IS true ) {
retStatusStruct['MSG'] = 'success';
retStatusStruct['STATUS'] = status;
// automatically rebuild the Facebook Feed Cache.
application.ptsocialmedia.socialMediaCacheController.buildFacebookFeedCache();
}
return retStatusStruct;
var retStatusStruct = StructNew();
var dataValues = StructNew();
var status = "";
var filteredPostData = StructNew();
var includedList = "";
retStatusStruct['MSG'] = "failed";
retStatusStruct['CONTENTUPDATED'] = false;
retStatusStruct['STATUS'] = status;
// Get the included post ID list
filteredPostData = application.ptsocialmedia.socialMediaCacheDAO.getFilteredPostData();
if ( StructKeyExists(filteredPostData,"values") ) {
// Copy existing values and dataPageID to the dataValues struct
dataValues = filteredPostData.values;
dataValues.dataPageID = filteredPostData.PageID;
if ( StructKeyExists(filteredPostData.values,"facebookIncludedList") ) {
postPos = ListFindNoCase(filteredPostData.values.facebookIncludedList,arguments.postID);
if ( postPos ) {
dataValues.facebookIncludedList = listDeleteAt(filteredPostData.values.facebookIncludedList,postPos);
status = "updated";
}
} else {
dataValues.facebookIncludedList = arguments.postID;
status = "updated";
}
}
if ( status EQ "updated" ) {
// Call the CCAPI to update the element
retStatusStruct = facebookCCAPI(dataValues);
}
if ( retStatusStruct['CONTENTUPDATED'] IS true ) {
retStatusStruct['MSG'] = 'success';
retStatusStruct['STATUS'] = status;
// automatically rebuild the Facebook Feed Cache.
application.ptsocialmedia.socialMediaCacheController.buildFacebookFeedCache();
}
return retStatusStruct;
var retStatusStruct = StructNew();
// Populate dataValues struct into the element
retStatusStruct = application.ptSocialMedia.csContent.populateContent(variables.FilterCCAPIName, arguments.dataValues);
/* retStatusStruct RETURNS: CONTENTUPDATED : true/false & CONTENTUPDATERESPONSE: Success:1 */
return retStatusStruct;