SharePoint Study Notes-exercise series-70-573 exercise analysis-(Q40-Q44)

Source: Internet
Author: User
Tags visual studio 2010

Question 40
you need to send a single value from a consumer Web part to a provider Web part.
which interface shocould you use?
. ialertpolicyhandler
B. iwebpartfield
C. iwebpartparameters
D. iwebpartrow

Resolution:
The purpose of this question is to transfer "single value" data between webparts.
Direct Analysis options:
Option A. ialertpolicyhandler provides methods for sending alert information in Microsoft. Sharepoint. dll. For example, alert email may be defined through ialertpolicyhandler. Obviously, this interface has nothing to do with the webpart connection. Let alone transfer "single value" data between two webparts.
Option B. iwebpartfield this interface is used to implement a standard interface for connecting components and controls based on data fields, that is, to transmit "single value" data between them, which is exactly the answer to this question.
Option C. iwebpartparameters: In a Web part connection, data is usually sent from the provider to the user. However, in some cases, the provider needs USER Parameters to determine which values should be sent back. The iwebpartparameters interface defines the Members to be implemented. These members help to pass parameters from the user to the provider. That is to say, it is used to control the data sent.
Option D. iwebpartrow is a provider interface used to transmit "data rows" between webparts"
Therefore, the correct option for this question should be B.

Refer:
Http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.webparts.iwebpartfield.aspx

 

Question 41
You need to connect two Web parts by using the iwebpartrow interface.
Which method shocould you use?
A. dataitem
B. getfieldvalue
C. getrowdata
D. gettabledata

Resolution:
This question requires you to determine which method in the standby option belongs to the iwebpartrow interface.
A. dataitem literally does not belong to the naming convention of "method". As for the class object it belongs to, you may find many answers, but it is by no means the answer to this question.
B. getfieldvalue. is a method included in the iwebpartfield interface. This interface is used to implement a standard interface for connecting data fields between Web Part controls, that is, to transmit "single value" data between them.
C. getrowdata is a method contained in the iwebpartrow interface. iwebpartrow is a provider interface used to transmit "data rows" between webparts"
D. gettabledata is a method contained in the iwebparttable interface. This interface is used to transmit connections between webparts based on the entire data table.
Therefore, the correct option for this question should be c

reference:
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.webpartpages.communication.icellprovider.aspx
http://msdn.microsoft.com/zh-cn/library/dd586425 (V = office.11 ). aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebpartrow.aspx
http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.webparts.iwebpartrow (V = vs.80 ). aspx
http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.webparts.iwebparttable.aspx

Question 42
You create a sandboxed solution that contains a Web part.
You need to debug the Web part by using Microsoft Visual Studio 2010.
To which process shocould you attach the debugger?
A. owstimer.exe
B. spucworkerprocess.exe
C. spucworkerprocessproxy.exe
D. w3wp.exe

Resolution:
This question is intended to test your knowledge about sandbox solution debug.
Debugging different objects in the development environment of SharePoint sometimes requires attach to different processes. Below are some common situations:
1. Farm solution ----- w3wp. exe
2. Sandbox solution -----pucworkerprocess.exe Program Pool (w3wp.exe) process (spucworkerprocess.exe) to run the sandbox Solution Code . So you must debug it on spucworkerprocess)
3. Use the sandbox Solution--SPUCWorkerProcessProxy.exe of Full-trust proxy
4. Feature receivers ---- feature cycler is automatically started by Visual Studio by default. You can change this setting in the deployment settings of Visual Studio.
4.1. activation/deactivation of feature receivers: depending on how it is activation/deactivation, You need to attaching to different processes.
• Start or stop ---- w2wp. EXE on the web interface
• Start or stop ---- powershell.exe in powershell
4.2 featureinstalled/featureuninstalling/featureupgrading of feature receivers (installation/uninstall/upgrade) ----- owstimer.exe

Therefore, the correct option for this question should be B.

Refer:
Http://msdn.microsoft.com/zh-cn/library/ee231562.aspx
Http://msdn.microsoft.com/en-us/library/ee231550.aspx
Http://www.cnblogs.com/wsdj-ITtech/archive/2011/12/08/2258260.html

