HttpServletResponse response)
throws Throwable {
ItemMaintActionForm form = (ItemMaintActionForm) actionForm;
AdminBean adminBean = getAdminBean(request);
Site site = adminBean.getSite();
initSiteProfiles(form, site);
JSONEscapeObject jsonResult = new JSONEscapeObject();
jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
Item item = ItemDAO.load(site.getSiteId(), Format.getLong(form.getItemId()));
String itemCrossSellIds[] = form.getItemCrossSellIds();
if (itemCrossSellIds != null) {
for (int i = 0; i < itemCrossSellIds.length; i++) {
Item itemCrossSell = ItemDAO.load(site.getSiteId(), Format.getLong(itemCrossSellIds[i]));
item.getItemsCrossSell().remove(itemCrossSell);
}
item.setRecUpdateBy(adminBean.getUser().getUserId());
item.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
em.persist(item);