From 58001e174ba2aa6f66e1a5389fb9951c20dbc474 Mon Sep 17 00:00:00 2001 From: jensp Date: Fri, 27 May 2011 06:53:12 +0000 Subject: [PATCH] =?UTF-8?q?Seiteneffekt=20der=20=C3=84nderung=20f=C3=BCr?= =?UTF-8?q?=20das=20Anzeigen=20von=20Contacts=20in=20OrganizationPanel=20(?= =?UTF-8?q?r935/r936)=20behoben=20(f=C3=BChrte=20zu=20fehlerhafter=20Ansic?= =?UTF-8?q?ht=20der=20Mitgliederliste)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@940 8810af33-2d31-482b-a856-94f89814c4df --- .../ui/GenericOrganizationalUnitPanel.java | 24 +++++++++----- .../london/terms/TermCategoryListener.java | 33 ++++++++++--------- 2 files changed, 33 insertions(+), 24 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 d3189aef0..bcfd3b9ce 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPanel.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPanel.java @@ -92,7 +92,7 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel { GenericContact contact; contact = contacts.getContact(); - generateContactXML(contact, + generateGenericContactXML(contact, contactsElem, state, Integer.toString(contacts.getContactOrder()), @@ -157,17 +157,13 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel { } } } - + protected void generateContactXML(final GenericContact contact, final Element parent, final PageState state, final String order, - final boolean withPerson) { - ContactXmlLGenerator generator = new ContactXmlLGenerator(contact); - - generator.generateXML(state, parent, order); - - /*Element contactElem = parent.newChildElement("contact"); + final boolean withPerson) { + Element contactElem = parent.newChildElement("contact"); contactElem.addAttribute("order", order); Element title = contactElem.newChildElement("title"); @@ -244,7 +240,17 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel { country.setText(address.getIsoCountryCode()); Element theState = addressElem.newChildElement("state"); theState.setText(address.getState()); - }*/ + } + } + + protected void generateGenericContactXML(final GenericContact contact, + final Element parent, + final PageState state, + final String order, + final boolean withPerson) { + ContactXmlLGenerator generator = new ContactXmlLGenerator(contact); + + generator.generateXML(state, parent, order); } @Override diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/TermCategoryListener.java b/ccm-ldn-terms/src/com/arsdigita/london/terms/TermCategoryListener.java index 0a4f253bd..ea0a2a099 100755 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/TermCategoryListener.java +++ b/ccm-ldn-terms/src/com/arsdigita/london/terms/TermCategoryListener.java @@ -34,17 +34,23 @@ import com.arsdigita.persistence.SessionManager; */ public class TermCategoryListener implements CategoryListener { - private static final Logger s_log = Logger.getLogger(TermCategoryListener.class); + private static final Logger s_log = Logger.getLogger( + TermCategoryListener.class); - public void onDelete(Category cat) {} + public void onDelete(Category cat) { + } - public void onAddChild(Category cat, Category child) {} + public void onAddChild(Category cat, Category child) { + } - public void onRemoveChild(Category cat, Category child) {} + public void onRemoveChild(Category cat, Category child) { + } - public void onMap(Category cat, ACSObject obj) {} + public void onMap(Category cat, ACSObject obj) { + } - public void onUnmap(Category cat, ACSObject obj) {} + public void onUnmap(Category cat, ACSObject obj) { + } /** * Create new term by hooking into setDefaultParent() category @@ -57,8 +63,8 @@ public class TermCategoryListener implements CategoryListener { */ public void onSetDefaultParent(Category cat, Category parent) { // Check whether a term already exists for this category. - DataCollection allTerms = SessionManager.getSession() - .retrieve(Term.BASE_DATA_OBJECT_TYPE); + DataCollection allTerms = SessionManager.getSession().retrieve( + Term.BASE_DATA_OBJECT_TYPE); allTerms.addEqualsFilter(Term.MODEL, cat.getID()); if (allTerms.next()) { s_log.debug("A term already exists for cat: " + cat); @@ -78,8 +84,8 @@ public class TermCategoryListener implements CategoryListener { return; } - DataCollection domains = SessionManager.getSession() - .retrieve(Domain.BASE_DATA_OBJECT_TYPE); + DataCollection domains = SessionManager.getSession().retrieve( + Domain.BASE_DATA_OBJECT_TYPE); domains.addEqualsFilter(Domain.MODEL, root.getID()); Domain termDomain = null; if (domains.next()) { @@ -98,12 +104,9 @@ public class TermCategoryListener implements CategoryListener { } Term.create(cat, - String.valueOf(maxID.intValue()+1), + String.valueOf(maxID.intValue() + 1), false, "", - termDomain - ); + termDomain); } - } -