use of org.kuali.kfs.kim.bo.ui.GroupDocumentQualifier in project cu-kfs by CU-CommunityApps.
the class IdentityManagementGroupDocument method setDefinitions.
public void setDefinitions(List<KimAttributeField> definitions) {
super.setDefinitions(definitions);
if (getQualifiers() == null || getQualifiers().size() < 1) {
GroupDocumentQualifier qualifier;
setQualifiers(new ArrayList<>());
if (getDefinitions() != null) {
for (KimAttributeField key : getDefinitions()) {
qualifier = new GroupDocumentQualifier();
qualifier.setKimAttrDefnId(getKimAttributeDefnId(key));
getQualifiers().add(qualifier);
}
}
}
}
use of org.kuali.kfs.kim.bo.ui.GroupDocumentQualifier in project cu-kfs by CU-CommunityApps.
the class IdentityManagementGroupDocument method getQualifiersAsAttributes.
public Map<String, String> getQualifiersAsAttributes() {
Map<String, String> attributes = new HashMap<>();
for (GroupDocumentQualifier qualifier : qualifiers) {
if (qualifier.getKimAttribute() != null) {
attributes.put(qualifier.getKimAttribute().getAttributeName(), qualifier.getAttrVal());
} else {
LOG.warn("Unknown attribute ID on group: " + qualifier.getKimAttrDefnId() + " / value=" + qualifier.getAttrVal());
attributes.put("Unknown Attribute ID: " + qualifier.getKimAttrDefnId(), qualifier.getAttrVal());
}
}
return attributes;
}
use of org.kuali.kfs.kim.bo.ui.GroupDocumentQualifier in project cu-kfs by CU-CommunityApps.
the class IdentityManagementGroupDocument method prepareForSave.
@Override
public void prepareForSave() {
String groupId;
if (StringUtils.isBlank(getGroupId())) {
SequenceAccessorService sas = getSequenceAccessorService();
Long nextSeq = sas.getNextAvailableSequenceNumber("KRIM_GRP_ID_S", this.getClass());
groupId = nextSeq.toString();
setGroupId(groupId);
} else {
groupId = getGroupId();
}
if (getMembers() != null) {
String groupMemberId;
for (GroupDocumentMember member : getMembers()) {
member.setGroupId(getGroupId());
if (StringUtils.isBlank(member.getGroupMemberId())) {
SequenceAccessorService sas = getSequenceAccessorService();
Long nextSeq = sas.getNextAvailableSequenceNumber("KRIM_GRP_MBR_ID_S", this.getClass());
groupMemberId = nextSeq.toString();
member.setGroupMemberId(groupMemberId);
}
if (StringUtils.isBlank(member.getDocumentNumber())) {
member.setDocumentNumber(getDocumentNumber());
}
}
}
int index = 0;
// this needs to be checked - are all qualifiers present?
if (getDefinitions() != null) {
for (KimAttributeField key : getDefinitions()) {
if (getQualifiers().size() > index) {
GroupDocumentQualifier qualifier = getQualifiers().get(index);
qualifier.setKimAttrDefnId(getKimAttributeDefnId(key));
qualifier.setKimTypId(getKimType().getId());
qualifier.setGroupId(groupId);
qualifier.setDocumentNumber(getDocumentNumber());
}
index++;
}
}
}
Aggregations