place.setDisplayNameComputed(displayNameComputed);
/* TODO - think about how much to support. This approach to the client
* does not scale! We should really favor the document/payload approach. */
- if((value = (String)placeInfo.get(PlaceJAXBSchema.NAME))!=null) {
+ if((value = (String)placeInfo.get(PlaceJAXBSchema.PLACE_NAME))!=null) {
PlaceNameGroupList placeNameGroupList = new PlaceNameGroupList();
List<PlaceNameGroup> placeNameGroups = placeNameGroupList.getPlaceNameGroup();
PlaceNameGroup placeNameGroup = new PlaceNameGroup();
- placeNameGroup.setName(value);
+ placeNameGroup.setPlaceName(value);
placeNameGroups.add(placeNameGroup);
place.setPlaceNameGroupList(placeNameGroupList);
}
/* Could try to pull name out of first placeNameGroup
displayName =
prepareDefaultDisplayName(
- placeMap.get(PlaceJAXBSchema.NAME));
+ placeMap.get(PlaceJAXBSchema.PLACE_NAME));
*/
}
* @see PlaceAuthorityDocumentModelHandler.prepareDefaultDisplayName() which
* duplicates this logic, until we define a service-general utils package
* that is neither client nor service specific.
- * @param name
+ * @param placeName
* @return a display name
*/
public static String prepareDefaultDisplayName(
- String name ) {
+ String placeName ) {
StringBuilder newStr = new StringBuilder();
- newStr.append(name);
+ newStr.append(placeName);
return newStr.toString();
}
// TODO Make place type and status be controlled vocabs.
sanjoseMap.put(PlaceJAXBSchema.DISPLAY_NAME, TEST_DNAME);
sanjoseMap.put(PlaceJAXBSchema.SHORT_IDENTIFIER, TEST_SHORTID);
- sanjoseMap.put(PlaceJAXBSchema.NAME, TEST_NAME);
+ sanjoseMap.put(PlaceJAXBSchema.PLACE_NAME, TEST_NAME);
sanjoseMap.put(PlaceJAXBSchema.NOTE, TEST_NOTE);
sanjoseMap.put(PlaceJAXBSchema.SOURCE, TEST_SOURCE);
sanjoseMap.put(PlaceJAXBSchema.SOURCE_PAGE, TEST_SOURCE_PAGE);
List<PlaceNameGroup> placeNameGroups = placeNameGroupList.getPlaceNameGroup();
Assert.assertNotNull(placeNameGroups);
Assert.assertTrue(placeNameGroups.size() > 0);
- String name = placeNameGroups.get(0).getName();
- Assert.assertNotNull(name);
+ String placeName = placeNameGroups.get(0).getPlaceName();
+ Assert.assertNotNull(placeName);
// Update the contents of this resource.
final String PLACE_NAME_ADDITION = "verify-item-place-name-updated";
- placeNameGroups.get(0).setName(PLACE_NAME_ADDITION + TEST_NAME);
+ placeNameGroups.get(0).setPlaceName(PLACE_NAME_ADDITION + TEST_NAME);
place.setPlaceNameGroupList(placeNameGroupList);
if (logger.isDebugEnabled()) {
logger.debug("to be updated Place");
@Override
protected PlacesCommon updateItemInstance(PlacesCommon placesCommon) {
- // Get the Name field from the resource passed in
+ // Get the placeName field from the resource passed in
PlaceNameGroupList placeNameGroupList = placesCommon.getPlaceNameGroupList();
Assert.assertNotNull(placeNameGroupList);
List<PlaceNameGroup> placeNameGroups = placeNameGroupList.getPlaceNameGroup();
Assert.assertNotNull(placeNameGroups);
Assert.assertTrue(placeNameGroups.size() > 0);
- String originalName = placeNameGroups.get(0).getName();
- Assert.assertNotNull(originalName);
+ String originalPlaceName = placeNameGroups.get(0).getPlaceName();
+ Assert.assertNotNull(originalPlaceName);
// Update the contents of the new resource based on original value
PlaceNameGroupList updatedPlaceNameGroupList = new PlaceNameGroupList();
List<PlaceNameGroup> updatedPlaceNameGroups = updatedPlaceNameGroupList.getPlaceNameGroup();
PlaceNameGroup updatedPlaceNameGroup = new PlaceNameGroup();
- updatedPlaceNameGroup.setName("updated-" + originalName);
+ updatedPlaceNameGroup.setPlaceName("updated-" + originalPlaceName);
updatedPlaceNameGroups.add(updatedPlaceNameGroup);
PlacesCommon result = new PlacesCommon();
result.setPlaceNameGroupList(updatedPlaceNameGroupList);
protected void compareUpdatedItemInstances(PlacesCommon original,
PlacesCommon updated) throws Exception {
- // Get the Name fields each resource passed in
+ // Get the placeName fields each resource passed in
PlaceNameGroupList placeNameGroupList = original.getPlaceNameGroupList();
Assert.assertNotNull(placeNameGroupList);
List<PlaceNameGroup> placeNameGroups = placeNameGroupList.getPlaceNameGroup();
Assert.assertNotNull(placeNameGroups);
Assert.assertTrue(placeNameGroups.size() > 0);
- String originalName = placeNameGroups.get(0).getName();
- Assert.assertNotNull(originalName);
+ String originalPlaceName = placeNameGroups.get(0).getPlaceName();
+ Assert.assertNotNull(originalPlaceName);
PlaceNameGroupList updatedPlaceNameGroupList = updated.getPlaceNameGroupList();
Assert.assertNotNull(updatedPlaceNameGroupList);
List<PlaceNameGroup> updatedPlaceNameGroups = updatedPlaceNameGroupList.getPlaceNameGroup();
Assert.assertNotNull(updatedPlaceNameGroups);
Assert.assertTrue(updatedPlaceNameGroups.size() > 0);
- String updatedName = updatedPlaceNameGroups.get(0).getName();
- Assert.assertNotNull(updatedName);
+ String updatedPlaceName = updatedPlaceNameGroups.get(0).getPlaceName();
+ Assert.assertNotNull(updatedPlaceName);
- Assert.assertEquals(updatedName, originalName,
+ Assert.assertEquals(updatedPlaceName, originalPlaceName,
"Data in updated Place did not match submitted data.");
}
protected PoxPayloadOut createNonExistenceItemInstance(
String commonPartName, String identifier) {
Map<String, String> nonexMap = new HashMap<String,String>();
- nonexMap.put(PlaceJAXBSchema.NAME, TEST_NAME);
+ nonexMap.put(PlaceJAXBSchema.PLACE_NAME, TEST_NAME);
nonexMap.put(PlaceJAXBSchema.SHORT_IDENTIFIER, "nonEx");
nonexMap.put(PlaceJAXBSchema.PLACE_TYPE, TEST_PLACE_TYPE);
nonexMap.put(PlaceJAXBSchema.TERM_STATUS, TEST_STATUS);
shortDisplayNameComputed = true;
if (displayNameComputed || shortDisplayNameComputed) {
// Obtain the primary place name from the list of place names, for computing the display name.
- String xpathToName = PlaceJAXBSchema.PLACE_NAME_GROUP_LIST
- + "/[0]/" + PlaceJAXBSchema.NAME;
- String name = getXPathStringValue(docModel, COMMON_PART_LABEL, xpathToName);
- String displayName = prepareDefaultDisplayName(name);
+ String xpathToPlaceName = PlaceJAXBSchema.PLACE_NAME_GROUP_LIST
+ + "/[0]/" + PlaceJAXBSchema.PLACE_NAME;
+ String placeName = getXPathStringValue(docModel, COMMON_PART_LABEL, xpathToPlaceName);
+ String displayName = prepareDefaultDisplayName(placeName);
if (displayNameComputed) {
docModel.setProperty(commonPartLabel, PlaceJAXBSchema.DISPLAY_NAME,
displayName);
* @see PlaceAuthorityClientUtils.prepareDefaultDisplayName() which
* duplicates this logic, until we define a service-general utils package
* that is neither client nor service specific.
- * @param name
+ * @param placeName
* @return the default display name
* @throws Exception
*/
private static String prepareDefaultDisplayName(
- String name ) throws Exception {
+ String placeName ) throws Exception {
StringBuilder newStr = new StringBuilder();
- newStr.append(name);
+ newStr.append(placeName);
return newStr.toString();
}