Resolved Policy GUI Issues

Resolved the time to leave date issue field to support all browsers.
Resolved Export and Import Policy Functionality.
Added few GUI cosmetic fixes.

Issue-Id : POLICY-221

Change-Id: I920a4d9c8e16ae1cffcd13df3319e109a992ba55
Signed-off-by: rb7147 <rb7147@att.com>
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
index d989470..64324d4 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
@@ -115,7 +115,7 @@
 				policyData.setTtlDate("NA");
 			}else{
 				String dateTTL = policyData.getTtlDate();
-				String newDate = convertDate(dateTTL, false);
+				String newDate = convertDate(dateTTL);
 				policyData.setTtlDate(newDate);
 			}
 
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/AbstractPolicyCreation.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/AbstractPolicyCreation.java
index 71de2b2..aa33729 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/AbstractPolicyCreation.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/AbstractPolicyCreation.java
@@ -40,18 +40,10 @@
 				getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID());
 	}
 	
-	public String convertDate(String dateTTL, boolean portalType) {
+	public String convertDate(String dateTTL) {
 		String formateDate = null;
-		String[] date;
-		String[] parts;
-		
-		if (portalType){
-			parts = dateTTL.split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
-		} else {
-			date  = dateTTL.split("T");
-			parts = date[0].split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
+		if(dateTTL.contains("/")){
+			formateDate = dateTTL.replace("/", "-");
 		}
 		return formateDate;
 	}
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSParamController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSParamController.java
index 9104b98..fc7cb60 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSParamController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSParamController.java
@@ -337,27 +337,13 @@
 				policyAdapter.setGuard(value);
 			}
 			if ("TTLDate".equals(attributeId) && !value.contains("NA")){
-				String newDate = convertDate(value, true);
+				PolicyController controller = new PolicyController();
+				String newDate = controller.convertDate(value);
 				policyAdapter.setTtlDate(newDate);
 			}
 		}
 	}
 
-	private String convertDate(String dateTTL, boolean portalType) {
-		String formateDate = null;
-		String[] date;
-		String[] parts;
-		
-		if (portalType){
-			parts = dateTTL.split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z";
-		} else {
-			date  = dateTTL.split("T");
-			parts = date[0].split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
-		}
-		return formateDate;
-	}
 	// This method generates the UI from rule configuration
 	public void paramUIGenerate(PolicyRestAdapter policyAdapter, PolicyEntity entity) {
 		String data = entity.getConfigurationData().getConfigBody();
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSRawController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSRawController.java
index 9851d31..b08761b 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSRawController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSRawController.java
@@ -141,7 +141,8 @@
 											policyAdapter.setGuard(value);
 										}
 										if (attributeId.equals("TTLDate") && !value.contains("NA")){
-											String newDate = convertDate(value, true);
+											PolicyController controller = new PolicyController();
+											String newDate = controller.convertDate(value);
 											policyAdapter.setTtlDate(newDate);
 										}
 									}
@@ -154,19 +155,4 @@
 		} 
 	}
 
-	private String convertDate(String dateTTL, boolean portalType) {
-		String formateDate = null;
-		String[] date;
-		String[] parts;
-		
-		if (portalType){
-			parts = dateTTL.split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z";
-		} else {
-			date  = dateTTL.split("T");
-			parts = date[0].split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
-		}
-		return formateDate;
-	}
 }
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopFaultController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopFaultController.java
index e7740c3..20a671b 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopFaultController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopFaultController.java
@@ -564,7 +564,8 @@
 											policyAdapter.setGuard(value);
 										}
 										if (attributeId.equals("TTLDate") && !value.contains("NA")){
-											String newDate = convertDate(value, true);
+											PolicyController controller = new PolicyController();
+											String newDate = controller.convertDate(value);
 											policyAdapter.setTtlDate(newDate);
 										}
 									}
@@ -579,22 +580,6 @@
 
 	}
 
-	private String convertDate(String dateTTL, boolean portalType) {
-		String formateDate = null;
-		String[] date;
-		String[] parts;
-
-		if (portalType){
-			parts = dateTTL.split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z";
-		} else {
-			date  = dateTTL.split("T");
-			parts = date[0].split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
-		}
-		return formateDate;
-	}
-
 	private String readClosedLoopJSONFile(PolicyRestAdapter policyAdapter, PolicyEntity entity) {
 		ObjectMapper mapper = new ObjectMapper();
 		try {
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java
index a4d6014..f10041e 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java
@@ -111,7 +111,8 @@
 											policyAdapter.setGuard(value);
 										}
 										if (attributeId.equals("TTLDate") && !value.contains("NA")){
-											String newDate = convertDate(value, true);
+											PolicyController controller = new PolicyController();
+											String newDate = controller.convertDate(value);
 											policyAdapter.setTtlDate(newDate);
 										}
 										if (attributeId.equals("ServiceType")){
@@ -140,22 +141,6 @@
 		}		
 	}
 
