Latest MCTS 70-573 Dumps Real Exam Download 51-60

Ensurepass

QUESTION 51

You use a third-party site definition to create SharePoint sites.

You need to add a Web Part to the home page of the site definition.

Which file should you modify?

 

A. default.master

B. Onet.xml

C. Sp.xml

D. web.config

 

Correct Answer: B

Explanation/Reference:

MNEMONIC RULE: “third-party site definition = Onet.xml”

You can perform the following kinds of tasks in a custom Onet.xml file that is used for either a custom site definition or a custom web template:

Specify an alternative cascading style sheet (CSS) file, JavaScript file, or ASPX header file for a site definition.

Modify navigation areas for the home page and list pages.

Add a new list definition as an option in the UI.

Define one configuration for the site definition or web template, specifying the lists, modules, files, and Web Parts that are included when the configuration is instantiated.

Specify Features to be included automatically with websites that are created from the site definition or web template.

Understanding Onet.xml Files http://msdn.microsoft.com/en-us/library/ms474369.aspx

 

clip_image002

Explanation/Reference:

MNEMONIC RULE: “custom site definition = Onet.xml”

You can perform the following kinds of tasks in a custom Onet.xml file that is used for either a custom site definition or a custom web template:

Specify an alternative cascading style sheet (CSS) file, JavaScript file, or ASPX header file for a site definition.

Modify navigation areas for the home page and list pages.

Add a new list definition as an option in the UI.

Define one configuration for the site definition or web template, specifying the lists, modules, files, and Web Parts that are included when the configuration is instantiated.

Specify Features to be included automatically with websites that are created from the site definition or web template.

Understanding Onet.xml Files http://msdn.microsoft.com/en-us/library/ms474369.aspx

 

 

QUESTION 53

You create a custom site definition named DCS.

You create a site provision handler for DCS.

DCS contains a file named DCSTemplate.xsd that stores configuration data. You need to read the content of DCSTemplate.xsd in the site provision handler.

Which property should you use?

 

A. SPSite.GetCustomWebTemplates(1033)[“DCS”].ProvisionClass

B. SPWebApplication.DataRetrievalProvider

C. SPWebProvisioningProperties.Data

D. SPWebProvisioningProperties.Web.DataRetrievalServicesSettings

 

Correct Answer: C

 

Explanation/Reference:

MNEMONIC RULE: “configuration data = SPWebProvisioningProperties.Data”

Gets custom data that is used in creating the Web site.

SPWebProvisioningProperties.Data Property http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebprovisioningproperties.data.aspx

 

 

QUESTION 54

You create custom code to import content to SharePoint sites.

You create a custom site definition by using Microsoft Visual Studio 2010.

You need to ensure that when a new site that uses the site definition is created, the custom code executes

after the site is created.

Which class should you add to the project?

 

A. SPChangeFile

B. SPItemEventReceiver

C. SPWebEventReceiver

D. SPWebProvisioningProvider

 

Correct Answer: D

Explanation/Reference:

MNEMONIC RULE: “new site created = SPWebProvisioningProvider”

Provides a handler for responding to Web site creation.

SPWebProvisioningProvider Class http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebprovisioningprovider.aspx

 

 

QUESTION 55

You create a custom Web Part.

You need to verify whether the Web Part causes any memory leaks.

Which tool should you use?

 

A. SPDisposeCheck.exe

B. SPMetal.exe

C. Wca.exe

D. WinDbg.exe

 

Correct Answer: A

 

Explanation/Reference:

MNEMONIC RULE: “memory leaks = SPDisposeCheck”

SPDisposeCheck is a tool that helps developers and administrators check custom SharePoint solutions that use the SharePoint Object Model helping measure against known Microsoft dispose best practices. This tool may not show all memory leaks in your code and may produce false positives which need further review by subject matter experts.

SharePoint Dispose Checker Tool http://archive.msdn.microsoft.com/SPDisposeCheck

 

 

QUESTION 56

You are creating a Web Part that will be deployed as a sandboxed solution.

You need to ensure that the Web Part can write debugging information to the SharePoint trace logs.

Which class should the logging component inherit?

 

A. SPDelegate

B. SPLog

C. SPPersistedObject

D. SPProxyOperation

 

Correct Answer: D

Explanation/Reference:

MNEMONIC RULE: “sandboxed solution needs SPProxyOperation”

You can implement your full-trust functionality in classes that derive from the SPProxyOperation abstract

class and deploy the assembly to the global assembly cache. These classes expose a full-trust proxy that

you can call from within the sandbox environment.

Full-trust proxies can provide a useful way to expose logging and configuration functionality to sandboxed

applications.

Hybrid Approaches http://msdn.microsoft.com/en-us/library/ff798433.aspx

 

 

QUESTION 57

You update a solution validator.

You need to ensure that all SharePoint solutions are validated the next time the solutions are executed.

What should you do?

 

A. Modify the Guid attribute of the solution validator.

B. Deactivate and activate all of the installed solutions.

C. Modify the Signature property of the solution validator.

D. In the Feature that deploys the solution validator, modify the Version attribute of the Feature element.

 

Correct Answer: C

Explanation/Reference:

MNEMONIC RULE: “signature solution validator”

Gets or sets the version number and state hash of a solution validator.

SPSolutionValidator.Signature Property http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.usercode.spsolutionvalidator.signature.aspx

 

 

QUESTION 58

You are creating a Web Part. The Web Part will be used in a SharePoint subsite that has the URL http:// www.contoso.com/hr.

You need to ensure that the Web Part activates a Feature in the subsite without causing a memory leak.

Which code segment should you use?

 

clip_image004

 

Correct Answer: B

Explanation/Reference:

MNEMONIC RULE: “no memory leak = SPContext; subsite = WebFeatures”

Gets the activated site features of the Microsoft SharePoint Foundation context.

SPContext.WebFeatures Property

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontext.webfeatures.aspx

 

 

QUESTION 59

You create a Web Part that takes three values from three text boxes and creates a new SharePoint site when you click a button named CreateNewSite.

The Web Part contains the following code segment.

protected void CreateNewSite_Click(object sender, EventArgs e)

{ SPSite site = SPContext.Current.Site;

SPWeb web = site.AllWebs.Add(SiteNameTextBox.Text, SiteTitleTextBox.Text,SiteDescriptionTextBox.Text, 0, SPWebTemplate.WebTemplateSTS, false, false);}

You test the Web Part and it works properly.

When another user attempts to use the Web Part to create a new site, he receives the following error message: “Error: Access Denied.”

You need to ensure that users can use the Web Part to create new sites.

What should you do?

 

A. Add web.Update()after the code segment.

B. Add web.ValidatesFormDigest()after the code segment.

C. Run the code segment inside a SPSecurity.RunWithElevatedPrivilegesdelegate.

D. Add the following code after the code segment:

SPUser currentUser = System.web.CurrentUser;

web.Users.Add(currentUser.LoginName, currentUser.Email, currentUser.Name,””);

 

Correct Answer: C

 

Explanation/Reference:

MNEMONIC RULE: “Access Denied = RunWithElevatedPrivileges”

SPSecurity.RunWithElevatedPrivileges Method http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx

 

 

QUESTION 60

You have a SharePoint site collection that contains 100 subsites.

You plan to create a Web Part. The Web Part will be deployed to each subsite.

You need to ensure that the Web Part retrieves all of the files in the root directory of the current subsite.

You write the following code segment. (Line numbers are included for reference only.)

01 SPSite site = SPContext.Current.Site;02 SPWeb web = SPContext.Current.Web;03

Which code segment should you add at line 03?

 

 

A. site.AllWebs[1].Files;

B. Site.RootWeb.Lists[0].Items;

C. web.Files;

D. web.RootFolder.SubFolders[0].Files ;web.Users.Add(currentUser.LoginName, currentUser.Email, currentUser.Name,””);

 

Correct Answer: C

Explanation/Reference:

MNEMONIC RULE: “current subsite = web = web.Files”

Gets the collection of all files in the root directory of the website.

SPWeb.Files Property

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.files.aspx

 

Download Lates MCTS 70-573 Real Free Tests , help you to pass exam 100%.