I recently received a requirement from a customer who wanted to build one click approval into the email notifications being received around a Purchase Order process.
As Purchase Orders are being created in a forms library (although this could work against any list item use case), a SharePoint Designer workflow was created to determine approval routing and an email notification was sent seeking their approval. When the approver received the email, two links are presented to allow the approver to Approve or Reject the purchase order.

These built in links call a Toolset provider to update the status accordingly and then the connection redirects the user to their dashboard in SharePoint.
Here are the easy to follow implementation steps:
1) You will need to create an External Data Provider (for more information on creating an EDP consult other articles on the Community site). Create your connection needed for the provider that will be associated to each link in the email. In our example below, we are leveraging a SharePoint web service for updating a list item. Our links in the email will call this Toolset connection passing in the List ID and the appropriate status. Some of the key information needed in this connection is the <listName>. This will be the list your updating through this connection. You will need to change your field names to correspond to your actual field names. And the <Values> section you will need to include the passthrough parameters for this connection. One last key component to this connection is the <RedirectTo> node. This will be the URL that the user will be redirected to after the status is updated. You will want to add this to provide a more seamless user experience. If you don’t include this node, the user will see the native SOAP response coming back from the SharePoint web service. I directed the user to the dashboard in our customer solution.
<Data>
<Name>POApprovalDecision</Name>
<Default>false</Default>
<ConnectionType>Web Service</ConnectionType>
<Request>http://devrapps.corasworks.net/rfdev/hapts/_vti_bin/Lists.asmx</Request>
<RedirectTo>http://devrapps.corasworks.net/rfdev/hapts/ADefault.aspx</RedirectTo>
<SOAP>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>Purchase Orders</listName>
<updates>
<Batch OnError="Return">
<Method ID="1" Cmd="Update">
<Field Name="ID">%ListID%</Field>
<Field Name="PO_x0020_Status">%Status%</Field>
</Method>
</Batch>
</updates>
</UpdateListItems>
</soap:Body>
</soap:Envelope>
</SOAP>
<SOAPAction>http://schemas.microsoft.com/sharepoint/soap/UpdateListItems</SOAPAction>
<UseCurrentUserCredentials>2</UseCurrentUserCredentials>
<UserName>%CWUserID%</UserName>
<Password>%CWPassword%</Password>
<OutputType>text/xml</OutputType>
<Values>
<ListID />
<Status />
</Values>
</Data>
2) Build your workflow email using SharePoint Designer. Of course you will want to include as much detail that the approver will need to make a decision on the Purchase Order approval. But the main ingredient here are the Approve and Reject links. You will notice that we are building links to the Toolset provider created in step 1. We append the ID for the list item and the appropriate status for the link. These are used by the connection to identify the right purchase order and to update the approval decision.

3) The user will receive an email that looks something like this. The Approve and Reject links execute the provider that updates the status. And then the user is redirected to the dashboard.

Imagine all of the one click scenarios you could implement around this technique. As you implement, please share them with the community so we can all benefit from your creative genius.
Posted by Rodney Fickas on 21-Jul-09
There has been some recent interest in whether the Toolset could be used to create MS Office documents. So being the adventurous guy that I am, I set off to see whether it could be done. And I’m pleased to say it’s possible and really straight forward.
Imagine you were building out an employee on-boarding process using the Toolset. At some point in the process, a user needs to generate an On-Boarding Form that will be used by IT to do things like order a laptop, setup the user in AD and grant access to one or more systems.
The user could simply go to a grid display for all new employees. They would click on an icon that will then invoke MS Word with the employee details already merged into the document. This could be printed or emailed to the appropriate people.
This article is focused on setting up the provider needed when the user clicks on the icon. There are other articles in the community on how to setup a grid display with icons. In our use case above, the icon would simply leverage the provider that you will create using the steps below.
Here are the steps for creating the provider needed to create the Word ML:
1) Create your Toolset provider using a SharePoint Data Provider if your employee content exists in a SharePoint list. Or use the External Data Provider if your employee information resides in an external data source like SQL Server. If you need help setting up your provider, there are a number of community articles and related videos on how to setup a Toolset provider.
2) Create your document in MS Word formatting the way you want the document to look when the Toolset provider creates it. The placeholders in bracket are where you want dynamic content to come through the Toolset provider. More on that in a moment.
3) Now save your document as a Word XML Document. In our example below we are saving it using the Word 2003 XML Document file type.

3) It’s time to move on the XSLT needed to insert our dynamic content into the Word XML that you just saved in the previous step. You will need to have an XSLT file that contains the following XSL. Be sure to change the <xsl:for-each select=”/NewDataSet/Table1”> to the node structure of your provider. NewDataSet/Table1 is the default node structure for a SharePoint Data Provider. NewDataSet/Data is the default node structure for an External Data Provider. Be sure to reference your actual provider for its node structure.
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" indent="yes" standalone="yes" />
<xsl:template match="/">
<xsl:for-each select="/NewDataSet/Table1">
[Insert Word XML Here]
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
4) Now you cut and paste the Word XML into this XSL file. You don’t need the xml declarations at the top. So just highlight everything except the first two lines and insert into the XSL file a the appropriate location where you see [Insert Word XML Here] in the code snippet in the previous step. Save your XSLT file.
Word XML file:

XSLT file after copy and paste:

5) Now replace all your placeholders in the XSLT that came over from your Word XML with the appropriate xsl statement for selecting values in your provider. Once you have replaced all your placeholders and saved the file, you’re ready to move on to the next step.


6) If you are using a SharePoint Data Provider, you will need to create a Mashup Adapter that uses your provider and applies the XSLT file you created in the previous steps. If you don’t know how to create a Mashup Adapter, there are articles in the community on how to do this. Note: this step can be eliminated in the 1.5 release of the Toolset. The SharePoint Data Provider prior to 1.5 is not outputting the encoding XML declaration that is required by Word ML to process correctly. If you are reading and using Toolset 1.5, you can skip this step.
7) If you are using an External Data Provider or the SharePoint Data Provider starting with version 1.5, you will need to complete this step.
If you’re using a SharePoint Data Provider, create an external data provider HTTP Post connection that references your provider.
<Data>
<Name>EmployeeOnBoarding</Name>
<Default>false</Default>
<ConnectionType>HTTP Post</ConnectionType>
<HttpPostURI>Insert URL to your SharePoint Data Provider</HttpPostURI>
<UseCurrentUserCredentials>2</UseCurrentUserCredentials>
<UserName>%CWUserID%</UserName>
<Password>%CWPassword%</Password>
<XslStylesheetLocation>Insert URL to your XSLT file created in step 4</XslStylesheetLocation>
<OutputType>application/msword</OutputType>
</Data>
Reference the URL to your SharePoint Data Provider in the HttpPostURI node.
In the XslStylesheetLocation Node, you will reference the URL for the XSLT file you create in step 4.
The OutputType node tells SharePoint to treat the output of this provider connection as a MS Word document. So rather than opening the aspx page for the provider as XML, it will invoke MS Word. There are a number of content types that can be used here. There will be a separate list of these content types posted to the community at a later time.
If you are using an External Data Provider to grab your employee details, you would just need to add the XslStylesheetLocation node and OutputType node as they are above into that connection.
Provider output without the OutputType node applied.

When you add the OutputType node, the provider will invoke MS Word.

You have successfully setup a Toolset provider to create MS Word documents. Imagine the possibilities. Of course, you need to implement this provider in a user display like a grid. So when they click on an employee, it leverages your provider to create the MS Word document. There are some helpful articles in the community on how to do this.
Posted by Rodney Fickas on 17-Jul-09
With the new Chart Display Adapter in the Toolset, a useful functionality is ability to click on a chart and drilldown to view more specific information. In this example, we have a Pie Chart that is representing sales for an employee for the months of March and April. Our pie chart rolls up the monthly sales into one figure, but we may want to see the individual sales for the specific month, so we’ll configure our CDA to let us retrieve that detailed information.
First, let’s review our data set we are using. We start with our base data that we retrieved through our External Data Provider, which returns us all of our detailed information (Employee, SalesMonth, GrossSales). To help out our CDA, we use a Business Data Analysis Adapter to roll up our data and pass it to the CDA in a format that makes more sense for our charting needs.
A quick look at our Analysis Adapter settings…
For our Setup Properties:
URL to XML is pointing to our External Data Provider:
<%SiteURL%>/DataSource/SalesDP.aspx
Convert XML is set to convert GrossSales to a decimal datatype so we can do our calculation:
<Convert>
<Column>
<ColumnName>GrossSales</ColumnName>
<ColumnType>System.Decimal</ColumnType>
</Column>
</Convert>
Output as XML is checked
For the Dynamic Group Properties:
Group Column Name is set to SalesMonth, since we want to group sales by month
Group Filter Template is set to
[<%Group%>]=’<%GroupName%>’
Expression for Analysis is set to Sum(GrossSales), for our rollup
Now let’s take a look at our chart and how we’re going to configure it for the drilldown…
Let’s rundown the various properties we need to configure and we’ll point out the one’s that will allow the drilldown to happen.
Setup Properties
We need to configure our URL To XML and Add Column XML.
URL To XML points to our Business Data Analysis Adapter:
<%SiteURL%>/DataSource/ChartAnalysis.aspx
Add Column XML – In order for our chart to accept the NavigateToURL property setting, which defines the data property setting for the DataActionType required by the CDA, but to set this property it has to be done by adding an additional column and pointing the setting node back to our added column. We’ll also setup the URL for our drilldown, which defines the DataActionURL property in the data settings, so we need to add a couple columns to the settings of our chart:
<Columns>
<Column>
<ColumnName>NavigateToURL</ColumnName>
<ColumnType>System.String</ColumnType>
<Expression>’NavigateToURL’</Expression>
</Column>
<Column>
<ColumnName>URL</ColumnName>
<ColumnType>System.String</ColumnType>
<Expression>’http://www.myportal.com/mysite/SalesDetail.aspx?SalesMonth=’+[Group Name]</Expression>
</Column>
</Columns>
Notice that our URL column has the expression of the address to our SalesDetail page, which has a Grid Display Adapter configured to go against our SalesDP External Data Provider and has SalesMonth as a PassThrough parameter. The [Group Name] is how we reference the value from the chart that we want to pass on to our SalesDetail page, the [Group Name] is set in our data settings (below).
Data Properties
Here we will configure our Data Settings, some general settings required for our chart.
<d>
<setup>
<Table1>Table1</Table1>
<Type>Pie</Type>
<Name>Series1</Name>
<DataName>Group Name</DataName>
<DataY>Group Value</DataY>
<DataActionType>NavigateToURL</DataActionType>
<DataActionURL>URL</DataActionURL>
</setup>
</d>
Notice, that the value of the DataActionType and DataActionURL reference the names of the columns that we added up in the Add Column XML property.
Some other settings that we have configured for our chart are in the Chart Format Properties section which will set our labels, chart type, animation etc.
Chart Format Properties
Chart Display Settings – setting up the chart header
<chart_settings>
<title enabled=”true” padding=”15”>
<text>Sales Status</text>
</title>
</chart_settings>
Chart Setup – setting animation and the chart type
<c>
<s>
<EnableAnimation>true</EnableAnimation>
<Type>Pie</Type>
</s>
</c>
Data Plot Settings – which set our labels for our chart
<data_plot_settings enable_3d_mode=”false”>
<pie_series>
<tooltip_settings enabled=”true”>
<format>{%Name} {%Value}{numDecimals:0}</format>
</tooltip_settings>
<label_settings enabled=”true” mode=”Outside” multi_line_align=”Center”>
<background enabled=”false” />
<position anchor=”Center” valign=”Center” halign=”Center” padding=”20” />
<format>{%Name} {%Value}{numDecimals:0}</format>
<font bold=”False” />
</label_settings>
<connector color=”Black” opacity=”0.4” />
</pie_series>
</data_plot_settings>
So now that we have the chart setup for our drilldown and all the other properties configured, when we click on a piece of the pie, we’ll get a new window displaying our drilled-down information for our sales data.
Hopefully, you will find drilling down into the chart for more detailed information in your solutions… happy coding!
Posted by Kevin Dager on 17-Jun-09
During a recent customer engagement, I was asked to help customize the Rich Text Field (RTF) available in the Toolset. The following customizations are available whether you are using the RTF in a Business Data Form Adapter (BDF) or in a list or library.
The customer wanted to customize the tool options and configure a default font type and font size for RTF being configured in several of their BDF forms.
Below is a screenshot of how they wanted the RTF control customized.

You will notice that there are less tool options than what the out of the box RTF control comes configured with. The customer wanted to also set the font type and font size while removing the ability to change it within the UI. In this example, it’s been configured to use Times New Romans and 24pt font.
Here are the steps for configuring the RTF to look as it does in the above image.
1) Create an XML file for the tool options being configured.
<?xml version="1.0" encoding="utf-8" ?>
<root>
<tools>
<tool name="AjaxSpellCheck"/>
<tool separator="true"/>
<tool name="Bold"/>
<tool name="Italic"/>
<tool name="Underline"/>
<tool separator="true"/>
<tool name="JustifyLeft"/>
<tool name="JustifyCenter"/>
<tool name="JustifyRight"/>
<tool separator="true"/>
<tool name="InsertOrderedList"/>
<tool name="InsertUnorderedList"/>
<tool separator="true"/>
<tool name="Outdent"/>
<tool name="Indent"/>
<tool separator="true"/>
</tools>
</root>
If you look at the image above, you will notice the correlation between the options being configured in the XML file and what appears in the UI.
2) This file must be placed on the server in the following path. And needs to be placed on each SharePoint WFE.

3) Create a CSS file for the font type and font size desired.
body
{
font-family: Times New Roman;
font-size: 8pt;
}
4) Upload the CSS file into a document library.
5) Configure your RTF controls in your BDF form file to use these files.

