Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
synergy-api-util
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raimbek Egemberdiev
synergy-api-util
Commits
3db1986a
Commit
3db1986a
authored
Jan 30, 2017
by
Raimbek Egemberdiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new types and services
parent
f6d27a3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
src/main/java/kz/arta/synergy/api/JsonUtils.java
src/main/java/kz/arta/synergy/api/JsonUtils.java
+10
-0
src/main/java/kz/arta/synergy/api/asforms/AsFormService.java
src/main/java/kz/arta/synergy/api/asforms/AsFormService.java
+8
-0
No files found.
src/main/java/kz/arta/synergy/api/JsonUtils.java
View file @
3db1986a
...
...
@@ -40,4 +40,14 @@ public class JsonUtils {
public
static
String
getValueByKey
(
String
jsonData
,
String
key
)
throws
IOException
{
return
MAPPER
.
readTree
(
jsonData
).
path
(
key
).
getTextValue
();
}
public
static
String
getValueByPath
(
String
jsonData
,
String
path
)
throws
IOException
{
String
[]
pathArray
=
path
.
split
(
"\\."
);
JsonNode
jsonNode
=
MAPPER
.
readTree
(
jsonData
);
for
(
String
pathItem
:
pathArray
)
{
jsonNode
=
jsonNode
.
path
(
pathItem
);
}
return
jsonNode
.
getTextValue
();
}
}
src/main/java/kz/arta/synergy/api/asforms/AsFormService.java
View file @
3db1986a
...
...
@@ -172,4 +172,12 @@ public class AsFormService {
String
result
=
restHttpQuery
.
doQuery
(
query
);
return
JsonUtils
.
read
(
result
,
AsFormDefinition
.
class
);
}
public
String
getDocumentIdByDataUuid
(
String
dataUuid
)
throws
IOException
{
Query
query
=
Query
.
newInstance
()
.
url
(
"/rest/api/asforms/data/document"
)
.
queryParam
(
"dataUUID"
,
dataUuid
);
String
result
=
restHttpQuery
.
doQuery
(
query
);
return
JsonUtils
.
getValueByPath
(
result
,
dataUuid
+
".documentID"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment