Package javax.portlet

Examples of javax.portlet.PortletPreferences


    }
   
    public String [] getPreferenceValues(String key, String [] defaultValues)
    {
        String [] preferenceValues = null;
        PortletPreferences prefs = getPortletRequest().getPreferences();
       
        if (prefs.getMap().containsKey(key))
        {
            preferenceValues = prefs.getValues(key, defaultValues);
        }
       
        return preferenceValues;
    }
View Full Code Here


        protected NewUserPrincipalPanel(String id)
        {
            super(id);
           
            PortletPreferences preferences = ((AbstractAdminWebApplication)getApplication()).getPortletRequest().getPreferences();
           
            final String defaultRole = preferences.getValue(DEFAULT_ROLE ,"");
            final String requiredRole = preferences.getValue(REQUIRED_ROLE, "");
            final String defaultProfile = preferences.getValue(DEFAULT_PROFILE ,"");
            final String defaultSubsite = preferences.getValue(DEFAULT_SUBSITE ,"");
            final String templateFolder = preferences.getValue(NEW_USER_TEMPLATE_DIR, "/_user/template/");
            final String subsiteRoot = preferences.getValue(SUB_SITE_ROOT,"");
            profilingRule = defaultProfile.toString();
           
            add(new FeedbackPanel("feedback"));
            Form userForm = new Form("newUserForm");
            add(userForm);
View Full Code Here

    {
        // get current session OpenID login state
        RequestContext requestContext = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
        Subject sessionSubject = (Subject)requestContext.getSessionAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT);
        String sessionOpenIDProvider = (String)requestContext.getSessionAttribute(PortalReservedParameters.SESSION_OPEN_ID_PROVIDER);
        PortletPreferences prefs = request.getPreferences();
        String requiredOpenIDProvider = prefs.getValue(REQUIRED_OPEN_ID_PROVIDER_PREF_NAME, null);
        String requiredOpenIDProviderLabel = prefs.getValue(REQUIRED_OPEN_ID_PROVIDER_LABEL_PREF_NAME, null);

        // check against configured requirements
        if ((sessionSubject == null) || ((requiredOpenIDProvider != null) && !requiredOpenIDProvider.equals(sessionOpenIDProvider)))
        {
            if (notAvailableViewPage != null)
View Full Code Here

    }

    public void setupPreferencesEdit(RenderRequest request, RenderResponse response)
    {
        Context context = getContext(request);
        PortletPreferences prefs = request.getPreferences();
        Map map = prefs.getMap();
        Iterator it = map.entrySet().iterator();
        context.put("prefs", it);
       
        Map result = new HashMap(map.size());
        Iterator f = map.entrySet().iterator();
View Full Code Here

{
    static public void requestParamsToPreferences(ActionRequest request)
        throws PortletException
    {
        Map params = request.getParameterMap();
        PortletPreferences prefs = request.getPreferences();
        Map prefsMap = prefs.getMap();

        try
        {
            Iterator it = params.entrySet().iterator();
            while (it.hasNext())
            {
                Map.Entry entry = (Map.Entry) it.next();
                Object value = entry.getValue();
                String key = (String) entry.getKey();
                if (null == prefsMap.get(key))
                {
                    continue;
                }
                if (value instanceof String)
                {
                    prefs.setValue(key, (String)value);
                }
                else if (value instanceof String[])
                {
                    prefs.setValue(key, ((String[]) value)[0]);
                }
            }
        }
        catch (Exception e)
        {
View Full Code Here

    public String save()
    {
        if (this.date != null)
        {
            PortletRequest request = (PortletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
            PortletPreferences prefs = request.getPreferences();
            try
            {
               
                prefs.setValue(getDateKey(this.date), this.notes);
                prefs.store();
            }
            catch (Exception e)
            {
                System.err.println("error storing prefs " + e);
            }
View Full Code Here

        }
        return nodes;
    }

    protected boolean getShowEmptyCategory(PortletRequest request) {
        PortletPreferences portletPreferences = request.getPreferences();
        String showEmptyCategoryStringValue = portletPreferences.getValue(EMPTY_CATEGORY_PROPERTY_NAME, "false");
        return Boolean.valueOf(showEmptyCategoryStringValue);
    }
View Full Code Here

   {
      String zip = actionRequest.getParameter(ZIP);

      if (null != zip)
      {
         PortletPreferences prefs = actionRequest.getPreferences();
         prefs.setValue(ZIP, zip);
         prefs.store();
      }

      // set zip as render parameter
      actionResponse.setRenderParameter(ZIP, zip);
View Full Code Here

        boolean useCaptcha;
        if (skipCaptcha) {
            useCaptcha = false;
        } else {
            PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
            PortletPreferences pref = pcontext.getRequest().getPreferences();
            useCaptcha = Boolean.parseBoolean(pref.getValue(UIRegisterEditMode.USE_CAPTCHA, "true"));
        }

        if (useCaptcha) {
            addUIFormInput(new UICaptcha(CAPTCHA, CAPTCHA, null).addValidator(MandatoryValidator.class).addValidator(
                    CaptchaValidator.class));
View Full Code Here

public class UIRegisterEditMode extends UIForm {
    public static final String USE_CAPTCHA = "useCaptcha";

    public UIRegisterEditMode() {
        PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletPreferences pref = pcontext.getRequest().getPreferences();
        boolean useCaptcha = Boolean.parseBoolean(pref.getValue(USE_CAPTCHA, "true"));
        addUIFormInput(new UIFormCheckBoxInput<Boolean>(USE_CAPTCHA, USE_CAPTCHA, useCaptcha).setValue(useCaptcha));
    }
View Full Code Here

TOP

Related Classes of javax.portlet.PortletPreferences

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.