protected void updateEntityFields(ActionContext actionContext, IGTEntity entity) throws GTClientException { IGTServiceAssignmentEntity serviceAssignment = (IGTServiceAssignmentEntity) entity; ServiceAssignmentAForm form = (ServiceAssignmentAForm) actionContext.getActionForm(); serviceAssignment.setFieldValue(IGTServiceAssignmentEntity.USER_NAME, form.getUserName()); serviceAssignment.setFieldValue( IGTServiceAssignmentEntity.USER_TYPE, IGTServiceAssignmentEntity.PARTNER_TYPE); String password = form.getUserPassword(); if (entity.isNewEntity() || (password != null && password.trim().length() > 0)) { serviceAssignment.setFieldValue(IGTServiceAssignmentEntity.PASSWORD, form.getUserPassword()); } Collection webServiceUids = StaticUtils.collectionValue(form.getWebServiceUids()); serviceAssignment.setFieldValue(IGTServiceAssignmentEntity.WEBSERVICE_UIDS, webServiceUids); }
protected void initialiseActionForm(ActionContext actionContext, IGTEntity entity) throws GTClientException { IGTServiceAssignmentEntity serviceAssignment = (IGTServiceAssignmentEntity) entity; ServiceAssignmentAForm form = (ServiceAssignmentAForm) actionContext.getActionForm(); form.setUserName(serviceAssignment.getFieldString(IGTServiceAssignmentEntity.USER_NAME)); form.setUserType(IGTServiceAssignmentEntity.PARTNER_TYPE); // form.setUserPassword(serviceAssignment.getFieldString(IGTServiceAssignmentEntity.PASSWORD)); Collection webServiceUids = (Collection) serviceAssignment.getFieldValue(IGTServiceAssignmentEntity.WEBSERVICE_UIDS); if (webServiceUids == null || webServiceUids.isEmpty()) form.setWebServiceUids(StaticUtils.EMPTY_STRING_ARRAY); else { String uIds[] = StaticUtils.getStringArray(webServiceUids); form.setWebServiceUids(uIds); } }