Seiteneffekt der Änderung für das Anzeigen von Contacts in OrganizationPanel (r935/r936) behoben (führte zu fehlerhafter Ansicht der Mitgliederliste)

git-svn-id: https://svn.libreccm.org/ccm/trunk@940 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2011-05-27 06:53:12 +00:00
parent 71fc621f8d
commit 58001e174b
2 changed files with 33 additions and 24 deletions

View File

@ -92,7 +92,7 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel {
GenericContact contact; GenericContact contact;
contact = contacts.getContact(); contact = contacts.getContact();
generateContactXML(contact, generateGenericContactXML(contact,
contactsElem, contactsElem,
state, state,
Integer.toString(contacts.getContactOrder()), Integer.toString(contacts.getContactOrder()),
@ -163,11 +163,7 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel {
final PageState state, final PageState state,
final String order, final String order,
final boolean withPerson) { final boolean withPerson) {
ContactXmlLGenerator generator = new ContactXmlLGenerator(contact); Element contactElem = parent.newChildElement("contact");
generator.generateXML(state, parent, order);
/*Element contactElem = parent.newChildElement("contact");
contactElem.addAttribute("order", order); contactElem.addAttribute("order", order);
Element title = contactElem.newChildElement("title"); Element title = contactElem.newChildElement("title");
@ -244,7 +240,17 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel {
country.setText(address.getIsoCountryCode()); country.setText(address.getIsoCountryCode());
Element theState = addressElem.newChildElement("state"); Element theState = addressElem.newChildElement("state");
theState.setText(address.getState()); 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 @Override

View File

@ -34,17 +34,23 @@ import com.arsdigita.persistence.SessionManager;
*/ */
public class TermCategoryListener implements CategoryListener { 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 * Create new term by hooking into setDefaultParent() category
@ -57,8 +63,8 @@ public class TermCategoryListener implements CategoryListener {
*/ */
public void onSetDefaultParent(Category cat, Category parent) { public void onSetDefaultParent(Category cat, Category parent) {
// Check whether a term already exists for this category. // Check whether a term already exists for this category.
DataCollection allTerms = SessionManager.getSession() DataCollection allTerms = SessionManager.getSession().retrieve(
.retrieve(Term.BASE_DATA_OBJECT_TYPE); Term.BASE_DATA_OBJECT_TYPE);
allTerms.addEqualsFilter(Term.MODEL, cat.getID()); allTerms.addEqualsFilter(Term.MODEL, cat.getID());
if (allTerms.next()) { if (allTerms.next()) {
s_log.debug("A term already exists for cat: " + cat); s_log.debug("A term already exists for cat: " + cat);
@ -78,8 +84,8 @@ public class TermCategoryListener implements CategoryListener {
return; return;
} }
DataCollection domains = SessionManager.getSession() DataCollection domains = SessionManager.getSession().retrieve(
.retrieve(Domain.BASE_DATA_OBJECT_TYPE); Domain.BASE_DATA_OBJECT_TYPE);
domains.addEqualsFilter(Domain.MODEL, root.getID()); domains.addEqualsFilter(Domain.MODEL, root.getID());
Domain termDomain = null; Domain termDomain = null;
if (domains.next()) { if (domains.next()) {
@ -98,12 +104,9 @@ public class TermCategoryListener implements CategoryListener {
} }
Term.create(cat, Term.create(cat,
String.valueOf(maxID.intValue()+1), String.valueOf(maxID.intValue() + 1),
false, false,
"", "",
termDomain termDomain);
);
} }
} }