`
Inline Code Example Here
`
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"%>
<html>
<head>
<%@ page import="java.io.*" %>
<%@ page import="java.io.*" %>
<%@ page import ="net.sf.mpxj.MPXJException " %>
<%@ page import=" net.sf.mpxj.ProjectFile" %>
<%@ page import=" net.sf.mpxj.Resource" %>
<%@ page import=" net.sf.mpxj.Task" %>
<%@ page import=" net.sf.mpxj.mpp.MPPReader" %>
<%@ page import ="net.sf.mpxj.reader.ProjectReader" %>
<title>Insert title here</title>
</head>
<body>
<%
final class Mpx
{
public void mppReader()
{
ProjectReader reader = new MPPReader();
ProjectFile project;
System.out.print("before reading");
try
{
project = reader.read("b4ubuild_sample_2k-03.mpp");
//b4ubuild_sample_2k-03
}
catch (MPXJException e)
{
e.printStackTrace();
}
for (Resource resource : project.getAllResources())
{
System.out.println("Resource: " + resource.getName() + " \n(Unique ID=" +resource.getUniqueID() + ")");
System.out.println("\n");
}
for (Task task : project.getAllTasks())
{
System.out.println("Task: " + task.getName() + " ID=" + task.getID() + " Unique ID=" +
task.getUniqueID()+ "\nStart Date : " +task.getStart()+"\nFinish Date : "+task.getFinish()+ "\nDuration : "
+task.getDuration().getDuration());
System.out.println("\n");
}
System.out.println("after reading");
}
public void main(String[] args)
{
Mpx fileReader = new Mpx();
fileReader.mppReader();
}
}%>
</body>
</html>