/** * Gets a CLU. * * @param cluId CLU id * @return CLU * @throws OperationFailedException If retrieving CLU fails */ public CluInfo getCluInfo(String cluId, ContextInfo contextInfo) throws OperationFailedException { if (cluId == null) { return null; } try { VersionDisplayInfo versionInfo = cluService.getCurrentVersion(CluServiceConstants.CLU_NAMESPACE_URI, cluId, null); CluInfo clu = this.cluService.getClu(versionInfo.getId(), contextInfo); return clu; } catch(Exception e) { throw new OperationFailedException(e.getMessage(), e); } }
@Override public VersionDisplayInfo getLatestVersion(String versionIndId, String objectTypeURI) { Query query = em.createNamedQuery("Clu.findLatestVersion"); query.setParameter("versionIndId", versionIndId); VersionDisplayInfo versionDisplayInfo = (VersionDisplayInfo)query.getSingleResult(); versionDisplayInfo.setRefObjectUri(objectTypeURI); return versionDisplayInfo; }
if (versionInfo.getSequenceNumber().equals(sequenceNumber)) { previousVersion = programService.getMajorDiscipline(versionInfo.getId(),ContextUtils.getContextInfo()); break;
/** * 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); } }
boolean isVersionNewerThanCurrentVersion = versionInfo.getSequenceNumber() >= startSeq; boolean isVersionSelectedVersion = versionInfo.getSequenceNumber().equals(selectedVersion.getVersion().getSequenceNumber()); boolean updateState = isVersionNewerThanCurrentVersion && !isVersionSelectedVersion; if (updateState) { CredentialProgramInfo otherProgram = programService.getCredentialProgram(versionInfo.getId(),ContextUtils.getContextInfo()); if (otherProgram.getStateKey().equals(DtoConstants.STATE_APPROVED) || otherProgram.getStateKey().equals(DtoConstants.STATE_ACTIVE)){
/** * 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()); } }
boolean isVersionNewerThanCurrentVersion = versionInfo.getSequenceNumber() >= startSeq; boolean isVersionSelectedVersion = versionInfo.getSequenceNumber().equals(selectedVersion.getVersion().getSequenceNumber()); boolean updateState = isVersionNewerThanCurrentVersion && !isVersionSelectedVersion; if (updateState) { CoreProgramInfo otherProgram = programService.getCoreProgram(versionInfo.getId(),ContextUtils.getContextInfo()); if (otherProgram.getStateKey().equals(DtoConstants.STATE_APPROVED) || otherProgram.getStateKey().equals(DtoConstants.STATE_ACTIVE)){
/** * 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; }
/** * 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()); } }
@Override public VersionDisplayInfo getVersionBySequenceNumber(String versionIndId, String objectTypeURI, Long sequenceNumber) { Query query = em.createNamedQuery("Clu.findVersionBySequence"); query.setParameter("versionIndId", versionIndId); query.setParameter("sequenceNumber", sequenceNumber); VersionDisplayInfo versionDisplayInfo = (VersionDisplayInfo)query.getSingleResult(); versionDisplayInfo.setRefObjectUri(objectTypeURI); return versionDisplayInfo; }
if (versionInfo.getSequenceNumber() >= startSeq && versionInfo.getSequenceNumber() != selectedVersion.getVersion().getSequenceNumber()) { MajorDisciplineInfo otherProgram = null; otherProgram = programService.getMajorDiscipline(versionInfo.getId(), contextInfo); if (otherProgram.getStateKey().equals(DtoConstants.STATE_APPROVED) || otherProgram.getStateKey().equals(DtoConstants.STATE_ACTIVE)){
/** * 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; }
/** * 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()); } }
@Override public VersionDisplayInfo getFirstVersion(String versionIndId, String objectTypeURI) { Query query = em.createNamedQuery("Clu.findFirstVersion"); query.setParameter("versionIndId", versionIndId); VersionDisplayInfo versionDisplayInfo = (VersionDisplayInfo)query.getSingleResult(); versionDisplayInfo.setRefObjectUri(objectTypeURI); return versionDisplayInfo; }
boolean isVersionNewerThanCurrentVersion = versionInfo.getSequenceNumber() >= startSeq; boolean isVersionSelectedVersion = false; isSelectedVersionCurrent = versionInfo.getSequenceNumber().equals(selectedVersion.getVersion().getSequenceNumber()); boolean updateState = isVersionNewerThanCurrentVersion && !isVersionSelectedVersion; if (updateState) { MajorDisciplineInfo otherProgram = programService.getMajorDiscipline(versionInfo.getId(),ContextUtils.getContextInfo()); if (otherProgram.getStateKey().equals(DtoConstants.STATE_APPROVED) || otherProgram.getStateKey().equals(DtoConstants.STATE_ACTIVE)){
/** * 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 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()); } }
@Override public VersionDisplayInfo getCurrentVersionOnDate(String versionIndId, String objectTypeURI, Date date) { Query query = em.createNamedQuery("Clu.findCurrentVersionOnDate"); query.setParameter("versionIndId", versionIndId); query.setParameter("date", date); VersionDisplayInfo versionDisplayInfo = (VersionDisplayInfo)query.getSingleResult(); versionDisplayInfo.setRefObjectUri(objectTypeURI); return versionDisplayInfo; }
if (versionInfo.getSequenceNumber() >= startSeq) { CourseInfo otherCourse = courseService .getCourse(versionInfo.getId(),contextInfo); if (otherCourse.getStateKey().equals( DtoConstants.STATE_APPROVED)
/** * 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; }