-	private String convertDate(String dateTTL, boolean portalType) {
-		String formateDate = null;
-		String[] date;
-		String[] parts;
-
-		if (portalType){
-			parts = dateTTL.split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z";
-		} else {
-			date  = dateTTL.split("T");
-			parts = date[0].split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
-		}
-		return formateDate;
-	}
-
 	protected void readClosedLoopJSONFile(PolicyRestAdapter policyAdapter, PolicyEntity entity) {
 		ObjectMapper mapper = new ObjectMapper();
 		try {
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java
index 6405e6f..a814b0d 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java
@@ -1236,7 +1236,8 @@
 											policyAdapter.setGuard(value);
 										}
 										if (attributeId.equals("TTLDate") && !value.contains("NA")){
-											String newDate = convertDate(value, true);
+											PolicyController controller = new PolicyController();
+											String newDate = controller.convertDate(value);
 											policyAdapter.setTtlDate(newDate);
 										}
 									}
@@ -1249,15 +1250,6 @@
 			}
 		}
 	}
-
-	private String convertDate(String dateTTL, boolean portalType) {
-		String formateDate = null;
-		String[] date  = dateTTL.split("T");
-		String[] parts = date[0].split("-");
-			
-		formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
-		return formateDate;
-	}
 	
 	public static Map<String, String> convert(String str, String split) {
 		Map<String, String> map = new HashMap<>();
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateFirewallController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateFirewallController.java
index 828bc38..ed0bf4c 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateFirewallController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateFirewallController.java
@@ -282,7 +282,8 @@
 											policyAdapter.setGuard(value);
 										}
 										if (attributeId.equals("TTLDate") && !value.contains("NA")){
-											String newDate = convertDate(value, true);
+											PolicyController controller = new PolicyController();
+											String newDate = controller.convertDate(value);
 											policyAdapter.setTtlDate(newDate);
 										}
 									}
@@ -295,22 +296,6 @@
 		}
 	}
 	
