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.

Thursday, October 9, 2008

Web Part Maintenance Page

In some cases we need some way to close the offending web parts.In that case we go to the Web Part Maintenance Page.
For the Web Part Maintenance Page is to append "?contents=1" to the end of your web part page's URL and loading that page.
For example:
/sites/foo.aspx
/sites/foo.aspx?contents=1.

Monday, October 6, 2008

How to add Audience Targeting to a link at QuickLaunchBar?

I strugle a lot for setting a group to a link.So that the group users only can see the link at quicklaunchbar.
I would like to share a few lines...
if (userGroup == "Publisher")
{
node.Properties.Add("Audience", ";;;;" + groupName1);
node.Update();
}
else if (userGroup == "Certifier")
{
node.Properties.Add("Audience", ";;;;" + groupName2);
node.Update();
}

Sharepoint Interview questions

1-Question: can you create page layout templates in Visual Studio?Answer: Yes, but longer answer in the Page Layout module
2-Question: When using SharePoint designer for Page Layout Templates can you add code behind or reference an ascx file with a dll?Answer: You can... unfortunately it's not wired together as easily as you have when bulding ASPX pages in Visual Studio 2005. So what you do is create a class library and then specify which class the page inherits from in the Inherits attribute within the page's directive.
3-Question: Can we get the code for the "Minimal "publishing site template?Answer: Sure... just change the WSP file extension to CAB and you can easily extract it and see the contents. WSP's are just CAB files renamed as WSP's.
4-Question: I missed the extra step you did in extending the existing web app? did you just change the port?
5-Question: So the customized pages need to be placed under MPG(Master page gallary) & is ASP.Net master page same as MOSS master page?Answer: (1) If they are created using SPD, all masters and page layouts must be in the MPG... they can't be anywhere else. Once you open them and edit them, when you save them, they stay in the MPG as customised. (2) yes, you just have to have the sharepoint placeholder controls in your master page.
6-Question: is it possible to customize TOC for Press Releases by showing first couple of lines per press release?Answer: Yes... you'd just use the same technique you use for the Content Query Web Part by modifing the XSLT files or creating your own custom XSLT.
7-Question: I use createchildcontrols but find that sometimes it does not have values on post back so I have had to use oninitAnswer: At times you do need to add things to OnInit to register event handlers and such, yes that's correct.
8-Question: 1- How do you debug webparts? 2 - Is it performance consuming to have 3 content query webpart on a page (for the welcome page for an internet site)?Answer: (1) you manually attach the debugger to the w3wp.exe process...
9-Question: What are the best scenarios to use 1)Web Parts, User Controls, Application Pages please compare and contrast.Answer: Web Parts are good as "little applications", such as aggregation controls. In SharePoint we typically don't build many user controls, but you can do it. However, there's nothing special about SharePoint in deciding when to build user controls vs. Web Parts... it's the same decision process you'd have in an ASP.NET 2.0 site. As for application pages (which are deployed to the _layouts directory), these are good for pages you want to be avaialble to ALL sites in your farm as all sites share the same _layouts path.
10-Question: If I have an asp/net application (ie. showing mortgage rates), how do I install this in MOSS? Do I use WebParts or is there another technique?
11-Question: How can we better link lists together, we have primary keys in DBMS.. what about SharePoint lists/DocLibs?Answer: there's no relationship between sharepoint lists... but you can enforce this with event receivers.
12-Question: Is it possible to use infopath and aspx pages in the same workflow?Answer: Hmm... If you can use InfoPath forms, then you should beacuse they do so much heavy lifting for you!
13-Question: How can we deal with cases in which the approver did not respond in a timely manner?Answer: There are activities in the base activity library in WF that you can use to wake up your activity after a specified time... within this activity you can check how long it's been pending and either give them a reminder slap via email or you can change the approver and reroute it. But you'd have to this using custom workflows.