variables.ElementName = ''; variables.CCAPIName = ''; variables.ElementIDfield = "uniqueID"; variables.FilterElementName = getPostFilteringCEName(); variables.FilterCCAPIName = getCCAPIName(ceName=variables.FilterElementName); variables.serviceTypeName = ''; variables.excludeListField = ''; // Append the serviceTypeName variables.includeListField = ''; // Append the serviceTypeName var retStatusStruct = StructNew(); var dataValues = StructNew(); var status = ""; var filteredPostData = StructNew(); var excludedList = ""; var serviceField = variables.excludeListField; var serviceType = variables.serviceTypeName; 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,serviceField) ) { if ( ListFindNoCase(filteredPostData.values[serviceField],arguments.postID) EQ 0 ) { dataValues[serviceField] = ListAppend(filteredPostData.values[serviceField],arguments.postID); status = "updated"; } } else { dataValues[serviceField] = arguments.postID; status = "updated"; } } // Call the CCAPI to update the element if ( status EQ "updated" ) retStatusStruct = socialMediaFilteringCCAPI(dataValues); if ( retStatusStruct['CONTENTUPDATED'] IS true ) { retStatusStruct['MSG'] = 'success'; retStatusStruct['STATUS'] = status; // automatically rebuild the Facebook Feed Cache. application.ptsocialmedia.socialMediaCacheController.buildServiceTypeFeedCache(serviceType=serviceType); } return retStatusStruct; var retStatusStruct = StructNew(); var dataValues = StructNew(); var status = ""; var filteredPostData = StructNew(); var includedList = ""; var serviceField = variables.includeListField; var serviceType = variables.serviceTypeName; 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,serviceField) ) { if ( ListFindNoCase(filteredPostData.values[serviceField],arguments.postID) EQ 0 ) { dataValues[serviceField] = ListAppend(filteredPostData.values[serviceField],arguments.postID); status = "updated"; } } else { dataValues[serviceField] = arguments.postID; status = "updated"; } } // Call the CCAPI to update the element if ( status EQ "updated" ) retStatusStruct = socialMediaFilteringCCAPI(dataValues); if ( retStatusStruct['CONTENTUPDATED'] IS true ) { retStatusStruct['MSG'] = 'success'; retStatusStruct['STATUS'] = status; // automatically rebuild the Facebook Feed Cache. application.ptsocialmedia.socialMediaCacheController.buildServiceTypeFeedCache(serviceType=serviceType); } return retStatusStruct; var retStatusStruct = StructNew(); var dataValues = StructNew(); var status = ""; var filteredPostData = StructNew(); var excludedList = ""; var serviceField = variables.excludeListField; var serviceType = variables.serviceTypeName; 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,serviceField) ) { postPos = ListFindNoCase(filteredPostData.values[serviceField],arguments.postID); if ( postPos ) { dataValues[serviceField] = listDeleteAt(filteredPostData.values[serviceField],postPos); status = "updated"; } } else { dataValues[serviceField] = arguments.postID; status = "updated"; } } // Call the CCAPI to update the element if ( status EQ "updated" ) retStatusStruct = socialMediaFilteringCCAPI(dataValues); if ( retStatusStruct['CONTENTUPDATED'] IS true ) { retStatusStruct['MSG'] = 'success'; retStatusStruct['STATUS'] = status; // automatically rebuild the YouTube Feed Cache. application.ptsocialmedia.socialMediaCacheController.buildServiceTypeFeedCache(serviceType=serviceType); } return retStatusStruct; var retStatusStruct = StructNew(); var dataValues = StructNew(); var status = ""; var filteredPostData = StructNew(); var includedList = ""; var serviceField = variables.includeListField; var serviceType = variables.serviceTypeName; 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,serviceField) ) { postPos = ListFindNoCase(filteredPostData.values[serviceField],arguments.postID); if ( postPos ) { dataValues[serviceField] = listDeleteAt(filteredPostData.values[serviceField],postPos); status = "updated"; } } else { dataValues[serviceField] = arguments.postID; status = "updated"; } } // Call the CCAPI to update the element if ( status EQ "updated" ) retStatusStruct = socialMediaFilteringCCAPI(dataValues); if ( retStatusStruct['CONTENTUPDATED'] IS true ) { retStatusStruct['MSG'] = 'success'; retStatusStruct['STATUS'] = status; // automatically rebuild the YouTube Feed Cache. application.ptsocialmedia.socialMediaCacheController.buildServiceTypeFeedCache(serviceType=serviceType); } return retStatusStruct; var retStatusStruct = {}; // 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;