Example usage for com.liferay.portal.kernel.util StringPool AT

List of usage examples for com.liferay.portal.kernel.util StringPool AT

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util StringPool AT.

Prototype

String AT

To view the source code for com.liferay.portal.kernel.util StringPool AT.

Click Source Link

Usage

From source file:com.stoxx.portlet.preregcustomeradmin.delegate.CustomerAdminDelegate.java

private void processDomain(Map<String, List<String>> resultMap, long salesEntryId, String domain)
        throws SystemException {
    if (!domain.startsWith(StringPool.AT)) {
        domain = StringPool.AT + domain;
    }//from  w ww .ja  v  a 2s  .  c  o m
    domain = StringUtil.toLowerCase(domain);
    try {
        EmailDomain emailDomain = EmailDomainLocalServiceUtil.getEmailDomain(domain);
        if (emailDomain.getSalesEntryId() != salesEntryId) {
            log.info("Domain '" + domain + "' already associated with another sales entry id :"
                    + emailDomain.getSalesEntryId());
            addToSkippedDomain(resultMap, domain);
        }
    } catch (NoSuchEmailDomainException e1) {
        EmailDomainLocalServiceUtil.addEmailDomain(salesEntryId, domain);
        log.info("Domain '" + domain + "' added succssfully with sales entry id: " + salesEntryId);
    }
}

From source file:org.gnenc.yams.portlet.AccountManagement.java

License:Open Source License

public void addAccount(ActionRequest actionRequest, ActionResponse actionResponse) {
    Account account = ActionUtil.accountFromRequest(actionRequest);
    String backURL = ParamUtil.getString(actionRequest, "backURL");
    Account newAccount = null;/*from   www .ja va2s. c o m*/
    String jspPage = null;

    AccountManagementService ams = AccountManagementServiceImpl.getInstance();
    List<SubSystem> subsystems = new ArrayList<SubSystem>();

    List<String> responses = new ArrayList<String>();
    String password = DAOParamUtil.getString(actionRequest, "password");
    String verify = DAOParamUtil.getString(actionRequest, "verify");
    String emailAddress = DAOParamUtil.getString(actionRequest, "emailAddress") + StringPool.AT
            + DAOParamUtil.getString(actionRequest, "domain");

    actionRequest.setAttribute("selAccount", account);
    actionResponse.setRenderParameter("backURL", backURL);

    boolean valid = PortletUtil.validatePasswordFields(password, verify, account.getGivenName(),
            account.getSn(), responses);

    if (valid) {
        valid = PortletUtil.validateEmailAddressField(emailAddress, responses);
    }

    if (!valid && responses.size() > 0) {
        for (String response : responses) {
            SessionErrors.add(actionRequest, response);
        }

        jspPage = PortletUtil.ACCT_MGMT_ACCOUNT_ADD_WIZARD_JSP;
    } else {
        account.setPassword(password);
        subsystems.add(SubSystem.LDAP);
        try {
            if (ams.checkAccountExists(account.getMail().get(0)).isEmpty()) {
                newAccount = ams.createAccount(account, subsystems);
                jspPage = PortletUtil.SEARCH_VIEW_JSP;
            } else {
                SessionErrors.add(actionRequest, "This account already exists");
                jspPage = PortletUtil.ACCT_MGMT_ACCOUNT_ADD_WIZARD_JSP;
            }
        } catch (ValidationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    writeActionLog(actionRequest, account.getMail().get(0), account.getDisplayName(),
            account.getAttribute("esuccEntity"), "Add account");
    actionResponse.setRenderParameter("jspPage", jspPage);
}

From source file:org.vaadin.tori.service.LiferayToriMailService.java

License:Apache License

private static String getMailId(final long companyId, final long categoryId, final long messageId)
        throws PortalException, SystemException {

    Company company = CompanyLocalServiceUtil.getCompany(companyId);
    String mx = company.getMx();/*from w  ww. j  a  va 2  s  .  c  o m*/
    StringBundler sb = new StringBundler(10);

    sb.append(StringPool.LESS_THAN);
    sb.append(POP_PORTLET_PREFIX);
    sb.append(categoryId);
    sb.append(StringPool.PERIOD);
    sb.append(messageId);
    sb.append(StringPool.AT);

    String sd = PropsUtil.get(PropsKeys.POP_SERVER_SUBDOMAIN);
    if (sd != null && !"null".equals(sd.toLowerCase())) {
        sb.append(sd);
        sb.append(StringPool.PERIOD);
    }

    sb.append(mx);
    sb.append(StringPool.GREATER_THAN);

    return sb.toString();
}