|
1 | 1 | --- |
2 | | -title: Manage Default Project Properties in Aspose.Tasks |
| 2 | +title: Efficiently Manage MS Project Properties in Aspose.Tasks |
3 | 3 | linktitle: Manage Default Project Properties in Aspose.Tasks |
4 | 4 | second_title: Aspose.Tasks Java API |
5 | | -description: |
| 5 | +description: Learn how to manage default MS Project properties using Aspose.Tasks for Java. Streamline your project management workflow effortlessly. |
6 | 6 | type: docs |
7 | 7 | weight: 11 |
8 | 8 | url: /java/project-management/default-properties/ |
9 | 9 | --- |
10 | | - |
11 | | -## Complete Source Code |
| 10 | +## Introduction |
| 11 | +Are you looking to streamline your project management process with Aspose.Tasks for Java? Managing default properties in Microsoft Project files can significantly enhance efficiency. In this tutorial, we will walk through step-by-step instructions on how to manage default MS Project properties using Aspose.Tasks. |
| 12 | +## Prerequisites |
| 13 | +Before we delve into the tutorial, ensure you have the following prerequisites: |
| 14 | +### 1. Java Development Kit (JDK) |
| 15 | + - Make sure JDK is installed on your system. |
| 16 | + - You can download it from [here](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html). |
| 17 | +### 2. Aspose.Tasks for Java Library |
| 18 | + - Download and include the Aspose.Tasks for Java library in your project. |
| 19 | + - You can download it from the [website](https://releases.aspose.com/tasks/java/). |
| 20 | +## Import Packages |
| 21 | +Firstly, import the necessary packages in your Java file: |
12 | 22 | ```java |
13 | | -/* |
14 | | - * Copyright 2001-2022 Aspose Pty Ltd. All Rights Reserved. |
15 | | - * |
16 | | - * This file is part of Aspose.Tasks. The source code in this file |
17 | | - * is only intended as a supplement to the documentation, and is provided |
18 | | - * "as is", without warranty of any kind, either expressed or implied. |
19 | | - */ |
20 | | - |
21 | | - |
22 | | - |
23 | 23 | import com.aspose.tasks.*; |
24 | | - |
25 | | - |
26 | 24 | import java.util.Calendar; |
27 | | - |
28 | | -public class DefaultProjectProperties { |
29 | | - public static void main(String[] args) { |
30 | | - // The path to the documents directory. |
31 | | - String dataDir = "Your Data Directory"; |
32 | | - |
33 | | - Project project = new Project(dataDir + "project.mpp"); |
34 | | - |
35 | | - //Display default properties |
36 | | - System.out.println("Project Version : " + project.get(Prj.SAVE_VERSION)); |
37 | | - System.out.println("New Task Default Start: " + project.get(Prj.DEFAULT_START_TIME)); |
38 | | - System.out.println("New Task Default Type: " + project.get(Prj.DEFAULT_TASK_TYPE)); |
39 | | - System.out.println("Resource Default Standard Rate: " + project.get(Prj.DEFAULT_STANDARD_RATE)); |
40 | | - System.out.println("Resource Default Overtime Rate: " + project.get(Prj.DEFAULT_OVERTIME_RATE)); |
41 | | - System.out.println("Default Task EV Method: " + project.get(Prj.DEFAULT_TASK_EV_METHOD)); |
42 | | - System.out.println("Default Cost Accrual: " + project.get(Prj.DEFAULT_FIXED_COST_ACCRUAL)); |
43 | | - |
44 | | - //Set default properties |
45 | | - project.set(Prj.SCHEDULE_FROM_START, new NullableBool(true)); |
46 | | - |
47 | | - java.util.Calendar cal = java.util.Calendar.getInstance(); |
48 | | - cal.set(2014, Calendar.FEBRUARY, 15, 0, 0, 0); |
49 | | - |
50 | | - project.set(Prj.START_DATE, cal.getTime()); |
51 | | - project.set(Prj.DEFAULT_START_TIME, project.get(Prj.START_DATE)); |
52 | | - project.set(Prj.DEFAULT_TASK_TYPE, TaskType.FixedDuration); |
53 | | - project.set(Prj.DEFAULT_STANDARD_RATE, 15d); |
54 | | - project.set(Prj.DEFAULT_OVERTIME_RATE, 12d); |
55 | | - project.set(Prj.DEFAULT_TASK_EV_METHOD, EarnedValueMethodType.PercentComplete); |
56 | | - project.set(Prj.DEFAULT_FIXED_COST_ACCRUAL, CostAccrualType.Prorated); |
57 | | - |
58 | | - //Save the project to XML format |
59 | | - project.save(dataDir + "project4.xml", SaveFileFormat.Xml); |
60 | | - |
61 | | - //Display result of conversion. |
62 | | - System.out.println("Process completed Successfully"); |
63 | | - } |
64 | | -} |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
69 | | - |
70 | 25 | ``` |
| 26 | +Let's break down the process into manageable steps: |
| 27 | +## Step 1: Load Project File |
| 28 | +```java |
| 29 | +// The path to the documents directory. |
| 30 | +String dataDir = "Your Data Directory"; |
| 31 | +Project project = new Project(dataDir + "project.mpp"); |
| 32 | +``` |
| 33 | +## Step 2: Display Default Properties |
| 34 | +```java |
| 35 | +// Display default properties |
| 36 | +System.out.println("Project Version : " + project.get(Prj.SAVE_VERSION)); |
| 37 | +System.out.println("New Task Default Start: " + project.get(Prj.DEFAULT_START_TIME)); |
| 38 | +System.out.println("New Task Default Type: " + project.get(Prj.DEFAULT_TASK_TYPE)); |
| 39 | +System.out.println("Resource Default Standard Rate: " + project.get(Prj.DEFAULT_STANDARD_RATE)); |
| 40 | +System.out.println("Resource Default Overtime Rate: " + project.get(Prj.DEFAULT_OVERTIME_RATE)); |
| 41 | +System.out.println("Default Task EV Method: " + project.get(Prj.DEFAULT_TASK_EV_METHOD)); |
| 42 | +System.out.println("Default Cost Accrual: " + project.get(Prj.DEFAULT_FIXED_COST_ACCRUAL)); |
| 43 | +``` |
| 44 | +## Step 3: Set Default Properties |
| 45 | +```java |
| 46 | +// Set default properties |
| 47 | +project.set(Prj.SCHEDULE_FROM_START, new NullableBool(true)); |
| 48 | +java.util.Calendar cal = java.util.Calendar.getInstance(); |
| 49 | +cal.set(2014, Calendar.FEBRUARY, 15, 0, 0, 0); |
| 50 | +project.set(Prj.START_DATE, cal.getTime()); |
| 51 | +project.set(Prj.DEFAULT_START_TIME, project.get(Prj.START_DATE)); |
| 52 | +project.set(Prj.DEFAULT_TASK_TYPE, TaskType.FixedDuration); |
| 53 | +project.set(Prj.DEFAULT_STANDARD_RATE, 15d); |
| 54 | +project.set(Prj.DEFAULT_OVERTIME_RATE, 12d); |
| 55 | +project.set(Prj.DEFAULT_TASK_EV_METHOD, EarnedValueMethodType.PercentComplete); |
| 56 | +project.set(Prj.DEFAULT_FIXED_COST_ACCRUAL, CostAccrualType.Prorated); |
| 57 | +``` |
| 58 | +## Step 4: Save Project to XML Format |
| 59 | +```java |
| 60 | +// Save the project to XML format |
| 61 | +project.save(dataDir + "project4.xml", SaveFileFormat.Xml); |
| 62 | +``` |
| 63 | +## Step 5: Display Result |
| 64 | +```java |
| 65 | +// Display result of conversion. |
| 66 | +System.out.println("Process completed Successfully"); |
| 67 | +``` |
| 68 | +By following these steps, you can efficiently manage default MS Project properties using Aspose.Tasks for Java. |
| 69 | +## Conclusion |
| 70 | +In this tutorial, we've learned how to manage default MS Project properties using Aspose.Tasks for Java. By utilizing these techniques, you can optimize your project management workflow, enhancing productivity and organization. |
| 71 | +## FAQ's |
| 72 | +### Q1: Can I use Aspose.Tasks with other programming languages? |
| 73 | +A1: Yes, Aspose.Tasks supports various programming languages such as .NET, Python, and Java. |
| 74 | +### Q2: Is Aspose.Tasks suitable for both personal and enterprise use? |
| 75 | +A2: Absolutely! Whether you're managing small personal projects or large-scale enterprise initiatives, Aspose.Tasks caters to all. |
| 76 | +### Q3: Does Aspose.Tasks offer customer support? |
| 77 | +A3: Yes, you can find assistance and community support on the [Aspose.Tasks forum](https://forum.aspose.com/c/tasks/15). |
| 78 | +### Q4: Can I try Aspose.Tasks before purchasing? |
| 79 | +A4: Of course! You can avail of a free trial from the [website](https://releases.aspose.com/). |
| 80 | +### Q5: How can I obtain a temporary license for Aspose.Tasks? |
| 81 | +A5: You can get a temporary license from the [purchase page](https://purchase.aspose.com/temporary-license/) for testing and evaluation purposes. |
0 commit comments