Overview

CloudStreet Portal version 3 incorporates a new helper function that can notify your host when a portal user requests a subscription for a divisionCode-customerId-documentType combination that is not currently on file in the portal's document database.

To use this feature, you can use your FTP access to your FTP account then simply create a new directory called csp_notifications (if it is not already present).

When CloudStreet Portal sees that this directory name exists in your FTP account, it will automatically write an xml file into that directory each time an administrator on the CloudStreet Portal site approves a subscription for a divisionCode-customerId-documentType combination that does not already exist in the CloudStreet Portal document database.

Your host can poll this directory using FTP and when it finds an xml file, it can import and delete the document from the directory. The XML file contains all of the information your host may need in order to push the required documents to the portal.

Example of the XML file that is created in the csp_notifications directory:

<?xml version="1.0"?>
<notification>
<timeDate>2017-07-05 20:39:43</timeDate>
<type>subscription</type>
<event>approval</event>
<subscriberId>1001</subscriberId>
<subscriberName>testuser</subscriberName>
<subscriberUsername>testuser</subscriberUsername>
<subscriberEmail>This email address is being protected from spambots. You need JavaScript enabled to view it./subscriberEmail>
<divisionCode>030</divisionCode>
<divisionName>Selma</divisionName>
<documentType>invoice</documentType>
<customerId>12345</customerId>
<myCompanyName>Bruce Decker</myCompanyName>
<reachMeAt>303.905.4110</reachMeAt>
<customerNotes>Please let me in</customerNotes>
<approvedByUserId>840</approvedByUserId>
<approvedByUserName>bdecker</approvedByUserName>
<approvedByName>Bruce Decker</approvedByName>
<advice>Zero documents in database for this divisionCode-customerId-documentType combination. Consider importing them into Cloudstreet Portal.</advice>
</notification>

Container Purpose/Description
<type> This will contain a notification type. In the example above, Cloudstreet Portal wrote the value 'subscription'.
<divisionCode> This is the division code related to this subscription notification
<documentType> This is the documentType related to this subscription notification
<customerId> This is the customerId related to this subscription notification
<advice> This provides advice or summary information related to this subscription notification

Normal Sequence of Events

  1. A user adds a new subscription request for a specific division code, document type and customer ID to their MySubscriptions tab in the portal as a pending_approval status subscription request.
  2. A portal administrator approves the subscriptions.
  3. Cloudstreet Portal performs a series of checks to determine if CSP should place a notification file into the csp_notification directory. These checks are:
    • The 'Host Update' field in the subscriptions field must be blank
    • The Subscription status must be 'approved'
    • There must not be any documents already on file in the document database for the combination of DivisionCode, DocumentType and CustomerId
    • The directory in your FTP account called 'csp_notification' must exist
  4. If all of the above criteria are met, then CSP will generate an XML record and write it into the csp_notification directory. Otherwise, it will skip the notification write logic and simply save the subscription.
  5. The host should periodically poll the csp_notification directory looking for new files.
  6. When the host finds a file in the cspc_notification directory, it should download it via FTP to the host then host MUST delete the file from the csp_notification directory.
  7. The host should parse the XML to gather the divisionCode, CustomerId and DocumentType information.
  8. The host will generate the requested XML documents for the subcription and place them in the ftp account's csp_in directory (e.g., csp_in)
  9. The host or administrator will import the documents into CloudStreet Portal using one of the supported document import methods.
  10. The portal user will now be able to access the documents.

 

The response time between subscription submission and document availability will vary depending on:

1) The time required to approve the subscription

2) The polling interval of the host to the csp_notification directory

3) The time required for the host to generate the XML documents for the portal

4) The time required to transmit the generated XML documents to the portal

5) The time required to commence the document import function on the portal

6) The time required to import the documents into the portal

 

Tips

Forcing a notification to be sent from Cloudstreet Portal

The criteria defined above is used by CSP to determine if a notification record should be sent. The first criterion is to check to see if the field 'Host Update' has been set to a valid date time value. If the field contains a value, then CloudStreet Portal assumes that the host has already been updated. To override this check, simply clear the value from the Host Update field and save the subscription. Assuming the other criteria are met, the xml file will be regenerated into the csp_notification directory and the Host Update field will be set to the current date and time to indicate that the subscription notification has been sent.