private void readResource ( net . sf . mpxj . planner . schema . Resource plannerResource ) throws MPXJException { Resource mpxjResource = m_projectFile . addResource ( ) ; //mpxjResource.setResourceCalendar(m_projectFile.getBaseCalendarByUniqueID(getInteger(plannerResource.getCalendar()))); mpxjResource . setEmailAddress ( plannerResource . getEmail ( ) ) ; mpxjResource . setUniqueID ( getInteger ( plannerResource . getId ( ) ) ) ; mpxjResource . setName ( plannerResource . getName ( ) ) ; mpxjResource . setNotes ( plannerResource . getNote ( ) ) ; mpxjResource . setInitials ( plannerResource . getShortName ( ) ) ; mpxjResource . setType ( getInt ( plannerResource . getType ( ) ) == 2 ? ResourceType . MATERIAL : ResourceType . WORK ) ; //plannerResource.getStdRate(); //plannerResource.getOvtRate(); //plannerResource.getUnits(); //plannerResource.getProperties(); ProjectCalendar calendar = mpxjResource . addResourceCalendar ( ) ; calendar . setWorkingDay ( Day . SUNDAY , DayType . DEFAULT ) ; calendar . setWorkingDay ( Day . MONDAY , DayType . DEFAULT ) ; calendar . setWorkingDay ( Day . TUESDAY , DayType . DEFAULT ) ; calendar . setWorkingDay ( Day . WEDNESDAY , DayType . DEFAULT ) ; calendar . setWorkingDay ( Day . THURSDAY , DayType . DEFAULT ) ; calendar . setWorkingDay ( Day . FRIDAY , DayType . DEFAULT ) ; calendar . setWorkingDay ( Day . SATURDAY , DayType . DEFAULT ) ; ProjectCalendar baseCalendar = m_projectFile . getCalendarByUniqueID ( getInteger ( plannerResource . getCalendar ( ) ) ) ; if ( baseCalendar == null ) { baseCalendar = m_defaultCalendar ; } calendar . setParent ( baseCalendar ) ; m_eventManager . fireResourceReadEvent ( mpxjResource ) ; }
This method extracts data for a single resource from a Planner file .