variables.version = "2.0";
variables.svnBuild = "117";
// TODO: Setup Errors variable in the App variable scope
//if ( StructKeyExists(application,"ptSocialMedia") AND !StructKeyExists(application.ptSocialMedia,"appErrors") )
//application.ptSocialMedia.appErrors = ArrayNew(1);
application.ptSocialMedia.version = variables.version;
application.ptSocialMedia.svnBuild = variables.svnBuild;
var appConfig = getAppConfig();
// Get the UI theme from the config element
if ( structKeyExists(appConfig,"ui_theme") AND LEN(TRIM(appConfig['ui_theme'])) )
return appConfig['ui_theme'];
else
return "redmond";
var appConfig = getAppConfig();
// Get the cache type from the config element
if ( structKeyExists(appConfig,"socialMediaServiceTypes") AND LEN(TRIM(appConfig['socialMediaServiceTypes'])) )
return appConfig['socialMediaServiceTypes'];
else
return "facebook,twitter,youtube,wordpress";
var appConfig = getAppConfig();
// Get the cache dashboard url from the config element
if ( structKeyExists(appConfig,"dashboardURL") AND LEN(TRIM(appConfig.dashboardURL)) )
return appConfig['dashboardURL'];
else
return "#request.site.CP_URL#webadmin/socialmedia/Social-Media-Dashboard.cfm";
var appConfig = getAppConfig();
// Get the cache dashboard url from the config element
if ( structKeyExists(appConfig,"serviceManagerURL") AND LEN(TRIM(appConfig.serviceManagerURL)) )
return appConfig['serviceManagerURL'];
else
return "#request.site.CP_URL#webadmin/socialmedia/Manage-Services.cfm";
var appConfig = getAppConfig();
// Get the configuration manager page url from the config element
if ( structKeyExists(appConfig,"configManagerURL") AND LEN(TRIM(appConfig.configManagerURL)) )
return appConfig['configManagerURL'];
else
return "#request.site.CP_URL#webadmin/socialmedia/Manage-Configuration.cfm";
var appConfig = getAppConfig();
// Get the cache type from the config element
if ( structKeyExists(appConfig,"enableFeedCache") AND LEN(TRIM(appConfig['enableFeedCache'])) )
return appConfig['enableFeedCache'];
else
return 0;
var appConfig = getAppConfig();
// Get the Rebuild Feed Cache Interval from the config element
if ( structKeyExists(appConfig,"rebuildFeedCacheInterval") AND IsNumeric(appConfig['rebuildFeedCacheInterval']) )
return appConfig['rebuildFeedCacheInterval'];
else
return 15;
var appConfig = getAppConfig();
// Get the Facebook AppID from the config element
if ( StructKeyExists(appConfig,"apiFacebookAppID") AND LEN(TRIM(appConfig.apiFacebookAppID)) )
return appConfig.apiFacebookAppID;
else
return "";
var appConfig = getAppConfig();
// Get the Facebook AppID from the config element
if ( StructKeyExists(appConfig,"apiTwitterCustomerKey") AND LEN(TRIM(appConfig.apiTwitterCustomerKey)) )
return appConfig.apiTwitterCustomerKey;
else
return "";
var appConfig = getAppConfig();
// Get the Facebook AppID from the config element
if ( StructKeyExists(appConfig,"apiTwitterCustomerSecret") AND LEN(TRIM(appConfig.apiTwitterCustomerSecret)) )
return appConfig.apiTwitterCustomerSecret;
else
return "";
var custKey = getTwitterCustomerKey();
var custSecret = getTwitterCustomerSecret();
// RFC 1738 encoded consumer key (does not change)
custKey = URLEncodedFormat(custKey); // TODO: verify that CF's URLEncodedFormat does RFC 1738 encoding
// RFC 1738 encoded consumer secret (does not change)
custSecret = URLEncodedFormat(custSecret); // TODO: verify that CF's URLEncodedFormat does RFC 1738 encoding
// Get the Facebook AppID from the config element
if ( LEN(TRIM(custKey)) AND LEN(TRIM(custSecret)) )
return custKey & ":" & custSecret;
else
return "";
var bearerToken = getTwitterBearerToken();
// Convert the bearer token to base64
if ( LEN(TRIM(bearerToken)) )
return ToBase64(bearerToken,"utf-8");
else
return "";
var errorDump = "";
var logFileName = errorLogFileName(arguments.serviceName);
//var logFileName = dateFormat(now(), "yyyymmdd") & "." & request.site.name & ".ptSocialMedia_" & arguments.serviceName & "_Errors.htm";
var errorStruct = StructNew();
// Add the errorDetails to the errorStruct
errorStruct.Details = arguments.errorDetails;
// Add the serviceName to the errorStruct
if ( LEN(TRIM(arguments.serviceName)) )
errorStruct.ServiceName = arguments.serviceName;
// Add the methodName to the errorStruct data
if ( LEN(TRIM(arguments.methodName)) )
errorStruct.methodName = arguments.methodName;
var logFileName = dateFormat(now(), "yyyymmdd") & "." & request.site.name & ".ptSocialMedia_" & arguments.serviceName & "_Errors.htm";
return logFileName;