SharePoint Roadshow – Omaha

By , February 11, 2012 1:48 am

A friend of mine, Cory VanDyke, works for Ricoh and asked me to spread the word about their SharePoint Roadshow that will be held at the Microsoft Seminar Facilities in Omaha on February 21, 2012. If you want more information on this, you can download the flyer here -  Omaha Flyer 2-12-2012.  Looks like a promising day of SharePoint goodness!

Here’s the agenda for the day:

OPERATIONAL EFFICIENCY BY ADOPTING MICROSOFT SHAREPOINT
10:00 am – 3:00 pm

DOCUMENT MANAGEMENT AND COLLABORATION DEEP DIVE
This presentation will dive into the critical tenets of enterprise content management.
10:30 am – 11:30 am

CHALK TALK – BRING THE PAIN
Luncheon discussion on the challenges you face and how SharePoint can be the solution
11:30 am – 1:00 pm

EXPOSING BUSINESS INTELLIGENCE IN SHAREPOINT
This presentation will dive into capabilities and implementation of business intelligence within SharePoint
1:00 pm – 2:00 pm

HOW TO CREATE INFORMATION WORKERS
This presentation will delve into SharePoint’s workflow engine and show how we can provide a platform for creating our own information workers to carry out tasks.
2:00 pm – 3:00 pm

LOCATION
Microsoft Seminar Facilities
2111 S. 67th St., Ste. 100
Omaha, NE 68106

Map to event

Live Example of my Org Chart/Site Map Mashup

By , December 13, 2011 10:15 am

If you have read my series on creating an Org Chart or Site Map using SharePoint lists, SPServices library, jQuery and the Google Charting API, I now have that solution posted online for you to see.

Go to: http://sharepoint.dipetersen.com/orgchart/default.aspx to see it in action! Try it in different browsers. Let me know what you think!

Calling all Omaha-area SharePoint Users!

By , November 4, 2011 2:33 pm

After I spoke at the SharePoint Saturday – Twin Cities conference, I decided that Omaha needed an engaged SharePoint User Group and I was going to spearhead the revival! Well, I know I can’t do it on my own so I’m looking for people in and around Omaha who would be interested in helping get this group going again.  I have created a form that you can fill out, which will let me know who is interested.  I would like to have an organizational meeting either late this month ( I know it’s Thanksgiving) or early next month.  As always, if you have any questions, email me or put a comment on this form!

 

I’ll be speaking at SharePoint Saturday – Kansas City!

By , October 31, 2011 8:50 pm

I just received the confirmation letter that I will be presenting at SharePoint Saturday – Kansas City on December 10, 2011.  Come see my presentation and say hi!

 

I’m speaking at SharePoint Saturday – Twin Cities on Oct 29, 2011

By , September 20, 2011 10:59 am

I just found out I’ll be presenting my Mashup presentation at SharePoint Saturday – Twin Cities on October 29! Come see me and hopefully I’ll have some books with to sign!

Org Chart/ Site Map Mashup: Wrapping it all up!

By , August 30, 2011 11:57 am

I have received some positive feedback on this article series. Thank you! I thought I’d go ahead and create this post with links to each post in the series to make it easy to read the whole thing in order. I also want to thank EndUserSharePoint.com for picking up the series, making it available to many more people. As always, if there is a particular subject you would like to know more about, send me an email and I’ll try to write something about it.

Here are all of the links!

  1. Introduction
  2. Setting up the coding environment
  3. Create the chart
  4. Add content
  5. Conclusion

jQuery – .SPServices – Google.OrgChart API Mashup – Part 5

By , August 26, 2011 4:33 pm

Part 5 – Conclusion

In the first four parts, we saw how easy it is to set up a couple of lists and then with just a little bit of JavaScript, we can transform that list data into an Org Chart or a graphical Site Map. This shows you how a little out-of-the-box thinking can produce great results.

When we last left our Site Map, it looked like this in IE.

IE Site Map

As displayed in IE

The structure is all there but it looks completely different in browsers such as Chrome.

Chrome Site Map

As displayed in Chrome

The reason the displays are different for each browser is because of the CSS used to render the boxes. Google uses some specific css that IE prior to version 9 does not recognize:

.google-visualization-orgchart-node {
    background-color: #EDF7FF;
    border: 2px solid #B5D9EA;
    border-radius: 5px 5px 5px 5px;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
    cursor: default;
    font-family: arial,helvetica;
    text-align: center;
    vertical-align: middle;
}

If you look closely, there are a couple of tags that specify the rounded corners and the shawdow, namely, border-radius and box-shadow. These are found in the CSS3 proposal, the web-kit markup for Chrome and Safari browsers and the mos- markup for the Mozilla based browsers.

More information on CSS3 can be found at http://www.css3.info

Not everyone will be using IE9, so how can we make previous versions look better? While there are numerous rounded corner techniques, I chose to only work on the background and just accept the square corners. Lets begin by inserting a <STYLE> section just before our sitemap <DIV>.


The CSS class that we want to override is .google-visualization-orgchart-node. We can always use a solid color to draw the box but to make it look a little better, I created a small 3px X 395px that had a blue gradient. I can use this as the background and repeat it across the whole box. I chose 395 at random. I don’t think the boxes will ever be larger than 395px but I also wanted it small enough that I could see the gradation in the smaller boxes. If the boxes do get larger than 395px, then my background-color attribute is the same as the end color of my graphic. I named the graphic ‘background.gif’. Upload the graphic to the images folder you created in the second post. Once the file is uploaded to the server insert following CSS into your style section.

.google-visualization-orgchart-node
{
    Background-image:url(resources/images/background.gif);
    Background-repeat:repeat-x;
    Background-color:#d2eaf3;
    Border:1px solid #a8d5eb;
    padding: 10px;
    height: 120px;
    white-space: nowrap;
}

You will notice that I also took some liberty in trying to make the boxes look a bit uniform. I did this with the padding and setting the height. I also want to make sure that the contents of the box do not wrap. The key takeaway, it that you can configure each node however you want. Our final look in both IE and Chrome are:

IE Final

IE Final

Chrome Final

Chrome Final

I hope you have enjoyed this series. I love creating solutions that might look difficult but in reality, are pretty easy. This also shows how powerful SharePoint Web Services can be. If you haven’t worked with SPServices library in the past, check it out. With a little OOB thinking, you can create some cool solutions.

I hope my instructions have been clear enough so that your chart looks like mine, but if not, you can download my code SiteMap and the background.gif file here.


Other posts in this series:

  1. Introduction
  2. Setting up the coding environment
  3. Create the chart
  4. Add content
  5. Conclusion

jQuery – .SPServices – Google.OrgChart API Mashup – Part 4

By , August 24, 2011 4:33 pm

Part 4 – Add content

Now that we have the basic chart, it’s now time to add content to each box from the Site Map Content List. I could get all of the content of the list and then iterate through them for each node in the Site Map list, or I could write a short function that queried the Site Map Content list at the time I was drawing the node. Since my site map was small and I knew it wouldn’t get much larger, i chose the second option. It would not be hard to code the first option either.

I called this function GetContent and I place it outside of my $(document).ready() block.

function GetContent(LookupValue)
{
    var out='';
    var content, url;
    // use SPServices to query the Site Map Content list for all nodes that match the
    // LookupValue.  Grab the Title, Url, Position and SiteMapNode fields.
    $().SPServices({
        operation: 'GetListItems',
        listName: 'Site Map Content',
        async: false,
        CAMLViewFields: '<ViewFields><FieldRef Name="Title" /><FieldRef Name="Url" /><FieldRef Name="Position" /><FieldRef Name="SiteMapNode" /></ViewFields>',
        CAMLQuery: '<Query><OrderBy><FieldRef Name="Position" /></OrderBy><Where><Eq><FieldRef Name="SiteMapNode" /><Value Type="Lookup">'+LookupValue+'</Value></Eq></Where></Query>',
        completefunc: function(xData,Status){
            // When the response is received from the server,
            // create our content string by iterating
            // through each row returned in the response.
            $(xData.responseXML).find('[nodeName="z:row"]').each(function(){
                url='';
                content='';
                // if our string has already been started, add a new row to the response.
                if(out.length>0)
                    out+='<br/>';
                content=$(this).attr('ows_Title');
                if($(this).attr('ows_Url')!=null)
                    content='<a href="' + $(this).attr('ows_Url') + '" title="' + content + '">' + content + '</a>';
                // add the content string to the output.
                out += content;
            });
            // one requirement I had was to put the Node name at the bottom of the box.
            // The easiest way to do this is to add an empty paragraph and then the Lookup Value.
            // This is specific to my requirement so you don't have to do this.
            out+='<br/><p>&nbsp;</p>';
            out+= LookupValue.wrap('<p>(',')</p>');
        }
    });
    return out;
}

Now that we have the content string built, we can plug that function call into our existing code where we are drawing the boxes.

If you go back to the original function that drew the boxes, locate the lines that say:

boxContent=curTitle;

and replace the line with the following code snippet:

boxContent = GetContent(curTitle);

Your site map should now look like the following illustration.

IE Site Map

As displayed in IE

Chrome Site Map

As displayed in Chrome

As you can see, it looks quite different in IE than it does in Chrome. The reason behind this is the CSS that is used by Google to draw the boxes. In the last post, we’ll make some CSS changes to make it look better in IE.
 


Other posts in this series:

  1. Introduction
  2. Setting up the coding environment
  3. Create the chart
  4. Add content
  5. Conclusion

jQuery – .SPServices – Google.OrgChart API Mashup – Part 3

By , August 23, 2011 10:07 am

Part 3 – Create the chart

In the first two posts, we created our lists and set up our development environment. In this part, we will use jQuery to query the Site Map list and create the Site Map hierarchy. If you haven’t completed the steps outlined in the first two parts, you should do that now. Links to the other posts in the series can be found at the end of this article.

Drawing Boxes

The first thing we are going to do is query our Site Map list and grab all of the list items. We will put all of the code in the document.ready block that we already prepared.

Copy and paste the following snippet of code into the page.

$().SPServices(
{
    operation: 'GetListItems',
    listName: 'Site Map',
    async: false,
    CAMLViewFields: '<ViewFields Properties="True"><FieldRef Name="Title"/><FieldRef Name="Parent"/><FieldRef Name="ID"/></ViewFields>',
    CAMLQuery: '<Query><OrderBy><FieldRef Name="Parent" Ascending="TRUE" /></OrderBy></Query>',
    completefunc: function(xData,Status){}
});

This snippet directs SPServices to use the GetListItems web service and query the list named, Site Map. It specifies that we want to see the following fields: Title, Parent and ID. It also says that we want to Order our data by Parent in ascending order. When we receive the return data, we want to pass that data, xData, to a function for further processing.

For more information on CAML and its syntax, you can find a great reference at http://msdn.microsoft.com/en-us/library/ms462365.aspx.

So far, our code doesn’t really do anything except fetch the data from our list. We need to parse the results and then format it so that the Google charting API can understand it. We will do this in the function(xData, Status){} block. Copy and paste the following snippet.

	//initialize variables
    var curParent='0';
    var testParent;
    var curTitle='';
    var curId='0';
    var parentId;
    var boxContent='';
    // create a new DataTable object that we will pass to the Google API
    var	data = new google.visualization.DataTable();
    // add the following columns to the DataTable to store the chart values.
    data.addColumn('string','Name');
    data.addColumn('string','Parent');
    data.addColumn('string','Tooltip');
    // SPSServices return the response data in the xData object.  It contains
    // the response in an XML document.  We can then use jQuery to find each
    // row of data in the XML file and act on it.
    $(xData.responseXML).find('[nodeName="z:row"]').each(function(){
        // if this node does not have a parent, then we need to save it to the DataTable
        // differently than the nodes with parents.
        if($(this).attr('ows_Parent')==null)
        {
	    curParent = $(this).attr('ows_ID');
	    curTitle = $(this).attr('ows_Title');
	    boxContent=curTitle;

            //   note the first field in the DataTable. the v:curParent and the
            //   f:boxContent are in the Name field.  The v: represents the Value
            //   while the f: represents the display field.  It may look like we're
            //   saving 4 values to a 3 field table but the first field has a
            //   value and display name part to it.

	    data.addRow([{v:curParent, f:boxContent},'',curTitle]);
        }
        else
        {
	    testParent = $(this).attr('ows_Parent');
	    curTitle = $(this).attr('ows_Title');
	    parentId = testParent.split(';#')[0];
	    curId = $(this).attr('ows_ID');
	    boxContent=curTitle;
	    if(parentId !=curParent)
	        curParent=parentId ;
	        data.addRow([{v:curId, f:boxContent},curParent,curTitle]);
	 }
    });

    // now send it to the Google Visualization API and store the results in 'chart'
    var chart = new google.visualization.OrgChart(document.getElementById('sitemap'));
    // render the HTML of the chart.
    chart.draw(data,{allowHtml:true});

