MPXJ: Microsoft Project Exchange

net.sf.mpxj
Class ProjectFile

Package class diagram package ProjectFile
java.lang.Object
  extended by net.sf.mpxj.ProjectFile

public final class ProjectFile
extends java.lang.Object

This class represents a project plan.


Constructor Summary
ProjectFile()
           
 
Method Summary
 ProjectCalendar addBaseCalendar()
          This method is used to add a new base calendar to the file.
 void addCustomFieldValueItem(CustomFieldValueItem item)
          Add a custom field value list item.
 ProjectCalendar addDefaultBaseCalendar()
          This is a convenience method used to add a base calendar called "Standard" to the file, and populate it with a default working week and default working hours.
 void addFilter(Filter filter)
          Adds a filter definition to this project file.
 void addGraphicalIndicator(FieldType field, GraphicalIndicator indicator)
          Adds the definition of a graphical indicator for a field type.
 void addGroup(Group group)
          Adds a group definition to this project file.
 void addProjectListener(ProjectListener listener)
          Adds a listener to this project file.
 Resource addResource()
          This method is used to add a new resource to the file.
(package private)  void addResourceAssignment(ResourceAssignment assignment)
          This method is provided to allow resource assignments that have been created programatically to be added as a record to the main file.
 ProjectCalendar addResourceCalendar()
          This method is provided to create a resource calendar, before it has been attached to a resource.
 void addSubProject(SubProject project)
          This package-private method is used to add sub project details.
 void addTable(Table table)
          Package-private method used to add tables to this MPP file.
 Task addTask()
          This method allows a task to be added to the file programatically.
(package private)  void addTask(Task task)
          This method is provided to allow child tasks that have been created programmatically to be added as a record to the main file.
 void addView(View view)
          Package-private method used to add views to this MPP file.
 void fireResourceReadEvent(Resource resource)
          This method is called to alert project listeners to the fact that a resource has been read from a project file.
 void fireResourceWrittenEvent(Resource resource)
          This method is called to alert project listeners to the fact that a resource has been written to a project file.
 void fireTaskReadEvent(Task task)
          This method is called to alert project listeners to the fact that a task has been read from a project file.
 void fireTaskWrittenEvent(Task task)
          This method is called to alert project listeners to the fact that a task has been written to a project file.
 ResourceField getAliasResourceField(java.lang.String alias)
          Retrieves a resource field based on its alias.
 TaskField getAliasTaskField(java.lang.String alias)
          Retrieves a task field instance based on its alias.
 java.util.List<Group> getAllGroups()
          Retrieves a list of all groups.
 java.util.List<ResourceAssignment> getAllResourceAssignments()
          This method is used to retrieve a list of all of the resource assignments that are defined in this MPX file.
 java.util.List<Filter> getAllResourceFilters()
          Retrieves a list of all resource filters.
 java.util.List<Resource> getAllResources()
          This method is used to retrieve a list of all of the resources that are defined in this MPX file.
 java.util.List<SubProject> getAllSubProjects()
          Retrieves all the subprojects for this MPX file.
 java.util.List<Filter> getAllTaskFilters()
          Retrieves a list of all task filters.
 java.util.List<Task> getAllTasks()
          This method is used to retrieve a list of all of the tasks that are defined in this MPX file.
 boolean getAutoCalendarUniqueID()
          Retrieve the flag that determines whether the calendar unique ID is generated automatically.
 boolean getAutoFilter()
          Retrieve a flag indicating if auto filter is enabled.
 boolean getAutoOutlineLevel()
          Retrieve the flag that determines whether outline level is generated automatically.
 boolean getAutoOutlineNumber()
          Retrieve the flag that determines whether outline numbers are generated automatically.
 boolean getAutoResourceID()
          Retrieve the flag that determines whether the resource ID is generated automatically.
 boolean getAutoResourceUniqueID()
          Retrieve the flag that determines whether the resource unique ID is generated automatically.
 boolean getAutoTaskID()
          Retrieve the flag that determines whether the task ID is generated automatically.
 boolean getAutoTaskUniqueID()
          Retrieve the flag that determines whether the task unique ID is generated automatically.
 boolean getAutoWBS()
          Retrieve the flag that determines whether WBS is generated automatically.
 ProjectCalendar getBaseCalendar(java.lang.String calendarName)
          Retrieves the named base calendar.
 ProjectCalendar getBaseCalendarByUniqueID(java.lang.Integer calendarID)
          Retrieves the base calendar referred to by the supplied unique ID value.
 java.util.List<ProjectCalendar> getBaseCalendars()
          This method retrieves the list of base calendars defined in this file.
 ProjectCalendar getCalendar()
          Retrieves the default calendar for this project.
(package private)  int getCalendarUniqueID()
          This method is used to retrieve the next unique ID for a calendar.
(package private)  int getChildTaskCount()
          This method is used to retrieve the number of child tasks associated with this parent task.
 java.util.List<Task> getChildTasks()
          This method is used to retrieve a list of all of the top level tasks that are defined in this MPX file.
 CustomFieldValueItem getCustomFieldValueItem(java.lang.Integer uniqueID)
          Get the custom field value list item with the given unique ID.
 ProjectCalendar getDefaultResourceCalendar()
          This is a protected convenience method to add a default resource calendar.
 char getDelimiter()
          Accessor method to retrieve the current file delimiter character.
 Duration getDuration(java.util.Date startDate, java.util.Date endDate)
          This method is used to calculate the duration of work between two fixed dates according to the work schedule defined in the named calendar.
 Duration getDuration(java.lang.String calendarName, java.util.Date startDate, java.util.Date endDate)
          This method is used to calculate the duration of work between two fixed dates according to the work schedule defined in the named calendar.
 boolean getEncoded()
          Get whether the data in this file is encoded.
 byte getEncryptionCode()
          Get the key with which this data is encrypted (can be decrypted) with.
 FileCreationRecord getFileCreationRecord()
          Retrieves the file creation record.
 Filter getFilterByID(java.lang.Integer id)
          Retrieve a given filter by ID.
 Filter getFilterByName(java.lang.String name)
          Retrieve a given filter by name.
 java.util.Date getFinishDate()
          Find the latest task finish date.
 GraphicalIndicator getGraphicalIndicator(FieldType field)
          Retrieves the definition of any graphical indicators used for the given field type.
 Group getGroupByName(java.lang.String name)
          Retrieve a given group by name.
 int getMppFileType()
          This method retrieves a value representing the type of MPP file that has been read.
 java.lang.String getProjectFilePath()
          Gets the project file path.
 ProjectHeader getProjectHeader()
          This method is used to retrieve the project header record.
 Resource getResourceByID(java.lang.Integer id)
          This method allows an arbitrary resource to be retrieved based on its ID field.
 Resource getResourceByUniqueID(java.lang.Integer id)
          This method allows an arbitrary resource to be retrieved based on its UniqueID field.
 java.util.List<ProjectCalendar> getResourceCalendars()
          This method retrieves the list of resource calendars defined in this file.
 java.lang.String getResourceFieldAlias(ResourceField field)
          Retrieves the alias associated with a custom resource field.
 java.util.Map<ResourceField,java.lang.String> getResourceFieldAliasMap()
          Allows derived classes to gain access to the mapping between MPX resource field numbers and aliases.
 int getResourceID()
          This method is used to retrieve the next ID for a resource.
 SubProject getResourceSubProject()
          Retrieves details of the sub project file used as a resource pool.
 Table getResourceTableByName(java.lang.String name)
          Utility method to retrieve the definition of a resource table by name.
 int getResourceUniqueID()
          This method is used to retrieve the next unique ID for a resource.
 java.util.Date getStartDate()
          Find the earliest task start date.
 java.util.List<Table> getTables()
          This method returns a list of the tables defined in this MPP file.
 Task getTaskByID(java.lang.Integer id)
          This method allows an arbitrary task to be retrieved based on its ID field.
 Task getTaskByUniqueID(java.lang.Integer id)
          This method allows an arbitrary task to be retrieved based on its UniqueID field.
 java.lang.String getTaskFieldAlias(TaskField field)
          Retrieves the alias associated with a custom task field.
 java.util.Map<TaskField,java.lang.String> getTaskFieldAliasMap()
          Allows derived classes to gain access to the mapping between MPX task field numbers and aliases.
 java.util.List<java.lang.String> getTaskFieldDescriptionList(TaskField field)
          Retrieves the description value list associated with a custom task field.
 java.util.List<java.lang.Object> getTaskFieldValueList(TaskField field)
          Retrieves the value list associated with a custom task field.
 int getTaskID()
          This method is used to retrieve the next ID for a task.
 Table getTaskTableByName(java.lang.String name)
          Utility method to retrieve the definition of a task table by name.
 int getTaskUniqueID()
          This method is used to retrieve the next unique ID for a task.
 java.util.List<View> getViews()
          This method returns a list of the views defined in this MPP file.
 ViewState getViewState()
          Retrieve the saved view state associated with this file.
(package private)  void mapCalendarUniqueID(java.lang.Integer id, ProjectCalendar calendar)
          Adds an id-to-calendar mapping.
(package private)  void mapResourceID(java.lang.Integer id, Resource resource)
          Adds an id-to-resource mapping.
(package private)  void mapResourceUniqueID(java.lang.Integer id, Resource resource)
          Adds an id-to-resource mapping.
(package private)  void mapTaskID(java.lang.Integer id, Task task)
          Adds an id-to-task mapping.
(package private)  void mapTaskUniqueID(java.lang.Integer id, Task task)
          Adds an id-to-task mapping.
 ResourceAssignment newResourceAssignment(Task task)
          This method has been provided to allow the subclasses to instantiate ResourecAssignment instances.
 void removeCalendar(ProjectCalendar calendar)
          Removes a base calendar.
 void removeFilter(java.lang.String filterName)
          Removes a filter from this project file.
 void removeProjectListener(ProjectListener listener)
          Removes a listener from this project file.
 void removeResource(Resource resource)
          This method is used to remove a resource from the project.
(package private)  void removeResourceAssignment(ResourceAssignment assignment)
          This method removes a resource assignment from the internal storage maintained by the project file.
 void removeTask(Task task)
          This method is used to remove a task from the project.
 void setAutoCalendarUniqueID(boolean flag)
          Used to set whether the calendar unique ID field is automatically populated.
 void setAutoFilter(boolean autoFilter)
          Sets a flag indicating if auto filter is enabled.
 void setAutoOutlineLevel(boolean flag)
          Used to set whether outline level numbers are automatically created.
 void setAutoOutlineNumber(boolean flag)
          Used to set whether outline numbers are automatically created.
 void setAutoResourceID(boolean flag)
          Used to set whether the resource ID field is automatically populated.
 void setAutoResourceUniqueID(boolean flag)
          Used to set whether the resource unique ID field is automatically populated.
 void setAutoTaskID(boolean flag)
          Used to set whether the task ID field is automatically populated.
 void setAutoTaskUniqueID(boolean flag)
          Used to set whether the task unique ID field is automatically populated.
 void setAutoWBS(boolean flag)
          Used to set whether WBS numbers are automatically created.
 void setCalendar(ProjectCalendar calendar)
          Sets the default calendar for this project.
 void setDelimiter(char delimiter)
          Modifier method used to set the delimiter character.
 void setEncoded(boolean encoded)
          Set whether the data in this file is encoded.
 void setEncryptionCode(byte encryptionKey)
          Set the key with which this data is encrypted (can be decrypted) with.
 void setMppFileType(int fileType)
          Used internally to set the file type.
 void setProjectFilePath(java.lang.String projectFilePath)
          Sets the project file path.
 void setResourceFieldAlias(ResourceField field, java.lang.String alias)
          Associates an alias with a custom resource field number.
 void setResourceSubProject(SubProject project)
          This package-private method is used to add resource sub project details.
 void setTaskFieldAlias(TaskField field, java.lang.String alias)
          Associates an alias with a custom task field number.
 void setTaskFieldDescriptionList(TaskField field, java.util.List<java.lang.String> descriptions)
          Associates a descriptions for value list with a custom task field number.
 void setTaskFieldValueList(TaskField field, java.util.List<java.lang.Object> values)
          Associates a value list with a custom task field number.
 void setViewState(ViewState viewState)
          Set the saved view state associated with this file.
 void synchronizeResourceIDs()
          This method can be called to ensure that the IDs of all resources in this project are sequential, and start from an appropriate point.
 void synchronizeTaskIDs()
          This method can be called to ensure that the IDs of all tasks in this project are sequential, and start from an appropriate point.
(package private)  void unmapCalendarUniqueID(java.lang.Integer id)
          Removes an id-to-calendar mapping.
(package private)  void unmapResourceID(java.lang.Integer id)
          Removes an id-to-resource mapping.
(package private)  void unmapResourceUniqueID(java.lang.Integer id)
          Removes an id-to-resource mapping.
(package private)  void unmapTaskID(java.lang.Integer id)
          Removes an id-to-task mapping.
(package private)  void unmapTaskUniqueID(java.lang.Integer id)
          Removes an id-to-task mapping.
 void updateStructure()
          This method is used to recreate the hierarchical structure of the MPX file from scratch.
 void updateUniqueCounters()
          This method is called to ensure that after a project file has been read, the cached unique ID values used to generate new unique IDs start after the end of the existing set of unique IDs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectFile

public ProjectFile()
Method Detail

getDelimiter

public char getDelimiter()
Accessor method to retrieve the current file delimiter character.

Returns:
delimiter character

setDelimiter

public void setDelimiter(char delimiter)
Modifier method used to set the delimiter character.

Parameters:
delimiter - delimiter character

addTask

void addTask(Task task)
This method is provided to allow child tasks that have been created programmatically to be added as a record to the main file.

Parameters:
task - task created as a child of another task

addTask

public Task addTask()
This method allows a task to be added to the file programatically.

Returns:
new task object

removeTask

public void removeTask(Task task)
This method is used to remove a task from the project.

Parameters:
task - task to be removed

synchronizeTaskIDs

public void synchronizeTaskIDs()
This method can be called to ensure that the IDs of all tasks in this project are sequential, and start from an appropriate point. If tasks are added to and removed from the list of tasks, then the project is loaded into Microsoft project, if the ID values have gaps in the sequence, there will be blank task rows shown.


synchronizeResourceIDs

public void synchronizeResourceIDs()
This method can be called to ensure that the IDs of all resources in this project are sequential, and start from an appropriate point. If resources are added to and removed from the list of resources, then the project is loaded into Microsoft project, if the ID values have gaps in the sequence, there will be blank resource rows shown.


getChildTasks

public java.util.List<Task> getChildTasks()
This method is used to retrieve a list of all of the top level tasks that are defined in this MPX file.

Returns:
list of tasks

getAllTasks

public java.util.List<Task> getAllTasks()
This method is used to retrieve a list of all of the tasks that are defined in this MPX file.

Returns:
list of all tasks

setAutoWBS

public void setAutoWBS(boolean flag)
Used to set whether WBS numbers are automatically created.

Parameters:
flag - true if automatic WBS required.

setAutoOutlineLevel

public void setAutoOutlineLevel(boolean flag)
Used to set whether outline level numbers are automatically created.

Parameters:
flag - true if automatic outline level required.

setAutoOutlineNumber

public void setAutoOutlineNumber(boolean flag)
Used to set whether outline numbers are automatically created.

Parameters:
flag - true if automatic outline number required.

setAutoTaskUniqueID

public void setAutoTaskUniqueID(boolean flag)
Used to set whether the task unique ID field is automatically populated.

Parameters:
flag - true if automatic unique ID required.

setAutoCalendarUniqueID

public void setAutoCalendarUniqueID(boolean flag)
Used to set whether the calendar unique ID field is automatically populated.

Parameters:
flag - true if automatic unique ID required.

setAutoTaskID

public void setAutoTaskID(boolean flag)
Used to set whether the task ID field is automatically populated.

Parameters:
flag - true if automatic ID required.

getAutoWBS

public boolean getAutoWBS()
Retrieve the flag that determines whether WBS is generated automatically.

Returns:
boolean, default is false.

getAutoOutlineLevel

public boolean getAutoOutlineLevel()
Retrieve the flag that determines whether outline level is generated automatically.

Returns:
boolean, default is false.

getAutoOutlineNumber

public boolean getAutoOutlineNumber()
Retrieve the flag that determines whether outline numbers are generated automatically.

Returns:
boolean, default is false.

getAutoTaskUniqueID

public boolean getAutoTaskUniqueID()
Retrieve the flag that determines whether the task unique ID is generated automatically.

Returns:
boolean, default is false.

getAutoCalendarUniqueID

public boolean getAutoCalendarUniqueID()
Retrieve the flag that determines whether the calendar unique ID is generated automatically.

Returns:
boolean, default is false.

getAutoTaskID

public boolean getAutoTaskID()
Retrieve the flag that determines whether the task ID is generated automatically.

Returns:
boolean, default is false.

getTaskUniqueID

public int getTaskUniqueID()
This method is used to retrieve the next unique ID for a task.

Returns:
next unique ID

getCalendarUniqueID

int getCalendarUniqueID()
This method is used to retrieve the next unique ID for a calendar.

Returns:
next unique ID

getTaskID

public int getTaskID()
This method is used to retrieve the next ID for a task.

Returns:
next ID

setAutoResourceUniqueID

public void setAutoResourceUniqueID(boolean flag)
Used to set whether the resource unique ID field is automatically populated.

Parameters:
flag - true if automatic unique ID required.

setAutoResourceID

public void setAutoResourceID(boolean flag)
Used to set whether the resource ID field is automatically populated.

Parameters:
flag - true if automatic ID required.

getAutoResourceUniqueID

public boolean getAutoResourceUniqueID()
Retrieve the flag that determines whether the resource unique ID is generated automatically.

Returns:
boolean, default is false.

getAutoResourceID

public boolean getAutoResourceID()
Retrieve the flag that determines whether the resource ID is generated automatically.

Returns:
boolean, default is false.

getResourceUniqueID

public int getResourceUniqueID()
This method is used to retrieve the next unique ID for a resource.

Returns:
next unique ID

getResourceID

public int getResourceID()
This method is used to retrieve the next ID for a resource.

Returns:
next ID

getFileCreationRecord

public FileCreationRecord getFileCreationRecord()
Retrieves the file creation record.

Returns:
file creation record.

addResourceCalendar

public ProjectCalendar addResourceCalendar()
This method is provided to create a resource calendar, before it has been attached to a resource.

Returns:
new ProjectCalendar instance

addBaseCalendar

public ProjectCalendar addBaseCalendar()
This method is used to add a new base calendar to the file.

Returns:
new base calendar object

removeCalendar

public void removeCalendar(ProjectCalendar calendar)
Removes a base calendar.

Parameters:
calendar - calendar to be removed

addDefaultBaseCalendar

public ProjectCalendar addDefaultBaseCalendar()
This is a convenience method used to add a base calendar called "Standard" to the file, and populate it with a default working week and default working hours.

Returns:
a new default base calendar

getDefaultResourceCalendar

public ProjectCalendar getDefaultResourceCalendar()
This is a protected convenience method to add a default resource calendar. This is used when the calendar data is available before the resource data has been read, a situation which occurs with MPP files.

Returns:
new ProjectCalendar instance

getBaseCalendars

public java.util.List<ProjectCalendar> getBaseCalendars()
This method retrieves the list of base calendars defined in this file.

Returns:
list of base calendars

getResourceCalendars

public java.util.List<ProjectCalendar> getResourceCalendars()
This method retrieves the list of resource calendars defined in this file.

Returns:
list of resource calendars

getProjectHeader

public ProjectHeader getProjectHeader()
This method is used to retrieve the project header record.

Returns:
project header object

addResource

public Resource addResource()
This method is used to add a new resource to the file.

Returns:
new resource object

removeResource

public void removeResource(Resource resource)
This method is used to remove a resource from the project.

Parameters:
resource - resource to be removed

getAllResources

public java.util.List<Resource> getAllResources()
This method is used to retrieve a list of all of the resources that are defined in this MPX file.

Returns:
list of all resources

getAllResourceAssignments

public java.util.List<ResourceAssignment> getAllResourceAssignments()
This method is used to retrieve a list of all of the resource assignments that are defined in this MPX file.

Returns:
list of all resources

addResourceAssignment

void addResourceAssignment(ResourceAssignment assignment)
This method is provided to allow resource assignments that have been created programatically to be added as a record to the main file.

Parameters:
assignment - Resource assignment created as part of a task

removeResourceAssignment

void removeResourceAssignment(ResourceAssignment assignment)
This method removes a resource assignment from the internal storage maintained by the project file.

Parameters:
assignment - resource assignment to remove

newResourceAssignment

public ResourceAssignment newResourceAssignment(Task task)
This method has been provided to allow the subclasses to instantiate ResourecAssignment instances.

Parameters:
task - parent task
Returns:
new resource assignment instance

getBaseCalendar

public ProjectCalendar getBaseCalendar(java.lang.String calendarName)
Retrieves the named base calendar. This method will return null if the named base calendar is not located.

Parameters:
calendarName - name of the required base calendar
Returns:
base calendar object

getBaseCalendarByUniqueID

public ProjectCalendar getBaseCalendarByUniqueID(java.lang.Integer calendarID)
Retrieves the base calendar referred to by the supplied unique ID value. This method will return null if the required calendar is not located.

Parameters:
calendarID - calendar unique ID
Returns:
ProjectCalendar instance

getChildTaskCount

int getChildTaskCount()
This method is used to retrieve the number of child tasks associated with this parent task. This method is used as part of the process of automatically generating the WBS.

Returns:
Number of child tasks

getDuration

public Duration getDuration(java.util.Date startDate,
                            java.util.Date endDate)
                     throws MPXJException
This method is used to calculate the duration of work between two fixed dates according to the work schedule defined in the named calendar. The calendar used is the "Standard" calendar. If this calendar does not exist, and exception will be thrown.

Parameters:
startDate - start of the period
endDate - end of the period
Returns:
new Duration object
Throws:
MPXJException - normally when no Standard calendar is available

getDuration

public Duration getDuration(java.lang.String calendarName,
                            java.util.Date startDate,
                            java.util.Date endDate)
                     throws MPXJException
This method is used to calculate the duration of work between two fixed dates according to the work schedule defined in the named calendar. The name of the calendar to be used is passed as an argument.

Parameters:
calendarName - name of the calendar to use
startDate - start of the period
endDate - end of the period
Returns:
new Duration object
Throws:
MPXJException - normally when no Standard calendar is available

getTaskByID

public Task getTaskByID(java.lang.Integer id)
This method allows an arbitrary task to be retrieved based on its ID field.

Parameters:
id - task identified
Returns:
the requested task, or null if not found

getTaskByUniqueID

public Task getTaskByUniqueID(java.lang.Integer id)
This method allows an arbitrary task to be retrieved based on its UniqueID field.

Parameters:
id - task identified
Returns:
the requested task, or null if not found

getResourceByID

public Resource getResourceByID(java.lang.Integer id)
This method allows an arbitrary resource to be retrieved based on its ID field.

Parameters:
id - resource identified
Returns:
the requested resource, or null if not found

getResourceByUniqueID

public Resource getResourceByUniqueID(java.lang.Integer id)
This method allows an arbitrary resource to be retrieved based on its UniqueID field.

Parameters:
id - resource identified
Returns:
the requested resource, or null if not found

updateStructure

public void updateStructure()
This method is used to recreate the hierarchical structure of the MPX file from scratch. The method sorts the list of all tasks, then iterates through it creating the parent-child structure defined by the outline level field.


updateUniqueCounters

public void updateUniqueCounters()
This method is called to ensure that after a project file has been read, the cached unique ID values used to generate new unique IDs start after the end of the existing set of unique IDs.


getStartDate

public java.util.Date getStartDate()
Find the earliest task start date. We treat this as the start date for the project.

Returns:
start date

getFinishDate

public java.util.Date getFinishDate()
Find the latest task finish date. We treat this as the finish date for the project.

Returns:
finish date

fireTaskReadEvent

public void fireTaskReadEvent(Task task)
This method is called to alert project listeners to the fact that a task has been read from a project file.

Parameters:
task - task instance

fireTaskWrittenEvent

public void fireTaskWrittenEvent(Task task)
This method is called to alert project listeners to the fact that a task has been written to a project file.

Parameters:
task - task instance

fireResourceReadEvent

public void fireResourceReadEvent(Resource resource)
This method is called to alert project listeners to the fact that a resource has been read from a project file.

Parameters:
resource - resource instance

fireResourceWrittenEvent

public void fireResourceWrittenEvent(Resource resource)
This method is called to alert project listeners to the fact that a resource has been written to a project file.

Parameters:
resource - resource instance

addProjectListener

public void addProjectListener(ProjectListener listener)
Adds a listener to this project file.

Parameters:
listener - listener instance

removeProjectListener

public void removeProjectListener(ProjectListener listener)
Removes a listener from this project file.

Parameters:
listener - listener instance

setTaskFieldAlias

public void setTaskFieldAlias(TaskField field,
                              java.lang.String alias)
Associates an alias with a custom task field number.

Parameters:
field - custom field number
alias - alias text

getTaskFieldAlias

public java.lang.String getTaskFieldAlias(TaskField field)
Retrieves the alias associated with a custom task field. This method will return null if no alias has been defined for this field.

Parameters:
field - task field instance
Returns:
alias text

getAliasTaskField

public TaskField getAliasTaskField(java.lang.String alias)
Retrieves a task field instance based on its alias. If the alias is not recognised, this method will return null.

Parameters:
alias - alias text
Returns:
task field instance

setTaskFieldValueList

public void setTaskFieldValueList(TaskField field,
                                  java.util.List<java.lang.Object> values)
Associates a value list with a custom task field number.

Parameters:
field - custom field number
values - values for the value list

getTaskFieldValueList

public java.util.List<java.lang.Object> getTaskFieldValueList(TaskField field)
Retrieves the value list associated with a custom task field. This method will return null if no value list has been defined for this field.

Parameters:
field - task field instance
Returns:
alias text

setTaskFieldDescriptionList

public void setTaskFieldDescriptionList(TaskField field,
                                        java.util.List<java.lang.String> descriptions)
Associates a descriptions for value list with a custom task field number.

Parameters:
field - custom field number
descriptions - descriptions for the value list

getTaskFieldDescriptionList

public java.util.List<java.lang.String> getTaskFieldDescriptionList(TaskField field)
Retrieves the description value list associated with a custom task field. This method will return null if no descriptions for the value list has been defined for this field.

Parameters:
field - task field instance
Returns:
alias text

setResourceFieldAlias

public void setResourceFieldAlias(ResourceField field,
                                  java.lang.String alias)
Associates an alias with a custom resource field number.

Parameters:
field - custom field number
alias - alias text

getResourceFieldAlias

public java.lang.String getResourceFieldAlias(ResourceField field)
Retrieves the alias associated with a custom resource field. This method will return null if no alias has been defined for this field.

Parameters:
field - field number
Returns:
alias text

getAliasResourceField

public ResourceField getAliasResourceField(java.lang.String alias)
Retrieves a resource field based on its alias. If the alias is not recognised, this method will return null.

Parameters:
alias - alias text
Returns:
resource field instance

getTaskFieldAliasMap

public java.util.Map<TaskField,java.lang.String> getTaskFieldAliasMap()
Allows derived classes to gain access to the mapping between MPX task field numbers and aliases.

Returns:
task field to alias map

getResourceFieldAliasMap

public java.util.Map<ResourceField,java.lang.String> getResourceFieldAliasMap()
Allows derived classes to gain access to the mapping between MPX resource field numbers and aliases.

Returns:
resource field to alias map

unmapTaskUniqueID

void unmapTaskUniqueID(java.lang.Integer id)
Removes an id-to-task mapping.

Parameters:
id - task unique ID

mapTaskUniqueID

void mapTaskUniqueID(java.lang.Integer id,
                     Task task)
Adds an id-to-task mapping.

Parameters:
id - task unique ID
task - task instance

unmapTaskID

void unmapTaskID(java.lang.Integer id)
Removes an id-to-task mapping.

Parameters:
id - task ID

mapTaskID

void mapTaskID(java.lang.Integer id,
               Task task)
Adds an id-to-task mapping.

Parameters:
id - task ID
task - task instance

unmapResourceUniqueID

void unmapResourceUniqueID(java.lang.Integer id)
Removes an id-to-resource mapping.

Parameters:
id - resource unique ID

mapResourceUniqueID

void mapResourceUniqueID(java.lang.Integer id,
                         Resource resource)
Adds an id-to-resource mapping.

Parameters:
id - resource unique ID
resource - resource instance

unmapResourceID

void unmapResourceID(java.lang.Integer id)
Removes an id-to-resource mapping.

Parameters:
id - resource ID

mapResourceID

void mapResourceID(java.lang.Integer id,
                   Resource resource)
Adds an id-to-resource mapping.

Parameters:
id - resource ID
resource - resource instance

unmapCalendarUniqueID

void unmapCalendarUniqueID(java.lang.Integer id)
Removes an id-to-calendar mapping.

Parameters:
id - calendar unique ID

mapCalendarUniqueID

void mapCalendarUniqueID(java.lang.Integer id,
                         ProjectCalendar calendar)
Adds an id-to-calendar mapping.

Parameters:
id - calendar unique ID
calendar - calendar instance

getMppFileType

public int getMppFileType()
This method retrieves a value representing the type of MPP file that has been read. Currently this method will return the value 8 for an MPP8 file (Project 98), 9 for an MPP9 file (Project 2000 and Project 2002) and 12 for an MPP12 file (Project 12).

Returns:
integer representing the file type

setMppFileType

public void setMppFileType(int fileType)
Used internally to set the file type.

Parameters:
fileType - file type

addView

public void addView(View view)
Package-private method used to add views to this MPP file.

Parameters:
view - view data

getViews

public java.util.List<View> getViews()
This method returns a list of the views defined in this MPP file.

Returns:
list of views

addTable

public void addTable(Table table)
Package-private method used to add tables to this MPP file.

Parameters:
table - table data

getTables

public java.util.List<Table> getTables()
This method returns a list of the tables defined in this MPP file.

Returns:
list of tables

addFilter

public void addFilter(Filter filter)
Adds a filter definition to this project file.

Parameters:
filter - filter definition

removeFilter

public void removeFilter(java.lang.String filterName)
Removes a filter from this project file.

Parameters:
filterName - The name of the filter

getAllResourceFilters

public java.util.List<Filter> getAllResourceFilters()
Retrieves a list of all resource filters.

Returns:
list of all resource filters

getAllTaskFilters

public java.util.List<Filter> getAllTaskFilters()
Retrieves a list of all task filters.

Returns:
list of all task filters

getFilterByName

public Filter getFilterByName(java.lang.String name)
Retrieve a given filter by name.

Parameters:
name - filter name
Returns:
filter instance

getFilterByID

public Filter getFilterByID(java.lang.Integer id)
Retrieve a given filter by ID.

Parameters:
id - filter ID
Returns:
filter instance

getAllGroups

public java.util.List<Group> getAllGroups()
Retrieves a list of all groups.

Returns:
list of all groups

getGroupByName

public Group getGroupByName(java.lang.String name)
Retrieve a given group by name.

Parameters:
name - group name
Returns:
Group instance

addGroup

public void addGroup(Group group)
Adds a group definition to this project file.

Parameters:
group - group definition

addGraphicalIndicator

public void addGraphicalIndicator(FieldType field,
                                  GraphicalIndicator indicator)
Adds the definition of a graphical indicator for a field type.

Parameters:
field - field type
indicator - graphical indicator definition

getGraphicalIndicator

public GraphicalIndicator getGraphicalIndicator(FieldType field)
Retrieves the definition of any graphical indicators used for the given field type.

Parameters:
field - field type
Returns:
graphical indicator definition

getTaskTableByName

public Table getTaskTableByName(java.lang.String name)
Utility method to retrieve the definition of a task table by name. This method will return null if the table name is not recognised.

Parameters:
name - table name
Returns:
table instance

getResourceTableByName

public Table getResourceTableByName(java.lang.String name)
Utility method to retrieve the definition of a resource table by name. This method will return null if the table name is not recognised.

Parameters:
name - table name
Returns:
table instance

setResourceSubProject

public void setResourceSubProject(SubProject project)
This package-private method is used to add resource sub project details.

Parameters:
project - sub project

getResourceSubProject

public SubProject getResourceSubProject()
Retrieves details of the sub project file used as a resource pool.

Returns:
sub project details

addSubProject

public void addSubProject(SubProject project)
This package-private method is used to add sub project details.

Parameters:
project - sub project

getAllSubProjects

public java.util.List<SubProject> getAllSubProjects()
Retrieves all the subprojects for this MPX file.

Returns:
all sub project details

getAutoFilter

public boolean getAutoFilter()
Retrieve a flag indicating if auto filter is enabled.

Returns:
auto filter flag

setAutoFilter

public void setAutoFilter(boolean autoFilter)
Sets a flag indicating if auto filter is enabled.

Parameters:
autoFilter - boolean flag

setViewState

public void setViewState(ViewState viewState)
Set the saved view state associated with this file.

Parameters:
viewState - view state

getViewState

public ViewState getViewState()
Retrieve the saved view state associated with this file.

Returns:
view state

setEncoded

public void setEncoded(boolean encoded)
Set whether the data in this file is encoded.

Parameters:
encoded - True if the data is encoded in the file

getEncoded

public boolean getEncoded()
Get whether the data in this file is encoded.

Returns:
encoded

setEncryptionCode

public void setEncryptionCode(byte encryptionKey)
Set the key with which this data is encrypted (can be decrypted) with.

Parameters:
encryptionKey - Encryption key

getEncryptionCode

public byte getEncryptionCode()
Get the key with which this data is encrypted (can be decrypted) with.

Returns:
m_encryptionKey

setProjectFilePath

public void setProjectFilePath(java.lang.String projectFilePath)
Sets the project file path.

Parameters:
projectFilePath - project file path

getProjectFilePath

public java.lang.String getProjectFilePath()
Gets the project file path.

Returns:
project file path

addCustomFieldValueItem

public void addCustomFieldValueItem(CustomFieldValueItem item)
Add a custom field value list item.

Parameters:
item - CustomFieldValueItem instance

getCustomFieldValueItem

public CustomFieldValueItem getCustomFieldValueItem(java.lang.Integer uniqueID)
Get the custom field value list item with the given unique ID.

Parameters:
uniqueID - unique ID
Returns:
CustomFieldValueItem instance

getCalendar

public ProjectCalendar getCalendar()
Retrieves the default calendar for this project.

Returns:
default projectCalendar instance

setCalendar

public void setCalendar(ProjectCalendar calendar)
Sets the default calendar for this project.

Parameters:
calendar - default calendar instance


Copyright © 2000-2009 Packwood Software. All Rights Reserved.