I am using Asset Publisher and need to dynamically get the articleId of the latest journal article published.
I am using in abstracts.jsp hook:
version=JournalArticleLocalServiceUtil.getLatestVersion(assetRenderer.getGroupId(), "14405");
journalArticle = JournalArticleLocalServiceUtil.getArticle(assetRenderer.getGroupId() , "14405",version);
I have hardcoded the articleId here.
How do I avoid this??
Kindly help.
Thanks.
Use a dynamic query to get the latest Article from
JournalArticleLocalServiceUtilmaybe you can useProjectionFactoryUtil.max("createDate");to get the latest Date