Package org.apache.jetspeed.om.common.preference

Examples of org.apache.jetspeed.om.common.preference.PreferenceComposite


    {
        PortletEntity entity = getPortletEntity(request);
        String prefString= request.getParameter("selectedPref");
        String newValue = request.getParameter("newPrefValue");
        String prefName = prefString.split("::")[1];
        PreferenceComposite pref = (PreferenceComposite) entity.getPreferenceSet().get(prefName);
        pref.addValue(newValue);
    }
View Full Code Here


            throw new PortletException("Preference values cannot be empty.");
        }
        String[] info = prefString.split("::");
        String prefName = info[1];
        int valueIndex = Integer.parseInt(info[2]);
        PreferenceComposite pref = (PreferenceComposite) entity.getPreferenceSet().get(prefName);
        pref.setValueAt(valueIndex, updatedValue);
    }
View Full Code Here

        PortletEntity entity = getPortletEntity(request);
        String prefString= request.getParameter("selectedPref");
        String[] info = prefString.split("::");
        String prefName = info[1];
        int valueIndex = Integer.parseInt(info[2]);
        PreferenceComposite pref = (PreferenceComposite) entity.getPreferenceSet().get(prefName);
        pref.removeValueAt(valueIndex);
    }
View Full Code Here

        if(action.equals("add_preference"))
        {
            String name = actionRequest.getParameter("name");
            String value = actionRequest.getParameter("value");
           
            PreferenceComposite pref = (PreferenceComposite) portlet.getPreferenceSet().get(name);
            if(pref == null)
            {
                portlet.addPreference(name, new String[] { value });
            }
            else
            {
                pref.addValue(value);
            }
        }
        else if(action.equals("edit_preference"))
        {
            String[] prefNames = actionRequest.getParameterValues("pref_edit_id");
            for (int i = 0; i < prefNames.length; i++)
            {
                String prefName = prefNames[i];
                PreferenceComposite prefComp = (PreferenceComposite) portlet.getPreferenceSet().get(prefName);
                String[] values = prefComp.getValueArray();
                for (int j = 0; j < values.length; j++)
                {
                    String value = values[j];
                    String newValue = actionRequest.getParameter(prefName + ":" + j);
                    if(!value.equals(newValue))
                    {
                        prefComp.setValueAt(j, newValue);
                    }
                }
            }
        }
        else if(action.equals("remove_preference"))
        {
            String[] prefNames = actionRequest.getParameterValues("pref_remove_id");
           
            Iterator prefIter = portlet.getPreferenceSet().iterator();
            while (prefIter.hasNext())
            {
                PreferenceComposite pref = (PreferenceComposite) prefIter.next();
                String name = pref.getName();
               
                for(int i=0; i<prefNames.length; i++)
                {
                    String prefName = prefNames[i];
                    if(name.equals(prefName))
View Full Code Here

        }
    }

    private boolean addPref(String prefName, String keywords, PortletDefinitionComposite portlet)
    {
        PreferenceComposite pref = (PreferenceComposite) portlet.getPreferenceSet().get(prefName);       
        if (pref == null)
        {
            portlet.addPreference(prefName, new String[] { keywords });
        }
        else
View Full Code Here

        return true;
    }
   
    private boolean modifyPref(String prefName, String keywords, PortletDefinitionComposite portlet)
    {
        PreferenceComposite prefComp = (PreferenceComposite) portlet.getPreferenceSet().get(prefName);
        String[] values = prefComp.getValueArray();
        if(!values[0].equals(keywords))
        {
            prefComp.setValueAt(0, keywords);
            return true;
        }
        return false;
    }
View Full Code Here

    private boolean removePref(String prefName, PortletDefinitionComposite portlet)
    {
        Iterator prefIter = portlet.getPreferenceSet().iterator();
        while (prefIter.hasNext())
        {
            PreferenceComposite pref = (PreferenceComposite) prefIter.next();
            String name = pref.getName();
            if (name.equals(prefName))
            {
                    prefIter.remove();
                    return true;
            }
View Full Code Here

            {
                return false;               
            }
            if (val > max)
                return false;
            PreferenceComposite pref = (PreferenceComposite) portlet.getPreferenceSet().get(prefName);
            String[] values = pref.getValueArray();
            if(!values[0].equals(param))
            {
                pref.setValueAt(0, param);
                return true;
            }                          
        }
        return false;
    }
View Full Code Here

        }
    }

    private boolean addPref(String prefName, String keywords, PortletDefinitionComposite portlet)
    {
        PreferenceComposite pref = (PreferenceComposite) portlet.getPreferenceSet().get(prefName);       
        if (pref == null)
        {
            portlet.addPreference(prefName, new String[] { keywords });
        }
        else
View Full Code Here

        return true;
    }
   
    private boolean modifyPref(String prefName, String keywords, PortletDefinitionComposite portlet)
    {
        PreferenceComposite prefComp = (PreferenceComposite) portlet.getPreferenceSet().get(prefName);
        String[] values = prefComp.getValueArray();
        if(!values[0].equals(keywords))
        {
            prefComp.setValueAt(0, keywords);
            return true;
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.common.preference.PreferenceComposite

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.