[Policy-52, Policy-92, Policy-93] Policy Enhancements and bugfixes
[policy/engine.git] / ECOMP-PAP-REST / src / main / java / org / openecomp / policy / pap / xacml / rest / controller / DescriptiveDictionaryController.java
index aa05f52..0ea1da1 100644 (file)
@@ -21,6 +21,7 @@
 package org.openecomp.policy.pap.xacml.rest.controller;
 
 import java.io.PrintWriter;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -70,7 +71,7 @@ public class DescriptiveDictionaryController {
        @RequestMapping(value={"/get_DescriptiveScopeByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
        public void getDescriptiveDictionaryByNameEntityData(HttpServletRequest request, HttpServletResponse response){
                try{
-                       Map<String, Object> model = new HashMap<String, Object>();
+                       Map<String, Object> model = new HashMap<>();
                        ObjectMapper mapper = new ObjectMapper();
                        model.put("descriptiveScopeDictionaryDatas", mapper.writeValueAsString(commonClassDao.getDataByColumn(DescriptiveScope.class, "descriptiveScopeName")));
                        JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
@@ -85,7 +86,7 @@ public class DescriptiveDictionaryController {
        @RequestMapping(value={"/get_DescriptiveScope"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
        public void getDescriptiveDictionaryEntityData(HttpServletRequest request, HttpServletResponse response){
                try{
-                       Map<String, Object> model = new HashMap<String, Object>();
+                       Map<String, Object> model = new HashMap<>();
                        ObjectMapper mapper = new ObjectMapper();
                        model.put("descriptiveScopeDictionaryDatas", mapper.writeValueAsString(commonClassDao.getData(DescriptiveScope.class)));
                        JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
@@ -169,6 +170,7 @@ public class DescriptiveDictionaryController {
                        }else{
                                if(!isFakeUpdate){
                                        descriptiveScope.setUserModifiedBy(this.getUserInfo(userId));
+                                       descriptiveScope.setModifiedDate(new Date());
                                        commonClassDao.update(descriptiveScope); 
                                }
                        }