Class Project
- java.lang.Object
-
- com.aspose.tasks.Project
-
public class Project extends Object
Represents a project.
<p>The <b>Project</b> is a central class in the Aspose.Tasks library.</p>One can use<b>Project</b>to read one of supported project management formats: MPP, MPT, MPX, XML.<p>To load an existing document in any of the supported formats, pass a file name or a stream into one of the <b>Project</b> constructors. To create a blank project, call the parameterless constructor.</p><p>Use one of the Save method overloads to save the project in any of the {@link SaveFileFormat} formats: Primavera: P6 XML, PM XER; Microsoft Excel: XLSX, XML; Fixed Layout: PDF; Images: JPEG, PNG, BMP, TIFF, SVG; Text: TXT; Others: HTML.</p><p>To print the project, use one of the {@link Project#print} method overloads.</p><p>The <b>Project</b> stores project-wide information such as {@code Aspose.Tasks.Project.Views}({@link Project#getViews}/{@link Project#setViews(ViewCollection)}), {@code Aspose.Tasks.Project.BuiltInProps}({@link Project#getBuiltInProps}/{@link Project#setBuiltInProps(BuiltInProjectPropertyCollection)}), {@code Aspose.Tasks.Project.CustomProps}({@link Project#getCustomProps}/{@link Project#setCustomProps(CustomProjectPropertyCollection)}), and {@code Aspose.Tasks.Project.ExtendedAttributes}({@link Project#getExtendedAttributes}/{@link Project#setExtendedAttributes(ExtendedAttributeDefinitionCollection)}). Most of these objects are accessible via the corresponding properties of the <b>Project</b> class.</p><p>The <b>Project</b> is a root entity that contains entry points to manipulate other project entities, such as {@link Task}, {@link Resource}, {@link ResourceAssignment}, {@link ExtendedAttribute} and {@link Calendar}.</p>The<b>Project</b>entities can be accessed via typed collections, for exampleAspose.Tasks.Task.Children(Task.getChildren()/Task.setChildren(TaskCollection)),Aspose.Tasks.Project.Resources(getResources()/setResources(ResourceCollection)),Aspose.Tasks.Project.ResourceAssignments(getResourceAssignments()/setResourceAssignments(ResourceAssignmentCollection)), etc.
-
-
Constructor Summary
Constructors Constructor Description Project()Initializes a new instance of theProjectclass.Project(DbSettings settings)Initializes a new instance of theProjectclass to read data from a database which is specified by the instance of theDbSettingsclass.Project(InputStream stream)Initializes a new instance of theProjectclass from a stream.Project(InputStream stream, LoadOptions options)Initializes a new instance of theProjectclass from the Stream with the specified instance of theLoadOptionsclass.Project(InputStream stream, ParseErrorCallback parseErrorHandler)Initializes a new instance of theProjectclass from a template(existent mpp or mpt file).Project(InputStream stream, ParseErrorCallback parseErrorHandler, PrimaveraXmlReadingOptions options)Initializes a new instance of theProjectclass from the Stream with the specified instance of thePrimaveraXmlReadingOptionsclass.Project(InputStream stream, PrimaveraXmlReadingOptions options)Initializes a new instance of theProjectclass from the Stream with the specified instance of thePrimaveraXmlReadingOptionsclass.Project(InputStream stream, String protectionPassword)Initializes a new instance of theProjectclass from a template(existent mpp or mpt file).Project(String projectTemplate)Initializes a new instance of theProjectclass from a template (existent mpp or mpt file).Project(String projectTemplate, LoadOptions options)Initializes a new instance of theProjectclass from a template (existent mpp or mpt file) with the specified instance of theLoadOptionsclass.Project(String projectTemplate, ParseErrorCallback parseErrorHandler)Initializes a new instance of theProjectclass from a template (existent mpp or mpt file).Project(String projectTemplate, ParseErrorCallback parseErrorHandler, PrimaveraXmlReadingOptions options)Initializes a new instance of theProjectclass from a template (existent mpp or mpt file) with the specified instance of thePrimaveraXmlReadingOptionsclass.Project(String projectTemplate, PrimaveraXmlReadingOptions options)Initializes a new instance of theProjectclass from a template (existent MPP or MPT file) with the specified instance of thePrimaveraXmlReadingOptionsclass.Project(String projectTemplate, String protectionPassword)Initializes a new instance of theProjectclass from a password protected template (existent mpp or mpt file).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyTo(Project another)Copies project's main data and properties to another project.voidcopyTo(Project another, CopyToOptions options)Copies project's main data and properties to another project.<T> Tget(Key<T,Integer> key)Returns the value to which the property is mapped in this container.DategetBaselineSaveTime(int baselineNumber)Returns the baseline save time.BuiltInProjectPropertyCollectiongetBuiltInProps()Gets project's built-in properties collection.intgetCalculationMode()Gets calculation mode of a project.CalendarCollectiongetCalendars()GetsCalendarCollectionobject of this Project instance.TaskCollectiongetCriticalPath()Gets a collection which contains a list of Critical tasks which comprise Critical Path of this project.CustomProjectPropertyCollectiongetCustomProps()Gets project's custom properties collection.ViewgetDefaultView()Gets default view of the project.WeekDayCollectiongetDefaultWeekWorkingDays()Gets the instance ofWeekDayCollectionclass which represents a collection of project default week working days and working times.ProjectDisplayOptionsgetDisplayOptions()Gets an instance of theProjectDisplayOptionsclass.DurationgetDuration(double val)GetsDurationobject with the specified number of units and default duration format which is defined in project's settingsPrj.DURATION_FORMAT.DurationgetDuration(double val, int timeUnit)GetsDurationobject with the specified number ofTimeUnitTypeunits.ExtendedAttributeDefinitionCollectiongetExtendedAttributes()Gets ExtendedAttributeDefinitionCollection object.OleObjectCollectiongetOleObjects()Gets a collection containing the instances of theOleObjectclass which are linked or embedded to this project file.OutlineCodeDefinitionCollectiongetOutlineCodes()Gets OutlineCodeDefinitionCollection object.intgetPageCount()Returns page count for the project to be rendered using defaultTimescale(Days).intgetPageCount(int format, int scale)Returns page count for the project to be rendered using givenTimescaleandPresentationFormat.intgetPageCount(SaveOptions saveOptions)Returns page count for the project to be rendered using givenSaveOptions.intgetPageCount_PageSize(int pageSize, int scale)intgetPageCount_PageSize(int pageSize, int scale, Date startDate, Date endDate)Returns page count for the project to be rendered using givenTimescale,PresentationFormatand date range.intgetPageCount_PresentationFormat(int format)Returns page count for the project to be rendered using defaultTimescale(Days) and givenPresentationFormatintgetPageCount_Timescale(int scale)Returns page count for the project to be rendered using givenTimescale.TaskLinkCollectiongetPredecessors(Task task)Returns a collection of task links which are predecessors of the specified task.static ProjectFileInfogetProjectFileInfo(InputStream stream)Gets project file info from the stream.static ProjectFileInfogetProjectFileInfo(String filename)Read project file info from the file.ResourceAssignmentCollectiongetResourceAssignments()Gets ResourceAssignmentCollection object.FilterCollectiongetResourceFilters()Gets all the resource-based filter definitions.GroupCollectiongetResourceGroups()Gets all of the resource-based group definitions.ResourceCollectiongetResources()Gets ResourceCollection object.TaskgetRootTask()Gets the root of the tree of tasks.TableCollectiongetTables()Gets a list ofTableobjects.FilterCollectiongetTaskFilters()Gets all the task-based filter definitions.GroupCollectiongetTaskGroups()Gets all the task-based group definitions.TaskLinkCollectiongetTaskLinks()GetsTaskLinkCollectionobject.VbaProjectgetVbaProject()ViewCollectiongetViews()Gets a list ofViewobjects.WBSCodeDefinitiongetWBSCodeDefinition()Gets WBS Code Definition for the project.DurationgetWork(double val)GetsDurationobject with the specifieddoublevalue and default work format.voidprint()Prints project to the default printer with default printer settings using the standard (no User Interface) print controller.voidprint(PrinterSettings printerSettings)Prints project according to the specified printer settings using the standard (no User Interface) print controller.voidprint(PrinterSettings printerSettings, PrintOptions options)Prints project according to the specified printer settings and custom save options using the standard (no User Interface) print controller.voidprint(PrinterSettings printerSettings, PrintOptions options, String documentName)Prints project according to the specified printer settings, custom save options and the specified document name using the standard (no User Interface) print controller.voidprint(PrinterSettings printerSettings, String documentName)Prints project according to the specified printer settings using the standard (no User Interface) print controller.voidprint(PrintOptions options)Prints project to the default printer with default printer settings and custom save options using the standard (no User Interface) print controller.voidprint(String printerName)Prints project to the specified printer with default printer settings using the standard (no User Interface) print controller.voidrecalculate()Reschedules all project tasks ids, outline levels, start/finish dates, sets early/late dates, calculates slacks, work and cost fields.voidrecalculate(boolean validate)Reschedules all project tasks ids, outline levels, start/finish dates, sets early/late dates, calculates slacks, work and cost fields with optional validation.voidrecalculateResourceFields()Recalculates Id, Start and Finish of resources.voidrecalculateResourceStartFinish()Recalculates Start and Finish of resources.voidremoveInvalidResourceAssignments()Eliminates invalid resource assignments from the project resource assignments list.voidrenumberWBSCode()Renumber WBS code of all tasks.voidrenumberWBSCode(List<Integer> taskIds)Renumber WBS code of passed tasks.voidrescheduleUncompletedWorkToStartAfter(Date after)Reschedules uncompleted project work to start after a specified date.voidrescheduleUncompletedWorkToStartAfter(Date after, List<Task> taskCollection)Reschedules uncompleted work for a specified list of tasks to start after a specified date.voidsave(OutputStream stream, int format)Saves the project data to the stream.voidsave(OutputStream stream, MPPSaveOptions options)Saves the project to a stream using the specified save options.voidsave(OutputStream stream, SaveOptions options)Saves the project to a stream using the specified save options.voidsave(String filename)Saves the project data to the file in mpp format.voidsave(String filename, int format)Saves the project data to the file.voidsave(String filename, MPPSaveOptions options)Saves the document to mpp file format using the specified save options.voidsave(String filename, SaveOptions options)Saves the document to a file using the specified save options.voidsaveAsTemplate(OutputStream stream)Saves the project as a template to a specified stream.voidsaveAsTemplate(OutputStream stream, SaveTemplateOptions options)Saves the project as a template to a specified stream.voidsaveAsTemplate(String fileName)Saves the project as a template to the specified file path.voidsaveAsTemplate(String fileName, SaveTemplateOptions options)Saves the project as a template.voidsaveReport(OutputStream stream)Saves the project overview report to the stream.voidsaveReport(OutputStream stream, int reportType)Saves the project report of the specified type to the specified stream.voidsaveReport(String fileName)Saves the project overview report to PDF file.voidsaveReport(String fileName, int reportType)Saves the project report of the specified type in PDF format to the specified file path.List<Task>selectAllChildTasks()Recursively collects all child tasks of the root task.voidset(Key<Date,Integer> key, Date val)Maps the specified property to the specified value in this container.<T> voidset(Key<T,Integer> key, T val)Maps the specified property to the specified value in this container.voidsetBaseline(int baselineType)Saves baseline fields to the specified baseline for the entire project.voidsetBaseline(int baselineType, Iterable<Task> taskCollection)Saves baseline fields to the specified baseline for the selected tasks.voidsetBaselineSaveTime(int baselineNumber, Date value)Sets the baseline save time.voidsetCalculationMode(int value)Sets calculation mode of a project.voidsetDefaultView(View value)Sets default view of the project.voidsetWBSCodeDefinition(WBSCodeDefinition value)Sets WBS Code Definition for the project.voidupdateProjectWorkAsComplete(Date completeThrough, boolean setZeroOrHundredPercentCompleteOnly)Updates all work as complete through a specified date for the entire project.voidupdateProjectWorkAsComplete(Date completeThrough, boolean setZeroOrHundredPercentCompleteOnly, List<Task> taskCollection)Updates all work as complete through a specified date for the specified list of tasks.
-
-
-
Constructor Detail
-
Project
public Project()
Initializes a new instance of the
Projectclass.
-
Project
public Project(String projectTemplate, String protectionPassword)
Initializes a new instance of the
Projectclass from a password protected template (existent mpp or mpt file).- Parameters:
projectTemplate- Path to template to create project from.protectionPassword- Protection password.
Reading password protected files currently supported for MSP 2003 file format only.
-
Project
public Project(String projectTemplate)
Initializes a new instance of the
Projectclass from a template (existent mpp or mpt file).- Parameters:
projectTemplate- Path to template to create project from.
-
Project
public Project(InputStream stream, PrimaveraXmlReadingOptions options)
Initializes a new instance of the
Projectclass from the Stream with the specified instance of thePrimaveraXmlReadingOptionsclass.- Parameters:
stream- Stream of the ProjectInputStreamclassoptions- the specified instance of thePrimaveraXmlReadingOptionsclass
-
Project
public Project(InputStream stream, ParseErrorCallback parseErrorHandler, PrimaveraXmlReadingOptions options)
Initializes a new instance of the
Projectclass from the Stream with the specified instance of thePrimaveraXmlReadingOptionsclass.- Parameters:
stream- Stream of the ProjectInputStreamclassparseErrorHandler- the specified callback method to handle xml parse errorsoptions- the specified instance of thePrimaveraXmlReadingOptionsclass
-
Project
public Project(String projectTemplate, ParseErrorCallback parseErrorHandler)
Initializes a new instance of the
Projectclass from a template (existent mpp or mpt file).- Parameters:
projectTemplate- Path to template to create project from.parseErrorHandler- the specified callback method to handle xml parse errors.
-
Project
public Project(InputStream stream)
Initializes a new instance of the
Projectclass from a stream.- Parameters:
stream-InputStreamto load a template from.
-
Project
public Project(String projectTemplate, PrimaveraXmlReadingOptions options)
Initializes a new instance of the
Projectclass from a template (existent MPP or MPT file) with the specified instance of thePrimaveraXmlReadingOptionsclass.- Parameters:
projectTemplate- Path to template to create project fromoptions- the specified instance of thePrimaveraXmlReadingOptionsclass.
-
Project
public Project(String projectTemplate, ParseErrorCallback parseErrorHandler, PrimaveraXmlReadingOptions options)
Initializes a new instance of the
Projectclass from a template (existent mpp or mpt file) with the specified instance of thePrimaveraXmlReadingOptionsclass.- Parameters:
projectTemplate- Path to template to create project fromparseErrorHandler- the specified callback method to handle xml parse errorsoptions- the specified instance of thePrimaveraXmlReadingOptionsclass.
-
Project
public Project(DbSettings settings)
Initializes a new instance of the
Projectclass to read data from a database which is specified by the instance of theDbSettingsclass.- Parameters:
settings- the specified instance of theDbSettingsclass.
-
Project
public Project(InputStream stream, ParseErrorCallback parseErrorHandler)
Initializes a new instance of the
Projectclass from a template(existent mpp or mpt file).- Parameters:
stream-InputStreamto load a template from.parseErrorHandler- the specified callback method to handle xml parse errors.
-
Project
public Project(InputStream stream, String protectionPassword)
Initializes a new instance of the
Projectclass from a template(existent mpp or mpt file).- Parameters:
stream-InputStreamto load a template from.protectionPassword- Protection password.
Reading password protected files currently supported for MSP 2003 file format only.
-
Project
public Project(String projectTemplate, LoadOptions options)
Initializes a new instance of the
Projectclass from a template (existent mpp or mpt file) with the specified instance of theLoadOptionsclass.- Parameters:
projectTemplate- Path to template to create project fromoptions- the specified instance of theLoadOptionsclass.
-
Project
public Project(InputStream stream, LoadOptions options)
Initializes a new instance of the
Projectclass from the Stream with the specified instance of theLoadOptionsclass.- Parameters:
stream- Stream of the ProjectInputStreamclassoptions- the specified instance of theLoadOptionsclass
-
-
Method Detail
-
copyTo
public final void copyTo(Project another)
Copies project's main data and properties to another project.
- Parameters:
another- Another project to copy data to.
-
copyTo
public final void copyTo(Project another, CopyToOptions options)
Copies project's main data and properties to another project.
- Parameters:
another- Another project to copy data to.options- Copy options to control copy process.
-
get
public final <T> T get(Key<T,Integer> key)
Returns the value to which the property is mapped in this container.
- Parameters:
key- the specified property key.Prjfor getting the property key.T: the type of the mapped value.- Returns:
- the value to which the property is mapped in this container.
-
getBaselineSaveTime
public final Date getBaselineSaveTime(int baselineNumber)
Returns the baseline save time. Returns DateTime.MinValue (00:00:00.0000000 UTC, 1st January 0001) if the baseline was not saved.
- Parameters:
baselineNumber- The baseline's numberBaselineType.- Returns:
- The baseline's last save date and time.
-
getBuiltInProps
public final BuiltInProjectPropertyCollection getBuiltInProps()
Gets project's built-in properties collection.
- Returns:
- project's built-in properties collection.
-
getCalculationMode
public final int getCalculationMode()
Gets calculation mode of a project. Can be one of the values of
CalculationMode(getCalculationMode()/setCalculationMode(int)) enumeration.- Returns:
- calculation mode of a project.
-
setCalculationMode
public final void setCalculationMode(int value)
Sets calculation mode of a project. Can be one of the values of
CalculationMode(getCalculationMode()/setCalculationMode(int)) enumeration.- Parameters:
value- calculation mode of a project.
-
getCalendars
public final CalendarCollection getCalendars()
Gets
CalendarCollectionobject of this Project instance.- Returns:
CalendarCollectionobject of this Project instance.
-
getCriticalPath
public final TaskCollection getCriticalPath()
Gets a collection which contains a list of Critical tasks which comprise Critical Path of this project.
- Returns:
- a collection which represents a list of all critical tasks.
This is an O(n) operation, where n is the number of tasks in the project.
-
getCustomProps
public final CustomProjectPropertyCollection getCustomProps()
Gets project's custom properties collection.
- Returns:
- project's custom properties collection.
-
getDefaultView
public final View getDefaultView()
Gets default view of the project.
- Returns:
- default view of the project.
-
setDefaultView
public final void setDefaultView(View value)
Sets default view of the project.
- Parameters:
value- default view of the project.
-
getDefaultWeekWorkingDays
public final WeekDayCollection getDefaultWeekWorkingDays()
Gets the instance of
WeekDayCollectionclass which represents a collection of project default week working days and working times.- Returns:
- The instance of
WeekDayCollectionclass which contains a list ofWeekDayobjects.
The data contains only in mpp files (not in xml).
-
getDisplayOptions
public final ProjectDisplayOptions getDisplayOptions()
Gets an instance of the
ProjectDisplayOptionsclass.- Returns:
- an instance of the
ProjectDisplayOptionsclass.
-
getDuration
public final Duration getDuration(double val)
Gets
Durationobject with the specified number of units and default duration format which is defined in project's settingsPrj.DURATION_FORMAT.- Parameters:
val- specified number of units.- Returns:
- Duration object.
-
getDuration
public final Duration getDuration(double val, int timeUnit)
Gets
Durationobject with the specified number ofTimeUnitTypeunits.- Parameters:
val- specified number of units.timeUnit- specified TimeUnitType value.- Returns:
- Duration object.
-
getExtendedAttributes
public final ExtendedAttributeDefinitionCollection getExtendedAttributes()
Gets ExtendedAttributeDefinitionCollection object. The collection of extended attribute (custom fields) definitions associated with a project.
- Returns:
- ExtendedAttributeDefinitionCollection object.
-
getOleObjects
public final OleObjectCollection getOleObjects()
Gets a collection containing the instances of the
OleObjectclass which are linked or embedded to this project file.
Available for mpp file format only. This collection is read-only except for 'Clear' operation.- Returns:
- a collection containing the instances of the
OleObjectclass which are linked or embedded to this project file.
-
getOutlineCodes
public final OutlineCodeDefinitionCollection getOutlineCodes()
Gets OutlineCodeDefinitionCollection object. The collection of outline code definitions associated with a project.
- Returns:
- OutlineCodeDefinitionCollection object.
-
getPageCount
public final int getPageCount(SaveOptions saveOptions)
Returns page count for the project to be rendered using given
SaveOptions.In this example instance of HtmlSaveOptions and the number of pages in resulting HTML is written to the console.
[C#] Project project = new Project(@"test.mpp"); HtmlSaveOptions saveOptions = new HtmlSaveOptions { IncludeProjectNameInPageHeader = false, IncludeProjectNameInTitle = false, PageSize = PageSize.A4, Timescale = Timescale.Days, StartDate = project.Get(Prj.StartDate).Date, EndDate = project.Get(Prj.FinishDate).Date }; Console.WriteLine(project.GetPageCount(saveOptions));- Parameters:
saveOptions- The save options to get page count for.- Returns:
- a page count to be rendered.
-
getPageCount
public final int getPageCount()
Returns page count for the project to be rendered using default
Timescale(Days).- Returns:
- Page count to be rendered.
-
getPageCount_PageSize
public final int getPageCount_PageSize(int pageSize, int scale, Date startDate, Date endDate)Returns page count for the project to be rendered using given
Timescale,PresentationFormatand date range.
-
getPageCount_PageSize
public final int getPageCount_PageSize(int pageSize, int scale)
-
getPageCount_PresentationFormat
public final int getPageCount_PresentationFormat(int format)
Returns page count for the project to be rendered using default
Timescale(Days) and givenPresentationFormat- Parameters:
format-PresentationFormatto get page count for.- Returns:
- Page count to be rendered.
-
getPageCount_Timescale
public final int getPageCount_Timescale(int scale)
Returns page count for the project to be rendered using given
Timescale.- Parameters:
scale-Timescaleto get page count for.- Returns:
- Page count to be rendered.
-
getPageCount
public final int getPageCount(int format, int scale)Returns page count for the project to be rendered using given
TimescaleandPresentationFormat.- Parameters:
format-PresentationFormatto get page count for.scale-Timescaleto get page count for.- Returns:
- Page count to be rendered.
-
getPredecessors
public final TaskLinkCollection getPredecessors(Task task)
Returns a collection of task links which are predecessors of the specified task.
- Parameters:
task- The task to get predecessors for.- Returns:
- List of predecessors
TaskLink.
-
getProjectFileInfo
public static ProjectFileInfo getProjectFileInfo(String filename)
Read project file info from the file.
- Parameters:
filename- The project filename.- Returns:
- The project file info
ProjectFileInfo.
-
getProjectFileInfo
public static ProjectFileInfo getProjectFileInfo(InputStream stream)
Gets project file info from the stream.
- Parameters:
stream- The data stream.- Returns:
- The project file info
ProjectFileInfo.
-
getResourceAssignments
public final ResourceAssignmentCollection getResourceAssignments()
Gets ResourceAssignmentCollection object.
- Returns:
- ResourceAssignmentCollection object.
-
getResourceFilters
public final FilterCollection getResourceFilters()
Gets all the resource-based filter definitions. ResourceFilters is a collection of
Filterobjects.- Returns:
- all the resource-based filter definitions.
-
getResourceGroups
public final GroupCollection getResourceGroups()
Gets all of the resource-based group definitions. ResourceGroups is a collection of
Groupobjects.- Returns:
- all of the resource-based group definitions.
-
getResources
public final ResourceCollection getResources()
Gets ResourceCollection object.
- Returns:
- ResourceCollection object.
-
getRootTask
public final Task getRootTask()
Gets the root of the tree of tasks.
- Returns:
- the root of the tree of tasks.
-
getTables
public final TableCollection getTables()
Gets a list of
Tableobjects.- Returns:
- a list of
Tableobjects.
-
getTaskFilters
public final FilterCollection getTaskFilters()
Gets all the task-based filter definitions. TaskFilters is a collection of
Filterobjects.- Returns:
- all the task-based filter definitions.
-
getTaskGroups
public final GroupCollection getTaskGroups()
Gets all the task-based group definitions. TaskGroups is a collection of
Groupobjects.- Returns:
- all the task-based group definitions.
-
getTaskLinks
public final TaskLinkCollection getTaskLinks()
Gets
TaskLinkCollectionobject.- Returns:
TaskLinkCollectionobject.
-
getVbaProject
public final VbaProject getVbaProject()
Gets an instance of
VbaProject(getVbaProject()/setVbaProject(VbaProject)) class.- Returns:
- an instance of
VbaProject(getVbaProject()/setVbaProject(VbaProject)) class.
-
getViews
public final ViewCollection getViews()
Gets a list of
Viewobjects.- Returns:
- a list of
Viewobjects.
-
getWBSCodeDefinition
public final WBSCodeDefinition getWBSCodeDefinition()
Gets WBS Code Definition for the project.
- Returns:
- WBS Code Definition for the project.
-
setWBSCodeDefinition
public final void setWBSCodeDefinition(WBSCodeDefinition value)
Sets WBS Code Definition for the project.
- Parameters:
value- WBS Code Definition for the project.
-
getWork
public final Duration getWork(double val)
Gets
Durationobject with the specifieddoublevalue and default work format.- Parameters:
val- specified double value.- Returns:
- Duration object.
-
print
public final void print()
Prints project to the default printer with default printer settings using the standard (no User Interface) print controller.
-
print
public final void print(PrintOptions options)
Prints project to the default printer with default printer settings and custom save options using the standard (no User Interface) print controller.
- Parameters:
options- the specified instance of thePrintOptionsclass.
-
print
public final void print(String printerName)
Prints project to the specified printer with default printer settings using the standard (no User Interface) print controller.
- Parameters:
printerName- Specified printer name.
-
print
public final void print(PrinterSettings printerSettings)
Prints project according to the specified printer settings using the standard (no User Interface) print controller.
- Parameters:
printerSettings- the specified instance of thePrinterSettingsclass.
-
print
public final void print(PrinterSettings printerSettings, String documentName)
Prints project according to the specified printer settings using the standard (no User Interface) print controller.
- Parameters:
printerSettings- the specified instance of thePrinterSettingsclass.documentName- the document name to display (for example, in a print status dialog box or printer queue).
-
print
public final void print(PrinterSettings printerSettings, PrintOptions options)
Prints project according to the specified printer settings and custom save options using the standard (no User Interface) print controller.
- Parameters:
printerSettings- the specified instance of thePrinterSettingsclass.options- the specified instance of thePrintOptionsclass.
-
print
public final void print(PrinterSettings printerSettings, PrintOptions options, String documentName)
Prints project according to the specified printer settings, custom save options and the specified document name using the standard (no User Interface) print controller.
- Parameters:
printerSettings- the specified instance of thePrinterSettingsclass.options- the specified instance of thePrintOptionsclass.documentName- the document name to display (for example, in a print status dialog box or printer queue).
-
recalculate
public final void recalculate()
Reschedules all project tasks ids, outline levels, start/finish dates, sets early/late dates, calculates slacks, work and cost fields.
-
recalculate
public final void recalculate(boolean validate)
Reschedules all project tasks ids, outline levels, start/finish dates, sets early/late dates, calculates slacks, work and cost fields with optional validation.
- Parameters:
validate- If true the validation of recalculation will be performed. What data is validated: At the moment only basic validation of task and task link date ranges is implemented. Task's date ranges (e.g. ActualStart - ActualFinish, EarlyStart - EarlyFinish, etc.) as well as Task Links dates will be checked against the date criteria that start date is less or equal than finish date. If any of conditions described above is failed thenRecalculationValidationExceptionwill be thrown.
-
recalculateResourceFields
public final void recalculateResourceFields()
Recalculates Id, Start and Finish of resources.
-
recalculateResourceStartFinish
public final void recalculateResourceStartFinish()
Recalculates Start and Finish of resources.
-
removeInvalidResourceAssignments
public final void removeInvalidResourceAssignments()
Eliminates invalid resource assignments from the project resource assignments list.
MS Project creates an empty resource assignment for each task. Call the method to remove them.
-
renumberWBSCode
public final void renumberWBSCode()
Renumber WBS code of all tasks.
-
renumberWBSCode
public final void renumberWBSCode(List<Integer> taskIds)
Renumber WBS code of passed tasks.
- Parameters:
taskIds- Task identifiers to renumber WBS codes.
-
rescheduleUncompletedWorkToStartAfter
public final void rescheduleUncompletedWorkToStartAfter(Date after)
Reschedules uncompleted project work to start after a specified date.
- Parameters:
after- The date to reschedule uncompleted work after.
Ensure that Project.CanSplitsInProgressTasks flag is set to true before using this method.
-
rescheduleUncompletedWorkToStartAfter
public final void rescheduleUncompletedWorkToStartAfter(Date after, List<Task> taskCollection)
Reschedules uncompleted work for a specified list of tasks to start after a specified date.
- Parameters:
after- The date to reschedule uncompleted work after.taskCollection- List<Task> of tasks to reschedule uncompleted work for.
Ensure that Project.CanSplitsInProgressTasks flag is set to true before using this method.
-
save
public final void save(String filename, MPPSaveOptions options) throws IOException
Saves the document to mpp file format using the specified save options.
- Parameters:
filename- The file name.options- The save options.- Throws:
IOException
-
save
public final void save(String filename, SaveOptions options) throws IOException
Saves the document to a file using the specified save options.
- Parameters:
filename- The file name.options- The save options.- Throws:
IOException
-
save
public final void save(String filename, int format) throws IOException
Saves the project data to the file.
- Parameters:
filename- The file name.format- The save file format.- Throws:
IOException
-
save
public final void save(String filename) throws IOException
Saves the project data to the file in mpp format.
- Parameters:
filename- The file name.- Throws:
IOException
-
save
public final void save(OutputStream stream, SaveOptions options) throws IOException
Saves the project to a stream using the specified save options.
- Parameters:
stream- The stream.options- The save options.- Throws:
IOException
-
save
public void save(OutputStream stream, MPPSaveOptions options) throws IOException
Saves the project to a stream using the specified save options.
- Parameters:
stream- The stream.options- The save options.- Throws:
IOException
-
save
public void save(OutputStream stream, int format) throws IOException
Saves the project data to the stream.
- Parameters:
stream- The stream.format- the specified save file format.SaveFileFormat- Throws:
IOException
-
saveAsTemplate
public void saveAsTemplate(String fileName, SaveTemplateOptions options) throws IOException
Saves the project as a template.
- Parameters:
fileName- The file name.options- the specified save optionsSaveTemplateOptions.- Throws:
IOException
-
saveAsTemplate
public final void saveAsTemplate(String fileName) throws IOException
Saves the project as a template to the specified file path.
- Parameters:
fileName- the specified file name.- Throws:
IOException
-
saveAsTemplate
public final void saveAsTemplate(OutputStream stream) throws IOException
Saves the project as a template to a specified stream.
- Parameters:
stream- the specified stream to save the project to.- Throws:
IOException
-
saveAsTemplate
public final void saveAsTemplate(OutputStream stream, SaveTemplateOptions options) throws IOException
Saves the project as a template to a specified stream.
- Parameters:
stream- Stream to save the project template to.options- the specified save optionsSaveTemplateOptions.- Throws:
IOException
-
saveReport
public final void saveReport(OutputStream stream) throws IOException
Saves the project overview report to the stream.
- Parameters:
stream- The stream to save project report to.- Throws:
IOException
-
saveReport
public final void saveReport(String fileName) throws IOException
Saves the project overview report to PDF file.
- Parameters:
fileName- The file name.- Throws:
IOException
-
saveReport
public void saveReport(OutputStream stream, int reportType) throws IOException
Saves the project report of the specified type to the specified stream.
- Parameters:
stream- the specified stream to save project report to.reportType- the specified report type.ReportType- Throws:
IOException
-
saveReport
public final void saveReport(String fileName, int reportType) throws IOException
Saves the project report of the specified type in PDF format to the specified file path.
- Parameters:
fileName- the specified file name.reportType- the specified report type.ReportType- Throws:
IOException
-
selectAllChildTasks
public final List<Task> selectAllChildTasks()
Recursively collects all child tasks of the root task.
- Returns:
- The collection of tasks.
-
set
public final <T> void set(Key<T,Integer> key, T val)
Maps the specified property to the specified value in this container.
- Parameters:
key- the specified property key.Prjfor getting the property key.val- the value.T: the type of the mapped value.
-
set
public final void set(Key<Date,Integer> key, Date val)
Maps the specified property to the specified value in this container.
- Parameters:
key- the specified property key.Prjfor getting the property key.val- the value.
-
setBaseline
public final void setBaseline(int baselineType)
Saves baseline fields to the specified baseline for the entire project.
- Parameters:
baselineType- The baseline type to save baseline data to.
-
setBaseline
public final void setBaseline(int baselineType, Iterable<Task> taskCollection)Saves baseline fields to the specified baseline for the selected tasks.
- Parameters:
baselineType- The baseline type to save baseline data to.taskCollection- List of tasks to save baseline data for.
-
setBaselineSaveTime
public final void setBaselineSaveTime(int baselineNumber, Date value)Sets the baseline save time.
- Parameters:
baselineNumber- The baseline's numberBaselineType.value- The baseline's last save date and time.
Set value to DateTime.MinValue if the baseline was not saved.
-
updateProjectWorkAsComplete
public final void updateProjectWorkAsComplete(Date completeThrough, boolean setZeroOrHundredPercentCompleteOnly)
Updates all work as complete through a specified date for the entire project.
- Parameters:
completeThrough- The date to update work as completed through.setZeroOrHundredPercentCompleteOnly- If set to true updates only those tasks as 100% complete whose finish date is before specified complete-through date. Otherwise, calculates a percentage complete value based on scheduled start and complete-through dates.
-
updateProjectWorkAsComplete
public final void updateProjectWorkAsComplete(Date completeThrough, boolean setZeroOrHundredPercentCompleteOnly, List<Task> taskCollection)
Updates all work as complete through a specified date for the specified list of tasks.
- Parameters:
completeThrough- The date to update work as completed through.setZeroOrHundredPercentCompleteOnly- If set to true updates only those tasks as 100% complete whose finish date is before specified complete-through date. Otherwise, calculates a percentage complete value based on scheduled start and complete-through dates.taskCollection- List<Task> of tasks to update work for.
-
-