question 43
you create a custom web part.
you need to create a class to log Web Part errors to the unified Logging Service (ULS) logs.
what should you use?
. the ilogger interface
B. the iloggingprovider interface
C. the spdiagnosticsservicebase class
D. the sppersistedobject class

resolution:
this topic defines a class to write error information to ULS.
each server running Windows SharePoint Services 3.0 and Office Sharepoint Server 2007 writes log records to the ULS log file and server event log. The ULS log file found in the {SharePoint root} \ logs folder on each server running SharePoint in the server farm can contain a considerable amount of information, depending on the configuration of diagnostic log restrictions. Although the more detailed the log records, the more difficult it is to find specific items in the log file.
by assigning uniqueness to each log item, Sharepoint 2010 improves the efficiency of searching for specific log items. This uniqueness (known as the related token) is a guid provided to the user when an error occurs. The Administrator or developer can then extract the guid string from the error and use it to search for specific items in the log file. This will speed up the search for items in the log file to track specific events.
in Windows SharePoint Services 3.0, the only way to write SharePoint tracking logs and unified logging system (ULS) logs is to implement the idiagnosticsmanager interface required for implementing other code. However, in SharePoint Foundation, the preferred method is to use the spdiagnosticsservicebase class, which contains a simpler and more effective way to interact with ULS logs, especially the writeevent and writetrace methods that can be easily implemented. So option C is the answer to this question.

Option A. The ilogger interface this interface is added from. NET Framework 2.0 and is used to define the interface used when the Code generates a task report error. It is used to define the msbuild recorder, which subscribes to generate system events.
Option B. The iloggingprovider interface this interface provides general function definitions for logging providers. It is located in the Microsoft. Sharepoint. Administration namespace and therefore falls into the scope of administration management. This space provides related types and members for managing Windows SharePoint Services deployment.

Option D. The sppersistedobject class is a method used to automatically serialize the status value of an object and save it permanently. You can also obtain the previously saved value and deserialize it as needed. That is, it is a class for custom management settings. When building an application on the Windows SharePoint Services Platform, you may need to create a class to define the custom property settings of the application and provide methods to store these settings. The Microsoft. Sharepoint. Administration namespace in Windows SharePoint Services 3.0 introduces Object persistence, which can be used to retain classes derived from the basic sppersistedobject class to the Windows SharePoint Services Database. To create a reserved object, you can create a class that inherits from sppersistedobject or from a class in the sppersistedobject-derived Microsoft. Sharepoint. Administration namespace. This class can define an object model used to store custom attribute settings in the Windows SharePoint Services Database. For example, you can create a Windows service that uses Windows SharePoint services in some way. This requires creating a class that inherits from the spwindowsservice class to store settings specific to Windows Services. Compiled DLL provides an object model that can be used to retrieve or save attributes. Windows SharePoint Services provides methods and locations for storing settings, and manages their availability for all servers and processes in the server farm, including cache refresh.
in actual use, we can also use it to save some user configuration information.
the correct option for this question should be C

Refer:
Http://msdn.microsoft.com/zh-cn/library/ee535240 (V = office.14). aspx
Http://blogs.msdn.com/ B /sharepoint_cht/archive/2011/03/24/uls-2.aspx
Http://msdn.microsoft.com/zh-cn/library/microsoft.servicemodel.domainservices.tools.ilogger (V = vs.91). aspx
Http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.administration.iloggingprovider.aspx
Http://msdn.microsoft.com/zh-cn/library/gg512103 (V = office.14). aspx
Http://msdn.microsoft.com/zh-cn/library/bb861848 (V = office.12). aspx

 

Question 44
You create a Sharepoint Farm solution that contains a Web part.
You need to debug the Web part by using Microsoft Visual Studio 2010.
To which process shocould you attach the debugger?
A. owstimer.exe
B. spucworkerprocess.exe
C. spucworkerprocessproxy.exe
D. w3wp.exe

Resolution:
Or how to debug the SharePoint project.
See question 42
The correct option for this question should be d, because Farm solution runs on Windows SharePoint Services process (w3wp.exe.

Refer:
Http://msdn.microsoft.com/en-us/library/ff798425.aspx
Http://msdn.microsoft.com/zh-cn/library/ee231550.aspx

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.