From c1ac39ec784ee417f14ff604d4d413132c6d613c Mon Sep 17 00:00:00 2001
From: peter <peter.hormanns@jalin.de>
Date: Tue, 16 Oct 2012 10:54:36 +0200
Subject: [PATCH] handling of created and cancelled properties

---
 hsarback/src/de/hsadmin/remote/PacRemote.java |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/hsarback/src/de/hsadmin/remote/PacRemote.java b/hsarback/src/de/hsadmin/remote/PacRemote.java
index 9008a76..1ccbef7 100644
--- a/hsarback/src/de/hsadmin/remote/PacRemote.java
+++ b/hsarback/src/de/hsadmin/remote/PacRemote.java
@@ -25,6 +25,10 @@
 		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 @@
 			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)) {

--
Gitblit v1.9.0-SNAPSHOT