use of com.publiccms.entities.cms.CmsCategory in project PublicCMS-preview by sanluan.
the class CmsCategoryAdminController method move.
/**
* @param siteId
* @param id
* @param parentId
*/
private void move(SysSite site, Integer id, Integer parentId) {
CmsCategory entity = service.getEntity(id);
if (null != entity && site.getId() == entity.getSiteId()) {
service.updateParentId(site.getId(), id, parentId);
service.generateChildIds(site.getId(), entity.getParentId());
if (null != parentId) {
service.generateChildIds(site.getId(), parentId);
}
}
}
use of com.publiccms.entities.cms.CmsCategory in project PublicCMS-preview by sanluan.
the class CmsContentAdminController method uncheck.
/**
* @param ids
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("uncheck")
public String uncheck(Long[] ids, HttpServletRequest request, HttpSession session, ModelMap model) {
if (CommonUtils.notEmpty(ids)) {
SysSite site = getSite(request);
Long userId = getAdminFromSession(session).getId();
List<CmsContent> entityList = service.uncheck(site.getId(), userId, ids);
Set<Integer> categoryIdSet = new HashSet<>();
for (CmsContent entity : entityList) {
if (null != entity && site.getId() == entity.getSiteId()) {
if (CommonUtils.notEmpty(entity.getParentId())) {
publish(new Long[] { entity.getParentId() }, request, session, model);
}
publish(new Long[] { entity.getId() }, request, session, model);
categoryIdSet.add(entity.getCategoryId());
}
}
for (CmsCategory category : categoryService.getEntitys(categoryIdSet.toArray(new Integer[categoryIdSet.size()]))) {
templateComponent.createCategoryFile(site, category, null, null);
}
logOperateService.save(new LogOperate(site.getId(), userId, LogLoginService.CHANNEL_WEB_MANAGER, "uncheck.content", RequestUtils.getIpAddress(request), CommonUtils.getDate(), StringUtils.join(ids, ',')));
}
return TEMPLATE_DONE;
}
Aggregations