From 000f1dd78296323d94c0d71942a0d25c19d2c5bf Mon Sep 17 00:00:00 2001 From: jensp Date: Tue, 24 May 2011 05:29:59 +0000 Subject: [PATCH] =?UTF-8?q?Kontakte=20im=20einem=20OrganizationPanel=20wer?= =?UTF-8?q?den=20jetzt=20mit=20Hilfe=20des=20SimpleXMLGenerators=20gerende?= =?UTF-8?q?rt,=20so=20dass=20hier=20exakt=20der=20gleiche=20XML-Output=20f?= =?UTF-8?q?=C3=BCr=20die=20Kontakte=20entsteht=20wie=20f=C3=BCr=20anderen?= =?UTF-8?q?=20Stellen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@935 8810af33-2d31-482b-a856-94f89814c4df --- .../ui/GenericOrganizationalUnitPanel.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPanel.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPanel.java index e4af3f7ae..d3189aef0 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPanel.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPanel.java @@ -30,6 +30,7 @@ import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitPersonCollection; import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.GenericPersonContactCollection; +import com.arsdigita.cms.dispatcher.SimpleXMLGenerator; import com.arsdigita.xml.Element; /** @@ -40,7 +41,6 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel { public static final String SHOW_CONTACTS = "contacts"; public static final String SHOW_MEMBERS = "members"; - private boolean displayContacts = true; private boolean displayMembers = true; @@ -163,7 +163,11 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel { final PageState state, final String order, final boolean withPerson) { - Element contactElem = parent.newChildElement("contact"); + ContactXmlLGenerator generator = new ContactXmlLGenerator(contact); + + generator.generateXML(state, parent, order); + + /*Element contactElem = parent.newChildElement("contact"); contactElem.addAttribute("order", order); Element title = contactElem.newChildElement("title"); @@ -230,7 +234,7 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel { Element addressElem = contactElem.newChildElement( "address"); Element postalCode = addressElem.newChildElement( - "postalCode"); + "postalCode"); postalCode.setText(address.getPostalCode()); Element city = addressElem.newChildElement("city"); city.setText(address.getCity()); @@ -240,7 +244,7 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel { country.setText(address.getIsoCountryCode()); Element theState = addressElem.newChildElement("state"); theState.setText(address.getState()); - } + }*/ } @Override @@ -270,4 +274,19 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel { generateMembersXML(orga, content, state); } } + + private class ContactXmlLGenerator extends SimpleXMLGenerator { + + private GenericContact contact; + + public ContactXmlLGenerator(final GenericContact contact) { + super(); + this.contact = contact; + } + + @Override + protected ContentItem getContentItem(PageState state) { + return contact; + } + } }