Examples of PortletPreferences


Examples of javax.portlet.PortletPreferences

            add(new Button("editModeSaveButton", new ResourceModel("pam.details.action.save"))
            {
                @Override
                public void onSubmit()
                {
                    PortletPreferences prefs = ((ApplicationsListApplication)this.getApplication()).getPortletRequest().getPreferences();
                    FeedbackPanel feedback = (FeedbackPanel)this.getParent().get("feedback");
                    try
                    {
                        prefs.setValue("appRows", Integer.toString(EditModeForm.this.getAppRows()));
                        prefs.setValue("portletRows", Integer.toString(EditModeForm.this.getPortletRows()));
                        prefs.store();
                        ActionResponse ar = (ActionResponse)((ApplicationsListApplication)this.getApplication()).getPortletResponse();
                        ar.setPortletMode(PortletMode.VIEW);                       
                    }
                    catch (ReadOnlyException e)
                    {
View Full Code Here

Examples of javax.portlet.PortletPreferences

    }
   
    public String getPreferenceValue(String key, String defaultValue)
    {
        String preferenceValue = null;
        PortletPreferences prefs = getPortletRequest().getPreferences();
       
        if (prefs.getMap().containsKey(key))
        {
            preferenceValue = prefs.getValue(key, defaultValue);
        }
       
        return preferenceValue;
    }
View Full Code Here

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

Examples of javax.portlet.PortletPreferences

        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

Examples of javax.portlet.PortletPreferences

    {
        // 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

Examples of javax.portlet.PortletPreferences

    }

    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

Examples of javax.portlet.PortletPreferences

{
    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

Examples of javax.portlet.PortletPreferences

    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

Examples of javax.portlet.PortletPreferences

        }
        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

Examples of javax.portlet.PortletPreferences

   {
      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
TOP
Copyright © 2018 www.massapi.com. 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.