public void process(JSONRequestContext jsonRequestContext) { ResourceDAO resourceDAO = DAOFactory.getInstance().getResourceDAO(); ResourceCategoryDAO resourceCategoryDAO = DAOFactory.getInstance().getResourceCategoryDAO(); WorkResourceDAO workResourceDAO = DAOFactory.getInstance().getWorkResourceDAO(); TagDAO tagDAO = DAOFactory.getInstance().getTagDAO(); String name = jsonRequestContext.getRequest().getParameter("name"); Long resourceId = NumberUtils.createLong(jsonRequestContext.getRequest().getParameter("resource")); Double hourlyCost = NumberUtils.createDouble(jsonRequestContext.getRequest().getParameter("hourlyCost")); Double costPerUse = NumberUtils.createDouble(jsonRequestContext.getRequest().getParameter("costPerUse")); Long version = NumberUtils.createLong(jsonRequestContext.getRequest().getParameter("version")); String tagsText = jsonRequestContext.getString("tags"); Set<Tag> tagEntities = new HashSet<Tag>(); if (!StringUtils.isBlank(tagsText)) { List<String> tags = Arrays.asList(tagsText.split("[\\ ,]")); for (String tag : tags) { if (!StringUtils.isBlank(tag)) { Tag tagEntity = tagDAO.findByText(tag.trim()); if (tagEntity == null) tagEntity = tagDAO.create(tag); tagEntities.add(tagEntity); } } } WorkResource workResource = workResourceDAO.findById(resourceId); if (!version.equals(workResource.getVersion())) throw new SmvcRuntimeException( PyramusStatusCode.CONCURRENT_MODIFICATION, Messages.getInstance() .getText( jsonRequestContext.getRequest().getLocale(), "generic.errors.concurrentModification")); ResourceCategory resourceCategory = resourceCategoryDAO.findById( NumberUtils.createLong(jsonRequestContext.getRequest().getParameter("category"))); workResourceDAO.update(workResource, name, resourceCategory, costPerUse, hourlyCost); resourceDAO.setResourceTags(workResource, tagEntities); jsonRequestContext.setRedirectURL(jsonRequestContext.getReferer(true)); }