Skip to content

Instantly share code, notes, and snippets.

@CorneAussems
Last active December 29, 2015 08:29
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 CorneAussems/7643615 to your computer and use it in GitHub Desktop.
Save CorneAussems/7643615 to your computer and use it in GitHub Desktop.
Liferay Groovy Script: find specific Journal Article's layout
import com.liferay.portlet.journal.service.JournalContentSearchLocalServiceUtil
import com.liferay.portal.service.LayoutLocalServiceUtil
groupid = new Long(17364)
truefalse = Boolean.TRUE
articleId= "1209617"
println(groupid +","+truefalse +","+ articleId)
articlesfound = JournalContentSearchLocalServiceUtil.getLayoutIdsCount(articleId );
println("articlesfound:"+articlesfound)
hitLayoutList = JournalContentSearchLocalServiceUtil.getLayoutIds(groupid, truefalse,articleId );
println(hitLayoutList.size()+" "+hitLayoutList)
for ( Long hitLayoutId : hitLayoutList){
println("hitLayoutId="+hitLayoutId)
layout = LayoutLocalServiceUtil.getLayout(groupid, truefalse, hitLayoutId.longValue());
println(layout)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment