Archive

Posts Tagged ‘Sharepoint’

Add .net assembly to sharepoint 2010 package or solution

April 5, 2011 Leave a comment

hi,

here in today I would like to share a small but required thing while packaging sharepoint solutions. We usually require to bundle-up .net assemblies within a sharepoint solution(s). Microsoft Visual studio 2010 has made this thing very easy for packaging sharepoint 2010 solutions.

Please check the screen shots for the sameIn the solution explorer you can see an .net assembly( underlined red in color), I wanted to refer/add this assembly into the sharepoint solution (highlighted in dark black).

So I opened the package.package (double click it 🙂 ) as shown in screen shot.

Here on the wizard click on Advance tab (highlighted in red box below)

On opening of the tab gives option (inform of buttons) to add, edit, delete “Additional Assemblies”. The added assemblies are listed in the grid.

When we try to add new assembly it will give 2 options viz; Add existing assembly & Add assembly from project output

Now if you want to add assembly from your current project/solution then use second option & if you to refer to external assembly which is not part of your project then use first option.

In either cases if you want to register these assemblies into the web.config safe controls then there is provision for same 🙂

One most important thing to remember is: any assembly that you want to refer/add should be strong named (public token key) in order to add it to the GAC / assembly cache.

Additional Resource can be found at: Add & Remove Additional Assemblies

PRE-REQUISITES FOR SHAREPOINT FOUNDATION 2010

August 5, 2010 3 comments

Hi all 🙂
Since from last week I was struggling to install SharePoint 2010 Foundation. Yes it was really painful activity for me (even when I had awesome experince of sharepoint 2007 installation). So in this article I want to share my experince with you all so that it can benifit you while installing the same.
Below is the Hardware and S/w requirements for SharePoint 2010 Foundation Server:
* Hardware
o CPU: x64 bit compatible
o RAM: 4GB recommended (for developer installation), actual= 6GB- 8GB
o HardDisk: min. 80GB (preferred: 250 GB min.)
o Processor: Intel 64 bit 2-core
+ Intel 64 bit 4-cores or Intel 64 bit 8-cores Recommended
* Software
o Operating System: Windows Vista SP2 – 64bit
+ Windows 7 – 64bit
+ Windows Server 2008 – 64bit
+ Windows Server 2008 R2 – 64bit
o IIS: 7.0
o Sql-Server: Sql Server 2008 / Sql Server 2005 – SP3 (doubtful)
o .NET: .Net Framework 3.5 SP1, ASP.NET
* Development: Visual Studio 2008 ; Visual Studio 2010 (prefered)
This link can be good pointer for same: http://technet.microsoft.com/en-us/library/cc262485.aspx

PRE-REQUISITES FOR SHAREPOINT FOUNDATION 2010
** When you will run the SharePointFoundation.exe installer, you will get the option for installing the pre-requisites via this installer.
** But as per my experince its better we manually install these pre-requisites. As via installer its very lengthy process and there is no-assurance of fool proof installation.
** I googled out all of these pre-requisites and installed them manually and then again ran the wizard to configure it rightly. 🙂

• Windows Server 2008 Service Pack 2 – http://www.microsoft.com/downloads/details.aspx?familyid=656c9d4a-55ec-4972-a0d7-b1a6fedf51a7&displaylang=en
* note prior to installation of the service pack we need to download and install Readiness Tool for Windows Server 2008 x64 Edition (KB947821)
Following is the url for the same: http://www.microsoft.com/downloads/details.aspx?FamilyID=ba837d17-580f-410c-b6a9-1069d772a835&displaylang=en

• Application Server Role, Web Server (IIS) Role – comes bundeled with the OS itself

• Microsoft SQL Server 2008 Native Client – http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c6c3e9ef-ba29-4a43-8d69-a2bed18fe73c
* installer: X64 Package (sqlncli.msi) – 7963 KB

• Microsoft .NET Framework 3.5 SP1 – http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&displaylang=en

• Hotfix for Microsoft Windows (KB976394) – (http://code.msdn.microsoft.com/KB976394/Release/ProjectReleases.aspx?ReleaseId=3572)

• Windows PowerShell 2.0 – http://support.microsoft.com/kb/968929
* Requires 2 installers:
1. Windows6.0-KB968930-x64
2. Windows6.0-KB960568-x64

• Windows Identity Foundation (KB974405) – http://www.microsoft.com/downloads/details.aspx?FamilyID=eb9c345f-e830-40b8-a5fe-ae7a864c4d76&displaylang=en

• Microsoft Sync Framework Runtime v1.0 (x64) – http://www.microsoft.com/downloads/details.aspx?FamilyId=C88BA2D1-CEF3-4149-B301-9B056E7FB1E6&displaylang=en
* installer: SyncSetup_en.x64.zip

• Microsoft Chart Controls for Microsoft .NET Framework 3.5 – http://www.microsoft.com/downloads/details.aspx?FamilyID=130f7986-bf49-4fe5-9ca8-910ae6ea442c&displaylang=en

• Microsoft Filter Pack 2.0 – http://www.microsoft.com/downloads/details.aspx?FamilyId=60C92A37-719C-4077-B5C6-CAC34F4227CC&displaylang=en
* installer: FilterPackx64.exe

• Microsoft SQL Server 2008 Analysis Services ADOMD.NET – http://www.microsoft.com/downloads/details.aspx?FamilyId=228DE03F-3B5A-428A-923F-58A033D316E1&displaylang=en
* installer: X64 Package (SQLSERVER2008_ASADOMD10.msi) – 9263 KB

• Microsoft Server Speech Platform Runtime (x64) – http://www.microsoft.com/downloads/details.aspx?FamilyID=b444fa90-ad7a-490f-86a4-a900567714f0&displaylang=en
* installer: Platform\x64\SpeechPlatformRuntime.msi

• Microsoft Server Speech Recognition Language – TELE(en-US) – dont worry the installer (while running the pre-requisites wizard) will locate this and install it automatically. Because I could not find it 😦

• SQL 2008 R2 Reporting Services SharePoint 2010 Add-in – http://www.microsoft.com/downloads/details.aspx?FamilyID=200fd7b5-db7c-4b8c-a7dc-5efee6e19005&displaylang=en
* installer: rsSharePoint.msi

Refered URL for any more details: http://technet.microsoft.com/en-us/library/bb905370.aspx#section5

** in my case following items were re-configured by the pre-requisites wizard:
1. sp2 of windows 2008
2. Configuration Application Server role of Web Server (IIS) role
3. Filterpack
4. MS SQLServer 2008 Analysis Services ADOMD.NET
5. Microsoft server speech recognition language – TELE(en-US) [got downloaded and installed automaticaly as I could not locate it online]
6. SQL 2008 R2 Reporting Services SharePoint 2010 Add-in

**Once the above all gets done then, all you need is to run the SharePoint 2010 Foundation wizard and this process is quite similar to installation of WSS 3.0

** Incase if you have any doubt or query wrt this then please feel free to write to me 🙂

Regards,
Manish Patil

Categories: General Tags:

Integrate Siebel CRM with SharePoint

November 15, 2009 7 comments

CRM - SharePointThis post talk all about my experiment of integrating siebel crm system (siebel-on-demand) with sharepoint portal (SharePoint 2007 – MOSS). This is something which I did year back for one of our esteemed client.

This was really a very challenging and exciting task which me and my team enjoyed a lot. (thanks to my fellow team mates)

Well now I will start with the details of the task and will explain the approach to crack the task and design the solution.

Objective: The Objective was to pull data from LOB application  (Siebel-On-Demand) in MOSS through the channel of Business Data Catalog (BDC) and display it in form of list.

Requisites: Access to Siebel-On-Demand Applications web service, MS.NET wrapper web service, xml Meta data file, SSP.

Approach: Since this was a very unusal task and in that I was new to sharepoint so in initial phase I was confussed and had lost my confidence. So in such situation as normal developer do, I deed the same i.e. I simply googled out for Siebel Integration with SharePoint  🙂 and to my surprise the very first article I got was from MSDN for the same.

This build my confidence and cracked my worry too. It is really nice article but unfortunately wasn’t suitable for my need 😦 . So I went back to my Manager and even to the client specifying that it was not going to be very easy task (the client smilingly noded that he is aware about that and hence it to us). But some how because of that article I was hopeful  that I will crack the solution for this requirement.

So I started good enough brain storming sessions (I like & really enjoy this activity). While understanding Siebel as a technology the first thing that strick to my mind was, the support for web services (for me this is most exciting stuff of I.T and thanks to Deobrat for that 🙂 ) and its ability to talk with other applications through them.

The very first thing which I deed was I wrote a asp.net application in which I invoked the siebel web service by consuming its WSDL files (this wasn’t that easy as I thought. But the help files which I got from siebel were very helpful). So eventually I was able to list the data into asp.net grid view through the web services of siebel.

So this made one point clear and that is: I need not need to do any configuration or customization on the siebel end(as specified in MSDN) for my things. But on other hand I need to write some asp.net application which could help me to generate the required xml metadata file of BDC which I can import into sharepoint and start displaying data.

So from this one more thing which I concluded was I need a wrapper around siebel web service which will make the above task easy and comfortable.

Following are the basic steps for getting siebel integration with SharePoint:
1. Download the WSDL (web service defi. language) files from your Siebel-On-demand site
2. Create a new ASP.NET web service project and include all the above wsdl files into this as a web-reference
3. Now Against each WSDL create new WebService file(.asmx) within it write webmethods like Get,Set / Select that will communicate with Siebel web methods(something like method overriding.)
4. Whatever data you extract from siebel via services will be required to be returned by your webmethods so that SharePoint can read them. So return the siebel data in for .net array types(string, int, dateTime).
5. Compile this project and deploy it or host it on IIS server.
6. Test the same through your browser, once that is done then start designing application definition file(ADF) against these hosted web services.
7. On successful creation of the same then upload it to the sharepoint server
8. Add BDC webparts to webpage and configure them against the above ADF’s

I’m planning to elaborate more on this very soon 🙂

Hide “My Site” and “My links”

October 12, 2009 Leave a comment

The question is how to hide “My Site” and “My links” gracefully?

For any normal web application developer (who has very little exposure to sharepoint tools and technology) hiding some links (specifically “My Site”) from the default.master page will be just setting its visibilty property to “false”. But doing like this is not a feasible solution.

Then the question arises how to play with  such links gracefully?

So for this all you need to go to the SSP under the central administration site that is associated with SharePoint web application for which you want to hide the links.

Inside the SSP:

Under “User Profiles and My Site” Header click on “Personalization services permissions” link

This will take you to the “Manage Permissions: Shared Service Rights”   Screen 🙂

here select the user for whom you want to disable the “My Site” and “My Links” feature and then click “Modify Permissions of Selected Users” link

which will take you to “Modify Permissions” screen.

Now uncheck the “Create personal site” checkBox to disable the above features 🙂

Please Note changes made here will be applied on the all of the webapplications associated with SSP where you performed this change.

Need less to say that “My Links” and/or “My Site” feature is available to sharepoint web applications which are associated to the SSP only. In short WSS 3.0 driven webapplications dont have such feature 🙂

Define Custom Permission Level in SharePoint for Peopls and Groups

October 1, 2009 Leave a comment

Hmm… today I’m going to share some smart techniques for configuring and designing of sharepoint sites.

It’s quite obvious that many times (while working with sharepoint) for managing users and groups you may need to assign some specific set of rights/permissions to those users and groups. Which can be a part of different sharepoint default permissions levels.

So in such case sharepoint allows us to define a new set of permission levels: (as follows)

  1. Define Permission Level in SharePoint for Groups permission-Level

The navigation is as shown in adjoining screen 🙂

  1. Assign Permisssion to User or Groups
  2. Change the Permission for User or Group on/for specific list or library or web
  1. Hide “View All Site Contents”

Reference Url: http://technet.microsoft.com/en-us/library/cc287625.aspx

Installation And Deployment Guide for MOSS 2007

August 28, 2009 Leave a comment

Here is the place where I found some good documents related to sharepoint 2007 (MOSS / Office SharePoint Server) from Microsoft 🙂

http://technet.microsoft.com/en-us/library/cc262788.aspx

Hide SharePoint QuickLaunch And Add Custom QuickLaunch

August 24, 2009 1 comment

So with reference to my previous post here I’m trying to explain my first coding tact of hiding existing quick launch and replace it with custom webpart that renders links in same fashion as default quick launch does.

Here in this the idea is such that,

our custom webpart will first search for the default quicklaunch control in the master page

set it’s visibility to false and then sets his(custom webpart) own visibility to true

Then start adding the links to the webpart simultaneously apply the cosmetic work on the links so that it looks like the default quick launch links.

To find the default quicklaunch control in the master page below code will be helpful:

protected override void CreateChildControls()
{
List<string> controlsList = new List<string>();
if (Page.Master.HasControls())
{
for (int controlIndex = 0; controlIndex < Page.Master.Controls.Count; controlIndex++)
{
controlsList.Add(“<br>”);
controlsList.Add(controlIndex.ToString() + “. ” + Page.Master.Controls[controlIndex].UniqueID);
controlsList.Add(“<br> Level 1: <br>”);
for (int childCntrlIndex = 0; childCntrlIndex < Page.Master.Controls[controlIndex].Controls.Count; childCntrlIndex++)
{
controlsList.Add(childCntrlIndex.ToString() + “. ” + Page.Master.Controls[controlIndex].Controls[childCntrlIndex].UniqueID);
controlsList.Add(“<br> Level 2: <br>”);

for (int innerChildCntrlIndex = 0; innerChildCntrlIndex < Page.Master.Controls[controlIndex].Controls[childCntrlIndex].Controls.Count; innerChildCntrlIndex++)
{

controlsList.Add(innerChildCntrlIndex.ToString() + “. ” + Page.Master.Controls[controlIndex].Controls[childCntrlIndex].Controls[innerChildCntrlIndex].UniqueID + “<br>”);
controlsList.Add(“<br> Level 3: <br>”);

for (int level3Index = 0; level3Index < Page.Master.Controls[controlIndex].Controls[childCntrlIndex].Controls[innerChildCntrlIndex].Controls.Count; level3Index++)
{
controlsList.Add(level3Index.ToString() + “. ” + Page.Master.Controls[controlIndex].Controls[childCntrlIndex].Controls[innerChildCntrlIndex].Controls[level3Index].UniqueID + “<br>”);

}

controlsList.Add(“-:Level 3 END:-<br>”);

}

controlsList.Add(“-:Level 2 END:-<br>”);

}

controlsList.Add(“<br> -:Level 1 END:- <br>”);

}
}
StringBuilder str = new StringBuilder();

for (int controlListIndex = 0; controlListIndex < controlsList.Count; controlListIndex++)

{

str.Append(controlsList[controlListIndex].ToString());

}

//HttpContext.Current.Response.WriteFile(“Pagecontroldetails.txt”, false);

HttpContext.Current.Response.Clear();

HttpContext.Current.Response.AddHeader(“content-disposition”, “attachment;filename=Pagecontroldetails.txt”);

HttpContext.Current.Response.Charset = “”;

HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);

HttpContext.Current.Response.ContentType = “application/vnd.text”;

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

HttpContext.Current.Response.Write(str.ToString());

HttpContext.Current.Response.End();

base.CreateChildControls();

}

The above code will help you get the exact controlid in the masterpage for quick launch control. If you don’t want to this all for getting the controlid then I will tell you the control ID 🙂 its “ctl00$PlaceHolderLeftNavBar$QuickLaunchNavigationManager

Hmm… Now comes the main task i.e is point no. 2 and 3

protected override void CreateChildControls()
{
Control masterPageControl = new Control();
try
{
QueryXmlDocumentForAuthorizingLoggedInUser();
AuthorizeLoggedInUser();
if (NonAdminUser)
{
masterPageControl = Page.Master.FindControl(“ctl00$PlaceHolderLeftNavBar$QuickLaunchNavigationManager”);
masterPageControl.Visible = false;
}
else
{   // unhide the quick launch control on the page and set pearlNavigation control to invisible
masterPageControl = Page.Master.FindControl(“ctl00$PlaceHolderLeftNavBar$QuickLaunchNavigationManager”);
masterPageControl.Visible = true;
}
}
catch (Exception ex)
{
EventLog pearlNavLog = new EventLog(“Application”, “.”);
pearlNavLog.WriteEntry(ex.Message, EventLogEntryType.FailureAudit);
}
base.CreateChildControls();
}

protected override void Render(HtmlTextWriter writer)
{
if (NonAdminUser)
{
// get details of links from xml file
QueryXmlDocumentForBuildingNavigationLinks();

// add the main html tag here
StringBuilder startingHTML = new StringBuilder();
startingHTML.Append(
//”<table height=’100%’ cellpadding=’0′ cellspacing=’0′ border=’0′>” + Environment.NewLine
//+”<tr valign=’top’>” + Environment.NewLine + “<td width=’4px’> <img src=’/_layouts/images/blank.gif’ width=’4′ height=’1′ alt=”> </td>” + Environment.NewLine
//+”<td valign=’top’ width=’100%’> <div class=’ms-quicklaunchouter’> <div class=’ms-quickLaunch’ style=’width: 100%’>” + Environment.NewLine
“<div id=’ctl00_PlaceHolderLeftNavBar_QuickLaunchNavigationManager’> <div>” + Environment.NewLine
+ “<table id=’zz2_QuickLaunchMenu’ class=’ms-navSubMenu1 zz2_QuickLaunchMenu_7 zz2_QuickLaunchMenu_2′ cellpadding=’0′ cellspacing=’0′ border=’0′>” + Environment.NewLine
);

StringBuilder mainHTML = new StringBuilder();
// Iterate the links collection here for adding the links

bool isChildPresent = false;

for (int linkIndex = 0; linkIndex < QuickNavigationLinksCollection.Count; linkIndex++)
{
if (string.IsNullOrEmpty(QuickNavigationLinksCollection[linkIndex].Header))
{// Header tag here
if (isChildPresent)
{ // Last part of child
mainHTML.Append(“</table>” + Environment.NewLine + “</td>” + Environment.NewLine + “</tr>”);
}
isChildPresent = false;
mainHTML.Append(“<tr id=’zz2_QuickLaunchMenun” + linkIndex + “‘ >”);
mainHTML.Append(Environment.NewLine);
mainHTML.Append(“<td>” + Environment.NewLine + “<table class=’ms-navheader zz2_QuickLaunchMenu_4′ cellpadding=’0′ cellspacing=’0′ border=’0′ width=’100%’>”);
mainHTML.Append(Environment.NewLine);
mainHTML.Append(“<tr>” + Environment.NewLine + “<td style=’width: 100%;’>”);
mainHTML.Append(Environment.NewLine);
mainHTML.Append(“<a class=’zz2_QuickLaunchMenu_1 ms-navheader zz2_QuickLaunchMenu_3′ style=’border-style: none; font-size: 1em;’>” + QuickNavigationLinksCollection[linkIndex].Title + “</a>”);
mainHTML.Append(Environment.NewLine);
mainHTML.Append(“</td>” + Environment.NewLine + “</tr>” + Environment.NewLine + “</table>” + Environment.NewLine + “</td>” + Environment.NewLine + “</tr>”);
mainHTML.Append(Environment.NewLine);

}
else
{
if (!isChildPresent)
{  // First part of child
mainHTML.Append(“<tr>” + Environment.NewLine + “<td>” + Environment.NewLine + “<table border=’0′ cellpadding=’0′ cellspacing=’0′ width=’100%’ class=’ms-navSubMenu2 zz2_QuickLaunchMenu_8′>”);
}

isChildPresent = true;
//mainHTML.Append(“<tr>” + Environment.NewLine + “<td>” + Environment.NewLine + “<table border=’0′ cellpadding=’0′ cellspacing=’0′ width=’100%’ class=’ms-navSubMenu2 zz2_QuickLaunchMenu_8′>”);
//mainHTML.Append(Environment.NewLine);
mainHTML.Append(“<tr onmouseover=’Menu_HoverStatic(this)’ onmouseout=’Menu_Unhover(this)’ onkeyup=’Menu_Key(event)’ id=’zz2_QuickLaunchMenun” + linkIndex + “‘>”);
mainHTML.Append(Environment.NewLine);
mainHTML.Append(“<td>” + Environment.NewLine + “<table class=’ms-navitem zz2_QuickLaunchMenu_6′ cellpadding=’0′ cellspacing=’0′ border=’0′ width=’100%’>”);
mainHTML.Append(Environment.NewLine);
mainHTML.Append(“<tr>” + Environment.NewLine + “<td style=’width: 100%;’> “);
mainHTML.Append(Environment.NewLine);
mainHTML.Append(“<a class=’zz2_QuickLaunchMenu_1 ms-navitem zz2_QuickLaunchMenu_5′ href='” + QuickNavigationLinksCollection[linkIndex].URL
+ “‘ style=’border-style: none; font-size: 1em;’>” + QuickNavigationLinksCollection[linkIndex].Title + “</a>”);
mainHTML.Append(Environment.NewLine);
mainHTML.Append(” </td>” + Environment.NewLine + “</tr>” + Environment.NewLine + “</table>” + Environment.NewLine + “</td>” + Environment.NewLine + “</tr>”);
//mainHTML.Append(Environment.NewLine + “</table>” + Environment.NewLine + “</td> </tr>”);
mainHTML.Append(Environment.NewLine);
}
}

if (isChildPresent)
{ // Last part of child
mainHTML.Append(“</table>” + Environment.NewLine + “</td>” + Environment.NewLine + “</tr>”);
}

StringBuilder endingHTML = new StringBuilder();
endingHTML.Append(“</table>” + Environment.NewLine + “</div>” + Environment.NewLine + “</div>”); // +Environment.NewLine + “</div>” + Environment.NewLine + “</div>” + Environment.NewLine + “</td>” + Environment.NewLine + “</tr>” + Environment.NewLine + “<tr>” + Environment.NewLine + “<td colspan=’2′>” + Environment.NewLine + “<img src=’/_layouts/images/blank.gif’ width=’138′ height=’1′ alt=”>” + Environment.NewLine + “</td>” + Environment.NewLine + “</tr>” + Environment.NewLine + “</table>”);

// Now write the complete html output
writer.Write(startingHTML.ToString());
writer.Write(mainHTML.ToString());
writer.Write(endingHTML.ToString());
}
base.Render(writer);
}
}

That’s it and you are done with the work