Skip to content

Commit ebbcbeb

Browse files
authored
Add support for GanttProject (#35)
* Work in progress * Add GanttProject support * Work in progress * Work in progress * Work in progress * Work in progress * Work in progress * Work in progress * Work in progress * Work in progress * Work in progress * Work in progress * Work in progress * Work in progress * Update documentation
1 parent 574b92a commit ebbcbeb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+6535
-14
lines changed

.checkstyle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<fileset-config file-format-version="1.2.0" simple-config="false">
3+
<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
44
<local-check-config name="MPXJ" location="eclipse/checkstyle-config.xml" type="project" description="">
55
<additional-data name="protect-config-file" value="false"/>
66
</local-check-config>
77
<fileset name="Java Files" enabled="true" check-config-name="MPXJ" local="true">
88
<file-match-pattern match-pattern=".java$" include-pattern="true"/>
99
</fileset>
1010
<filter name="FilesFromPackage" enabled="true">
11+
<filter-data value="src/net/sf/mpxj/ganttproject/schema"/>
1112
<filter-data value="src/net/sf/mpxj/mspdi/schema"/>
1213
<filter-data value="src/net/sf/mpxj/phoenix/schema"/>
1314
<filter-data value="src/net/sf/mpxj/planner/schema"/>

build.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@
121121
<exec executable="xjc" dir="${basedir}">
122122
<arg line="-classpath ${classes.dir} -d ${basedir}/src -b ${basedir}/phoenix-binding.xjb -p net.sf.mpxj.phoenix.schema ${basedir}/jaxb/phoenix-4.5.xsd" />
123123
</exec>
124+
<exec executable="xjc" dir="${basedir}">
125+
<arg line="-classpath ${classes.dir} -d ${basedir}/src -b ${basedir}/ganttproject-binding.xjb -p net.sf.mpxj.ganttproject.schema ${basedir}/jaxb/ganttproject-2.8.xsd" />
126+
</exec>
124127

125128
<delete>
126129
<fileset dir="${basedir}" includes="*.xjb" defaultexcludes="no" />

jaxb/ganttproject-2.8.xsd

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
<?xml version="1.0"?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
3+
4+
<xs:complexType name="field">
5+
<xs:simpleContent>
6+
<xs:extension base="xs:string">
7+
<xs:attribute type="xs:string" name="id" use="optional"/>
8+
<xs:attribute type="xs:string" name="name" use="optional"/>
9+
<xs:attribute type="xs:int" name="width" use="optional"/>
10+
<xs:attribute type="xs:int" name="order" use="optional"/>
11+
</xs:extension>
12+
</xs:simpleContent>
13+
</xs:complexType>
14+
15+
<xs:complexType name="view">
16+
<xs:sequence>
17+
<xs:element type="field" name="field" maxOccurs="unbounded" minOccurs="0"/>
18+
</xs:sequence>
19+
<xs:attribute type="xs:string" name="zooming-state" use="optional"/>
20+
<xs:attribute type="xs:string" name="id" use="optional"/>
21+
</xs:complexType>
22+
23+
<xs:complexType name="day-type">
24+
<xs:simpleContent>
25+
<xs:extension base="xs:string">
26+
<xs:attribute type="xs:int" name="id" use="optional"/>
27+
</xs:extension>
28+
</xs:simpleContent>
29+
</xs:complexType>
30+
31+
<xs:complexType name="default-week">
32+
<xs:simpleContent>
33+
<xs:extension base="xs:string">
34+
<xs:attribute type="xs:int" name="id"/>
35+
<xs:attribute type="xs:string" name="name"/>
36+
<xs:attribute type="xs:int" name="sun"/>
37+
<xs:attribute type="xs:int" name="mon"/>
38+
<xs:attribute type="xs:int" name="tue"/>
39+
<xs:attribute type="xs:int" name="wed"/>
40+
<xs:attribute type="xs:int" name="thu"/>
41+
<xs:attribute type="xs:int" name="fri"/>
42+
<xs:attribute type="xs:int" name="sat"/>
43+
</xs:extension>
44+
</xs:simpleContent>
45+
</xs:complexType>
46+
47+
<xs:complexType name="only-show-weekends">
48+
<xs:simpleContent>
49+
<xs:extension base="xs:string">
50+
<xs:attribute type="xs:string" name="value"/>
51+
</xs:extension>
52+
</xs:simpleContent>
53+
</xs:complexType>
54+
55+
<xs:complexType name="day-types">
56+
<xs:sequence>
57+
<xs:element type="day-type" name="day-type" maxOccurs="unbounded" minOccurs="0"/>
58+
<xs:element type="default-week" name="default-week"/>
59+
<xs:element type="only-show-weekends" name="only-show-weekends"/>
60+
<xs:element type="xs:string" name="overriden-day-types"/>
61+
<xs:element type="xs:string" name="days"/>
62+
</xs:sequence>
63+
</xs:complexType>
64+
65+
<xs:complexType name="date">
66+
<xs:simpleContent>
67+
<xs:extension base="xs:string">
68+
<xs:attribute type="xs:string" name="year" use="optional"/>
69+
<xs:attribute type="xs:int" name="month" use="optional"/>
70+
<xs:attribute type="xs:int" name="date" use="optional"/>
71+
<xs:attribute type="xs:string" name="type" use="optional"/>
72+
</xs:extension>
73+
</xs:simpleContent>
74+
</xs:complexType>
75+
76+
<xs:complexType name="calendars">
77+
<xs:sequence>
78+
<xs:element type="day-types" name="day-types"/>
79+
<xs:element type="date" name="date" maxOccurs="unbounded" minOccurs="0"/>
80+
</xs:sequence>
81+
<xs:attribute type="xs:string" name="base-id"/>
82+
</xs:complexType>
83+
84+
<xs:complexType name="taskproperty">
85+
<xs:simpleContent>
86+
<xs:extension base="xs:string">
87+
<xs:attribute type="xs:string" name="id" use="optional"/>
88+
<xs:attribute type="xs:string" name="name" use="optional"/>
89+
<xs:attribute type="xs:string" name="type" use="optional"/>
90+
<xs:attribute type="xs:string" name="valuetype" use="optional"/>
91+
<xs:attribute type="xs:string" name="defaultvalue" use="optional"/>
92+
</xs:extension>
93+
</xs:simpleContent>
94+
</xs:complexType>
95+
96+
<xs:complexType name="taskproperties">
97+
<xs:sequence>
98+
<xs:element type="taskproperty" name="taskproperty" maxOccurs="unbounded" minOccurs="0"/>
99+
</xs:sequence>
100+
</xs:complexType>
101+
102+
<xs:complexType name="depend">
103+
<xs:simpleContent>
104+
<xs:extension base="xs:string">
105+
<xs:attribute type="xs:int" name="id" use="optional"/>
106+
<xs:attribute type="xs:int" name="type" use="optional"/>
107+
<xs:attribute type="xs:int" name="difference" use="optional"/>
108+
<xs:attribute type="xs:string" name="hardness" use="optional"/>
109+
</xs:extension>
110+
</xs:simpleContent>
111+
</xs:complexType>
112+
113+
<xs:complexType name="custom-task-property">
114+
<xs:simpleContent>
115+
<xs:extension base="xs:string">
116+
<xs:attribute type="xs:string" name="taskproperty-id" use="optional"/>
117+
<xs:attribute type="xs:string" name="value" use="optional"/>
118+
</xs:extension>
119+
</xs:simpleContent>
120+
</xs:complexType>
121+
122+
<xs:complexType name="task">
123+
<xs:sequence>
124+
<xs:sequence>
125+
<xs:element type="depend" name="depend" maxOccurs="unbounded" minOccurs="0"/>
126+
</xs:sequence>
127+
<xs:element type="custom-task-property" name="customproperty" maxOccurs="unbounded" minOccurs="0"/>
128+
<xs:element type="task" name="task" maxOccurs="unbounded" minOccurs="0"/>
129+
</xs:sequence>
130+
<xs:attribute type="xs:int" name="id" use="optional"/>
131+
<xs:attribute type="xs:string" name="name" use="optional"/>
132+
<xs:attribute type="xs:string" name="color" use="optional"/>
133+
<xs:attribute type="xs:string" name="meeting" use="optional"/>
134+
<xs:attribute type="xs:date" name="start" use="optional"/>
135+
<xs:attribute type="xs:int" name="duration" use="optional"/>
136+
<xs:attribute type="xs:int" name="complete" use="optional"/>
137+
<xs:attribute type="xs:string" name="expand" use="optional"/>
138+
<xs:attribute type="xs:date" name="thirdDate" use="optional"/>
139+
<xs:attribute type="xs:int" name="thirdDate-constraint" use="optional"/>
140+
<xs:attribute type="xs:int" name="priority" use="optional"/>
141+
<xs:attribute type="xs:string" name="webLink" use="optional"/>
142+
</xs:complexType>
143+
144+
<xs:complexType name="tasks">
145+
<xs:sequence>
146+
<xs:element type="taskproperties" name="taskproperties"/>
147+
<xs:element type="task" name="task" maxOccurs="unbounded" minOccurs="0"/>
148+
</xs:sequence>
149+
<xs:attribute type="xs:string" name="empty-milestones"/>
150+
</xs:complexType>
151+
152+
<xs:complexType name="rate">
153+
<xs:simpleContent>
154+
<xs:extension base="xs:string">
155+
<xs:attribute type="xs:string" name="name"/>
156+
<xs:attribute type="xs:int" name="value"/>
157+
</xs:extension>
158+
</xs:simpleContent>
159+
</xs:complexType>
160+
161+
<xs:complexType name="custom-resource-property">
162+
<xs:simpleContent>
163+
<xs:extension base="xs:string">
164+
<xs:attribute type="xs:string" name="definition-id"/>
165+
<xs:attribute type="xs:string" name="value"/>
166+
</xs:extension>
167+
</xs:simpleContent>
168+
</xs:complexType>
169+
170+
<xs:complexType name="resource">
171+
<xs:sequence>
172+
<xs:element type="rate" name="rate" maxOccurs="1" minOccurs="0"/>
173+
<xs:element type="custom-resource-property" name="custom-property" maxOccurs="unbounded" minOccurs="0"/>
174+
</xs:sequence>
175+
<xs:attribute type="xs:int" name="id" use="optional"/>
176+
<xs:attribute type="xs:string" name="name" use="optional"/>
177+
<xs:attribute type="xs:string" name="function" use="optional"/>
178+
<xs:attribute type="xs:string" name="contacts" use="optional"/>
179+
<xs:attribute type="xs:string" name="phone" use="optional"/>
180+
</xs:complexType>
181+
182+
<xs:complexType name="resources">
183+
<xs:sequence>
184+
<xs:element type="custom-property-definition" name="custom-property-definition" maxOccurs="unbounded" minOccurs="0"/>
185+
<xs:element type="resource" name="resource" maxOccurs="unbounded" minOccurs="0"/>
186+
</xs:sequence>
187+
</xs:complexType>
188+
189+
<xs:complexType name="allocation">
190+
<xs:simpleContent>
191+
<xs:extension base="xs:string">
192+
<xs:attribute type="xs:int" name="task-id" use="optional"/>
193+
<xs:attribute type="xs:int" name="resource-id" use="optional"/>
194+
<xs:attribute type="xs:string" name="function" use="optional"/>
195+
<xs:attribute type="xs:string" name="responsible" use="optional"/>
196+
<xs:attribute type="xs:float" name="load" use="optional"/>
197+
</xs:extension>
198+
</xs:simpleContent>
199+
</xs:complexType>
200+
201+
<xs:complexType name="allocations">
202+
<xs:sequence>
203+
<xs:element type="allocation" name="allocation" maxOccurs="unbounded" minOccurs="0"/>
204+
</xs:sequence>
205+
</xs:complexType>
206+
207+
<xs:complexType name="vacation">
208+
<xs:simpleContent>
209+
<xs:extension base="xs:string">
210+
<xs:attribute type="xs:date" name="start"/>
211+
<xs:attribute type="xs:date" name="end"/>
212+
<xs:attribute type="xs:int" name="resourceid"/>
213+
</xs:extension>
214+
</xs:simpleContent>
215+
</xs:complexType>
216+
217+
<xs:complexType name="vacations">
218+
<xs:sequence>
219+
<xs:element type="vacation" name="vacation"/>
220+
</xs:sequence>
221+
</xs:complexType>
222+
223+
<xs:complexType name="roles">
224+
<xs:sequence>
225+
<xs:element type="role" name="role" maxOccurs="unbounded" minOccurs="0"/>
226+
</xs:sequence>
227+
<xs:attribute type="xs:string" name="roleset-name" use="optional"/>
228+
</xs:complexType>
229+
230+
<xs:complexType name="role">
231+
<xs:simpleContent>
232+
<xs:extension base="xs:string">
233+
<xs:attribute type="xs:string" name="id"/>
234+
<xs:attribute type="xs:string" name="name"/>
235+
</xs:extension>
236+
</xs:simpleContent>
237+
</xs:complexType>
238+
239+
<xs:complexType name="custom-property-definition">
240+
<xs:simpleContent>
241+
<xs:extension base="xs:string">
242+
<xs:attribute type="xs:string" name="id"/>
243+
<xs:attribute type="xs:string" name="name"/>
244+
<xs:attribute type="xs:string" name="type"/>
245+
<xs:attribute type="xs:string" name="default-value" use="optional"/>
246+
</xs:extension>
247+
</xs:simpleContent>
248+
</xs:complexType>
249+
250+
<xs:element name="project">
251+
<xs:complexType>
252+
<xs:sequence>
253+
<xs:element type="xs:string" name="description"/>
254+
<xs:element type="view" name="view" maxOccurs="unbounded" minOccurs="0"/>
255+
<xs:element type="calendars" name="calendars">
256+
<xs:annotation>
257+
<xs:documentation> </xs:documentation>
258+
</xs:annotation>
259+
</xs:element>
260+
<xs:element type="tasks" name="tasks"/>
261+
<xs:element type="resources" name="resources"/>
262+
<xs:element type="allocations" name="allocations"/>
263+
<xs:element type="vacations" name="vacations"/>
264+
<xs:element type="xs:string" name="previous"/>
265+
<xs:element type="roles" name="roles" maxOccurs="unbounded" minOccurs="0"/>
266+
</xs:sequence>
267+
<xs:attribute type="xs:string" name="name"/>
268+
<xs:attribute type="xs:string" name="company"/>
269+
<xs:attribute type="xs:anyURI" name="webLink"/>
270+
<xs:attribute type="xs:date" name="view-date"/>
271+
<xs:attribute type="xs:int" name="view-index"/>
272+
<xs:attribute type="xs:int" name="gantt-divider-location"/>
273+
<xs:attribute type="xs:int" name="resource-divider-location"/>
274+
<xs:attribute type="xs:string" name="version"/>
275+
<xs:attribute type="xs:string" name="locale"/>
276+
</xs:complexType>
277+
</xs:element>
278+
</xs:schema>

jaxb/ganttproject-binding.xjb

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<jxb:bindings version="1.0"
2+
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
3+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
4+
schemaLocation="./jaxb/ganttproject-2.8.xsd">
5+
6+
<jxb:globalBindings>
7+
<!-- globally map date types to Calendar to allow custom print and parse to be used -->
8+
<jxb:javaType name="java.util.Date"
9+
xmlType="xs:date"
10+
parseMethod="net.sf.mpxj.ganttproject.DatatypeConverter.parseDate"
11+
printMethod="net.sf.mpxj.ganttproject.DatatypeConverter.printDate"/>
12+
</jxb:globalBindings>
13+
14+
<!-- rename the value element -->
15+
<jxb:bindings node="//xs:complexType[@name='only-show-weekends']">
16+
<jxb:bindings node=".//xs:attribute[@name='value']">
17+
<jxb:property name="valueAttribute"/>
18+
</jxb:bindings>
19+
</jxb:bindings>
20+
21+
<!-- rename the value element -->
22+
<jxb:bindings node="//xs:complexType[@name='custom-task-property']">
23+
<jxb:bindings node=".//xs:attribute[@name='value']">
24+
<jxb:property name="valueAttribute"/>
25+
</jxb:bindings>
26+
</jxb:bindings>
27+
28+
<!-- rename the value element -->
29+
<jxb:bindings node="//xs:complexType[@name='custom-resource-property']">
30+
<jxb:bindings node=".//xs:attribute[@name='value']">
31+
<jxb:property name="valueAttribute"/>
32+
</jxb:bindings>
33+
</jxb:bindings>
34+
35+
<!-- rename the value element -->
36+
<jxb:bindings node="//xs:complexType[@name='rate']">
37+
<jxb:bindings node=".//xs:attribute[@name='value']">
38+
<jxb:property name="valueAttribute"/>
39+
</jxb:bindings>
40+
</jxb:bindings>
41+
</jxb:bindings>

maven/src/changes/changes.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<author email="[email protected]">Jon Iles</author>
66
</properties>
77
<body>
8-
<release date="git master" version="7.0.4">
8+
<release date="git master" version="7.1.0">
9+
<action dev="joniles" type="add">Added support for reading GanttProject files.</action>
910
</release>
1011
<release date="21/12/2017" version="7.0.3">
1112
<action dev="joniles" type="update">Use the Windows-1252 character set as the default when reading XER files.</action>

0 commit comments

Comments
 (0)