Event receivers allow responding to events as they occur within SharePoint, such as adding an item or deleting an item. They inherit from the SpItemEventReciever or SPListEventReciever base class
2. How to use an event receiver?
Event receivers respond to events, thus used for something as canceling an action, e.g. deleting a document library by using the Cancel property. This would prevent users from deleting any documents if you wanted to maintain the data.
3. Explain Difference between an asynchronous and synchronous event receivers?
An asynchronous event takes place after an action has taken place, and a synchronous event occurs before the action has take place.
A .ddf file: Data Directive File. It contains the metadata like the source files and their destination locations. The .ddf file is passed as a parameter to the MAKECAB utility to orchestrate construction of the SharePoint solution file.
A SharePoint solution file is compressed file that contains custom components. It is suffixed with a .wsp extension that aids in deployment.
Differences between the .cab and the SharePoint solution files are:
Solution files allow easy deployment to all Web Front End's.
Solution files are highly manageable from the interface.
Solution files can provide Code Access Security to avoid GAC deployments.
A solution file contains: aspx files, DLLs, resource files, definition files.
6. Explain ClassResources? How to reference and deploy resources with an ASP.NET 2.0 WebPart?
ClassResources are defined in the SharePoint solution file. It is a helpful directory to use in order to deploy custom images. In ASP.NET 2.0, objects (images) are referenced by embedding them as resources within an assembly. ClassResources allows us to eliminate recompiles to change small interface adjustments or alterations to external JavaScript files. Just saving the files can work.
WebPart properties are just like ASP.NET control properties, they are used to specify the characteristics of a webpart and by specifying the attributes with the desired values by a user. Some of the attributes are WebDescription, WebDisplayName, Category, Personalizable, and WebBrowsable.
8. Explain impersonation, and when would you use impersonation?
Impersonation is the concept of providing functionality in the context of a different identity, for example letting a user access the system with anonymous access. You would use impersonation in order to access resources on behalf of the user with a different account, that normally, that would provide just the very basic rights to access the system.
CAML: - Collaborative Application Markup Language.
It is an XML based language and provides data constructs used to build up the SharePoint fields and is also used for table definition. CAML is used to build or customize SharePoint based sites and construct a CAML query in a WebPart to retrieve values from a SharePoint List.
10. How to return SharePoint List items using SharePoint web services?
Create a reference to the SharePoint Lists.asmx web service by appending “/_vti_bin/Lists.asmx” to the end of a site name. One can use this url to add a service reference in Visual studio there onwards. This will query the WSDL for the Lists.asmx service.
Next step is to configure the security to be able to call the service methods. You can do this by altering the bindingConfiguration to indicate the transport uses NTLM authentication, which is the default.
We can then iterate through all the lists.
e.g:
ServiceReference1.ListsSoapClient proxy = new ServiceReference1.ListsSoapClient();
proxy.ClientCredentials.Windows.ClientCredential = new NetworkCredential();
XmlNode node = proxy.GetListCollection();
XPathNavigator nav = node.CreateNavigator();
XPathNodeIterator iter = nav.SelectDescendants("List", "http://schemas.microsoft.com/sharepoint/soap/", false);
while (iter.MoveNext())
{
string title = iter.Current.GetAttribute("Title", string.Empty);
string id = iter.Current.GetAttribute("ID", string.Empty);
Messagebox.Show ("title:" + title + “ and id:” + id);
}
writer.Flush();
11. What is the role of SPWebApplication object?
The SPWebApplication class consists of various methods and properties to perform various manipulations on web applications. i.e. Perform backups, add content databases, add site collections, set alert settings, change the web.config file etc. The class simply represents the IIS load balanced web application that is installed on the server farm.
12. What is the difference between SPSite and SPWeb object?
Difference between SPSite and SPWeb object
SPSite
The SPSite object represents a collection of sites, i.e. Site Collection, a top level site and all its sub sites.
SPWeb
The SPWeb object represents an instance of a SharePoint Web, and the SPWeb object contains things like the actual content
13. What is the role of SPWeb.EnsureUser method?
SPWeb.EnsureUser method validates whether the specified login name belongs to a valid user of the website or not. If the login name does not exist then it adds the login name to the website.
Eg:
Dim instance As SPWeb
Dim loginName As String
Dim returnValue As SPUser
returnValue = instance.EnsureUser(loginName)
14. What is the role of AllowUnsafeUpdates?
AllowUnsafeUpdates allows updates on a GET request. It basically allows code to bypass security validation while making changes to Sharepoint objects which are not executed within a HTTP POST request.
15. Which one is Better a UserControl or a WebPart?
Comparison of UserControl and WebPart
Advantages of UserControl:
Developers are already familiar with user controls which reduce the learning curve.
UserControls can be used with other ASP.NET applications. Hence reusable.
Developing user controls using Visual studio is much faster than building it through code as in the case of WebParts.
Disadvantages of UserControl:
There is a performance overhead as usercontrol use a shim as a wrapper to work with Sharepoint.
Deployment is a bit messy.
Advantages of WebPart:
Everything is available and customizable, i.e. toolbar, behavior, content etc.
Better performance as there is no shim wrapper.
Provide a structured deployment mechanism.
Disadvantages of WebPart:
Developers are unfamiliar so learning curve is steeper.
They are strictly for Sharepoint and won't work with other ASP.NET applications. Thus not reusable.
16. Explain the WebPartManager sealed class? What is its purpose?
The WebPartManager sealed class manages everything in context of a WebPart page, i.e. WebParts controls, events, functionality in WebPartZones etc. It is also known as the central class of the WebPart control set.
17. What is the Security methods(Authentication methods) available in sharepoint?
Authentication methods supported by Sharepoint:
Classic-mode authentication methods
Anonymous
Basic
Digest
Certificates
NTLM
Negotiate (Kerberos or NTLM)
Claims-based authentication methods
Windows
Anonymous
Basic
Digest
Certificates
NTLM
Negotiate (Kerberos or NTLM)
Forms Based
LDAP
SQL Database or other databases
Custom or third party membership and role providers
SAML token-based authentication
Active directory federation services 2.0
Windows Live ID
Third-party identity providers
18. What is the role of RunWithElevatedPrivileges?
RunWithElevatedPrivileges executes code as the System account. This basically then means that the code that you supply as a delegate to the method, has full permissions to modify SharePoint objects in question.
19. Explain Application Pages in SharePoint?
One can create custom application pages to add GUI components in Sharepoint. Unlike site pages, an application page is deployed only once per Webserver. Application pages cannot be customized based on sites, and are based on virtual _layouts directory. Application pages are all compiled together into a single dll and are also used across all sites within a server farm. They are preferred to site pages because of their performance benefits over them and they also support inline code.
20. Can you explain How do the sub sites work in SharePoint?
Sharepoint Websites exist in a hierarchy. At the top of the hierarchy is a Top-Level website. There can then be multiple sub sites under this top-level website and sub sites under sub sites. The entire structure is then called a site collection.
Administrators can decide who can create sub sites under the top level website. One can see the list of sites and sub sites below the top level site by using the Sites and Workspaces web page. The list shows only one level at a time.
The Sharepoint Team Services provides an efficient text based search capability to find documents and information.
Features of search component:
Consistent and familiar search experience.
Increased relevance of results as a result of a search.
Search for people and expertise
Ability to index and search data in other business applications using business connectors.
Improved manageability and extensibility.
22. Explain the features of the new Content management in Office SharePoint 2007?
MOSS provides enhanced document management including document authoring, business document processing, web content management and publishing, records management, policy management, and support for multilingual publishing.
Content management is divided into 3 categories:
Document management: Manage documents in the Document Center, Manage translation documents and processes, Convert documents on the server, and Integrate document management on the server and the client.
Records management: Implement information management policies, Limit actions on files that are downloaded from sites, Manage records retention in the Records Center, and Manage e-mail records.
Web content management: Improve the consistency and efficiency of your site design, Customize sites with Office SharePoint Designer 2007, Publish SharePoint sites more systematically, Create and update pages from the Web-based content editor, Create and update pages from 2007 Office release client programs, Create and maintain variations of a site, Manage site navigation more easily, and Manage sites more effectively.
23. Do you know How is SharePoint Portal Server different from the Site Server?
The Sharepoint Site Server has search capabilities which are more advanced using SharePoint. It uses digital dashboard technology, which provides a nice interface for creating web parts and also allows showing them on dashboards pages. Site Server on the other hand, does not have anything as advanced as that. The biggest difference would be Sharepoint Portal Server's document management features which also integrate with web folders and MS Office.
24. What is the difference between a site and a web?
A collection of sites along with the top level site is known as a single site collection in Sharepoint. While creating a new Web Application, one has to follow creating a site collection to specify the content of the web application. A web application can thus even contain thousands of site collections. The web application is needed to host those site collections. Web application is the logical & physical partition/container within IIS to create portals.
25. What are advanced features of MOSS 2007?
Advanced features of MOSS 2007:
My site personal site: Provides users an opportunity to aggregate information into “for me, by me, about me”.
User profiles and profile store: Enables every user to store profile information.
Audience targeting: Allows use of Webpart based pages, Web parts, and content to target distribution lists and groups.
Infopath forms services: Enable designing web based forms and distribute them on intranets, internet. User can use the forms in a browser, or even mobile devices supporting browsers without any client components.
Business data catalog: Allows for integration of external data into MOSS. This provides the users with a consistent GUI experience. Enhanced workflow engine
Provides BI and reporting capabilities
Provides records management capabilities.
26. How to make site public? By default, all sites are created private?
To make a sharepoint website public, enable anonymous access for the entire site. One can then pass on the url for the website through emails etc and allow public users to access the sharepoint website.
Steps to make a sharepoint website public:
Login as an administrator
Click on site settings
Click on Go to Site Administration
Click on Manage anonymous access
Choose one of the three conditions on what Anonymous users can access:
Entire Web site
Lists and libraries
Nothing
To make My Site public turn on anonymous access. Steps to do so:
Click Site Settings, On your Products site.
Under Administration, click Go to Site Administration.
On the Site Administration page, under Users and Permissions, click Manage anonymous access.
In the Anonymous Access section, click Entire Web site or Lists and libraries.
To turn off anonymous access, in the Anonymous Access section, click Nothing.
Click OK
27. How to invite users to join a Windows SharePoint Services Site?
Sharepoint based websites can be configured to be password protected to restrict access to users. Only registered users can then access it and an invitation to those users is sent via email. Moreover, they also support roles, enabling administrators to restrict certain members based on their roles to certain permissions. When adding a new user, one may store their email address and request sharepoint to send an email to the user to enable them to access the sharepoint based website. Shrepoint itself provide with web pages to administer users, user groups, roles and permissions to ensure security and ease of user management on sharepoint based websites.
Difference between MOSS and MOSS for Internet sites:
MOSS
Content, information, and applications are meant to be used by internal people/employees.
Needs License for MOSS and CAL (client access Licenses) for each client accessing it.
Used for Intranet Portals
MOSS standard licenses for database and servers.
MOSS for Internet sites
Content, information, and applications are meant to be used by external people.
Does not need CAL. License only needed for MOSS for Internet Sites.
Used for extranet/Internet facing portals.
Acquire External Connector (EC) licenses for each copy of the Windows Server 2003, SQL Server software that will be accessed by your external users only.
Data Protection Manager provides the ability to backup an entire sharepoint farm including the SQL Server databases, metadata, farm configuration files and indexes for federated search. Bakups can be automated to occur upto 4 times an hour based on the need. DPM starts by backing up a baseline copy of the sharepoint environment. It then there onwards performs full backups on regular basis using the sharepoint VSS writer and underlying component VSS writers to identify blocks or fragments of the farm and content databases which have changed. It is designed for sharepoint administrators and provides them with wizards and workflows to help protect the data. It represents data to be protected in the same context as the user accesses it.
30. What is System Center Data Protection Manager 2007 (DPM)? Explain its purpose in MOSS?
DPM is designed for the Sharepoint Administrator using a variety of wizards and workflows to help ensure protection of data. It provides the following benefits in terms of MOSS:
Provides Built in support for Sharepoint services (WSS) and MOSS
Provides consistency checks for windows sharepoint server farms
Re-validates only those parts of a windows sharepoint services replica for which data backup is inconsistent.
Provides support for MOSS with Mirrored SQL Server databases.
Presents the data to be protected in the same context as user accesses it. Sharepoint Administrators simply select the farm to be protected, DPM understands what components need to be backed up
31. How to create input forms for workflow?
MOSS has the capability for a workflow participant to fill an initiation form to start a workflow. The initiation form can have fields that support:
Single line of text
Multiple lines of text
Number (up/down counter arrows)
Yes/No (Checkbox)
Choice (dropdowns)
Date and time (calendar)
One can use these to create forms by using custom application pages (aspx pages), which are deployed to run out of the _layout directory on MOSS server or using Microsoft Office Infopath 2007
32. Explain the types of input forms that can be created for a workflow?
MOSS has the capability for a workflow participant to fill an initiation form to start a workflow. The initiation form can have fields that support:
Single line of text
Multiple lines of text
Number (up/down counter arrows)
Yes/No (Checkbox)
Choice (dropdowns)
Date and time (calendar)
Types of input forms:
Association, Initiation, Modification and Task edit.
33. Explain Two types of workflow supported, i.e. Sequential, State Machine?
Types of workflow supported:
Sequential: Sequential workflow as the name suggests simply depicts the fact that there is a collection of tasks which need be completed in a sequence one by one. The workflow progresses as each and every single task is completed in the workflow.
State: This category of workflow includes collection of states of the document (which it can be in). The workflow progresses based on how the state of the document changes and progresses.
34. How to implement workflow in SharePoint?
Steps to implement workflows in MOSS:
Add workflow to a document library, routing document to different people for approval
Document author starts the workflow and creates document approval tasks, and assigns these tasks to various participants/people.
Author sends an email to various participants with task instructions and a link to the document in question.
As participants complete their actions one after the other, they can view the status of the document.
The workflow ends when all participants have completed their tasks regarding the document.
Author of the workflow is notified via an email after the workflow has ended.
35. Explain the ways to initiate the workflow?
Ways to initiate a workflow:
Once a workflow has been linked to a document, one can start the workflow by selecting the workflow that you want from the list of workflows available for the document or item. If needed, one may have to fill a form with the information that is needed by the workflow. Based on how the workflow was configured, it might be possible to customize it and start it.
There are basically 3 ways, Manually, When new list item is added, and When a new list item is updated.