jasperreports-server-ce/samples/customDataSource/webapp/WEB-INF/applicationContext-webscrap...

68 lines
2.6 KiB
XML
Executable File

<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2005 - 2018 TIBCO Software Inc.
~ http://www.jaspersoft.com.
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<!-- define a custom data source -->
<bean id="webScraperDataSource" class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.CustomDataSourceDefinition">
<!-- this prop is always the same; it registers the custom ds -->
<property name="factory" ref="customDataSourceServiceFactory"/>
<!-- name used in message catalog and elsewhere -->
<property name="name" value="webScraperDataSource"/>
<!-- class name of implementation -->
<property name="serviceClassName" value="example.cds.WebScraperDataSourceService"/>
<!-- instance of validator (optional)
must implement com.jaspersoft.jasperserver.api.engine.jasperreports.util.CustomDataSourceValidator
-->
<property name="validator">
<bean class="example.cds.WebScraperDataSourceValidator"/>
</property>
<!-- definitions of properties you can edit -->
<property name="propertyDefinitions">
<list>
<map>
<entry key="name" value="url"/>
</map>
<map>
<entry key="name" value="path"/>
</map>
</list>
</property>
<property name="queryExecuterMap">
<map>
<entry key="webscraper" value="example.cds.WebScraperQueryExecuterFactory"/>
</map>
</property>
</bean>
<!-- add your message catalog -->
<bean class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdater">
<property name="definition" ref="addMessageCatalog"/>
<property name="value">
<list>
<value>WEB-INF/bundles/webscraperds</value>
</list>
</property>
<property name="valueType" value="stringList"/>
</bean>
</beans>