Kontakte im einem OrganizationPanel werden jetzt mit Hilfe des SimpleXMLGenerators gerendert, so dass hier exakt der gleiche XML-Output für die Kontakte entsteht wie für anderen Stellen.
git-svn-id: https://svn.libreccm.org/ccm/trunk@935 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
404804a6d9
commit
000f1dd782
|
|
@ -30,6 +30,7 @@ import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection
|
||||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitPersonCollection;
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitPersonCollection;
|
||||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.cms.contenttypes.GenericPersonContactCollection;
|
import com.arsdigita.cms.contenttypes.GenericPersonContactCollection;
|
||||||
|
import com.arsdigita.cms.dispatcher.SimpleXMLGenerator;
|
||||||
import com.arsdigita.xml.Element;
|
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_CONTACTS = "contacts";
|
||||||
public static final String SHOW_MEMBERS = "members";
|
public static final String SHOW_MEMBERS = "members";
|
||||||
|
|
||||||
private boolean displayContacts = true;
|
private boolean displayContacts = true;
|
||||||
private boolean displayMembers = true;
|
private boolean displayMembers = true;
|
||||||
|
|
||||||
|
|
@ -163,7 +163,11 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel {
|
||||||
final PageState state,
|
final PageState state,
|
||||||
final String order,
|
final String order,
|
||||||
final boolean withPerson) {
|
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);
|
contactElem.addAttribute("order", order);
|
||||||
|
|
||||||
Element title = contactElem.newChildElement("title");
|
Element title = contactElem.newChildElement("title");
|
||||||
|
|
@ -240,7 +244,7 @@ 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());
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -270,4 +274,19 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel {
|
||||||
generateMembersXML(orga, content, state);
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue