Project

General

Profile

ValueRemoteSource Extender

Function


ValueRemoteSource is designed for forming text values on the ValueServer side, extracted from contents in specified order. For example: text file or xml file. These files can be both stored on current machine and available via local network or http.

For more detailed description, see ticket #20945

Configuration


To configure ValueRemoteSource extender, select Components / ValueRemoteSource Configuration … from DJin main menu. In the dialog box that opens, you will see current ValueRemoteSource settings.

2.1 Creation of data source (DataSource)

The data source (DataSource) serves as the root node for this extender. It contains the following set of parameters:

  • Name: source name displayed for the user (this field is mandatory)
  • Source type: Web / File system
  • Source Path:
  • Document type: XML / Plain Text
  • Encoding: Default / Win1251 / Win1252 / UTF8 / UTF16
  • Frequency Request, sec
  • Module: the module in the system of events (this field is mandatory)
  • Host: value server host (address) in the system of events

2.2 Creation (specification) of a variable (Variable)

When creating a variable it is required to specify only one parameter – the Name. This means the name of a variable that on ValueServer side will have the value received from selector assigned to it.

2.3 Creation of Selector

Selector is an entity that performs parsing of Data Source based on Type and Value. Available parameters include:

  • Name: selector name displayed for the user
  • Type: XPath / RegExp
  • Value: regular expression or xpath selector

Example of Component Configuration: ValueRemoteSource, ValueSource, ValueXMLWritter

Component documentation

3.1 All components operate within a single application

Let us configure vid config file first, initializing the needed components.

CREATE_NET_PLUGIN ValueServer ValueServer.dll Digispot.Plugins.ValueServer
CREATE_NET_WND_PLUGIN ValueXMLWriter ValueXMLWriter.dll Digispot.Plugins.ValueXMLWriter

SET_VIEW_TAB_OBJ VIEW_T1     ValueXMLWriter "Value XML Writer" 

SET_OBJ_BASE ValueServer log true

Here is an example of ValueRemoteSource configuration:

Here is an example of ValueXMLWritter configuration:

Two applications ValueRemoteSource and ValueXMLWritter + ValueSource

Let’s configure vid config file first, initializing the needed components. The configuration is performed for application where ValueXMLWritter + ValueSource components are installed.

CREATE_NET_PLUGIN ValueServer ValueServer.dll Digispot.Plugins.ValueServer
CREATE_NET_WND_PLUGIN ValueXMLWriter ValueXMLWriter.dll Digispot.Plugins.ValueXMLWriter

SET_VIEW_TAB_OBJ VIEW_T1     ValueXMLWriter "Value XML Writer" 

SET_OBJ_BASE ValueServer log true

Configuring system of events for application with ValueRemoteSource installed. Let us look at djin.xml:

<EVENT_SERVER HOST="CLIENT">
  <CLIENTS>
    <TCP TYPE="CLIENT" IP="127.0.0.1" PORT="1000" />
</CLIENTS>
</EVENT_SERVER>

Configuring system of events for application with ValueXMLWriter and ValueServer components installed. Let us look at djin.xml:

<EVENT_SERVER HOST="VS">
  <CLIENTS>
    <TCP TYPE="SERVER" IP="127.0.0.1" PORT="1000" />
</CLIENTS>
</EVENT_SERVER>

Here is an example of ValueRemoteSource configuration:

Here is an example of ValueXMLWritter configuration:

Advanced

4.1 Using Xml Tree for generation of XPath expressions

Xml Tree is an extension for Google Chrome that provides a clear way to generate and debug XPath extensions.
To install this extension, just follow the link in parentheses: "(link)":https://chrome.google.com/webstore/detail/xml-tree/gbammbheopgpmaagmckhpjbfgdfkpadb

xml-tree-install-page.png

Now open a random RSS feed and extract a number of news headers by clicking on the Title node. The results will be shown as follows:

/rss/channel/item/title

xml-tree-title-first-line.png

Now let us check the user XPath expression by receiving the first of a number of headers. This will result in the change of expression:

/rss/channel/item[1]/title

By clicking on XPath/Render on the line below, you will see the results:

xml-tree-title-first-line1.png

Build References

The extender consists of 2 builds – ValueRemoteSource.Service.dll (WCF service) and ValueRemoteSource.Client.dll (WCF client – settings editor)

Links from ValueRemoteSource.Service.dll build:

  • D3API.dll
  • D3APICommon.dll
  • Microsoft.Practices.Prism.dll
  • Digispot.Practices.Prism.Extender.dll
  • ValueRemoteSource.Client.dll

Links from ValueRemoteSource.Client.dll build:

  • D3API.dll
  • D3APICommon.dll
  • ICSharpCode.TreeView
  • Microsoft.Practices.Prism.dll
  • Digispot.Practices.Prism.Extender.dll

Add picture from clipboard (Maximum size: 742 MB)