org.springframework.samples.petclinic.model.Vets Java Examples

The following examples show how to use org.springframework.samples.petclinic.model.Vets. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VetsAtomView.java    From docker-workflow-plugin with MIT License 6 votes vote down vote up
@Override
protected List<Entry> buildFeedEntries(Map<String, Object> model,
                                       HttpServletRequest request, HttpServletResponse response) throws Exception {

    Vets vets = (Vets) model.get("vets");
    List<Vet> vetList = vets.getVetList();
    List<Entry> entries = new ArrayList<Entry>(vetList.size());

    for (Vet vet : vetList) {
        Entry entry = new Entry();
        // see http://diveintomark.org/archives/2004/05/28/howto-atom-id#other
        entry.setId(String.format("tag:springsource.org,%s", vet.getId()));
        entry.setTitle(String.format("Vet: %s %s", vet.getFirstName(), vet.getLastName()));
        //entry.setUpdated(visit.getDate().toDate());

        Content summary = new Content();
        summary.setValue(vet.getSpecialties().toString());
        entry.setSummary(summary);

        entries.add(entry);
    }
    response.setContentType("blabla");
    return entries;

}
 
Example #2
Source File: VetsAtomView.java    From audit4j-demo with Apache License 2.0 6 votes vote down vote up
@Override
protected List<Entry> buildFeedEntries(Map<String, Object> model,
                                       HttpServletRequest request, HttpServletResponse response) throws Exception {

    Vets vets = (Vets) model.get("vets");
    List<Vet> vetList = vets.getVetList();
    List<Entry> entries = new ArrayList<Entry>(vetList.size());

    for (Vet vet : vetList) {
        Entry entry = new Entry();
        // see http://diveintomark.org/archives/2004/05/28/howto-atom-id#other
        entry.setId(String.format("tag:springsource.org,%s", vet.getId()));
        entry.setTitle(String.format("Vet: %s %s", vet.getFirstName(), vet.getLastName()));
        //entry.setUpdated(visit.getDate().toDate());

        Content summary = new Content();
        summary.setValue(vet.getSpecialties().toString());
        entry.setSummary(summary);

        entries.add(entry);
    }
    response.setContentType("blabla");
    return entries;

}
 
Example #3
Source File: VetController.java    From DevOps-for-Web-Development with MIT License 5 votes vote down vote up
@RequestMapping(value = {"/vets.xml", "/vets.html"})
public String showVetList(Map<String, Object> model) {
    // Here we are returning an object of type 'Vets' rather than a collection of Vet objects
    // so it is simpler for Object-Xml mapping
    Vets vets = new Vets();
    vets.getVetList().addAll(this.clinicService.findVets());
    model.put("vets", vets);
    return "vets/vetList";
}
 
Example #4
Source File: VetController.java    From DevOps-for-Web-Development with MIT License 5 votes vote down vote up
@RequestMapping("/vets.json")
public
@ResponseBody
Vets showResourcesVetList() {
    // Here we are returning an object of type 'Vets' rather than a collection of Vet objects
    // so it is simpler for JSon/Object mapping
    Vets vets = new Vets();
    vets.getVetList().addAll(this.clinicService.findVets());
    return vets;
}
 
Example #5
Source File: VetController.java    From DevOps-for-Web-Development with MIT License 5 votes vote down vote up
@RequestMapping(value = { "/vets.html"})
public String showVetList(Map<String, Object> model) {
    // Here we are returning an object of type 'Vets' rather than a collection of Vet objects
    // so it is simpler for Object-Xml mapping
    Vets vets = new Vets();
    vets.getVetList().addAll(this.clinicService.findVets());
    model.put("vets", vets);
    return "vets/vetList";
}
 
Example #6
Source File: VetController.java    From DevOps-for-Web-Development with MIT License 5 votes vote down vote up
@RequestMapping(value = { "/vets.json", "/vets.xml"})
public
@ResponseBody
Vets showResourcesVetList() {
    // Here we are returning an object of type 'Vets' rather than a collection of Vet objects
    // so it is simpler for JSon/Object mapping
    Vets vets = new Vets();
    vets.getVetList().addAll(this.clinicService.findVets());
    return vets;
}
 
Example #7
Source File: VetController.java    From docker-workflow-plugin with MIT License 5 votes vote down vote up
@RequestMapping("/vets")
public String showVetList(Map<String, Object> model) {
    // Here we are returning an object of type 'Vets' rather than a collection of Vet objects 
    // so it is simpler for Object-Xml mapping
    Vets vets = new Vets();
    vets.getVetList().addAll(this.clinicService.findVets());
    model.put("vets", vets);
    return "vets/vetList";
}
 
Example #8
Source File: VetController.java    From audit4j-demo with Apache License 2.0 5 votes vote down vote up
@RequestMapping("/vets")
public String showVetList(Map<String, Object> model) {
    // Here we are returning an object of type 'Vets' rather than a collection of Vet objects 
    // so it is simpler for Object-Xml mapping
    Vets vets = new Vets();
    vets.getVetList().addAll(this.clinicService.findVets());
    model.put("vets", vets);
    return "vets/vetList";
}