-	private String convertDate(String dateTTL, boolean portalType) {
-		String formateDate = null;
-		String[] date;
-		String[] parts;
-		
-		if (portalType){
-			parts = dateTTL.split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z";
-		} else {
-			date  = dateTTL.split("T");
-			parts = date[0].split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
-		}
-		return formateDate;
-	}
-	
 	@RequestMapping(value={"/policyController/ViewFWPolicyRule.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
 	public void setFWViewRule(HttpServletRequest request, HttpServletResponse response){
 		try {
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java
index 4506fb8..625b2bd 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java
@@ -52,22 +52,6 @@
 	private ArrayList<Object> attributeList;
 	boolean isValidForm = false;
 
-	private String convertDate(String dateTTL, boolean portalType) {
-		String formateDate = null;
-		String[] date;
-		String[] parts;
-
-		if (portalType){
-			parts = dateTTL.split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z";
-		} else {
-			date  = dateTTL.split("T");
-			parts = date[0].split("-");
-			formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
-		}
-		return formateDate;
-	}
-
 	public void prePopulateBaseConfigPolicyData(PolicyRestAdapter policyAdapter, PolicyEntity entity) {
 		attributeList = new ArrayList<>();
 		if (policyAdapter.getPolicyData() instanceof PolicyType) {
@@ -130,7 +114,8 @@
 											policyAdapter.setGuard(value);
 										}
 										if (attributeId.equals("TTLDate") && !value.contains("NA")){
-											String newDate = convertDate(value, true);
+											PolicyController controller = new PolicyController();
+											String newDate = controller.convertDate(value);
 											policyAdapter.setTtlDate(newDate);
 										}
 										if (attributeId.equals("ConfigName")){
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyController.java
index 4a6c230..eac06a7 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyController.java
@@ -694,4 +694,12 @@
 	public static String getFile() {
 		return file;
 	}
+	
+	public String convertDate(String dateTTL) {
+		String formateDate = null;
+		if(dateTTL.contains("-")){
+			formateDate = dateTTL.replace("-", "/");
+		}
+		return formateDate;
+	}
 }
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyExportAndImportController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyExportAndImportController.java
index a6c6bf6..856d825 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyExportAndImportController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyExportAndImportController.java
@@ -21,9 +21,11 @@
 package org.onap.policy.controller;
 
 
+import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.FileWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.ArrayList;
@@ -237,6 +239,7 @@
 		Iterator<Row> rowIterator = datatypeSheet.iterator();
 
 		while (rowIterator.hasNext()) {
+			finalColumn = false;
 			policyEntity = new PolicyEntity();
 			configurationDataEntity = new ConfigurationDataEntity();
 			actionBodyEntity = new ActionBodyEntity();
@@ -343,12 +346,26 @@
 						configurationDataEntity.setCreatedBy(userId);
 						configurationDataEntity.setModifiedBy(userId);
 						commonClassDao.save(configurationDataEntity);
+						try(FileWriter fw = new FileWriter(PolicyController.getConfigHome() + File.separator + configName)){
+							BufferedWriter bw = new BufferedWriter(fw);
+							bw.write(configurationDataEntity.getConfigBody());
+							bw.close();
+						} catch (IOException e) {
+							logger.error("Exception Occured While cloning the configuration file",e);
+						}
 					}
 					if(actionExists){
 						actionBodyEntity.setDeleted(false);
 						actionBodyEntity.setCreatedBy(userId);
 						actionBodyEntity.setModifiedBy(userId);
 						commonClassDao.save(actionBodyEntity);
+						try(FileWriter fw = new FileWriter(PolicyController.getActionHome() + File.separator + actionBodyEntity.getActionBodyName())) {
+							BufferedWriter bw = new BufferedWriter(fw);
+							bw.write(actionBodyEntity.getActionBody());
+							bw.close();
+						} catch (IOException e) {
+							logger.error("Exception Occured While cloning the configuration file",e);
+						}
 					}
 					if(configName != null){
 						if(configName.contains("Config_")){
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/main/policyEditor.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/main/policyEditor.html
index 6ae6b88..9721e1c 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/main/policyEditor.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/main/policyEditor.html
@@ -40,6 +40,8 @@
 	<script src= "app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
 	<script src= "app/fusion/external/jquery/dist/jquery.min.js"></script>
 	<script src= "app/policyApp/libs/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
+	<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
+    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
 	
 	<!---------------------------Angular Gridster-------------------------------->
 	<link rel="stylesheet" href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">	
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSParamPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSParamPolicyController.js
index eb3bfce..02c3148 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSParamPolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSParamPolicyController.js
@@ -36,6 +36,15 @@
         return $('#' + id).modal(hide ? 'hide' : 'show');
     };
     
+    $('#ttlDate').datepicker({
+    	dateFormat: 'dd/mm/yy',
+    	changeMonth: true,
+    	changeYear: true,
+    	onSelect: function(date) {
+    		angular.element($('#ttlDate')).triggerHandler('input');
+    	}
+    });
+    
     $scope.validateSuccess = true;
     var readValue = $scope.temp.policy.readOnly;
     if(readValue){
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSRawPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSRawPolicyController.js
index 451d2ea..8f27f2a 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSRawPolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSRawPolicyController.js
@@ -36,6 +36,15 @@
         return $('#' + id).modal(hide ? 'hide' : 'show');
     };
     
+    $('#ttlDate').datepicker({
+    	dateFormat: 'dd/mm/yy',
+    	changeMonth: true,
+    	changeYear: true,
+    	onSelect: function(date) {
+    		angular.element($('#ttlDate')).triggerHandler('input');
+    	}
+    });
+    
     PolicyAppService.getData('getDictionary/get_BRMSControllerDataByName').then(function (data) {
     	var j = data;
     	$scope.data = JSON.parse(j.data);
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BaseConfigPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BaseConfigPolicyController.js
index 54ce401..891e409 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BaseConfigPolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BaseConfigPolicyController.js
@@ -37,6 +37,15 @@
         return $('#' + id).modal(hide ? 'hide' : 'show');
     };
     
+    $('#ttlDate').datepicker({
+    	dateFormat: 'dd/mm/yy',
+    	changeMonth: true,
+    	changeYear: true,
+    	onSelect: function(date) {
+    		angular.element($('#ttlDate')).triggerHandler('input');
+    	}
+    });
+    
     PolicyAppService.getData('getDictionary/get_OnapNameDataByName').then(function (data) {
     	var j = data;  
     	$scope.data = JSON.parse(j.data);
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js
index b93fc8a..b3f702f 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js
@@ -35,6 +35,15 @@
     $scope.modal = function(id, hide) {
         return $('#' + id).modal(hide ? 'hide' : 'show');
     };
+    
+    $('#ttlDate').datepicker({
+    	dateFormat: 'dd/mm/yy',
+    	changeMonth: true,
+    	changeYear: true,
+    	onSelect: function(date) {
+    		angular.element($('#ttlDate')).triggerHandler('input');
+    	}
+    });
 	
 	if($scope.temp.policy.triggerTrapSignatures == undefined){
 		$scope.temp.policy.triggerTrapSignatures = [];
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopPMController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopPMController.js
index c81f465..caec13f 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopPMController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopPMController.js
@@ -35,6 +35,15 @@
 	  $scope.modal = function(id, hide) {
 	      return $('#' + id).modal(hide ? 'hide' : 'show');
 	  };
+	  
+	  $('#ttlDate').datepicker({
+		  dateFormat: 'dd/mm/yy',
+		  changeMonth: true,
+		  changeYear: true,
+		  onSelect: function(date) {
+			  angular.element($('#ttlDate')).triggerHandler('input');
+		  }
+	  });
 	 
 	 PolicyAppService.getData('getDictionary/get_OnapNameDataByName').then(function (data) {
 		 var j = data;
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js
index 8dd559c..a983d2f 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js
@@ -37,6 +37,15 @@
         return $('#' + id).modal(hide ? 'hide' : 'show');
     };
     
+    $('#ttlDate').datepicker({
+    	dateFormat: 'dd/mm/yy',
+    	changeMonth: true,
+    	changeYear: true,
+    	onSelect: function(date) {
+    		angular.element($('#ttlDate')).triggerHandler('input');
+    	}
+    });
+    
 	if ($scope.temp.policy.editPolicy != undefined|| $scope.temp.policy.readOnly  != undefined){
 		if ($scope.temp.policy.configName == undefined){
 			$scope.isCheck = false;
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/FirewallPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/FirewallPolicyController.js
index 86c6854..5988ef3 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/FirewallPolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/FirewallPolicyController.js
@@ -35,6 +35,15 @@
     $scope.modal = function(id, hide) {
         return $('#' + id).modal(hide ? 'hide' : 'show');
     };
+    
+    $('#ttlDate').datepicker({
+    	dateFormat: 'dd/mm/yy',
+    	changeMonth: true,
+    	changeYear: true,
+    	onSelect: function(date) {
+    		angular.element($('#ttlDate')).triggerHandler('input');
+    	}
+    });
 		
     PolicyAppService.getData('getDictionary/get_SecurityZoneDataByName').then(function (data) {
     	var j = data;
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ActionPolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ActionPolicyTemplate.html
index e58e7bb..313015d 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ActionPolicyTemplate.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ActionPolicyTemplate.html
@@ -18,7 +18,7 @@
 			<div class="well">
 				<div class="form-group row">
 					<div class="form-group col-sm-2">
-						<label>Component Attributes:</label><br>
+						<label>Component Attributes:<sup><b>*</b></sup></label><br>
 						<button type="button" class="btn btn-default"
 							ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()">
 							<i class="fa fa-plus"></i>
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BRMSParamPolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BRMSParamPolicyTemplate.html
index 0e7a4b3..d941c24 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BRMSParamPolicyTemplate.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BRMSParamPolicyTemplate.html
@@ -46,8 +46,8 @@
 			</div>
 			<div class="form-group row">
 				<div class="form-group col-sm-3">
-					<label>Time to Live Date:</label> <input type="date"
-						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly" class="date"
+					<label>Time to Live Date:</label> <input type="text" id="ttlDate"
+						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly"
 						ng-model="temp.policy.ttlDate" />
 				</div>
 				<div class="form-group col-sm-3">
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BRMSRawPolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BRMSRawPolicyTemplate.html
index a778b13..1557f97 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BRMSRawPolicyTemplate.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BRMSRawPolicyTemplate.html
@@ -45,8 +45,8 @@
 			</div>
 			<div class="form-group row">
 				<div class="form-group col-sm-3">
-					<label>Time to Live Date:</label> <input type="date"
-						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly" class="date"
+					<label>Time to Live Date:</label> <input type="text" id="ttlDate"
+						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly"
 						ng-model="temp.policy.ttlDate" />
 				</div>
 				<div class="form-group col-sm-3">
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BasePolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BasePolicyTemplate.html
index 790a16b..c81a98d 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BasePolicyTemplate.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BasePolicyTemplate.html
@@ -30,8 +30,8 @@
 						title="Enter the Config Name without any spaces" />
 				</div>
 				<div class="form-group col-sm-3">
-					<label>Time to Live Date:</label> <input type="date"
-						class="form-control" ng-disabled="temp.policy.readOnly" name="ttlDate" class="date"
+					<label>Time to Live Date:</label> <input type="text" id="ttlDate"
+						class="form-control" ng-disabled="temp.policy.readOnly" name="ttlDate"
 						ng-model="temp.policy.ttlDate" />
 				</div>
 			</div>
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ClosedLoopFaultPolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ClosedLoopFaultPolicyTemplate.html
index 8f1c10e..0912ac2 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ClosedLoopFaultPolicyTemplate.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ClosedLoopFaultPolicyTemplate.html
@@ -82,8 +82,8 @@
 						ng-model="temp.policy.jsonBodyData.vDNS"> vDNS</input>
 				</div>
 				<div class="form-group col-sm-3">
-					<label>Time to Live Date:</label> <input type="date"
-						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly" class="date"
+					<label>Time to Live Date:</label> <input type="text" id="ttlDate"
+						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly"
 						ng-model="temp.policy.ttlDate" />
 				</div>
 			</div>
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ClosedLoopPMPolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ClosedLoopPMPolicyTemplate.html
index 2fc60b7..4e7cad3 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ClosedLoopPMPolicyTemplate.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ClosedLoopPMPolicyTemplate.html
@@ -24,8 +24,8 @@
 						required pattern="\S+" title="OnapName is required"></select>
 				</div>
 				<div class="form-group col-sm-3">
-					<label>Time to Live Date:</label> <input type="date"
-						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly" class="date"
+					<label>Time to Live Date:</label> <input type="text" id="ttlDate"
+						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly"
 						ng-model="temp.policy.ttlDate" />
 				</div>
 				<div class="form-group col-sm-3">
@@ -89,7 +89,7 @@
 			</div>
 			<div class="well">
 				<div class="form-group row">
-					<label>Attributes:<sup><b>*</b></sup></label>
+					<label>Attributes:<sup><b></b></sup></label>
 					<div
 						ng-repeat="(key, data) in temp.policy.attributeFields.attributes">
 						<div class="well">
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DCAEMicroServicePolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DCAEMicroServicePolicyTemplate.html
index 4e35219..5c0aa9f 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DCAEMicroServicePolicyTemplate.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DCAEMicroServicePolicyTemplate.html
@@ -24,8 +24,8 @@
 						required pattern="\S+" title="OnapName is required"></select>
 				</div>
 				<div class="form-group col-sm-3">
-					<label>Time to Live Date:</label> <input type="date"
-						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly" class="date"
+					<label>Time to Live Date:</label> <input type="text" id="ttlDate"
+						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly"
 						ng-model="temp.policy.ttlDate" />
 				</div>
 				<div class="form-group col-sm-3">
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/FirewallPolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/FirewallPolicyTemplate.html
index 2a4a653..1fdfa31 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/FirewallPolicyTemplate.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/FirewallPolicyTemplate.html
@@ -50,8 +50,8 @@
 						ng-model="temp.policy.configName" required />
 				</div>
 				<div class="form-group col-sm-3">
-					<label>Time to Live Date:</label> <input type="date"
-						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly" class="date"
+					<label>Time to Live Date:</label> <input type="text" id="ttlDate"
+						class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly"
 						ng-model="temp.policy.ttlDate" />
 				</div>
 				<div class="form-group col-sm-3">
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policyManager.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policyManager.js
index 52ca964..7568030 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policyManager.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policyManager.js
@@ -186,7 +186,7 @@
             return currentPath.indexOf(path) !== -1;
         };
          
-       $scope.watch = function(item){
+       $scope.watchPolicy = function(item){
            var uuu = "watchPolicy";
            var data = {name : item.model.name,
         		   path : item.model.path};
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/item-toolbar.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/item-toolbar.html
index 086aef0..a73a292 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/item-toolbar.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/item-toolbar.html
@@ -1,5 +1,5 @@
 <div ng-show="!item.inprocess">
-    <button class="btn btn-sm btn-default" data-toggle="modal" data-target="#watch"  ng-click="watch(item)" title="Watch">
+    <button class="btn btn-sm btn-default" data-toggle="modal" data-target="#watch"  ng-click="watchPolicy(item)" title="Watch">
         <i class="glyphicon glyphicon-eye-open"></i>
     </button>
 </div> 
\ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/main-table.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/main-table.html
index 27ddad7..fcf6ded 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/main-table.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/main-table.html
@@ -34,7 +34,7 @@
              <th class="hidden-sm hidden-xs">
                 <a href="">
                    Watch Policy
-                    <span class="sortorder"  ng-class="{reverse:reverse}"></span>
+                    <span  ng-class="{reverse:reverse}"></span>
                 </a>
             </th>
             <!-- <th class="text-right">