Squadron – Explorer Add-in

In this article I would like to introduce you to the Explorer (Old Site-Structure) Add-in of Squadron.

What are the advantages of Explorer?

Using Explorer we can quickly generate the Site Collection, Sub sites, Lists & Libraries, Items in hierarchical manner. The information is useful in analyzing a site collection.

image

We can also view in Grid Style where the above objects are displayed in Rows with facility to export too.

clip_image004

Squadron is a Free SharePoint 2010 Productivity tool deployed using ClickOnce technology. You can install it from following location.

http://www.sharepointact.com/Squadron2010/publish.htm

How to generate the Structure?

Install the Squadron application & execute it using the Desktop short cut. You will get the following screen.

clip_image006

Now click on the left pane named Explorer. You will get the following Site Structure screen.

clip_image008

Enter the Web Application URL in the URL textbox of the header. Click the Execute button to generate the site structure as shown below:

clip_image010

Please note that you can include Lists & Libraries by checking the Show Lists, Libraries checkbox. Additionally you can include Items & Versions using the Show Items, Show Version Count Checkboxes.

clip_image012

Following is the result after generating Items & Versions.

clip_image014

Please note that the versions are displayed within Parenthesis.

Grid Style

We can also generate Grid Style using the Grid Style checkbox.

clip_image016

Now click the Execute button again.

clip_image018

Export to Excel

For saving the rows, right click & choose:

1. Export to Excel

2. Export to CSV

clip_image020

After saving, the file gets opened inside Microsoft Excel. You may uncheck the Open after save option if you do not prefer automatic launching of file after saving.

CSV option is also good but if you have COMMA (,) character in the names of Site, List, Items the generated file will be confusing.

Hidden Lists

The hidden lists checkbox allows you to include Hidden Lists in the result. Hidden Lists are those not displayed in the Quick Launch bar as well as the System Lists.

clip_image022

Property Grid

We can examine each item properties further using the Property Grid. For example you wanted to view:

· Allow Designer property of site collection

· Allow Unsafe Updates property of site

· Allow Deletion property of List & Library

You can view these properties by clicking the result item; the Properties will get displayed in the right side.

clip_image024


 

Code Behind

Following is the code to generate the Hierarchy information.

Following is the main method:

private void GenerateHierarchy(string url)

{

tv.Nodes.Clear();

SPWebApplication webApp = SPWebApplication.Lookup(new Uri(url));

_rootNode = tv.Nodes.Add(webApp.Id.ToString(), GetDisplay(webApplication), 0, 0);

_rootNode.Tag = webApplication;

foreach (SPSite site in webApp.Sites)

{

if (FilterCheck.Checked)

if (!site.Url.StartsWith(FilterText.Text))

continue;

TreeNode node = _rootNode.Nodes.Add(site.ID.ToString(), GetDisplay(site), 1, 1);

node.Tag = site;

node.ToolTipText = “Site Collection”;

IterateWebs(site, node);

Application.DoEvents();

}

tv.ExpandAll();

if (_rootNode != null)

_rootNode.EnsureVisible();

}

For iterating webs, the following method is used:

private void IterateWebs(SPSite site, TreeNode parentNode)

{

foreach (SPWeb web in site.AllWebs)

{

if (FilterCheck.Checked)

if (!web.Url.StartsWith(FilterText.Text))

continue;

if (!web.IsRootWeb) parentNode = GetParent(web.ParentWebId.ToString());

if (parentNode == null) parentNode = _rootNode;

TreeNode node = parentNode.Nodes.Add(web.ID.ToString(), GetDisplay(web), 2, 2);

node.Tag = web;

node.ToolTipText = “Site”;

if (ShowListsChecked.Checked)

IterateLists(web, node);

}

}

For iterating Lists, following is the method:

private void IterateLists(SPWeb web, TreeNode parentNode)

{

foreach (SPList list in web.Lists)

{

if (list.Hidden || !list.OnQuickLaunch)

if (!ShowHiddenChecked.Checked)

continue;

int imageIndex = 3;

if (list is SPDocumentLibrary)

imageIndex = 4;

TreeNode node = parentNode.Nodes.Add(list.ID.ToString(), GetDisplay(list),

imageIndex, imageIndex);

node.Tag = list;

if (list is SPDocumentLibrary)

node.ToolTipText = “Library”;

else

node.ToolTipText = “List”;

if (ShowItemsCheck.Checked)

IterateItems(list, node);

}

}

