Skip to content

Commit b96a7a7

Browse files
committed
SPR-5460: Add AtomView sample to PetClinic
1 parent ce83ebf commit b96a7a7

File tree

8 files changed

+401
-18
lines changed

8 files changed

+401
-18
lines changed

org.springframework.samples.petclinic/ivy.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
</publications>
2020

2121
<dependencies>
22+
<dependency org="com.sun.syndication" name="com.springsource.com.sun.syndication" rev="0.9.0" conf="compile->compile"/>
2223
<dependency org="javax.servlet" name="com.springsource.javax.servlet" rev="2.5.0" conf="provided->runtime"/>
2324
<dependency org="javax.servlet" name="com.springsource.javax.servlet.jsp.jstl" rev="1.1.2" conf="compile->runtime"/>
2425
<dependency org="org.apache.commons" name="com.springsource.org.apache.commons.logging" rev="1.1.1" conf="compile->compile"/>

org.springframework.samples.petclinic/petclinic.iml

Lines changed: 190 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,30 +76,41 @@
7676
<orderEntry type="module-library">
7777
<library>
7878
<CLASSES>
79-
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.4.0/com.springsource.org.junit-4.4.0.jar!/" />
79+
<root url="jar://$IVY_CACHE$/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-1.1.1.jar!/" />
8080
</CLASSES>
8181
<JAVADOC />
8282
<SOURCES>
83-
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.4.0/com.springsource.org.junit-sources-4.4.0.jar!/" />
83+
<root url="jar://$IVY_CACHE$/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-sources-1.1.1.jar!/" />
8484
</SOURCES>
8585
</library>
8686
</orderEntry>
87+
<orderEntry type="module" module-name="orm" />
8788
<orderEntry type="module-library">
8889
<library>
8990
<CLASSES>
90-
<root url="jar://$IVY_CACHE$/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-1.1.1.jar!/" />
91+
<root url="jar://$IVY_CACHE$/com.oracle.toplink.essentials/com.springsource.oracle.toplink.essentials/2.0.0.b41-beta2/com.springsource.oracle.toplink.essentials-2.0.0.b41-beta2.jar!/" />
9192
</CLASSES>
9293
<JAVADOC />
9394
<SOURCES>
94-
<root url="jar://$IVY_CACHE$/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-sources-1.1.1.jar!/" />
95+
<root url="jar://$IVY_CACHE$/com.oracle.toplink.essentials/com.springsource.oracle.toplink.essentials/2.0.0.b41-beta2/com.springsource.oracle.toplink.essentials-sources-2.0.0.b41-beta2.jar!/" />
9596
</SOURCES>
9697
</library>
9798
</orderEntry>
98-
<orderEntry type="module" module-name="orm" />
9999
<orderEntry type="module-library">
100100
<library>
101101
<CLASSES>
102-
<root url="jar://$IVY_CACHE$/org.aspectj/com.springsource.org.aspectj.weaver/1.5.4/com.springsource.org.aspectj.weaver-1.5.4.jar!/" />
102+
<root url="jar://$IVY_CACHE$/org.hibernate/com.springsource.org.hibernate/3.2.6.ga/com.springsource.org.hibernate-3.2.6.ga.jar!/" />
103+
</CLASSES>
104+
<JAVADOC />
105+
<SOURCES>
106+
<root url="jar://$IVY_CACHE$/org.hibernate/com.springsource.org.hibernate/3.2.6.ga/com.springsource.org.hibernate-sources-3.2.6.ga.jar!/" />
107+
</SOURCES>
108+
</library>
109+
</orderEntry>
110+
<orderEntry type="module-library">
111+
<library>
112+
<CLASSES>
113+
<root url="jar://$APPLICATION_HOME_DIR$/lib/j2ee.jar!/" />
103114
</CLASSES>
104115
<JAVADOC />
105116
<SOURCES />
@@ -108,43 +119,208 @@
108119
<orderEntry type="module-library">
109120
<library>
110121
<CLASSES>
111-
<root url="jar://$IVY_CACHE$/com.oracle.toplink.essentials/com.springsource.oracle.toplink.essentials/2.0.0.b41-beta2/com.springsource.oracle.toplink.essentials-2.0.0.b41-beta2.jar!/" />
122+
<root url="jar://$IVY_CACHE$/org.apache.taglibs/com.springsource.org.apache.taglibs.standard/1.1.2/com.springsource.org.apache.taglibs.standard-1.1.2.jar!/" />
123+
</CLASSES>
124+
<JAVADOC />
125+
<SOURCES />
126+
</library>
127+
</orderEntry>
128+
<orderEntry type="module-library">
129+
<library>
130+
<CLASSES>
131+
<root url="jar://$IVY_CACHE$/com.sun.syndication/com.springsource.com.sun.syndication/0.9.0/com.springsource.com.sun.syndication-0.9.0.jar!/" />
112132
</CLASSES>
113133
<JAVADOC />
114134
<SOURCES>
115-
<root url="jar://$IVY_CACHE$/com.oracle.toplink.essentials/com.springsource.oracle.toplink.essentials/2.0.0.b41-beta2/com.springsource.oracle.toplink.essentials-sources-2.0.0.b41-beta2.jar!/" />
135+
<root url="jar://$IVY_CACHE$/com.sun.syndication/com.springsource.com.sun.syndication/0.9.0/com.springsource.com.sun.syndication-sources-0.9.0.jar!/" />
116136
</SOURCES>
117137
</library>
118138
</orderEntry>
119139
<orderEntry type="module-library">
120140
<library>
121141
<CLASSES>
122-
<root url="jar://$IVY_CACHE$/org.hibernate/com.springsource.org.hibernate/3.2.6.ga/com.springsource.org.hibernate-3.2.6.ga.jar!/" />
142+
<root url="jar://$IVY_CACHE$/org.aspectj/com.springsource.org.aspectj.weaver/1.6.2.RELEASE/com.springsource.org.aspectj.weaver-1.6.2.RELEASE.jar!/" />
123143
</CLASSES>
124144
<JAVADOC />
125145
<SOURCES>
126-
<root url="jar://$IVY_CACHE$/org.hibernate/com.springsource.org.hibernate/3.2.6.ga/com.springsource.org.hibernate-sources-3.2.6.ga.jar!/" />
146+
<root url="jar://$IVY_CACHE$/org.aspectj/com.springsource.org.aspectj.weaver/1.6.2.RELEASE/com.springsource.org.aspectj.weaver-sources-1.6.2.RELEASE.jar!/" />
127147
</SOURCES>
128148
</library>
129149
</orderEntry>
130150
<orderEntry type="module-library">
131151
<library>
132152
<CLASSES>
133-
<root url="jar://$APPLICATION_HOME_DIR$/lib/j2ee.jar!/" />
153+
<root url="jar://$IVY_CACHE$/org.apache.commons/com.springsource.org.apache.commons.dbcp/1.2.2.osgi/com.springsource.org.apache.commons.dbcp-1.2.2.osgi.jar!/" />
134154
</CLASSES>
135155
<JAVADOC />
136-
<SOURCES />
156+
<SOURCES>
157+
<root url="jar://$IVY_CACHE$/org.apache.commons/com.springsource.org.apache.commons.dbcp/1.2.2.osgi/com.springsource.org.apache.commons.dbcp-sources-1.2.2.osgi.jar!/" />
158+
</SOURCES>
137159
</library>
138160
</orderEntry>
139161
<orderEntry type="module-library">
140162
<library>
141163
<CLASSES>
142-
<root url="jar://$IVY_CACHE$/org.apache.taglibs/com.springsource.org.apache.taglibs.standard/1.1.2/com.springsource.org.apache.taglibs.standard-1.1.2.jar!/" />
164+
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.5.0/com.springsource.org.junit-4.5.0.jar!/" />
143165
</CLASSES>
144166
<JAVADOC />
145-
<SOURCES />
167+
<SOURCES>
168+
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.5.0/com.springsource.org.junit-sources-4.5.0.jar!/" />
169+
</SOURCES>
146170
</library>
147171
</orderEntry>
148172
</component>
173+
<component name="copyright">
174+
<Base>
175+
<setting name="state" value="1" />
176+
</Base>
177+
<LanguageOptions name="HTML">
178+
<option name="templateOptions">
179+
<value>
180+
<option name="block" value="true" />
181+
<option name="separateBefore" value="false" />
182+
<option name="separateAfter" value="false" />
183+
<option name="prefixLines" value="true" />
184+
<option name="lenBefore" value="80" />
185+
<option name="lenAfter" value="80" />
186+
<option name="box" value="false" />
187+
<option name="filler" value=" " />
188+
</value>
189+
</option>
190+
<option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
191+
<option name="keyword" value="Copyright" />
192+
<option name="fileTypeOverride" value="1" />
193+
<option name="relativeBefore" value="true" />
194+
<option name="addBlankAfter" value="true" />
195+
<option name="fileLocation" value="1" />
196+
<option name="useAlternate" value="false" />
197+
</LanguageOptions>
198+
<LanguageOptions name="JAVA">
199+
<option name="templateOptions">
200+
<value>
201+
<option name="block" value="true" />
202+
<option name="separateBefore" value="false" />
203+
<option name="separateAfter" value="false" />
204+
<option name="prefixLines" value="true" />
205+
<option name="lenBefore" value="80" />
206+
<option name="lenAfter" value="80" />
207+
<option name="box" value="false" />
208+
<option name="filler" value=" " />
209+
</value>
210+
</option>
211+
<option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
212+
<option name="keyword" value="Copyright" />
213+
<option name="fileTypeOverride" value="2" />
214+
<option name="relativeBefore" value="true" />
215+
<option name="addBlankAfter" value="true" />
216+
<option name="fileLocation" value="1" />
217+
<option name="useAlternate" value="false" />
218+
</LanguageOptions>
219+
<LanguageOptions name="JSP">
220+
<option name="templateOptions">
221+
<value>
222+
<option name="block" value="true" />
223+
<option name="separateBefore" value="false" />
224+
<option name="separateAfter" value="false" />
225+
<option name="prefixLines" value="true" />
226+
<option name="lenBefore" value="80" />
227+
<option name="lenAfter" value="80" />
228+
<option name="box" value="false" />
229+
<option name="filler" value=" " />
230+
</value>
231+
</option>
232+
<option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
233+
<option name="keyword" value="Copyright" />
234+
<option name="fileTypeOverride" value="1" />
235+
<option name="relativeBefore" value="true" />
236+
<option name="addBlankAfter" value="true" />
237+
<option name="fileLocation" value="1" />
238+
<option name="useAlternate" value="false" />
239+
</LanguageOptions>
240+
<LanguageOptions name="JavaScript">
241+
<option name="templateOptions">
242+
<value>
243+
<option name="block" value="true" />
244+
<option name="separateBefore" value="false" />
245+
<option name="separateAfter" value="false" />
246+
<option name="prefixLines" value="true" />
247+
<option name="lenBefore" value="80" />
248+
<option name="lenAfter" value="80" />
249+
<option name="box" value="false" />
250+
<option name="filler" value=" " />
251+
</value>
252+
</option>
253+
<option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
254+
<option name="keyword" value="Copyright" />
255+
<option name="fileTypeOverride" value="1" />
256+
<option name="relativeBefore" value="true" />
257+
<option name="addBlankAfter" value="true" />
258+
<option name="fileLocation" value="1" />
259+
<option name="useAlternate" value="false" />
260+
</LanguageOptions>
261+
<LanguageOptions name="Properties">
262+
<option name="templateOptions">
263+
<value>
264+
<option name="block" value="true" />
265+
<option name="separateBefore" value="false" />
266+
<option name="separateAfter" value="false" />
267+
<option name="prefixLines" value="true" />
268+
<option name="lenBefore" value="80" />
269+
<option name="lenAfter" value="80" />
270+
<option name="box" value="false" />
271+
<option name="filler" value=" " />
272+
</value>
273+
</option>
274+
<option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
275+
<option name="keyword" value="Copyright" />
276+
<option name="fileTypeOverride" value="1" />
277+
<option name="relativeBefore" value="true" />
278+
<option name="addBlankAfter" value="true" />
279+
<option name="fileLocation" value="1" />
280+
<option name="useAlternate" value="false" />
281+
</LanguageOptions>
282+
<LanguageOptions name="XML">
283+
<option name="templateOptions">
284+
<value>
285+
<option name="block" value="true" />
286+
<option name="separateBefore" value="false" />
287+
<option name="separateAfter" value="false" />
288+
<option name="prefixLines" value="true" />
289+
<option name="lenBefore" value="80" />
290+
<option name="lenAfter" value="80" />
291+
<option name="box" value="false" />
292+
<option name="filler" value=" " />
293+
</value>
294+
</option>
295+
<option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
296+
<option name="keyword" value="Copyright" />
297+
<option name="fileTypeOverride" value="1" />
298+
<option name="relativeBefore" value="true" />
299+
<option name="addBlankAfter" value="true" />
300+
<option name="fileLocation" value="1" />
301+
<option name="useAlternate" value="false" />
302+
</LanguageOptions>
303+
<LanguageOptions name="__TEMPLATE__">
304+
<option name="templateOptions">
305+
<value>
306+
<option name="block" value="true" />
307+
<option name="separateBefore" value="false" />
308+
<option name="separateAfter" value="false" />
309+
<option name="prefixLines" value="true" />
310+
<option name="lenBefore" value="80" />
311+
<option name="lenAfter" value="80" />
312+
<option name="box" value="false" />
313+
<option name="filler" value=" " />
314+
</value>
315+
</option>
316+
<option name="notice" value="Copyright 2002-&amp;#36;today.year the original author or authors.&#10;&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10; http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License." />
317+
<option name="keyword" value="Copyright" />
318+
<option name="fileTypeOverride" value="4" />
319+
<option name="relativeBefore" value="true" />
320+
<option name="addBlankAfter" value="true" />
321+
<option name="fileLocation" value="1" />
322+
<option name="useAlternate" value="false" />
323+
</LanguageOptions>
324+
</component>
149325
</module>
150326

