What is the GAC ?
The GAC stands for the global assembly cache. It is the machine wide code cache which will give custom binaries place into the full trust code group for SharePoint. Certain SharePoint assets, such as Feature Receivers need full trust to run correctly, and therefore are put into the GAC. You should always try to avoid deployment to the GAC as much as possible since it will possibly allow development code to do more than it was intended to do.
What is strong naming (signing) a Web Part assembly file mean ?
Signing an assembly with a strong name (a.k.a strong naming) uses a cryptographic key pair that gives a unique identity to a component that is being built. This identity can then be referred throughout the rest of the environment. In order to install assemblies into the GAC, they must be strongly named. After signing, the binary will have a public key token identifier which can be use to register the component in various other places on the server.
What are safe controls, and what type of information, is placed in that element in a SharePoint web.config file ?
- When you deploy a WebPart to SharePoint, you must first make it as a safe control to use within SharePoint in the web.config file. Entries made in the safe controls element of SharePoint are encountered by the Share Point Handler object and will be loaded in the SharePoint environment properly, those not will not be loaded and will throw an error.
- In the generic safe control entry (this is general, there could be more), there is generally the Assembly name, the namespace, the public key token numeric, the type name, and the safe declaration (whether it is safe or not). There are other optional elements.
What does the Render Contents method do in an ASP.NET 2.0 WebPart ?
The render contents method will render the WebPart content to the writer, usually an Html Text Writer since WebParts will output to an HTML stream. Render Contents is used to tell how the controls that are going to be displayed in the WebPart should be rendered on the page.
What is the Web Part Manager sealed class? What is its purpose ?
The Web Part Manager sealed class is responsible for managing everything occurring on a WebPart page, such as the WebParts (controls), events, and misc. functionality that will occur in Web Part Zones. For example, the Web Part Manager is responsible for the functionality that is provided when you are working with moving a WebPart from Web Part Zone to Web Part Zone. It is known as the "the central class of the Web Part Control Set".
What is a SP Site and SP Web object, and what is the difference between each of the objects ?
The SPSite object represents a collection of sites (site collection [a top level sites and all its sub sites]). The SP Web object represents an instance SharePoint Web, and SP Web object contains things like the actual content. A SPSite object contains the various sub sites and the information regarding them.
How would you go about getting a reference to a site?
Select For Unformatted Code C#: oSPSite = new SPSite("http:/server"); oSPWeb = oSPSite.OpenWeb();
What does a SP Web Application object represent ?
The SP Web Application objects represents a SharePoint Web Application, which essentially is an IIS virtual server. Using the class you can instigate high level operations, such as getting all the features of an entire Web Application instance, or doing high level creation operations like creating new Web Applications through code.
Would you use SP Web Application to get information like the SMTP address of the SharePoint site ?
Yes, since this is a Web Application level setting. You would iterate through each SP Web Application in the SP Web Application collection, and then use the appropriate property calls (Outbound Mail Service Instance) in order to return settings regarding the mail service such as the SMTP address.
How do you return SharePoint List items using SharePoint web services ?
In order to retrieve list items from a SharePoint list through Web Services, you should use the lists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposes the Get List Items method, which will allow the return of the full content of the list in an XML node. It will take parameters like the GUID of the name of the list you are querying against, the GUID of the view you are going to query, etc.
When retrieving List items using SharePoint Web Services, how do you specify explicit credentials to be passed to access the list items ?
In order to specify explicit credentials with a Web Service, you generally instantiate the web service, and then using the credentials properties of the Web Service object you use the System.Net.Network Credential class to specify the username, password, and domain that you wish to pass when making the web service call and operations.
What is CAML, and why would you use it ?
CAML stands for Collaborative Application Markup Language. CAML is an XML based language which provides data constructs that build up the SharePoint fields, view, and is used for table definition during site provisioning. CAML is responsible for rending data and the resulting HTML that is output to the user in SharePoint. CAML can be used for a variety of circumstances, overall is used to query, build and customize SharePoint based sites. A general use would be building a CAML query in a SharePoint WebPart in order to retrieve values from a SharePoint list.
What is impersonation, and when would you use impersonation ?
Impersonation can basically provide the functionality of executing something in the context of a different identity, for example assigning an account to users with anonymous access. You would use impersonation in order to access resources on behalf of the user with a different account, that normally, that wouldn't be able to access or execute something.
What is the IDesign Time Html Provider interface, and when can you use it in WebParts ?
The IDesign Time Html Provider interface uses the function Get Design Time Html() which can contain your relevant render methods. It was helpful to use in 2003 since it allowed your WebPart to have a preview while a page was edited in FrontPage with the Webpart on it, because the Get Design Time Html () method contains the HTML for the designer to render.
Why are properties important in WebPart development, and how have you exploited them in past development projects? What must each custom property have ?
Properties are important because WebParts allow levels of personalization for each user. WebPart properties make it possible for a user to interact, adjust, and increase overall experience value with the programmatic assets that you develop without having the need to use an external editor or right any code. A very simple example of exploiting a property would be something like allowing the user to change the text on the WebPart design interface so that they can display whatever string of text they desire.
What are Class Resources ? How do you reference and deploy resources with an ASP.NET 2.0 WebPart ?
Class Resources are used when inheriting from the SharePoint.WebPart.Web Part Pages.WebPart base class, and are defined in the SharePoint solution file as things that should be stored in the wpresources directory on the server. It is a helpful directory to use in order to deploy custom images. In ASP.NET 2.0, typically things such as images are referenced by embedding them as resources within an assembly. The good part about Class Resources is they can help to eliminate re compiles to change small interface adjustments or alterations to external JavaScript files.
What is a Share Point Solution File ? How does it differ from WebPart .cab files in legacy development ? What does it contain ?
- A SharePoint solution file is essentially a .cabinet file with all a developers custom components suffixed with a .wsp extension that aids in deployment. The big difference with SharePoint solution files is that a solution:
- Allows deployment to all WFE's in a farm
- is highly manageable from the interface allowing deployment, retraction, and versioning Can package all types of assets like site definitions, feature definitions (and associated components), Webparts, etc.
What is a .ddf file and what does it have to do with SharePoint Solution creation ?
A .ddf file is a data directive file and is used when building the SharePoint solution bundle specifying the source files and their destination locations. The important thing for someone to understand is that the .ddf file will be passed as a parameter to the MAKECAB utility to orchestrate construction of the SharePoint solution field.
What deployment mechanism can you use to instigate Code Access Security attributes for your WebParts?
SharePoint solution files can add in order to handle code access security deployment issues. This is done in the element in the SharePoint solution manifest.XML, which makes it easier to get assemblies the appropriate permissions in order to operate in the bin directory of the web application.
What is a SharePoint Feature? What files are used to define a feature ?
- A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances, such as at the farm, site collection, web, etc. Features have their own receiver architecture, which allow you to trap events such as when a feature is installing, uninstalling, activated, or deactivated. They are helpful because they allow ease of upgrades and versioning.
- The two files that are used to define a feature are the feature.xml and manifest file. 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.
What types of SharePoint assets can be deployed with a SharePoint feature ?
- Features can do a lot. For example, you could deploy
- Simple site customizations
- Custom site navigation
- WebParts
- pages
- list types
- list instances
- event handlers
- workflows
- custom actions
What are event receivers ?
Event receivers are classes that inherit from the SpItem Event Receiver or SPList Event Receiver base class (both of which derive out of the abstract base class SP Event Receiver Base), and provide the option of responding to events as they occur within SharePoint, such as adding an item or deleting an item.
When would you use an event receiver ?
Since event receivers respond to events, you could use a receiver for something as simple as canceling an action, such as deleting a document library by using the Cancel property. This would essentially prevent users from deleting any documents if you wanted to maintain retention of stored data.
What base class do event receivers inherit from ?
Event receivers either inherit from the SPList Event Receiver base class or the SPItem Event Receiver base class, both which derive from the abstract base class SPEvent Receiver Base.
If I wanted to not allow people to delete documents from a document library, how would I go about it?
You would on the Item Deleting event set: properties.Cancel= true.
What is the difference between an asynchronous and synchronous event receivers?
An asynchronous event occurs after an action has taken place, and a synchronous event occurs before an action has take place. For example, an asynchronous event is Item Added, and its sister synchronous event is Item Adding.
How could you append a string to the title of a site when it is provisioned ?
In the On Activated event: Select For Unformatted Code C#: SPWeb site = site Collection.Root Web; site.Title += "interview"; site.Update();
Can an event receiver be deployed through a SharePoint feature ?
Yes.
No comments:
Post a Comment