Commit 7a8f92aa authored by Aurel's avatar Aurel

fix script parameters used when populating content

modify the XSLT method :
- include an edit workflow bu default so that the creation date is the publication date
- remove sid
- change order for computation of id based on md5

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32286 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1c18b9b7
...@@ -54,8 +54,8 @@ xmlns:dc="http://purl.org/dc/elements/1.1/">\n ...@@ -54,8 +54,8 @@ xmlns:dc="http://purl.org/dc/elements/1.1/">\n
<xsl:template match="item|entry">\n <xsl:template match="item|entry">\n
<xsl:variable name="md5_id">\n <xsl:variable name="md5_id">\n
<xsl:choose>\n <xsl:choose>\n
<xsl:when test="link"><xsl:value-of select="link|link/@href"/></xsl:when>\n
<xsl:when test="title|dc:title"><xsl:value-of select="title|dc:title"/></xsl:when>\n <xsl:when test="title|dc:title"><xsl:value-of select="title|dc:title"/></xsl:when>\n
<xsl:when test="link"><xsl:value-of select="link|link/@href"/></xsl:when>\n
<xsl:otherwise><xsl:value-of select="description|dc:description"/></xsl:otherwise>\n <xsl:otherwise><xsl:value-of select="description|dc:description"/></xsl:otherwise>\n
</xsl:choose>\n </xsl:choose>\n
</xsl:variable>\n </xsl:variable>\n
...@@ -63,7 +63,6 @@ xmlns:dc="http://purl.org/dc/elements/1.1/">\n ...@@ -63,7 +63,6 @@ xmlns:dc="http://purl.org/dc/elements/1.1/">\n
<object id="{$converted_id}" portal_type="RSS Item">\n <object id="{$converted_id}" portal_type="RSS Item">\n
<id type="string"><xsl:value-of select="$converted_id"/></id>\n <id type="string"><xsl:value-of select="$converted_id"/></id>\n
<rid type="string"><xsl:value-of select=\'$rid\'/></rid>\n <rid type="string"><xsl:value-of select=\'$rid\'/></rid>\n
<sid type="int"><xsl:value-of select="$sid"/></sid>\n
<categories_list type="tokens"><xsl:value-of select="$categories_list"/></categories_list>\n <categories_list type="tokens"><xsl:value-of select="$categories_list"/></categories_list>\n
<title type="string"><xsl:value-of select="title|dc:title"/></title>\n <title type="string"><xsl:value-of select="title|dc:title"/></title>\n
<subject_list type="lines"><xsl:value-of select="$subject_list"/></subject_list>\n <subject_list type="lines"><xsl:value-of select="$subject_list"/></subject_list>\n
...@@ -75,6 +74,15 @@ xmlns:dc="http://purl.org/dc/elements/1.1/">\n ...@@ -75,6 +74,15 @@ xmlns:dc="http://purl.org/dc/elements/1.1/">\n
</xsl:choose>\n </xsl:choose>\n
</url_text>\n </url_text>\n
<pub_date><xsl:value-of select="pubDate|dc:date"/></pub_date>\n <pub_date><xsl:value-of select="pubDate|dc:date"/></pub_date>\n
<workflow_action id="edit_workflow">\n
<action type="string">edit</action>\n
<actor type="string">aurel</actor>\n
<comment type="string"></comment>\n
<error_message type="string"></error_message>\n
<serial type="string">0.0.0.0</serial>\n
<state type="string">current</state>\n
<time type="date"><xsl:value-of select="pubDate|dc:date"/></time>\n
</workflow_action>\n
</object>\n </object>\n
</xsl:template>\n </xsl:template>\n
\n \n
...@@ -82,7 +90,8 @@ xmlns:dc="http://purl.org/dc/elements/1.1/">\n ...@@ -82,7 +90,8 @@ xmlns:dc="http://purl.org/dc/elements/1.1/">\n
<xsl:apply-templates/>\n <xsl:apply-templates/>\n
</xsl:template>\n </xsl:template>\n
\n \n
</xsl:stylesheet> </xsl:stylesheet>\n
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -61,7 +61,8 @@ to create the corresponding RSS Item objects.\n ...@@ -61,7 +61,8 @@ to create the corresponding RSS Item objects.\n
from DateTime import DateTime\n from DateTime import DateTime\n
\n \n
#Step1: transform an RSS Feed into ERP5 XML\n #Step1: transform an RSS Feed into ERP5 XML\n
xsl_kw = {\'date\':DateTime()}\n #xsl_kw = {\'date\':DateTime()}\n
xsl_kw = {}\n
xml_output = context.TextDocument_asCallable.RSSFeed_asAggregatedImportXML(**xsl_kw)\n xml_output = context.TextDocument_asCallable.RSSFeed_asAggregatedImportXML(**xsl_kw)\n
\n \n
#Step2: extract xml subobjects and create RSS Item objects\n #Step2: extract xml subobjects and create RSS Item objects\n
......
205 206
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment