Friday, January 7, 2011

SharePoint Interview Questions -4

Que 6: How would you define configurable properties in a webpart?
Ans 6: Here is a simple example of creating a property that can be configured by the users. Notice how each attribute is separated by commas (,).

[code:c#]
[Browsable(false),Category("Miscellaneous"),
DefaultValue(defaultText),
WebPartStorage(Storage.Personal),
FriendlyName("Text"),Description("Text Property")]
public string Text
{
get
{
return text;
}

set
{
text = value;
}
}
[/code]

Que 7: What is a feature scope and where is it defined?
Ans 7: A feature scope restricts the use of feature to different heiarchy available in SharePoint object model. The scope is defined in the feature.xml file. Here are the different levels of scope available.

a) Web: This restrict the use of feature to the scope of a site e.g HR site feature cannot be used in Accounting Site.
b) Site: This restricts the use of feature to a specific Site Collection.
c) WebApplication: This restrict the use of feature to the scope of web application.
d) Farm: This is the highest level available. A feature defined with the scope of Farm is available to all the web application, site collections and websites defined in the Farm.

Que 8: What is a Site Definition? How can you create a new Site Definition?
Ans 8: A site definition is a collection of files that defines the structure & layout of site templates. Confused? Well, don't be. A site definition comprised of a webtemp.xml file which in turn defined the order of various site templates available in that site definition. Site definition file also include a separate directory structure that includes all the other core files required. The webtemp.xml file is stored in%COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML location and directory that contains all the core files is %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions \12\TEMPLATE\SiteTemplates.

Steps for creating a custom Site Definition.

Step 1.Create a copy of existing site Definition structure by navigating to %COMMONPROGRAMFILES%\\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates. Rename the file as NewLOB (short form for New line of business).

Step 2. Navigate to %COMMONPROGRAMFILES%\\Microsoft Shared\web server extensions\12\TEMPLATE\1033and copy the STS directory and paste it in the same strucutre and rename it as NewLOB.

Step 3. Create webTemp.xml file to register the site definition created in step 1&2.

Step 4. Reset IIS.

Thats it. Now, new site definition is available for use for the new line of business group.

Que 9: Explain the concept of feature Stapling?
Ans 9: In order to follow the best practices set forth by Microsoft, we should not modify the out-of-box site definiton file. So how would you achieve the customized needs of the business without having to create a brand new Site Definition files and structure? The answer is Feature Stapling. Feature stapling is a feature developed to staple (or read attach) another feature to one or more out-of-box site definition (technically speaking, it can include your custom site definition also). Here is an example of feature stapling that staples feature to different STS's.

[code:xml]
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureSiteTemplateAssociation Id="00BFE171-1B17-4F72-28CB-1171C0140130"TemplateName="STS#0" />
<FeatureSiteTemplateAssociation Id="00BFE171-1B17-4F72-28CB-1171C0140130"TemplateName="STS#1" />
<FeatureSiteTemplateAssociation Id="00BFE171-1B17-4F72-28CB-1171C0140130"TemplateName="STS#2" />
Elements>
[/code]

Que 10: What is the role of IFilter in SharePoint?
Ans 10: IFilter is a component installed on the server (Indexing and WFEs) to index documents that with file format associated with IFilter. Out-of-box WSS supports IFilter for Word, Excel, Text, HTML, PPT, OneNote & xps. If a company stores a lot of pdf documents, the a custom IFilter install is required to enable indexing and search to support pdf formats. PDF's IFilter is freely available and can be downloaded from Adobe's website. However for tiff files, there are no free IFilter available (atleast not to my knowledge).

No comments: