1  



package
 hudsonfog.voc.model;

2  



3  



import
 com.fogx.webdav.DavResource;

4  



import
 com.fogx.webdav.DavClass;

5  



import
 com.fogx.webdav.DavBean;

6  



import
 com.fogx.webdav.DavProperty;

7  



import

static
 com.fogx.webdav.DavProperty.*;

8  



import
 com.fogx.webdav.packages.DavBeanPackage;

9  



import
 com.fogx.webdav.util.DavResourceSupport;

10 



import
 com.fogx.webdav.util.UrlUtil;

11 



import
 java.util.Date;

12 



import
 java.util.Map;

13 



import
 java.util.HashMap;

14 



import
 java.util.List;

15 



import
 java.util.Collections;

16 



import
 java.util.Arrays;

17 



18 



import

hudsonfog.voc.model.company
.*;

19 



import

hudsonfog.voc.model.products
.*;

20 



import

hudsonfog.voc.system.primitiveTypes
.*;

21 



import

hudsonfog.voc.model.fulfillment
.*;

22 



import

hudsonfog.voc.system.fog
.*;

23 



import

hudsonfog.voc.model.orders
.*;

24 



import

hudsonfog.voc.model.accounting
.*;

25 



import

hudsonfog.voc.system.parse
.*;

26 



import

hudsonfog.voc.model.top
.*;

27 



import

hudsonfog.voc.system.XMLSchema
.*;

28 



29 



import

hudsonfog.voc.system.fog
.*;

30 



31 



32 



public

abstract

class
 delivery {

33 



34 


  @DavClass._aggregationAllowed

35 



public

static

class
 StockPerOrder {

36 


      @k 
public
 PartyAddress                  location;

37 


      @k 
public

hudsonfog.voc.model.top.Order
 order;

38 



public
 ExternalOrganization          shipper;

39 



public
 ExternalOrganization          consignee;

40 



public
 ExternalOrganization          forwarder;

41 


         @_backLink(
"stockLevel"
)

42 



public
 StockItem[]                   items;

43 


         @_label(
"Last inventory date"
)

44 


      @k 
public
 ComplexDate                   date;

45 


  }

46 



47 


  @DavClass._aggregationAllowed

48 



public

static

class
 LastInventoryMark {

49 


      @k 
public
 PartyAddress                  location;

50 


      @r 
public
 ComplexDate                   lastInventoryDate;

51 


  }

52 



53 


  @DavClass._notSiteSharable

54 



public

static

class
 StockItem {

55 


      @k 
public
 StockPerOrder                 stockLevel;

56 


      @k 
public
 Integer                       seq;

57 



public
 ComplexDate                   dateStored;

58 



public
 Integer                       quantity;

59 


  }

60 



61 



public

static

class
 DamageDocument 
extends

hudsonfog.voc.model.top.Document
 {

62 


         @_maxSize(
100
)

63 


      @k 
public
 String                        number;

64 


      @s 
public
 Damage                        event;

65 


    @h@s 
public

hudsonfog.voc.model.top.Order
 order; 
//* not applicable to this class

66 



         @_backLink(
"document"
)

67 


    @h@s 
public
 BusinessEvent[]               events; 
//* not applicable to this class

68 



      @s 
public
 FulfillmentItem               items;

69 


  }

70 



71 



public

static

class
 Damage 
extends

hudsonfog.voc.model.top.BusinessEvent
 {

72 


      @k 
public
 Vehicle                       vehicle;

73 


    @k@s 
public
 BusinessEventType             eventType;

74 


    @k@s 
public
 ComplexDate                   date;

75 


    @k@s 
public
 PartyAddress                  location;

76 


      @s 
public
 DamageDocument                document;

77 


    @h@s 
public
 BusinessEvent                 nextEvent;

78 


    @h@s 
public
 BusinessEvent                 previousEvent;

79 


         @_backLink(
"event"
)

80 


    @h@s 
public
 Fulfillment[]                 fulfills;

81 


  }

82 



83 



/**

84 


 * This class is used when nothing is known about the Document except its number

85 


 */

86 



public

static

class
 TransportDocument 
extends

hudsonfog.voc.model.top.Document
 {

87 


    @h@s 
public

hudsonfog.voc.model.top.Order
 order;

88 


    @h@s 
public
 BusinessEvent                 event;

89 


         @_maxSize(
100
)

90 


      @k 
public
 String                        number;

91 


      @s 
public
 BusinessEvent                 events;

92 


      @s 
public
 FulfillmentItem               items;

93 


  }

94 



95 


  @DavClass._avoidEditing

96 



public

static

class
 Transport 
extends

hudsonfog.voc.model.top.BusinessEvent
 {

97 


         @_displayNameElm

98 


         @_noLink

99 


      @k 
public
 Vehicle                       vehicle;

100


      @r 
public
 TransportationMode            transportationMode;

101


    @k@s 
public
 BusinessEventType             eventType;

102


    @k@s 
public
 ComplexDate                   date;

103



public
 Long                          estimatedDeparture;

104



public
 Long                          departureDate;

105



public
 Long                          estimatedArrival;

106


    @k@s 
public
 PartyAddress                  location;

107


         @_backLink(
"transport"
)

108


         @_subPropertyOf(
"fulfills"
)

109


      @s 
public
 PackingList[]                 packingLists;

110


      @s 
public
 Transport                     nextEvent;

111


      @s 
public
 Transport                     previousEvent;

112



public
 Transport                     within; 
//* one transport vehicle may be within another, e.g. container on vessel; wagon attached to a train

113



         @_noLink

114


         @_subPropertyOf(
"document"
)

115


      @s 
public
 TransportDocument             waybill;

116



public
 ExternalOrganization          carrier;

117



public
 ExternalOrganization          shipper;

118



public
 Country                       destinationCountry;

119


         @_maxSize(
200
)

120



public
 String                        destination;

121


         @_makeTotal

122



public
 ton                           grossWeight;

123


         @_makeTotal

124



public
 Integer                       unitCount;

125


  }

126



127


  @DavClass._dataLocationIndexServer

128


  @DavClass._skipAccessControl

129



public

static

class
 TransportationMode 
extends

hudsonfog.voc.system.fog.ListItem
 {

130


         @_maxSize(
50
)

131


      @k 
public
 String                        code;

132


         @_maxSize(
100
)

133



public
 String                        description;

134


  }

135



136


  @DavClass._abstract

137



public

static

abstract

class
 ShipmentDocument 
extends

hudsonfog.voc.model.top.Document
 {

138


         @_subPropertyOf(
"event"
)

139


    @k@s 
public
 Transport                     transport;

140


    @k@s 
public

hudsonfog.voc.model.top.Order
 order;

141



public
 ExternalOrganization          shipper;

142



public
 ExternalOrganization          consignee;

143



public
 ExternalOrganization          forwarder;

144


  }

145



146


  @DavClass._avoidIndexing

147



public

static

class
 PackingList 
extends
 ShipmentDocument {

148


    @k@s 
public
 Transport                     transport;

149


    @k@s 
public

hudsonfog.voc.model.orders.Order
 order;

150


         @_maxSize(
100
)

151



public
 String                        number;

152


         @_backLink(
"document"
)

153


    @h@s 
public
 BusinessEvent[]               events; 
//* Events that are connected to this Document, but themselves fulfill other orders

154



      @s 
public
 ExternalOrganization          shipper;

155


      @s 
public
 ExternalOrganization          consignee;

156


      @s 
public
 ExternalOrganization          forwarder;

157


      @s 
public
 FulfillmentItem               items;

158


  }

159



160



public

static

class
 BillOfLading 
extends
 ShipmentDocument {

161


         @_maxSize(
100
)

162


      @k 
public
 String                        number;

163


         @_subPropertyOf(
"order"
)

164


      @s 
public

hudsonfog.voc.model.orders.Order
 bookingOrder;

165


         @_maxSize(
200
)

166



public
 String                        destination;

167



public
 Country                       destinationCountry;

168


      @s 
public
 Transport                     transport;

169


      @s 
public
 ExternalOrganization          shipper;

170


      @s 
public
 ExternalOrganization          consignee;

171


      @s 
public
 ExternalOrganization          forwarder;

172


      @s 
public
 BusinessEvent                 events;

173


      @s 
public
 FulfillmentItem               items;

174


  }

175



176



public

static

class
 BillOfLading2 
extends
 TransportDocument {

177


    @k@s 
public
 String                        number;

178


         @_subPropertyOf(
"event"
)

179


      @s 
public
 Transport                     transport;

180


         @_subPropertyOf(
"order"
)

181


      @s 
public

hudsonfog.voc.model.orders.Order
 bookingOrder;

182



public
 ExternalOrganization          shipper;

183



public
 ExternalOrganization          consignee;

184



public
 ExternalOrganization          forwarder;

185


         @_maxSize(
200
)

186



public
 String                        destination;

187



public
 Country                       destinationCountry;

188


  }

189



190



public

static

class
 BLItem 
extends

hudsonfog.voc.model.top.FulfillmentItem
 {

191


         @_subPropertyOf(
"fulfillment"
)

192


    @k@s 
public
 BillOfLading                  billOfLading;

193


    @k@s 
public
 Integer                       seq;

194


      @s 
public
 DavResource                   unit;

195


      @s 
public
 Integer                       quantity;

196


  }

197



198



public

static

class
 PackingListNoOrder 
extends
 PackingList {

199


    @k@s 
public
 Transport                     transport;

200


      @s 
public

hudsonfog.voc.model.orders.Order
 order;

201


  }

202



203



public

static

class
 LoadingAdvice 
extends

hudsonfog.voc.model.top.Fulfillment
 {

204


      @k 
public
 Integer                       number;

205


      @s 
public

hudsonfog.voc.model.top.Order
 order;

206


      @s 
public
 BusinessEvent                 event;

207


      @s 
public
 FulfillmentItem               items;

208


  }

209



210



public

static

class
 DispatchAdvice 
extends

hudsonfog.voc.model.top.Fulfillment
 {

211


      @k 
public
 Integer                       number;

212


      @s 
public

hudsonfog.voc.model.top.Order
 order;

213


      @s 
public
 BusinessEvent                 event;

214


      @s 
public
 FulfillmentItem               items;

215


  }

216



217



/*

218


class ContainerTransport extends Transport implements Container cn {

219


 -aggregationAllowed : true;

220


 -icon: "icons/container.gif";

221


  #Container                    container :: vehicle;

222


   -displayNameElm : true;

223


  #t.BusinessEventType          eventType :: eventType;

224


  #f.ComplexDate                date :: date;

225


  #c.PartyAddress               location :: location;

226


   string(50)                   sealNumber;

227


   string(100)                  returnTo;

228


   c.ExternalOrganization       owner :: cn.owner;

229


   ContainerType                containerType :: cn.type;

230


   string                       containerLength :: cn.length;

231


   kg                           cargoCapacity :: cn.cargoCapacity;

232


   kg                           tareWeight :: cn.tareWeight;

233


   ContainerTransport           next :: nextEvent;

234


   ContainerTransport           previous :: previousEvent;

235


   ton                          grossWeight;

236


   int                          unitCount;

237


}

238


*/

239


  @DavClass._icon(
"icons/container.gif"
)

240


  @DavClass._aggregationAllowed

241



public

static

class
 ContainerTransport 
extends
 Transport {

242


         @_displayNameElm

243


         @_noLink

244


         @_subPropertyOf(
"vehicle"
)

245


    @k@s 
public
 Container                     container;

246


    @k@s 
public
 BusinessEventType             eventType;

247


    @k@s 
public
 ComplexDate                   date;

248


    @k@s 
public
 PartyAddress                  location;

249


         @_maxSize(
50
)

250



public
 String                        sealNumber;

251


         @_maxSize(
100
)

252



public
 String                        returnTo;

253



public
 ExternalOrganization          owner;

254



public
 ContainerType                 containerType;

255



public
 String                        containerLength;

256



public
 kg                            cargoCapacity;

257



public
 kg                            tareWeight;

258


         @_subPropertyOf(
"nextEvent"
)

259


      @s 
public
 ContainerTransport            next;

260


         @_subPropertyOf(
"previousEvent"
)

261


      @s 
public
 ContainerTransport            previous;

262


         @_makeTotal

263


         @_oldName(
"totalReels"
)

264


      @s 
public
 Integer                       unitCount;

265


  }

266



267


  @DavClass._label(
"Container"
)

268



public

static

class
 ContainerOnRailwayPlatform 
extends
 ContainerTransport {

269


         @_displayNameElm

270


    @k@s 
public
 Container                     container;

271


         @_maxSize(
20
)

272


      @k 
public
 String                        platform;

273


      @s 
public
 TransportDocument             waybill;

274


    @k@s 
public
 PartyAddress                  location;

275


    @k@s 
public
 BusinessEventType             eventType;

276


      @s 
public
 ComplexDate                   date;

277


  }

278



279



public

static

class
 ContainerOnTrain 
extends
 ContainerOnRailwayPlatform {

280


         @_displayNameElm

281


    @k@s 
public
 Container                     container;

282


    @k@s 
public
 String                        platform;

283


    @k@s 
public
 TransportDocument             waybill;

284


      @s 
public
 PartyAddress                  location;

285


      @s 
public
 BusinessEventType             eventType;

286


      @s 
public
 ComplexDate                   date;

287


  }

288



289



public

static

class
 ContainerOnTruck 
extends
 ContainerTransport {

290


         @_displayNameElm

291


    @k@s 
public
 Container                     container;

292


         @_maxSize(
30
)

293


      @k 
public
 String                        truck;

294


    @k@s 
public
 TransportDocument             waybill;

295



public
 String                        trailer;

296


      @s 
public
 PartyAddress                  location;

297


      @s 
public
 BusinessEventType             eventType;

298


      @s 
public
 ComplexDate                   date;

299


  }

300



301


  @DavClass._label(
"Container"
)

302



public

static

class
 ContainerLoaded 
extends
 ContainerTransport {

303


         @_displayNameElm

304


    @k@s 
public
 Container                     container;

305


    @k@s 
public
 TransportDocument             waybill;

306


    @k@s 
public
 ExternalOrganization          shipper;

307


         @_maxSize(
20
)

308



public
 String                        platform;

309


         @_maxSize(
20
)

310



public
 String                        truck;

311


         @_maxSize(
20
)

312



public
 String                        trailer;

313


      @s 
public
 PartyAddress                  location;

314


      @s 
public
 BusinessEventType             eventType;

315


      @s 
public
 ComplexDate                   date;

316


  }

317



318


  @DavClass._viewCols(
"railcar, railwayBill, date, eventType"
)

319


  @DavClass._icon(
"icons/classes/Wagon.gif"
)

320



public

static

class
 RailcarTransport 
extends
 Transport {

321


         @_displayNameElm

322


         @_subPropertyOf(
"vehicle"
)

323


    @k@s 
public
 RailwayCar                    railcar;

324


    @k@s 
public
 BusinessEventType             eventType;

325


    @k@s 
public
 ComplexDate                   date;

326


    @k@s 
public
 PartyAddress                  location;

327


         @_subPropertyOf(
"waybill"
)

328


      @s 
public
 TransportDocument             railwayBill;

329


  }

330



331



public

static

class
 RailcarLoaded 
extends
 RailcarTransport {

332


         @_displayNameElm

333


    @k@s 
public
 RailwayCar                    railcar;

334


    @k@s 
public
 TransportDocument             railwayBill;

335


    @k@s 
public
 ExternalOrganization          shipper;

336


      @s 
public
 PartyAddress                  location;

337


      @s 
public
 BusinessEventType             eventType;

338


      @s 
public
 ComplexDate                   date;

339


  }

340



341


  @DavClass._largeIcon(
"icons/classes/Truck-large.gif"
)

342


  @DavClass._icon(
"icons/classes/Truck.gif"
)

343



public

static

class
 TruckTransport 
extends
 Transport {

344


         @_displayNameElm

345


         @_noLink

346


         @_subPropertyOf(
"vehicle"
)

347


    @k@s 
public
 Truck                         truck;

348


    @k@s 
public
 BusinessEventType             eventType;

349


    @k@s 
public
 ComplexDate                   date;

350


    @k@s 
public
 PartyAddress                  location;

351



public
 Trailer                       trailer1;

352



public
 Trailer                       trailer2;

353



public
 Trailer                       trailer3;

354



public
 ExternalOrganization          endUser;

355


  }

356



357


  @DavClass._largeIcon(
"icons/classes/Truck-large.gif"
)

358


  @DavClass._icon(
"icons/classes/Truck.gif"
)

359



public

static

class
 TruckLoaded 
extends
 TruckTransport {

360


         @_displayNameElm

361


         @_noLink

362


    @k@s 
public
 Truck                         truck;

363


    @k@s 
public
 TransportDocument             waybill;

364


    @k@s 
public
 ExternalOrganization          shipper;

365


      @s 
public
 BusinessEventType             eventType;

366


      @s 
public
 ComplexDate                   date;

367


      @s 
public
 PartyAddress                  location;

368


  }

369



370


  @DavClass._label(
"Truck Transport"
)

371



public

static

class
 TruckTransport1 
extends
 TruckTransport {

372


         @_displayNameElm

373


    @k@s 
public
 Truck                         truck;

374


    @k@s 
public
 TransportDocument             waybill;

375


    @k@s 
public
 BusinessEventType             eventType;

376


    @k@s 
public
 PartyAddress                  location;

377


      @s 
public
 ComplexDate                   date;

378


  }

379



380


  @DavClass._label(
"Truck Transport"
)

381



public

static

class
 TruckTransportNoTruck 
extends
 TruckTransport {

382


         @_displayNameElm

383


         @_subPropertyOf(
"waybill"
)

384


    @k@s 
public
 TransportDocument             deliveryNote;

385


    @k@s 
public
 BusinessEventType             eventType;

386


    @k@s 
public
 PartyAddress                  location;

387


      @s 
public
 ComplexDate                   date;

388


    @h@s 
public
 Truck                         truck;

389


  }

390



391


  @DavClass._icon(
"icons/vessel.gif"
)

392



public

static

class
 VesselTransport 
extends
 Transport {

393


         @_displayNameElm

394


         @_subPropertyOf(
"vehicle"
)

395


    @k@s 
public
 Vessel                        vessel;

396


    @k@s 
public
 BusinessEventType             eventType;

397


    @k@s 
public
 ComplexDate                   date;

398


    @k@s 
public
 PartyAddress                  location;

399



public
 VesselVoyageDocument          voyage;

400


         @_maxSize(
100
)

401



public
 String                        portOfLoad;

402


         @_maxSize(
100
)

403



public
 String                        portOfDischarge;

404


  }

405



406


  @DavClass._icon(
"icons/vessel.gif"
)

407



public

static

class
 VesselTransport1 
extends
 Transport {

408


         @_displayNameElm

409


         @_subPropertyOf(
"vehicle"
)

410


    @k@s 
public
 Vessel                        vessel;

411


    @k@s 
public
 BusinessEventType             eventType;

412


    @k@s 
public
 PartyAddress                  location;

413


    @k@s 
public
 TransportDocument             waybill;

414


      @s 
public
 ComplexDate                   date;

415



public
 VesselVoyageDocument          voyage;

416


         @_maxSize(
100
)

417



public
 String                        portOfLoad;

418


         @_maxSize(
100
)

419



public
 String                        portOfDischarge;

420


  }

421



422


  @DavClass._icon(
"icons/vessel.gif"
)

423



public

static

class
 VesselTransport2 
extends
 Transport {

424


         @_displayNameElm

425


         @_subPropertyOf(
"vehicle"
)

426


    @k@s 
public
 Vessel                        vessel;

427


    @k@s 
public
 BusinessEventType             eventType;

428


    @k@s 
public
 PartyAddress                  location;

429


      @s 
public
 TransportDocument             waybill;

430


      @s 
public
 ComplexDate                   date;

431


      @k 
public
 VesselVoyageDocument          voyage;

432


         @_maxSize(
100
)

433



public
 String                        portOfLoad;

434


         @_maxSize(
100
)

435



public
 String                        portOfDischarge;

436


    @k@s 
public
 ExternalOrganization          carrier;

437


  }

438



439


  @DavClass._icon(
"icons/train.gif"
)

440



public

static

class
 TrainTransport 
extends
 Transport {

441


         @_displayNameElm

442


         @_noLink

443


         @_subPropertyOf(
"vehicle"
)

444


    @k@s 
public
 Train                         train;

445


    @k@s 
public
 BusinessEventType             eventType;

446


    @k@s 
public
 PartyAddress                  location;

447


      @s 
public
 ComplexDate                   date;

448



public
 TrainVoyageDocument           voyage;

449


  }

450



451



public

static

class
 RailwayBill 
extends
 TransportDocument {

452


    @k@s 
public
 String                        number;

453


  }

454



455



public

static

class
 VesselVoyageDocument 
extends
 TransportDocument {

456


    @k@s 
public
 String                        number;

457


  }

458



459



public

static

class
 TrainVoyageDocument 
extends
 TransportDocument {

460


    @k@s 
public
 String                        number;

461


  }

462



463


  @DavClass._dataLocationIndexServer

464


  @DavClass._icon(
"icons/container.gif"
)

465



public

static

class
 Container 
extends
 Vehicle {

466


    @k@s 
public
 String                        number;

467



public
 ExternalOrganization          owner;

468



public
 kg                            cargoCapacity;

469



public
 kg                            tareWeight;

470


         @_maxSize(
10
)

471



public
 String                        length;

472


         @_subPropertyOf(
"vehicleType"
)

473


      @s 
public
 ContainerType                 containerType;

474


  }

475



476


  @DavClass._largeIcon(
"icons/classes/Truck-large.gif"
)

477


  @DavClass._dataLocationIndexServer

478


  @DavClass._icon(
"icons/classes/Truck.gif"
)

479



public

static

class
 Truck 
extends
 Vehicle {

480


    @k@s 
public
 String                        number;

481


  }

482



483


  @DavClass._dataLocationIndexServer

484



public

static

class
 Trailer 
extends
 Vehicle {

485


    @k@s 
public
 String                        number;

486


  }

487



488


  @DavClass._dataLocationIndexServer

489


  @DavClass._icon(
"icons/classes/Wagon.gif"
)

490



public

static

class
 RailwayCar 
extends
 Vehicle {

491


    @k@s 
public
 String                        number;

492


  }

493



494


  @DavClass._dataLocationIndexServer

495


  @DavClass._icon(
"icons/vessel.gif"
)

496



public

static

class
 Vessel 
extends
 Vehicle {

497


         @_subPropertyOf(
"number"
)

498


    @k@s 
public
 String                        name;

499


  }

500



501


  @DavClass._dataLocationIndexServer

502


  @DavClass._icon(
"icons/train.gif"
)

503



public

static

class
 Train 
extends
 Vehicle {

504


    @k@s 
public
 String                        number;

505


  }

506



507


  @DavClass._dataLocationIndexServer

508



public

static

class
 UnknownVehicle 
extends
 Vehicle {

509


    @k@s 
public
 String                        number;

510


  }

511



512


  @DavClass._dataLocationIndexServer

513



public

static

class
 OtherVehicle 
extends
 Vehicle {

514


    @k@s 
public
 String                        number;

515


  }

516



517


  @DavClass._dataLocationIndexServer

518



public

static

class
 Vehicle 
extends

hudsonfog.voc.model.company.FixedAsset
 {

519


         @_subPropertyOf(
"assetId"
)

520


    @k@s 
public
 String                        number;

521


      @r 
public
 VehicleType                   vehicleType;

522


      @s 
public
 Organization                  organization;

523


  }

524



525


  @DavClass._dataLocationIndexServer

526


  @DavClass._skipAccessControl

527



public

static

class
 VehicleType 
extends

hudsonfog.voc.system.fog.ListItem
 {

528


         @_maxSize(
40
)

529


      @k 
public
 String                        code;

530


         @_maxSize(
100
)

531


      @r 
public
 String                        description;

532


  }

533



534


  @DavClass._dataLocationIndexServer

535


  @DavClass._skipAccessControl

536



public

static

class
 ContainerType 
extends
 VehicleType {

537


    @k@s 
public
 String                        code;

538


  }

539



540


  @DavClass._dataLocationIndexServer

541


  @DavClass._skipAccessControl

542



public

static

class
 ShipmentMethodType 
extends

hudsonfog.voc.system.fog.ListItem
 {

543


         @_maxSize(
100
)

544


      @k 
public
 String                        code;

545


         @_maxSize(
100
)

546



public
 String                        description;

547


  }

548


}

549