varun pradeep shah 10 Years Ago It is really good. Thanks for your contribution. Please sign in to reply. Reply as... Cancel
Jerry Smith 9 Years Ago Thanks for this; it really helped me do what I wanted in Java. One thing I had to research by searching through source code (wish the javadocs were better) that might be helpful to someone: the -1 you pass into the call file.getFileVersions is checked against "WorkflowConstants.STATUS_ANY" to get versions with any status. I modified my code to use the constant to make it more clear since it won't just be a script. Please sign in to reply. Reply as... Cancel
Thiago Leão Moreira 9 Years Ago Awesome script Mitesh! Thanks for sharing Please sign in to reply. Reply as... Cancel
Ramalingaiah. D 7 Years Ago It is really good...................... Please sign in to reply. Reply as... Cancel
Taruchit Goyal 5 Years Ago Hello Sir, I tried executing some part of your script, but it did not gave any results: - import com.liferay.portal.model.User; import com.liferay.portal.service.UserLocalServiceUtil; import java.util.List; import com.liferay.portal.kernel.repository.model.FileEntry; import com.liferay.portal.kernel.repository.model.FileVersion; import com.liferay.portal.kernel.repository.model.Folder; import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil; import com.liferay.portlet.documentlibrary.service.DLFileVersionLocalServiceUtil; import com.liferay.portlet.documentlibrary.model.DLFileVersion; // Param1: Group ID // Param2: Folder ID try{ listFiles(Group ID, Folder ID); def listFiles(Group ID, Folder ID) { allfiles = DLAppServiceUtil.getFileEntries(Group ID,Folder ID) for (FileEntry file:allfiles) { System.out.println("File Title: " + file.getTitle()); System.out.println("File Version: " + file.getVersion()); } } }catch(e){ out.println("""<div class="portlet-msg-error">${e}</div>"""); e.printStackTrace(out); } I had replaced the parameters with actual values, and tried to see records are returned along with version. Please suggest the modifications required to correct the code. Regards Taruchit Goyal Please sign in to reply. Reply as... Cancel