Package org.j2cms.model.config

Examples of org.j2cms.model.config.Config


       try {  
       EntityManagerFactory factory = Persistence.createEntityManagerFactory("j2cmsSSH");//sessionFactory
       EntityManager em = factory.createEntityManager();
       em.getTransaction().begin();//开始事务
       Config config = em.find(Config.class, 1);
       em.getTransaction().commit();   
       if(config.getUuid()==null||"".equals(config.getUuid())||config.getUuid().length()!=36)
       {
         config.setUuid(java.util.UUID.randomUUID().toString());
       }
       InetAddress addr = InetAddress.getLocalHost();
      String ip=addr.getHostAddress().toString();
      config.setIp(ip);
      config.setCtp(servletContext.getContextPath());
      try {
        String logined = "<html><head><title>管理中心-Powered by J2CMS</title><meta http-equiv=Content-Type content=text/html;charset=utf-8></head><frameset rows='85,*'  frameborder='NO' border='0' framespacing='0'><frame src='manage/top' noresize='noresize' frameborder='NO' name='topFrame' scrolling='no' marginwidth='0' marginheight='0' target='main' /><frameset cols='250,*' id='frame'><frame src='manage/left' name='leftFrame' noresize='noresize' marginwidth='0' marginheight='0' frameborder='0' scrolling='auto' target='main' /><frame src='manage/right' name='main' marginwidth='0' marginheight='0' frameborder='0' scrolling='auto' target='_self' /></frameset></frameset><noframes><body></body></noframes></html>";
        servletContext.setAttribute("logined", logined);
      } catch (Exception e) {
        System.out.println("操作失败!");
View Full Code Here


    } catch (RuntimeException e) {
      e.printStackTrace();
    }
  }
  @Test public void save(){
    Config config = new Config();
    config.setName("易乐网络");
    config.setCompany("武汉易乐网络有限公司");
    config.setDomain("127.0.0.1:8080/j2cmsSSH");
    config.setCopyright("YetNet 2010 All right reserved");
    config.setEmail("admin@yetnet.cn");
    config.setTemplate("j2cms");
    config.setRecordCode("鄂ICP备08102130号");
    configService.save(config);
  }
View Full Code Here

    config.setTemplate("j2cms");
    config.setRecordCode("鄂ICP备08102130号");
    configService.save(config);
  }
  @Test public void update(){
    Config config = configService.find(1);
    System.out.println(config.getCompany());
    config.setCompany("易乐网络有限公司");
    configService.update(config);
  }
View Full Code Here

  }
  @Actions({
    @Action("edit"),
  })
  public String execute(){
    Config config = configService.find(1);
    Struts2Utils.setAttribute("config", config);
    return SUCCESS;
  }
View Full Code Here

  }
  @Actions({
    @Action(value="/manage/getLatestVersion"),
  }) 
  public String getLatestVersion(){
    Config c =(Config)Struts2Utils.getContextAttribute("C");
    try {
      String p =c.getConfigStr();
      Struts2Utils.setAttribute("url", "http://www.j2cms.com/getLatestVersion?"+p);
      return "urlRedirect";
    } catch (Exception e) {
      return "urlRedirect";
   
View Full Code Here

TOP

Related Classes of org.j2cms.model.config.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.