If everything worked right, you should now have an OrgChart based on the values you placed in the Site Map list resembling Figure 1.

Boxes

Figure 1 : OrgChart

That’s promising! This is where it starts getting fun! In the next post, I’ll show you how to get the content for the individual boxes!


Other posts in this series:

  1. Introduction
  2. Setting up the coding environment
  3. Create the chart
  4. Add content
  5. Conclusion

jQuery – .SPServices – Google.OrgChart API Mashup – Part 2

By , August 20, 2011 9:26 am

Part 2 – Setting up the coding environment

In the last post, we defined the requirement and the solution and then created the lists that will support it.  In this post, we will assemble all of the parts and set up the coding environment.  I will also show you how I organize supporting files when I develop SharePoint solutions.

Note: The structure I use to create client-side solutions using jQuery and the CEWP is the method and structure that I have adopted after trying various ways on various different projects.  I know others create Document Libraries to store their code and that is fine.  Some even put all of the code in the CEWP.  I normally have SharePoint Designer access so I choose to create Folders instead of Libraries.  If you don’t have SharePoint Designer access, you can create a Document Library to store your code or place it in the CEWP.

To host the org chart, we are going to use a Content Editor Web Part (CEWP).  Using this web part,  we can use HTML or JavaScript to create rich content.

  1. Place a Content Editor Web Part (CEWP) into one of the web part zones.  Don’t worry about configuring it right now.
  2. Open up your site in SharePoint Designer (SPD).
  3. Create a new folder in the root of the site and name it Resources.
  4. Create four new folders in the Resources folder named content, css, images, js.
  5. For this exercise, we are going to use jQuery 1.6.2 and SPServices-0.6.2.
  6. If you haven’t already done so, download the jQuery and SPServices libraries.
  7. Place jquery-1.6.2.min.js and jquery.SPServices-0.6.2.min.js into the Resources/js folder you created on your site.
  8. In the Resources/content folder, create a new file called SiteMap.js.
  9. Open the SiteMap.js file for editing in SharePoint Designer (or any other text editor).
  10. Use the following code block to set up your code page.
<!-- Load the jQuery and SPServices libraries.
     Make sure you verify the path   -->
<script language="javascript" type="text/javascript" src="resources/js/jquery-1.6.2.min.js"></script>
<script language="javascript" type="text/javascript" src="resources/js/jquery.SPServices-0.6.2.min.js"></script>

<!-- Load the Google Charting visualization library.  -->
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load('visualization', '1', {packages:['orgchart']});</script>

<!-- Create a script area for our custom code.   -->
<script type="text/javascript" language="javascript">
String.prototype.wrap = function(pre,post) {
	return pre + this + post;
}
var out="";
var data;
$(document).ready(function(){

    // this is where we will write our code

});

</script>

<!--  This is the container for the site map. -->
<div id="sitemap"></div>
  1. Go back to the page in your browser where you placed your CEWP.  Open the web part for modification and in the Content Link box, type the path of the SiteMap.js file.  The path to the file is relative to the site so normally, it would be resources/content/sitemap.js. Test your path to make sure.
  2. Save your changes.
Your environment is now set up.  I showed you how I prefer to set up my solution and explained how others have accomplished the same task.  The point to remember is that creating these types of solutions are simple and flexible. In the next post, we will start coding our solution.

Other posts in this series:

  1. Introduction
  2. Setting up the coding environment
  3. Create the chart
  4. Add content
  5. Conclusion

Panorama Theme by Themocracy