setNameFields( contactGV );
contactGV.set("contactTypeId", "user");
userLoginGV.set("userLoginId", userLogin);
userLoginGV.set("currentPassword", userPassword);
DataMatrix dataMatrix = new DataMatrix(delegator, new Vector());
dataMatrix.getCurrentBuffer().addContentsRow(new Vector());
dataMatrix.addEntity("Contact", false, true);
dataMatrix.getCurrentBuffer().getContentsRow(0).add(contactGV);
dataMatrix.addEntity("Address", false, true);
dataMatrix.getCurrentBuffer().getContentsRow(0).add(addressGV);
dataMatrix.addEntity("Party", false, true);
dataMatrix.getCurrentBuffer().getContentsRow(0).add(partyGV);
dataMatrix.addEntity("UserLogin", false, true);
dataMatrix.getCurrentBuffer().getContentsRow(0).add(userLoginGV);
if (preInsert(userInfo, delegator, dataMatrix) != STATUS_CONTINUE) {
return false;
}
if ( (userLogin != null) && (userLogin.length() > 0))
{
try {
partyGV =dataMatrix.getCurrentBuffer().getGenericValue(0, "Party", true);
} catch (GenericEntityException e) {
Debug.logError(
"[ContactEventProcessor.QuickInsert] Error getting generic value: " +
e.getLocalizedMessage(), module);
return false;
}
partyRoleGV.set("partyId", partyGV.getString("partyId"));
partyRoleGV.set("roleTypeId", "SFA_USER");
dataMatrix.addEntity("PartyRole", false, true);
dataMatrix.getCurrentBuffer().getContentsRow(0).add(partyRoleGV);
}
try {
delegator.storeAll((List) dataMatrix.getCurrentBuffer()
.getContentsRow(0));
} catch (GenericEntityException e2) {
Debug.logError(
"[ContactEventProcessor.QuickInsert] Error updating: " +
e2.getLocalizedMessage(), module);