Package com.multysite.entity.admin

Examples of com.multysite.entity.admin.Application


      String siteDescription = req.getParameter("siteDescription");
      String siteKeyword = req.getParameter("siteKeyword");
      if (!NamespaceManager.get().equals(Setting.getGeneralNamespace())) {
        User user = UserServiceFactory.getUserService()
            .getCurrentUser();
        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);
View Full Code Here


  public void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws IOException {
    try {
      resp.setCharacterEncoding("utf-8");
      if (NamespaceManager.get().equals(Setting.getGeneralNamespace())) {
        Application obj = new Application();
        req.setAttribute("site", obj);
        req.getRequestDispatcher("/admin/pages/create.jsp").forward(
            req, resp);
      } else {
        int port = req.getServerPort();
View Full Code Here

      throws ServletException, IOException {
    try {
      TreeMap<String, String> error = new TreeMap<String, String>();
      String applicationId = req.getParameter("applicationId");
      String applicationTitle = req.getParameter("applicationTitle");
      Application obj = new Application();
      if (applicationId != null && applicationId.length() > 3) {
        /*
         * Check exits application id
         */
        Application checkObj = ApplicationModel.getById(applicationId);
        if (checkObj != null) {
          error.put(
              "applicationId",
              applicationId
                  + " is not avaiable. Please try another application id ");
View Full Code Here

        resp.getWriter().println("Hello My Boss");
        /*
         * Me place
         */
      } else {
        Application obj = ApplicationModel.getById(currentNs);
        if (obj != null
            && obj.getUserEmail().equals(
                UserServiceFactory.getUserService()
                    .getCurrentUser().getEmail())) {
          NamespaceManager.set(currentNs);
          req.getRequestDispatcher(
              "/admin/pages/application-detail.jsp").forward(req,
View Full Code Here

  @SuppressWarnings("unchecked")
  public static Application getById(String id) {
    NamespaceManager.set(Setting.getGeneralNamespace());
    try {     
      boolean cached = false;
      Application obj = new Application();
      String prefix = cachePrefix + "id_" + id;
      try {
        obj = (Application) cache.get(prefix);
        if (obj != null) {
          cached = true;
View Full Code Here

      String siteName = ((HttpServletRequest) request).getServerName();     
      if (!siteName.equals(Setting.getDomain())) {
        if (siteName.contains(Setting.getDomain())) {       
          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);
View Full Code Here

TOP

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

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.