/** * This method will make this version of the major discipline the current one. * * @param majorDisciplineInfo * @param contextInfo */ private void makeCurrent(MajorDisciplineInfo majorDisciplineInfo, ContextInfo contextInfo) throws Exception { // Check if this is the current version before trying to make it current // (the web service will error if you try to make a version current that is already current) VersionDisplayInfo currentVersion = null; currentVersion = programService.getCurrentVersion(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, majorDisciplineInfo.getVersion().getVersionIndId(), contextInfo); // If this is not the current version, then make it current if (!currentVersion.getSequenceNumber().equals(majorDisciplineInfo.getVersion().getSequenceNumber())) { programService.setCurrentMajorDisciplineVersion(majorDisciplineInfo.getId(), null, contextInfo); } }
public static VersionInfo toVersionInfo(Version version) { if (version == null) { return null; } VersionInfo versionInfo = new VersionInfo(); versionInfo.setCurrentVersionStart(version.getCurrentVersionStart()); versionInfo.setCurrentVersionEnd(version.getCurrentVersionEnd()); versionInfo.setSequenceNumber(version.getSequenceNumber()); versionInfo.setVersionComment(version.getVersionComment()); versionInfo.setVersionIndId(version.getVersionIndId()); versionInfo.setVersionedFromId(version.getVersionedFromId()); return versionInfo; } }
@Override @Transactional(readOnly=false,noRollbackFor={DoesNotExistException.class},rollbackFor={Throwable.class}) public StatusInfo setCurrentMajorDisciplineVersion( String majorDisciplineId, Date currentVersionStart,ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, IllegalVersionSequencingException, OperationFailedException, PermissionDeniedException, DataValidationErrorException { StatusInfo status = cluService.setCurrentCluVersion(majorDisciplineId, currentVersionStart,contextInfo); //Update the variations to be current as well List<ProgramVariationInfo> variationList = getVariationsByMajorDisciplineId(majorDisciplineId,contextInfo); for (ProgramVariationInfo variationInfo:variationList){ String variationId = variationInfo.getId(); //If null set to current (non-null value means version is first and is already current) if (variationInfo.getVersion().getCurrentVersionStart() == null){ cluService.setCurrentCluVersion(variationId, currentVersionStart,contextInfo); } } return status; }
/** * Get the current version of course from another version of course * * */ protected CourseInfo getCurrentVersionOfCourse(CourseInfo course,ContextInfo contextInfo) throws Exception { // Get version independent id of course String verIndId = course.getVersion().getVersionIndId(); // Get id of current version of course given the versionindependen id VersionDisplayInfo curVerDisplayInfo = courseService.getCurrentVersion( CourseServiceConstants.COURSE_NAMESPACE_URI, verIndId,contextInfo); String curVerId = curVerDisplayInfo.getId(); // Return the current version of the course CourseInfo currVerCourse = courseService.getCourse(curVerId,contextInfo); return currVerCourse; }
if (input != null) { this.version = input.getVersion() != null ? new VersionInfo(input.getVersion()) : null; this.descr = input.getDescr() != null
/** * Get the current version of program given the selected version of program * * @param majorDisciplineInfo * @param contextInfo */ protected MajorDisciplineInfo getCurrentVersion(MajorDisciplineInfo majorDisciplineInfo, ContextInfo contextInfo) throws Exception { // Get version independent id of program String verIndId = majorDisciplineInfo.getVersion().getVersionIndId(); // Get id of current version of program given the version independent id VersionDisplayInfo curVerDisplayInfo = null; curVerDisplayInfo = programService.getCurrentVersion(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, verIndId, contextInfo); String curVerId = null; curVerId = curVerDisplayInfo.getId(); // Return the current version of the course MajorDisciplineInfo currentVersion = programService.getMajorDiscipline(curVerId, contextInfo); return currentVersion; }
: new ArrayList<String>(); this.version = new VersionInfo(courseInfo.getVersion());
/** * This method will make this version of the major discipline the current one. * * @param majorDisciplineInfo */ private void makeCurrent(MajorDisciplineInfo majorDisciplineInfo) throws Exception { // Check if this is the current version before trying to make it current // (the web service will error if you try to make a version current that is already current) VersionDisplayInfo currentVersion = programService.getCurrentVersion(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, majorDisciplineInfo.getVersion().getVersionIndId(),ContextUtils.getContextInfo()); // If this is not the current version, then make it current if (!currentVersion.getSequenceNumber().equals(majorDisciplineInfo.getVersion().getSequenceNumber())) { programService.setCurrentMajorDisciplineVersion(majorDisciplineInfo.getId(), null,ContextUtils.getContextInfo()); } }
/** * Get the current version of program given the selected version of program * * @param credentialProgramInfo */ protected CredentialProgramInfo getCurrentVersion(CredentialProgramInfo credentialProgramInfo) throws Exception { // Get version independent id of program String verIndId = credentialProgramInfo.getVersion().getVersionIndId(); // Get id of current version of program given the version independent id VersionDisplayInfo curVerDisplayInfo = programService.getCurrentVersion( ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, verIndId,ContextUtils.getContextInfo()); String curVerId = curVerDisplayInfo.getId(); // Return the current version of the course CredentialProgramInfo currentVersion = programService.getCredentialProgram(curVerId,ContextUtils.getContextInfo()); return currentVersion; }
this.feeInfo = (null != clu.getFeeInfo()) ? new CluFeeInfo(clu.getFeeInfo()) : null; this.accountingInfo = (null != clu.getAccountingInfo()) ? new CluAccountingInfo(clu.getAccountingInfo()) : null; this.version = (null != clu.getVersion()) ? new VersionInfo(clu.getVersion()) : null; this.effectiveDate = (null != clu.getEffectiveDate()) ? new Date(clu.getEffectiveDate().getTime()) : null; this.expirationDate = (null != clu.getExpirationDate()) ? new Date(clu.getExpirationDate().getTime()) : null;
if (DtoConstants.STATE_ACTIVE.equals(courseState) && courseInfo.getVersion().getCurrentVersionStart() == null){
/** * This method will make this version of the major discipline the current one. * * @param coreProgramInfo */ private void makeCurrent(CoreProgramInfo coreProgramInfo) throws Exception { // Check if this is the current version before trying to make it current // (the web service will error if you try to make a version current that is already current) VersionDisplayInfo currentVersion = programService.getCurrentVersion(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, coreProgramInfo.getVersion().getVersionIndId(),ContextUtils.getContextInfo()); // If this is not the current version, then make it current if ( !currentVersion.getSequenceNumber().equals(coreProgramInfo.getVersion().getSequenceNumber())) { programService.setCurrentCoreProgramVersion(coreProgramInfo.getId(), null,ContextUtils.getContextInfo()); } }
/** * Get the current version of program given the selected version of program * * @param verIndId */ protected CoreProgramInfo getCurrentVersion(CoreProgramInfo coreProgramInfo) throws Exception { // Get version independent id of program String verIndId = coreProgramInfo.getVersion().getVersionIndId(); // Get id of current version of program given the version independent id VersionDisplayInfo curVerDisplayInfo = programService.getCurrentVersion(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, verIndId,ContextUtils.getContextInfo()); String curVerId = curVerDisplayInfo.getId(); // Return the current version of the course CoreProgramInfo currentVersion = programService.getCoreProgram(curVerId,ContextUtils.getContextInfo()); return currentVersion; }
/** * This method will make this version of the major discipline the current one. * * @param credentialProgramInfo */ private void makeCurrent(CredentialProgramInfo credentialProgramInfo) throws Exception { // Check if this is the current version before trying to make it current // (the web service will error if you try to make a version current that is already current) VersionDisplayInfo currentVersion = programService.getCurrentVersion(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, credentialProgramInfo.getVersion().getVersionIndId(),ContextUtils.getContextInfo()); // If this is not the current version, then make it current if (!currentVersion.getSequenceNumber().equals(credentialProgramInfo.getVersion().getSequenceNumber())) { programService.setCurrentCredentialProgramVersion(credentialProgramInfo.getId(), null,ContextUtils.getContextInfo()); } }
/** * Get the current version of program given the selected version of program * * @param verIndId */ protected MajorDisciplineInfo getCurrentVersion(MajorDisciplineInfo majorDisciplineInfo) throws Exception { // Get version independent id of program String verIndId = majorDisciplineInfo.getVersion().getVersionIndId(); // Get id of current version of program given the version independent id VersionDisplayInfo curVerDisplayInfo = null; curVerDisplayInfo = programService.getCurrentVersion(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, verIndId,ContextUtils.getContextInfo()); String curVerId = curVerDisplayInfo.getId(); // Return the current version of the course MajorDisciplineInfo currentVersion = programService.getMajorDiscipline(curVerId,ContextUtils.getContextInfo()); return currentVersion; }
/** * This method will make this version of the major discipline the current one. * * @param majorDisciplineInfo */ private void makeCurrent(MajorDisciplineInfo majorDisciplineInfo) throws Exception { // Check if this is the current version before trying to make it current // (the web service will error if you try to make a version current that is already current) VersionDisplayInfo currentVersion = null; currentVersion = programService.getCurrentVersion(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, majorDisciplineInfo.getVersion().getVersionIndId(),ContextUtils.getContextInfo()); // If this is not the current version, then make it current if (!currentVersion.getSequenceNumber().equals(majorDisciplineInfo.getVersion().getSequenceNumber())) { programService.setCurrentMajorDisciplineVersion(majorDisciplineInfo.getId(), null,ContextUtils.getContextInfo()); } }
if (mdInfo.getId() == null && mdInfo.getVersion() != null) { String majorVersionIndId = mdInfo.getVersion().getVersionIndId();
List<VersionDisplayInfo> versions = programService.getVersions(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, majorDisciplineInfo.getVersion().getVersionIndId(),ContextUtils.getContextInfo()); sequenceNumber = majorDisciplineInfo.getVersion().getSequenceNumber();
@Override protected Object save(Object dto, Map<String, Object> properties,ContextInfo contextInfo) throws Exception { if (dto instanceof CoreProgramInfo) { CoreProgramInfo cpInfo = (CoreProgramInfo) dto; if (cpInfo.getId() == null && cpInfo.getVersion() != null) { String coreVersionIndId = cpInfo.getVersion().getVersionIndId(); cpInfo = programService.createNewCoreProgramVersion(coreVersionIndId, "New core program version", contextInfo); } else if (cpInfo.getId() == null) { cpInfo = programService.createCoreProgram(cpInfo.getTypeKey(), cpInfo,contextInfo); } else { cpInfo = programService.updateCoreProgram(cpInfo.getId(), cpInfo.getTypeKey(), cpInfo, contextInfo); } return cpInfo; } else { throw new InvalidParameterException("Only persistence of CoreProgram is supported by this DataService implementation."); } }
selectedVersion.getVersion().getVersionIndId(),ContextUtils.getContextInfo()); Long startSeq = new Long(1); startSeq = currentVersion.getVersion().getSequenceNumber() + 1; boolean isVersionSelectedVersion = versionInfo.getSequenceNumber().equals(selectedVersion.getVersion().getSequenceNumber()); boolean updateState = isVersionNewerThanCurrentVersion && !isVersionSelectedVersion; if (updateState) {