1.0.1 Examples of resourceDescriptor
The following resourceDescriptor sample contains a set of simple properties that describe a JDBC connection resource:
<resourceDescriptor name= "JServerJdbcDS" wsType= "jdbc"
uriString= "/datasources/JServerJdbcDS" isNew= "false" >
<label >JServer Jdbc data source</label >
<description >JServer Jdbc data source</description >
<resourceProperty name= "PROP_PARENT_FOLDER" >
<value >/datasources</value >
</resourceProperty >
<resourceProperty name= "PROP_VERSION" >
<value >0</value >
</resourceProperty >
<resourceProperty name= "PROP_DATASOURCE_DRIVER_CLASS" >
<value >com.mysql.jdbc.Driver</value >
</resourceProperty >
<resourceProperty name= "PROP_DATASOURCE_CONNECTION_URL" >
<value >jdbc:mysql://localhost/test?autoReconnect=true</value >
</resourceProperty >
<resourceProperty name= "PROP_DATASOURCE_USERNAME" >
<value >username</value >
</resourceProperty >
<resourceProperty name= "PROP_DATASOURCE_PASSWORD" >
<value >password</value >
</resourceProperty >
</resourceDescriptor >
Some properties cannot be represented by a simple value. To accommodate more complicated properties, a resourceProperty can recursively contain other resourceProperties. This is the case for a List of Values type resource (used to define input controls for report parameters); the list values are contained in the resourceProperty named PROP_LOV and are represented by sub-resourceProperties. For example:
<resourceDescriptor name= "SampleLOV" wsType= "lov" uriString= "/datatypes/SampleLOV" isNew= "false" >
<label >Sample List of Values</label >
<resourceProperty name= "PROP_RESOURCE_TYPE" >
<value >com.jaspersoft.jasperserver.api.metadata.common.domain.ListOfValues
</value >
</resourceProperty >
<resourceProperty name= "PROP_PARENT_FOLDER" >
<value >/datatypes</value >
</resourceProperty >
<resourceProperty name= "PROP_VERSION" >
<value >-1</value >
</resourceProperty >
<resourceProperty name= "PROP_HAS_DATA" >
<value >false</value >
</resourceProperty >
<resourceProperty name= "PROP_IS_REFERENCE" >
<value >false</value >
</resourceProperty >
<resourceProperty name= "PROP_LOV" >
<resourceProperty name= "US" >
<value >United States</value >
</resourceProperty >
<resourceProperty name= "CA" >
<value >Canada</value >
</resourceProperty > <resourceProperty name= "IN" >
<value >India</value >
</resourceProperty >
<resourceProperty name= "IT" >
<value >Italy</value >
</resourceProperty >
<resourceProperty name= "DE" >
<value >Germany</value >
</resourceProperty >
<resourceProperty name= "RO" >
<value >Romania</value >
</resourceProperty >
</resourceProperty >
</resourceDescriptor >
This example defined a list of countries. Notice that, for each list item, the resourceProperty name represents the item value, and the resourceProperty value contains the item label.
Previous
Resource Descriptor Parameters
Next
REST v2 - Repository Services