Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB WebUI Entity Service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB WebUI Entity Service
Commits
56360e5a
Commit
56360e5a
authored
3 years ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
DRAFT: Begin TransactionService class
parent
48cc8553
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
generate_sources.sh
+1
-1
1 addition, 1 deletion
generate_sources.sh
src/TransactionService.js
+70
-0
70 additions, 0 deletions
src/TransactionService.js
with
71 additions
and
1 deletion
generate_sources.sh
+
1
−
1
View file @
56360e5a
...
@@ -17,7 +17,7 @@ echo "PROTO_DIR: $PROTO_DIR"
...
@@ -17,7 +17,7 @@ echo "PROTO_DIR: $PROTO_DIR"
_OUT_DIR
=
$SRC_DIR
/generated/
_OUT_DIR
=
$SRC_DIR
/generated/
mkdir
-p
$_OUT_DIR
mkdir
-p
$_OUT_DIR
PROTO_MODULE
=
info
/v1
PROTO_MODULE
=
entity
/v1
echo
"generate javascript module proto/caosdb/
$PROTO_MODULE
"
echo
"generate javascript module proto/caosdb/
$PROTO_MODULE
"
PROTO_FILE
=
${
PROTO_DIR
}
/caosdb/
${
PROTO_MODULE
}
/main.proto
PROTO_FILE
=
${
PROTO_DIR
}
/caosdb/
${
PROTO_MODULE
}
/main.proto
...
...
This diff is collapsed.
Click to expand it.
src/TransactionService.js
0 → 100644
+
70
−
0
View file @
56360e5a
/*
* ** header v3.0
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
* Copyright (C) 2021 Florian Spreckelsen <f.spreckelsen@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ** end header
*/
import
{
api
}
from
"
./EntityApi
"
;
export
class
TransactionService
{
constructor
(
uri
)
{
this
.
uri
=
uri
||
"
/api
"
;
}
_PrepareTransaction
(
retrieveRequest
)
{
const
client
=
new
api
.
v1
.
EntityTransactionServiceClient
(
this
.
uri
,
null
,
null
);
var
transactionRequest
=
new
api
.
v1
.
Transactionrequest
();
transactionRequest
.
setRetrieveRequest
(
retrieveRequest
);
var
request
=
new
api
.
v1
.
MultiTransactionRequest
();
request
.
addRequests
(
transactionRequest
);
return
(
res_cb
,
err_cb
)
=>
{
client
.
multiTransaction
(
request
,
headers
,
(
error_response
,
response
)
=>
{
if
(
error_response
)
{
err_cb
(
error_response
);
}
res_cb
(
response
);
});
};
}
_CreateRetrieveRequest
(
id
)
{
var
retrieve_request
=
new
api
.
v1
.
RetrieveRequest
();
retrieve_request
.
setId
(
id
);
retrieve_request
.
setRegisterFileDownload
(
false
);
return
retrieve_request
;
}
_CreateQueryRequest
(
query_string
)
{
var
query
=
new
api
.
v1
.
Query
();
query
.
setQuery
(
query_string
);
var
query_request
=
new
api
.
v1
.
RetrieveRequest
();
query_request
.
setQuery
(
query
);
query_request
.
setRegisterFileDownload
(
false
);
return
query_request
;
}
}
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