Available Providers

The default Curiosity distribution is shipped with some default providers.

InfoProviderMail

It sends the data as the html body of an email.

Class:

  • com.goCuriosity.providers.InfoProviderMail

Note: InfoReach was the codename of Curiosity in the early stages of development; so, these class names may change in the future.

Parameters:

  • recipients: a comma separeted list of email addresses
  • mailSender: (optional) the email address that will be used as sender (overrides the default - see later)
  • mailSubject: (optional) the subject of the email; the {0} placeholder will be replaced with the Source label

You must specify the smtp server and the default sender address in the global options section:

<curiosity>
    <options>
        <smtp>anSmtp.example.com</smtp>
        <mailSender>curiosity@example.com</mailSender>
    </options>
</curiosity>

Smtp authentication is also supported:

<curiosity>
    <options>
        <smtp>anSmtp.example.com</smtp>
        <smtpPort>587</smtpPort>
        <smtpUser>anSmtpUser</smtpUser>
        <smtpPwd>5WFEvFwgbOFMRpwZB3=</smtpPwd>
    </options>
</curiosity>

You have to encode the password as explained here.

InfoProviderMailWithAttachment

It is like the InfoProviderMail, but the data is attached to the mail as a file; the name of the file is the one of the related source, while the extension is xml. For the moment, there is no means to change the file name and extension, nor the mail body, which consist of a default message.

class:

  • ...providers.InfoProviderMailWithAttachment

ProviderMailsBag

It is like the InfoProviderMail, but it is intended to send an email for each InfoResource acquired. In order to perform this task, it expects in input an xsl which is supposed to transform the acquired data in another Xml file conform to the bagOfMails.xsd schema definition (included in the distribution) - which basically defines a collection of emails with a subject, a body and an header collection.

Class:

  • ...providers.mailsBag.ProviderMailsBag

InfoProviderFile

The data is provided as a file written in the file system.

Class:

  • com.goCuriosity.providers.InfoProviderFile

Parameters:

  • file: the file name; you can use in the name the sequence {0} which will be substitued with the source name
  • append: if true, the provided data is appended to the end of the specified file
  • encoding: the code page name of the character encoding that must to be used when writing to the file; please, refer to the online MSDN documentation of the System.Text.Encoding class for a list of valid code page names (note that not every encoding may be available on your platform)

InfoProviderFileFtp

The data is provided as a file which is uploaded via ftp.

Class:

  • com.goCuriosity.providers.InfoProviderFileFtp

Parameters:

  • host
  • login
  • pwd: the password, which must be encoded as explained here
  • path: the path on the server where to upload the file
  • file: as in InfoProviderFile

next