Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADITO_Update_Upgrade
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
ADITO_Update_Upgrade
Commits
e2d7b0bd
Commit
e2d7b0bd
authored
5 years ago
by
Markus Escher
Browse files
Options
Downloads
Patches
Plain Diff
change Document_lib download to selectionRows
parent
bf1e7549
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity/Document_entity/entityfields/downloadsinglefileaction/onActionProcess.js
+1
-1
1 addition, 1 deletion
.../entityfields/downloadsinglefileaction/onActionProcess.js
process/Document_lib/process.js
+16
-29
16 additions, 29 deletions
process/Document_lib/process.js
with
17 additions
and
30 deletions
entity/Document_entity/entityfields/downloadsinglefileaction/onActionProcess.js
+
1
−
1
View file @
e2d7b0bd
import
(
"
Document_lib
"
);
DocumentUtil
.
downloadS
ingle
Document
();
DocumentUtil
.
downloadS
elected
Document
s
();
This diff is collapsed.
Click to expand it.
process/Document_lib/process.js
+
16
−
29
View file @
e2d7b0bd
...
...
@@ -15,17 +15,27 @@ function DocumentUtil(){
/**
* Utility function to download all selected documents.
* Selected documents will be checked with $
local.uids.
* Selected documents will be checked with $
sys.selectionRows
* Documents will be downloaded with neon.download
*/
DocumentUtil
.
downloadSelectedDocuments
=
function
()
{
var
alias
=
db
.
getCurrentAlias
();
// Download selected files (=not opened)
if
(
vars
.
exists
(
"
$local.uids
"
)
&&
vars
.
exists
(
"
$local.rows
"
)
&&
vars
.
get
(
"
$local.rows
"
)
&&
JSON
.
parse
(
vars
.
get
(
"
$local.rows
"
)).
length
>
0
)
{
var
rows
=
JSON
.
parse
(
vars
.
get
(
"
$local.rows
"
));
var
uids
=
JSON
.
parse
(
vars
.
get
(
"
$local.uids
"
));
if
(
vars
.
exists
(
"
$sys.selectionRows
"
)
&&
vars
.
get
(
"
$sys.selectionRows
"
))
{
var
rows
;
try
{
rows
=
JSON
.
parse
(
vars
.
get
(
"
$sys.selectionRows
"
));
}
catch
(
e
)
{
rows
=
JSON
.
parse
(
JSON
.
stringify
(
vars
.
get
(
"
$sys.selectionRows
"
)));
}
var
uids
;
try
{
uids
=
JSON
.
parse
(
vars
.
get
(
"
$sys.selection
"
));
}
catch
(
e
)
{
uids
=
JSON
.
parse
(
JSON
.
stringify
(
vars
.
get
(
"
$sys.selection
"
)));
}
var
binaryContents
=
db
.
getBinaryContents
(
uids
,
alias
);
// check if multiplie Files are selected.
...
...
@@ -39,29 +49,6 @@ DocumentUtil.downloadSelectedDocuments = function() {
}
}
/**
* Utility function dow download a single Document.
*/
DocumentUtil
.
downloadSingleDocument
=
function
()
{
var
alias
=
db
.
getCurrentAlias
();
var
id
;
var
name
;
if
(
vars
.
exists
(
"
$local.uid
"
))
{
// Download single file (=not opened)
id
=
JSON
.
parse
(
vars
.
get
(
"
$local.uid
"
));
name
=
vars
.
get
(
"
$local.value
"
);
}
else
{
// Download open file
id
=
vars
.
get
(
"
$field.UID
"
);
name
=
vars
.
get
(
"
$field.NAME
"
);
}
var
binaryContent
=
db
.
getBinaryContent
(
id
,
alias
);
if
(
binaryContent
!=
null
&&
binaryContent
!=
''
)
neon
.
download
(
binaryContent
,
name
);
}
/**
* Utility function to delete the current/opened Document.
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment