var retStatusStruct = "failed"; // Create the CS Content CFC //var csContent = server.ADF.objectFactory.getBean("CSContent_1_0"); //application.ADF.utils.doDump(arguments.dataValues,"arguments.dataValues", false); // Create the page retStatusStruct = application.ptPhotoGallery.CSContent.populateContent("Photo", arguments.dataValues); var pageResult = ""; var dataStruct = StructNew(); var binarydata = ""; var tempPhotoDescription = arguments.photoDescription; var tempDescription = listfirst(listlast(arguments.imgDir,"/"),"."); var csUpload = ""; if (len(tempPhotoDescription) eq 0) { photoDescription = tempDescription; } else { photoDescription = tempPhotoDescription; } dataStruct.LocalFileName = "#arguments.imgDir#"; dataStruct.public = true; dataStruct.category = "General"; dataStruct.galleryID = "1"; dataStruct.description = photoDescription; // create the page pageResult = application.ptPhotoGallery.csUpload.uploadImage(request.subsite.id, dataStruct, binarydata); return pageResult; var configStruct = StructNew(); configStruct.docPath = "#request.subsiteCache[1].dir#uploads/"; configStruct.docURL = "#request.subsiteCache[1].url#uploads/"; // Config - UPLOADPATH if ( (StructKeyExists(server.ADF.environment[request.site.id].ptPhotoGallery, "UPLOAD_PATH")) AND (LEN(server.ADF.environment[request.site.id].ptPhotoGallery.UPLOAD_PATH)) ) configStruct.docPath = server.ADF.environment[request.site.id].ptPhotoGallery.UPLOAD_PATH; // Config - UPLOADURL if ( (StructKeyExists(server.ADF.environment[request.site.id].ptPhotoGallery, "UPLOAD_URL")) AND (LEN(server.ADF.environment[request.site.id].ptPhotoGallery.UPLOAD_URL)) ) configStruct.docURL = server.ADF.environment[request.site.id].ptPhotoGallery.UPLOAD_URL; var sizeData = StructNew(); var sizeArray = ArrayNew(1); if ( LEN(TRIM(arguments.sizeRefName)) ) sizeArray = application.ptPhotoGallery.cedata.getCEData("Photo Size", "directory", arguments.sizeRefName); if ( ArrayLen(sizeArray) AND StructKeyExists(sizeArray[1],"values") ) sizeData = sizeArray[1].values; return sizeData; var catID = ""; var catArray = ArrayNew(1); if ( LEN(TRIM(arguments.refName)) ) catArray = application.ptPhotoGallery.cedata.getCEData("Photo Category","directory",TRIM(arguments.refName)); if ( ArrayLen(catArray) AND StructKeyExists(catArray[1],"values") AND StructKeyExists(catArray[1].values,"categoryID") ) catID = catArray[1].values.categoryID; return catID; var catID = ""; var catArray = ArrayNew(1); if ( LEN(TRIM(arguments.catTitle)) ) catArray = application.ptPhotoGallery.cedata.getCEData("Photo Category","title",TRIM(arguments.catTitle)); if ( ArrayLen(catArray) AND StructKeyExists(catArray[1],"values") AND StructKeyExists(catArray[1].values,"categoryID") ) catID = catArray[1].values.categoryID; return catID;