Package com.multysite.entity.admin

Examples of com.multysite.entity.admin.ApplicationConfig


  @Override
  protected void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    String ns = NamespaceManager.get();
    ApplicationConfig config = ApplicationConfigModel.getById(ns, ns);
    ApplicationTemplate template = ApplicationTemplateModel.getById(ns,
        config.getTemplateId());
    String action = req.getParameter("action");
    String value = req.getParameter("pageValue");
    if (action != null && action.equals("homePage")) {
      template.setHome(value);
    } else if (action != null && action.equals("detailPage")) {
View Full Code Here


          String subDomain = siteName.replace("." + Setting.getDomain(),
              "");
          Application obj = ApplicationModel.getById(subDomain);
          if (obj != null) {
            try {
              ApplicationConfig config = ApplicationConfigModel
                  .getById(obj.getId(), obj.getId());
              ApplicationTemplate template = ApplicationTemplateModel
                  .getById(obj.getId(), config.getTemplateId());
              NamespaceManager.set(obj.getId());
              if (config != null && template != null) {
                request.setAttribute("template", template);
                request.setAttribute("config", config);
              } else {
                response.getWriter().print(
                    "Please try again later !");
                log.warning("Config or template are null !");
              }
            } catch (Exception e) {
              response.getWriter().print("Please try again later !");
              log.warning(e.toString());
            }
          } else {
            NamespaceManager.set(Setting.getGeneralNamespace());
          }
        } else {
          siteName = siteName.replace("http://", "");
          siteName = siteName.replace("www.", "");
          log.warning("---------------->------>" + siteName);
          ApplicationMapping mapping = ApplicationMappingModel
              .getById(siteName);
          if (mapping != null) {
            try {
              Application obj = ApplicationModel.getById(mapping
                  .getApplicationId());
              if (obj != null) {
                ApplicationConfig config = ApplicationConfigModel
                    .getById(obj.getId(), obj.getId());
                ApplicationTemplate template = ApplicationTemplateModel
                    .getById(obj.getId(),
                        config.getTemplateId());
                NamespaceManager.set(mapping.getApplicationId());
                if (config != null && template != null) {
                  request.setAttribute("template", template);
                  request.setAttribute("config", config);
                } else {
View Full Code Here

      throws IOException {
    try {
      req.setCharacterEncoding("utf-8");
      ApplicationTemplate template = (ApplicationTemplate) req
          .getAttribute("template");
      ApplicationConfig config = (ApplicationConfig) req
          .getAttribute("config");
      if (template != null && config != null) {
        /*
         * get detail content
         */
        String[] splitted = req.getRequestURI().split("/");
        if (splitted.length == 3) {
          boolean check = false;
          String categoryAlias = splitted[2];
          categoryAlias = URLDecoder.decode(categoryAlias, "UTF-8");
          Category obj = CategoryModel.getById(categoryAlias);
          if (obj != null || check == false) {

            CompiledScript compiledscript = CompileScriptEngine
                .getCompileScript(config.getApplicationId(),
                    "category", template.getCategory());
            Bindings bind = compiledscript.getEngine().getBindings(
                ScriptContext.ENGINE_SCOPE);
            bind.put("title_for_layout", config.getTitle());
            bind.put("description_for_layout",
                config.getDescription());
            bind.put("keyword_for_layout", config.getKeyword());
            bind.put("css_for_layout", template.getCss());
            bind.put("js_for_layout", template.getJs());

            int page = 1;
            try {
View Full Code Here

TOP

Related Classes of com.multysite.entity.admin.ApplicationConfig

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.