Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save austinchiang/41ff57854ca3e93890da0cde29d4270f to your computer and use it in GitHub Desktop.
Save austinchiang/41ff57854ca3e93890da0cde29d4270f to your computer and use it in GitHub Desktop.
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