Examples of ApplicationConfig


Examples of com.alibaba.dubbo.config.ApplicationConfig

        }
        if (getApplication() == null
                && (getProvider() == null || getProvider().getApplication() == null)) {
            Map<String, ApplicationConfig> applicationConfigMap = applicationContext == null ? null : BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext, ApplicationConfig.class, false, false);
            if (applicationConfigMap != null && applicationConfigMap.size() > 0) {
                ApplicationConfig applicationConfig = null;
                for (ApplicationConfig config : applicationConfigMap.values()) {
                    if (config.isDefault() == null || config.isDefault().booleanValue()) {
                        if (applicationConfig != null) {
                            throw new IllegalStateException("Duplicate application configs: " + applicationConfig + " and " + config);
                        }
View Full Code Here

Examples of com.liferay.faces.util.config.ApplicationConfig

    Application application = (Application) systemEvent.getSource();
    FacesContext initFacesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = initFacesContext.getExternalContext();
    Map<String, Object> applicationMap = externalContext.getApplicationMap();
    String appConfigAttrName = ApplicationConfig.class.getName();
    ApplicationConfig applicationConfig = (ApplicationConfig) applicationMap.get(appConfigAttrName);

    if (applicationConfig == null) {

      boolean resolveEntities = WebConfigParam.ResolveXMLEntities.getBooleanValue(externalContext);
      String requestServletPath = externalContext.getRequestServletPath();
      ApplicationConfigInitializer applicationConfigInitializer = new ApplicationConfigInitializerImpl(
          requestServletPath, resolveEntities);

      try {
        applicationConfig = applicationConfigInitializer.initialize();
        applicationMap.put(appConfigAttrName, applicationConfig);

        // Register the configured factories with the factory extension finder.
        FacesConfig facesConfig = applicationConfig.getFacesConfig();
        List<ConfiguredElement> configuredFactoryExtensions = facesConfig.getConfiguredFactoryExtensions();

        if (configuredFactoryExtensions != null) {

          FactoryExtensionFinder factoryExtensionFinder = FactoryExtensionFinder.getInstance();
View Full Code Here

Examples of com.multysite.entity.admin.ApplicationConfig

      NamespaceManager.set(ns);
    }
    try {
      init();
      boolean cached = false;
      ApplicationConfig obj = new ApplicationConfig();
      String prefix = cachePrefix + "id_" + id;
      try {
        obj = (ApplicationConfig) cache.get(prefix);
        if (obj != null) {
          cached = true;
View Full Code Here

Examples of com.multysite.entity.admin.ApplicationConfig

        Application app = ApplicationModel.getById(NamespaceManager
            .get());
        if (app != null && user != null
            && user.getEmail().equals(app.getUserEmail())) {
          NamespaceManager.set(app.getId());
          ApplicationConfig config = ApplicationConfigModel.getById(
              NamespaceManager.get(), NamespaceManager.get());         
          config.setTitle(siteTitle);
          config.setDescription(siteDescription);
          config.setKeyword(siteKeyword);
          ApplicationConfigModel.insert(NamespaceManager.get(),
              config);
          resp.sendRedirect("/admin");
        } else {
          resp.getWriter().println("Invalid Permission");
View Full Code Here

Examples of com.multysite.entity.admin.ApplicationConfig

  protected void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    try {
      ApplicationTemplate template = (ApplicationTemplate) req
          .getAttribute("template");
      ApplicationConfig config = (ApplicationConfig) req
          .getAttribute("config");
      log.warning("--------do post from test servlet---------");
      BlobstoreService blobService = BlobstoreServiceFactory
          .getBlobstoreService();
      byte b[] = null;
      try {

        Map<String, List<BlobKey>> blobs = blobService.getUploads(req);
        List<BlobKey> blobKeys = blobs.get("template");
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        if (blobKeys != null && blobKeys.size() > 0) {
          for (BlobKey blobKey : blobKeys) {
            b = blobService.fetchData(blobKey, 0, 20);
            if (b.length > 0) {
              FileService fileService = FileServiceFactory
                  .getFileService();
              AppEngineFile file = fileService
                  .getBlobFile(blobKey);
              FileReadChannel readChannel = fileService
                  .openReadChannel(file, false);
              InputStream is = Channels
                  .newInputStream(readChannel);
              int nRead;
              byte[] buffer = new byte[10240];
              while ((nRead = is.read(buffer, 0, buffer.length)) != -1) {
                bos.write(buffer, 0, nRead);
              }
              bos.flush();
            }
          }
          ByteArrayInputStream bais = new ByteArrayInputStream(
              bos.toByteArray());
          ZipInputStream zis = new ZipInputStream(bais);
          ZipEntry entry;
          InputStreamReader isr = new InputStreamReader(zis);

          while ((entry = zis.getNextEntry()) != null) {
            log.warning("-----------------size " + entry.getSize());

            char[] buffer = new char[10240];
            StringBuilder strTemp = new StringBuilder();
            int length;
            while ((length = isr.read(buffer, 0, buffer.length)) != -1) {
              strTemp.append(buffer, 0, length);
            }

            if (entry.toString().contains("home.php")) {
              template.setHome(strTemp.toString());
              log.warning("--------home ok---------");
            } else if (entry.toString().contains("category.php")) {
              template.setCategory(strTemp.toString());
              log.warning("--------category ok---------");
            } else if (entry.toString().contains("tag.php")) {
              template.setTag(strTemp.toString());
              log.warning("--------tag ok---------");
            } else if (entry.toString().contains("search.php")) {
              template.setSearch(strTemp.toString());
              log.warning("--------search ok---------");
            } else if (entry.toString().contains("style.css")) {
              template.setCss(strTemp.toString());
              log.warning("--------css ok---------");
            } else if (entry.toString().contains("javascript.js")) {
              template.setJs(strTemp.toString());
              log.warning("--------js ok---------");
            } else {
              log.warning("--------not ok---------"
                  + entry.toString());
            }
            // read the contents into the buffer

          }
          ApplicationTemplateModel.insert(config.getApplicationId(),
              template);
          CompileScriptEngine.removeCache();
          resp.getWriter().println("Ok babe !");

        }
View Full Code Here

Examples of com.multysite.entity.admin.ApplicationConfig

    try {
      System.out.println("Current NS : " + NamespaceManager.get());
      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) {
          String keyword = splitted[2];
          keyword = URLDecoder.decode(keyword, "UTF-8");
          int page = 1;
          try {
            page = Integer.parseInt((String) req
                .getParameter("page"));
          } catch (Exception e) {
            page = 1;
          }
          log.warning("----------Key-------" + keyword);
          NewsSearchModel model = new NewsSearchModel();
          model.setPage(page);
          model.search(keyword);

          CompiledScript compiledscript = CompileScriptEngine
              .getCompileScript(config.getApplicationId(),
                  "search", template.getSearch());

          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());

          CategoryModel cateModel = new CategoryModel();
          cateModel.prepareAll();
View Full Code Here

Examples of com.multysite.entity.admin.ApplicationConfig

        ApplicationTemplateModel.insert(ns, template);

        /*
         * site config
         */
        ApplicationConfig config = new ApplicationConfig();
        config.setApplicationId(obj.getId());
        config.setTitle(obj.getTitle() + " Title");
        config.setDescription(obj.getTitle() + " Description");
        config.setKeyword(obj.getId());
        config.setTemplateId(template.getId());
        config.setStatus(1);
        ApplicationConfigModel.insert(ns, config);

        resp.setContentType("text/html");
        resp.getWriter().println(
            "Visit site with url : <a href=\"http://" + obj.getId()
View Full Code Here

Examples of com.multysite.entity.admin.ApplicationConfig

      throws IOException {
    try {
      req.setCharacterEncoding("utf-8");
      ApplicationTemplate template = (ApplicationTemplate) req
          .getAttribute("template");
      ApplicationConfig config = (ApplicationConfig) req
          .getAttribute("config");
      if (template != null && config != null) {
        NewsModel model = new NewsModel();
        model.setLimit(500);
        model.prepareList();       
View Full Code Here

Examples of com.multysite.entity.admin.ApplicationConfig

    try {
      System.out.println("Current NS : " + NamespaceManager.get());
      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) {
          String tagAlias = splitted[2];
          tagAlias = URLDecoder.decode(tagAlias, "UTF-8");
          Tag obj = TagModel.getById(tagAlias);
          if (obj != null) {
            int limit = 10;
            int page = 1;
            try {
              page = Integer.parseInt((String) req
                  .getParameter("page"));
            } catch (Exception e) {
              page = 1;
            }
            CompiledScript compiledscript = CompileScriptEngine
                .getCompileScript(config.getApplicationId(),
                    "tag", template.getTag());

            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());

            CategoryModel cateModel = new CategoryModel();
            cateModel.prepareAll();
View Full Code Here

Examples of com.multysite.entity.admin.ApplicationConfig

    try {
      if (!NamespaceManager.get().equals(Setting.getGeneralNamespace())) {
        req.setCharacterEncoding("utf-8");
        ApplicationTemplate template = (ApplicationTemplate) req
            .getAttribute("template");
        ApplicationConfig config = (ApplicationConfig) req
            .getAttribute("config");
        if (template != null && config != null) {
          int page = 1;
          try {
            page = Integer.parseInt((String) req
                .getParameter("page"));
          } catch (Exception e) {
            page = 1;
          }
          NewsModel model = new NewsModel();
          model.setPage(page);
          model.prepareList();
          CategoryModel cateModel = new CategoryModel();
          cateModel.prepareAll();
          TagModel tagModel = new TagModel();
          tagModel.prepareList();

          CompiledScript compiledscript = CompileScriptEngine
              .getCompileScript(config.getApplicationId(),
                  "home", template.getHome());
          if (compiledscript != null) {
            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());

            bind.put("recent_view",
                RecentViewHelper.getRecentView());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.