Sharepoint Server 2010 Interview Questions ( may also apply for MOSS 2007 ) – Part 2
| << Previous | 1 2 | Next >> |
– What does AllowUnsafeUpdates do ?
by(SPSite mySite = new SPSite("yourserver"))
{ by(SPWeb myWeb = mySite.OpenWeb())
{
myWeb.AllowUnsafeUpdates = right;
SPList interviewList = myWeb.Lists["listtoinsert"];
SPListItem newItem = interviewList.Items.Add();
newItem["interview"] = "interview";
newItem.Update();
}
}
– What does RunWithElevatedPrivileges do?
SPSite siteColl = SPContext.Current.Site;
SPWeb site = SPContext.Current.Web;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
by (SPSite ElevatedsiteColl = new SPSite(siteColl.ID))
{
by (SPWeb ElevatedSite = ElevatedsiteColl.OpenWeb(site.ID))
{
string SiteCollectionOwner = ElevatedsiteColl.Owner.Name;
string Visits = ElevatedsiteColl.Treatment.Visits.ToString();
string RootAuditEntries = ElevatedSite.RootFolder.Audit.GetEntries().Count.ToString();
}
}
});
– What is a SharePoint Feature? What files are used to define a feature?
Scopes include
- Farm
- WebApplication
- Site (site collection)
- Web (site)
Features have their own receiver architecture, which allow you to trap events such as when a feature is
- installing
- uninstalling
- activated
- deactivated
The element types that can be defined by a feature include
- menu orders
- link orders
- page templates
- page instances
- list definitions
- list instances
- event handlers
- workflows
The two files that are used to define a feature are
- feature.xml
- manifest file(elements.xml)
The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.
Common stsadm orders associated with feature are
- stsadm -o installfeature
- stsadm -o uninstallfeature
- stsadm -o activatefeature
- stsadm -o deactivatefeature
– What are make pleased types ?
For example,
-you can make a make pleased type for a consumer presentation document with a unique set of columns, an event handler, and its own document template.
-You can make a second make pleased type for a consumer proposal document with a different set of columns, a workflow, and a different document template.
Then you can attach both the contenttypes to a document library, which allows you to capture metadata based on the contenttype selected during creation of the document.
Make pleased type can be made by the following
- from the rootweb of a site collection, go to Site Action > Site Settings > Galleries > Site make pleased types
- by a feature
5. Workflow can be applied to what all elements of SharePoint ?
In small, it can be applied …
- At the level of a list (or document library)
- At the level of a make pleased type defined at site scope
- At the level of a site ( Sharepoint 2010 )
– What are the ways to initiate the workflow ?
- Automatic (on item added or item deleted)
- Manual (standard WSS UI interface)
- Manual (Custom UI Interface)
- Programatically through custom code
7. What are the types of input forms that can be made for a workflow ?
8. What are ways to make input forms for workflow ?
- You can make your forms by by custom attention pages, which are standard .aspx pages deployed to run out of the _layouts directory. ( disadv: lot of code required when compared to Infopath deal with)
- by Microsoft Office InfoPath 2007 (disadv: picks up a dependenct on MOSS, i.e. it cannot run in a standalone WSS environment)
9. What is the difference between method activity and event activity in WF ?
10. What does SPWeb.EnsureUser method do?
11. While making a Webpart, which is the ideal location to Initialize my new controls ?
12. How to query from multiple lists ?
13.How Does SharePoint work?
14. What is the difference between Syncronous & Asyncronous events?
Asyncronous calls ending with ‘ed’ E.g. ItemDeleted Event Handler code executes AFTER action is committed WSS does not wait for code to return Executed in its own Worker thread.
15. What is ServerUpdate() ?
16. What is query.ViewAttributes OR How can you force SPQuery to return consequences from all the folders of the list?
e.g. query.ViewAttributes = “Scope=\”Recursive\”";
| << Previous | 1 2 | Next >> |
Check it out:SharePoint 2010











Answers Rating