Example usage for com.liferay.portal.kernel.dao.search DAOParamUtil getBoolean

List of usage examples for com.liferay.portal.kernel.dao.search DAOParamUtil getBoolean

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.dao.search DAOParamUtil getBoolean.

Prototype

public static boolean getBoolean(PortletRequest portletRequest, String param) 

Source Link

Usage

From source file:com.liferay.calendar.search.CalendarResourceSearchTerms.java

License:Open Source License

public CalendarResourceSearchTerms(PortletRequest portletRequest) {
    super(portletRequest);

    active = DAOParamUtil.getBoolean(portletRequest, ACTIVE);
    code = DAOParamUtil.getLike(portletRequest, CODE);
    description = DAOParamUtil.getLike(portletRequest, DESCRIPTION);
    name = DAOParamUtil.getLike(portletRequest, NAME);
    scope = DAOParamUtil.getLong(portletRequest, SCOPE);
    type = DAOParamUtil.getString(portletRequest, TYPE);
}

From source file:com.liferay.dynamic.data.mapping.search.StructureSearchTerms.java

License:Open Source License

public StructureSearchTerms(PortletRequest portletRequest) {
    super(portletRequest);

    description = DAOParamUtil.getString(portletRequest, DESCRIPTION);
    name = DAOParamUtil.getString(portletRequest, NAME);
    searchRestriction = DAOParamUtil.getBoolean(portletRequest, SEARCH_RESTRICTION);
    storageType = DAOParamUtil.getString(portletRequest, STORAGE_TYPE);
}

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

License:Open Source License

public static void editForward(ActionRequest actionRequest, ActionResponse actionResponse) {
    ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
    Account callingAccount = null;//from  ww w . j av a2 s .  com
    try {
        callingAccount = ActionUtil.accountFromEmailAddress(themeDisplay.getUser().getEmailAddress());
    } catch (Exception e1) {
        e1.printStackTrace();
    }
    AccountManagementService ams = AccountManagementServiceImpl.getInstance();
    String jspPage = null;
    boolean valid = false;
    String backURL = DAOParamUtil.getString(actionRequest, "backURL");
    boolean delete = DAOParamUtil.getBoolean(actionRequest, "delete");
    String forward = DAOParamUtil.getString(actionRequest, "forward");
    String verify = DAOParamUtil.getString(actionRequest, "verify_forward");
    Account account = ActionUtil.accountFromUidNumber(DAOParamUtil.getString(actionRequest, "uidNumber"));

    actionResponse.setRenderParameter("uidNumber", account.getAttribute("uidNumber"));
    actionResponse.setRenderParameter("backURL", backURL);

    if (PermissionsChecker.hasPermission(callingAccount, account,
            PermissionsChecker.PERMISSION_ACCOUNT_FORWARD)) {
        try {
            ams.modifyEmailForward(account, forward, delete);
        } catch (ValidationException e) {
            SessionErrors.add(actionRequest, "password-change-failed");

            jspPage = PortletUtil.ACCT_MGMT_ACCOUNT_EDIT_FORWARD_JSP;
        }

        jspPage = PortletUtil.SEARCH_VIEW_JSP;
    } else {
        SessionErrors.add(actionRequest, "insufficient-privileges");

        jspPage = PortletUtil.ACCT_MGMT_ACCOUNT_EDIT_FORWARD_JSP;
    }

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

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

License:Open Source License

public static void removeAccount(ActionRequest actionRequest, ActionResponse actionResponse) {
    ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
    Account callingAccount = null;//from  www.ja v a2s  .  c o  m
    try {
        callingAccount = ActionUtil.accountFromEmailAddress(themeDisplay.getUser().getEmailAddress());
    } catch (Exception e1) {
        e1.printStackTrace();
    }
    AccountManagementService ams = AccountManagementServiceImpl.getInstance();
    String jspPage = null;
    List<SubSystem> subsystems = new ArrayList<SubSystem>();
    String backURL = DAOParamUtil.getString(actionRequest, "backURL");
    boolean remove = DAOParamUtil.getBoolean(actionRequest, "remove");
    Account account = ActionUtil.accountFromUidNumber(DAOParamUtil.getString(actionRequest, "uidNumber"));

    actionResponse.setRenderParameter("uidNumber", account.getAttribute("uidNumber"));
    actionResponse.setRenderParameter("backURL", backURL);

    if (PermissionsChecker.hasPermission(callingAccount, account,
            PermissionsChecker.PERMISSION_ACCOUNT_REMOVE_FORCE)) {
        subsystems.add(SubSystem.LDAP);
        if (remove) {
            try {
                account.setAttribute("removeAccount", "TRUE");
                ams.modifyAccount(account, subsystems);
            } catch (ValidationException e) {
                e.printStackTrace();
            } catch (IllegalArgumentException e) {
                // That's Ok
            }
        }
        jspPage = PortletUtil.SEARCH_VIEW_JSP;
    } else {
        SessionErrors.add(actionRequest, "insufficient-privileges");

        jspPage = PortletUtil.ACCT_MGMT_ACCOUNT_REMOVE_JSP;
    }

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

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

License:Open Source License

public void deleteScheduledRemovalJob(ActionRequest actionRequest, ActionResponse actionResponse) {
    ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
    Account callingAccount = null;//  w  w w . jav a  2  s  .  c o  m
    try {
        callingAccount = ActionUtil.accountFromEmailAddress(themeDisplay.getUser().getEmailAddress());
    } catch (Exception e1) {
        e1.printStackTrace();
    }
    String jspPage = null;
    Account account = ActionUtil.accountFromUidNumber(DAOParamUtil.getString(actionRequest, "uidNumber"));
    String backURL = DAOParamUtil.getString(actionRequest, "backURL");
    boolean delete = DAOParamUtil.getBoolean(actionRequest, "delete");

    actionResponse.setRenderParameter("uidNumber", account.getAttribute("uidNumber"));
    actionResponse.setRenderParameter("backURL", backURL);

    if (PermissionsChecker.hasPermission(callingAccount, account,
            PermissionsChecker.PERMISSION_ACCOUNT_REMOVE_FORCE)) {
        if (delete) {
            try {
                JobQueueLocalServiceUtil.deleteJobByEmailAddressAndJobAction(account.getMail().get(0),
                        PortletUtil.JOB_ACTION_REMOVE);
                JobQueueLocalServiceUtil.deleteJobByEmailAddressAndJobAction(account.getMail().get(0),
                        PortletUtil.JOB_ACTION_REMOVE_EMAIL_NOTICE);
            } catch (SystemException e) {
                SessionErrors.add(actionRequest, "delete-removal-job-failed");

                jspPage = PortletUtil.ACCT_MGMT_ACCOUNT_REMOVE_JSP;
            }
        }
        jspPage = PortletUtil.SEARCH_VIEW_JSP;
    } else {
        SessionErrors.add(actionRequest, "insufficient-privileges");

        jspPage = PortletUtil.ACCT_MGMT_ACCOUNT_REMOVE_JSP;
    }

    writeActionLog(actionRequest, account.getMail().get(0), account.getDisplayName(),
            account.getAttribute("esuccEntity"), "Deleted scheduled removal jobs");
    actionResponse.setRenderParameter("jspPage", jspPage);
}