/** * Create the ValueObject from the ims.core.configuration.domain.objects.AppUser object. * * @param map DomainObjectMap of DomainObjects to already created ValueObjects. * @param domainObject */ public static ims.admin.vo.AppUserVo create( DomainObjectMap map, ims.core.configuration.domain.objects.AppUser domainObject) { if (null == domainObject) { return null; } // check if the domainObject already has a valueObject created for it ims.admin.vo.AppUserVo valueObject = (ims.admin.vo.AppUserVo) map.getValueObject(domainObject, ims.admin.vo.AppUserVo.class); if (null == valueObject) { valueObject = new ims.admin.vo.AppUserVo(domainObject.getId(), domainObject.getVersion()); map.addValueObject(domainObject, valueObject); valueObject = insert(map, valueObject, domainObject); } return valueObject; }
/** * Update the ValueObject with the Domain Object. * * @param map DomainObjectMap of DomainObjects to already created ValueObjects. * @param valueObject to be updated * @param domainObject ims.core.configuration.domain.objects.AppUser */ public static ims.admin.vo.AppUserVo insert( DomainObjectMap map, ims.admin.vo.AppUserVo valueObject, ims.core.configuration.domain.objects.AppUser domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new DomainObjectMap(); } valueObject.setID_AppUser(domainObject.getId()); valueObject.setIsRIE(domainObject.getIsRIE()); // If this is a recordedInError record, and the domainObject // value isIncludeRecord has not been set, then we return null and // not the value object if (valueObject.getIsRIE() != null && valueObject.getIsRIE().booleanValue() == true && !domainObject.isIncludeRecord()) return null; // If this is not a recordedInError record, and the domainObject // value isIncludeRecord has been set, then we return null and // not the value object if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false) && domainObject.isIncludeRecord()) return null; // Roles valueObject.setRoles( ims.admin.vo.domain.AppRoleShortVoAssembler.createAppRoleShortVoCollectionFromAppRole( map, domainObject.getRoles())); // mos valueObject.setMos( ims.core.vo.domain.MemberOfStaffShortVoAssembler.create(map, domainObject.getMos())); // PreviousPasswords valueObject.setPreviousPasswords( ims.admin.vo.domain.AppUserPasswordVoAssembler .createAppUserPasswordVoCollectionFromAppUserPassword( map, domainObject.getPreviousPasswords())); // EmailAccount valueObject.setEmailAccount( ims.admin.vo.domain.UserEmailAccountVoAssembler.create( map, domainObject.getEmailAccount())); // UseExternalAuthentication valueObject.setUseExternalAuthentication(domainObject.isUseExternalAuthentication()); // NotificationDetails valueObject.setNotificationDetails( ims.admin.vo.domain.UserNotificationDetailsVoAssembler.create( map, domainObject.getNotificationDetails())); // SecretKey valueObject.setSecretKey(domainObject.getSecretKey()); // sdsUserId valueObject.setSdsUserId(domainObject.getSdsUserId()); // Username valueObject.setUsername(domainObject.getUsername()); // Password valueObject.setPassword(domainObject.getPassword()); // EncodedPassword valueObject.setEncodedPassword(domainObject.getEncodedPassword()); // Theme valueObject.setTheme(domainObject.getTheme()); // PwdExpDate java.util.Date PwdExpDate = domainObject.getPwdExpDate(); if (null != PwdExpDate) { valueObject.setPwdExpDate(new ims.framework.utils.DateTime(PwdExpDate)); } // EffectiveFrom java.util.Date EffectiveFrom = domainObject.getEffectiveFrom(); if (null != EffectiveFrom) { valueObject.setEffectiveFrom(new ims.framework.utils.DateTime(EffectiveFrom)); } // EffectiveTo java.util.Date EffectiveTo = domainObject.getEffectiveTo(); if (null != EffectiveTo) { valueObject.setEffectiveTo(new ims.framework.utils.DateTime(EffectiveTo)); } // IsActive valueObject.setIsActive(domainObject.isIsActive()); // DebugMode valueObject.setDebugMode(domainObject.isDebugMode()); // LDAPUsername valueObject.setLDAPUsername(domainObject.getLDAPUsername()); // LDAPPassword valueObject.setLDAPPassword(domainObject.getLDAPPassword()); // Locked valueObject.setLocked(domainObject.isLocked()); return valueObject; }