POST
|
Thanks for the reply. The script above itself ( replace(split_part( image_path_filename, '_', 5), '.pdf', '')::timestamp > CURRENT_TIMESTAMP - INTERVAL '545 day' and split_part( image_path_filename, '_', 5) not like 'sn-%' and split_part( image_path_filename , '_', 5) <> ' ' and maptype = 'Appraisal') is working but when it combined with other condition it returned an error as below. Basically purpose of this script is to query Appraisal maps under a condition that the map date is earlier than 18 months from now. But the date info is not directly given is in a field with the record format of " //sv04docifs5/data5/vol2/records/map_sets/s-map/00840/s_00840_008_2016-11-08.pdf". That is why I had to extract the date info firstly. With this condition I also tried to query maptype = 'Bridge' OR maptype = 'Record' OR maptype = 'Survey' and it returned the following error. (replace(split_part( image_path_filename, '_', 5), '.pdf', '')::timestamp > CURRENT_TIMESTAMP - INTERVAL '545 day' and split_part( image_path_filename, '_', 5) not like 'sn-%' and split_part( image_path_filename , '_', 5) <> '' and maptype = 'Appraisal') or maptype = 'Bridge' OR maptype = 'Record' OR maptype = 'Survey'
... View more
06-08-2017
02:09 PM
|
0
|
0
|
242
|
POST
|
I was using the following code to query out the record in ArcMap. when I used verify button for the code, it returned error. Anybody can tell me why? replace(split_part( image_path_filename, '_', 5), '.pdf', '')::timestamp > CURRENT_TIMESTAMP - INTERVAL '545 day' and split_part( image_path_filename, '_', 5) not like 'sn-%' and split_part( image_path_filename , '_', 5) <> ' ' and maptype = 'Appraisal' Thanks,
... View more
06-07-2017
08:55 AM
|
0
|
2
|
616
|
POST
|
"requ" is the query name for "SR", which contains all the pdf links on the server. Is the following code right to define the field of "requ"? fileURLs = {
fieldInfos: [{
name: 'requ',
alias: 'SR',
}]
}; doExport: function() {
fileURLs = {
fieldInfos: [{
name: 'requ',
alias: 'SR',
}]
};
var zip = new JSZip();
var count = 0;
downloadFile(fileURLs[count], onDownloadComplete);
function downloadFile(url, onSuccess) {
var xhr = new XMLHttpRequest();
// xhr.onprogress = calculateAndUpdateProgress;
xhr.open('GET', url, true);
xhr.responseType = "blob";
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (onSuccess) onSuccess(xhr.response);
}
}
}
function onDownloadComplete(blobData) {
if (count < fileURLs.length) {
blobToBase64(blobData, function(binaryData) {
// add downloaded file to zip:
var fileName = fileURLs[count].substring(fileURLs[count].lastIndexOf('/') + 1);
zip.file(fileName, binaryData, {
base64: true
});
if (count < fileURLs.length - 1) {
count++;
downloadFile(fileURLs[count], onDownloadCompleted);
} else {
// all files have been downloaded, create the zip
var content = zip.generate();
// then trigger the download link:
var zipName = 'download.zip';
var a = document.createElement('a');
a.href = "data:application/zip;base64," + content;
a.download = zipName;
a.click();
}
});
}
}
function blobToBase64(blob, callback) {
var reader = new FileReader();
reader.onload = function() {
var dataUrl = reader.result;
var base64 = dataUrl.split(',')[1];
callback(base64);
};
reader.readAsDataURL(blob);
}
}, doExport: function() {
fileURLs = {
fieldInfos: [{
name: 'requ',
alias: 'SR',
}]
};
var zip = new JSZip();
var count = 0;
downloadFile(fileURLs[count], onDownloadComplete);
function downloadFile(url, onSuccess) {
var xhr = new XMLHttpRequest();
// xhr.onprogress = calculateAndUpdateProgress;
xhr.open('GET', url, true);
xhr.responseType = "blob";
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (onSuccess) onSuccess(xhr.response);
}
}
}
function onDownloadComplete(blobData) {
if (count < fileURLs.length) {
blobToBase64(blobData, function(binaryData) {
// add downloaded file to zip:
var fileName = fileURLs[count].substring(fileURLs[count].lastIndexOf('/') + 1);
zip.file(fileName, binaryData, {
base64: true
});
if (count < fileURLs.length - 1) {
count++;
downloadFile(fileURLs[count], onDownloadCompleted);
} else {
// all files have been downloaded, create the zip
var content = zip.generate();
// then trigger the download link:
var zipName = 'download.zip';
var a = document.createElement('a');
a.href = "data:application/zip;base64," + content;
a.download = zipName;
a.click();
}
});
}
}
function blobToBase64(blob, callback) {
var reader = new FileReader();
reader.onload = function() {
var dataUrl = reader.result;
var base64 = dataUrl.split(',')[1];
callback(base64);
};
reader.readAsDataURL(blob);
}
},
... View more
08-17-2016
12:42 PM
|
0
|
0
|
723
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|