// Path: src/java/se/idega/idegaweb/commune/school/data/SchoolTime.java
// public interface SchoolTime extends IDOEntity {
// 	public void setUser (User user) throws RemoteException;
//     public void setSchool (School school) throws RemoteException;
//     public void setHours (int hours) throws RemoteException;
//     public void setSeason (SchoolSeason season) throws RemoteException;
//     public void setRegistrationTime (Date date) throws RemoteException;
// }


import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.ejb.FinderException;
import javax.ejb.SessionContext;
import javax.transaction.UserTransaction;
import se.idega.idegaweb.commune.business.CommuneUserBusiness;
import se.idega.idegaweb.commune.school.business.SchoolCommuneBusiness;
import se.idega.idegaweb.commune.school.data.SchoolTime;
import se.idega.idegaweb.commune.school.data.SchoolTimeHome;
import se.idega.util.PIDChecker;
import com.idega.block.importer.data.ImportFile;
import com.idega.block.school.business.SchoolBusiness;
import com.idega.block.school.data.School;
import com.idega.block.school.data.SchoolHome;
import com.idega.block.school.data.SchoolSeason;
import com.idega.block.school.data.SchoolSeasonHome;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
import com.idega.user.data.Group;
import com.idega.user.data.User;
import com.idega.user.data.UserHome;
                        logWarning
                                ("NackaStudentTimeImportFileHandlerget: created"
                                 + " new special citizen with ssn " + ssn);
                    }

                    // 2. find school
                    final String schoolName = (String) fields.get (SCHOOL_COL);
                    School school = findBySchool (schoolName, schoolHome);
                    if (school == null) {
                        final String aliasedName
                                = getIWApplicationContext().getIWMainApplication()
                                .getBundle("se.idega.idegaweb.commune")
                                .getProperty (schoolName + "_alias");
                        if (aliasedName != null) {
                            school = findBySchool (aliasedName, schoolHome);
                        }
                    }
                    if (school == null) {
                        logWarning (record + " - Unknown school");
                        failedRecords.add (record + " - Unknown school");
                        unknownSchools.add (schoolName);
                        readSuccess = false;
                    }

                    // 3. get number of hours spent per week
                    final int hours = getIntInBeginningOfString
                            ((String) fields.get (HOURS_COL));

                    // 4. store in db
                    if (user != null) {
// Path: src/java/se/idega/idegaweb/commune/school/data/SchoolTime.java
// public interface SchoolTime extends IDOEntity {
// 	public void setUser (User user) throws RemoteException;
//     public void setSchool (School school) throws RemoteException;
//     public void setHours (int hours) throws RemoteException;
//     public void setSeason (SchoolSeason season) throws RemoteException;
//     public void setRegistrationTime (Date date) throws RemoteException;
// }


// Path: src/java/se/idega/idegaweb/commune/school/importer/NackaStudentTimeImportFileHandlerBean.java
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.ejb.FinderException;
import javax.ejb.SessionContext;
import javax.transaction.UserTransaction;
import se.idega.idegaweb.commune.business.CommuneUserBusiness;
import se.idega.idegaweb.commune.school.business.SchoolCommuneBusiness;
import se.idega.idegaweb.commune.school.data.SchoolTime;
import se.idega.idegaweb.commune.school.data.SchoolTimeHome;
import se.idega.util.PIDChecker;
import com.idega.block.importer.data.ImportFile;
import com.idega.block.school.business.SchoolBusiness;
import com.idega.block.school.data.School;
import com.idega.block.school.data.SchoolHome;
import com.idega.block.school.data.SchoolSeason;
import com.idega.block.school.data.SchoolSeasonHome;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
import com.idega.user.data.Group;
import com.idega.user.data.User;
import com.idega.user.data.UserHome;

                        logWarning
                                ("NackaStudentTimeImportFileHandlerget: created"
                                 + " new special citizen with ssn " + ssn);
                    }

                    // 2. find school
                    final String schoolName = (String) fields.get (SCHOOL_COL);
                    School school = findBySchool (schoolName, schoolHome);
                    if (school == null) {
                        final String aliasedName
                                = getIWApplicationContext().getIWMainApplication()
                                .getBundle("se.idega.idegaweb.commune")
                                .getProperty (schoolName + "_alias");
                        if (aliasedName != null) {
                            school = findBySchool (aliasedName, schoolHome);
                        }
                    }
                    if (school == null) {
                        logWarning (record + " - Unknown school");
                        failedRecords.add (record + " - Unknown school");
                        unknownSchools.add (schoolName);
                        readSuccess = false;
                    }

                    // 3. get number of hours spent per week
                    final int hours = getIntInBeginningOfString
                            ((String) fields.get (HOURS_COL));

                    // 4. store in db
                    if (user != null) {
                        final SchoolTime schoolTime = schoolTimeHome.create ();