The image above shows how you need to configure the RTF control in your BDF form file. Note the <ToolFileLocation> node and the <ContentAreaCssFile> node.
The CSS file can not be located in a virtual directory but needs to be in an actual document library and then referenced in the RTF control configuration as noted above.
Each RTF control can have different configuration options by implementing different Tool files and CSS files. You can implement just a Tools file and not use the CSS file at all. The options are up to your implementation requirements.
Posted by Rodney Fickas on 12-Jun-09
The External Data Provider is THE Swiss Army knife of the Toolset. Sure it connects to your external data, but did you realize all the connection types it supports and the possible properties you can specify with each? During this blog series we’ll cover all the connection types, the properties associated with them and also provide examples for you to reference going forward. This article assumes you have seen a connection file before and understand its format of an opening & closing <CorasWorks> parent element with each connection being stored as a <Data> element within.
This final article in the series will cover two topics actually – the File connection type and the aggregate properties that can be used when “mashing up” data via the External Data Adapter.
A connection type of File, as the name implies, is for when you simply want to connect to a file containing XML data. If the file in question is in a web accessible location, this connection will actually work the same way as if you created an HTTP Post connection to the URL of the file. However, imagine a situation where you have an XML file on a network share. Perhaps you have some legacy or archived data; or it’s a secured application in where you only need periodic data dumps from a secured source you cannot or do not want to tap directly into.
With the File connection type, you can place that XML file on any network resource accessible (from the perspective of the SharePoint server) and pull it in as if it were any other connection type. Update the file in its location; see the results in your SharePoint applications.
The File connection type rivals the HTTP Post in its simplicity. A connection could be as basic as:
|
<Data>
<Name>YourConnectionName</Name>
<Default>True/False</Default>
<ConnectionType>File</ConnectionType>
<FileLocation>Path </FileLocation>
</Data>
|
Your path is then simply a URL, like in an HTTP Post connection, or it can be a UNC network path such as “\\ServerName\SharedFolder\MyXMLFile.xml”. Once you’ve connected to that XML file on your network or out on the web, you have the familiar properties from the other connection types available as well.
They are:
|
Property Name / Element
|
Property Use / Function
|
|
<Values>
|
The Values element simply holds empty child nodes representing each and every parameter that you wish to pass into this connection. Thus, if you plan to pass in a parameter called “Department” into your connection, you would need a self-closing <Department /> element inside your <Values></Values> elements. This is to let the connection know to look for a GET/POST param with the name specified. There’s no limit to the number of params.
|
|
<OutputType>
|
Default is “text/xml” however “text/html” & ”text/plain” are also supported.
|
|
<XslStylesheet>
|
Actual XSL to transform the response from your Provider. However, it is recommended to use an attached stylesheet (see next property) as opposed to including your XSL in line here.
|
|
<XslStylesheetLocation>
|
The URL to the location of an XSL stylesheet (can be .xml, .xsl or .xslt) to be applied for transforming the Provider response. This transform occurs *before* the data is rendered or passed on to another component.
|
|
<ErrorRedirect>
|
A URL to redirect a user/connection to when the connection called results in an error.
|
|
<ReportErrors>
|
A true/false flag to indicate whether errors are reported. If set to “true”, and an <ErrorRedirect> is specified, the error message will be attached to the redirect URL as: ErrorRedirectURL?Error=(Error Message)
|
|
<RedirectTo>
|
The URL to redirect this connection to upon successful completion. This is the ability to take the response from one connection and instantly pass it into another to complete a process or validate a response. If you specify a parameter in the RedirectTo, you can pass the value of the initial connection using a pre-defined variable called %Data%.
Ex. http://site.net/subsite/providers/ADO.aspx?
ConnectionName=SecondConnection&FirstValue=%Data%
|
|
<RDConnection>
|
The URL to pass the results of this connection into. This is different than a <RedirectTo> which literally forwards the request on to a new page/connection. With an <RDConnection>, the results of the first connection are passed into a second connection for use in processing said connection, and the results of the second connection are then returned to the first one. This is most useful when needing to send a collection of XML into a second connection since, with the RedirectTo, the entire response of the first connection is passed via query string variable; see the next property for setting the XML elements you wish to post into the second connection.
|
|
<RDConnectionPost>
|
A property for specifying (via XPath) the XML results from your first connection that you wish to post into a second connection, as well as the parameter names to use when posting them. The <RDConnectionPost> also supports setting a default value to pass for a parameter, should the XPath for the parameter value not exist within the first connection’s result.
|
|
<CacheOutput>
|
A true/false value indicating whether or not the output from this connection should be cached. If set to “true”, you can use the following three properties to customize the cache label and/or duration. Absent any of the following properties, the default label will be TheConnectionName+”Output”+WebPartID with a duration of 200 mins.
|
|
<CacheLabel>
|
A text value to specify the cache label; if not specified, the default Web Part ID will be used for this portion of the cache identifier.
|
|
<CacheAddUserID>
|
A true/false value indicating whether or not to add the ID of the user running the connection to cache label; this is akin to a cache per user mechanism. If set to “true” the User’s ID will be added to the end of the cache label.
|
|
<CacheDuration>
|
An integer value indicating the cache duration in minutes.
|
Finally, I’ll share some properties that can reside outside your individual connections (i.e. outside your <Data> elements) which we call the aggregate properties. A handy capability of the External Data Provider is that you can actually do mashups with it. It doesn’t provide all the feature/functions of the dedicated Mashup Adapter, but for quick & simple vertical mashups, it can often fit the need in short order.
To perform a “mashup” with the EDP, simply create a connection file that (a) has one or more connections set as the default and (b) has one or more connections with the same name. If both these conditions are met, the EDP will make all the connections listed and output their aggregate result as a vertical mashup.
In doing so, we’ve then provided some aggregate properties that you can set for the behavior/handling of the aggregate data returned. Many work just like the similarly named properties within a given connection type, they’re simply applied at the macro level.
These aggregate properties are:
|
Property Name / Element
|
Property Use / Function
|
|
<AggregateOutputType>
|
Default is “text/xml” however “text/html” & ”text/plain” are also supported.
|
|
<AggregateXSL>
|
Actual XSL to transform the aggregate response from your Provider. However, it is recommended to use an attached stylesheet (see next property) as opposed to including your XSL in line here.
|
|
<AggregateXSLLocation>
|
The URL to the location of an XSL stylesheet (can be .xml, .xsl or .xslt) to be applied for transforming the aggregate Provider response. This transform occurs *before* the data is rendered or passed on to another component.
|
|
<AggregateRedirectTo>
|
The URL to redirect this connection to upon successful completion. This is the ability to take the aggregate response from your connections and instantly pass it into another to complete a process or validate a response. If you specify a parameter in the RedirectTo, you can pass the value of the initial connections using a pre-defined variable called %Data%.
Ex. http://site.net/subsite/providers/ADO.aspx?
ConnectionName=SecondConnection&FirstValue=%Data%
|
|
<CacheOutput>
|
A true/false value indicating whether or not the aggregate output from this connection should be cached. If set to “true”, you can use the following three properties to customize the cache label and/or duration. Absent any of the following properties, the default label will be TheConnectionName+”Output”+WebPartID with a duration of 200 mins.
|
|
<CacheLabel>
|
A text value to specify the aggregate cache label; if not specified, the default Web Part ID will be used for this portion of the cache identifier.
|
|
<CacheAddUserID>
|
A true/false value indicating whether or not to add the ID of the user running the aggregate connections to cache label; this is akin to a cache per user mechanism. If set to “true” the User’s ID will be added to the end of the cache label.
|
|
<CacheDuration>
|
An integer value indicating the aggregate cache duration in minutes.
|
Wrapping up the series, you can download a sample connection file for a File connection, as well as an example of a connection file employing aggregate properties, from the Building Block Exchange section of the CorasWorks Community forum here.
We hope this series has proven useful in opening your eyes to all the possibilities in the EDP. Check back soon for a related post on the EDP’s newest (Toolset v1.4 & later) capability; two-way support for Binary data in your ADO connections.
The External Data Provider is THE Swiss Army knife of the Toolset. Sure it connects to your external data, but did you realize all the connection types it supports and the possible properties you can specify with each? During this blog series we’ll cover all the connection types, the properties associated with them and also provide examples for you to reference going forward. This article assumes you have seen a connection file before and understand its format of an opening & closing <CorasWorks> parent element with each connection being stored as a <Data> element within.
This article will focus on the dark horse of the EDP connections, that oldie but a goodie – the HTTP Post.
Whether it’s a classic web-based application or a web 2.0 mash-up integrating external services like RSS Feeds, Twitter, Facebook & more, the HTTP Post connection allows you to interact with data that’s local or out on the web that may not be in a traditional database or addressable via web service. Especially with RSS feeds and, more recently, social networking sites, the HTTP Post connection type makes it easy to grab data that is already being served out as XML. Add in the ability to post parameters in as well, and you have two-way interaction.
Let’s look at the basic requirements for a successful HTTP Post connection:
|
<Data>
<Name>YourConnectionName</Name>
<Default>True/False</Default>
<ConnectionType>HTTP Post</ConnectionType>
<HttpPostURI>URLtoData</HttpPostURI >
</Data>
|
As you can see, it’s certainly the easiest of the connection types. As long as your “URLtoData” is a web page outputting XML, such as an RSS feed or even a Toolset Provider sitting on another SharePoint farm, you can now bring that data into the local SharePoint environment and use it within your applications.
I also alluded to interacting with external data sources through HTTP Post connections. One recent example of this is a “Twitter Dashboard” we built; within it, we’re both aggregating the latest Tweet from a series of users we wanted to track as well as enabling users to make changes and post new Tweets to their Twitter account, all without ever leaving their SharePoint site.
Listed here are all the optional properties for use with an HTTP Post connection; just like a web service connection, <ProtocolVersion> is available here as well, in addition to the HTTP Post-specific properties <ContentType> and <Parameters>:
|
Property Name / Element
|
Property Use / Function
|
|
<ProtocolVersion>
|
Some HTTP Post connections require using the 1.0 protocol. If you get a protocol error when attempting an HTTP Post connection, use the <ProtocolVersion> property with the value “Version10”.
|
|
<ContentType>
|
The Content-Type to specify within the header of the HTTP Post request. The default value is “application/x-www-form-urlencoded”. Only use this property if needing to specify a different Content-Type.
|
|
<Parameters>
|
Like the <Values> element, the <Parameters> element is used to specify values being passed in and/or used by this connection. With the <Parameters> element however, you’re actually defining the value of the parameter being sent to your HTTP Post connection. Thus, if you wanted to post a parameter called “MyName” to your HTTP Post connection, you would have an element called <MyName> inside your <Parameters></Parameters> elements and you would set its value there. An example would be <MyName>My name is %CWUserName%</MyName> where I’m actually combining hard-coded text along with a variable or value passed into my connection.
|
|
<Values>
|
The Values element simply holds empty child nodes representing each and every parameter that you wish to pass into this connection. Thus, if you plan to pass in a parameter called “Department” into your connection, you would need a self-closing <Department /> element inside your <Values></Values> elements. This is to let the connection know to look for a GET/POST param with the name specified. There’s no limit to the number of params.
|
|
<OutputType>
|
Default is “text/xml” however “text/html” & ”text/plain” are also supported.
|
|
<XslStylesheet>
|
Actual XSL to transform the response from your Provider. However, it is recommended to use an attached stylesheet (see next property) as opposed to including your XSL in line here.
|
|
<XslStylesheetLocation>
|
The URL to the location of an XSL stylesheet (can be .xml, .xsl or .xslt) to be applied for transforming the Provider response. This transform occurs *before* the data is rendered or passed on to another component.
|
|
<ErrorRedirect>
|
A URL to redirect a user/connection to when the connection called results in an error.
|
|
<ReportErrors>
|
A true/false flag to indicate whether errors are reported. If set to “true”, and an <ErrorRedirect> is specified, the error message will be attached to the redirect URL as: ErrorRedirectURL?Error=(Error Message)
|
|
<RedirectTo>
|
The URL to redirect this connection to upon successful completion. This is the ability to take the response from one connection and instantly pass it into another to complete a process or validate a response. If you specify a parameter in the RedirectTo, you can pass the value of the initial connection using a pre-defined variable called %Data%.
Ex. http://site.net/subsite/providers/ADO.aspx?
ConnectionName=SecondConnection&FirstValue=%Data%
|
|
<RDConnection>
|
The URL to pass the results of this connection into. This is different than a <RedirectTo> which literally forwards the request on to a new page/connection. With an <RDConnection>, the results of the first connection are passed into a second connection for use in processing said connection, and the results of the second connection are then returned to the first one. This is most useful when needing to send a collection of XML into a second connection since, with the RedirectTo, the entire response of the first connection is passed via query string variable; see the next property for setting the XML elements you wish to post into the second connection.
|
|
<RDConnectionPost>
|
A property for specifying (via XPath) the XML results from your first connection that you wish to post into a second connection, as well as the parameter names to use when posting them. The <RDConnectionPost> also supports setting a default value to pass for a parameter, should the XPath for the parameter value not exist within the first connection’s result.
|
|
<CacheOutput>
|
A true/false value indicating whether or not the output from this connection should be cached. If set to “true”, you can use the following three properties to customize the cache label and/or duration. Absent any of the following properties, the default label will be TheConnectionName+”Output”+WebPartID with a duration of 200 mins.
|
|
<CacheLabel>
|
A text value to specify the cache label; if not specified, the default Web Part ID will be used for this portion of the cache identifier.
|
|
<CacheAddUserID>
|
A true/false value indicating whether or not to add the ID of the user running the connection to cache label; this is akin to a cache per user mechanism. If set to “true” the User’s ID will be added to the end of the cache label.
|
|
<CacheDuration>
|
An integer value indicating the cache duration in minutes.
|
No to be left out, you can download a sample connection file for an HTTP Post connection from the Building Block Exchange section of the CorasWorks Community forum here.
Check back next week for the final post, Part 4 in the series, where we wrap up the secondary connection types and the aggregate properties.
The External Data Provider is THE Swiss Army knife of the Toolset. Sure it connects to your external data, but did you realize all the connection types it supports and the possible properties you can specify with each? During this blog series we’ll cover all the connection types, the properties associated with them and also provide examples for you to reference going forward. This article assumes you have seen a connection file before and understand its format of an opening & closing <CorasWorks> parent element with each connection being stored as a <Data> element within.
This article will focus on my favorite connection type for building web 2.0 and enterprise mashup applications – Web Services.
When creating a web service connection type, effectively what we’re doing is telling our External Data Provider which web service to call through its documented endpoint and passing in the SOAP Action and Envelope for the web service method (also called operation) you want to execute.
Let’s look at a sample web service method provided out-of-the-box in SharePoint. This screenshot shows the details for the “GetUserInfo” operation of the “Users and Groups” web service in SharePoint. You can access this same page on any SharePoint environment (WSS v3 or MOSS) by appending the following to any Site’s URL: /_vti_bin/usergroup.asmx?op=GetUserInfo. You can also leave off the “?op=…” portion to see all the operations the User and Groups web service supports.
First, let’s briefly decode what we’re looking at – and need – from this web service. The key here is that just about any data source that supports SOAP web services, be it SharePoint, Dynamics CRM or even commercial web services like those offered by companies such as CDYNE, will have a page and/or documentation like this. For CorasWorks Data Integration Toolset customers, this means calling a web service is as easy as copy-pasting the three highlighted sections you see above.
In terms of your connection setup, the yellow text represents the Request URI, the orange your SOAP Action and the green section your SOAP Envelope. Let’s now see how this looks inside a Toolset web service connection; the sample below is for the web service method in the screenshot above.
|
<Data>
<Name>YourConnectionName</Name>
<Default>True/False</Default>
<ConnectionType>WebService</ConnectionType>
<Request>http://YourSite/_vti_bin/usergroup.asmx</Request>
<SOAP>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetUserInfo xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
<userLoginName>%CWUserName%</userLoginName>
</GetUserInfo>
</soap:Body>
</soap:Envelope>
</SOAP>
<SOAPAction>http://schemas.microsoft.com/sharepoint/soap/directory/GetUserInfo</SOAPAction>
</Data>
|
This is all you need in a connection to begin working with web services. You may notice that I left the “?op=” part off of my request URI; this is fine because, by virtue of my SOAP Action and envelope, the web service knows which method to execute. And don’t forget; a web service connection supports all the EDP variables and parameter replacement options an ADO connection does. In our example here, I’m using the EDP variable %CWUserName% to dynamically pass in the username of the currently logged in user when this connection is run.
And just like an ADO connection, here are all the optional properties you can set with a Web Service connection; the only ones not available on an ADO connection, are <ProtocolVersion> and <DecodeXML>:
|
Property Name / Element
|
Property Use / Function
|
|
<ProtocolVersion>
|
Some older SOAP web services require the HTTP connection to be made via protocol 1.0. For these, use the <ProtocolVersion> property with the value “Version10”. You do not need to use this property unless you get an error in your EDP that the protocol version is wrong; the default value is “Version11”.
|
|
<DecodeXML>
|
Set this property to “True” if your web service call is returning XML embedded inside a single element. Otherwise, the default value is “False”.
|
|
<OutputType>
|
Default is “text/xml” however “text/html” & ”text/plain” are also supported.
|
|
<XslStylesheet>
|
Actual XSL to transform the response from your Provider. However, it is recommended to use an attached stylesheet (see next property) as opposed to including your XSL in line here.
|
|
<XslStylesheetLocation>
|
The URL to the location of an XSL stylesheet (can be .xml, .xsl or .xslt) to be applied for transforming the Provider response. This transform occurs *before* the data is rendered or passed on to another component.
|
|
<ErrorRedirect>
|
A URL to redirect a user/connection to when the connection called results in an error.
|
|
<ReportErrors>
|
A true/false flag to indicate whether errors are reported. If set to “true”, and an <ErrorRedirect> is specified, the error message will be attached to the redirect URL as: ErrorRedirectURL?Error=(Error Message)
|
|
<RedirectTo>
|
The URL to redirect this connection to upon successful completion. This is the ability to take the response from one connection and instantly pass it into another to complete a process or validate a response. If you specify a parameter in the RedirectTo, you can pass the value of the initial connection using a pre-defined variable called %Data%.
Ex. http://site.net/subsite/providers/ADO.aspx?
ConnectionName=SecondConnection&FirstValue=%Data%
|
|
<RDConnection>
|
The URL to pass the results of this connection into. This is different than a <RedirectTo> which literally forwards the request on to a new page/connection. With an <RDConnection>, the results of the first connection are passed into a second connection for use in processing said connection, and the results of the second connection are then returned to the first one. This is most useful when needing to send a collection of XML into a second connection since, with the RedirectTo, the entire response of the first connection is passed via query string variable; see the next property for setting the XML elements you wish to post into the second connection.
|
|
<RDConnectionPost>
|
A property for specifying (via XPath) the XML results from your first connection that you wish to post into a second connection, as well as the parameter names to use when posting them. The <RDConnectionPost> also supports setting a default value to pass for a parameter, should the XPath for the parameter value not exist within the first connection’s result.
|
|
<Values>
|
The Values element simply holds empty child nodes representing each and every parameter that you wish to pass into this connection. Thus, if you plan to pass in a parameter called “Department” into your connection, you would need a self-closing <Department /> element inside your <Values></Values> elements. This is to let the connection know to look for a GET/POST param with the name specified. There’s no limit to the number of params.
|
|
<CacheOutput>
|
A true/false value indicating whether or not the output from this connection should be cached. If set to “true”, you can use the following three properties to customize the cache label and/or duration. Absent any of the following properties, the default label will be TheConnectionName+”Output”+WebPartID with a duration of 200 mins.
|
|
<CacheLabel>
|
A text value to specify the cache label; if not specified, the default Web Part ID will be used for this portion of the cache identifier.
|
|
<CacheAddUserID>
|
A true/false value indicating whether or not to add the ID of the user running the connection to cache label; this is akin to a cache per user mechanism. If set to “true” the User’s ID will be added to the end of the cache label.
|
|
<CacheDuration>
|
An integer value indicating the cache duration in minutes.
|
Just like yesterday’s post on making an ADO connection, you can download a sample connection file for a web service connection from the Building Block Exchange section of the CorasWorks Community forum here.
Check back tomorrow for Part 3 in the series – HTTP Post connections.
The External Data Provider is THE Swiss Army knife of the Toolset. Sure it connects to your external data, but did you realize all the connection types it supports and the possible properties you can specify with each? During this blog series we’ll cover all the connection types, the properties associated with them and also provide examples for you to reference going forward. This article assumes you have seen a connection file before and understand its format of an opening & closing <CorasWorks> parent element with each connection being stored as a <Data> element within.
So, without delay, let’s look at the first (and most common) connection type – ADO.
The ADO connection type is the method you’ll use when connecting to most traditional databases and legacy systems. Generally speaking, any data source that supports an OLEDB or ODBC connection has a connection string that can be used for accessing that data source. The most comprehensive listing of these connection strings can be found online at www.ConnectionStrings.com; when on the site, look for the “ADO” or “ADO.Net” version of a connection string for your data source. You can also find connection string details within a source’s documentation or SDK.
When creating an ADO connection, there are two properties specific to an ADO connection type: <ConnectionString> and <Query>. As with all connections, you will also need a <Name>, <Default> and <ConnectionType> property.
Thus, an ADO connection can be as basic as:
|
<Data>
<Name>YourConnectionName</Name>
<Default>True/False</Default>
<ConnectionType>ADO</ConnectionType>
<ConnectionString>YourConnectionString</ConnectionString>
<Query>Your SFW Query</Query>
</Data>
|
Now, let’s look at some of the additional properties that are optional for an ADO connection:
|
Property Name / Element
|
Property Use / Function
|
|
<OutputType>
|
When omitted, the default is “text/xml” however “text/html” and ”text/plain” are also supported
|
|
<XslStylesheet>
|
Actual XSL to transform the response from your Provider. However, it is recommended to use an attached stylesheet (see next property) as opposed to including your XSL in line here.
|
|
<XslStylesheetLocation>
|
The URL to the location of an XSL stylesheet (can be .xml, .xsl or .xslt) to be applied for transforming the Provider response. This transform occurs *before* the data is rendered or passed on to another component.
|
|
<ErrorRedirect>
|
A URL to redirect a user/connection to when the connection called results in an error.
|
|
<ReportErrors>
|
A true/false flag to indicate whether errors are reported. If set to “true”, and an <ErrorRedirect> is specified, the error message will be attached to the redirect URL as: ErrorRedirectURL?Error=(Error Message)
|
|
<RedirectTo>
|
The URL to redirect this connection to upon successful completion. This is the ability to take the response from one connection and instantly pass it into another to complete a process or validate a response. If you specify a parameter in the RedirectTo, you can pass the value of the initial connection using a pre-defined variable called %Data%.
Ex. http://site.net/subsite/providers/ADO.aspx?
ConnectionName=SecondConnection&FirstValue=%Data%
|
|
<RDConnection>
|
The URL to pass the results of this connection into. This is different than a <RedirectTo> which literally forwards the request on to a new page/connection. With an <RDConnection>, the results of the first connection are passed into a second connection for use in processing said connection, and the results of the second connection are then returned to the first one. This is most useful when needing to send a collection of XML into a second connection since, with the RedirectTo, the entire response of the first connection is passed via query string variable; see the next property for setting the XML elements you wish to post into the second connection.
|
|
<RDConnectionPost>
|
A property for specifying (via XPath) the XML results from your first connection that you wish to post into a second connection, as well as the parameter names to use when posting them. The <RDConnectionPost> also supports setting a default value to pass for a parameter, should the XPath for the parameter value not exist within the first connection’s result.
|
|
<Values>
|
The Values element simply holds empty child nodes representing each and every parameter that you wish to pass into this connection. Thus, if you plan to pass in a parameter called “Department” into your connection for use in your query, you would need a self-closing <Department /> element inside your <Values></Values> elements. This has the effect of letting the connection know to look for a GET/POST parameter with the name specified. There is no limit to the number of parameters you can list here.
|
|
<CacheOutput>
|
A true/false value indicating whether or not the output from this connection should be cached. If set to “true”, you can use the following three properties to customize the cache label and/or duration. Absent any of the following properties, the default label will be TheConnectionName+”Output”+WebPartID with a duration of 200 mins.
|
|
<CacheLabel>
|
A text value to specify the cache label; if not specified, the default Web Part ID will be used for this portion of the cache identifier.
|
|
<CacheAddUserID>
|
A true/false value indicating whether or not to add the ID of the user running the connection to cache label; this is akin to a cache per user mechanism. If set to “true” the User’s ID will be added to the end of the cache label.
|
|
<CacheDuration>
|
An integer value indicating the cache duration in minutes.
|
And just to make it all easier to hit the ground running, you can download a sample connection file with an ADO connection from the Building Block Exchange section of the CorasWorks Community forum here.
Check back tomorrow for Part 2 in the series – Web Service connections.
This series of screenshots and comments will help you implement a master-detail grid solution using the Toolset. The instructions assume you know how to create providers for the grid displays that will accept passed in parameters for filtering the provider. (If you need more information on this, you can reference this document.)
Note: screenshots have been redacted to protect sensitive data.
Top grid displays technical specifications. When you click on the Documents icon, the bottom grid will display related documents for that specific technical specification.

