Permalink
Browse files

bug fixed

  • Loading branch information...
1 parent f228b34 commit 47e6b75141a1bad3748ee62be739b18b3e067503 @sanluan committed Aug 29, 2016
@@ -1 +1 @@
-{"index.html":{"alias":"首页","publishPath":"index.html","useDynamic":true,"needLogin":true,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":[{"required":true,"name":"SEO关键词","description":"请填写与分类内容相关的关键词,多个关键词应该使用逗号分开,最好保持在10个以下","code":"keywords","inputType":"textarea","defaultValue":""},{"required":true,"name":"SEO描述","description":"请填写与分类内容相关的描述,字数控制应该70-100个汉字或者140-200个英文字符","code":"description","inputType":"textarea","defaultValue":""},{"required":false,"name":"页面统计代码","description":"请填写统计代码","code":"code","inputType":"textarea","defaultValue":""},{"required":false,"name":"标语","description":"","code":"slogan","inputType":"text","defaultValue":""},{"required":true,"name":"用户站点地址","description":"","code":"member","inputType":"text","defaultValue":""},{"required":true,"name":"搜索站点地址","description":"","code":"search","inputType":"text","defaultValue":""}],"extendDataList":[{"name":"keywords","value":"开源CMS,CMS,JAVA CMS,SpringMVC CMS,JAVACMS,FreeMarker,Apache FreeMarker,publiccms"},{"name":"description","value":"PublicCMS是采用2016年最新主流技术开发的免费开源JAVACMS系统。商用免费,架构科学。无需任何数据库优化,即可支持上千万数据;支持全站静态化,SSI,0xml配置,扩展指令自动加载,动态页面局部静态化等为您快速建站,建设大规模站点提供强大驱动,也是企业级项目产品原型的良好选择。"},{"name":"code","value":"<script>\r\nvar _hmt = _hmt || [];\r\n(function() {\r\n var hm = document.createElement(\"script\");\r\n hm.src = \"//hm.baidu.com/hm.js?bd81f02e5329554415de9ee15f916a98\";\r\n var s = document.getElementsByTagName(\"script\")[0];\r\n s.parentNode.insertBefore(hm, s);\r\n})();\r\n</script>"},{"name":"slogan","value":"与先进同行"},{"name":"member","value":"//member.publiccms.com/"},{"name":"search","value":"//search.publiccms.com/"}]},"member.html":{"alias":"记录用户","publishPath":"member.html","useDynamic":false,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null},"sso.html":{"alias":"单点登录","publishPath":"sso.html","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null},"download.html":{"alias":"下载链接","publishPath":"download.html","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null},"interface.html":{"alias":"接口","publishPath":"","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null},"index.exe":{"alias":"首页.exe","publishPath":"","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null},"index.php":{"alias":"首页.php","publishPath":"","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null}}
+{"index.html":{"alias":"首页","publishPath":"index.html","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":[{"required":true,"name":"SEO关键词","description":"请填写与分类内容相关的关键词,多个关键词应该使用逗号分开,最好保持在10个以下","code":"keywords","inputType":"textarea","defaultValue":""},{"required":true,"name":"SEO描述","description":"请填写与分类内容相关的描述,字数控制应该70-100个汉字或者140-200个英文字符","code":"description","inputType":"textarea","defaultValue":""},{"required":false,"name":"页面统计代码","description":"请填写统计代码","code":"code","inputType":"textarea","defaultValue":""},{"required":false,"name":"标语","description":"","code":"slogan","inputType":"text","defaultValue":""},{"required":true,"name":"用户站点地址","description":"","code":"member","inputType":"text","defaultValue":""},{"required":true,"name":"搜索站点地址","description":"","code":"search","inputType":"text","defaultValue":""}],"extendDataList":[{"name":"keywords","value":"开源CMS,CMS,JAVA CMS,SpringMVC CMS,JAVACMS,FreeMarker,Apache FreeMarker,publiccms"},{"name":"description","value":"PublicCMS是采用2016年最新主流技术开发的免费开源JAVACMS系统。商用免费,架构科学。无需任何数据库优化,即可支持上千万数据;支持全站静态化,SSI,0xml配置,扩展指令自动加载,动态页面局部静态化等为您快速建站,建设大规模站点提供强大驱动,也是企业级项目产品原型的良好选择。"},{"name":"code","value":"<script>\r\nvar _hmt = _hmt || [];\r\n(function() {\r\n var hm = document.createElement(\"script\");\r\n hm.src = \"//hm.baidu.com/hm.js?bd81f02e5329554415de9ee15f916a98\";\r\n var s = document.getElementsByTagName(\"script\")[0];\r\n s.parentNode.insertBefore(hm, s);\r\n})();\r\n</script>"},{"name":"slogan","value":"与先进同行"},{"name":"member","value":"//member.publiccms.com/"},{"name":"search","value":"//search.publiccms.com/"}]},"member.html":{"alias":"记录用户","publishPath":"member.html","useDynamic":false,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null},"sso.html":{"alias":"单点登录","publishPath":"sso.html","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null},"download.html":{"alias":"下载链接","publishPath":"download.html","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null},"interface.html":{"alias":"接口","publishPath":"","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null},"index.exe":{"alias":"首页.exe","publishPath":"","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null},"index.php":{"alias":"首页.php","publishPath":"","useDynamic":true,"needLogin":false,"acceptParamters":"","cacheTime":0,"allowContribute":false,"extendList":null,"extendDataList":null}}
@@ -37,14 +37,15 @@ public void updateStatistics(Collection<CmsContentRelatedStatistics> entitys) {
}
@SuppressWarnings("unchecked")
- public void update(long contentId, List<CmsContentRelated> entitys) {
+ public void update(long contentId, long userId, List<CmsContentRelated> entitys) {
Set<Long> idList = new HashSet<Long>();
if (notEmpty(entitys)) {
for (CmsContentRelated entity : entitys) {
if (notEmpty(entity.getId())) {
- update(entity.getId(), entity, new String[] { "id" });
+ update(entity.getId(), entity, new String[] { "id", "contentId", "userId" });
} else {
entity.setContentId(contentId);
+ entity.setUserId(userId);
save(entity);
}
idList.add(entity.getId());
@@ -175,7 +175,7 @@ public String save(CmsContent entity, CmsContentAttribute attribute, @ModelAttri
getIpAddress(request), now, entity.getId() + ":" + entity.getTitle()));
}
Long[] tagIds = tagService.update(site.getId(), contentParamters.getTags());
- service.updateTagIds(entity.getId(), arrayToDelimitedString(tagIds,BLANK_SPACE));// 更新保存标签
+ service.updateTagIds(entity.getId(), arrayToDelimitedString(tagIds, BLANK_SPACE));// 更新保存标签
if (entity.isHasImages() || entity.isHasFiles()) {
contentFileService.update(entity.getId(), user.getId(), entity.isHasFiles() ? contentParamters.getFiles() : null,
entity.isHasImages() ? contentParamters.getImages() : null);// 更新保存图集,附件
@@ -212,7 +212,7 @@ public String save(CmsContent entity, CmsContentAttribute attribute, @ModelAttri
}
attributeService.updateAttribute(entity.getId(), attribute);// 更新保存扩展字段,文本字段
- cmsContentRelatedService.update(entity.getId(), contentParamters.getContentRelateds());// 更新保存推荐内容
+ cmsContentRelatedService.update(entity.getId(), user.getId(), contentParamters.getContentRelateds());// 更新保存推荐内容
templateComponent.createContentFile(site, entity, category, categoryModel);// 静态化
return TEMPLATE_DONE;
}
@@ -287,10 +287,12 @@ public String related(CmsContentRelated entity, HttpServletRequest request, Http
if (empty(entity.getDescription())) {
entity.setDescription(entity.getDescription());
}
+ SysUser user = getAdminFromSession(session);
+ entity.setUserId(user.getId());
cmsContentRelatedService.save(entity);
publish(new Long[] { entity.getContentId() }, request, session, model);
- logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(),
- LogLoginService.CHANNEL_WEB_MANAGER, "related.content", getIpAddress(request), getDate(),
+ logOperateService.save(new LogOperate(site.getId(), user.getId(), LogLoginService.CHANNEL_WEB_MANAGER,
+ "related.content", getIpAddress(request), getDate(),
related.getId() + ":" + related.getTitle() + " to " + content.getId() + ":" + content.getTitle()));
}
return TEMPLATE_DONE;
@@ -315,8 +317,8 @@ public String move(Long[] ids, Integer categoryId, HttpServletRequest request, H
if (sb.length() > 0) {
sb.append(COMMA_DELIMITED);
}
- sb.append(getMessage(getLocale(request), "message.content.categoryModel.empty", entity.getId() + ":" + entity.getTitle(),
- categoryId + ":" + category.getName()));
+ sb.append(getMessage(getLocale(request), "message.content.categoryModel.empty",
+ entity.getId() + ":" + entity.getTitle(), categoryId + ":" + category.getName()));
}
}
model.put("message", sb.toString());
@@ -37,14 +37,15 @@ public void updateStatistics(Collection<CmsContentRelatedStatistics> entitys) {
}
@SuppressWarnings("unchecked")
- public void update(long contentId, List<CmsContentRelated> entitys) {
+ public void update(long contentId, long userId, List<CmsContentRelated> entitys) {
Set<Long> idList = new HashSet<Long>();
if (notEmpty(entitys)) {
for (CmsContentRelated entity : entitys) {
if (notEmpty(entity.getId())) {
- update(entity.getId(), entity, new String[] { "id" });
+ update(entity.getId(), entity, new String[] { "id", "contentId", "userId" });
} else {
entity.setContentId(contentId);
+ entity.setUserId(userId);
save(entity);
}
idList.add(entity.getId());
@@ -175,7 +175,7 @@ public String save(CmsContent entity, CmsContentAttribute attribute, @ModelAttri
getIpAddress(request), now, entity.getId() + ":" + entity.getTitle()));
}
Long[] tagIds = tagService.update(site.getId(), contentParamters.getTags());
- service.updateTagIds(entity.getId(), arrayToDelimitedString(tagIds,BLANK_SPACE));// 更新保存标签
+ service.updateTagIds(entity.getId(), arrayToDelimitedString(tagIds, BLANK_SPACE));// 更新保存标签
if (entity.isHasImages() || entity.isHasFiles()) {
contentFileService.update(entity.getId(), user.getId(), entity.isHasFiles() ? contentParamters.getFiles() : null,
entity.isHasImages() ? contentParamters.getImages() : null);// 更新保存图集,附件
@@ -212,7 +212,7 @@ public String save(CmsContent entity, CmsContentAttribute attribute, @ModelAttri
}
attributeService.updateAttribute(entity.getId(), attribute);// 更新保存扩展字段,文本字段
- cmsContentRelatedService.update(entity.getId(), contentParamters.getContentRelateds());// 更新保存推荐内容
+ cmsContentRelatedService.update(entity.getId(), user.getId(), contentParamters.getContentRelateds());// 更新保存推荐内容
templateComponent.createContentFile(site, entity, category, categoryModel);// 静态化
return TEMPLATE_DONE;
}
@@ -287,10 +287,12 @@ public String related(CmsContentRelated entity, HttpServletRequest request, Http
if (empty(entity.getDescription())) {
entity.setDescription(entity.getDescription());
}
+ SysUser user = getAdminFromSession(session);
+ entity.setUserId(user.getId());
cmsContentRelatedService.save(entity);
publish(new Long[] { entity.getContentId() }, request, session, model);
- logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(),
- LogLoginService.CHANNEL_WEB_MANAGER, "related.content", getIpAddress(request), getDate(),
+ logOperateService.save(new LogOperate(site.getId(), user.getId(), LogLoginService.CHANNEL_WEB_MANAGER,
+ "related.content", getIpAddress(request), getDate(),
related.getId() + ":" + related.getTitle() + " to " + content.getId() + ":" + content.getTitle()));
}
return TEMPLATE_DONE;
@@ -315,8 +317,8 @@ public String move(Long[] ids, Integer categoryId, HttpServletRequest request, H
if (sb.length() > 0) {
sb.append(COMMA_DELIMITED);
}
- sb.append(getMessage(getLocale(request), "message.content.categoryModel.empty", entity.getId() + ":" + entity.getTitle(),
- categoryId + ":" + category.getName()));
+ sb.append(getMessage(getLocale(request), "message.content.categoryModel.empty",
+ entity.getId() + ":" + entity.getTitle(), categoryId + ":" + category.getName()));
}
}
model.put("message", sb.toString());

0 comments on commit 47e6b75

Please sign in to comment.