Skip to content

Day3 – Dev

Heirarchy of objects.: From the top: Farm and Servers
Within Servers , Application and Services. Site Coll -Sites, In Sites Pages, Files and Lists.
Inside lists there can be folders , within pages there can be folders,files, items

Actually everything is an item. Inside item there are fields and there are attachments
which are again files. Users are stored around site collection basis.User associated with a site, per site basis.

At Site we have : user objects.At folder, list or items: permission associations.
Group in sp* is only sp group. (give the user directly or indirectly permissions on some site.
Permissions can be given on site, list, folder or item (file is an item))

Around sites there are users List has forms and views (maybe more than 3 forms etc)
List can have event handlers, workflows.
Pages/master pages/ controls,web parts.
Template = site definition + other things. definition declaritively.CAMEL.collab. app. markup level.
Camel : used for querying.

Deploying anything to sharepoint:solution packages.
Features in solution packages: Units of deployment.
So when building a solution package you plan it so that you can determine the number of features in that solution.

ContentTypes: Grouping of site columsn, Set of fields at site level.
Add bunch of cols at one shot. Create list templates that you link to content type.
List can be made to contain item of more than one content type.
Unless 3 content types are having the same content type – then the same site column
when repeated would be skipped! so only unique.
List consist of fields. Column name need not be same, internally Guid (globally unique id)

Currency uses banker’s rounding rather than arithemtatic.
Arithemetic rounding : -2.5
banker’s number: -3
+ Rounding is max till 4 places.

Excel uses banker’s rounding by default. Lookup want to look up things from other sites: Need to create custom field type. Look up by default looks up only on within the site.

Cannot guarentee uniqueness,Create field in scope of site : Such fields are called Site Column,.
By default in list settings: field specific to each list only.Update it in the central location.
When you add a site column to list, the list mantains a copy of site column, certain aspect of sc* are editable. eg: can change the name. cannot change the data type.

Base storage format should be compatible only then the datatype can be changed for fields.
when sc* changed then list also shows the changed.Title need not be mandatory not unique can be any field – cannot be deleted/ datatype cannot be changed. ECB shown on this.field, site column, content type, list template. content type can inherit from other content type, it can contain another content type.
Extremely powerful concept.

System-> Item -> Basic Page,File-> Document,If we remove Item content type – all other content types have COPIES so data will not be harmed.

Event handlers can be attached to list/content types.Plan data in terms of content types -Create a new column in a list, any new column of any content type would be added to content type. gets associated with default content type on this list: default is ITEM.


A Master page a special kind of library. Responsible for most of look and feel.
Create a new master for difft l&f. Template is created by end user. Definition is created by developers.
Lt = list templates
Wt = web templates

Sc* cannot have data.
Create a _lt* that derives from root template. Gallery is a doc lib*

cmd \k mybat.cmd [doesnt close the window]

Action = hyperlink that takes us somewhere.
Asp prefix is registered in root web.config. Register prefix on page or web.config

Solution package is a compressed file – compressed using cab or cabinet.
Just like zip files can have folder or sub folders in it , solution file has to be structured in a
particular manner.

Solution file in its root directory should have manifest.xml the name of this file is called
a solution manifest. XML – Camel., it describes all details of solution.

Tool can be created in four format:for GUID.
Root Files: deploy in 12 direct
Template Files : deploy in 12/Template (user stuff here…)

Module: for deploying to content DB.

makefi.eexe can be used CAB file or extractable.
CAB : DDF = diamond definition file. *sp says make ext as wsp

makefile /f soloution.ddf
creates the cab file
stsadm -o enumsolutions
stsadm -o addsolution : puts this package in the config DB and does not deploy it.

target of solution if wfe : then goes on every machine
if app server : then it does not go to every machine.

Deploy solution,
stsadm -o deploysolution
if it contains anything other than root files and templates files you have to specify a URL.
It will deploy to a physical dir corresponding to that url.

deploy with time – uses timer service who does the deployment.

stsadm -o deploysolution -name -local
stsadm -o retractSolution -name -local
stsadm -o deleteSolution -name

udl file for connection string.
Object browser in – add the dll.
WebControls has UI stuff , Data related stuff in M/S.Sharepoint.
Classes can be found in the Admin namespace.

SPSite = SiteColln
SPWeb = Site
SPContext = Current

To create subsite with unique permission : log in as site collection & NOT SITE OWNER !!
To delete the site: /second/third/_layouts/deleteweb.aspx

Role = permission level is sharepoint.
Access denied error: the user who logs in does not have the permission to run.
For FORMS authentication: Impersonation for code exec doesnt take place and a given processid exec its handing it form token having user id when accessing the database.

If user not added to members group — cannot see site.
User has to have add Items permissions

Check if X has Y permission for Z object, is an elevated op.
if the curr user does not hav add item perms on curr site he should not be allowed.
This level of coding is done through interface in sharepoint.

SPWeb: Sites,
SPList ,
SPListItems. all 4 implemente

Permissions are never given at site collection level : SPSite.
CurrentWeb.checkPermission : if user has no perm access denied err
doesUserHavePermissions : if user has no perm – bool
ResetRoleInheritance : reset the role perms

Layoutpage base class calls rights required and calls checkPermission.

If we extend our file from LayoutsPageBase: Anon users cannot open this page.
we prevent anon users from coming in.

List page view content
title description items

Always retrieve : the object and put in variable.
Collection can you add stuff to it and can you retrive/delete from it.

UnsecuredLayoutsPageBase: derive our page from this Anon = true.
Accuracy: items.count
Speed: itemcount

if any object contains url or server related url properties
url will be relative to the site collection (server name is not hard coded!)
server related url will be relative to the application name.

in particular in layouts pages you should always use server relative url.
layout pages can be called from anywhere.

need manage list permissions to see the settings of list.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: