Data Viewer Web Part 2013 (Beta) from Lightning Tools

Lightning Tools Data Viewer Web PartI don’t have much to say about this new tool from Lightning Tools yet, but it sure does looks promising. Lighting Tools makes good stuff in general, so I’m sure it’s going to work well. If I can get my hands on a beta copy and can kick the tires some, I’ll let you know how it looks.

My friend Dan Antion assured me a while back that the The Market Will Save Us when it comes to the missing Design and Split Views in SharePoint Designer 2013, and perhaps this is the first firm indication that he’s right. (Of course he’s right – Dan’s a smart guy.)

In case you aren’t aware, there are Changes to the Design View in SharePoint Designer 2013. Changes in the sense that it’s not there any more. I’ve been whining and complaining about this for a long time, as it removes significant power from the citizen developers who tend to make SharePoint truly useful. All that is basically moot at this point, since SharePoint Designer 2013 RTM is now available and it certainly doesn’t have Design or Split Views. Oddly, it still has buttons on the ribbon that make no sense without these views, like Skewer Click, which is odd since there’s nothing to skewer!Skewer Click in SharePoint Designer 2013

So we have to figure out What’s Next, and tools like this one from Lightning Tools are probably going to be the answer. Who know.s, maybe this was what Microsoft has intended all along, letting third parties effectively take over maintenance of their free SharePoint Designer prodiuct, since it doesn’t generate any revenue for them anymore.

Here are some details lifted straight from from the Lightning Tools site. I’m sure thet they will change  – probably for the better – as things move outta beta.

Data Viewer Web Part 2013 (Beta)

The Lightning Tools Data Viewer is a web part that can connect to BCS External Content Type, Microsoft SQL, ODBC, Oracle, MS Access,  OData, REST, Classic Web Services, XML, and RSS feeds. Without the use of SharePoint Designer, the web part can be configured within your browser using a configuration wizard. View’s of your data can be built using checkboxes to select columns, Sorting, Filtering, Formatting and Conditional Formatting can all be applied without writing any code. For the coders amongst you, views can also be built using JSON and XSLT.

  • - Easy to Use, but Powerful enough to Display your Business Data
  • - Build database connections and views in minutes
  • - Does not require SharePoint Designer.

From:$TBA per web front end+ Support and Maintenance

SharePoint 2013 Data View

Data View Web Part SharePoint 2013

The Lightning Tools Data View web part provides you with the ability to create views of data from almost any external data source, insert data, edit data, and delete data (assuming the user has the correct permissions). Users can configure the data view web part without the use of SharePoint Designer 2013.

Data View Web Part SharePoint 2013

Using the Data View Web Part for SharePoint 2013, you can configure connections easily using the simple wizard. Simply select the provider and then complete the required fields such as the server name for the SQL server or the URL for the service containing the data.

Data View Web Part SharePoint 2013

The grid view for the web part is configured once the connection has been created. Simply check the columns from the external data source that you wish to display, provide a column alias, grouping, formatting, and alignment. Conditional formatting, aggregate functions and sorting are among the many features that can be applied without the use of SharePoint Designer 2013.

Removing the Default Document Content Type from the Allowed Content Types for a Document Set

I’ve been searching on and off for days on this one. When you create a Content Type based on the Document Set Content Type, it’s fairly common to want to restrict the Content Types which are allowed to be added to the Document Set.

Here’s an example. Say you have a Document Set Content Type called “Analyst Report”. You’d like to only allow documents to be added with the Document-based Content Types “Analyst Report Document” and “Analyst Report Critique”.

SharePoint actually gives you a nice dialog for this in the Document Set Settings. To get to it:

  • Go to Site Settings in the site where you created the Document Set Content Type
  • Click on Site content types
  • Choose the Document Set Content Type you want to work with
  • Click on Document Set settings

Allowing other Content Types is easy: you simply highlight them on the left and click the Add > button. Note that the order in which you do this matters, as the Content Types will be listed under the New Document button in the ribbon in the order in which you add them.

The problem is that you can’t remove the Document Content Type after you add the other Content Types you’d like to allow. When you try to do so, you’ll get this pop up alert:

Given that you’ve just created the Document Set Content Type and you haven’t even made it available in a list anywhere, how can this be? I tried everything I could think of – even blowing away a bunch of content I really didn’t want to blow away – to try to get rid of the darn thing.

I finally found the answer embedded deep in the comments on a post called Document Sets – SharePoint 2010 – Part 1 by Slava Gorbunov, who seems to be based on Sydney, Australia. It’s a good post, in that it gives a nice overview of how Document Sets work. The money was in this comment, though:

Good old Anonymous. I tell you, I’ve learned more form that guy…

Right below the Allowed Content Types section, you’ll see a section headed Default Content.

This provides another cool feature of Document Sets, allowing you to pre-populate them with documents. It’s really useful. The problem is that the way it starts out causes the problem. It looks like there is nothing set, but in fact, the Document Content Type is selected, and there is one “item” listed there.

What you need to do is to click on the Delete button to remove the default item which is displayed.

Then you will see no item listed…

…and you will be able to remove the Document Content Type from the Allowed Content Types.

Thanks again, Anonymous!

SPServices GetListItems Generator Demo Page

Someone asked a question in the SPServices Discussions this morning because they were getting an “Object not found” error. This type of error almost always means that the references to the .js files aren’t correct for your environment. I’ve done a few posts about how to remedy this, most notably Adding jQuery to a SharePoint Page: Step One, Always  and Adding jQuery+SPServices to a SharePoint Page: Step One, Always.

But that question wasn’t the cool part (I probably get at least one “Object not found” question a day”). The cool part was alfred_j_kwack‘s original post. In it, he provided a page you can use to generated SPServices calls to GetListItems just be making some selections on the page. It’s a great little tool for someone who is just getting started with SPServices and wants to see how the calls should be assembled. I probably saw it when he first posted it about a year ago, made a note to do something with it, and then got busy.

I made some tweaks to Alfred’s code to bring it in line with the current versions of jQuery and SPServices, with a little clean up as well, and posted it on my demo site as a new demo page called GetListItemsGenerator.

GetListItemsGenerator

The script uses WebUrlFromPageUrl, SiteDataGetListCollection, and GetList to make things work. Here’s the script, though it’s also available on the demo page.

$(document).ready(function() {

	waitMessage = "</pre>
<img style="display: block; margin-left: auto; margin-right: auto;" src="/_layouts/images/gears_an.gif" alt="" />
<pre>";

	$("form").submit(function(e) {e.preventDefault()});

	$('#inputURL').change(function() {
		//obtain the site's URL inputURL value
		$().SPServices({
			operation: "WebUrlFromPageUrl",
			async: false,
			pageURL: $("#inputURL").val(),
			completefunc: function (xData, Status) {
				$('#siteURL').html($(xData.responseXML).find("WebUrlFromPageUrlResult").text());
			}
		})
		getSiteLists($('#siteURL').text());
	});

	$('#ListSlct').change(function(){
		$("#colSlct").html(waitMessage);
		$().SPServices({
			operation: "GetList",
			webURL: $('#siteURL').text(),
			listName: $(this).val(),
			async: false,
			completefunc: function (xData, Status){
				var outputHTML = "</pre>
"; $(xData.responseXML).find("Fields > Field").each(function(index) { if((index % 6) == 0) { outputHTML += "" };outputHTML +=""; }); outputHTML += "
<table>
<tbody>
<tr>
<td><input type="checkbox" name="" value="+ $(this).attr(" />"+ $(this).attr("DisplayName") +"</td>
</tr>
</tbody>
</table>
<pre>
";
				$("#colSlct").html(outputHTML);
			}
		})
	});
	$('#getSatisfaction').click(function(){
		var qryCAML = "" +n";
		var tableResult = "
" +n"; $('input:checkbox:checked').each(function(){ qryCAML += "tttt"" +n";tableResult += "tttt"" + $(this).attr("ows_"+ this.value+"") + "" +n"; }) qryCAML += "ttt""; tableResult += "ttt"

";
		var resultCode = "";
		resultCode += "var htmlTable = '</pre>
';"; resultCode += "n$().SPServices({"; resultCode += "ntoperation: "GetListItems","; resultCode += "ntasync: false,"; resultCode += "ntlistName: "" + $('#ListSlct').val() + "","; resultCode += "ntwebURL: "" + $('#siteURL').text() + "","; resultCode += "ntCAMLViewFields: "" + qryCAML + "","; resultCode += "ntcompletefunc: function (xData, Status) {"; resultCode += "ntt$(xData.responseXML).SPFilterNode('z:row').each(function() {"; resultCode += "nttthtmlTable += "" + tableResult + "";"; resultCode += "ntt})"; resultCode += "ntthtmlTable += "
<pre>
";";
		resultCode += "nt}";
		resultCode += "n});";
		$('#results').html("<textarea id="resultsCode" rows="20">"+resultCode+"</textarea>");

	});
	//load the default site
	$("#inputURL").val(location.href)
	$("#inputURL").trigger('change');

});

function getSiteLists(tURL){
	$("#ListSlct").html("
Loading...
");
	$().SPServices({
		operation: "SiteDataGetListCollection",
		webURL: tURL,
		completefunc: function(xData, Status){
			//renderList(xData, Status)
			$("#ListSlct").html("
Select a site list...
");
			$(xData.responseXML).find("_sList").each(function() {
				$("#ListSlct").append("
" + $("Title",this).text() + "
");
			});
		}
	});
}