-
Notifications
You must be signed in to change notification settings - Fork 8
Feed Processing %2D Incoming
ProteanCMS has a very robust feed processing facility.
Feeds are required to be in XML so first you need to write a handler to convert your feed into XML, if it is not allready.
This handler can take time to convert therefore we often run this first and save the feed to a local XML file.
Feeds are processed using SOAP API calls.
This can either be done with the ProteanCMS Scheduler service, or called with Windows Scheduler using powershell.
We plan to Deprecate the ProteanCMS Scheduler and move to Powershell and windows scheduler so for now we manually are setting up SOAP calls in Powershell Scripts.
Note: if the site is using cloudflare it is important to setup a direct path using http. This can be locked down by IP so is only accessible from the server itself of developers IP's
The following is an example.
$Body = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.eonic.co.uk/ewcommon/Services">
<soapenv:Header/>
<soapenv:Body>
<ser:Feed>
<ser:cURL>http://services.xxxx.com,/feed.xml</ser:cURL>
<ser:cXSLPath>F:\HostingSpaces\xxx\exx.co.uk\wwwroot\xsl\feeds\Feed.xsl</ser:cXSLPath>
<ser:nPageId>5184</ser:nPageId>
<ser:nSaveMode>1</ser:nSaveMode>
<ser:cItemNodeName>Product</ser:cItemNodeName>
</ser:Feed>
</soapenv:Body>
</soapenv:Envelope>'
Invoke-WebRequest -Uri http://services.elitemodelsonline.co.uk/ewcommon/services.asmx -Headers (@{SOAPAction='http://www.eonic.co.uk/ewcommon/Services/Feed'}) -Method Post -Body $Body -ContentType text/xml
cURL - is the URL of the XML feed we are loading
cXSLPath - is an XSLT file that converts the items in the XML into items to import into Protean.
nPageId - the default page id the content items are to be placed on
nSaveMode - 0 - Remove Old - 1 - Archive Old - 2 - Manual Remove
cItemNodeName - the nodename of the Entity incoming xml feed, this is used to stream the incoming feed in chuncks and process them asynconously improving performance.
You can import any type of Protean entity but are usually Content Items and more specifically products.
However feeds can be used for database queries and imports from legacy websites using an appropriate handler to extract any data to XML.
Once a feed is transformed the feed XML can contain settings to define how the feed is processed.
<Instances>
<DeleteNonEntries enabled="false">
<cDefiningField>cContentForiegnRef</cDefiningField>
</DeleteNonEntries>
<SkipExisting enabled="false"/>
<NoLocations enabled="false"/>
<ResetLocations enabled="false"/>
<xsl:for-each select="Product">
<instance update="relocate">
<tblContent>
...
</tblContent>
<Locations/>
<Relations/>
</instance>
</xsl:for-each>
</Instances>
Please see the dll for details ProcessInstanceExtras
Open Task Scheduler Create New Task Give Title Tick Run Weather logged in or not Set Trigger for daily ?
Actions - Start a program Program/Script C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Add Arguments
-File F:\HostingSpaces\client\site.co.uk_Jobs\script.ps1