我使用ImportDataHandler的RSS核心,URL存储在我的数据库中。所以我在配置文件中完成了嵌套调用,如下所示。我面临的问题是它只更新了3行(每个类别一个),但它总共获取了149个重新编码。可能是什么问题:
这是我的配置文件,格式化可能不太好,我不确定如何过去正确,请删除:
<dataConfig>
<dataSource type="URLDataSource" name="dsurl"/>
<dataSource type="JdbcDataSource" name="dsdb" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/HCDACoreDB" user="root" password="CDA@318"/>
<document>
<entity name="feeds"
query="select FeedUrl, FeedCategory from feeds where status=1"
processor="SqlEntityProcessor"
forEach="/FeedUrl"
dataSource="dsdb">
<field column="FeedUrl" name="urllink" dataSource="dsdb"/>
<field column="FeedCategory" name="Feedcategory" dataSource="dsdb"/>
<entity name="nprNews"
pk="link"
url="${feeds.FeedUrl}"
processor="XPathEntityProcessor"
forEach="/rss | /rss/channel | /rss/channel/item"
transformer="HTMLStripTransformer"
dataSource="dsurl">
<field column="source" xpath="/rss/channel/title" commonField="true" dataSource="dsurl"/>
<field column="source-link" xpath="/rss/channel/link" commonField="true" dataSource="dsurl"/>
<field column="Source-desc" xpath="/rss/channel/description" commonField="true" dataSource="dsurl"/>
<field column="title" xpath="/rss/channel/item/title" dataSource="dsurl"/>
<field column="link" xpath="/rss/channel/item/link" dataSource="dsurl"/>
<field column="description" xpath="/rss/channel/item/description" stripHTML="true" dataSource="dsurl"/>
<field column="pubDate" xpath="/rss/channel/item/pubDate" dataSource="dsurl"/>
<field column="guid" xpath="/rss/channel/item/guid" dataSource="dsurl"/>
<field column="content" xpath="/rss/channel/item/content" dataSource="dsurl"/>
<field column="author" xpath="/rss/channel/item/creator" dataSource="dsurl"/>
<entity name="newscategory"
query="select CategoryName from category where CategoryId='${feeds.FeedCategory}'"
dataSource="dsdb">
<field column="CategoryName" name="category" dataSource="dsdb"/>
</entity>
</entity>
</entity>
</document>
</dataConfig>