com.sapportals.portal.prt.resource
Interface IPropertiesResource

All Superinterfaces:
IResource

public interface IPropertiesResource
extends IResource

The IPropertiesResource is an abstract view of XML resources, java property files or whatever.
It provides convenient methods to parse the nodes hierarchy without knowing anything about the file format.


For example :

 IPropertiesResource countries =
 (IPropertiesResource)(request.getResource("weather", "xml", "city.xml"));
 if ( countries.isAvailable()==true )
 {
 Enumeration enum = countries.getChildren();
 while (enum.hasMoreElements())
 {
 IPropertiesResource country = (IPropertiesResource)(enum.nextElement());
 System.out.println("CountryName="+country.getAttributeValue("name"));
 }
 }
 

See Also:
IResource, IResourceInformation, IPortalComponentRequest.getResource(String, String, String), IPortalComponentResponse.addResource(IResource)

Fields inherited from interface com.sapportals.portal.prt.resource.IResource
APPLET, CSS, IMAGE, JSP, PAGELET, PRIVATE_SCOPE, PROFILE, PROPERTY, PUBLIC_SCOPE, SCOPE_SEPARATOR, SCRIPT, STATIC_PAGE, SYSTEM_RESOURCE, XML
 
Method Summary
 java.util.Enumeration getAttributeNames()
          returns an enumeration of attributes
 java.lang.String getAttributeValue(java.lang.String key)
          returns the value related to the provided key.
 java.util.Enumeration getChildren()
          returns an array of IPropertiesResource children or null if no there is no child.
 java.util.Enumeration getChildren(java.lang.String tagName)
          returns an array of IPropertiesResource children which correspond to the tag name or null if no there is no child.
 java.lang.String getNodeName()
          returns the name of this node
 java.lang.String getNodeValue()
          returns the value of this node
 void setAttributeValue(java.lang.String key, java.lang.String value)
          sets the value related to the provided key.
 void store()
          Updates the content of the file.
 
Methods inherited from interface com.sapportals.portal.prt.resource.IResource
getResourceInformation, init, isAvailable
 

Method Detail

getAttributeNames

public java.util.Enumeration getAttributeNames()
returns an enumeration of attributes

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String key)
returns the value related to the provided key.
Parameters:
key -  

setAttributeValue

public void setAttributeValue(java.lang.String key,
                              java.lang.String value)
sets the value related to the provided key.
Parameters:
key -  
value -  

getNodeName

public java.lang.String getNodeName()
returns the name of this node

getNodeValue

public java.lang.String getNodeValue()
returns the value of this node

getChildren

public java.util.Enumeration getChildren()
returns an array of IPropertiesResource children or null if no there is no child.

getChildren

public java.util.Enumeration getChildren(java.lang.String tagName)
returns an array of IPropertiesResource children which correspond to the tag name or null if no there is no child.
Parameters:
tagName -  

store

public void store()
           throws PortalRuntimeException
Updates the content of the file. This method throws an exception when the file is not writable or does not exist.
Throws:
PortalRuntimeException -