application.ADF.log.logAppend( argumentCollection=arguments ); //server.ADF.objectFactory.getBean("log_1_0").logAppend( argumentCollection=arguments ); application.ADF.log.bulkLogAppend( argumentCollection=arguments ); var resultHTML = ""; var dumpAttrs = StructNew();
#arguments.label#: #arguments.var#
dumpAttrs = { var="#arguments.var#" ,label="#arguments.label#" ,expand="#arguments.expand#" ,showUDFs="#arguments.showUDFs#" }; if ( IsNumeric(arguments.top) ) dumpAttrs.top = arguments.top; WriteDump(attributeCollection=dumpAttrs);
#resultHTML#
SELECT Directory, Name, Type FROM arguments.dirQuery WHERE Type = AND UPPER(name) #arguments.whereOperator# ORDER BY Directory, Name var newDate = dateFormat(dateAdd('n', arguments.minuteDelay, now()), "mm/dd/yyyy"); var newTime = timeFormat(dateAdd('n', arguments.minuteDelay, now()), "HH:mm"); var logFileDir = arguments.schedLogDir; var fullLogFilePath = ""; var uniqueFullLogFilePath = ""; var logExt = ""; var logFileName = ""; // TODO: FUTURE FEATURE: Use for scheduled tasks that need authentication to run unattended var validAuthToken = false; // ACF 10+ only allows .log and .txt extension for the generated log files. // Additional extensions can be added to the \cfusion\lib\neo-cron.xml config file. // https://wikidocs.adobe.com/wiki/display/coldfusion/cfschedule logExt = ListLast(arguments.schedLogFileName,'.'); logFileName = Mid(arguments.schedLogFileName, 1, Len(arguments.schedLogFileName)-Len(logExt)-1); if ( ListFindNoCase(arguments.allowedLogExts,logExt) EQ 0 ) arguments.schedLogFileName = logFileName & ".log"; if ( arguments.makeLogFileNameUnique ) { fullLogFilePath = logFileDir & arguments.schedLogFileName; uniqueFullLogFilePath = createUniqueFileName(fullLogFilePath); arguments.schedLogFileName = ListLast(uniqueFullLogFilePath,"/"); } // Validate authToken (Future authentication feature) //validAuthToken = application.ADF.csSecurity.isValidAuthToken(arguments.authtoken); validAuthToken = true; if ( LEN(TRIM(arguments.AuthToken)) AND validAuthToken ) schedURL = schedURL & "&authtoken=" & arguments.authtoken; /** * Creates a unique file name; used to prevent overwriting when moving or copying files from one location to another. * v2, bug found with dots in path, bug found by joseph * v3 - missing dot in extension, bug found by cheesecow * * @param fullpath Full path to file. (Required) * @return Returns a string. * @author Marc Esher (marc.esher@cablespeed.com) * @version 3, July 1, 2008 */ var extension = ""; var thePath = ""; var newPath = arguments.fullPath; var counter = 0; if(listLen(arguments.fullPath,".") gte 2) extension = listLast(arguments.fullPath,"."); thePath = listDeleteAt(arguments.fullPath,listLen(arguments.fullPath,"."),"."); while(fileExists(newPath)){ counter = counter+1; newPath = thePath & "_" & counter & "." & extension; } return newPath; var getFields = ''; var data = server.ADF.objectFactory.getBean("Data_1_0"); var fieldTypes = arrayNew(1); select type, propertyModule, renderModule, ID, active, dateLastModified, JSValidator from customFieldTypes order by type var results = true; var update = ''; update customFieldTypes set renderModule = , propertyModule = , JSValidator = , type = , Active = , DateLastModified = where ID = results = false; logAppend("Error updating custom field type: #cfcatch.detail#"); var zipFile = ""; // ZipFile var entries = ""; // Enumeration of ZipEntry var entry = ""; // ZipEntry var fil = ""; //File var inStream = ""; var filOutStream = ""; var bufOutStream = ""; var nm = ""; var pth = ""; var lenPth = ""; var buffer = ""; var l = 0; zipFile = createObject("java", "java.util.zip.ZipFile"); zipFile.init(zipFilePath); entries = zipFile.entries(); while(entries.hasMoreElements()) { entry = entries.nextElement(); if(NOT entry.isDirectory()) { nm = entry.getName(); lenPth = len(nm) - len(getFileFromPath(nm)); if (lenPth) { pth = outputPath & left(nm, lenPth); } else { pth = outputPath; } if (NOT directoryExists(pth)) { fil = createObject("java", "java.io.File"); fil.init(pth); fil.mkdirs(); } filOutStream = createObject( "java", "java.io.FileOutputStream"); filOutStream.init(outputPath & nm); bufOutStream = createObject( "java", "java.io.BufferedOutputStream"); bufOutStream.init(filOutStream); inStream = zipFile.getInputStream(entry); buffer = repeatString(" ",1024).getBytes(); l = inStream.read(buffer); while(l GTE 0) { bufOutStream.write(buffer, 0, l); l = inStream.read(buffer); } inStream.close(); bufOutStream.close(); } } zipFile.close(); var exists = false; if ( fileExists(expandPath(arguments.templatePath)) ) exists = true; else if ( fileExists(arguments.templatePath) ) exists = true; return exists; var fieldData = ''; var count = ''; var deleteLists = ''; var insertList = ''; var updateFieldValue = ''; var results = structNew(); var doUpdate = false; var fieldIDList = ""; var fieldDataAry = arrayNew(1); var fieldID = ""; var fieldDataList = ""; var fieldVal = ""; var theListID = ""; // make sure that the field type passed in is of type list var isListType = fieldTypeIsList(arguments.fieldType); results.updated = false; if( isListType ) { // get the fieldID's that have this fieldType fieldIDList = variables.ceData.getFieldIdsByType(arguments.fieldType); if( not listLen(fieldIDList) ) results.msg = "No fields are bound to this type"; else doUpdate = true; } else results.msg = "Field type #arguments.fieldType# is not a 'list' field type"; delete from data_ListItems where listID = insert into data_listItems (listID, position, pageID, numItemValue, StrItemValue ) values ( , , , , ) insert into data_listItems (listID, position, pageID, StrItemValue ) values ( , , , ) update data_FieldValue set listID = where pageID = and itemID = and versionState = 2 var isList = false; var checkFieldType = queryNew(''); select ID from customFieldTypes where type = var rtn = StructNew(); var listStart = ''; var listEnd = ''; var pg = ''; var maxPage = Ceiling(arguments.itemCount / arguments.pageSize); var itemStart = 0; var itemEnd = 0; rtn.itemStart = itemStart; rtn.itemEnd = itemEnd; #rtn.resultsCount# rtn.itemStart = itemStart; rtn.itemEnd = itemEnd; rtn.prevlink = ""; rtn.pagelinks = ArrayNew(1); rtn.nextLink = ""; var final_list = ""; var x = 0; var random_i = 0; var random_val = 0; if(ArrayLen(Arguments) GTE 3) theDelim = Arguments[3]; if(arguments.numElements GT ListLen(arguments.theList, theDelim)) { arguments.numElements = ListLen(arguments.theList, theDelim); } // Build the new list "scratching off" the randomly selected elements from the original list in order to avoid repeats for(x=1; x LTE arguments.numElements; x=x+1){ random_i = RandRange(1, ListLen(arguments.theList)); // pick a random list element index from the remaining elements random_val = ListGetAt(arguments.theList, random_i); // get the corresponding list element's value arguments.theList = ListDeleteAt(arguments.theList, random_i); // delete the used element from the list final_list = ListAppend(final_list, random_val , theDelim); } return(final_list);