Which code segment should you add at line 13?
You create a Web Part that queries a list. The Web Part contains the following code segment.
(Line numbers are included for reference only.) 01Protected Overloads Overrides Sub
Render(ByVal writer As HtmlTextWriter) 02 Dim spInToken As SPUserToken =
GetTheContext(SPContext.Current.Site) 03 Using aSite As New SPSite(curSiteCtx.ID,
spInToken) 04 … 05 End Using 06 End Sub 07Private Function GetTheContext(ByVal nWeb As
SPSite) As SPUserToken 08 nWeb.CatchAccessDeniedException = False 09 Dim spToken As
SPUserToken = Nothing 10 Try 11 spToken = nWeb.SystemAccount.UserToken 12 Catch
generatedExceptionName As UnauthorizedAccessException 13 14 End Try 15 Return spToken
16End Function You need to ensure that users without permissions to the list can view the
contents of the list from the Web Part. Which code segment should you add at line 13?
You need to delete the previous versions of all documents in a document library
You need to delete the previous versions of all documents in a document library. The deleted
versions of the documents must be retained in the SharePoint Recycle Bin. What should you do?
Which code segment should you add at line 09?
have a SharePoint site collection that has the URL http://contoso/sites/finance. You are creating a
Microsoft .NET Framework console application that will use the SharePoint client object model to
create a site in the site collection. The application contains the following code segment. (Line
numbers are included for reference only.) 01Dim cCtx As New
ClientContext(“http://contoso/sites/finance”) 02Dim root As Web = cCtx.Site.RootWeb
03cCtx.Load(root) 04Dim webInfo As New WebCreationInformation() 05webInfo.Title = “site1”
06webInfo.Url = “site1” 07webInfo.WebTemplate = “MPS#2” 08root.Webs.Add(webInfo) 09
10cCtx.Dispose() You need to ensure that the application creates the site. Which code segment
should you add at line 09?
Which code segment should you add at line 04?
You need to create a Web Part that adds a term set to the current SharePoint site collection’s
term store. You write the following code segment. (Line numbers are included for reference only.)
01Dim txtBoxTermSetToAdd As New System.Web.UI.WebControls.TextBox() 02Dim session As
New TaxonomySession(SPContext.Current.Site) 03Dim addedTerm As TermSet =
session.TermStores(0).Groups (“MyNewTermStore”).CreateTermSet(txtBoxTermSetToAdd.Text)
04 Which code segment should you add at line 04?
You need to apply the custom master page to the site and ensure that future pages added to the site…
You have a SharePoint site. The current master page of the site is v4.master. You create a
custom master page named MyMasterPage.master and deploy it to /_catalogs/masterpage/. You
need to apply the custom master page to the site and ensure that future pages added to the site,
including system and application pages, automatically use the custom master page. You must
also ensure that future SharePoint updates do not remove or modify the changes you have made.
What should you do?
Which code segment should you add to the Web Part?
You plan to develop a Web Part that displays a SharePoint list. The Web Part will verify the list
permissions when users access it by using the web.CurrentUser.DoesUserHavePermissions
method. You need to ensure that when users do not have permissions to the list, the Web Part
displays the company’s logo. Which code segment should you add to the Web Part?
What should you create?
You are developing a Feature that will be used in multiple languages. You need to ensure that
users view the Feature’s title and description in the display language of their choice. What should
you create?
Which code segment should you implement in the Web Part?
You need to create a Web Part that creates a copy of the out-of-the box Contribute permission
level. Which code segment should you implement in the Web Part?
Where should you define the workflow action?
Using Microsoft Visual Studio 2010, you create a custom workflow action named WF1 that copies
the content of a document library to another document library. WF1 is used in a Microsoft
SharePoint Designer reusable workflow. You need to ensure that the workflow action can be
deployed to multiple sites. Where should you define the workflow action?
You need to ensure that the consumer Web Parts can receive data from the provider Web Part
You plan to create one provider Web Part and two consumer Web Parts. You need to ensure that
the consumer Web Parts can receive data from the provider Web Part. You create an interface
that contains the following code segment. Public Interface Interface1 Property Parameter1 As
String End Interface What should you do next?