Starting in v126.96.36.199, Windward is using a single set of code to address accessing files and web-based data. This adds features with regard to your Data Source credentials as well as how Import Tags access content.
These provide a new consistent way to access files and web based data across AutoTag. Windward ships with the following access providers:
.NET (.NET Engine, RESTful Engine, AutoTag)
Customers can write their own Access Provider and it will get added to this list at runtime and is treated identically to the existing providers. A provider should be able to be written in under 200 lines of code (usually much less).
How it works
In the Authentication Protocol field, select the type you want from the dropdown and then fill in the credential fields for that option. This combination defines the protocol and its properties, and is saved as a connection string in the form “AccessProvider=Basic;Username=username;Password=password;”
- All of the connection string keywords and any of the common values are in BaseAccessProvider.java if needed directly in your code. AutoTag will build this string for you.
- One of the protocols is FileBased which is used for reading a local file as well as http files.
- If no AccessProvider is set in the connection string, Windward it will look at the URL and set it to "AllHttp" if the url starts with http:, https:, ftp:, etc. Otherwise it will set it to FileBased.
Via Your Data Source
When you edit or create a new web or file-based Data Source, you can set the Authentication Protocol. In AutoTag this is done by selecting the protocol itself and then setting the properties for that protocol. Open your Data Source Connection Editor (see this article for more) and edit or create a new Web/File connection. In the Authentication Protocol field, select the type you want from the dropdown and then fill in the credential fields for that option. The connection editor screen will look slightly different depending on the type of connection.
For specific settings with your data source, see these pages:
Via Your Import Tags
To access the Authentication Protocol for an Import Tag, open the Tag Editor and navigate to the Properties pane. In the Tag Properties, click the [...] button to bring up the Connection String interface.
There is no URL in the Import Tag credentials because the Import Tag itself provides the URL.
The Connection String Interface
If you select “Use variable,” the variable dropdown will show all variables defined in the template you have open. In this case, the variable needs to be set to find the connection string you want to use; a Set Tag is usually the best Tag to use for this. "Use variable" is very useful if the username/password is to be set differently during production. It is also useful if the same protocol and credentials are used with multiple Import Tags.
Use this option to set the credentials for this particular Import Tag. The fields will be the same as those used in the Data Connection Editor Interface.
In the URL
Normally the Import Tag will return something like http://www.windward.net/images/logo.png and all the provider information is set as above. However, if you type or paste a select into your Query Pane similar to what is shown below, all of the above settings, if they exist, are ignored. Instead, Windward assumes the returned value is the entire connection string.
It uses this mode if it finds Url= in the string.
Passing credentials to an Import Tag via the Engine
Use this Sample Invoice to play along!
To pass credentials via the Engine, follow these steps:
In your template in AutoTag, create an Input Variable.
- Give it a variable name, and a default value. The final form of the value you pass in will need to be in this form:
- Note the variable name because you will use it later!
Next Open your Import Tag and navigate to the Properties Pane. Open the Connection String interface, click Use Variable, and select the variable name from the dropdown menu.
Once your template has this set up run it to make sure it works in AUtoTag. Once you've tested that, it's time to try it in your Engine.
Now locate the engine code you're using; either open Catapult, or navigate to where the Windward Engine Samples are stored on your machine.
Find the Advanced section/folder, and open the Variables example. Here is the basic information that will need to be added to your code:
|.NET (C#)||Java (note|
| //This is where we pass in the parameters
Dictionary<string, object> map = new Dictionary<string, object>();
//order is our variable
//This is the function where we actually tell our report the parameter values
data.Map = map;
| //This is where we pass in the parameters to the datasource
Map map = new HashMap();
//the actual function that gives the datasource our parameters