/**
* Returns XML for list of users.
*/
protected Document getUsers() throws ServletException, IOException {
IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class );
Element rootElement = new DefaultElement( "users" );
Document doc = DocumentHelper.createDocument( rootElement );
if ( service != null ) {
List users = service.getAllUsers();
for ( Iterator usersIterator = users.iterator(); usersIterator.hasNext(); ) {
String username = usersIterator.next().toString();
if ( ( null != username ) && ( username.length() > 0 ) ) {
rootElement.addElement( "user" ).addCDATA( username );
}
}
}
return doc;
}