For iterating Items, use the following code:

private void IterateItems(SPList list, TreeNode parentNode)

{

foreach (SPListItem item in list.Items)

{

TreeNode node = parentNode.Nodes.Add(item.ID.ToString(), GetDisplay(item), 5, 5);

node.Tag = item;

}

}

For finding Root Web of a site, following method is used:

private SPWeb GetRootWeb(SPWeb web)

{

SPWeb result = web;

while (result.ParentWeb != null)

result = result.ParentWeb;

return result;

}

References

http://bit.ly/XdwpRV

Summary

In this article we have explored the Site Structure Add-in in Squadron. I believe this would be a helpful tool in your bag while visiting a new SharePoint customer.

You can download & use Squadron for Free, if you face any installation problems, please let me know.

7 thoughts on “Squadron – Explorer Add-in

  1. dildarm says:

    you are the best Jean Paul :-)

    1. Jean Paul says:

      Thank You Dildarm for the good words..
      The MVP Platform enables the growth :)

      1. dildarm says:

        its really nice work from you and also you book are very good and I leaned to much things.

        I have a small problem with the tool:

        my url is: http://sharepoint/

        and when I enter it and click on Explorer I get following error:

        18:14:40 [Explorer] System.InvalidOperationExceptio
        bei Microsoft.SharePoint.Administration.SPWebApplication.Lookup(Uri requestUri, Boolean fallbackToHttpContext)
        bei SquadronAddIns.Default.Components.SharePointExplorer.b__0()
        bei Microsoft.SharePoint.SPSecurity.c__DisplayClass4.b__2()
        bei Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
        bei Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
        bei Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
        bei SquadronAddIns.Default.Components.SharePointExplorer.OnUrlChanged()
        bei SquadronAddIns.Default.Components.SharePointExplorer.set_Url(String value)
        bei SquadronAddIns.Default.Explorer.ExplorerControl.RefreshData()

        can you maybe here help me?

        thank you very much in Advance.

  2. Jean Paul says:

    Hello Dildarm,

    Thank You for the good words.. I am working on better resources for SharePoint.

    Regarding your problem, it happens when the Web Application object is not creatable from URL specified.
    You can perform the following:

    1) Download & Install latest squadron from:
    http://www.sharepointcto.com/Squadron/Default.aspx

    2) Get the Web App URL from SharePoint & use it inside Squadron
    (sometimes the http://squadron is a DNS resolving name, you need to get the original URL from central admin)

    3) Try from the Central Admin Machine, Use URL http://localhost as well

    Please let me know further errors OR solved..

    Regards,
    Jean Paul

    1. dildarm says:

      Hallo Mr. Paul,

      I see and your posts are really very good.
      I like the way how you explain it, you explain simple, understandable.
      And in the book the real world examples are very good and I hope we will see more REAL WORLD examples in your next book.

      This solved my problem:

      1) Download & Install latest squadron from:
      http://www.sharepointcto.com/Squadron/Default.aspx

      I download it and install it and all works good.

      thank you very much
      Dildar

      1. Jean Paul says:

        Hei Dildarm,

        I am happy to hear that it solved the problem..
        i will add a Guiding Error message for the scenario..

        Regarding Scenarios in book, i back up you as there is already a person who used the book to gain SharePoint job without having SharePoint experience, he just used my book to get the job!

        I will add the story through “Power of SharePoint” group.. Please stay focused..

        After all SharePoint is a wonderful technology & it helps reducing costs, increasing productivity. We have to make the SharePoint world more easier & fun working with :)

        Regards,
        Jean Paul

      2. dildarm says:

        Hi Mr. Paul,

        you welcome anytime, I told also my friends about your Website and your book.

        keep it up and carry on :)
        Im everyday on your site.

        thank you again
        Dildarm

Leave a Reply to Jean Paul Cancel reply

Your email address will not be published. Required fields are marked *