-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP (BIG): convert webapi and workflowmanager to models (mostly), fix…
… models
- Loading branch information
Showing
10 changed files
with
911 additions
and
844 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from .client_util import * | ||
import json | ||
import re | ||
|
||
def getEDMDataArray(DBName, Type): | ||
response = rGet(f"EDM/{DBName}/{Type}") | ||
return response.json() | ||
|
||
def getEDMData(DBName, Type, ID, path): | ||
if ID == '' or ID is None: | ||
return None | ||
response = rGet(f"EDM/{DBName}/{Type}/{ID}/?path={path}") | ||
return response.json() | ||
|
||
|
||
def setEDMData(DBName, Type, ID, path, data): | ||
response = rPatch(f"EDM/{DBName}/{Type}/{ID}", data=json.dumps({"path": str(path), "data": data})) | ||
return response.json() | ||
|
||
|
||
def createEDMData(DBName, Type, data): | ||
response = rPost(f"EDM/{DBName}/Type", data=json.dumps(data)) | ||
return response.json() | ||
|
||
|
||
def cloneEDMData(DBName, Type, ID, shallow=[]): | ||
response = rGet(f"EDM/{DBName}/{Type}/{ID}/clone", params={"shallow": ' '.join(shallow)}) | ||
return response.json() | ||
|
||
|
||
def getSafeLinks(DBName, Type, ID, paths=[]): | ||
response = rGet(f"EDM/{DBName}/{Type}/{ID}/safe-links", params={"paths": ' '.join(paths)}) | ||
return response.json() | ||
|
||
|
||
def getEDMEntityIDs(DBName, Type, filter=None): | ||
response = rPut(f"EDM/{DBName}/{Type}/find", data=json.dumps({"filter": (filter if filter else {})})) | ||
return response.json() | ||
|
||
|
||
def uploadEDMBinaryFile(DBName, binary_data): | ||
response = rPost(f"EDM/{DBName}/blob/upload", files={"blob": binary_data}) | ||
return response.json() | ||
|
||
|
||
def getEDMBinaryFileByID(DBName, fid): | ||
response = rGet(f"EDM/{DBName}/blob/{fid}") | ||
d = response.headers['Content-Disposition'] | ||
filename = re.findall("filename=(.+)", d)[0] | ||
return response.content, filename | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.