Skip to content

Commit 355cd91

Browse files
Updated project properties examples
1 parent fe40b0d commit 355cd91

File tree

4 files changed

+167
-116
lines changed

4 files changed

+167
-116
lines changed

content/english/java/project-properties/_index.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ url: /java/project-properties/
1010

1111
## Project Properties Tutorials
1212
### [Read Meta Properties in Aspose.Tasks Projects](./read-meta-properties/)
13-
### [Read Project Info with Aspose.Tasks](./read-project-info/)
14-
### [Write Project Info in Aspose.Tasks](./write-project-info/)
13+
Unlock the power of metadata in Aspose.Tasks projects with this comprehensive tutorial. Learn to extract and leverage meta-properties effortlessly.
14+
### [Extract Microsoft Project Info with Aspose.Tasks for Java](./read-project-info/)
15+
Learn how to extract Microsoft Project information using Aspose.Tasks for Java. Enhance project management in Java applications effortlessly.
16+
### [Mastering MS Project Manipulation with Aspose.Tasks for Java](./write-project-info/)
17+
Learn how to efficiently write MS Project information using Aspose.Tasks for Java. Step-by-step guide for Java developers.

content/english/java/project-properties/read-meta-properties/_index.md

Lines changed: 56 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,72 @@
22
title: Read Meta Properties in Aspose.Tasks Projects
33
linktitle: Read Meta Properties in Aspose.Tasks Projects
44
second_title: Aspose.Tasks Java API
5-
description:
5+
description: Unlock the power of metadata in Aspose.Tasks projects with this comprehensive tutorial. Learn to extract and leverage meta-properties effortlessly.
66
type: docs
77
weight: 10
88
url: /java/project-properties/read-meta-properties/
99
---
10+
## Introduction
11+
In the realm of project management and data analysis, delving into the metadata of project files can offer invaluable insights. Aspose.Tasks for Java presents a robust toolkit for navigating through these meta-properties effortlessly. This tutorial serves as a comprehensive guide to extract and comprehend meta-properties within your Aspose.Tasks projects.
12+
## Prerequisites
13+
Before embarking on this journey, ensure you have the following prerequisites in place:
14+
1. Java Development Kit (JDK): Make sure you have Java installed on your system. You can download and install the latest JDK from [here](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html).
15+
2. Aspose.Tasks for Java Library: Obtain the Aspose.Tasks for Java library from the [download link](https://releases.aspose.com/tasks/java/) and include it in your Java project.
1016

11-
## Complete Source Code
17+
## Import Packages
18+
Before you begin extracting meta-properties, import the necessary packages into your Java project:
1219
```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-
2320
import com.aspose.tasks.BuiltInProjectProperty;
2421
import com.aspose.tasks.CustomProjectProperty;
2522
import com.aspose.tasks.Project;
26-
2723
import com.aspose.tasks.examples.Tasks.ActualProperties;
24+
```
2825

29-
public class ReadMetaProperties {
30-
public static void main(String[] args) {
31-
// The path to the documents directory.
32-
String dataDir = "Your Data Directory";
33-
// ExStart: ReadMetaProperties
34-
// Create a project reader instance
35-
Project project = new Project(dataDir + "project.mpp");
36-
37-
// Custom properties are available through the typed collection:
38-
for (CustomProjectProperty property : project.getCustomProps()) {
39-
System.out.println(property.getType());
40-
System.out.println(property.getName());
41-
System.out.println(property.getValue());
42-
}
43-
44-
// Built-in properties are available directly:
45-
System.out.println(project.getBuiltInProps().getAuthor());
46-
System.out.println(project.getBuiltInProps().getTitle());
47-
48-
// or as an item of built-in property collection:
49-
for (BuiltInProjectProperty property : project.getBuiltInProps()) {
50-
System.out.println(property.getName());
51-
System.out.println(property.getValue());
52-
}
53-
// ExEnd:ReadMetaProperties
54-
}
26+
## Step 1. Set Data Directory
27+
First, ensure you set the data directory where your project file resides.
28+
```java
29+
String dataDir = "Your Data Directory";
30+
```
31+
## Step 2. Initialize Project Object
32+
Create an instance of the `Project` class, passing the path to your project file.
33+
```java
34+
Project project = new Project(dataDir + "project.mpp");
35+
```
36+
## Step 3. Read Custom Properties
37+
Iterate through custom properties using a typed collection and print their details.
38+
```java
39+
for (CustomProjectProperty property : project.getCustomProps()) {
40+
System.out.println("Type: " + property.getType());
41+
System.out.println("Name: " + property.getName());
42+
System.out.println("Value: " + property.getValue());
5543
}
5644
```
45+
## Step 4. Access Built-in Properties
46+
Access built-in properties directly and print their values.
47+
```java
48+
System.out.println("Author: " + project.getBuiltInProps().getAuthor());
49+
System.out.println("Title: " + project.getBuiltInProps().getTitle());
50+
```
51+
## Step 5. Iterate Through Built-in Properties
52+
Alternatively, iterate through built-in properties and print their details.
53+
```java
54+
for (BuiltInProjectProperty property : project.getBuiltInProps()) {
55+
System.out.println("Name: " + property.getName());
56+
System.out.println("Value: " + property.getValue());
57+
}
58+
```
59+
This step-by-step guide equips you with the proficiency to unravel meta-properties within your Aspose.Tasks projects effortlessly.
60+
61+
## Conclusion
62+
Navigating meta-properties in Aspose.Tasks projects opens a gateway to deeper insights and enhanced project management capabilities. By following this guide, you can harness the power of metadata to streamline your workflow and drive project success.
63+
## FAQs
64+
### Q: Can Aspose.Tasks handle custom meta-properties efficiently?
65+
A: Aspose.Tasks provides robust support for both custom and built-in meta-properties, ensuring efficient extraction and manipulation.
66+
### Q: Is Aspose.Tasks compatible with different project file formats?
67+
A: Yes, Aspose.Tasks supports a wide range of project file formats, including MPP, XML, and more.
68+
### Q: How can I obtain temporary licenses for Aspose.Tasks?
69+
A: You can acquire temporary licenses for Aspose.Tasks through the [temporary license portal](https://purchase.aspose.com/temporary-license/).
70+
### Q: Does Aspose.Tasks offer comprehensive documentation?
71+
A: Yes, you can find extensive documentation for Aspose.Tasks on the [documentation page](https://reference.aspose.com/tasks/java/).
72+
### Q: Where can I seek support for Aspose.Tasks-related queries?
73+
A: For any assistance or queries regarding Aspose.Tasks, you can visit the [Aspose.Tasks forum](https://forum.aspose.com/c/tasks/15) for dedicated support from the community and experts.
Lines changed: 55 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,67 @@
11
---
2-
title: Read Project Info with Aspose.Tasks
2+
title: Extract Microsoft Project Info with Aspose.Tasks for Java
33
linktitle: Read Project Info with Aspose.Tasks
44
second_title: Aspose.Tasks Java API
5-
description:
5+
description: Learn how to extract Microsoft Project information using Aspose.Tasks for Java. Enhance project management in Java applications effortlessly.
66
type: docs
77
weight: 11
88
url: /java/project-properties/read-project-info/
99
---
10+
## Introduction
11+
In the realm of project management and task tracking, Microsoft Project holds a significant position. Aspose.Tasks for Java emerges as a powerful tool that enables seamless interaction with Microsoft Project files in Java environments. This tutorial delves into the process of extracting vital project information from Microsoft Project files using Aspose.Tasks for Java.
12+
## Prerequisites
13+
:
14+
Before embarking on this tutorial, ensure you have the following prerequisites in place:
15+
1. Java Development Environment: Make sure you have Java Development Kit (JDK) installed on your system.
16+
17+
2. Aspose.Tasks for Java: Download and install Aspose.Tasks for Java from the [website](https://releases.aspose.com/tasks/java/).
1018

11-
## Complete Source Code
19+
## Import Packages:
20+
To begin, import the necessary packages to facilitate interaction with Aspose.Tasks for Java:
1221
```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-
2322
import com.aspose.tasks.*;
24-
25-
26-
public class ReadProjectInfo {
27-
public static void main(String[] args) {
28-
// The path to the documents directory.
29-
String dataDir = "Your Data Directory";
30-
//ExStart:ReadProjectInfo
31-
Project project = new Project(dataDir + "ReadProjectInfo.mpp");
32-
if (project.get(Prj.SCHEDULE_FROM_START).getValue()) {
33-
System.out.println("Project Start Date: " + project.get(Prj.START_DATE));
34-
} else {
35-
System.out.println("Project Finish Date: " + project.get(Prj.FINISH_DATE));
36-
}
37-
String strSchdl = (project.get(Prj.SCHEDULE_FROM_START).getValue()) ? "Project Start Date" : "Project Finish Date";
38-
39-
System.out.println("Project Schedule From: " + strSchdl);
40-
System.out.println("Current Date: " + project.get(Prj.CURRENT_DATE));
41-
System.out.println("Status Date: " + project.get(Prj.STATUS_DATE));
42-
System.out.println("Calendar: " + project.get(Prj.CALENDAR).getName());
43-
//ExEnd:ReadProjectInfo
44-
}
23+
```
24+
## Step-by-Step Guide:
25+
Let's break down the provided example into manageable steps:
26+
## Step 1: Define Data Directory
27+
Set the path to the directory containing your project files:
28+
```java
29+
String dataDir = "Your Data Directory";
30+
```
31+
## Step 2: Load Project File
32+
Initialize a new `Project` object by loading a Microsoft Project file:
33+
```java
34+
Project project = new Project(dataDir + "ReadProjectInfo.mpp");
35+
```
36+
## Step 3: Check Project Schedule
37+
Determine whether the project schedule is calculated from the project start date or finish date:
38+
```java
39+
if (project.get(Prj.SCHEDULE_FROM_START).getValue()) {
40+
System.out.println("Project Start Date: " + project.get(Prj.START_DATE));
41+
} else {
42+
System.out.println("Project Finish Date: " + project.get(Prj.FINISH_DATE));
4543
}
4644
```
45+
## Step 4: Retrieve Project Schedule Information
46+
Obtain additional project schedule information such as the current date, status date, and associated calendar:
47+
```java
48+
String strSchdl = (project.get(Prj.SCHEDULE_FROM_START).getValue()) ? "Project Start Date" : "Project Finish Date";
49+
System.out.println("Project Schedule From: " + strSchdl);
50+
System.out.println("Current Date: " + project.get(Prj.CURRENT_DATE));
51+
System.out.println("Status Date: " + project.get(Prj.STATUS_DATE));
52+
System.out.println("Calendar: " + project.get(Prj.CALENDAR).getName());
53+
```
54+
55+
## Conclusion:
56+
Mastering the extraction of Microsoft Project information with Aspose.Tasks for Java opens doors to enhanced project management capabilities within Java applications. By following this tutorial, you can seamlessly integrate project data into your Java projects, enabling better decision-making and tracking.
57+
## FAQ's
58+
### Q: Can I use Aspose.Tasks for Java with any version of Microsoft Project files?
59+
A: Yes, Aspose.Tasks for Java supports various versions of Microsoft Project files, including MPP and XML formats.
60+
### Q: Is Aspose.Tasks for Java compatible with all Java development environments?
61+
A: Aspose.Tasks for Java is compatible with most Java development environments, ensuring flexibility in integration.
62+
### Q: Does Aspose.Tasks for Java provide support for manipulating project data beyond reading information?
63+
A: Absolutely, Aspose.Tasks for Java offers extensive functionalities for manipulating project data, including editing, saving, and exporting.
64+
### Q: Can I automate the extraction of project information using Aspose.Tasks for Java?
65+
A: Yes, Aspose.Tasks for Java allows for automation through its comprehensive API, enabling streamlined processes for data extraction and analysis.
66+
### Q: Is there a community forum or support channel available for Aspose.Tasks for Java users?
67+
A: Yes, you can find helpful resources and engage with the community on the [Aspose.Tasks forum](https://forum.aspose.com/c/tasks/15).
Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,63 @@
11
---
2-
title: Write Project Info in Aspose.Tasks
2+
title: Mastering MS Project Manipulation with Aspose.Tasks for Java
33
linktitle: Write Project Info in Aspose.Tasks
44
second_title: Aspose.Tasks Java API
5-
description:
5+
description: Learn how to efficiently write MS Project information using Aspose.Tasks for Java. Step-by-step guide for Java developers.
66
type: docs
77
weight: 12
88
url: /java/project-properties/write-project-info/
99
---
10-
11-
## Complete Source Code
10+
## Introduction
11+
In this tutorial, we'll delve into utilizing Aspose.Tasks for Java, a powerful library for manipulating Microsoft Project files programmatically. We'll focus on a fundamental task: writing MS Project information using Aspose.Tasks. Whether you're a seasoned developer or just starting your journey in Java programming, this guide will walk you through the process step by step.
12+
## Prerequisites
13+
Before diving into the tutorial, ensure you have the following prerequisites in place:
14+
1. Java Development Kit (JDK): Make sure you have JDK installed on your system.
15+
2. Aspose.Tasks for Java Library: Download and install the Aspose.Tasks for Java library. You can obtain it from [here](https://releases.aspose.com/tasks/java/).
16+
3. Integrated Development Environment (IDE): Choose an IDE of your preference. We recommend IntelliJ IDEA or Eclipse.
17+
18+
## Import Packages
19+
First, import the necessary packages in your Java project:
1220
```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-
2321
import com.aspose.tasks.*;
24-
25-
2622
import java.util.Calendar;
23+
```
2724

28-
public class WriteProjectInfo {
29-
public static void main(String[] args) {
30-
// The path to the documents directory.
31-
String dataDir = "Your Data Directory";
32-
//ExStart:WriteProjectInfo
33-
//Create a project instance
34-
Project project = new Project();
35-
//Set project information properties
36-
project.set(Prj.SCHEDULE_FROM_START, new NullableBool(true));
37-
java.util.Calendar cal = java.util.Calendar.getInstance();
38-
cal.set(2014, Calendar.JULY, 10);
39-
project.set(Prj.START_DATE, cal.getTime());
40-
project.set(Prj.CURRENT_DATE, cal.getTime());
41-
project.set(Prj.STATUS_DATE, cal.getTime());
42-
43-
//Save the Project as XML
44-
project.save(dataDir + "project3.xml", SaveFileFormat.Xml);
45-
//ExEnd:WriteProjectInfo
46-
}
47-
}
48-
49-
50-
51-
52-
25+
## Step 1: Set Up Data Directory
26+
Define the directory where your project data will be stored.
27+
```java
28+
String dataDir = "Your Data Directory";
29+
```
30+
## Step 2: Create Project Instance
31+
Initialize a new project instance.
32+
```java
33+
Project project = new Project();
5334
```
35+
## Step 3: Set Project Information Properties
36+
Set properties for the project such as start date, schedule from start, and status date.
37+
```java
38+
project.set(Prj.SCHEDULE_FROM_START, new NullableBool(true));
39+
java.util.Calendar cal = java.util.Calendar.getInstance();
40+
cal.set(2014, Calendar.JULY, 10);
41+
project.set(Prj.START_DATE, cal.getTime());
42+
project.set(Prj.CURRENT_DATE, cal.getTime());
43+
project.set(Prj.STATUS_DATE, cal.getTime());
44+
```
45+
## Step 4: Save Project as XML
46+
Save the project with the updated information as an XML file.
47+
```java
48+
project.save(dataDir + "project3.xml", SaveFileFormat.Xml);
49+
```
50+
51+
## Conclusion
52+
Congratulations! You've successfully learned how to write MS Project information using Aspose.Tasks for Java. With this newfound knowledge, you can automate various tasks related to Microsoft Project files, enhancing your productivity as a Java developer.
53+
## FAQ's
54+
### Q: Can I use Aspose.Tasks for Java to read MS Project files?
55+
A: Yes, Aspose.Tasks for Java provides robust functionalities for both reading and writing MS Project files.
56+
### Q: Is Aspose.Tasks for Java compatible with different versions of MS Project?
57+
A: Absolutely, Aspose.Tasks for Java supports various versions of MS Project, ensuring compatibility across different file formats.
58+
### Q: Are there any limitations to the trial version of Aspose.Tasks for Java?
59+
A: While the trial version allows you to explore the library's capabilities, it has certain limitations such as watermarks on output files.
60+
### Q: How can I get support for Aspose.Tasks for Java?
61+
A: You can seek assistance from the Aspose.Tasks community forum [here](https://forum.aspose.com/c/tasks/15).
62+
### Q: Can I purchase a temporary license for Aspose.Tasks for Java?
63+
A: Yes, temporary licenses are available for short-term usage. You can obtain one from [here](https://purchase.aspose.com/temporary-license/).

0 commit comments

Comments
 (0)