Skip to content
Snippets Groups Projects
Commit 27315026 authored by Sebastian Pongratz's avatar Sebastian Pongratz :ping_pong:
Browse files

Merge branch '1083811_blobHandler' into '2021.1'

1083811 blobHandler read bindata fix

See merge request xrm/basic!1245
parents 2567c6e8 5ea4b1db
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ import("system.vars"); ...@@ -11,7 +11,7 @@ import("system.vars");
* This process uses the id of the dataset as filename. * This process uses the id of the dataset as filename.
*/ */
var path = vars.get("$sys.serverdata") + "/binaryfiles/" var path = vars.get("$sys.serverdata") + "/binaryfiles/";
var operation = null; var operation = null;
switch (vars.get("$local.operation")) switch (vars.get("$local.operation"))
...@@ -27,9 +27,6 @@ switch (vars.get("$local.operation")) ...@@ -27,9 +27,6 @@ switch (vars.get("$local.operation"))
break; break;
case "READ": case "READ":
operation = readBlob; operation = readBlob;
break;
default:
break;
} }
if (operation) if (operation)
...@@ -45,7 +42,7 @@ if (operation) ...@@ -45,7 +42,7 @@ if (operation)
*/ */
function createBlob (path, filename) function createBlob (path, filename)
{ {
_writeBlob(path + filename ) _writeBlob(path + filename);
} }
/* /*
...@@ -56,7 +53,7 @@ function createBlob (path, filename) ...@@ -56,7 +53,7 @@ function createBlob (path, filename)
*/ */
function deleteBlob (path, filename) function deleteBlob (path, filename)
{ {
fileIO.remove(path + filename ); fileIO.remove(path + filename);
} }
/* /*
...@@ -67,7 +64,7 @@ function deleteBlob (path, filename) ...@@ -67,7 +64,7 @@ function deleteBlob (path, filename)
*/ */
function updateBlob (path, filename) function updateBlob (path, filename)
{ {
_writeBlob(path + filename ); _writeBlob(path + filename);
} }
/* /*
...@@ -83,7 +80,7 @@ function readBlob (path, filename) ...@@ -83,7 +80,7 @@ function readBlob (path, filename)
var fullPath = path + filename; var fullPath = path + filename;
var fromWhereCond = new SqlBuilder(SqlUtils.getBinariesAlias()).from("ASYS_BINARIES").where("ASYS_BINARIES.ID", filename); var fromWhereCond = new SqlBuilder(SqlUtils.getBinariesAlias()).from("ASYS_BINARIES").where("ASYS_BINARIES.ID", filename);
sqlHelper = new SqlMaskingUtils(); var sqlHelper = new SqlMaskingUtils();
if (fileIO.exists(fullPath) && fileIO.canRead(fullPath)) if (fileIO.exists(fullPath) && fileIO.canRead(fullPath))
{ {
...@@ -91,7 +88,7 @@ function readBlob (path, filename) ...@@ -91,7 +88,7 @@ function readBlob (path, filename)
result.string(blob); result.string(blob);
} }
// copy to reuse it inside of the if with other select field // copy to reuse it inside of the if with other select field
else if (fromWhereCond.copy().select(sqlHelper.bindataLength("BINDATA")).cell() > 0) else if (fromWhereCond.copy().select(sqlHelper.binDataLength("BINDATA")).cell() > 0)
{ {
blob = fromWhereCond.select("BINDATA").cell(); blob = fromWhereCond.select("BINDATA").cell();
result.string(blob); result.string(blob);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment