主题 : jeecms2.4添加新站点报错 |
级别: 童生
|
1# 发表于:2010-01-20 16:30:55 IP:218.156.*.*
|
||||
---|---|---|---|---|---|
级别: 秀才
|
3# 发表于:2010-01-21 13:49:34 IP:221.105.*.*
处理办法:
1. 找到com.hbsc.article.action包下的ArticleAct.java 文件的public String save()方法 将注释的清除上传规则removeUploadRule();打开 2. 找到com.hbsc.article.manager.impl包下的ArticleMngImpl.java文件的 addAttachment()方法将system.out.println(……)语句删掉。 本帖最近评分记录:
|
||
---|---|---|---|
级别: 秀才
|
4# 发表于:2010-01-22 09:23:57 IP:221.105.*.*
汗... 怎么贴在这里了啊? 我记得没贴错呀? 上述所说是更改后台添加更新文章时报异常的
站点添加报错 处理办法: 1. 找到com.hbsc.cms.action下的WebsiteAct.java文件 添加public String save()方法。 具体代码: public String save() { if (bean.getParent() != null && bean.getParent().getId() == null) { bean.setParent(null); } websiteMng.saveWebsite(getWeb(), bean, getUser()); log.info("添加 站点 成功:{}", bean.getName()); return list(); } 2. 找到com.hbsc.core.manager下的WebsiteMng.java文件 添加public void saveWebsite(Website currweb,Website website,User user)方法。 具体代码加注释: /** * 保存站点到数据库和缓存,保存域名到缓存 * * @param website */ public void saveWebsite(Website currWeb, Website website, User user); 3. 找到com.hbsc.core.manager.impl下的WebsiteMngImpl.java文件 添加如下public void saveWebsite(Website currweb,Website website,User user)方法变量。 具体代码: public void saveWebsite(Website currWeb, Website website, User user) { website.setGlobal(currWeb.getGlobal()); website.setSuffix(Website.DEF_SUFFIX); website.setCreateTime(ComUtils.now()); website.setControl(currWeb.getControl()); Map<String, String> solutions = currWeb.getSolutions(); Map<String, String> nsolutions = new HashMap<String, String>(); for (String key : solutions.keySet()) { nsolutions.put(key, solutions.get(key)); } website.setSolutions(nsolutions); getDao().save(website); websiteDomainCache.put(new Element(website.getDomain(), website.getId())); String[] alias = website.getAlias(); if (alias != null) { for (String a : alias) { websiteAliasCache.put(new Element(a, website.getId())); } } // 创建管理员 CmsAdmin cmsAdmin = new CmsAdmin(); cmsAdmin.setCheckRight(0); cmsAdmin.setSelfOnly(false); Admin admin = new Admin(); admin.setUser(user); admin.setRoles(new HashSet<Role>(roleMng.findAll())); cmsAdmin.setAdmin(admin); cmsAdmin.setWebsite(website); * cmsAdminMng.register(currWeb.getId(),user * ,admin,cmsAdmin,true); // 创建配置对象 CmsConfig cc = cmsConfigMng.findById(currWeb.getId()); AuxiConfig ac = auxiConfigMng.findById(currWeb.getId()); CmsConfig ncc = new CmsConfig(); AuxiConfig nac = new AuxiConfig(); BeanUtils.copyProperties(cc, ncc); BeanUtils.copyProperties(ac, nac); ncc.setWebsite(website); nac.setWebsite(website); cmsConfigMng.save(ncc); auxiConfigMng.save(nac); // 创建模板 String otpl = currWeb.getTplRoot().toString(); String ores = currWeb.getResRoot(); String ctpl = website.getTplRoot().toString(); String cres = website.getResRoot(); otpl = contextPvd.getAppRealPath(otpl); ores = contextPvd.getAppRealPath(ores); ctpl = contextPvd.getAppRealPath(ctpl); cres = contextPvd.getAppRealPath(cres); try { FileUtils.copyDirectory(new File(otpl), new File(ctpl)); log.debug("原模板路径:{}", otpl); log.debug("目标模板路径:{}", ctpl); } catch (IOException e) { log.error("拷贝模板出错", e); } try { File[] subRes = new File(ores).listFiles(new FileFilter() { public boolean accept(File pathname) { if (pathname.getName().equals(Constants.UPLOAD_PATH)) { return false; } else { return true; } } }); File cresFile = new File(cres); for (int i = 0; i < subRes.length; i++) { FileUtils.copyDirectory(subRes[i], new File(cresFile, subRes[i] .getName())); log.debug("原资源路径:{}", subRes[i].getAbsolutePath()); log.debug("目标资源路径:{}/{}", cresFile.getAbsolutePath(), subRes[i] .getName()); } } catch (IOException e) { log.error("拷贝资源出错", e); } } @Autowired private CmsAdminMng cmsAdminMng; @Autowired private CmsConfigMng cmsConfigMng; @Autowired private AuxiConfigMng auxiConfigMng; @Autowired private RoleMng roleMng; @Autowired private ContextPvd contextPvd; (遗留问题:子站点管理项未出现?不知道原因....) |
||
---|---|---|---|
级别: 秀才
|
5# 发表于:2010-01-22 10:15:17 IP:221.105.*.*
版主给解决一下 为什么可以切换去管理子站点的那个下拉菜单没有出现呢?
|
||
---|---|---|---|
级别: 白丁
|
6# 发表于:2010-01-22 22:37:58 IP:115.248.*.*
添加完子站后要刷新下浏览器或者退出后台重新登录,这样才会出现站点下拉框。
|
||
---|---|---|---|
1
共1页