Created
April 19, 2021 06:07
-
-
Save austinchiang/41ff57854ca3e93890da0cde29d4270f to your computer and use it in GitHub Desktop.
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
macro getBlogEntry { | |
if (!(isSet(site))) { | |
var site = "true"; | |
} | |
var groupId = JSONGroupAPI._getGroupIdByName(groupName = "${groupName}", site = "${site}"); | |
var curl = ''' | |
http://localhost:8080/api/jsonws/blogs.blogsentry/get-entry \ | |
-u test@liferay.com:test \ | |
-d groupId=20125 \ | |
-d urlTitle='Blogs-Entry-With-Small-Image' | |
'''; | |
echo("## * Title: ${entryTitle}"); | |
echo("## * Original: ${curl}"); | |
var entryId = JSONCurlUtil.get("${curl}", "$.[?(@['title'] == '${title}')]['entryId']"); | |
var entryId = StringUtil.replace("${entryId}", "["", ""); | |
var entryId = StringUtil.replace("${entryId}", ""]", ""); | |
echo("## * Blogs ID: ${entryId}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment