Welcome to MSDN Blogs Sign in | Join | Help
Org Chat Web Part - Part I - Overview and Download

In this post we are going to explore User Profiles by extending the Organizational Hierarchy in MOSS. I've posted in Codeplex both installer and code for the Organizational Chart Hierarchy web part. This post will only discuss installation and configuration. I will discuss the code in posts to come.

What this webpart does:

This web part reads and analyzes the user profiles in MOSS and creates a full hierarchical organizational chart.  See screenshot below:

image

 

What I need to make it work:

1. It requires MOSS (Microsoft Office Sharepoint Server) 2007.

2. It requires you have imported profiles from you AD.

3. In order to have the hierarchy displayed correctly you have to include managerial and department information for all users who have manager (see the example in the snapshot below).

image

4. You have to edit the departmentconfig.xml file if you want links to the department sites. After the install, this file normally is found at: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\OrgChartPart\. This file is only available after the install is complete.

5. Just edit, add or delete <Mapping Department="[Department Name As in Profile]">[url]</Mapping> entries as appropriate. The mapping must be exact. As the example below (this entry is case sensitive):

<Mapping Department="Operations">http://myweb/sites/operations</Mapping>

 

Installing Steps:

1. Download the latest release here: http://www.codeplex.com/orgchartpart/Release/ProjectReleases.aspx?ReleaseId=15590 and save in a folder you will remember later (eg. c:\downloads).

2. Go to MOSS Bin folder, commonly at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN

3. Run the following commands from the command prompt when logged as farm administrator (assuming the .wsp file is in C:\Downloads):

stsadm -o addsolution -filename c:\downloads\OrgChartPart.wsp
stsadm -o deploysolution -name c:\downloads\OrgChartPart.wsp -allowgacdeployment -immediate
stsadm -o execadmsvcjobs

4. Go to the shared services provider you use for personalization in Central Administration.

5. Choose Personalization services permission under User Profiles and My Sites.

6. Make sure NT AUTHORITY\Authenticated Users has "Personal Features" and "Personal Site" rights.

image

 

7. Go to the site collection you want to include the web part (eg. http:/myweb).

8. Go to Site Actions | Site Settings | Modify All Site Settings

9. Go to Site Collection Features under Site Collection Administration

10. Activate Org chart Web Part

image

 

11. Verify if OrgChartPart is available in the Web Part Gallery of the Site Collection (Site Actions | Site Settings | Galleries | WebParts)

image

 

12. Add the web part wherever you want in a page

13. Make sure you adjust the web part to render correctly:

image

 

Notes:

  • The beautiful tree layout in Javascript was developed by the talented Emilio CL and can be found here: http://www.codeproject.com/KB/scripting/graphic_javascript_tree.aspx
  • Don't try it in a large Enterprise with over 500 user profiles. It will work but will be slow. A few modifications are necessary to enable better performance.
  • Next post will be about the source code.
Posted: Friday, July 25, 2008 3:12 AM by Rodney Viana

Comments

AACLAGE said:

Excelent article, just give some other goog ideas, here you use the MOSS, but i change to use the the wss3.0 with AD and integrated users photos, excelent post.

# July 26, 2008 11:12 AM

Tariq said:

In installing steps: Refer to point 3 correct command is  

stsadm -o deploysolution -name c:\downloads\OrgChartPart.wsp -allcontenturls -allowgacdeployment -immediate

# July 28, 2008 7:19 AM

SharePoint por Hector Insua said:

En un alto porcentaje de los proyectos en los que he trabajado, siempre la visualización del Organigrama

# July 28, 2008 9:54 AM

Rodney Viana said:

Hi AACLAGE,

Cool. Share the code with us in a comment entry.

# July 28, 2008 10:25 AM

Rodney Viana said:

Hi Tarig,

It is not necessary to add -allcontenturls as it is a farm wide solution.

Cheers

# July 28, 2008 10:29 AM

Rodney Viana said:

Ola Hector,

I've checked your post. Thanks for taking the web part to the Spanish speaking audience.

# July 28, 2008 10:40 AM

Mirrored Blogs said:

En un alto porcentaje de los proyectos en los que he trabajado, siempre la visualizaci&#243;n del Organigrama

# July 28, 2008 10:41 AM

SvenE said:

This webpart is exactly what we need.

We followed your instructions, but we had problems installing the webpart.

If we want to add the webpart to a site we got an error message (unknown error). It takes about 2 minutes until the error message appears. There aren't any error messages in event log of Windows. The permissions are set correctly for NT AUTHORITY\Authenticated Users.

Do you have an idea?

Thank you in advance.

SvenE

# July 28, 2008 11:33 AM

Rodney Viana said:

Hi SvenE,

Try it again and just after you finish the trial see what the MOSS log says. It is normally located at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN and if you sort by date or creation descending you will see the latest log on top. Go to the final lines and look for something related to the webpart and let me know what it says.

If you have problems identifying the error in the log file, turn the stack trace on (turn it back off later). See more details here:

http://www.sharepointblogs.com/michael/archive/2007/06/28/sharepoint-under-the-hood-see-real-error-description-and-callstack-stack-trace.aspx

# July 28, 2008 12:29 PM

SvenE said:

The stack trace shows the following message:

[HttpException (0x80004005): Request timed out.]

At the first time, I could add the web part to the site, but the org chart didn't show anything (only access denied). After that i set the permission to all authenticated users in Shared Service Provider.

Now I get this error code...

# July 29, 2008 4:05 AM

Rodney Viana said:

Hi SvenE,

Take a look at this:

http://forums.msdn.microsoft.com/en-US/sharepointdevelopment/thread/5fb13f00-e557-4f97-9483-cb32867b3505/

But it seems you have more than 500 users. Wait a little bit until put the webpart in production. I'll add some changes to enable performance for companies with over 500 profiles.

# July 29, 2008 10:21 AM

Mirrored Blogs said:

Corpo: Olá pessoal, tudo bom? Estou montando este post para compartilhar uma novidade bastante interessante

# July 31, 2008 10:44 PM

AACLAGE said:

Hi,

Like i say the big issue is use the "UserProfileManager"

you can get the user by a list call

SPList list = web.Lists["User Information List"];

then you only have to get the values there.

Mappings : List<OrgChartPart.Mapping>

next is the use of line on class:

public class Mappings : List<OrgChartPart.Mapping>

return string.Format("<a href=\"{0}\" class=\"ecolink\" target=\"_new\">{1}</a>", mapping.PublicUri, mapping.Department);

create a link image parameter where you have the photo URL and add to return string

return string.Format("<a href=\"{0}\" class=\"ecolink\" target=\"_new\">{1}</a><img src=\"MyPhoto.jpg\" mapping.PublicUri, mapping.Department);

Sorry cant be more explicit this is not the best place.

Hope this help.

# August 1, 2008 6:49 AM

Jeff said:

Hello,

When I try to run the 2nd command to deploy the webpart, I get the following warning:

This solution contains resources scoped for a Web application and must be deployed to one or more Web applications.

and nothing appears in the Templates folder as described.

Any ideas?

# August 26, 2008 4:22 PM

Jiga said:

I've a Problem, wehen i Publish the Webpart i see a Blue Ball with "Zugriff Verweigert", that means i don't have the Access Right.

My NT-AUTORITÄT\Authentifizierte Benutzer have the Right to read Personal Information.

Where is the Problem?

# September 3, 2008 4:39 AM

Jiga said:

I've a Problem, wehen i Publish the Webpart i see a Blue Ball with "Zugriff Verweigert", that means i don't have the Access Right.

My NT-AUTORITÄT\Authentifizierte Benutzer have the Right to read Personal Information.

Where is the Problem?

# September 3, 2008 4:46 AM

Jen said:

Rodney -

This is a GREAT webpart.  I was wondering if you had an ETA as to when the performance enhancements to support 500+ users would be completed?  If not, can you describe what you were thinking of doing so that I can give it a shot?  

Also, I am trying to use the web part as a vertical tree view that will display the hierarchy for an employee based on where they exist in the hierarchy (i.e. Director sees only his Managers, and the employees that report to his managers).  Then I will use this tree view list as a provider to a list of documents relating to the employee selected in the tree...

Do you think this is feasible, and if so, do you have any suggestions on how to do this?  We have several web applications that we are working on in our organization that require this functionality in a webpart.

Thanks much in advance!

Jen

# September 4, 2008 9:55 AM

barrypre said:

We have 3000 users in the organization. The webpart is not working correctly. Are you planning on releasing your improved source code soon? Or are you going to present your code in a new post?

On a smaller test dataset it looks good.

Thanks and Best Regards

# September 17, 2008 4:19 AM

Apple said:

Can the organisation chart be filter out into department by department?

# September 24, 2008 1:40 AM

Pierre said:

I got this message when i try to add or view the webpart :

"Impossible de charger le fichier ou l'assembly 'Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' ou une de ses dépendances. Le fichier spécifié est introuvable. à OrgChartPart.OrgChartPart.PopulateOrg() à OrgChartPart.OrgChartPart.Render(HtmlTextWriter writer)"

which means that it can't load the assembly Microsoft.Office.Server because it can't find the file.

can you help me plz ?

# October 8, 2008 3:08 AM

Bernhard said:

Hi,

thanks a lot for this great webpart!

It works really fine but the display of the department name. If I change some of the webpart settings, it takes some seconds until it is displayed and in this case also the department info are displayed correctly.

If I hit the refresh button, instead of the department names "Fatal:Unable to connect to the remote server" is displayed while the names of the employees are still displayed correctly.

I changed the cache time in the Org Chart settings to 24 (hours) but it seems to have no impact on the problem.

Do I have to change some timer settings or what could be the reason for this behaviour?

Thanks a lot!

# October 16, 2008 2:15 AM

Peter Moys said:

I've added the webpart and done everything i think i'm supposed to.  However, the orgchart is blank when i try to view it on the MOSS server itself, and gives this error message when i try to view it on a workstation:

Access Denied: Only an administrator may enumerate through all user profiles.

Can you give me any advice.  According to the crawl log, i have 285 user profiles imported so i don't think my org is too big.

Any help gratefully received,

Peter

# October 16, 2008 8:02 AM

crsnt said:

Hi,

I installed the webpart. But when I added it on the site, the chart is not showing up.

Does each user have to have Department info filled in?

and Manager info? or both?

Cheers.

# October 27, 2008 1:07 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker