variables.cacheFilePath = request.site.CP_URL & "_cs_apps/pt_calendar/cache/"; variables.eventsCacheFile = "calendar-cache-events-data.wddx"; variables.eventsCacheFilePath = ExpandPath(variables.cacheFilePath & variables.eventsCacheFile); //variables.eventsCachFields = "packetid,importid,CEID,CSPageid,CSSubsiteID,Type"; //variables.recurrenceCacheFile = "calendar-cache-recurrence-data.wddx"; //variables.recurrenceCacheFilePath = ExpandPath(variables.cacheFilePath & variables.recurrenceCacheFile); //variables.recurrenceCacheFields = "packetid,importid,CEID,CSPageid,CSSubsiteID,Type"; //var buildPacketFile = createEventsCacheFile(); var dataQry = application.ptCalendar.calEventsDAO.getEventsUnion( startDate=arguments.startDate ,endDate=arguments.endDate ); return writeWDDXData(filePath=variables.eventsCacheFilePath,dataQuery=dataQry); var retStr = "false"; var fileResult = deleteEventsCacheFile(); if ( StructKeyExists(fileResult,"MSG") ) retStr = fileResult.MSG; return retStr; return readWDDXData(filePath=variables.eventsCacheFilePath); SELECT cachedRecurQry.* FROM cachedRecurQry UNION SELECT newRecurQry.* FROM newRecurQry ORDER BY eventDate, AllDay DESC, StartTime return true; ---> ---> SELECT cachedEventQry.* FROM cachedEventQry UNION SELECT newEventsQry.* FROM newEventsQry ORDER BY eventDate, AllDay DESC, StartTime application.ptCalendarCache.events = cachedEventQry; application.ptCalendarCache.eventsCacheUpdateDateTime = dateTimeStamp; return true; ---> var dateTimeStamp = Now(); // Remove events cache records by EventID var deleteEvents = deleteEventCacheRecord( eventID=arguments.eventID ); // Create new events cache records by EventID var addEvents = addEventCacheRecord( eventID=arguments.eventID ); //Updating the timestamp and data is handled by the other add and delete functions return true; SELECT * FROM cachedEventQry WHERE 1 = 1 AND calEventID <> ORDER BY eventDate, AllDay DESC, StartTime application.ptCalendarCache.events = cachedEventQry; application.ptCalendarCache.eventsCacheUpdateDateTime = dateTimeStamp; return true; ---> return variables.eventsCacheFilePath; var colNameStruct = application.ptCalendar.calEventDateTimeDAO.getDateTimeQueryColumnListStruct(); var newQryColList = colNameStruct.columnNames; var newQryDataTypes = colNameStruct.dataTypes; return initWDDXpacketData(filePath=variables.eventsCacheFilePath,packetFields=newQryColList,packetFieldDataTypes=newQryDataTypes); var retStruct = StructNew(); var deleteStatus = deleteDataFile(filePath=variables.eventsCacheFilePath); if ( deleteStatus EQ "file-deleted" OR deleteStatus EQ "file-exists-false" ) { retStruct.status = true; retStruct.msg = "Success"; } else { retStruct.status = false; retStruct.msg = "Failed"; } return retStruct; var qPacket = QueryNew(arguments.packetFields); // Add the Field Data Type to the Query New if provided if ( LEN(TRIM(arguments.packetFieldDataTypes)) AND ( ListLen(arguments.packetFields) EQ ListLen(arguments.packetFieldDataTypes) ) ) qPacket = QueryNew(arguments.packetFields,arguments.packetFieldDataTypes); return writeWDDXData(filePath=arguments.filePath,dataQuery=qPacket); var dataPacketWDDX = ""; var extDataQry = QueryNew("tmp"); SELECT * FROM extDataQry WHERE #arguments.uniqueFldName# = '#arguments.uniqueValue#' AND #arguments.criteriaFldName# = '#arguments.criteriaValue#' ORDER BY #arguments.orderbystr# var extDataQry = readWDDXData(filePath=arguments.filePath); var columns = extDataQry.ColumnList; var rowCount = extDataQry.RecordCount; var currentrow = rowCount + 1; var i = 1; var col = ""; // Add new Row to the Query to populate QueryAddRow(extDataQry, 1); //Loop over the Query Columns an find the values in the KeyValueStruct to add for ( i=1; i LTE ListLen(columns); i++) { col = ListGetAt(columns,i); // Update query Cell with new VALUE if KEY is in Struct if ( StructKeyExists(arguments.keyValueStruct, col) ) { QuerySetCell( extDataQry, col, TRIM(arguments.keyValueStruct[col]), currentrow ); } else { QuerySetCell( extDataQry, col, "", currentrow ); } } // Write the new query back to the data file return writeWDDXData(arguments.filePath,extDataQry); var extDataQry = readWDDXData(filePath=arguments.filePath); var columns = extDataQry.ColumnList; var uField = TRIM(arguments.uniqueFldName); var uValue = TRIM(arguments.uniqueValue); var col = ""; var extDataQry = readWDDXData(filePath=arguments.filePath); var columns = extDataQry.ColumnList; var newDataQry = QueryNew(columns); var uField = TRIM(arguments.uniqueFldName); var uValue = TRIM(arguments.uniqueValue); var col = ""; return deleteDataFile(arguments.filePath); var writeStatus = ""; var dirCreate = StructNew(); var retStr = arguments.filePath; if ( FindNoCase(arguments.charToFind,retStr,1) ) retStr = ReplaceNoCase(retStr,arguments.charToFind,arguments.charToReplace,arguments.scope); return retStr; var fullPath = fixFilePathSlashes(arguments.filePath); var folderPath = GetDirectoryFromPath(fullPath); var retStatus = StructNew(); // If folder exists the we are done here... move on if ( DirectoryExists(folderPath) ) { retStatus.status = "dir-exists"; } else { try { CreateObject("java", "java.io.File").init(folderPath).mkdirs(); retStatus.status = "dir-created"; } catch (any e) { retStatus.status = "dir-create-failed"; } } return retStatus;