August 17, 2023

tRSSOutput – Docs for ESB 5.x

tRSSOutput

tRSSOutput_white_icon32.png

tRSSOutput Properties

Component family

Internet

 

Function

tRSSOutput writes RSS_Feed or
Atom_Feed XML files.

Purpose

tRSSOutput makes it possible to
create XML files that hold RSS or Atom feeds.

Basic settings

File name

Name or path to the XML file to be processed and/or the variable
to be used.

For further information about how to define and use a variable in
a Job, see Talend Studio
User Guide.

 

Encoding

Select an encoding type from the list, or select Custom and define it manually. This field
is compulsory for DB data handling.

 

Append

Select this check box to add the new rows to the end of the
file.

 

Mode

Select between RSS or ATOM according to the feed you want to
generate.

 

Channel (in RSS mode)

Note

The information to be typed in here concerns your entire input
data, site etc, rather than a particular item.

Title: Enter a meaningful
title.

Description: Enter a description
that you think will describe your content.

Publication date: Enter the
relevant date.

Link: Enter the relevant
URL.

 

Feed (in ATOM mode)

Title: Enter a meaningful
title.

Link: Enter the relevant
URL.

Id: Enter the valid URL
corresponding to the Link.

Update date: Enter the relevant
date .

Author name: Enter the relevant
name.

 

Optionnal Channel Elements

Click the [+] button below the table to add new lines and enter
the information relative to the RSS flow metadata:

Element Name: name of the metadata.

Element Value: content of the
metadata.

 

Schema and Edit
Schema

A schema is a row description, it defines the number of fields to be processed and
passed on to the next component. The schema is either Built-in or stored remotely in the
Repository.

Since version 5.6, both the Built-In mode and the Repository mode are
available in any of the Talend solutions.

Click Edit schema to make changes to the schema. If the
current schema is of the Repository type, three options are
available:

  • View schema: choose this option to view the
    schema only.

  • Change to built-in property: choose this option
    to change the schema to Built-in for local
    changes.

  • Update repository connection: choose this option to change
    the schema stored in the repository and decide whether to propagate the changes to
    all the Jobs upon completion. If you just want to propagate the changes to the
    current Job, you can select No upon completion and
    choose this schema metadata again in the [Repository
    Content]
    window.

By default, the schema of tRSSOutput is made of five read-only columns:
id, title, link,
updated, and summary. You can add new columns or click
Syn columns to retrieve the
schema structure from the preceding component.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a
Job level as well as at each component level.

Global Variables

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

NB_LINE: the number of rows read by an input component or
transferred to an output component. This is an After variable and it returns an
integer.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio
User Guide.

Usage

This component must be linked to an input or intermediary
component.

Limitation

n/a

Scenario 1: Creating an RSS flow and storing files on an FTP server

In this scenario we:

  • create an RSS flow for files that you would like to share with other people,
    and

  • store the complete files on an FTP server.

This scenario writes an RSS feed XML file about a Mysql table holding information
about books. It adds links to the files stored on an FTP server in case users want to
have access to the complete files.

Dropping and linking components

  1. Drop the following components from the Palette onto the design workspace:
    tMysqlInput
    , tRSSOutput, and
    tFTPPut.

  2. Right-click tMysqlInput and connect it to
    tRSSOutput using a Row > Main
    link.

  3. Right-click tMysqlInput and connect it to
    tFTPPut using a Trigger > OnSubjobOk
    link.

    Use_Case_tRSSOutput.png

Defining the data source

  1. In the design workspace, select tMysqlInput, and click the Component tab to define the basic settings for tMysqlInput.

    Use_Case_tRSSOutput1.png
  2. Set the Property type to Repository and click the three-dots
    button […] to select the relevant DB
    entry from the list. The connection details along with the schema get filled
    in automatically.

  3. In the Table Name field, either type your
    table name or click the three dots button […] and select your table name from the list. In this
    scenario, the Mysql input table is called “rss_talend” and the schema is
    made up of four columns, TITLE,
    Description, PUBDATE, and
    LINK.

  4. In the Query field, enter your DB query
    paying particular attention to properly sequence the fields in order to
    match the schema definition, or click Guess
    Query
    .

Creating an RSS flow

  1. In the design workspace, select tRSSOutput, and click the Component view to define the basic settings for tRSSOutput.

    Use_Case_tRSSOutput2.png
  2. In the File name field, use the by
    default file name and path, or browse to set your own for the output XML
    file.

  3. Select the encoding type on the Encoding Type
    list.

  4. In the Mode area, select RSS.

  5. In the Channel panel, enter a title, a
    description, a publication date, and a link to define your input data as a
    whole.

  6. Click Edit Schema to modify the schema if
    necessary.

    Note

    You can click Sync columns to
    retrieve the generated schema from the preceding component.

  7. Save your Job and press F6 to execute
    this first part.

    Use_Case_tRSSOutput5.png

    The tRSSOutput component created an
    output RSS flow in an XML format for the defined files.

Writing the complete files to an FTP server

To store the complete files on an FTP server:

  1. In the design workspace, select FTPPut,
    and click the Component tab to define the
    basic settings for tFTPPut.

    Use_Case_tRSSOutput4.png
  2. Enter the host name and the port number in their corresponding
    fields.

  3. Enter your connection details in the corresponding Username and Password
    fields.

  4. Browse to the local directory, or enter it manually in the Local directory field.

  5. Enter the details of the remote server directory.

  6. Select the transfer mode from the Transfer
    mode
    list.

  7. On the Files panel, click on the plus
    button to add new lines and fill in the filemasks of all files to be copied
    onto the remote directory. In this scenario, the files to be saved on the
    FTP server are all text files.

  8. Save your Job and press F6 to execute
    it.

    Files defined in the Filemask are copied on the remote server.

Scenario 2: Creating an RSS flow that contains metadata

This scenario describes a two-component Job that creates an RSS flow that holds
metadata and then redirects the obtained information in an XML file of the output RSS
flow.

Dropping and linking components

  1. Drop tRSSInput and tRSSOutput from the Palette
    to the design workspace.

  2. Connect the two components together using a Row > Main link.

    Use_Case_tRSSOutput6.png

Configuring the components

  1. Double-click tRSSInput to open its
    Basic settings view and define the
    component properties.

    Use_Case_tRSSOutput7.png
  2. Enter the URL for the RSS_Feed to access. In this scenario, tRSSInput links to the Talend RSS_Feed: http://feeds.feedburner.com/Talend.

  3. In the design workspace, double-click tRSSOutput to display its Basic
    settings
    view and define the component properties.

    Use_Case_tRSSOutput8.png
  4. In the File name field, use the by
    default file name and path, or browse to set your own for the output XML
    file.

  5. Select the encoding type on the Encoding Type
    list.

  6. In the Mode area, select RSS.

  7. In the Channel panel, enter a title, a
    description, a publication date and a link to define your input data as a
    whole.

  8. In the Optional Channel Element, define
    the RSS flow metadata. In this example, the flow has two metadata:
    copyright, which value is tos,
    and language which value is en_us.

  9. Click Edit Schema to modify the schema if
    necessary.

    Note

    You can click Sync Column to retrieve
    the generated schema from the preceding component.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.

  2. Press F6 or click Run on the Run tab to
    execute the Job.

    Use_Case_tRSSOutput9.png

    The defined files are copied in the output XML file and the metadata
    display under the <channel> node above the
    information about the RSS flow.

Scenario 3: Creating an ATOM feed XML file

This scenario describes a two component Job that generates data and writes them in an
ATOM feed XML file.

Dropping and linking components

  1. Drop the following components from the Palette onto the deisgn workspace: tFixedFlowInput of the Misc
    component group and tRSSOutput of the
    Internet component group.

  2. Right-click tFixedFlowInput and connect
    it to tRSSOutput using a Row Main link.

  3. When asked whether you want to pass on the schema of tRSSOutput to tFixedFlowInput, click Yes.

    Use_Case_tRSSOutput3_1.png

Configuring the components

  1. In the design workspace, double-click tFixedFlowInput to display its corresponding Component view and define its basic
    settings.

    Use_Case_tRSSOutput3_2.png
  2. In the Number of rows field, leave the
    default setting to 1 to only generate one
    line of data.

  3. In the Mode area, leave the Use Single Table option selected and fill in the
    Values table. Note that the Column field of the Values table is filled in by the columns of the schema
    defined in the component.

  4. In the Value field of the Values table, type in the data you want to be
    sent to the following component.

  5. In the design workspace, double-click tRSSOutput to display its corresponding Component view and define its basic settings.

    Use_Case_tRSSOutput3_3.png
  6. Click the […] button next to the
    File Name field to set the output XML
    file directory and name.

  7. In the Mode area, select ATOM to generate an ATOM feed XML file.

    Warning

    As the ATOM feed format is strict, some default information is
    required to create the XML file. So, the schema tRSSOutput contains default columns that will contain
    those information. Those default columns are greyed out to indicate that
    they must not be modified. If you choose to modify the schema of the
    component, the ATOM XML file created will not be valid.

  8. In the Feed area, enter a title, link,
    id, update date, author name to define your input data as a whole.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.

  2. Press F6 or click Run on the Run tab to
    execute the Job.

    Use_Case_tRSSOutput3_5.png

    The tRSSOutput component creates an
    output ATOM flow in an XML format.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x