Search This Blog

Tuesday, February 8, 2011

RealTime Sharepoint Interview Questions 6

What are WebPart properties, and what are some of the attributes you see when declaring WebPart properties in code?

WebPart properties are just like ASP.NET control properties, they are used to interact with and specify attributes that should be applied to a WebPart by a user. Some of the attributes you see with ASP.NET 2.0 properties are WebDescription, WebDisplayName, Category, Personalizable, and WebBrowsable. Although most of these properties come from the System.Web.UI.WebControls.WebParts class, ones like Category come out of System.ComponentModel namespace.


 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.
Each custom property that you have must have the appropriate get and set accessor methods.


What are ClassResources? How do you reference and deploy resources with an ASP.NET 2.0 WebPart?

ClassResources are used when inheriting from the SharePoint.WebPart.WebPartPages.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 ClassResources is they can help to eliminate recompiles to change small interface adjustments or alterations to external JavaScript files.


What is a SharePoint 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 ustom componets suffixed with a .wsp extension that aids in deployment. The big difference with SharePoint solution files is 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.
Can provide Code Access Security provisioning to avoid GAC deployments
And much more..


What is a .ddf file and what does it have to do with SharePoint Solution creation?

.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 file.


What file does a SharePoint solution package use to orchestrate (describe) its packaged contents?

The solution Manifest.XML file.


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.


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 SPListEventReciever base class or the SPItemEventReciever base class, both which derive from the abstract base class SPEventReceiverBase.


If I wanted to not allow people to delete documents from a document library, how would I go about it?

You would on the ItemDeleting event set: properties.Cancel= true.


When running with SPSecurity.RunWithElevatedPrivileges (web context) what credentials are being used?

In a web context, this is the application pool identity. In a timer job and workflow, this will be the 'Windows SharePoint Timer Services' identity.


When should you dispose SPWeb and SPSite objects? And even more important, when not?

You should always dispose them if you created them yourself, but not otherwise. You should never dispose SPContext.Current.Web/Site and you should normally not dispose SPWeb if IsRootWeb is true. More tricky constructs are things along the line of SPList.ParentWeb.
Also dispose each web when iterating over SPWeb.Webs
Also dispose SPLimitedWebPartManager's SPWeb property (.web)




  What base classes do event receivers inherit from?

SPListEventReceiver, SPItemEventReciever, and SPWebEventReceiver inherit from the abstract base class SPEventReceiverBase.
SPWorkflowLibraryEventReceiver inherits from SPItemEventReceiver.
SPEmailEventReceiver inherits directly from System.Object.


What are the built in ways to backup a SharePoint install?

A: Through the central administration and the stsadm command


(more advanced) You've created and deployed a Web Part, when you deploy to the server you get a page saying your Web Part couldn't be loaded, click here to go to the Web Part maintenance page, etc. to disable the web part. What step(s) should you take to get a stack dump from your web part instead of that error page?

Go to the web.config file for your website and find the CallStack Attribute in the SafeControls element and set the value to true


How would you programmatically retrieve a list item?

SPQuery and SPSiteDataQuery. Bonus points for knowledge of CrossListQueryCache, PortalSiteMapProvider. Negative points for use of foreach.


What are the data types which are supported as Lookup column in SharePoint.

Only Single Line of Text and Calculated columns are supported as lookup columns.


 how can debugging share point application and timer jobs ? with steps?

  1. build application place .dll into gac and reset iis
  2. On the Debug menu, select Attach to Process
  3. select the Show processes from all users check box.
  4. select W3W.exe and OSWTIMER.exe can attach
  5. refresh sharepoint site point break point


what is web part?

Web Parts are the fundamental building blocks for Share Point user interface, and with them we can build and integrate many different types of applications.In share point also be create custom web part using .oscx control
steps create custom web part
  1. create web part project copied .oscx control and build application.place .dll file in GAC .reset IIS.
  2. go 12 hive _layout folder create folder past your .oscx control
  3. go inetpub ->wwwroot->wss->open Your site ->web con fig->create safe control write assembly information of web part application
  4. open sharepoint site ->site action-site editing->Galleries ->web part->new Add your web part.
follow few web part in WSS 3.0
  • Content Editor Web Part
  • Data View Web Part
  • List View Web Part
  • Image Web Part
  • Members Web Part .
  • Page Viewer Web Part


What are the advantages of SharePoint Portal Services (SPS) over SharePoint Team Services (STS)?
harePoint Portal Services (SPS) has MUCH better document management. It has check-in, check-out, versioning, approval, publishing, subscriptions, categories, etc. STS does not have these features, or they are very scaled back. SharePoint Portal Services (SPS) has a better search engine, and can crawl multiple content sources. STS cannot. STS is easier to manage and much better for a team environment where there is not much Document Management going on. SPS is better for an organization, or where Document Management is crucial
  
  
  

No comments:

Post a Comment