git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/branches/REL_2@3358
cb58f699-b61c-0410-a6fe-
9272a202ed29
delete m_org;
delete m_entityAttrs;
for_each(m_contacts.begin(), m_contacts.end(), xmltooling::cleanup<ContactPerson>());
delete m_org;
delete m_entityAttrs;
for_each(m_contacts.begin(), m_contacts.end(), xmltooling::cleanup<ContactPerson>());
+ for_each(m_formats.begin(), m_formats.end(), xmltooling::cleanup<NameIDFormat>());
for_each(m_reqAttrs.begin(), m_reqAttrs.end(), xmltooling::cleanup<RequestedAttribute>());
for_each(m_attrConsumers.begin(), m_attrConsumers.end(), xmltooling::cleanup<AttributeConsumingService>());
#endif
for_each(m_reqAttrs.begin(), m_reqAttrs.end(), xmltooling::cleanup<RequestedAttribute>());
for_each(m_attrConsumers.begin(), m_attrConsumers.end(), xmltooling::cleanup<AttributeConsumingService>());
#endif
Organization* m_org;
EntityAttributes* m_entityAttrs;
vector<ContactPerson*> m_contacts;
Organization* m_org;
EntityAttributes* m_entityAttrs;
vector<ContactPerson*> m_contacts;
+ vector<NameIDFormat*> m_formats;
vector<RequestedAttribute*> m_reqAttrs;
vector<AttributeConsumingService*> m_attrConsumers;
#endif
vector<RequestedAttribute*> m_reqAttrs;
vector<AttributeConsumingService*> m_attrConsumers;
#endif
m_contacts.push_back(cp);
}
else {
m_contacts.push_back(cp);
}
else {
- RequestedAttribute* req = dynamic_cast<RequestedAttribute*>(child.get());
- if (req) {
+ NameIDFormat* nif = dynamic_cast<NameIDFormat*>(child.get());
+ if (nif) {
- m_reqAttrs.push_back(req);
+ m_formats.push_back(nif);
- AttributeConsumingService* acs = dynamic_cast<AttributeConsumingService*>(child.get());
- if (acs) {
+ RequestedAttribute* req = dynamic_cast<RequestedAttribute*>(child.get());
+ if (req) {
- m_attrConsumers.push_back(acs);
+ m_reqAttrs.push_back(req);
- UIInfo* info = dynamic_cast<UIInfo*>(child.get());
- if (info) {
- if (!m_uiinfo) {
- child.release();
- m_uiinfo = info;
- }
- else {
- m_log.warn("skipping duplicate UIInfo element");
- }
+ AttributeConsumingService* acs = dynamic_cast<AttributeConsumingService*>(child.get());
+ if (acs) {
+ child.release();
+ m_attrConsumers.push_back(acs);
- Organization* org = dynamic_cast<Organization*>(child.get());
- if (org) {
- if (!m_org) {
+ UIInfo* info = dynamic_cast<UIInfo*>(child.get());
+ if (info) {
+ if (!m_uiinfo) {
- m_log.warn("skipping duplicate Organization element");
+ m_log.warn("skipping duplicate UIInfo element");
- EntityAttributes* ea = dynamic_cast<EntityAttributes*>(child.get());
- if (ea) {
- if (!m_entityAttrs) {
+ Organization* org = dynamic_cast<Organization*>(child.get());
+ if (org) {
+ if (!m_org) {
- m_log.warn("skipping duplicate EntityAttributes element");
+ m_log.warn("skipping duplicate Organization element");
+ }
+ }
+ else {
+ EntityAttributes* ea = dynamic_cast<EntityAttributes*>(child.get());
+ if (ea) {
+ if (!m_entityAttrs) {
+ child.release();
+ m_entityAttrs = ea;
+ }
+ else {
+ m_log.warn("skipping duplicate EntityAttributes element");
+ }
entity->setOrganization(m_org->cloneOrganization());
for (vector<ContactPerson*>::const_iterator cp = m_contacts.begin(); cp != m_contacts.end(); ++cp)
entity->setOrganization(m_org->cloneOrganization());
for (vector<ContactPerson*>::const_iterator cp = m_contacts.begin(); cp != m_contacts.end(); ++cp)
- entity->getContactPersons().push_back((*cp)->cloneContactPerson());
+ entity->getContactPersons().push_back((*cp)->cloneContactPerson());
if (m_entityAttrs) {
if (!entity->getExtensions())
if (m_entityAttrs) {
if (!entity->getExtensions())
role = entity->getSPSSODescriptors().front();
}
role = entity->getSPSSODescriptors().front();
}
+ for (vector<NameIDFormat*>::const_iterator nif = m_formats.begin(); nif != m_formats.end(); ++nif)
+ role->getNameIDFormats().push_back((*nif)->cloneNameIDFormat());
+
if (m_uiinfo) {
if (!role->getExtensions())
role->setExtensions(ExtensionsBuilder::buildExtensions());
if (m_uiinfo) {
if (!role->getExtensions())
role->setExtensions(ExtensionsBuilder::buildExtensions());