}
}
public JSONObject listViews( String user ) {
ISimplePersistence sp;
JSONObject obj = new JSONObject();
JSONArray arr = new JSONArray();
try {
sp = getSimplePersistence();
Filter filter = new Filter();
filter.where( "user" ).equalTo( user );
List<View> views = sp.load( View.class, filter );
for ( View v : views ) {
arr.put( v.toJSON() );
}
} catch ( Exception e ) {
logger.warn( "Exception while writing result to json array", e );