Wednesday, June 18, 2008

How to show file extensions in a SharePoint document library

There are actually 2 ways to show file extensions in a SharePoint document library:

1. Convert the document library listviewwebpart to a XSLT dataview - Open the documentlibrary with FrontPage, rightclick and convert to dataview. Modify the XSLT to add

2. Modify the display pattern in ONET.XML - add <HTML><![CDATA[.]]></HTML><Field HTMLEncode="FALSE" Name="File_x0020_Type"/> before <HTML><![CDATA[</A>]]></HTML><IfNew Name="Created_x0020_Date"> . After making a change to ONET.XML you have to do IISRESET

Monday, June 16, 2008

Adding webparts to other SharePoint pages than homepage and webpart page

Recently I wanted to add some text descriptions to the "NewForm.aspx" and "EditForm.aspx".
All you need to add to the page are the

?PageView=Shared&ToolPaneView=2

parameters.


This opens the Task pane for adding webparts. So now you can add any webpart to the page.

Sunday, June 15, 2008

Adding Data from one list column to another list column using workflows

I got a task i.e i want to get data from one list column to another list, i want to show that data in choice field of that at the time of adding new item .

Here I am having data in list named “city” . it is having two fields “ cityname” and “statename” .

I am having one more list i.e “ cityname” .
I am created two columns “citynames “ and “ statename” with choicefileds . I want to get data of “cityname “column in the first list “ city “ to the column “ citynames” to the second list “ cityname” and to get data of “statename “column in the firstlist “ city “ to the column “ statename” to the list “ cityname” when ever an item created in secondlist “ cityname” like below screen




So for getting data just I have written vb.code as below .
Dim spsite As SPSite = New SPSite("http://pc00026:1364/test1")
Dim spweb As SPWeb = spsite.OpenWeb()
spweb.AllowUnsafeUpdates = True

Dim splists As SPListCollection = spweb.Lists
Dim splist As SPList = splists("city")

Dim states As New ArrayList
Dim citys As New ArrayList

Dim items As SPListItemCollection = splist.Items
Dim item As SPListItem

For Each item In items

If Not states.Contains(item("statename")) Then
states.Add(item("statename"))
End If
citys.Add(item("cityname"))

Next

Dim stalist As SPList = splists("cityname")

Dim regionField As SPFieldChoice = stalist.Fields("statename")
Dim cityregionField As SPFieldChoice = stalist.Fields("citynames")

For i As Integer = 0 To states.Count - 1
If Not regionField.Choices.Contains(states(i)) Then
regionField.Choices.Add(states(i))
End If
Next
regionField.DefaultValue = "Select"
regionField.Update()

For j As Integer = 0 To citys.Count - 1
If Not cityregionField.Choices.Contains(citys(j)) Then
cityregionField.Choices.Add(citys(j))
End If
Next
cityregionField.DefaultValue = "Select"
cityregionField.Update()



up to this it is working fine … but if we add new item in first list “city” i.e data does not reflects in second list drop downs . for that when ever we add item in the first list , I run a workflow , this workflow updates the data in dropdowns of second list i.e “ citynames” .

for developing workflow I used visual studio 2008 . in that I have taken sequential workflow template.
And I named that project as” getingdataindropdown1”


And pass the URL where u want to create workflow .and click next


Next select library or list where u want to deploy u r workflow i.e in my application it is “city” .and click next .



Check “ when an item is created “ checkbox . and finsh



In the design i.e “workflow1.vb(design) ” . drop “code” control from the Toolbox .



Double click on the codeactivity1 and write code as below .
Private Sub codeActivity1_ExecuteCode(ByVal sender As System.Object, ByVal e As System.EventArgs)
'Dim context As SPContext
Dim spsite As SPSite = New SPSite("http://pc00026:1364/test1")
Dim spweb As SPWeb = spsite.OpenWeb()
spweb.AllowUnsafeUpdates = True

Dim splists As SPListCollection = spweb.Lists
Dim splist As SPList = splists("city")

Dim states As New ArrayList
Dim citys As New ArrayList

Dim items As SPListItemCollection = splist.Items
Dim item As SPListItem

For Each item In items

If Not states.Contains(item("statename")) Then
states.Add(item("statename"))
End If
citys.Add(item("cityname"))

Next

Dim stalist As SPList = splists("cityname")

Dim regionField As SPFieldChoice = stalist.Fields("statename")
Dim cityregionField As SPFieldChoice = stalist.Fields("citynames")

For i As Integer = 0 To states.Count - 1
If Not regionField.Choices.Contains(states(i)) Then
regionField.Choices.Add(states(i))
End If
Next
regionField.DefaultValue = "Select"
regionField.Update()

For j As Integer = 0 To citys.Count - 1
If Not cityregionField.Choices.Contains(citys(j)) Then
cityregionField.Choices.Add(citys(j))
End If
Next
cityregionField.DefaultValue = "Select"
cityregionField.Update()

End Sub.

AND DEPLOY THE SOLUTION .
You will find u r workflow in workflow settings of your list i.e “ city”




This workflow runs when an item is created and updates the newly added item data to the list “cityname”



Tuesday, June 10, 2008

Add your own icons to SharePoint lists (such as pdf, exe, etc.).

Put the image in:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES
Edit this file:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\DOCICON.XML
Map the file type to an icon:


Icons :






Sunday, June 8, 2008

Multiple databases for 1 Web Application

