Java Doc for PortletPreferences.java in  » Portal » Open-Portal » javax » portlet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » javax.portlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.portlet.PortletPreferences

All known Subclasses:   com.sun.portal.portlet.impl.DPPortletPreferencesImpl,
PortletPreferences
public interface PortletPreferences (Code)
The PortletPreferences interface allows the portlet to store configuration data. It is not the purpose of this interface to replace general purpose databases.

There are two different types of preferences:

  • modifiable preferences - these preferences can be changed by the portlet in any standard portlet mode (EDIT, HELP, VIEW). Per default every preference is modifiable.
  • read-only preferences - these preferences cannot be changed by the portlet in any standard portlet mode, but may be changed by administrative modes. Preferences are read-only, if the are defined in the deployment descriptor with read-only set to true, or if the portlet container restricts write access.

Changes are persisted when the store method is called. The store method can only be invoked within the scope of a processAction call. Changes that are not persisted are discarded when the processAction or render method ends.





Method Summary
public  java.util.MapgetMap()
     Returns a Map of the preferences.

The values in the returned Map are from type String array (String[]).

If no preferences exist this method returns an empty Map. an immutable Map containing preference names as keys and preference values as map values, or an empty Mapif no preference exist.

public  java.util.EnumerationgetNames()
     Returns all of the keys that have an associated value, or an empty Enumeration if no keys are available.
public  StringgetValue(String key, String def)
     Returns the first String value associated with the specified key of this preference. If there is one or more preference values associated with the given key it returns the first associated value. If there are no preference values associated with the given key, or the backing preference database is unavailable, it returns the given default value.
Parameters:
  key - key for which the associated value is to be returned
Parameters:
  def - the value to be returned in the event that there is no value available associated with this key.
public  String[]getValues(String key, String[] def)
     Returns the String array value associated with the specified key in this preference.

Returns the specified default if there is no value associated with the key, or if the backing store is inaccessible.

If the implementation supports stored defaults and such a default exists and is accessible, it is used in favor of the specified default.
Parameters:
  key - key for which associated value is to be returned.
Parameters:
  def - the value to be returned in the event that thispreference node has no value associated with keyor the associated value cannot be interpreted as a String array,or the backing store is inaccessible.

public  booleanisReadOnly(String key)
     Returns true, if the value of this key cannot be modified by the user.

Modifiable preferences can be changed by the portlet in any standard portlet mode (EDIT, HELP, VIEW).

public  voidreset(String key)
     Resets or removes the value associated with the specified key.
public  voidsetValue(String key, String value)
     Associates the specified String value with the specified key in this preference.

The key cannot be null, but null values for the value parameter are allowed.
Parameters:
  key - key with which the specified value is to be associated.
Parameters:
  value - value to be associated with the specified key.
exception:
  ReadOnlyException - if this preference cannot be modified for this request
exception:
  java.lang.IllegalArgumentException - if key is null,or key.length() or value.length are to long.

public  voidsetValues(String key, String[] values)
     Associates the specified String array value with the specified key in this preference.

The key cannot be null, but null values in the values parameter are allowed.
Parameters:
  key - key with which the value is to be associated
Parameters:
  values - values to be associated with key
exception:
  java.lang.IllegalArgumentException - if key is null, orkey.length() is to long or value.size is to large.

public  voidstore()
     Commits all changes made to the preferences via the set methods in the persistent store.

If this call returns succesfull, all changes are made persistent.




Method Detail
getMap
public java.util.Map getMap()(Code)
Returns a Map of the preferences.

The values in the returned Map are from type String array (String[]).

If no preferences exist this method returns an empty Map. an immutable Map containing preference names as keys and preference values as map values, or an empty Mapif no preference exist. The keys in the preferencemap are of type String. The values in the preference map are of typeString array (String[]).




getNames
public java.util.Enumeration getNames()(Code)
Returns all of the keys that have an associated value, or an empty Enumeration if no keys are available. an Enumeration of the keys that have an associated value,or an empty Enumeration if no keys areavailable.



getValue
public String getValue(String key, String def)(Code)
Returns the first String value associated with the specified key of this preference. If there is one or more preference values associated with the given key it returns the first associated value. If there are no preference values associated with the given key, or the backing preference database is unavailable, it returns the given default value.
Parameters:
  key - key for which the associated value is to be returned
Parameters:
  def - the value to be returned in the event that there is no value available associated with this key. the value associated with key, or defif no value is associated with key, or the backingstore is inaccessible.
exception:
  java.lang.IllegalArgumentException - if key is null. (A null value for def is permitted.)
See Also:   PortletPreferences.getValues(String,String[])



getValues
public String[] getValues(String key, String[] def)(Code)
Returns the String array value associated with the specified key in this preference.

Returns the specified default if there is no value associated with the key, or if the backing store is inaccessible.

If the implementation supports stored defaults and such a default exists and is accessible, it is used in favor of the specified default.
Parameters:
  key - key for which associated value is to be returned.
Parameters:
  def - the value to be returned in the event that thispreference node has no value associated with keyor the associated value cannot be interpreted as a String array,or the backing store is inaccessible. the String array value associated withkey, or def if theassociated value does not exist.
exception:
  java.lang.IllegalArgumentException - if key is null. (A null value for def is permitted.)
See Also:   PortletPreferences.getValue(String,String)




isReadOnly
public boolean isReadOnly(String key)(Code)
Returns true, if the value of this key cannot be modified by the user.

Modifiable preferences can be changed by the portlet in any standard portlet mode (EDIT, HELP, VIEW). Per default every preference is modifiable.

Read-only preferences cannot be changed by the portlet in any standard portlet mode, but inside of custom modes it may be allowed changing them. Preferences are read-only, if they are defined in the deployment descriptor with read-only set to true, or if the portlet container restricts write access. false, if the value of this key can be changed, orif the key is not known
exception:
  java.lang.IllegalArgumentException - if key is null.




reset
public void reset(String key) throws ReadOnlyException(Code)
Resets or removes the value associated with the specified key.

If this implementation supports stored defaults, and there is such a default for the specified preference, the given key will be reset to the stored default.

If there is no default available the key will be removed.
Parameters:
  key - to reset
exception:
  java.lang.IllegalArgumentException - if key is null.
exception:
  ReadOnlyException - if this preference cannot be modified for this request




setValue
public void setValue(String key, String value) throws ReadOnlyException(Code)
Associates the specified String value with the specified key in this preference.

The key cannot be null, but null values for the value parameter are allowed.
Parameters:
  key - key with which the specified value is to be associated.
Parameters:
  value - value to be associated with the specified key.
exception:
  ReadOnlyException - if this preference cannot be modified for this request
exception:
  java.lang.IllegalArgumentException - if key is null,or key.length() or value.length are to long. The maximum length for key and value are implementation specific.
See Also:   PortletPreferences.setValues(String,String[])




setValues
public void setValues(String key, String[] values) throws ReadOnlyException(Code)
Associates the specified String array value with the specified key in this preference.

The key cannot be null, but null values in the values parameter are allowed.
Parameters:
  key - key with which the value is to be associated
Parameters:
  values - values to be associated with key
exception:
  java.lang.IllegalArgumentException - if key is null, orkey.length() is to long or value.size is to large. The maximum length for key and maximum size for value are implementation specific.
exception:
  ReadOnlyException - if this preference cannot be modified for this request
See Also:   PortletPreferences.setValue(String,String)




store
public void store() throws java.io.IOException, ValidatorException(Code)
Commits all changes made to the preferences via the set methods in the persistent store.

If this call returns succesfull, all changes are made persistent. If this call fails, no changes are made in the persistent store. This call is an atomic operation regardless of how many preference attributes have been modified.

All changes made to preferences not followed by a call to the store method are discarded when the portlet finishes the processAction method.

If a validator is defined for this preferences in the deployment descriptor, this validator is called before the actual store is performed to check wether the given preferences are vaild. If this check fails a ValidatorException is thrown.
exception:
  java.io.IOException - if changes cannot be written intothe backend store
exception:
  ValidatorException - if the validation performed by theassociated validator fails
exception:
  java.lang.IllegalStateException - if this method is called inside a render call
See Also:   PreferencesValidator




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.