public ProgramDTO(final Program program, final DTOPath path) {
id = program.getId();
name = program.getName();
if (!path.accept(DTOPath.PROGRAM_NAME)) {
prime = (program.getPrime() == null ? null : new ConcreteBusinessPartnerDTO(program.getPrime(), path));
spaceSegment = (program.getSpaceSegment() == null ? null : new ConcreteBusinessPartnerDTO(program.getSpaceSegment(), path));
groundSegment = (program.getGroundSegment() == null ? null : new ConcreteBusinessPartnerDTO(program.getGroundSegment(), path));
dateOfDeliveryToPrime = program.getDateOfDeliveryToPrime();
launchDate = program.getLaunchDate();
launcherType = program.getLauncherType();
// Skip a infinite loop in Authentification phase
if (path.accept(DTOPath.UZER_WITH_PROGRAMS)) {
// contains phone !
ecmManager = (program.getEcmManager() == null ? null : new UzerDTO(program.getEcmManager(), DTOPath.NOTHING_TO_SAY));
// contains phone !
processManager = (program.getProcessManager() == null ? null : new UzerDTO(program.getProcessManager(), DTOPath.NOTHING_TO_SAY));
// contains phone !
programManager = (program.getProgramManager() == null ? null : new UzerDTO(program.getProgramManager(), DTOPath.NOTHING_TO_SAY));
} else {
// contains phone !
ecmManager = (program.getEcmManager() == null ? null : new UzerDTO(program.getEcmManager(), path));
// contains phone !
processManager = (program.getProcessManager() == null ? null : new UzerDTO(program.getProcessManager(), path));
// contains phone !
programManager = (program.getProgramManager() == null ? null : new UzerDTO(program.getProgramManager(), path));
}
comment = program.getComment();
if (path.accept(DTOPath.PROGRAM_DOC)) {
contractDate = program.getContractDate();
kickoffDate = program.getKickoffDate();
startDate = program.getCampaignStartDate();
reviewDate = program.getDateOfReviewBeforeLaunch();
type12327 = program.getType12327();
client = (program.getClient() == null ? null : new ConcreteBusinessPartnerDTO(program.getClient(), path));
}
if (path.accept(DTOPath.PROGRAM_WITH_DOC)) {
final Map<DocumentType, Set<DocumentDTO>> docs = new HashMap<DocumentType, Set<DocumentDTO>>();
docs.put(DocumentType.GC_4_LAUNCH, buildDocumentSet(program.getGcForLaunches(), path));
docs.put(DocumentType.COMSAT_APPROVAL, buildDocumentSet(program.getComsatApprovals(), path));