public final class ProjectFile extends Object implements ChildTaskContainer, ChildResourceContainer, UniqueIdObjectSequenceProvider
Constructor and Description |
---|
ProjectFile()
Default constructor.
|
ProjectFile(ProjectFileSharedData shared)
Constructor allowing a ProjectFileSharedData instance to be passed.
|
Modifier and Type | Method and Description |
---|---|
ProjectCalendar |
addCalendar()
This method is used to add a new calendar to the file.
|
ProjectCalendar |
addDefaultBaseCalendar()
This is a convenience method used to add a calendar called
"Standard" to the file, and populate it with a default working week
and default working hours.
|
ProjectCalendar |
addDefaultDerivedCalendar()
This is a convenience method to add a default derived
calendar.
|
void |
addIgnoredError(Exception ex)
Add an error which has been ignored while reading this schedule.
|
Resource |
addResource()
This method is used to add a new resource to the file.
|
Task |
addTask()
This method allows a task to be added to the file programmatically.
|
void |
clearBaseline()
Clear the default baseline for this project.
|
void |
clearBaseline(int index)
Clear baselineN (1-10) for this project.
|
void |
expandSubprojects(boolean replaceExternalTasks)
Calling this method will recursively expand any subprojects
in the current file and in turn any subprojects those files contain.
|
void |
fixUniqueIdClashes()
This method is called to renumber any Unique ID values which
were found to have duplicates.
|
ActivityCodeContainer |
getActivityCodes()
Retrieves the activity code configuration for this project.
|
ProjectFile |
getBaseline()
Retrieve the default baseline project.
|
ProjectFile |
getBaseline(int index)
Retrieve baselineN from Baseline, Baseline1, Baseline2 ...
|
ProjectCalendar |
getBaselineCalendar()
Retrieve the calendar used internally for timephased baseline calculation.
|
List<ProjectFile> |
getBaselines()
Retrieve the baselines linked to this project.
|
ProjectCalendar |
getCalendarByName(String calendarName)
Retrieves the named calendar.
|
ProjectCalendar |
getCalendarByUniqueID(Integer calendarID)
Retrieves the calendar referred to by the supplied unique ID
value.
|
ProjectCalendarContainer |
getCalendars()
This method retrieves the list of calendars defined in
this file.
|
List<Resource> |
getChildResources()
This method is used to retrieve a list of all top level resources
defined in this project file.
|
List<Task> |
getChildTasks()
This method is used to retrieve a list of all top level tasks
defined in this project file.
|
CostAccountContainer |
getCostAccounts()
Retrieves the cost accounts available for this schedule.
|
CustomFieldContainer |
getCustomFields()
Retrieves the custom fields for this project.
|
DataLinkContainer |
getDataLinks()
Retrieves the data link configuration for this project.
|
ProjectCalendar |
getDefaultCalendar()
Retrieves the default calendar for this project based on the calendar name
given in the project properties.
|
LocalDateTime |
getEarliestStartDate()
Find the earliest task start date.
|
EventManager |
getEventManager()
Retrieve the event manager for this project.
|
ExpenseCategoryContainer |
getExpenseCategories()
Retrieves the expense categories available for this schedule.
|
FilterContainer |
getFilters()
This method returns the filters defined in an MPP file.
|
GroupContainer |
getGroups()
Retrieves a list of all groups.
|
List<Exception> |
getIgnoredErrors()
Retrieve a list of errors ignored when reading this schedule.
|
LocalDateTime |
getLatestFinishDate()
Find the latest task finish date.
|
LocationContainer |
getLocations()
Retrieve the locations available for this schedule.
|
NotesTopicContainer |
getNotesTopics()
Retrieves the notes topics available for this schedule.
|
Set<FieldType> |
getPopulatedFields()
A convenience method used to retrieve a set of FieldType instances representing
all populated fields in the project.
|
ProjectCodeContainer |
getProjectCodes()
Retrieves the project code configuration for this project.
|
ProjectConfig |
getProjectConfig()
Retrieve project configuration data.
|
ProjectProperties |
getProjectProperties()
This method is used to retrieve the project properties.
|
RelationContainer |
getRelations()
Retrieves a list of all relations in this project.
|
ResourceAssignmentCodeContainer |
getResourceAssignmentCodes()
Retrieves the resource assignment code configuration for this project.
|
ResourceAssignmentContainer |
getResourceAssignments()
Retrieves a list of all resource assignments in this project.
|
Resource |
getResourceByID(Integer id)
This method allows an arbitrary resource to be retrieved based
on its ID field.
|
Resource |
getResourceByUniqueID(Integer id)
This method allows an arbitrary resource to be retrieved based
on its UniqueID field.
|
ResourceCodeContainer |
getResourceCodes()
Retrieves the resource code configuration for this project.
|
ResourceContainer |
getResources()
Retrieves a list of all resources in this project.
|
RoleCodeContainer |
getRoleCodes()
Retrieves the role code configuration for this project.
|
ShiftPeriodContainer |
getShiftPeriods()
Retrieves the shift periods for this project.
|
ShiftContainer |
getShifts()
Retrieves the shifts for this project.
|
TableContainer |
getTables()
This method returns the tables defined in an MPP file.
|
Task |
getTaskByID(Integer id)
This method allows an arbitrary task to be retrieved based
on its ID field.
|
Task |
getTaskByUniqueID(Integer id)
This method allows an arbitrary task to be retrieved based
on its UniqueID field.
|
TaskContainer |
getTasks()
This method is used to retrieve a list of all tasks
defined in this project file.
|
ObjectSequence |
getUniqueIdObjectSequence(Class<?> c)
Retrieve the ObjectSequence instance used to generate Unique ID values for a given class.
|
UnitOfMeasureContainer |
getUnitsOfMeasure()
Retrieve the units of measure available for this schedule.
|
UserDefinedFieldContainer |
getUserDefinedFields()
Retrieves the user defined fields available for this schedule.
|
ViewContainer |
getViews()
This method returns a list of the views defined in this MPP file.
|
WorkContourContainer |
getWorkContours()
Retrieves the work contours available for this schedule.
|
void |
readComplete()
Called by a reader class when reading a schedule is complete.
|
void |
removeCalendar(ProjectCalendar calendar)
Removes a calendar.
|
void |
removeResource(Resource resource)
This method is used to remove a resource from the project.
|
void |
removeTask(Task task)
This method is used to remove a task from the project.
|
void |
setBaseline(ProjectFile baseline)
Store the supplied project as the default baseline, and use it to set the
baseline cost, duration, finish, fixed cost accrual, fixed cost, start and
work attributes for the tasks in the current project.
|
void |
setBaseline(ProjectFile baseline,
int index)
Store the supplied project as baselineN, and use it to set the
baselineN cost, duration, finish, fixed cost accrual, fixed cost, start and
work attributes for the tasks in the current project.
|
void |
setDefaultCalendar(ProjectCalendar calendar)
Sets the default calendar for this project.
|
void |
updateStructure()
This method is used to recreate the hierarchical structure of the
project file from scratch.
|
public ProjectFile()
public ProjectFile(ProjectFileSharedData shared)
shared
- ProjectFileSharedData instancepublic ProjectConfig getProjectConfig()
public Task addTask()
addTask
in interface ChildTaskContainer
public void removeTask(Task task)
task
- task to be removedpublic List<Task> getChildTasks()
getChildTasks
in interface ChildTaskContainer
public List<Resource> getChildResources()
getChildResources
in interface ChildResourceContainer
public TaskContainer getTasks()
public ProjectCalendar addCalendar()
public void removeCalendar(ProjectCalendar calendar)
calendar
- calendar to be removedpublic ProjectCalendar addDefaultBaseCalendar()
public ProjectCalendar addDefaultDerivedCalendar()
public ProjectCalendarContainer getCalendars()
public ProjectProperties getProjectProperties()
public Resource addResource()
addResource
in interface ChildResourceContainer
public void removeResource(Resource resource)
resource
- resource to be removedpublic ResourceContainer getResources()
public ResourceAssignmentContainer getResourceAssignments()
public RelationContainer getRelations()
public ProjectCalendar getCalendarByName(String calendarName)
calendarName
- name of the required calendarpublic ProjectCalendar getCalendarByUniqueID(Integer calendarID)
calendarID
- calendar unique IDpublic Task getTaskByID(Integer id)
id
- task identifiedpublic Task getTaskByUniqueID(Integer id)
id
- task identifiedpublic Resource getResourceByID(Integer id)
id
- resource identifiedpublic Resource getResourceByUniqueID(Integer id)
id
- resource identifiedpublic void updateStructure()
public LocalDateTime getEarliestStartDate()
public LocalDateTime getLatestFinishDate()
public ViewContainer getViews()
public TableContainer getTables()
public FilterContainer getFilters()
public GroupContainer getGroups()
public EventManager getEventManager()
public CustomFieldContainer getCustomFields()
public ActivityCodeContainer getActivityCodes()
public ProjectCodeContainer getProjectCodes()
public ResourceCodeContainer getResourceCodes()
public RoleCodeContainer getRoleCodes()
public ResourceAssignmentCodeContainer getResourceAssignmentCodes()
public ShiftContainer getShifts()
public ShiftPeriodContainer getShiftPeriods()
public DataLinkContainer getDataLinks()
public ExpenseCategoryContainer getExpenseCategories()
public CostAccountContainer getCostAccounts()
public UserDefinedFieldContainer getUserDefinedFields()
public WorkContourContainer getWorkContours()
public NotesTopicContainer getNotesTopics()
public LocationContainer getLocations()
public UnitOfMeasureContainer getUnitsOfMeasure()
public ProjectCalendar getDefaultCalendar()
public void setDefaultCalendar(ProjectCalendar calendar)
calendar
- default calendar instancepublic ProjectCalendar getBaselineCalendar()
public List<ProjectFile> getBaselines()
public void setBaseline(ProjectFile baseline)
baseline
- baseline projectpublic ProjectFile getBaseline()
public void setBaseline(ProjectFile baseline, int index)
baseline
- baseline projectindex
- baseline to populate (0-10)public ProjectFile getBaseline(int index)
index
- 0-10 representing Baseline, Baseline1, Baseline2 ... Baseline10public void clearBaseline()
public void clearBaseline(int index)
index
- baseline indexpublic Set<FieldType> getPopulatedFields()
public void expandSubprojects(boolean replaceExternalTasks)
ProjectFile.getTasks()
collection will still only contain the tasks from the original project,
not all the subprojects.
Passing true
for the replaceExternalTasks
flag will
replace any predecessor or successor relationships with external tasks
with new relationships which link to the original tasks. For each
external task where this is successful, the external task itself will
be removed as it is just a placeholder and is no longer required.replaceExternalTasks
- flag indicating if external tasks should be replacedpublic void readComplete()
public void fixUniqueIdClashes()
public ObjectSequence getUniqueIdObjectSequence(Class<?> c)
getUniqueIdObjectSequence
in interface UniqueIdObjectSequenceProvider
c
- target classpublic void addIgnoredError(Exception ex)
ex
- ignored errorCopyright © 2000–2024 Packwood Software. All rights reserved.