Package com.liferay.portal.model

Examples of com.liferay.portal.model.Company


        HttpSession session = request.getSession(false);
        String uri = request.getRequestURI();

        uri = URLDecoder.decode(uri, "UTF-8");

    Company company = PublicCompanyFactory.getDefaultCompany();

        /*
         * Here is a list of directories that we will ignore b/c of legacy code
         * and servlet mappings. This is a mess and should be much cleaner
         */
        if ( Xss.URIHasXSS( uri ) ) {
            try {
                uri = Xss.encodeForURL( uri );
            } catch ( EncodingException e ) {
                Logger.error( this, "Encoding failure. Unable to encode URI " + uri );
                throw new ServletException( e.getMessage(), e );
            }

            if ( uri.equals( "" ) ) {
                uri = "/";
            }
            response.sendRedirect( uri );
            return;
        }

        if ( request.getQueryString() != null && !UtilMethods.decodeURL( request.getQueryString() ).equals( null ) ) {
            //http://jira.dotmarketing.net/browse/DOTCMS-6141
      if(request.getQueryString() != null && request.getQueryString().contains("\"")){
        response.sendRedirect(uri+"?"+StringEscapeUtils.escapeHtml(StringEscapeUtils.unescapeHtml(request.getQueryString())));
        return;
      }
            if ( Xss.ParamsHaveXSS( request ) ) {
                response.sendRedirect( uri );
                return;
            }
        }

        if (excludeURI(uri)) {
            chain.doFilter(request, response);
            return;
        }

        // set the preview mode
        boolean ADMIN_MODE = false;
        boolean EDIT_MODE = false;
        boolean PREVIEW_MODE = false;

        LogFactory.getLog(this.getClass()).debug("CMS Filter URI = " + uri);

        PermissionAPI permissionAPI = APILocator.getPermissionAPI();

        if (session != null) {
            // struts crappy messages have to be retrived from session
            if (session.getAttribute(Globals.ERROR_KEY) != null) {
                request.setAttribute(Globals.ERROR_KEY, session.getAttribute(Globals.ERROR_KEY));
                session.removeAttribute(Globals.ERROR_KEY);
            }
            if (session.getAttribute(Globals.MESSAGE_KEY) != null) {
                request.setAttribute(Globals.MESSAGE_KEY, session.getAttribute(Globals.MESSAGE_KEY));
                session.removeAttribute(Globals.MESSAGE_KEY);
            }
            // set the preview mode
            ADMIN_MODE = (session.getAttribute(com.dotmarketing.util.WebKeys.ADMIN_MODE_SESSION) != null);
            PREVIEW_MODE = (session.getAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION) != null && ADMIN_MODE);
            EDIT_MODE = (session.getAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION) != null && ADMIN_MODE);

            if (request.getParameter("livePage") != null && request.getParameter("livePage").equals("1")) {
                PREVIEW_MODE = false;
                EDIT_MODE = false;
                session.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, null);
                request.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, null);
                session.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, null);
                request.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, null);
                LogFactory.getLog(this.getClass()).debug("CMS FILTER Cleaning PREVIEW_MODE_SESSION LIVE!!!!");

            }

            if (request.getParameter("previewPage") != null && request.getParameter("previewPage").equals("1")) {
                PREVIEW_MODE = false;
                EDIT_MODE = true;
                session.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, null);
                request.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, null);
                session.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, "true");
                request.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, "true");
                LogFactory.getLog(this.getClass()).debug("CMS FILTER Cleaning EDIT_MODE_SESSION PREVIEW!!!!");
            }

            if (request.getParameter("previewPage") != null && request.getParameter("previewPage").equals("2")) {
                PREVIEW_MODE = true;
                EDIT_MODE = false;
                session.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, "true");
                request.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, "true");
                session.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, null);
                request.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, null);
                LogFactory.getLog(this.getClass()).debug("CMS FILTER Cleaning PREVIEW_MODE_SESSION PREVIEW!!!!");
            }
        }

        /*
         * Getting host object form the session
         */
        HostWebAPI hostWebAPI = WebAPILocator.getHostWebAPI();
        Host host;
    try {
      host = hostWebAPI.getCurrentHost(request);
    } catch (PortalException e) {
        Logger.error(this, "Unable to retrieve current request host for URI " + uri);
        throw new ServletException(e.getMessage(), e);
    } catch (SystemException e) {
        Logger.error(this, "Unable to retrieve current request host for URI  " + uri);
        throw new ServletException(e.getMessage(), e);
    } catch (DotDataException e) {
        Logger.error(this, "Unable to retrieve current request host for URI  " + uri);
        throw new ServletException(e.getMessage(), e);
    } catch (DotSecurityException e) {
        Logger.error(this, "Unable to retrieve current request host for URI  " + uri);
        throw new ServletException(e.getMessage(), e);
    }

        /*
         * If someone is trying to go right to an asset without going through
         * the cms, give them a 404
         */

        if (UtilMethods.isSet(ASSET_PATH) && uri.startsWith(ASSET_PATH)) {
            response.sendError(403, "Forbidden");
            return;
        }

        String pointer = null;
       
        boolean isVanityURL = UtilMethods.isSet(VirtualLinksCache.getPathFromCache(host.getHostname() + ":" + uri));
        if (!isVanityURL)
          isVanityURL = UtilMethods.isSet(VirtualLinksCache.getPathFromCache(uri));

        if(!uri.equals(pointer) && !uri.endsWith("/")
            && ! RegEX.contains(uri, folderPathRegEx)
            && uri.indexOf("/dotCMS/") == -1
            && !isVanityURL ) {
          Enumeration enm = req.getParameterNames();
          StringBuffer params = new StringBuffer("");
            for (; enm.hasMoreElements(); ) {
              String name = (String)enm.nextElement();
              params.append(name + "=" + req.getParameter(name));
              if(enm.hasMoreElements())
                params.append(StringPool.AMPERSAND);
            }
      response.sendRedirect(uri + "/" + (params.length() > 0 ? "?" + params : ""));
      return;
    }

        //Verify if the request is for a specific language
        Long languageId;
        if ( !UtilMethods.isSet( req.getParameter( "language_id" ) ) ) {
            languageId = APILocator.getLanguageAPI().getDefaultLanguage().getId();
        } else {
            languageId = Long.parseLong( req.getParameter( "language_id" ) );
        }

        /* if edit mode */
        if (PREVIEW_MODE || EDIT_MODE) {
      try {
        pointer = WorkingCache.getPathFromCache(uri, host);

        if(!UtilMethods.isSet(pointer)){//DOTCMS-7062
          pointer = LiveCache.getPathFromCache(uri, host);
        }

            if (!UtilMethods.isSet(pointer)
                && !uri.equals("/")
                && (uri.endsWith(dotExtension)
                    || InodeUtils.isSet(APILocator
                        .getFolderAPI().findFolderByPath(uri, host,APILocator.getUserAPI().getSystemUser(),false)
                        .getInode()))) {
               
              String url = uri;
                if (!uri.endsWith(dotExtension)) {
                    url += "index" + dotExtension;
                }
                request.getRequestDispatcher("/html/portlet/ext/htmlpages/page_not_found_404.jsp?url=" + url + "&hostId=" + host.getIdentifier()).forward(
                        req, res);
                return;
            }
            LogFactory.getLog(this.getClass()).debug("CMS preview pointer = " + uri + ":" + pointer);
      } catch (Exception e) {
        Logger.debug(this.getClass(), "Can't find pointer " + uri);
      }
            /* if live mode */
        } else {

      try {
                pointer = LiveCache.getPathFromCache( uri, host, languageId );
            } catch (Exception e) {
        Logger.debug(this.getClass(), "Can't find pointer " + uri);
        try {
          if(WebAPILocator.getUserWebAPI().isLoggedToBackend(request)){
            response.setHeader( "Pragma", "no-cache" );
            response.setHeader( "Cache-Control", "no-cache" );
            response.setDateHeader( "Expires", 0 );
            response.sendError(404);
            return;
          }
        } catch (Exception e1) {
          Logger.debug(this.getClass(), "Can't find pointer " + uri);
        }
      }
            // If the cache hits the db the connection needs to be manually
            // closed
            try {
        HibernateUtil.closeSession();
      } catch (DotHibernateException e) {
        Logger.error(CMSFilter.class, e.getMessage(), e);
      }
            LogFactory.getLog(this.getClass()).debug("CMS live pointer = " + uri + ":" + pointer);

        }

        /*
         * Checking if host is active
         */
        boolean hostlive;
        try {
            hostlive = APILocator.getVersionableAPI().hasLiveVersion(host);
        } catch (Exception e1) {
            throw new ServletException(e1);
        }
        if(!ADMIN_MODE && !hostlive) {
          //Checking if it has a maintenance virtual link
          pointer = (String) VirtualLinksCache.getPathFromCache(host.getHostname() + ":/cmsMaintenancePage");
          if(pointer == null) {
            try {
          response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, LanguageUtil.get(company.getCompanyId(), company.getLocale(), "server-unavailable-error-message"));
        } catch (LanguageException e) {
          Logger.error(CMSFilter.class, e.getMessage(), e);
          response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
        }
            return;
View Full Code Here


    uc = CacheLocator.getUserCache();
  }
 
  @Override
  protected User loadDefaultUser() throws DotDataException, NoSuchUserException {
    Company company = com.dotmarketing.cms.factories.PublicCompanyFactory.getDefaultCompany();
    try {
      return loadUserById(User.getDefaultUserId(company.getCompanyId()));
    } catch (NoSuchUserException e) {
      Logger.debug(this, "Default user not found attempting to create by updating company");
      try {
        CompanyLocalManagerUtil.createDefaultUser(company);
      } catch (Exception e1) {
        throw new DotDataException("Unable to create deafult user from company", e1);
      }
    }
    return loadUserById(User.getDefaultUserId(company.getCompanyId()));
  }
View Full Code Here

    return loadUserById(User.getDefaultUserId(company.getCompanyId()));
  }
 
  @Override
  public User createUser(String userId, String email) throws DotDataException, DuplicateUserException {
        Company comp = com.dotmarketing.cms.factories.PublicCompanyFactory.getDefaultCompany();
    String companyId = comp.getCompanyId();
    boolean autoID = false;
    User defaultUser = null;
    if(!UtilMethods.isSet(userId)){
      autoID = true;
      try {
View Full Code Here

        if (usersStr == null) {
            usersStr = "";
        }

        int numberGenericVariables = Config.getIntProperty("MAX_NUMBER_VARIABLES_TO_SHOW");
        Company comp = PublicCompanyFactory.getDefaultCompany();
        String[][] matchesArray = new String[matches.size()][16 + numberGenericVariables];
        Iterator it = matches.iterator();
        for (int i = 0; it.hasNext(); i++) {

            User user = null;

            String userId = (String) ((Map) it.next()).get("userid");
            //Fix a bug when a userid is a substring of another userid example dotcms.1574 and dotcms15743
            String userIdExt = userId + ",";
            if (usersStr.equalsIgnoreCase("") || usersStr.contains(userIdExt) || fullCommand) {
                user = APILocator.getUserAPI().loadUserById(userId,APILocator.getUserAPI().getSystemUser(),false);

                UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);

                // adding read permission
                try {
                    _checkUserPermissions(userProxy, searcherUser, PERMISSION_READ);
                } catch (ActionException ae) {
                    continue;
                }

                List addresses = user.getAddresses();
                Address address = null;
                if (addresses.size() > 0) {
                    address = (Address) addresses.get(0);
                }

                matchesArray[i][0] = userId;
                matchesArray[i][1] = (user.getFirstName() == null) ? "" : user.getFirstName();
                matchesArray[i][2] = (user.getMiddleName() == null) ? "" : user.getMiddleName();
                matchesArray[i][3] = (user.getLastName() == null) ? "" : user.getLastName();
                matchesArray[i][4] = (user.getEmailAddress() == null) ? "" : user.getEmailAddress();
                matchesArray[i][5] = (user.getPassword() == null) ? "" : user.getPassword();
                matchesArray[i][6] = UtilMethods.htmlDateToHTMLTime(user.getBirthday());
                matchesArray[i][7] = (address == null) ? "" : address.getStreet1();
                matchesArray[i][8] = (address == null) ? "" : address.getStreet2();
                matchesArray[i][9] = (address == null) ? "" : address.getCity();
                matchesArray[i][10] = (address == null) ? "" : address.getState();
                matchesArray[i][11] = (address == null) ? "" : address.getZip();
                matchesArray[i][12] = (address == null) ? "" : address.getCountry();
                matchesArray[i][13] = (address == null) ? "" : address.getPhone();
                matchesArray[i][14] = (address == null) ? "" : address.getFax();
                matchesArray[i][15] = (address == null) ? "" : address.getCell();

                for (int j = 1; j <= numberGenericVariables; j++) {
                    matchesArray[i][15 + j] = (userProxy.getVar(j) == null) ? "" : userProxy.getVar(j);
                }
            }
        }

        httpRes.setContentType("application/octet-stream");
        httpRes.setHeader("Content-Disposition", "attachment; filename=\"users_" + UtilMethods.dateToHTMLDate(new Date(), "M_d_yyyy") + ".csv\"");

        ServletOutputStream out = httpRes.getOutputStream();
        try {

            if (matchesArray.length > 0) {

                out
                        .print("First Name,Middle Name,Last Name,Email Address,User Password,Date Of Birth,Address Street1,Address Street2,Address City,Address State,Address Zip,Address Country,Phone Number,Fax Number,Cell Number,");
                for (int j = 1; j <= numberGenericVariables; j++) {
                    out.print(LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var" + j) + ",");
                }
                out.print("\r\n");
                for (int i = 0; i < matchesArray.length; i++) {
                    String[] match = matchesArray[i];
                    if (match[0] != null && !match[0].equalsIgnoreCase("")) {
View Full Code Here

        httpRes.setContentType("application/octet-stream");
        httpRes.setHeader("Content-Disposition", "attachment; filename=\"CSV_Template.csv\"");

        ServletOutputStream out = httpRes.getOutputStream();
        int numberGenericVariables = Config.getIntProperty("MAX_NUMBER_VARIABLES_TO_SHOW");
        Company comp = PublicCompanyFactory.getDefaultCompany();

        if (comp.getAuthType().equalsIgnoreCase(Company.AUTH_TYPE_ID)) {
          out.print("First Name,Middle Name,Last Name,Email Address,User Password,Date Of Birth,Address Street1,Address Street2,Address City,Address State,Address Zip,Address Country,Phone Number,Fax Number,Cell Number,User ID,");
        } else {
          out.print("First Name,Middle Name,Last Name,Email Address,User Password,Date Of Birth,Address Street1,Address Street2,Address City,Address State,Address Zip,Address Country,Phone Number,Fax Number,Cell Number,");
        }

        for (int j = 1; j <= numberGenericVariables; j++) {
            out.print(LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var" + j) + ",");
        }
        out.print("\r\n");

        // adding record for example
        out.print("First Name,,Last Name,user@mydomain.com\r\n");
View Full Code Here

                if (userForm.isIgnoreHeaders()) {
                    input.readLine();
                    lineNumber++;
                }
                String line = null;
                Company comp = com.dotmarketing.cms.factories.PublicCompanyFactory.getDefaultCompany();
                HibernateUtil.startTransaction();
                while ((line = input.readLine()) != null) {
                    lineNumber++;
                    if (lineNumber % 100 == 0) {
                        HibernateUtil.commitTransaction();
                        HibernateUtil.startTransaction();

                    }
                    String[] lineTok = UtilMethods.specialSplit(line, ",", "\"");

                    String firstName = "";
                    String middleName = "";
                    String lastName = "";
                    String email = "";
                    String password = "";
                    String dateOfBirthday = "";
                    String street1 = "";
                    String street2 = "";
                    String city = "";
                    String state = "";
                    String zip = "";
                    String country = "";
                    String phone = "";
                    String fax = "";
                    String cell = "";
                    String userId = "";

                    try {

                        int i = 0;
                        try {
                            firstName = lineTok[i++];
                        } catch (Exception e) {
                        }
                        try {
                            middleName = lineTok[i++];
                        } catch (Exception e) {
                        }
                        try {
                            lastName = lineTok[i++];
                        } catch (Exception e) {
                        }
                        try {
                            email = lineTok[i++];
                        } catch (Exception e) {
                        }

                        if (UtilMethods.isValidEmail(email)) {

                            try {
                                password = lineTok[i++];
                            } catch (Exception e) {
                            }

                            Date birthday = null;
                            String validationBirthdayString;
                            try {
                                dateOfBirthday = lineTok[i++];

                                birthday = UtilMethods.htmlToDate(dateOfBirthday);
                                validationBirthdayString = UtilMethods.dateToHTMLDate(birthday);
                                if (!dateOfBirthday.startsWith(validationBirthdayString) || (9999 < birthday.getYear()))
                                    birthday = null;
                            } catch (Exception e) {
                            }

                            try {
                                street1 = lineTok[i++];
                            } catch (Exception e) {
                            }
                            try {
                                street2 = lineTok[i++];
                            } catch (Exception e) {
                            }
                            try {
                                city = lineTok[i++];
                            } catch (Exception e) {
                            }
                            try {
                                state = lineTok[i++];
                            } catch (Exception e) {
                            }
                            try {
                                zip = lineTok[i++];
                            } catch (Exception e) {
                            }
                            try {
                                country = lineTok[i++];
                            } catch (Exception e) {
                            }
                            try {
                                phone = lineTok[i++];
                            } catch (Exception e) {
                            }
                            try {
                                fax = lineTok[i++];
                            } catch (Exception e) {
                            }
                            try {
                                cell = lineTok[i++];
                            } catch (Exception e) {
                            }

                            if (comp.getAuthType().equals(Company.AUTH_TYPE_ID)) {
                                try {
                                    userId = lineTok[i++];
                                } catch (Exception e) {
                                   Logger.info(this, e.getMessage());
                                }
                            }

                            if (firstName.equalsIgnoreCase("")) {
                                if (!someError) {
                                    returnMessage.append( LanguageUtil.get(com.liferay.portal.util.PortalUtil.getUser(req), "Errors-loading-users-br-br") );
                                    someError = true;
                                }
                                returnMessage.append( LanguageUtil.get(com.liferay.portal.util.PortalUtil.getUser(req), "Missing-First-Name-on-line") +" "+ lineNumber + "<br>");
                                continue;
                            }
                            if (lastName.equalsIgnoreCase("")) {
                                if (!someError) {
                                    returnMessage.append(LanguageUtil.get(com.liferay.portal.util.PortalUtil.getUser(req), "Errors-loading-users-br-br"));
                                    someError = true;
                                }
                                returnMessage.append(LanguageUtil.get(com.liferay.portal.util.PortalUtil.getUser(req), "Missing-Last-Name-on-line")+" " + lineNumber + "<br>");
                                continue;
                            }
                            if (email.equalsIgnoreCase("")) {
                                if (!someError) {
                                    returnMessage.append(LanguageUtil.get(com.liferay.portal.util.PortalUtil.getUser(req), "Errors-loading-users-br-br"));
                                    someError = true;
                                }
                                returnMessage.append(LanguageUtil.get(com.liferay.portal.util.PortalUtil.getUser(req), "Missing-Email-Address-on-line") +" "+ lineNumber + "<br>");
                                continue;
                            }

                            User userDuplicated = null;
                            try {
                              if (comp.getAuthType().equals(Company.AUTH_TYPE_ID)) {
                                userDuplicated = APILocator.getUserAPI().loadUserById(userId,APILocator.getUserAPI().getSystemUser(),false);
                              } else {
                                userDuplicated = APILocator.getUserAPI().loadByUserByEmail(email, APILocator.getUserAPI().getSystemUser(), false);
                              }
                            } catch (Exception e) {
                            }

                            if (userDuplicated == null) {
                              User user = null;

                                // Check company authorization type to set user id.
                                if (comp.getAuthType().equals(Company.AUTH_TYPE_ID)) {

                                  if(userId.equalsIgnoreCase("")) {
                                    if (!someError) {
                                          returnMessage.append(LanguageUtil.get(com.liferay.portal.util.PortalUtil.getUser(req), "Errors-loading-users-br-br"));
                                          someError = true;
View Full Code Here

   */
  @SuppressWarnings("deprecation")
  public String reorderfields(String structureInode, String inodeList){

    Structure structure = StructureFactory.getStructureByInode(structureInode);
    Company d = PublicCompanyFactory.getDefaultCompany();
    try
    {
      String[] params = inodeList.split(",");
      for(String tempField : params)
      {
        String[] tokens = tempField.split(" @ ");
        if(tokens ==null || tokens.length<2){
          continue;
        }
        String fieldInode = tokens[0];
        String parameterValue = tokens[1];
        Field field = FieldFactory.getFieldByInode(fieldInode);
        field.setSortOrder(Integer.parseInt(parameterValue));
        FieldFactory.saveField(field);
      }

            //Cleaning cache
            FieldsCache.removeFields( structure );
            StructureCache.removeStructure( structure );

            //Save the structure in order to update the modDate
            StructureFactory.saveStructure( structure );

      //VirtualLinksCache.clearCache();
      //String message = "message.structure.reorderfield";
      //SessionMessages.add(request, "message",message);
      return LanguageUtil.get(d.getCompanyId(),d.getLocale(), "message.structure.reorderfield");
    }
    catch(Exception ex)
    {
      Logger.error(EditFieldAction.class,ex.toString());
      return "Fields-could-not-be-reorderd";
View Full Code Here

    finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varZip(>|(&gt;))", "");
    finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varZip(\")?( )*/*( )*(>|(&gt;))", (address.getZip()!=null) ? address.getZip() : "");

    //gets default company to get locale
    Company comp = PublicCompanyFactory.getDefaultCompany();

    try {
      String var1 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var1");
      if (var1!=null) var1 = var1.replaceAll(" ","_");

      String var2 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var2");
      if (var2!=null) var2 = var2.replaceAll(" ","_");

      String var3 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var3");
      if (var3!=null) var3 = var3.replaceAll(" ","_");

      String var4 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var4");
      if (var4!=null) var4 = var4.replaceAll(" ","_");

      String var5 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var5");
      if (var5!=null) var5 = var5.replaceAll(" ","_");

      String var6 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var6");
      if (var6!=null) var6 = var6.replaceAll(" ","_");

      String var7 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var7");
      if (var7!=null) var7 = var7.replaceAll(" ","_");

      String var8 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var8");
      if (var8!=null) var8 = var8.replaceAll(" ","_");

      String var9 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var9");
      if (var9!=null) var9 = var9.replaceAll(" ","_");

      String var10 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var10");
      if (var10!=null) var10 = var10.replaceAll(" ","_");

      String var11 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var11");
      if (var11!=null) var11 = var11.replaceAll(" ","_");

      String var12 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var12");
      if (var12!=null) var12 = var12.replaceAll(" ","_");

      String var13 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var13");
      if (var13!=null) var13 = var13.replaceAll(" ","_");

      String var14 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var14");
      if (var14!=null) var14 = var14.replaceAll(" ","_");

      String var15 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var15");
      if (var15!=null) var15 = var15.replaceAll(" ","_");

      String var16 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var16");
      if (var16!=null) var16 = var16.replaceAll(" ","_");

      String var17 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var17");
      if (var17!=null) var17 = var17.replaceAll(" ","_");

      String var18 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var18");
      if (var18!=null) var18 = var18.replaceAll(" ","_");

      String var19 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var19");
      if (var19!=null) var19 = var19.replaceAll(" ","_");

      String var20 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var20");
      if (var20!=null) var20 = var20.replaceAll(" ","_");

      String var21 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var21");
      if (var21!=null) var21 = var21.replaceAll(" ","_");

      String var22 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var22");
      if (var22!=null) var22 = var22.replaceAll(" ","_");

      String var23 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var23");
      if (var23!=null) var23 = var23.replaceAll(" ","_");

      String var24 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var24");
      if (var24!=null) var24 = var24.replaceAll(" ","_");

      String var25 = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var25");
      if (var25!=null) var25 = var25.replaceAll(" ","_");

      //additional variables
      finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/"+var1+"(>|(&gt;))", "");
      finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))" + var1 + "(\")?( )*/*( )*(>|(&gt;))", (userproxy.getVar1()!=null) ? userproxy.getVar1() : "");
View Full Code Here

     
      if (usersToDelete != null) {
        Iterator<UsersToDelete> iterUsersToDelete = usersToDelete.iterator();
        UsersToDelete userToDelete;
        User user;
        Company comp = com.dotmarketing.cms.factories.PublicCompanyFactory.getDefaultCompany();
        UserAPI uAPI = APILocator.getUserAPI();
        User sysUser = uAPI.getSystemUser();
       
        for (; iterUsersToDelete.hasNext();) {
          try {
            userToDelete = iterUsersToDelete.next();
            if (comp.getAuthType().equals(Company.AUTH_TYPE_EA)) {
                    user = uAPI.loadByUserByEmail(userToDelete.getUserId(), sysUser, false);
                  } else {
                    user = uAPI.loadUserById(userToDelete.getUserId(), sysUser, false);
                  }
           
View Full Code Here

public class CompanyUtils {

  public static Company getDefaultCompany()
  {
    Company company = PublicCompanyFactory.getDefaultCompany();
    return company;
  }
View Full Code Here

TOP

Related Classes of com.liferay.portal.model.Company

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.