Sometimes I get the impression that a lot of people think you can only have 1 database for every Web Application. Well a lot of people (actually all of them that think that way) couldn't be more wrong than that. In the category people who do know this fact, most of them don't know how to control where to put Site Collections. Well, this post is all about that.
In your database you can place multiple Site Collections. So for your database a Site Collection is seen as "one item" (hence the Site Collection List in "Central Administration > Application Management"). This means you can make multiple databases, with one Site Collection in every database.Why is this so interesting, well for example:
Performance
Backup / Recovery
Copying data to another farm (let's say to the staging environment)
How do you do it?
Well, when a Site Collection is created, MOSS Searches for the first available database.When is a database available? A database is available when it's status is "Online".You can change this status when going to "Central Administration > Application Management > Content Databases" and then clicking on the database of your choice.AND HERE is the misunderstanding: When you set the status to "Offline" it does NOT mean the database is unavailable. It ONLY means than you cannot create new Site Collections (aka Top Level Sites).
So if you want to create a new database for 1 specific Site Collection, do this:
Create a new content database
Set the other databases all to status "Offline"
Create your Site Collection (It will be put automatically in your fresh made database)
Set that database to status "Offline" (This prevents other Site Collections to be made in this database)
Don't forget after doing this, that you at least have to set one database back online. Otherwise it won't be possible for new users to create their MySite. Since every Mysite is a Site Collection.
Today I installed a MOSS 2007 Farm for a customer and at the end we had 4 content databases. Three of them have now the status "Offline" and each has 1 Site Collection. The forth is reserved for the MySites and thus has status "Online"
Keep on doing
katuri

Sending E-mails from sharepoint site through workflows

For sending emails using workflows Follow these simple steps :
1. Goto Start-->Run-->inetmgr.
2. Select Default SMTP Virtual Server.
3. Right Click and select Properties.3. Select Access Tab, By selecting Access Tab we find Authentication button, Click on it and Check Annonymous access then Ok.
4. Select relay button, and add IP Address / Domain Name and apply and OK.
5. Close the inetmgr.
After this u have to do some actions in central adminstration
1. Open SharePoint Central Administration.
2. Select Application management Tab. Click on Web Application outgoing email Settings.
3. Select the web application and Type From Address only.
4. Then Ok and Close Central Administration.
5. Open your Web Application in SharePoint Designer.
6. Create New Workflow.
7. And Take action " Send an email".in that action Type the To Address to whom you want to send email.
8. And Finish the workflow.
9. Test your workflow .

Wednesday, June 4, 2008

Technical Overview of sharepoint 2007


Technical Overview of Microsoft Office Sharepoint Server 2007


From: srinatha, 5 months ago





Technical Overview of Microsoft Office Sharepoint Server 2007


SlideShare Link

Forms Based Authentication

There have been several blog posts about the implementation and the use of Forms Based Authentication in a SharePoint environment. Last two days I have been digging into FBA because there is obviously a growing interest among companies about this authentication method.To start of I found a great help (must read!) in 2 posts by Dan Attis about setting up FBA and how to enable MySites and Personalization features for your FBA users:
1. http://www.devcow.com/blogs/jdattis/archive/2007/02/23/Office-SharePoint-Server-2007-Forms-Based-Authentication-FBA-Walkthrough-Part-1.aspx
2. http://www.devcow.com/blogs/jdattis/archive/2007/03/01/Office-SharePoint-Server-2007-Forms-Based-Authentication-FBA-w-MySites-Walkthrough-Part-2.aspx
Dan's primary purpose was about serving the customers, as in making the FBA part the most important one. Well, I like to turn things around.
Situation: You're working at a company with a bunch of freelancers. Let's say a newspaper. When a freelancer works for you, you would like to give him access to your SharePoint environment. Since you use a lot of freelancers (and not always for a long time) you don't want to put them into your Active Directory.
Setup: You have an intranet portal. All your ("real") employees are registered in Active Directory and they are using MySites and Personalization features. Your freelancers don't need MySites nor Personalization features, since they are never long enough around to use them properly.How to: (I will not go too detailed, since all the pure technical steps are beautifully described in the posts by Dan Attis)
1.Create a User database and some users.
2.Extend the already existing portal, creating a new IIS web site. (You can choose port and host header as you like)
3.Choose "Extranet" as zone in the Load Balanced URL section.
4.Add the connectionStrings entry and the Membership and Role Provider sections to the web.config file of the newly created Web Application AND to the web.config file of the Central Administration Web Application.
5.In the Central Administration web.config, change the default RoleManager to "AspNetWindowsTokenProvider"
6.Application Management, change the Authentication Provider for the Extranet zone to Forms and enter the Membership and Role Provider names

You can happyly try F.B.A with the below url also
http://www.andrewconnell.com/blog/articles/HowToConfigPublishingSiteWithDualAuthProvidersAndAnonAccess.aspx

Overview ...

For geting the Overview on MOSS 2007 check below link for video demos
http://office.microsoft.com/en-us/help/HA102199841033.aspx
http://office.microsoft.com/sharepoint

First Post ...

Hi.. I'll just have a try to make my posts as interesting as possible for learning sharepoint , so everyone can benefit from them. Here i am keeping some documents related to basic study of sharepoint .
http://www.ziddu.com/downloadlink.php?uid=abCem5emY7CZluKnY6qhkZSrYKqdmZWo3
http://www.ziddu.com/downloadlink.php?uid=aquel5mmb6%2BZmpqntKyZlJyiZrCWlJit6
http://www.ziddu.com/downloadlink.php?uid=cq%2BbnZSsa7OenOKnaaqhkZSrZqqdm5eq9
http://www.ziddu.com/downloadlink.php?uid=ZrCalp2rarOinOKnYaqhkZSrXqqdmJeu1
http://www.ziddu.com/downloadlink.php?uid=aaugm5Spba6dnOKnZaqhkZSrYqqdl5ao5