use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class CmsPlaceAdminController method refresh.
/**
* @param ids
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("refresh")
public String refresh(Long[] ids, HttpServletRequest request, HttpSession session, ModelMap model) {
if (CommonUtils.notEmpty(ids)) {
SysSite site = getSite(request);
service.refresh(site.getId(), ids);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "refresh.place", RequestUtils.getIpAddress(request), CommonUtils.getDate(), StringUtils.join(ids, ',')));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class CmsPlaceAdminController method delete.
/**
* @param ids
* @param request
* @param session
* @return view name
*/
@RequestMapping("delete")
public String delete(Long[] ids, HttpServletRequest request, HttpSession session) {
if (CommonUtils.notEmpty(ids)) {
SysSite site = getSite(request);
service.delete(site.getId(), ids);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "delete.place", RequestUtils.getIpAddress(request), CommonUtils.getDate(), StringUtils.join(ids, ',')));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class CmsPlaceAdminController method save.
/**
* @param entity
* @param placeParamters
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping(value = "save", method = RequestMethod.POST)
public String save(CmsPlace entity, @ModelAttribute CmsPlaceParamters placeParamters, HttpServletRequest request, HttpSession session, ModelMap model) {
if (null != entity && CommonUtils.notEmpty(entity.getPath())) {
entity.setPath(entity.getPath().replace("//", SEPARATOR));
SysSite site = getSite(request);
Long userId = getAdminFromSession(session).getId();
if (CommonUtils.empty(entity.getItemType()) || CommonUtils.empty(entity.getItemId())) {
entity.setItemType(CmsPlaceService.ITEM_TYPE_CUSTOM);
entity.setItemId(null);
}
if (null != entity.getId()) {
CmsPlace oldEntity = service.getEntity(entity.getId());
if (null == oldEntity || ControllerUtils.verifyNotEquals("siteId", site.getId(), oldEntity.getSiteId(), model)) {
return TEMPLATE_ERROR;
}
entity = service.update(entity.getId(), entity, ignoreProperties);
if (null != entity) {
logOperateService.save(new LogOperate(site.getId(), userId, LogLoginService.CHANNEL_WEB_MANAGER, "update.place", RequestUtils.getIpAddress(request), CommonUtils.getDate(), entity.getPath()));
}
} else {
entity.setUserId(userId);
entity.setSiteId(site.getId());
entity.setStatus(CmsPlaceService.STATUS_NORMAL);
service.save(entity);
logOperateService.save(new LogOperate(site.getId(), userId, LogLoginService.CHANNEL_WEB_MANAGER, "save.place", RequestUtils.getIpAddress(request), CommonUtils.getDate(), entity.getPath()));
}
String filePath = siteComponent.getWebTemplateFilePath(site, TemplateComponent.INCLUDE_DIRECTORY + entity.getPath());
Map<String, String> map = ExtendUtils.getExtentDataMap(placeParamters.getExtendDataList(), metadataComponent.getPlaceMetadata(filePath).getExtendList());
String extentString = ExtendUtils.getExtendString(map);
attributeService.updateAttribute(entity.getId(), extentString);
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class CmsPlaceAdminController method clear.
/**
* @param path
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("clear")
public String clear(String path, HttpServletRequest request, HttpSession session, ModelMap model) {
if (CommonUtils.notEmpty(path)) {
SysSite site = getSite(request);
service.delete(site.getId(), path);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "clear.place", RequestUtils.getIpAddress(request), CommonUtils.getDate(), path));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class CmsTagAdminController method save.
/**
* @param entity
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("save")
public String save(CmsTag entity, HttpServletRequest request, HttpSession session, ModelMap model) {
SysSite site = getSite(request);
if (null != entity.getId()) {
CmsTag oldEntity = service.getEntity(entity.getId());
if (null == oldEntity || ControllerUtils.verifyNotEquals("siteId", site.getId(), oldEntity.getSiteId(), model)) {
return TEMPLATE_ERROR;
}
entity = service.update(entity.getId(), entity, ignoreProperties);
if (null != entity) {
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "update.tag", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
} else {
entity.setSiteId(site.getId());
service.save(entity);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "save.tag", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
return TEMPLATE_DONE;
}
Aggregations