Java Code Examples for net.sf.mpxj.ProjectFile#getProjectConfig()
The following examples show how to use
net.sf.mpxj.ProjectFile#getProjectConfig() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AstaReader.java From mpxj with GNU Lesser General Public License v2.1 | 6 votes |
/** * Constructor. */ public AstaReader() { m_project = new ProjectFile(); m_eventManager = m_project.getEventManager(); ProjectConfig config = m_project.getProjectConfig(); config.setAutoTaskUniqueID(false); config.setAutoResourceUniqueID(false); config.setAutoCalendarUniqueID(false); m_project.getProjectProperties().setFileApplication("Asta"); m_project.getProjectProperties().setFileType("PP"); CustomFieldContainer fields = m_project.getCustomFields(); fields.getCustomField(TaskField.TEXT1).setAlias("Code"); fields.getCustomField(TaskField.NUMBER1).setAlias("Overall Percent Complete"); }
Example 2
Source File: MerlinReader.java From mpxj with GNU Lesser General Public License v2.1 | 6 votes |
/** * Read the project data and return a ProjectFile instance. * * @return ProjectFile instance */ private ProjectFile read() throws Exception { m_project = new ProjectFile(); m_eventManager = m_project.getEventManager(); ProjectConfig config = m_project.getProjectConfig(); config.setAutoCalendarUniqueID(false); config.setAutoTaskUniqueID(false); config.setAutoResourceUniqueID(false); m_project.getProjectProperties().setFileApplication("Merlin"); m_project.getProjectProperties().setFileType("SQLITE"); m_eventManager.addProjectListeners(m_projectListeners); populateEntityMap(); processProject(); processCalendars(); processResources(); processTasks(); processAssignments(); processDependencies(); return m_project; }
Example 3
Source File: FastTrackReader.java From mpxj with GNU Lesser General Public License v2.1 | 5 votes |
/** * Read FTS file data from the configured source and return a populated ProjectFile instance. * * @return ProjectFile instance */ private ProjectFile read() throws Exception { m_project = new ProjectFile(); m_eventManager = m_project.getEventManager(); ProjectConfig config = m_project.getProjectConfig(); config.setAutoCalendarUniqueID(false); config.setAutoTaskID(false); config.setAutoTaskUniqueID(false); config.setAutoResourceUniqueID(false); config.setAutoWBS(false); config.setAutoOutlineNumber(false); m_project.getProjectProperties().setFileApplication("FastTrack"); m_project.getProjectProperties().setFileType("FTS"); m_eventManager.addProjectListeners(m_projectListeners); // processProject(); // processCalendars(); processResources(); processTasks(); processDependencies(); processAssignments(); return m_project; }
Example 4
Source File: PrimaveraReader.java From mpxj with GNU Lesser General Public License v2.1 | 5 votes |
/** * Constructor. * * @param taskUdfCounters UDF counters for tasks * @param resourceUdfCounters UDF counters for resources * @param assignmentUdfCounters UDF counters for assignments * @param resourceFields resource field mapping * @param wbsFields wbs field mapping * @param taskFields task field mapping * @param assignmentFields assignment field mapping * @param aliases alias mapping * @param matchPrimaveraWBS determine WBS behaviour * @param wbsIsFullPath determine the WBS attribute structure */ public PrimaveraReader(UserFieldCounters taskUdfCounters, UserFieldCounters resourceUdfCounters, UserFieldCounters assignmentUdfCounters, Map<FieldType, String> resourceFields, Map<FieldType, String> wbsFields, Map<FieldType, String> taskFields, Map<FieldType, String> assignmentFields, Map<FieldType, String> aliases, boolean matchPrimaveraWBS, boolean wbsIsFullPath) { m_project = new ProjectFile(); m_eventManager = m_project.getEventManager(); ProjectConfig config = m_project.getProjectConfig(); config.setAutoTaskUniqueID(false); config.setAutoResourceUniqueID(false); config.setAutoAssignmentUniqueID(false); config.setAutoWBS(false); m_resourceFields = resourceFields; m_wbsFields = wbsFields; m_taskFields = taskFields; m_assignmentFields = assignmentFields; applyAliases(aliases); m_taskUdfCounters = taskUdfCounters; m_taskUdfCounters.reset(); m_resourceUdfCounters = resourceUdfCounters; m_resourceUdfCounters.reset(); m_assignmentUdfCounters = assignmentUdfCounters; m_assignmentUdfCounters.reset(); m_matchPrimaveraWBS = matchPrimaveraWBS; m_wbsIsFullPath = wbsIsFullPath; }
Example 5
Source File: TurboProjectReader.java From mpxj with GNU Lesser General Public License v2.1 | 4 votes |
/** * {@inheritDoc} */ @Override public ProjectFile read(InputStream stream) throws MPXJException { try { m_projectFile = new ProjectFile(); m_eventManager = m_projectFile.getEventManager(); m_tables = new HashMap<>(); ProjectConfig config = m_projectFile.getProjectConfig(); config.setAutoResourceID(false); config.setAutoCalendarUniqueID(false); config.setAutoResourceUniqueID(false); config.setAutoTaskID(false); config.setAutoTaskUniqueID(false); config.setAutoOutlineLevel(true); config.setAutoOutlineNumber(true); config.setAutoWBS(true); m_projectFile.getProjectProperties().setFileApplication("TurboProject"); m_projectFile.getProjectProperties().setFileType("PEP"); m_eventManager.addProjectListeners(m_projectListeners); applyAliases(); readFile(stream); readCalendars(); readResources(); readTasks(); readRelationships(); readResourceAssignments(); // // Ensure that the unique ID counters are correct // config.updateUniqueCounters(); return m_projectFile; } catch (IOException ex) { throw new MPXJException("Failed to parse file", ex); } finally { m_projectFile = null; m_eventManager = null; m_projectListeners = null; m_tables = null; } }
Example 6
Source File: MPD9DatabaseReader.java From mpxj with GNU Lesser General Public License v2.1 | 4 votes |
/** * Read a project from the current data source. * * @return ProjectFile instance * @throws MPXJException */ public ProjectFile read() throws MPXJException { try { m_project = new ProjectFile(); m_eventManager = m_project.getEventManager(); ProjectConfig config = m_project.getProjectConfig(); config.setAutoTaskID(false); config.setAutoTaskUniqueID(false); config.setAutoResourceID(false); config.setAutoResourceUniqueID(false); config.setAutoOutlineLevel(false); config.setAutoOutlineNumber(false); config.setAutoWBS(false); config.setAutoCalendarUniqueID(false); config.setAutoAssignmentUniqueID(false); m_project.getProjectProperties().setFileApplication("Microsoft"); m_project.getProjectProperties().setFileType("MPD"); m_project.getEventManager().addProjectListeners(m_projectListeners); processProjectProperties(); processCalendars(); processResources(); processResourceBaselines(); processTasks(); processTaskBaselines(); processLinks(); processAssignments(); processAssignmentBaselines(); processExtendedAttributes(); processSubProjects(); postProcessing(); return (m_project); } catch (SQLException ex) { throw new MPXJException(MPXJException.READ_ERROR, ex); } finally { reset(); if (m_allocatedConnection) { AutoCloseableHelper.closeQuietly(m_connection); m_connection = null; } } }
Example 7
Source File: SureTrakDatabaseReader.java From mpxj with GNU Lesser General Public License v2.1 | 4 votes |
@Override public ProjectFile read(File directory) throws MPXJException { if (!directory.isDirectory()) { throw new MPXJException("Directory expected"); } try { m_projectFile = new ProjectFile(); m_eventManager = m_projectFile.getEventManager(); ProjectConfig config = m_projectFile.getProjectConfig(); config.setAutoResourceID(true); config.setAutoResourceUniqueID(true); config.setAutoTaskID(true); config.setAutoTaskUniqueID(true); config.setAutoOutlineLevel(true); config.setAutoOutlineNumber(true); config.setAutoWBS(false); // Activity ID CustomFieldContainer customFields = m_projectFile.getCustomFields(); customFields.getCustomField(TaskField.TEXT1).setAlias("Code"); customFields.getCustomField(TaskField.TEXT2).setAlias("Department"); customFields.getCustomField(TaskField.TEXT3).setAlias("Manager"); customFields.getCustomField(TaskField.TEXT4).setAlias("Section"); customFields.getCustomField(TaskField.TEXT5).setAlias("Mail"); m_projectFile.getProjectProperties().setFileApplication("SureTrak"); m_projectFile.getProjectProperties().setFileType("STW"); m_eventManager.addProjectListeners(m_projectListeners); m_tables = new DatabaseReader().process(directory, m_projectName); m_definitions = new HashMap<>(); m_calendarMap = new HashMap<>(); m_resourceMap = new HashMap<>(); m_wbsMap = new HashMap<>(); m_activityMap = new HashMap<>(); readProjectHeader(); readDefinitions(); readCalendars(); readHolidays(); readResources(); readTasks(); readRelationships(); readResourceAssignments(); return m_projectFile; } catch (IOException ex) { throw new MPXJException("Failed to parse file", ex); } finally { m_projectFile = null; m_eventManager = null; m_projectListeners = null; m_tables = null; m_definitions = null; m_wbsFormat = null; m_calendarMap = null; m_resourceMap = null; m_wbsMap = null; m_activityMap = null; } }
Example 8
Source File: P3DatabaseReader.java From mpxj with GNU Lesser General Public License v2.1 | 4 votes |
@Override public ProjectFile read(File directory) throws MPXJException { if (!directory.isDirectory()) { throw new MPXJException("Directory expected"); } try { m_projectFile = new ProjectFile(); m_eventManager = m_projectFile.getEventManager(); ProjectConfig config = m_projectFile.getProjectConfig(); config.setAutoResourceID(true); config.setAutoResourceUniqueID(true); config.setAutoTaskID(true); config.setAutoTaskUniqueID(true); config.setAutoOutlineLevel(true); config.setAutoOutlineNumber(true); config.setAutoWBS(false); // Activity ID m_projectFile.getCustomFields().getCustomField(TaskField.TEXT1).setAlias("Code"); m_projectFile.getProjectProperties().setFileApplication("P3"); m_projectFile.getProjectProperties().setFileType("BTRIEVE"); m_eventManager.addProjectListeners(m_projectListeners); m_tables = new DatabaseReader().process(directory, m_projectName); m_resourceMap = new HashMap<>(); m_wbsMap = new HashMap<>(); m_activityMap = new HashMap<>(); readProjectHeader(); readCalendars(); readResources(); readTasks(); readRelationships(); readResourceAssignments(); return m_projectFile; } catch (IOException ex) { throw new MPXJException("Failed to parse file", ex); } finally { m_projectFile = null; m_eventManager = null; m_projectListeners = null; m_tables = null; m_resourceMap = null; m_wbsFormat = null; m_wbsMap = null; m_activityMap = null; } }
Example 9
Source File: ProjectCommanderReader.java From mpxj with GNU Lesser General Public License v2.1 | 4 votes |
/** * {@inheritDoc} */ @Override public ProjectFile read(InputStream is) throws MPXJException { try { m_projectFile = new ProjectFile(); m_projectFile.getProjectProperties().setFileApplication("Project Commander"); m_projectFile.getProjectProperties().setFileType("PC"); ProjectConfig config = m_projectFile.getProjectConfig(); config.setAutoTaskUniqueID(false); config.setAutoResourceUniqueID(false); m_eventManager = m_projectFile.getEventManager(); m_taskMap = new TreeMap<>(); m_childTaskCounts = new TreeMap<>(); m_extraBarCounts = new HashMap<>(); m_data = new ProjectCommanderData(); //m_data.setLogFile("c:/temp/project-commander.log"); m_data.process(is); readCalendars(); readResources(); readTasks(); readRelationships(); return m_projectFile; } catch (IOException ex) { throw new MPXJException(MPXJException.READ_ERROR, ex); } finally { m_eventManager = null; m_taskMap = null; m_childTaskCounts = null; m_extraBarCounts = null; m_data = null; } }