org.springframework.samples.petclinic/src/main/java/org/springframework/samples/petclinic/Visit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public Pet getPet() {
6363
/** Setter for property pet.
6464
* @param pet New value of property pet.
6565
*/
66-
protected void setPet(Pet pet) {
66+
public void setPet(Pet pet) {
6767
this.pet = pet;
6868
}
6969

org.springframework.samples.petclinic/src/main/java/org/springframework/samples/petclinic/web/ClinicController.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import org.springframework.samples.petclinic.Clinic;
66
import org.springframework.stereotype.Controller;
77
import org.springframework.ui.ModelMap;
8-
import org.springframework.web.bind.annotation.RequestMapping;
98
import org.springframework.web.bind.annotation.PathVariable;
9+
import org.springframework.web.bind.annotation.RequestMapping;
10+
import org.springframework.web.bind.annotation.RequestMethod;
1011
import org.springframework.web.servlet.ModelAndView;
1112

1213
/**
@@ -42,8 +43,8 @@ public void welcomeHandler() {
4243

4344
/**
4445
* Custom handler for displaying vets.
45-
* <p>
46-
* Note that this handler returns a plain {@link ModelMap} object instead of
46+
*
47+
* <p>Note that this handler returns a plain {@link ModelMap} object instead of
4748
* a ModelAndView, thus leveraging convention-based model attribute names.
4849
* It relies on the RequestToViewNameTranslator to determine the logical
4950
* view name based on the request URL: "/vets.do" -&gt; "vets".
@@ -68,4 +69,17 @@ public ModelAndView ownerHandler(@PathVariable("ownerId") int ownerId) {
6869
return mav;
6970
}
7071

72+
/**
73+
* Custom handler for displaying an list of visits.
74+
*
75+
* @param petId the ID of the pet whose visits to display
76+
* @return a ModelMap with the model attributes for the view
77+
*/
78+
@RequestMapping(value="/owners/*/pets/{petId}/visits", method=RequestMethod.GET)
79+
public ModelAndView visitsHandler(@PathVariable int petId) {
80+
ModelAndView mav = new ModelAndView("visits");
81+
mav.addObject("visits", this.clinic.loadPet(petId).getVisits());
82+
return mav;
83+
}
84+
7185
}

0 commit comments

Comments
 (0)