@@ -0,0 +1,1587 @@
+package edu.northwestern.bioinformatics.studycalendar.xml.utils;%0A%0Aimport edu.northwestern.bioinformatics.studycalendar.StudyCalendarSystemException;%0Aimport edu.northwestern.bioinformatics.studycalendar.dao.DaoFinder;%0Aimport edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeInnerNode;%0Aimport edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeNode;%0Aimport edu.northwestern.bioinformatics.studycalendar.domain.delta.Change;%0Aimport edu.northwestern.bioinformatics.studycalendar.domain.delta.ChildrenChange;%0Aimport gov.nih.nci.cabig.ctms.dao.DomainObjectDao;%0A%0A/**%0A * @author John Dzak%0A */%0Apublic class XmlUtils %7B%0A    private DaoFinder daoFinder;%0A%0A    /**%0A     * When a Change object is persisted to the database, when retreived the child element is null.%0A     * We must retrieve it using the child id.%0A     */%0A    public PlanTreeNode%3C?%3E findChangeChild(Change change) %7B%0A        Integer childId = ((ChildrenChange)change).getChildId();%0A        Class%3C? extends PlanTreeNode%3C?%3E%3E childClass = ((PlanTreeInnerNode) change.getDelta().getNode()).childClass();%0A%0A        DomainObjectDao dao = daoFinder.findDao(childClass);%0A        PlanTreeNode%3C?%3E child = (PlanTreeNode%3C?%3E) dao.getById(childId);%0A        if (child == null) %7B%0A            throw new StudyCalendarSystemException(%22Problem importing template. Child with class %25s and id %25s could not be found%22,%0A                    childClass.getName(), childId.toString());%0A        %7D%0A        return child;%0A    %7D%0A%0A    ////// Bean Setters%0A    public void setDaoFinder(DaoFinder daoFinder) %7B%0A        this.daoFinder = daoFinder;%0A    %7D%0A%7D%0A

Fix reference