This screenshot shows the loading icon when documents are loading in the grid after clicking on the Documents icon in the top grid.

This screenshot shows the related documents after the grid loads.

To implement this place a grid on your page that loads master items. We will later return to what you need to add to this grid display to create the Documents icon which provides the interaction between it and the documents grid.

Now create a web part page that has nothing but web part zones. Place a grid display on this page for the related documents. Configure it for passthrough. In the example below, it’s looking for a single passthrough parameter called TSN.

<PT><P><PTType>post</PTType><PTRequest>TSN</PTRequest><PTName>TSN</PTName></P></PT>
Now place a Page Utility web part on the same page as your master (parent) grid. Configure it to load the page with your child grid. In our case, this was the web part page with the Related Documents grid. Note the name in our example - RelatedDocs.

<PageLoad>
<Setup>
<Name>RelatedDocs</Name>
<Id>RelatedDocs</Id>
<Width>100%</Width>
<Height>390</Height>
<Src>http://devrapps.corasworks.net/rfdev/hapts/Toolset/TSDocs.aspx</Src>
<FrameBorder>0</FrameBorder>
</Setup>
</PageLoad>
At this point, there is a main grid for displaying Technical Specifications. And a Page Utility with a second grid display for displaying Related Documents that has been configured to accept a passthrough parameter.
The only remaining step is to add a new column to our Technical Specifications grid for the Documents icon. When the user clicks on the icon, it will load the Page Utility with a reference to the web part page with the Related Documents grid display. And it will pass in the TSN.

The Add Column XML for the Documents icon is provided below. The main take away from this step is the javascript function for reloading the Page Utility. By appending the name of your Page Utility (RelatedDocs) to the function WTFrameSetter, you can invoke the reloading function. WTFrameSetter is a built-in function in the Page Utility that allows you to reload the source URL.
Notice in the Add Column XML that we are concatenating the Technical Specification Number to the end of the page URL.

CorasWorks has been using a new verb lately, Jing. This new concept has allowed us to quickly create a how-to, walk through, and demo. Since we have captured so much, we figured perhaps you would be interested in getting access to a continuous feed of them, so here are some RSS links to help.
Toolset How-To RSS Feed
http://www.screencast.com/users/CorasWorks/folders/Toolset%20Captures/rss
Suite How-To RSS Feed
http://www.screencast.com/users/CorasWorks/folders/Suite%20Captures/rss
Community Walk Through RSS Feed
http://www.screencast.com/users/CorasWorks/folders/Community%20Resources/rss
Demo RSS Feed
http://www.screencast.com/users/CorasWorks/folders/Demo%20Scripts/rss
Jing is a free software that adds visuals to your online conversations. Learn more at http://www.jingproject.com/.
|
|