ContactInfo contactInfo = factory.createContact();
@Test public void testGobalContactDefault() throws Exception { GeoServerInfo g1 = factory.createGlobal(); ContactInfo contact = factory.createContact(); g1.setContact(contact); ByteArrayOutputStream out = out(); persister.save(g1, out); ByteArrayInputStream in = in(out); Document dom = dom(in); Element e = (Element) dom.getElementsByTagName("contact").item(0); e.removeAttribute("class"); in = in(dom); GeoServerInfo g2 = persister.load(in, GeoServerInfo.class); assertEquals(g1, g2); }
g1.setCharset("ISO-8859-1"); ContactInfo contact = factory.createContact(); g1.setContact(contact); contact.setAddress("123");
@Override public SettingsInfo getObject() { if (info == null) { GeoServer gs = GeoServerApplication.get().getGeoServer(); info = gs.getFactory().createSettings(); // initialize from global settings SettingsInfo global = gs.getGlobal().getSettings(); // hack, we need to copy out composite objects separately to get around proxying // madness ContactInfo contact = gs.getFactory().createContact(); OwsUtils.copy(global.getContact(), contact, ContactInfo.class); OwsUtils.copy(global, info, SettingsInfo.class); info.setContact(contact); info.setWorkspace(wsModel.getObject()); } return info; } }
@Override public SettingsInfo getObject() { if (info == null) { GeoServer gs = GeoServerApplication.get().getGeoServer(); info = gs.getFactory().createSettings(); //initialize from global settings SettingsInfo global = gs.getGlobal().getSettings(); //hack, we need to copy out composite objects separately to get around proxying // madness ContactInfo contact = gs.getFactory().createContact(); OwsUtils.copy(global.getContact(), contact, ContactInfo.class); OwsUtils.copy(global, info, SettingsInfo.class); info.setContact(contact); info.setWorkspace(wsModel.getObject()); } return info; } }