* You must still call updateState() to save the object using the web service. * * @param majorDisciplineInfo * @param endEntryTerm * @param endEnrollTerm * @param endInstAdmitTerm * @throws OperationFailedException * @throws MissingParameterException * @throws InvalidParameterException * @throws DoesNotExistException */ private void setEndTerms(MajorDisciplineInfo majorDisciplineInfo, String endEntryTerm, String endEnrollTerm, String endInstAdmitTerm) throws InvalidParameterException, MissingParameterException, OperationFailedException, DoesNotExistException { //Set the end terms on the major discipline majorDisciplineInfo.setEndProgramEntryTerm(endEntryTerm); majorDisciplineInfo.setEndTerm(endEnrollTerm); majorDisciplineInfo.getAttributes().put("endInstAdmitTerm", endInstAdmitTerm); //Check if there are variations to process if(!majorDisciplineInfo.getVariations().isEmpty()){ //Find the major's end term atps and obtain their date information AtpInfo majorEndEntryTermAtp = atpService.getAtp(endEntryTerm); Date majorEndEntryTermEndDate = majorEndEntryTermAtp.getEndDate(); AtpInfo majorEndEnrollTermAtp = atpService.getAtp(endEnrollTerm); Date majorEndEnrollTermEndDate = majorEndEnrollTermAtp.getEndDate(); AtpInfo majorEndInstAdmitTermAtp = atpService.getAtp(endInstAdmitTerm); Date majorEndInstAdmitTermEndDate = majorEndInstAdmitTermAtp.getEndDate(); //Loop through the variations for(ProgramVariationInfo variation:majorDisciplineInfo.getVariations()){ //compare dates to get the older of the two end terms if(variation.getEndProgramEntryTerm() != null){ AtpInfo variationEndEntryTermAtp = atpService.getAtp(variation.getEndProgramEntryTerm()); Date variationEndEntryTermEndDate = variationEndEntryTermAtp.getEndDate(); if(majorEndEnrollTermEndDate.compareTo(variationEndEntryTermEndDate)<=0){ variation.setEndProgramEntryTerm(endEntryTerm); } }else{ variation.setEndProgramEntryTerm(endEntryTerm); } //compare dates to get the older of the two end terms if(variation.getEndTerm() != null){ AtpInfo variationEndTermAtp = atpService.getAtp(variation.getEndTerm()); Date variationEndTermEndDate = variationEndTermAtp.getEndDate(); if(majorEndEntryTermEndDate.compareTo(variationEndTermEndDate)<=0){ variation.setEndTerm(endEnrollTerm); } }else{ variation.setEndTerm(endEnrollTerm); } //compare dates to get the older of the two end terms if(variation.getAttributes().get("endInstAdmitTerm") != null){ AtpInfo variationEndInstAdmitAtp = atpService.getAtp(variation.getAttributes().get("endInstAdmitTerm")); Date variationEndInstAdmitEndDate = variationEndInstAdmitAtp.getEndDate(); if(majorEndInstAdmitTermEndDate.compareTo(variationEndInstAdmitEndDate)<=0){ variation.getAttributes().put("endInstAdmitTerm", endInstAdmitTerm); } }else{ variation.getAttributes().put("endInstAdmitTerm", endInstAdmitTerm); } } } } /** * This method will update the requirement state. *
* Note that it uses StatementUtil to update the statement tree.
*
* @param majorDisciplineInfo
* @param newState
* @throws Exception
*/
public void updateRequirementsState(List
* We need to do this here as opposed to in the assemblers, since we need
* to make calls out to a separate web service. Also, this needs to be done here
* because changing state no longer calls the save function.
*
* Note that core and credential programs do not have variations so
* this method isn't necessary.
*
*
* @param majorDisciplineInfo
* @param newState
* @throws Exception
*/
public void updateVariationsRequirementsState(List
*
* @param state is the state we should set all statements in the tree to
* @param statementTreeViewInfo the tree of statements
* @throws Exception
*/
public static void updateStatementTreeViewInfoState(String state, StatementTreeViewInfo statementTreeViewInfo) {
// Set the state on the statement tree itself
statementTreeViewInfo.setState(state);
// Get all the requirements components for this statement
List
* The UI needs to create temporary ids in order to work with the statements
* in memory prior to storing them in the database. On save, we strip
* the temporary ids in this method, then write the statement tree to the database,
* allowing the database to generate proper ids.
*
*
* @param tree
*/
public static void stripStatementIds(StatementTreeViewInfo tree) {
List
currentCluState
value. Otherwise null
will be returned.
*/
protected String getCourseStateFromNewState(String currentCourseState, String newCourseState) {
if (LOG.isInfoEnabled()) {
LOG.info("current CLU state is '" + currentCourseState + "' and new CLU state will be '" + newCourseState + "'");
}
return getStateFromNewState(currentCourseState, newCourseState);
}
]]>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a set
method for the any property.
*
*
* For example, to add a new item, do as follows: *
* getAny().add(newItem); ** * *
* Objects of the following type(s) are allowed in the list * {@link Object } * {@link Element } * * */ public List
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a set
method for the content property.
*
*
* For example, to add a new item, do as follows: *
* getContent().add(newItem); ** * *
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
* {@link String }
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*
*/
public List