/** * 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; }
/** * 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 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); } }
/** * 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 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 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 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 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()); } }
/** * 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()); } }
/** * 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; }
selectedVersion.getVersion().getVersionIndId(),ContextUtils.getContextInfo()); Long startSeq = new Long(1);
selectedVersion.getVersion().getVersionIndId(), ContextUtils.getContextInfo()); Long startSeq = new Long(1);
List<VersionDisplayInfo> versions = programService.getVersions(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, majorDisciplineInfo.getVersion().getVersionIndId(),ContextUtils.getContextInfo());
versions = programService.getVersions(ProgramServiceConstants.PROGRAM_NAMESPACE_MAJOR_DISCIPLINE_URI, selectedVersion.getVersion().getVersionIndId(), contextInfo);
selectedVersion.getVersion().getVersionIndId(),ContextUtils.getContextInfo()); Long startSeq = new Long(1);
if (mdInfo.getId() == null && mdInfo.getVersion() != null) { String majorVersionIndId = mdInfo.getVersion().getVersionIndId();
@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."); } }
@Override protected Object save(Object dto, Map<String, Object> properties,ContextInfo contextInfo) throws Exception { if (dto instanceof CredentialProgramInfo) { CredentialProgramInfo cpInfo = (CredentialProgramInfo) dto; if (cpInfo.getId() == null && cpInfo.getVersion() != null) { String credentialVersionIndId = cpInfo.getVersion().getVersionIndId(); cpInfo = programService.createNewCredentialProgramVersion(credentialVersionIndId, "New credential program version", ContextUtils.getContextInfo()); } else if (cpInfo.getId() == null) { cpInfo = programService.createCredentialProgram(cpInfo.getId(), cpInfo, ContextUtils.getContextInfo()); } else { cpInfo = programService.updateCredentialProgram(cpInfo.getId(), cpInfo, ContextUtils.getContextInfo()); } return cpInfo; } else { throw new InvalidParameterException("Only persistence of CredentialProgram is supported by this DataService implementation."); } }
@Override protected Object save(Object dto, Map<String, Object> properties, ContextInfo contextInfo) throws Exception { if (dto instanceof MajorDisciplineInfo) { MajorDisciplineInfo mdInfo = (MajorDisciplineInfo) dto; if (mdInfo.getId() == null && mdInfo.getVersion() != null) { String majorVersionIndId = null; majorVersionIndId = mdInfo.getVersion().getVersionIndId(); mdInfo = programService.createNewMajorDisciplineVersion(majorVersionIndId, "New major discipline version",ContextUtils.getContextInfo()); } else if (mdInfo.getId() == null){ mdInfo = programService.createMajorDiscipline(mdInfo.getId(), mdInfo, ContextUtils.getContextInfo()); } else { mdInfo = programService.updateMajorDiscipline(mdInfo.getId(), mdInfo, ContextUtils.getContextInfo()); } return mdInfo; } else { throw new InvalidParameterException("Only persistence of MajorDiscipline is supported by this DataService implementation."); } }
String variationVersionIndId = variation.getVersion().getVersionIndId(); CluInfo newVariationClu = cluService.createNewCluVersion(variationVersionIndId, "Variation version for MajorDiscipline version " + majorDiscipline.getVersion().getSequenceNumber(),contextInfo);