Skip to content

Instantly share code, notes, and snippets.

@slemarchand
Created May 12, 2013 23:00
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 slemarchand/5565281 to your computer and use it in GitHub Desktop.
Save slemarchand/5565281 to your computer and use it in GitHub Desktop.
import com.liferay.portal.service.*
import com.liferay.portal.kernel.dao.orm.*
// Output management
final def SCRIPT_ID = "MYSCRIPT"
outputFile = new File("""${System.getProperty("liferay.home")}/scripting/out-${SCRIPT_ID}.txt""")
outputFile.getParentFile().mkdirs()
def trace(message) {
out.println(message)
outputFile << "${message}\n"
}
// Main code
users = UserLocalServiceUtil.getUsers(QueryUtil.ALL_POS, QueryUtil.ALL_POS)
users.each { u ->
trace(u.getFullName())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment