何小碩's profileGet More... ExperiencePhotosBlogListsMore Tools Help

Blog


    Creating List Defination

    Steps:
    1. Copy an existing List defination folder (eg, CustList folder ) from Local_Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATES\FEATURES and Paste in the same Features folder with a diffrent name say, "JobandInterviewTracking" List.
    2. Open Feature.xml in JobandInterviewTracking main folder and change the GUID,Title and scope of the feature if required.
    3. Open up the elements.xml file(in List Templetes folder) that identifies the list template and specifies information to display on the Create Page. Give it a Type value that is above 10000 and different from any other custom list definitions used in your deployment, Change Name, display name,description .
    4. Change the folder name,which contains schema.xml to "Name" element(i.e JobandInterviewTracking) specified in elements.xml.
    5. Install the feature by using following commands:
    a. stsadm -o installfeature -filename JobandInterviewTracking\Feature.xml
    b. stsadm -o activatefeature -name JobandInterviewTracking -url http://Server/Site/Subsite
    To test the new Feature, navigate to the Create Page and create a list through the template.
    Now, Lets Modify Schema.xml
    Firstly, What you can do with schema.xml
    The following kinds of tasks can be performed in a Schema.xml file to customize a list definition:
    *Add custom fields built on the base field types defined in FldTypes.xml (You cannot create custom base field types.)

    To do this we will have to modify schema.xml , and add our own custom column(that we will create) in default Item content type. This column will then be displayed along with the Title column when one craetes the List.

    Steps:

    1. Open schema.xml in VS or Notepad. Locate "ContentType ID="0x01" in ContentTypes tag.

    2. Now Open ctypeswss.xml in ctypes folder in Features directory and copy the defination for "ContentType ID="0x01" and paste in schema.xml . see below:

    3. Add the field into Fields tag and ViewFields tag in schema.xml as below:


    To add custom column please read the article specified : here
    *Create a custom view for lists created through the list definition.
    This can be done with "Views" tag which contain defination for all default views in the list.
    You can specify your custom view's name,Id,url of page,header,footer,fields in the view speciifed with CAML query tag, and orderby clause. You can also specify number of items to show in the view and how to display them,What to display when no items are returned in the view and so on...
    *Specify custom form pages for working with list items.
    This is done in "Forms" tag where you can specify Form with its type{ DispForm,EditForm,NewForm}, form's url, and WebPartzoneId ( usually main ).
    *Specify the default description that is displayed for the list in the user interface (UI)
    This is done with DefultDescription tag , but this description is overriden by description tag in the list defination specified in ONet.XML.
    *Define the Actions area that is displayed in the side navigational area of list views
    Diffrence between List templete and List Definations

    come from: http://programmingsharepoint.blogspot.com/

    Sharepoint Questions

    What are Application Pages in SharePoint?

    Ans : Unlike site pages (for example, default.aspx), a custom application page is deployed once per Web server and cannot be customized on a site-by-site basis. Application pages are based in the virtual _layouts directory. In addition, they are compiled into a single assembly DLL.

    A good example of an Application Page is the default Site Settings page: every site has one, and it's not customizable on a per site basis (although the contents can be different for sites).

    With application pages, you can also add inline code. With site pages, you cannot add inline code.
    Typically, you link custom application pages to application.master, the master page file that is used by the default application pages in Windows SharePoint Services. You should also write application pages to inherit from a base class defined inside the Microsoft.SharePoint assembly named LayoutsPageBase.

    UserControl or WebPart?

    Ans: Advantages of Using User Control are :

    Advantages

    There are three primary advantages to user controls when dealing with SharePoint. They are: familiarity, reusability, and development speed.

    *Familiarity:

    One of the keys to development is managing the degree of change that the team is put through as it transitions from technology to technology. Part of managing that change is minimizing it where possible. This is one of the reasons that user controls are such a good solution for many organizations. User controls are a core ASP.NET construct, they are something that developers are likely already familiar with — or at least aware of. This familiarity increases the knowledge reuse coming into the project, which keeps morale high, improves productivity, and improves reuse of the experience after the SharePoint project.

    *Reusability

    Another way user controls are advantageous is that they can be used with other ASP.NET-based solutions. They aren't explicitly tied to SharePoint. If for some reason in the future you decide that SharePoint isn't the right platform for the solutions you're building — or you decide you need to reuse the technology in another non-SharePoint project — you have that capability.

    *Development Speed:

    Direct support by Visual Studio for a visual interface for user controls — as opposed to manually adding in controls through code — is a great advantage in development speed. Having a visual look and feel instantly available makes the process go faster.

    *Debugging is faster too, as you can construct testing harnesses that fully exercise and instrument the user control. Web Parts are essentially only runable from within SharePoint. This means that you must deal with all of the SharePoint infrastructure while trying to debug.
    ASP.NET 2.0 Web Parts and their ability to be used with SharePoint hold promise, but since right now the story of SharePoint and ASP.NET 2.0 is still not perfect, it's more of a future consideration than a potential solution for today.

    Maintenance is also easier and faster with User Controls, primarily because they are easier to understand and debug. The net of this is that developing with user controls is substantially faster than developing a Web Part for everything but the most trivial implementations

    Q. When to use Diffrent Site Collections?

    Ans. An Individual Site collection offers following :

    For the Users:

    Dedicated Recycle bins
    Dedicated usage Reports
    Distributed administration (site collection administrators)
    Dedicated search scopes, keywords, and best-bets
    Custom feature deployments
    Dedicated language translation maintenance
    Dedicated galleries for web parts, master pages, content types, site columns, site templates, and list templates
    Dedicated shared libraries, such as site collection images and site collection styles
    Dedicated real estate (Self Containment)

    For the IT Administrators:

    Site quota templates
    Distributed administration
    Site locking
    Database maintenance options
    Backup / Restore abilities
    Content Deployments
    InfoPath forms services global template targeting

    why to use diffrent site collections:

    1. Site quotas is one of the reasons. The issue is the recycle bin is based on site collections and the quota for a site collection. If everyone shares a site collection, then they share the recycle bins storage size.

    2. Delegated Security and distributed administration is the next big thing. For eg, you have a IT department that doesn't know who should be able to see what content, besides how it should be organized. This is the job of the content owners and users. SharePoint site collections offers IT the ability to create a site collection for a project, team, department, document, or whatever the needs are, then assign an owner and hand it off to them.

    3. In addition to these two points is the need to separate the content between databases.

    What is Authentication and Authorization.
    Ans : An authentication system is how you identify yourself to the computer. The goal behind an authentication system is to verify that the user is actually who they say they are.

    Once the system knows who the user is through authentication, authorization is how the system decides what the user can do.

    What are some of the accounts you create while installing/managing the sharepont.

    Ans : Some of the accounts are specified here

    What are Security methods(Authentication methods) available in sharepoint.

    Ans :"Out of the box", SharePoint 2007 supports nine authentication methods. NTLM (short for NT Lan Manager, which is simply the Windows authentication that everyone is familiar with) and Kerberos (also a Windows "standard" authentication) are offered during installation, but I recommend to get started with NTLM, as Kerberos requires "special configuration by the domain administrator", while NTLM works without further hassle.

    come from: http://programmingsharepoint.blogspot.com/

    WebPart Life cycle

    1. protected override void OnInit(EventArgs e)
    2. protected override void OnLoad(EventArgs e)
    3. protected override void CreateChildControls()
    4. protected override void LoadViewState(object savedState) //Only at Postback
    5. protected override void OnPreRender(EventArgs e)
    6. protected override void Render(System.Web.UI.HtmlTextWriter writer)
    7. protected override void OnUnload(EventArgs e)
    8. public override void Dispose()

    come from: http://programmingsharepoint.blogspot.com/