Created
October 22, 2010 19:24
-
-
Save snooplsm/641212 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public List<SiteNode> findSites(Long surveyId) throws IOException, ApiException { | |
| HttpPost p = post(FIND_SITES, params(SURVEY_ID, surveyId)); | |
| HttpResponse response = client.execute(p); | |
| try { | |
| checkSecurity(response); | |
| List<SiteNode> nodes = mapper.readValue(response.getEntity().getContent(), TypeFactory.collectionType(List.class, SiteNode.class)); | |
| return nodes; | |
| } catch (Exception e) { | |
| throwIt(e); | |
| } | |
| return null; | |
| } | |
| package com.teachscape.dct; | |
| import java.io.Serializable; | |
| import org.codehaus.jackson.annotate.JsonProperty; | |
| public class SiteNode implements Serializable { | |
| private static final long serialVersionUID = 1L; | |
| @JsonProperty("id") | |
| private Long id; | |
| @JsonProperty("n") | |
| private String name; | |
| @JsonProperty("pid") | |
| private Long parentId; | |
| public Long getId() { | |
| return id; | |
| } | |
| public String getName() { | |
| return name; | |
| } | |
| public Long getParentId() { | |
| return parentId; | |
| } | |
| public void setId(Long id) { | |
| this.id = id; | |
| } | |
| public void setName(String name) { | |
| this.name = name; | |
| } | |
| public void setParentId(Long parentId) { | |
| this.parentId = parentId; | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment