handling of created and cancelled properties

This commit is contained in:
peter 2012-10-16 10:54:36 +02:00
parent 984d169e2c
commit c1ac39ec78

View File

@ -25,6 +25,10 @@ public class PacRemote extends AbstractRemote {
resultMap.put("customer", pac.getCustomer().getName());
resultMap.put("curinetaddr", pac.getCurINetAddr().getInetAddr());
resultMap.put("created", TextUtil.format(pac.getCreated()));
Date cancelled = pac.getCancelled();
if (cancelled != null) {
resultMap.put("cancelled", TextUtil.format(cancelled));
}
resultMap.put("basepac", pac.getBasepac().getName());
Map<String, Object> components = new HashMap<String, Object>();
@ -75,7 +79,17 @@ public class PacRemote extends AbstractRemote {
basePac.setName(basePacName);
pac.setBasepac(basePac);
}
pac.setCreated(new Date());
// pac.setCreated(new Date());
String createdStr = (String) setParams.get("created");
if (createdStr != null && !createdStr.isEmpty()) {
Date createdDate = TextUtil.parse(createdStr);
pac.setCreated(createdDate);
}
String cancelledStr = (String) setParams.get("cancelled");
if (cancelledStr != null && !cancelledStr.isEmpty()) {
Date cancelledDate = TextUtil.parse(cancelledStr);
pac.setCancelled(cancelledDate);
}
INetAddress curINetAddr = pac.getCurINetAddr();
String inetAddrString = (String) setParams.get("curinetaddr");
if ((curINetAddr == null || curINetAddr.getInetAddr() == null) && assertNotNull(inetAddrString)) {