Package javax.portlet

Examples of javax.portlet.PortletPreferences.reset()


    {
      if ( name == null ) name = "";
      PortletPreferences prefs = request.getPreferences();
      try
    {
        prefs.reset( name );
        prefs.store();
    }
    catch ( ReadOnlyException e ) { }
    catch ( IOException e ) { }
    catch ( ValidatorException e ) { }
View Full Code Here


    {
        String removeName = request.getParameter("remove");    
        if (removeName!=null)
        { // remove
            PortletPreferences prefs = request.getPreferences();
            prefs.reset(removeName);    
            prefs.store();
        }
        String add = request.getParameter("add");          
        if (add!=null)
        { // add                    
View Full Code Here

            // Test the values have been store in the persistent store
            assertEquals("new_single_pref", prefs.getValue("single_pref", "other"));
            assertEquals(new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"}, prefs.getValues("multi_pref", new String[]{"other"}));

            // Reset
            prefs.reset("single_pref");
            prefs.reset("multi_pref");

            // Test does not exist
            assertEquals("other", prefs.getValue("single_pref", "other"));
            assertEquals(new String[]{"other"}, prefs.getValues("multi_pref", new String[]{"other"}));
View Full Code Here

            assertEquals("new_single_pref", prefs.getValue("single_pref", "other"));
            assertEquals(new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"}, prefs.getValues("multi_pref", new String[]{"other"}));

            // Reset
            prefs.reset("single_pref");
            prefs.reset("multi_pref");

            // Test does not exist
            assertEquals("other", prefs.getValue("single_pref", "other"));
            assertEquals(new String[]{"other"}, prefs.getValues("multi_pref", new String[]{"other"}));
View Full Code Here

            {
               // expected
            }
            try
            {
               prefs.reset("single_pref");
               fail();
            }
            catch (ReadOnlyException e)
            {
               // expected
View Full Code Here

            {
               // expected
            }
            try
            {
               prefs.reset("multi_pref");
               fail();
            }
            catch (ReadOnlyException e)
            {
               // expected
View Full Code Here

            // Test with new value
            assertEquals("dynamic", prefs.getValue("pref", "other"));

            // Reset the value and store
            prefs.reset("pref");

            // Test the value does not exist anymore
            assertEquals("other", prefs.getValue("pref", "other"));

            // Store
View Full Code Here

    try {
      Enumeration<String> preferenceNames = portletPreferences.getNames();

      while (preferenceNames.hasMoreElements()) {
        String preferenceName = preferenceNames.nextElement();
        portletPreferences.reset(preferenceName);
      }

      portletPreferences.store();

      // Switch the portlet mode back to VIEW.
View Full Code Here

    try {
      Enumeration<String> preferenceNames = portletPreferences.getNames();

      while (preferenceNames.hasMoreElements()) {
        String preferenceName = preferenceNames.nextElement();
        portletPreferences.reset(preferenceName);
      }

      portletPreferences.store();

      // Switch the portlet mode back to VIEW.
View Full Code Here

    try {
      Enumeration<String> preferenceNames = portletPreferences.getNames();

      while (preferenceNames.hasMoreElements()) {
        String preferenceName = preferenceNames.nextElement();
        portletPreferences.reset(preferenceName);
      }

      portletPreferences.store();

      // Switch the portlet mode back to VIEW.
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.