+ private static final Logger LOGGER = FlexLogger.getLogger(BRMSDictionaryController.class);
+
+ private static final String VALIDATIONRESPONSE = "Validation";
+
+ private static CommonClassDao commonClassDao;
+ private static String rule;
+ private static String successMsg = "Success";
+ private static String duplicateResponseString = "Duplicate";
+ private static String ruleName = "ruleName";
+ private static String errorMessage = "Error";
+ private static String operation = "operation";
+ private static String dictionaryFields = "dictionaryFields";
+ private static String userid = "userid";
+ private static String dependencyName = "dependencyName";
+ private static String controllerName = "controllerName";
+ private static String brmsParamDatas = "brmsParamDictionaryDatas";
+ private static String brmsDependencyDatas = "brmsDependencyDictionaryDatas";
+ private static String brmsControllerDatas = "brmsControllerDictionaryDatas";
+
+ @Autowired
+ public BRMSDictionaryController(CommonClassDao commonClassDao) {
+ BRMSDictionaryController.commonClassDao = commonClassDao;
+ }
+
+ public static void setCommonClassDao(CommonClassDao commonClassDao2) {
+ BRMSDictionaryController.commonClassDao = commonClassDao2;
+ }
+
+ public BRMSDictionaryController() {
+ super();
+ }
+
+ private DictionaryUtils getDictionaryUtilsInstance() {
+ return DictionaryUtils.getDictionaryUtils();
+ }
+
+ @RequestMapping(
+ value = {"/get_BRMSParamDataByName"},
+ method = {RequestMethod.GET},
+ produces = MediaType.APPLICATION_JSON_VALUE)
+ public void getBRMSParamDictionaryByNameEntityData(HttpServletResponse response) {
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getDataByEntity(response, brmsParamDatas, ruleName, BRMSParamTemplate.class);
+ }
+
+ @RequestMapping(
+ value = {"/get_BRMSParamData"},
+ method = {RequestMethod.GET},
+ produces = MediaType.APPLICATION_JSON_VALUE)
+ public void getBRMSParamDictionaryEntityData(HttpServletResponse response) {
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getData(response, brmsParamDatas, BRMSParamTemplate.class);
+ }
+
+ @RequestMapping(value = {"/brms_dictionary/set_BRMSParamData"}, method = {RequestMethod.POST})
+ public static void setRuleData(HttpServletRequest request) throws IOException {
+ StringWriter writer = new StringWriter();
+ IOUtils.copy(request.getInputStream(), writer, StandardCharsets.UTF_8);
+ String cleanStreamBoundary = writer.toString().replaceFirst("------(.*)(?s).*octet-stream", "");
+ rule = cleanStreamBoundary.substring(0, cleanStreamBoundary.lastIndexOf("end") + 4);
+ }
+
+ @RequestMapping(value = {"/brms_dictionary/save_BRMSParam"}, method = {RequestMethod.POST})
+ public ModelAndView saveBRMSParamDictionary(HttpServletRequest request, HttpServletResponse response)
+ throws IOException {
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ try {
+ boolean fromAPI = utils.isRequestFromAPI(request);
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ JsonNode root = mapper.readTree(request.getReader());