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)

Field Summary
 
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
 Enumeration getAttributeNames()
          returns an enumeration of attributes
 String getAttributeValue(String key)
          returns the value related to the provided key.
 Enumeration getChildren()
          returns an array of IPropertiesResource children or null if no there is no child.
 Enumeration getChildren(String tagName)
          returns an array of IPropertiesResource children which correspond to the tag name or null if no there is no child.
 String getNodeName()
          returns the name of this node
 String getNodeValue()
          returns the value of this node
 void setAttributeValue(String key, 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

Enumeration getAttributeNames()
returns an enumeration of attributes


getAttributeValue

String getAttributeValue(String key)
returns the value related to the provided key.

Parameters:
key -

setAttributeValue

void setAttributeValue(String key,
                       String value)
sets the value related to the provided key.

Parameters:
key -
value -

getNodeName

String getNodeName()
returns the name of this node


getNodeValue

String getNodeValue()
returns the value of this node


getChildren

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


getChildren

Enumeration getChildren(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

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
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-BASIS-API [sap.com] tc/epbc/prt/lib/api api EP-PIN
[sap.com] EP-BASIS-API [sap.com] tc/epbc/prt/api api EP-PIN
[sap.com] EP-BASIS-API [sap.com] epbc.prtapi._apideprecated default EP-PIN-PRT


Copyright 2011 SAP AG Complete Copyright Notice