use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.
the class InterceptHelper method readAndMergeCollectionTypes.
private void readAndMergeCollectionTypes(Object obj, String firstName, String parentName, String state) {
Class l = getClazz(obj);
ClassMetadata customMeta = StaticHibernateUtil.getSessionFactory().getClassMetadata(l);
Object[] propertyValues = customMeta.getPropertyValues(obj, EntityMode.POJO);
String[] propertyNames = customMeta.getPropertyNames();
Type[] propertyTypes = customMeta.getPropertyTypes();
setPrimaryKeyValueForCollectionTypeAndMerge(customMeta, obj, firstName.concat(customMeta.getIdentifierPropertyName()), state);
for (int i = 0; i < propertyNames.length; i++) {
logger.debug("property Name : " + propertyNames[i] + " value : " + propertyValues[i]);
if (!propertyTypes[i].isEntityType() && !propertyTypes[i].isComponentType() && !propertyTypes[i].isCollectionType()) {
if (state.equalsIgnoreCase(AuditConstants.TRANSACTIONBEGIN)) {
String name = firstName.concat(propertyNames[i]);
logger.debug("i readFurtherMetaForCollectionType " + name + " value : " + propertyValues[i]);
if (isValueLoggable(propertyNames[i], firstName)) {
if (AuditConfiguration.checkForPropertyName(entityName, name, localeId)) {
String value = AuditConfiguration.getValueOfCorrespondingId(entityName, name, propertyValues[i], localeId);
if (initialArray.toString().trim().length() == 0 || initialArray.toString().endsWith(",")) {
initialArray.append(value);
} else if (value.trim().length() != 0) {
initialArray.append("-").append(value);
}
} else {
if (propertyValues[i] != null) {
if (initialArray.toString().trim().length() == 0 || initialArray.toString().endsWith(",")) {
initialArray.append(propertyValues[i]);
} else if (propertyValues[i].toString().trim().length() != 0) {
initialArray.append("-").append(propertyValues[i]);
}
}
}
}
} else {
String name = firstName.concat(propertyNames[i].toString());
logger.debug("c readFurtherMetaForCollectionType " + name + " value : " + propertyValues[i]);
if (isValueLoggable(propertyNames[i], firstName)) {
if (AuditConfiguration.checkForPropertyName(entityName, name, localeId)) {
String value = AuditConfiguration.getValueOfCorrespondingId(entityName, name, propertyValues[i], localeId);
if (changeArray.toString().trim().length() == 0 || changeArray.toString().endsWith(",")) {
changeArray.append(value);
} else if (value.trim().length() != 0) {
changeArray.append("-").append(value);
}
} else {
if (propertyValues[i] != null) {
if (changeArray.toString().trim().length() == 0 || changeArray.toString().endsWith(",")) {
changeArray.append(propertyValues[i]);
} else if (propertyValues[i].toString().trim().length() != 0) {
changeArray.append("-").append(propertyValues[i]);
}
}
}
}
}
}
if (propertyTypes[i].isEntityType() && !propertyTypes[i].isComponentType() && propertyValues[i] instanceof MasterDataEntity && AuditConfiguration.isObjectToBeLogged(entityName, propertyNames[i], firstName)) {
populateAndMergeValueForObjectsOfTypeMasterDataEntityInCollections(propertyValues[i], state, firstName.concat(propertyNames[i]));
}
if (propertyTypes[i].isEntityType() && !propertyTypes[i].isComponentType() && !(propertyValues[i] instanceof MasterDataEntity) && AuditConfiguration.isObjectToBeLogged(entityName, propertyNames[i], firstName)) {
Object object = propertyValues[i];
if (object != null) {
if (object instanceof MeetingBO) {
MeetingBO meeting = (MeetingBO) object;
if (propertyNames[i].equalsIgnoreCase("meeting") && meeting.getMeetingId() != null) {
readAndMergeMeetingCollection(meeting, propertyNames[i], state);
} else {
readAndMergeCollectionTypes(object, propertyNames[i], firstName, state);
}
} else {
readAndMergeCollectionTypes(object, propertyNames[i], firstName, state);
}
}
}
// Reading further component type
if (!propertyTypes[i].isEntityType() && propertyTypes[i].isComponentType() && !(propertyValues[i] instanceof MasterDataEntity) && AuditConfiguration.isObjectToBeLogged(entityName, propertyNames[i], firstName)) {
Object obj1 = propertyValues[i];
if (obj1 != null) {
readComponenetTypeInCollectionTypeWithMerge(obj1, propertyNames[i], state, propertyTypes[i]);
}
}
}
}
use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.
the class LoanBusinessServiceIntegrationTest method getLoanAccount.
private AccountBO getLoanAccount() {
Date startDate = new Date(System.currentTimeMillis());
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
center = TestObjectFactory.createWeeklyFeeCenter(this.getClass().getSimpleName() + "_Center", meeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter(this.getClass().getSimpleName() + "_Group", CustomerStatus.GROUP_ACTIVE, center);
LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(startDate, meeting);
return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, startDate, loanOffering);
}
use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.
the class LoanAccountActionStrutsTest method getLoanAccountFromLastLoanAmount.
private AccountBO getLoanAccountFromLastLoanAmount() {
Date startDate = new Date(System.currentTimeMillis());
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeetingForToday(WEEKLY, EVERY_WEEK, CUSTOMER_MEETING));
LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(startDate, meeting);
return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, startDate, loanOffering);
}
use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.
the class AbstractLoanActionTestCase method getLoanOffering.
protected LoanOfferingBO getLoanOffering(String name, String shortName, ApplicableTo applicableTo, RecurrenceType meetingFrequency, short recurAfter) {
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeeting(meetingFrequency, recurAfter, CUSTOMER_MEETING, MONDAY));
Date currentDate = new Date(System.currentTimeMillis());
return TestObjectFactory.createLoanOffering(name, shortName, applicableTo, currentDate, PrdStatus.LOAN_ACTIVE, 300.0, 1.2, 3, InterestType.FLAT, meeting);
}
use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.
the class AbstractLoanActionTestCase method getLoanOffering.
protected LoanOfferingBO getLoanOffering(String name, String shortName, ApplicableTo applicableTo, RecurrenceType meetingFrequency, short recurAfter, VariableInstallmentDetailsBO variableInstallmentDetailsBO) {
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeeting(meetingFrequency, recurAfter, CUSTOMER_MEETING, MONDAY));
Date currentDate = new Date(System.currentTimeMillis());
return TestObjectFactory.createLoanOffering(name, shortName, applicableTo, currentDate, PrdStatus.LOAN_ACTIVE, 300.0, 1.2, 3, InterestType.FLAT, meeting, variableInstallmentDetailsBO);
}
Aggregations