Friday, March 20, 2009

How to Create a quiz application using Survey template in SharePoint 2007?

Using "Survey" list template, I recently created a quizzing application. In my application I have a list with Question s, choices and answers. Using some object model I was able to make use of the SharePoint survey list template to organize a quiz within our organization.
I inherit some of the functionality from the following link. Sridhar has gave a start up idea for my requirement.
http://blogs.msdn.com/sridhara/archive/2008/12/15/howto-create-a-quizzing-application-with-sharepoint-2007.aspx
Using his tool I am able to create a Demo Exam to attend the employee. I am imitating the permissions to the lists from Sridhar.
Well, in the code, the Read/Write Securities for the survey list are set to 2, which means "Users have Read access only to items that they create" and "Write only my items" respectively. However, once a user answers all questions and submits the quiz, he/she can ‘t attend the test again.
Here the results are declare immediately.
The results are storing in a separate list . In that I am maintaining Employee Name, Date of attempt, Score. For this I am using ItemAdded Event handler.
I am creating a feature for this.

Tuesday, March 17, 2009

How to add People picker control into Sharepoint Page Template?

I have a requirement that add a people picker control into on page template.Why means my input values will be store in DB Custom Table.Once get all details i can get reports using SSRS.


For adding People picker control u have to register the following dlls in my aspx page template.

Monday, March 9, 2009

How to check the authorization to load a page ?

I achived to check the authrization of user follwoing way.

public static bool IsUserExistsInGroup(string aGroupName, SPWeb aWeb, string aUserName)
{
SPGroup userGroup;
SPUser user;
bool userExists = false;
try
{
userGroup = aWeb.Site.RootWeb.SiteGroups[aGroupName];
try
{
user = userGroup.Users[aUserName];

if (user != null)
{
userExists = true;
}
}
catch
{

}
}
catch (Exception ex)
{
throw ex;
}
return userExists;
}

Sunday, March 8, 2009

How to develope Page Templates in MOSS?

I got the chance to work on few Page Template like EmployeeEntryForm.aspx,CertifaicationDetails.aspx etc.I would like to attach a sample screenshot.

I am ataching a screen shot How to attach .cs with my aspx page.

Wednesday, January 28, 2009

How ASP.NET drop down controls Filter the Data View in SharePoint Designer?

To begin, create two lists in the browser: Categories with a field of CategoryName and Products with a field of CategoryName as well (I use a Lookup field type for simplicity, but it doesn't have to be - this code does a simple string compare). Then fill out the lists so you have more than one item in each.

This tip also assumes you already know how to open your Site in SPD and you have created a new page. I realize it is a lot of steps, but I believe they are pretty straight forward as you perform them...

Place your page into design view
Click Task panes :: Data Source Library
Click the data source called Categories
Click to Insert Data Source Control
If prompted, click “Yes” to display the control
Place insertion point below this control
Click Insert :: ASP.NET Controls > Drop Down List
Click the Smart Panel :: Choose Data Source...
Choose the Data Source (for example, SPListDataSource1)
Tell it to display "CategoryName" (or the field that contains your category name)
Make its value "CategoryName"
Click OK
Click to select the dropdownlist control
Click the Smart Panel :: AutoPostBack == True

For getting a default value like "Please select a item..." ?
1. Select the control
2. click on Task Panes > Tag Properties
3. change the AppendDataBoundItem to be True
4. Click the Smart Panel > Edit Items
5. click "Add"
6. type "Please select a item..." for the Text property
7. Click "OK"

Drag and drop the Products list onto a page to create a Data View
Clck the Smart Panel :: Edit Columns to add and remove the columns you want to display
Click Data View :: Filter
Create the following filter:
Field: CategoryName (or the field that contains your category name)
Comparison: Equals
Value: [Create a new Parameter]
Param Name: Param1
Source: Control
Control ID: DropDownList1
Default: Beverages
Click OK
Click OK again
Save the page
Preview in the browser
Make a change to the DropDownList control

Monday, January 26, 2009

How to add a new choice field using WSS Object Model?

SPList list = site.Lists["Demo"];
StringCollection choices = new StringCollection();
choices.Add("AP");
choices.Add("MP");
choices.Add("HP");
list.Fields.Add("State", SPFieldType.Choice, false, false, choices);
SPFieldChoice fldChoice = (SPFieldChoice)list.Fields["State"];
fldChoice.EditFormat = SPChoiceFormatType.Dropdown;
fldChoice.Update();
list.Update();

Monday, December 22, 2008

Determine the accounts you will need to install and configure MOSS 2007 Enterprise Edition?

Below you will find the list of accounts you will need and a suggested account name followed by a brief explanation of anything special about this account. You will be creating the accounts in AD.
1) Setup Account – SP_Admin – This is the account that you will log into the MOSS server to do the install and when you wish to administer the server. This account will need to be a local administrator on the MOSS server and be given the securityadmin and dbcreator roles from within SQL Server.

2) Farm Account – SP_Farm – This is the account that your farm will connect to the SQL Server as. It should only be a domain user. When you tell MOSS to use this account it will automatically set the account up as a dbcreator, securityadmin, and db_owner for all SharePoint databases.

3) WSS Search Service – SP_WSSSearch – This account is a domain user. SharePoint will automatically assign it read access to the configuration database and the content database for central administration.

4) WSS Search Crawl – SP_WSSCrawl – This account is a domain user. SharePoint will automatically grant this account Full read to the farm.

5) MOSS Search – SP_MossSearch – This account is a domain user. SharePoint will grant access to read the configuration database and read access to all content databases hosted in the farm. This will become you default content access account for crawling.

6) SSP App Pool – SP_SSPAppPool – This account is a domain user. SharePoint automatically gives this account db_owner for the SSP content database, read & write to all content databases associated with its SSP, read access to the configuration database, and read access to the central administration database.

7) SSP Service – SP_SSPService – This account is a domain user. Same permissions as the SSP App Pool

8) MY App Pool – SP_MyAppPool – This account is a domain user. This account will be used as the identity for the My Sites application pool. It will be granted db_owner to that content database, read access to the config and central administration databases, and read access to the associated SSP database.

9) Portal App Pool – SP_PortalAppPool – This account is a domain user. This account will be used as the identity for the portal application pool in the Module 3 lab. It will be granted db_owner to that content database, read access to the config and central administration databases, and read access to the associated SSP database.