Tuesday, December 29, 2009

Building and Deploying Solution Packages

Hello Guys,

First let's be clear on exactly what a Solution package is. Note I'm using 'Solution' with a capital S  in this article to distinguish between what we are discussing here and the general idea of a technical solution built using SharePoint. A Solution is a package of SharePoint items for deployment - in physical terms it is a cabinet file (.cab) which is given the extension of .wsp to differentiate it from standard .cab files. Other articles on this blog cover the idea of using SharePoint Features to deploy functionality, so let's also be clear on the relationship between Features and Solutions. In general terms, some of the tasks which cannot be done with a Feature alone but can be done with a Solution include:

  • Deployment of certain files to the filesystem, e.g. an assembly for workflow or web parts, custom files which will reside in the ‘12’ folder 
  • Deployment of web part definition files (.webpart)
  • Web.config modifications e.g. the ‘SafeControls’ entry required for a custom web part
  • Code Access Security config modifications e.g. those required for custom web parts not running from the GAC
In addition to being able to do these things, Solutions can also contain Features. The way I think of it is that the Solution wraps the Feature. In actual fact, I always recommend that even if they don't need to be (e.g. we're not doing anything in the list above), Features are always deployed as part of a Solution.  The reason for this is that the Solution framework takes care of deploying all required files to all Web Front End (WFE) servers in a SharePoint farm. This alone is incredibly useful in working towards repeatable deployments, and ensures your WFEs stay synchronized.


How Solutions are specified
The key file used to specify what a Solution package consists of is the manifest.xml file. Going back to my earlier post on deploying web parts, the manifest.xml file for that scenario looks like this:

<Solution xmlns="http://schemas.microsoft.com/sharepoint/" SolutionId="122C0F04-78B7-4d42-9378-6F8B4F93ADD1">
  <FeatureManifests>
   
    <FeatureManifest Location="COB.Demo.WebPartDeployment.WriteToFileWebPart\feature.xml" />
  FeatureManifests>
  <Assemblies>
    <Assembly     Location="COB.Demo.WebPartDeployment.WriteToFileWebPart\COB.Demo.WebPartDeployment.WriteToFileWebPart.dll"
        DeploymentTarget="GlobalAssemblyCache">
      <SafeControls>
        <SafeControl Assembly="COB.Demo.WebPartDeployment.WriteToFileWebPart, COB.Demo.WebPartDeployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5"
                    Namespace="COB.Demo.WebPartDeployment"
                    Safe="True"
                    TypeName="*" />
        SafeControls>
    Assembly>
  Assemblies>
  <DwpFiles>
    <DwpFile
     Location="COB.Demo.WebPartDeployment.WriteToFileWebPart\COB.Demo.WebPartDeployment.WriteToFileWebPart.webpart"
      FileName="COB.Demo.WebPartDeployment.WriteToFileWebPart.webpart" />
  DwpFiles>
Solution>

This is assuming the web part is being deployed to the GAC - for this illustration this is a simpler scenario than deploying to the web application's bin directory, where Code Access Security (CAS) policy would also be required. Effectively, the manifest specifies that the Solution package consists of the following:
  • a Feature with a header file named 'feature.xml'
  • an assembly for deployment to the GAC named 'COB.Demo.WebPartDeployment.WriteToFileWebPart.dll'
  • an entry in the SafeControls section of the application's web.config file, specifying all types in the specified assembly should be treated as safe
  • a web part definition file named 'COB.Demo.WebPartDeployment.WriteToFileWebPart.webpart' - this will be deployed to the web part gallery on the site
Importantly, all these details in the manifest.xml file are only used by SharePoint when the generated Solution package is deployed. They are effectively the instructions which say "go and get this item from the .wsp file and put it here". The actual process for generating the .wsp file is another task.

Building Solution packages
There are 2 options for building the actual package - build it manually using makecab.exe, or use an automated solution - there are several community-developed tools/techniques available. Since it's always good practise to understand what's actually happening in such processes, we'll cover how to do it manually here.
The first step is to write a .ddf (Diamond Directive File). This is a set of instructions for makecab.exe on how to build the folder hierarchy inside the .cab file. For my web part example, my file looks like:

.OPTION Explicit
.Set CabinetNameTemplate="COB.Demo.WebPartDeployment.WriteToFileWebPart.wsp" 
.Set DiskDirectory1="Package"
;***

manifest.xml

;** this directory name is used for the folder name under 12\TEMPLATE\Features, so should
;** match up with what you want to call the feature!
.Set DestinationDir=COB.Demo.WebPartDeployment.WriteToFileWebPart
elements.xml
feature.xml

.Set DestinationDir=COB.Demo.WebPartDeployment.WriteToFileWebPart
WebPart\COB.Demo.WebPartDeployment.WriteToFileWebPart.webpart
WebPart\COB.Demo.WebPartDeployment.WriteToFileWebPart.dll

;***

This file tells makecab.exe to do the following:
  • create a .cab file named 'COB.Demo.WebPartDeployment.WriteToFileWebPart.wsp'
  • put the 'manfest.xml' file at the root of the hierarchy
  • put the 'elements.xml' and 'feature.xml' files in a subfolder called 'COB.Demo.WebPartDeployment.WriteToFileWebPart'
  • also put the 2 other files (with extensions .webpart and .dll) in this same subfolder, but that makecab.exe should look for these files in a subfolder on the main filesystem called 'WebPart'
This instructions file is then passed to makecab.exe with the following command-line command:
D:\SolutionDeployment\Development\COB.Demo.WebPartDeployment>"C:\Program Files\Microsoft Cabinet SDK\BIN\MAKECAB.EXE" /f COB.Demo.WebPartDeployment.ddf

Couple of things to note here. At the command prompt we have ensured the current directory is the directory where all our Solution files are kept. This ensures that our relative references in the .ddf file above can be resolved. We pass the /f parameter to indicate we are passing a directives file, and also pass the location of this file.
Assuming all the files/references are OK, this results in a .cab file with a .wsp extension which will be created in a subfolder under the current directory called 'Package' (the folder will be created for you if it doesn't exist). We now have a Solution package which can be deployed to another SharePoint server. But first let's take a peek inside - this can be done by temporarily renaming the extension to .cab. You should then see something like:


Tuesday, December 8, 2009

SharePoint Interview Questions

Hi Friends,

                Below is the link for SharePoint Interview Questions. Please go through it.

                http://it.toolbox.com/wiki/index.php/Sharepoint_Interview_questions


Thanks & Best Regards,
 Rakesh

Wednesday, November 4, 2009

Extranet Collaboration Manager for SharePoint 2007

Hello Folks,

                 Planning and implementing a collaborative extranet environment using SharePoint 2007 brings with it a unique set of challenges that you as a SharePoint administrator must overcome to be successful. Primarily, you want to provide SharePoint sites for your users to collaborate with customers, suppliers, and partners, but you have to be sure that proper security is maintained. You've probably decided that you want to keep extranet user account data stored separately from internal user data, but who is going to manage those extranet users, and how will these user managment activities be controlled and audited? What about requests from extranet users for new SharePoint sites? How will requests for new extranet sites be processed and subsequently provisioned?



The solution to the challenges you are facing is our new Extranet Collaboration Manager for SharePoint 2007 product. ExCM comes in two versions - Standard Edition and Enterprise Edition.

•ExCM - Standard Edition provides you with a suite of tools to Simplify SharePoint 2007 extranet user access and management. See the ExCM product page for more details.

•ExCM - Enterprise Edition allows your users to submit a request when he or she would like to have a new SharePoint 2007 site provisioned. You can easily associate custom workflows with the new site requests, asking for approval prior to site creation. Once a site request is approved, ExCM - EE will automatically provision the site for you using any SharePoint 2007 site definition you have specified.

I'm happy to announce that ExCM - Standard Edition is now available for download from new SharePoint Solutions Software site.





Thursday, October 29, 2009

Resources for SharePoint Developers

Hello,

      
SharePoint Developer Introduction for .NET Developers

http://www.microsoft.com/click/SharePointDeveloper/

SharePoint 2007 Videos and Webcasts
http://msdn.microsoft.com/en-us/office/aa940989.aspx

Microsoft SharePoint Team Blog
http://blogs.msdn.com/sharepoint/

Best Practices Resource Center for SharePoint 2007 (NEW)
http://technet.microsoft.com/en-us/office/sharepointserver/bb736746.aspx

SharePoint Practice and Guidance
http://msdn.microsoft.com/en-us/library/dd203468.aspx
http://www.codeplex.com/spg




Tuesday, October 6, 2009

Interview Questions on Sharepoint

This are the some of the interview questions on SharePoint

1.  Overview of Project?


2.  MOSS 2007 Workflows experience? 

3. MSCOE work 

4. Describe last Project you did 

5. Your role in the Project? 

6. Most significant recent Projects in .NET technology 

7. Windows services vs WCF 

8. What is Service Endpoint? 

9. What is ASMX vs. WCF? 

10. What is View state Object? 

11. A) Have you worked with Master Page? 

    B) How to define Master Types, How to Access Master page properties in content pages.

12. ON a content page, how do you put Master page? 

13. What is a Strong Name? And its significance?

14. What is GAC? 

15. Where do you find GAC info? 

16. Have you worked with Generics in C#? 

17. What is an Abstract class? 

18. What have you done in SharePoint? 

19. Have you worked with Features in SharePoint?  Why features are used?

20. Where are the Documents being created in SharePoint? 

21. Which events are handled? What is the difference between synchronous and asynchronous events?

22. How you handled sessions and why?

23. What are Caml queries? 

24. What is a web part? 

25. In .NET, what is User Control? 

26. What is the difference between web part and user control? 

27. What are the main building blocks, when you create a custom field control? 

    Why we use custom field control, advantage over web part? How custom field helps in customization?

28. Have you worked on JavaScript? 

29. Do you know the declaration syntax of Arrays and classes in JavaScript? 

30. Which versions of SQL Server have you worked on? 

31. Worked with Integrated SQL Reporting Service with MOSS?

Sunday, September 13, 2009

Reg: Configuring and Implementing SSL in SharePoint

Hi Everyone, You can get the information regarding the implementation and Configuring from the below link. http://www.isaserver.org/img/upl/spskit/5installcaandssl/5installcaandssl.htm

Configuring Secure Socket Layer in MOSS 2007

Hi,

A SharePoint 2007 development can get quite complex depending on the business case and requirements of your customer. Last year I have worked on a few SharePoint 2007 solutions. During the development I have noticed that it is extremely helpful if you know how the customer's infrastructure will look like. It will help you even more if you will configure your development environment to resemble the customer's infrastructure as much as possible.

One of the things you should definitely consider is working with anonymous access and SSL support from the very beginning if applicable because they have major impact on the custom code you might need to create. Examples of the things you should be considering are Regular Expression for url parsing and privileges elevation if required to access some of the SharePoint properties. Finding out that your solution doesn't work in the real environment might be painful – especially if it's after it all has been deployed.

Setting up anonymous access in SharePoint 2007 is really straight forward and can be done by turning on two checkboxes. It is a bit more difficult to set up a working SSL certificate on your development machine though. It's all get difficult if you don't have the access to a server issuing certificates and all you want is a dummy certificate for development purposes only.

Let's begin with creating a new SharePoint 2007 Web Application which will use SSL:



The most important here is setting up the port to 443 and enabling SSL support. Configuring these settings correctly should automatically create the correct load balanced url beginning with https and ending with :443.

Now we have the Web Application, we are ready to create and link the SSL certificate. I have assumed you don't have access to a certificate server and you need to create an SSL certificate by yourself. To do so, you will first of all need the IIS 6.0 Resource Kit Tools. It contains a tool called SelfSSL which will create and link the dummy SSL certificate. After the installation you are almost ready to run the tool. The last detail you need to have is the ID of your Web Application which is required by SelfSSL. You can obtain it quite easily by running the IIS Manager > Properties of your Web Application and then opening the Logging Properties dialog.



The Web Application ID is the long number following W3SVC and in our case is 75208739:



Now we have all the details we must run SelfSSL by calling from the command prompt:

SelfSSL.exe /S:75208739 /T /Q

The SSL certificate will get automatically created and linked to our Web Application which will allow us to work with SharePoint through SSL.

Summary
Making your SharePoint 2007 development environment resemble the customer's production environment turns very useful during custom development. It allows you to debug your solution earlier and much more accurately. Furthermore you are able to test your deployment procedure much earlier in your development process what will spare you some unpleasant surprises afterwards.
Configuring anonymous access and SSL support if applicable isn't very difficult and covers the most common development issues. It is therefore worth making an integral part of your SharePoint 2007 development environment initiation.


Filed under: Uncategorized

Cancel reply
Your email is never shared.
Required fields are marked *

Name *


Email *


Website





Allowed tags:


Tuesday, September 1, 2009

Exchange Server

Hi Everyone,

I need some information regarding Exchange Servers in SharePoint.


Regards,
Rakesh.