public class Project extends Object
Represents a project.
How to create a simple project from scratch.// Create new empty project Project project = new Project(); project.setName("project name"); // Create calendars and add it to our project Calendar cal1 = Calendar.makeStandardCalendar(); cal1.setUid(1); Calendar cal2 = Calendar.makeStandardCalendar(); cal2.setUid(2); project.getCalendars().add(cal1); project.getCalendars().add(cal2); // Create 5 tasks Task task1 = new Task("task1", 10 * 24 * 60 * 60 * 1000 * 10000L); Task task2 = new Task("task2", 5 * 24 * 60 * 60 * 1000 * 10000L); Task task3 = new Task("task3", 3 * 24 * 60 * 60 * 1000 * 10000L); Task task4 = new Task("task4", 4 * 24 * 60 * 60 * 1000 * 10000L); Task task5 = new Task("task5", 5 * 24 * 60 * 60 * 1000 * 10000L); // Add first task as Root all other // tasks as it's children tasks project.setRootTask(task1); task1.getChildren().add(task2); task1.getChildren().add(task4); task1.getChildren().add(task5); task2.getChildren().add(task3); // Tasks 1,2 and 4 will use calendar 'Cal1' task1.setCalendar(cal1); task2.setCalendar(cal1); task4.setCalendar(cal1); // Tasks 3 and 5 will use calendar 'Cal2' task3.setCalendar(cal2); task5.setCalendar(cal2); // Task 5 will be started after the finish of Task 4 project.getTaskLinks().add(new TaskLink(task4, task5, TaskLinkType.FinishToStart)); // Create 2 resources and also add it to the project Resource res1 = new Resource("resource1"); res1.setUid(1); Resource res2 = new Resource("resource2"); res2.setUid(2); project.getResources().add(res1); project.getResources().add(res2); // Resource can use own customized calendars res1.setCalendar(cal2); res2.setCalendar(cal1); // Now assign resources to tasks project.getResourceAssignments().add(new ResourceAssignment(task2, res1)); project.getResourceAssignments().add(new ResourceAssignment(task4, res2)); project.getResourceAssignments().add(new ResourceAssignment(task3, res1)); // IDs and UIDs should be recalculated // after we finished project managing project.calcTaskIds(); project.calcTaskUids(); project.calcResourceIds(); project.calcResourceUids(); project.calcResourceAssignmentIds(); project.calcResourceAssignmentUids(); project.calcCalendarUids();
Modify existing project// load existing project ProjectReader reader = new ProjectReader(); InputStream rfs = new FileInputStream("testproj.mpp"); Project project = reader.read(rfs); // find task by ID Task task = project.getTaskById(9); // copy major properties Task newTask = new Task("My new task", 4 * 24 * 60 * 60 * 1000 * 10000L); newTask.setId(task.getId()); newTask.setUid(task.getUid()); newTask.setOutlineLevel(task.getOutlineLevel()); newTask.setOutlineNumber(task.getOutlineNumber()); newTask.setCalendar(task.getCalendar()); newTask.setParentTask(task.getParentTask()); // sets new duration in working hours newTask.setDuration(16 * 24 * 60 * 60 * 1000 * 10000L); // remove old task project.removeTask(task); // adds new task newTask.getParentTask().getChildren().add(newTask); // write new project ProjectWriter writer = new ProjectWriter(); OutputStream wfs = new FileOutputStream("testproj.xml"); writer.write(project, wfs, TasksDataFormat.XML);
How to convert from MPP to XML// Open existing project ProjectReader reader = new ProjectReader(); InputStream rfs = new FileInputStream("testproj.mpp"); Project project = reader.read(rfs); XmlWriter writer = new XmlWriter(); OutputStream wfs = new FileOutputStream("testproj.xml"); writer.write(project, wfs);
Constructor and Description |
---|
Project()
Default constructor.
|
Project(InputStream stream) |
Project(InputStream stream,
String protectionPassword) |
Project(String template)
Creates new project from a template(existent mpp or mpt file).
|
Project(String template,
String protectionPassword)
Creates new project from a password protected template(existent mpp or mpt file).
|
Modifier and Type | Method and Description |
---|---|
Resource |
addResource()
Adds new resource at the last position of a project resources collection.
|
Resource |
addResource(String resourceName)
Adds new resource at the last position of a project resources collection.
|
Resource |
addResource(String resourceName,
int beforeResourceId)
Adds new resource at the specified position of a project resources collection.
|
ResourceAssignment |
addResourceAssignment(Task task,
Resource resource)
Adds new assignment to a project ResourceAssignments collection.
|
ResourceAssignment |
addResourceAssignment(Task task,
Resource resource,
double units)
Adds new assignment to a project ResourceAssignments collection.
|
Task |
addTask()
Adds new task to project tasks collection on the same outline level of the last task.
|
Task |
addTask(int beforeTaskId)
Inserts new task before task with provided id and on the same outline level.
|
Task |
addTask(String taskName)
Adds new task to project tasks collection on the same outline level of the last task.
|
Task |
addTask(String taskName,
int beforeTaskId)
Inserts new task before task with provided id and on the same outline level.
|
void |
addTaskLink(TaskLink link)
Add a task link to a project.
|
void |
calcCalendarUids()
Recalculate Uids of calendars from 0 up to calendars collection length - 1.
|
void |
calcCalendarUids(int start)
Recalculate Uids of calendars from start value.
|
void |
calcResourceAssignmentIds()
Recalculate Ids of resource assignemnts.
|
void |
calcResourceAssignmentUids()
Recalculate Uids of resource assignments from 0 up to resource assignments collection
length - 1.
|
void |
calcResourceAssignmentUids(int start)
Recalculate Uids of resource assignments from start value.
|
void |
calcResourceFields()
Recalculates Id, Start and Finish of resources.
|
void |
calcResourceIds()
Recalculate Ids of resources.
|
void |
calcResourceStartFinish()
Recalculates Start and Finish of resources.
|
void |
calcResourceUids()
Recalculate Uids of resources from 0 up to resources collection length - 1.
|
void |
calcResourceUids(int start)
Recalculate Uids of resources from start value.
|
void |
calcSlacks()
Calculates slacks of project tasks based on task early/late dates and sets tasks critical flag.
|
void |
calcTaskIds()
Recalculate Ids of tasks.
|
void |
calcTaskUids()
Recalculate Uids of tasks (from 0).
|
void |
calculateCriticalPath()
Calculates EarlyDates, LateDates, Start, Finish and TotalSlacks of each task
and determines critical path of project based on calculated values.
|
boolean |
canSplitsInProgressTasks()
Determines whether in-progress tasks can be split.
|
void |
canSplitsInProgressTasks(boolean value) |
boolean |
check()
Checks the project's structure.
|
void |
copyTo(Project another)
Copies project's main data and properties to another project.
|
IRenderResult |
export(int renderFormat,
int presentationFormat,
OutputStream stream,
IRenderParam param)
Deprecated.
|
IRenderResult |
export(int renderFormat,
int presentationFormat,
OutputStream stream,
IRenderParam param,
boolean expandAll,
List arrayExpanded)
Deprecated.
|
IRenderResult |
export(int renderFormat,
int presentationFormat,
OutputStream stream,
IRenderParam param,
boolean expandAll,
List arrayExpanded,
ProjectView view)
Deprecated.
|
IRenderResult |
export(int renderFormat,
int presentationFormat,
String filename,
IRenderParam param)
Deprecated.
|
IRenderResult |
export(int renderFormat,
int presentationFormat,
String filename,
IRenderParam param,
boolean expandAll,
List arrayExpanded) |
IRenderResult |
export(int renderFormat,
int presentationFormat,
String filename,
IRenderParam param,
boolean expandAll,
List arrayExpanded,
ProjectView view) |
boolean |
getActualsInSync()
Determines whether all actual works have been synchronized with the project.
|
boolean |
getAdminProject()
Determines whether a project is an administrative project.
|
boolean |
getAreEditableActualCosts()
Determines whether actual costs are editable.
|
boolean |
getAreNewTasksEffortDriven()
Determines whether new tasks are effort driven.
|
boolean |
getAreNewTasksEstimated()
Determines whether an estimated duration is shown by default.
|
String |
getAuthor()
The author of a project.
|
boolean |
getAutoAddNewResourcesAndTasks()
Determines whether new resources or tasks automatically added to a resource or task pool.
|
boolean |
getAutolink()
Determines whether inserted or moved tasks are autolinked.
|
int |
getBaselineForEarnedValue()
The specific baseline used to calculate Variance values.
|
Date |
getBaselineSaveTime(int baselineNumber) |
boolean |
getCalculateAfterEdit()
Determines whether to recalculate the project dependent fields automatically.
|
Calendar |
getCalendar()
The project calendar.
|
Calendar |
getCalendarByName(String name)
Returns a calendar with the specified name.
|
Calendar |
getCalendarByUid(int uid)
Returns a calendar with the specified Uid.
|
List<Calendar> |
getCalendars() |
String |
getCategory()
The category of a project.
|
String |
getComments()
Project's comments.
|
String |
getCompany()
The company where a project was created.
|
Date |
getCreationDate() |
List<Task> |
getCriticalPath() |
int |
getCriticalSlackLimit()
The number of days to the end of a task when Microsoft Project
marks that task as a critical task.
|
String |
getCurrencyCode()
The three letter currency character code as defined in ISO 4217.
|
int |
getCurrencyDigits()
The number of digits after a decimal symbol.
|
String |
getCurrencySymbol()
The currency symbol used in a project.
|
int |
getCurrencySymbolPosition()
The position of a currency symbol.
|
Date |
getCurrentDate() |
Map |
getCustomProperties() |
int |
getDaysPerMonth()
The number of days per month.
|
Date |
getDefaultFinishTime() |
int |
getDefaultFixedCostAccrual()
The default type when fixed costs are accrued.
|
double |
getDefaultOvertimeRate()
The default overtime rate for new resources.
|
double |
getDefaultStandardRate()
The default standard rate for new resources.
|
Date |
getDefaultStartTime() |
int |
getDefaultTaskEVMethod()
The default earned value method for tasks.
|
int |
getDefaultTaskType()
The default type of new tasks.
|
List<WeekDay> |
getDefaultWeekWorkingDays() |
int |
getDurationFormat()
The format for expressing the bulk duration.
|
int |
getEarnedValueMethod()
The default method for calculating earned value.
|
ExtendedAttributeDefinition |
getExtendedAttributeDefinitionById(int id)
Returns an extended attribute definition by id
|
List<ExtendedAttributeDefinition> |
getExtendedAttributes() |
Date |
getExtendedCreationDate() |
Date |
getFinishDate() |
boolean |
getFiscalYearStart()
Determines whether the fiscal year numbering is used.
|
int |
getFyStartDate()
The month when fiscal year is starting.
|
boolean |
getHonorConstraints()
Determines whether tasks honour their constraint dates.
|
String |
getHyperlinkBase()
Project's hyperlink base.
|
boolean |
getKeepTaskOnNearestWorkingTimeWhenMadeAutoScheduled()
Determines whether manual tasks must be kept on nearest working time when made as auto scheduled.
|
String |
getKeywords()
Project's keywords.
|
String |
getLastAuthor()
Project's last author.
|
Date |
getLastPrinted() |
Date |
getLastSaved() |
String |
getManager()
The manager of a project.
|
boolean |
getMicrosoftProjectServerURL()
Determines whether a project was created by a Project Server user as opposed to an NT user.
|
int |
getMinutesPerDay()
The number of minutes per day.
|
int |
getMinutesPerWeek()
The number of minutes per week.
|
boolean |
getMoveCompletedEndsBack()
Determines whether the end of completed portions of tasks scheduled to start
after the status date but started earlier should be moved back to the status date.
|
boolean |
getMoveCompletedEndsForward()
Determines whether the end of completed portions of tasks scheduled
to have been completed before the status date but begun later
should be moved up to the status date.
|
boolean |
getMoveRemainingStartsBack()
Determines whether the beginning of remaining portions of tasks scheduled to start
after the status date but started earlier should be moved back to the status date.
|
boolean |
getMoveRemainingStartsForward()
Determines whether the beginning of remaining portions of tasks
scheduled to have begun later should be moved up to the status date.
|
boolean |
getMultipleCriticalPaths()
Determines whether multiple critical paths are calculated.
|
String |
getName()
The name of a project.
|
boolean |
getNewTasksAreManual()
Determines whether new tasks created as manual.
|
int |
getNewTaskStartDate()
The default start date type for new tasks.
|
int |
getNextCalendarUid()
Returns next Calendar Uid.
|
int |
getNextResourceAssignmentUid()
Returns next Resource assignment Uid.
|
int |
getNextResourceUid()
Returns next Resource Uid.
|
int |
getNextTaskUid()
Returns next Task Uid.
|
List<OutlineCodeDefinition> |
getOutlineCodes() |
int |
getPageCount_PresentationFormat(int format)
Returns page count for the project to be rendered using default
Timescale (Days) and given PresentationFormat
|
int |
getPageCount_Timescale(int scale)
Returns page count for the project to be rendered using given
Timescale . |
int |
getPageCount()
Returns page count for the project to be rendered using default
Timescale (Days). |
int |
getPageCount(int format,
int scale)
Returns page count for the project to be rendered using given
Timescale and PresentationFormat . |
List<TaskLink> |
getPredecessors(Task task) |
boolean |
getRemoveFileProperties()
Determines whether all file properties will be removed on save.
|
ResourceAssignment |
getResourceAssignmentByUid(int uid)
Returns a resource assignment with the specified Uid.
|
List<ResourceAssignment> |
getResourceAssignments() |
List<ResourceAssignment> |
getResourceAssignmentsByResource(Resource resource) |
List<ResourceAssignment> |
getResourceAssignmentsByTask(Task task) |
Resource |
getResourceByUid(int uid)
Returns a resource with the specified Uid.
|
List<Resource> |
getResources() |
int |
getRevision()
The number of times a project was saved.
|
Task |
getRootTask()
The root of the tree of tasks.
|
int |
getSaveVersion()
The version of Microsoft Office Project from which a project file was saved.
|
Date |
getStartDate() |
Date |
getStatusDate() |
String |
getSubject()
The subject of a project.
|
Task |
getTaskById(int id)
Returns a task with the specified Id.
|
Task |
getTaskByUid(int uid)
Returns a task with the specified Uid.
|
List<TaskLink> |
getTaskLinks() |
boolean |
getTaskUpdatesResource()
Determines whether updates to tasks update resources.
|
String |
getTemplate()
Project's template.
|
String |
getTitle()
The title of a project.
|
String |
getUid()
The unique Id of a project.
|
boolean |
getUpdateManuallyScheduledTasksWhenEditingLinks()
Determines whether manual tasks must be updated when links were edited.
|
int |
getWeekStartDay()
First day of a week.
|
int |
getWorkFormat()
The default work unit format.
|
boolean |
isInsertedProjectsLikeSummary()
Determines whether subtasks are calculated as summary tasks.
|
void |
isInsertedProjectsLikeSummary(boolean value) |
boolean |
isScheduleFromStart()
Determines whether the project is schduled from the start date or from finish date.
|
void |
isScheduleFromStart(boolean value) |
boolean |
isSpreadActualCost()
Determines whether actual costs are spread to the status date.
|
void |
isSpreadActualCost(boolean value) |
boolean |
isSpreadPercentComplete()
Determines whether a percent complete is spread to the status date.
|
void |
isSpreadPercentComplete(boolean value) |
void |
print()
Prints project to the default printer with default printer settings using the standard (no User Interface) print controller.
|
void |
print(com.aspose.ms.System.Drawing.Printing.PrinterSettings printerSettings)
Prints project according to the specified printer settings using the standard (no User Interface) print controller.
|
void |
print(com.aspose.ms.System.Drawing.Printing.PrinterSettings printerSettings,
PrintOptions options)
Prints project according to the specified printer settings and custom save options using the standard (no User Interface) print controller.
|
void |
print(com.aspose.ms.System.Drawing.Printing.PrinterSettings printerSettings,
String documentName)
Prints project according to the specified printer settings using the standard (no User Interface) print controller.
|
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.
|
void |
print(String printerName)
Prints project to the specified printer with default printer settings using the standard (no User Interface) print controller.
|
Calendar |
removeCalendar(int uid)
Removes calendar from a project.
|
void |
removeInvalidResourceAssignments()
Eliminates invalid resource assignments from the project resource assignments list.
|
TaskLink |
removeLink(TaskLink link)
Removes task link from a project.
|
void |
removeResource(int uid)
Removes a resource and all it's references from a project.
|
ResourceAssignment |
removeResourceAssignment(ResourceAssignment ra)
Removes a resource assignment.
|
void |
removeTask(int id)
Removes a task with the specified id.
|
void |
removeTask(Task task)
Removes a task from a project and all references to it.
|
void |
removeTaskByUid(int uid)
Removes a task with the specified uid,
|
Calendar |
replaceCalendar(int uid,
Calendar newCal)
Replaces a calendar and all references to it.
|
void |
save(OutputStream stream,
int format) |
void |
save(OutputStream stream,
SaveOptions options) |
void |
save(String filename,
int format)
Saves the project data to the file.
|
void |
save(String filename,
SaveOptions options)
Saves the document to a file using the specified save options.
|
void |
saveAsTemplate(OutputStream stream) |
void |
saveAsTemplate(OutputStream stream,
SaveTemplateOptions options) |
void |
saveAsTemplate(String filename)
Saves the project as a template.
|
void |
saveAsTemplate(String filename,
SaveTemplateOptions options)
Saves the project as a template.
|
void |
saveReport(OutputStream stream) |
void |
saveReport(OutputStream stream,
int reportType) |
void |
saveReport(String filename)
Saves the project overview report to pdf file.
|
void |
saveReport(String filename,
int reportType)
Saves the project report to pdf file.
|
void |
setActualsInSync(boolean value) |
void |
setAdminProject(boolean value) |
void |
setAreEditableActualCosts(boolean value) |
void |
setAreNewTasksEffortDriven(boolean value) |
void |
setAreNewTasksEstimated(boolean value) |
void |
setAuthor(String value) |
void |
setAutoAddNewResourcesAndTasks(boolean value) |
void |
setAutolink(boolean value) |
void |
setBaseline(int baselineType)
Saves baseline fields to the specified baseline for the entire project.
|
void |
setBaseline(int baselineType,
List<Task> tasks) |
void |
setBaselineForEarnedValue(int value) |
void |
setCalculateAfterEdit(boolean value) |
void |
setCalendar(Calendar value) |
void |
setCalendars(List<Calendar> value) |
void |
setCategory(String value) |
void |
setComments(String value) |
void |
setCompany(String value) |
void |
setCreationDate(Date value) |
void |
setCriticalSlackLimit(int value) |
void |
setCurrencyCode(String value) |
void |
setCurrencyDigits(int value) |
void |
setCurrencySymbol(String value) |
void |
setCurrencySymbolPosition(int value) |
void |
setCurrentDate(Date value) |
void |
setCustomProperties(Map value) |
void |
setDaysPerMonth(int value) |
void |
setDefaultFinishTime(Date value) |
void |
setDefaultFixedCostAccrual(int value) |
void |
setDefaultOvertimeRate(double value) |
void |
setDefaultStandardRate(double value) |
void |
setDefaultStartTime(Date value) |
void |
setDefaultTaskEVMethod(int value) |
void |
setDefaultTaskType(int value) |
void |
setDefaultWeekWorkingDays(List<WeekDay> value) |
void |
setDurationFormat(int value) |
void |
setEarnedValueMethod(int value) |
void |
setExtendedAttributes(List<ExtendedAttributeDefinition> value) |
void |
setExtendedCreationDate(Date value) |
void |
setFinishDate(Date value) |
void |
setFiscalYearStart(boolean value) |
void |
setFyStartDate(int value) |
void |
setHonorConstraints(boolean value) |
void |
setHyperlinkBase(String value) |
void |
setKeepTaskOnNearestWorkingTimeWhenMadeAutoScheduled(boolean value) |
void |
setKeywords(String value) |
void |
setLastAuthor(String value) |
void |
setLastPrinted(Date value) |
void |
setLastSaved(Date value) |
void |
setManager(String value) |
void |
setMicrosoftProjectServerURL(boolean value) |
void |
setMinutesPerDay(int value) |
void |
setMinutesPerWeek(int value) |
void |
setMoveCompletedEndsBack(boolean value) |
void |
setMoveCompletedEndsForward(boolean value) |
void |
setMoveRemainingStartsBack(boolean value) |
void |
setMoveRemainingStartsForward(boolean value) |
void |
setMultipleCriticalPaths(boolean value) |
void |
setName(String value) |
void |
setNewTasksAreManual(boolean value) |
void |
setNewTaskStartDate(int value) |
void |
setOutlineCodes(List<OutlineCodeDefinition> value) |
void |
setRemoveFileProperties(boolean value) |
void |
setResourceAssignments(List<ResourceAssignment> value) |
void |
setResources(List<Resource> value) |
void |
setRevision(int value) |
void |
setRootTask(Task value) |
void |
setSaveVersion(int value) |
void |
setStartDate(Date value) |
void |
setStatusDate(Date value) |
void |
setSubject(String value) |
void |
setTaskUpdatesResource(boolean value) |
void |
setTemplate(String value) |
void |
setTitle(String value) |
void |
setUid(String value) |
void |
setUpdateManuallyScheduledTasksWhenEditingLinks(boolean value) |
void |
setWeekStartDay(int value) |
void |
setWorkFormat(int value) |
void |
updateReferences()
Updates
Task.ParentProject and Task.ParentTask properties of all tasks in a project. |
public Project()
Default constructor.
public Project(String template, String protectionPassword)
Creates new project from a password protected template(existent mpp or mpt file).
template
- Path to template to create project from.protectionPassword
- Protection password.
public Project(String template)
Creates new project from a template(existent mpp or mpt file).
template
- Path to template to create project from.public Project(InputStream stream)
public Project(InputStream stream, String protectionPassword)
public boolean getCalculateAfterEdit()
Determines whether to recalculate the project dependent fields automatically.
public void setCalculateAfterEdit(boolean value)
public int getSaveVersion()
The version of Microsoft Office Project from which a project file was saved.
Read/write int
.
public void setSaveVersion(int value)
public String getUid()
The unique Id of a project.
Read/write string
.
public void setUid(String value)
public String getTitle()
The title of a project.
Read/write string
.
public void setTitle(String value)
public String getSubject()
The subject of a project.
Read/write string
.
public void setSubject(String value)
public String getCategory()
The category of a project.
Read/write string
.
public void setCategory(String value)
public String getCompany()
The company where a project was created.
Read/write string
.
public void setCompany(String value)
public String getManager()
The manager of a project.
Read/write string
.
public void setManager(String value)
public String getAuthor()
The author of a project.
Read/write string
.
public void setAuthor(String value)
public Date getCreationDate()
public void setCreationDate(Date value)
public int getRevision()
The number of times a project was saved.
Read/write int
.
public void setRevision(int value)
public Date getLastSaved()
public void setLastSaved(Date value)
public boolean isScheduleFromStart()
Determines whether the project is schduled from the start date or from finish date.
Read/write bool
.
public void isScheduleFromStart(boolean value)
public Date getStartDate()
public void setStartDate(Date value)
public Date getFinishDate()
public void setFinishDate(Date value)
public int getFyStartDate()
The month when fiscal year is starting.
Read/write Month
.
public void setFyStartDate(int value)
public int getCriticalSlackLimit()
The number of days to the end of a task when Microsoft Project
marks that task as a critical task.
Read/write int
.
public void setCriticalSlackLimit(int value)
public int getCurrencyDigits()
The number of digits after a decimal symbol.
Read/write int
.
public void setCurrencyDigits(int value)
public String getCurrencySymbol()
The currency symbol used in a project.
Read/write string
.
public void setCurrencySymbol(String value)
public String getCurrencyCode()
The three letter currency character code as defined in ISO 4217.
Example of valid values is "USD".
Read/write string
.
public void setCurrencyCode(String value)
public int getCurrencySymbolPosition()
The position of a currency symbol.
Read/write CurrencySymbolPositionType
.
public void setCurrencySymbolPosition(int value)
public Calendar getCalendar()
The project calendar.
Read/write Aspose.Tasks.Calendar
.
public void setCalendar(Calendar value)
public Date getDefaultStartTime()
public void setDefaultStartTime(Date value)
public Date getDefaultFinishTime()
public void setDefaultFinishTime(Date value)
public int getMinutesPerDay()
The number of minutes per day.
Read/write int
.
public void setMinutesPerDay(int value)
public int getMinutesPerWeek()
The number of minutes per week.
Read/write int
.
public void setMinutesPerWeek(int value)
public int getDaysPerMonth()
The number of days per month.
Read/write int
.
public void setDaysPerMonth(int value)
public int getDefaultTaskType()
The default type of new tasks.
Read/write TaskType
.
public void setDefaultTaskType(int value)
public int getDefaultFixedCostAccrual()
The default type when fixed costs are accrued.
Read/write CostAccrualType
.
public void setDefaultFixedCostAccrual(int value)
public double getDefaultStandardRate()
The default standard rate for new resources.
Read/write double
.
public void setDefaultStandardRate(double value)
public double getDefaultOvertimeRate()
The default overtime rate for new resources.
Read/write double
.
public void setDefaultOvertimeRate(double value)
public int getDurationFormat()
The format for expressing the bulk duration.
Read/write TimeUnitType
.
public void setDurationFormat(int value)
public int getWorkFormat()
The default work unit format.
Read/write TimeUnitType
.
public void setWorkFormat(int value)
public boolean getAreEditableActualCosts()
Determines whether actual costs are editable.
Read/write bool
.
public void setAreEditableActualCosts(boolean value)
public boolean getHonorConstraints()
Determines whether tasks honour their constraint dates.
Read/write bool
.
public void setHonorConstraints(boolean value)
public int getEarnedValueMethod()
The default method for calculating earned value.
Read/write EarnedValueMethodType
.
public void setEarnedValueMethod(int value)
public boolean isInsertedProjectsLikeSummary()
Determines whether subtasks are calculated as summary tasks.
Read/write bool
.
public void isInsertedProjectsLikeSummary(boolean value)
public boolean getMultipleCriticalPaths()
Determines whether multiple critical paths are calculated.
Read/write bool
.
public void setMultipleCriticalPaths(boolean value)
public boolean getAreNewTasksEffortDriven()
Determines whether new tasks are effort driven.
Read/write bool
.
public void setAreNewTasksEffortDriven(boolean value)
public boolean getAreNewTasksEstimated()
Determines whether an estimated duration is shown by default.
Read/write bool
.
public void setAreNewTasksEstimated(boolean value)
public boolean canSplitsInProgressTasks()
Determines whether in-progress tasks can be split.
Read/write bool
.
public void canSplitsInProgressTasks(boolean value)
public boolean isSpreadActualCost()
Determines whether actual costs are spread to the status date.
Read/write bool
.
public void isSpreadActualCost(boolean value)
public boolean isSpreadPercentComplete()
Determines whether a percent complete is spread to the status date.
Read/write bool
.
public void isSpreadPercentComplete(boolean value)
public boolean getTaskUpdatesResource()
Determines whether updates to tasks update resources.
Read/write bool
.
public void setTaskUpdatesResource(boolean value)
public boolean getFiscalYearStart()
Determines whether the fiscal year numbering is used.
Read/write bool
.
public void setFiscalYearStart(boolean value)
public int getWeekStartDay()
First day of a week.
Read/write DayType
.
public void setWeekStartDay(int value)
public boolean getMoveCompletedEndsBack()
Determines whether the end of completed portions of tasks scheduled to start
after the status date but started earlier should be moved back to the status date.
Read/write bool
.
public void setMoveCompletedEndsBack(boolean value)
public boolean getMoveRemainingStartsBack()
Determines whether the beginning of remaining portions of tasks scheduled to start
after the status date but started earlier should be moved back to the status date.
Read/write bool
.
public void setMoveRemainingStartsBack(boolean value)
public boolean getMoveRemainingStartsForward()
Determines whether the beginning of remaining portions of tasks
scheduled to have begun later should be moved up to the status date.
Read/write bool
.
public void setMoveRemainingStartsForward(boolean value)
public boolean getMoveCompletedEndsForward()
Determines whether the end of completed portions of tasks scheduled
to have been completed before the status date but begun later
should be moved up to the status date.
Read/write bool
.
public void setMoveCompletedEndsForward(boolean value)
public int getBaselineForEarnedValue()
The specific baseline used to calculate Variance values.
public void setBaselineForEarnedValue(int value)
public boolean getAutoAddNewResourcesAndTasks()
Determines whether new resources or tasks automatically added to a resource or task pool.
Read/write bool
.
public void setAutoAddNewResourcesAndTasks(boolean value)
public Date getStatusDate()
public void setStatusDate(Date value)
public Date getCurrentDate()
public void setCurrentDate(Date value)
public boolean getMicrosoftProjectServerURL()
Determines whether a project was created by a Project Server user as opposed to an NT user.
Read/write bool
.
public void setMicrosoftProjectServerURL(boolean value)
public boolean getAutolink()
Determines whether inserted or moved tasks are autolinked.
Read/write bool
.
public void setAutolink(boolean value)
public int getNewTaskStartDate()
The default start date type for new tasks.
Read/write TaskStartDateType
.
public void setNewTaskStartDate(int value)
public int getDefaultTaskEVMethod()
The default earned value method for tasks.
Read/write EarnedValueMethodType
.
public void setDefaultTaskEVMethod(int value)
public Date getExtendedCreationDate()
public void setExtendedCreationDate(Date value)
public boolean getActualsInSync()
Determines whether all actual works have been synchronized with the project.
Read/write bool
.
public void setActualsInSync(boolean value)
public boolean getRemoveFileProperties()
Determines whether all file properties will be removed on save.
Read/write bool
.
public void setRemoveFileProperties(boolean value)
public boolean getAdminProject()
Determines whether a project is an administrative project.
Read/write bool
.
public void setAdminProject(boolean value)
public Task getRootTask()
The root of the tree of tasks.
Read/write Task
.
public void setRootTask(Task value)
public void removeTask(Task task)
Removes a task from a project and all references to it.
task
- Task to remove.public void removeTask(int id)
Removes a task with the specified id.
id
- Id of task to remove.public void removeTaskByUid(int uid)
Removes a task with the specified uid,
uid
- Uid of a task to remove.public Calendar removeCalendar(int uid)
Removes calendar from a project.
uid
- Uid of a calendar to remove.public Calendar replaceCalendar(int uid, Calendar newCal)
Replaces a calendar and all references to it.
uid
- Uid of the removed calendar.newCal
- New calendar.public TaskLink removeLink(TaskLink link)
Removes task link from a project.
link
- TaskLink to remove.public ResourceAssignment removeResourceAssignment(ResourceAssignment ra)
Removes a resource assignment.
ra
- Resource assignment to remove.public Task getTaskByUid(int uid)
Returns a task with the specified Uid.
uid
- Task Uid.public Task getTaskById(int id)
Returns a task with the specified Id.
id
- Task Idpublic List<ResourceAssignment> getResourceAssignmentsByTask(Task task)
public List<ResourceAssignment> getResourceAssignmentsByResource(Resource resource)
public void addTaskLink(TaskLink link)
Add a task link to a project.
link
- TaskLink to add.public String getName()
The name of a project.
Read/write string
.
public void setName(String value)
public List<OutlineCodeDefinition> getOutlineCodes()
public void setOutlineCodes(List<OutlineCodeDefinition> value)
public Resource getResourceByUid(int uid)
Returns a resource with the specified Uid.
uid
- Resource Uid.public ResourceAssignment getResourceAssignmentByUid(int uid)
Returns a resource assignment with the specified Uid.
uid
- Resource assignment Uid.public ExtendedAttributeDefinition getExtendedAttributeDefinitionById(int id)
Returns an extended attribute definition by id
id
- specified idpublic void removeResource(int uid)
Removes a resource and all it's references from a project.
uid
- Uid of a resource to remove.public Calendar getCalendarByName(String name)
Returns a calendar with the specified name.
name
- Name of a calendar.public Calendar getCalendarByUid(int uid)
Returns a calendar with the specified Uid.
uid
- Uid of a calendar.public List<ResourceAssignment> getResourceAssignments()
public void setResourceAssignments(List<ResourceAssignment> value)
public void calcCalendarUids()
Recalculate Uids of calendars from 0 up to calendars collection length - 1.
public void calcCalendarUids(int start)
Recalculate Uids of calendars from start value.
public void calcResourceUids()
Recalculate Uids of resources from 0 up to resources collection length - 1.
public void calcResourceUids(int start)
Recalculate Uids of resources from start value.
public void calcResourceAssignmentUids()
Recalculate Uids of resource assignments from 0 up to resource assignments collection length - 1.
public void calcResourceAssignmentUids(int start)
Recalculate Uids of resource assignments from start value.
public void calcResourceIds()
Recalculate Ids of resources.
public void calcResourceStartFinish()
Recalculates Start and Finish of resources.
public void calcResourceFields()
Recalculates Id, Start and Finish of resources.
public void calcResourceAssignmentIds()
Recalculate Ids of resource assignemnts.
public void calcTaskUids()
Recalculate Uids of tasks (from 0).
public void calcTaskIds()
Recalculate Ids of tasks.
public void updateReferences()
Updates Task.ParentProject
and Task.ParentTask
properties of all tasks in a project.
public List<ExtendedAttributeDefinition> getExtendedAttributes()
public void setExtendedAttributes(List<ExtendedAttributeDefinition> value)
public boolean check()
Checks the project's structure. Returns true if the project's structure is correct and false if the structure is broken.
@Deprecated public IRenderResult export(int renderFormat, int presentationFormat, String filename, IRenderParam param)
Export project using different renderers.
renderFormat
- RenderFormat
rendering format.presentationFormat
- PresentationFormat
presentation format.filename
- File name to export.param
- IRenderParam
as rendering parameter.
IRenderResult
as rendering result info.@Deprecated public IRenderResult export(int renderFormat, int presentationFormat, OutputStream stream, IRenderParam param)
public IRenderResult export(int renderFormat, int presentationFormat, String filename, IRenderParam param, boolean expandAll, List arrayExpanded)
@Deprecated public IRenderResult export(int renderFormat, int presentationFormat, OutputStream stream, IRenderParam param, boolean expandAll, List arrayExpanded)
public IRenderResult export(int renderFormat, int presentationFormat, String filename, IRenderParam param, boolean expandAll, List arrayExpanded, ProjectView view)
@Deprecated public IRenderResult export(int renderFormat, int presentationFormat, OutputStream stream, IRenderParam param, boolean expandAll, List arrayExpanded, ProjectView view)
public int getNextTaskUid()
Returns next Task Uid. For project without tasks starts from 0, else starts from max Uid + 1. Increments each call.
public int getNextResourceUid()
Returns next Resource Uid. For project without resources starts from 0, else starts from max Uid + 1. Increments each call.
public int getNextResourceAssignmentUid()
Returns next Resource assignment Uid. For project without resource assignments starts from 1, else starts from max Uid + 1. Increments each call.
public int getNextCalendarUid()
Returns next Calendar Uid. For project without calendars starts from 1, for project with only base standart calendar in starts from 3, else starts from max Uid + 1. By the way in works in MS Office Project. Increments each call.
public String getComments()
Project's comments.
Read/write string
.
public void setComments(String value)
public String getKeywords()
Project's keywords.
Read/write string
.
public void setKeywords(String value)
public String getTemplate()
Project's template.
Read/write string
.
public void setTemplate(String value)
public String getLastAuthor()
Project's last author.
Read/write string
.
public void setLastAuthor(String value)
public Date getLastPrinted()
public void setLastPrinted(Date value)
public Map getCustomProperties()
public void setCustomProperties(Map value)
public String getHyperlinkBase()
Project's hyperlink base.
Read/write string
.
public void setHyperlinkBase(String value)
public boolean getNewTasksAreManual()
Determines whether new tasks created as manual.
Read/write bool
.
public void setNewTasksAreManual(boolean value)
public boolean getUpdateManuallyScheduledTasksWhenEditingLinks()
Determines whether manual tasks must be updated when links were edited.
Read/write bool
.
public void setUpdateManuallyScheduledTasksWhenEditingLinks(boolean value)
public boolean getKeepTaskOnNearestWorkingTimeWhenMadeAutoScheduled()
Determines whether manual tasks must be kept on nearest working time when made as auto scheduled.
Read/write bool
.
public void setKeepTaskOnNearestWorkingTimeWhenMadeAutoScheduled(boolean value)
public void removeInvalidResourceAssignments()
Eliminates invalid resource assignments from the project resource assignments list.
public Date getBaselineSaveTime(int baselineNumber)
public void calculateCriticalPath()
Calculates EarlyDates, LateDates, Start, Finish and TotalSlacks of each task and determines critical path of project based on calculated values.
public void save(String filename, SaveOptions options)
Saves the document to a file using the specified save options.
filename
- The file name.options
- SaveOptions
save options.public void save(String filename, int format)
Saves the project data to the file.
filename
- The file name.format
- SaveFileFormat
save file format.public void save(OutputStream stream, SaveOptions options)
public void save(OutputStream stream, int format)
public void saveReport(OutputStream stream)
public void saveReport(String filename)
Saves the project overview report to pdf file.
filename
- The file name.public void saveReport(OutputStream stream, int reportType)
public void saveReport(String filename, int reportType)
Saves the project report to pdf file.
filename
- The file name.reportType
- ReportType
public void saveAsTemplate(String filename, SaveTemplateOptions options)
Saves the project as a template.
filename
- The file name.options
- SaveTemplateOptions
Specifies additional options.public void saveAsTemplate(String filename)
Saves the project as a template.
filename
- the file name.public void saveAsTemplate(OutputStream stream)
public void saveAsTemplate(OutputStream stream, SaveTemplateOptions options)
public int getPageCount()
Returns page count for the project to be rendered using default Timescale
(Days).
public int getPageCount_Timescale(int scale)
Returns page count for the project to be rendered using given Timescale
.
scale
- Timescale
to get page count for.public int getPageCount_PresentationFormat(int format)
Returns page count for the project to be rendered using default Timescale
(Days) and given PresentationFormat
format
- PresentationFormat
to get page count for.public int getPageCount(int format, int scale)
Returns page count for the project to be rendered using given Timescale
and PresentationFormat
.
format
- PresentationFormat
to get page count for.scale
- Timescale
to get page count for.public void copyTo(Project another)
Copies project's main data and properties to another project.
another
- Another project to copy data to.public void print()
Prints project to the default printer with default printer settings using the standard (no User Interface) print controller.
public 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.
public void print(String printerName)
Prints project to the specified printer with default printer settings using the standard (no User Interface) print controller.
printerName
- Specified printer name.public void print(com.aspose.ms.System.Drawing.Printing.PrinterSettings printerSettings)
Prints project according to the specified printer settings using the standard (no User Interface) print controller.
printerSettings
- Specified instance of PrinterSettings
.public void print(com.aspose.ms.System.Drawing.Printing.PrinterSettings printerSettings, String documentName)
Prints project according to the specified printer settings using the standard (no User Interface) print controller.
printerSettings
- Specified instance of PrinterSettings
.documentName
- Document name.public void print(com.aspose.ms.System.Drawing.Printing.PrinterSettings printerSettings, PrintOptions options)
Prints project according to the specified printer settings and custom save options using the standard (no User Interface) print controller.
printerSettings
- Specified instance of PrinterSettings
.options
- Specified instance of PrintOptions
.public void setBaseline(int baselineType)
Saves baseline fields to the specified baseline for the entire project.
baselineType
- BaselineType
to save baseline data to.public void calcSlacks()
Calculates slacks of project tasks based on task early/late dates and sets tasks critical flag.
public Task addTask()
Adds new task to project tasks collection on the same outline level of the last task.
Task
public Task addTask(String taskName)
Adds new task to project tasks collection on the same outline level of the last task.
taskName
- Task name.Task
public Task addTask(int beforeTaskId)
Inserts new task before task with provided id and on the same outline level.
beforeTaskId
- public Task addTask(String taskName, int beforeTaskId)
Inserts new task before task with provided id and on the same outline level.
taskName
- Task name.beforeTaskId
- int
Id of task before which new task will be inserted.com.aspose.ms.System.ArgumentOutOfRangeException
public Resource addResource()
Adds new resource at the last position of a project resources collection.
public Resource addResource(String resourceName)
Adds new resource at the last position of a project resources collection.
resourceName
- Name of a resource.public Resource addResource(String resourceName, int beforeResourceId)
Adds new resource at the specified position of a project resources collection.
resourceName
- Name of a resource.beforeResourceId
- Position of a resource in a project resources collection.public ResourceAssignment addResourceAssignment(Task task, Resource resource, double units)
Adds new assignment to a project ResourceAssignments collection.
task
- A task to be assigned.resource
- A resource to be assigned.units
- The number of units for a new assignment.public ResourceAssignment addResourceAssignment(Task task, Resource resource)
Adds new assignment to a project ResourceAssignments collection.
task
- A task to be assigned.resource
- A resource to be assigned.Copyright (c) 2008-2013 Aspose Pty Ltd. All Rights Reserved.