Hi All,
In our development time, some times we need check output of some methods of Util class or service class. Say I want to view all documents of group in Lifray then Liferay provides you run your lines of code in control panel.
Go to Control Panel -> Server Administration -> Script and select Groovy for Java code.
Paste below lines of code to get all documents of group.
java.util.List<DLFileEntry> dlFileEntryList = com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil.getGroupFileEntries(10167, -1, -1);
for(com.liferay.portlet.documentlibrary.model.DLFileEntry fileEntry : dlFileEntryList){
out.println(fileEntry.getTitle());
In our development time, some times we need check output of some methods of Util class or service class. Say I want to view all documents of group in Lifray then Liferay provides you run your lines of code in control panel.
Go to Control Panel -> Server Administration -> Script and select Groovy for Java code.
Paste below lines of code to get all documents of group.
java.util.List<DLFileEntry> dlFileEntryList = com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil.getGroupFileEntries(10167, -1, -1);
for(com.liferay.portlet.documentlibrary.model.DLFileEntry fileEntry : dlFileEntryList){
out.println(fileEntry.getTitle());
}
Here 10167 is static value of group Id but you can get it the same way as above script.
Click on Execute button and it will run above code and it will show all document title in page.
Same way you can run and check the out put of any code but make sure to use Class or Object with full specified path like for DLFileEntry object I have used com.liferay.portlet.documentlibrary.model.DLFileEntry.
No comments:
Post a Comment