* map users : JAXR has concept of 'primary contact', which is a
* special designation for one of the users, and D6.1 seems to say
* that the first UDDI user is the primary contact
*/
Contacts cts = objectFactory.createContacts();
Contact[] carr = new Contact[0];
User primaryContact = organization.getPrimaryContact();
Collection<User> users = organization.getUsers();
// Expand array to necessary size only (xmlbeans does not like
// null items in cases like this)
int carrSize = 0;
if (primaryContact != null) {
carrSize += 1;
}
// TODO: Clean this up and make it more efficient
Iterator<User> it = users.iterator();
while (it.hasNext()) {
User u = (User) it.next();
if (u != primaryContact) {
carrSize++;
}
}
carr = new Contact[carrSize];
/*
* first do primary, and then filter that out in the loop
*/
if (primaryContact != null) {
Contact ct = getContactFromJAXRUser(primaryContact);
carr[0] = ct;
}
it = users.iterator();
int carrPos = 1;
while (it.hasNext()) {
User u = (User) it.next();
if (u != primaryContact) {
Contact ct = getContactFromJAXRUser(u);
carr[carrPos] = ct;
carrPos++;
}
}
bss.getBusinessService().addAll(Arrays.asList(barr));
if (carr.length>0) {
cts.getContact().addAll(Arrays.asList(carr));
biz.setContacts(cts);
}
biz.setBusinessServices(bss);
// External Links