Saturday, January 2, 2010

Archive for Sharepoint ? Symantec Enterprise Vault... Round# 3

Finally. There is an archive product which is ready for archiving Moss.

Yes. They solved most of their issues. And I can proudly say that I saw this product developing progress since it early days.

Why it's ready ?
1. Supports Kerberos.
2. It is transperent to the end user. How come ? The list looks the same. The file name hasn't changed. It's only down sized to 1kb ( even less if you want to be accuarte ).
3. We can crawl it. Since they added the transperent mechanisim, the crawler just see it as regular file.
4. When you edit the file, or do any modification, or drag it to another list, it retreives it back from the repository to the list and bring it back to his original size.

Some small problems, that I still need to mention :
1. Doenst support item level premission ( but they have nice workaround ).
2. The policy mangement is not versital enough.
3. Not enough documentation. Capicity planning is not easy without it.

Sunday, December 13, 2009

SPWeb.Users and SPWeb.SiteUsers are the same ?

Well no.

Sounds very close, but there is a difference.


SPWeb.Users - Property returns collection of user objects that are explicitly assigned permissions.


SPWeb.SiteUsers - Property returns collection of user objects that belong to site collection.

Thursday, November 12, 2009

CAML Vs Linq ? What's better ?

A few days ago I had a small project over one of my clients, one of the issues I had to deal with was to iterate via his enormous lists sizes, and to change specific MetaData according to other metadata that he already has.

Then I had to choose how I want to work with those lists

Why Linq ?

1. Easy for the .net developer, no new skills required.
2. intellisense. It's a great deal sometimes.
3. Easy to read your code, no loops, no "weird" syntax.
4. Can combine multiple sources ( XML files, SharePoint lists and databases and more ... )

Why NOT Linq ?

1.Performance issues in some cases. All items are being retrieved from the database.
The filtering phase is being done only by iterating via all all items and comparing them to the where clause. So in large collections we have a major performance problem with Linq.

An example, which we will use later again :

 
//checking if the column address is not empty and the column name equals tothe filter.
//and order it by PostedOn

var resourceListItems = fromSPListItemitemin resourceList.Items
whereitem[“Name”] .ToString().ToLower().Contains(_filter)
&& item[“Adress”].ToString().Length> 0
orderbyitem[“PostedOn”] ascending


Why CAMAL ?

1. Only items that match the filter criteria will be retrieved from the database.
2. There are some wizards to make it easier for writing those queries ( such as : LinqToSharepoint, Linq4SP and some more - just google those names ).

Why NOT CAMAL ?

1. Syntax. No intellisense. Not easy to read.
2. Problematic filtering, not as wide as you can get in Linq. If you want to compare two columns it's not feasible ( I might wrong on that ).

Same example as before in CAML :

 
//checking if the column address is not empty and the column name equals tothe filter.
//and order it by PostedOn, and at last calling getting the collection.

SPQueryquery = newSPQuery();
query.Query= String.Format(“

{0}




”, _filter);

SPListItemCollectionlistItemsColl= resourceList.GetItems(query);


And yes, you can use them both combined , for example :

 

SPQuerycamlQuery= newSPQuery();
camlQuery.Query= String.Format(“

{0}


”, _filter);
var resourceItemsCollection=fromSPListItemiteminresourceList.GetItems(camlQuery)
orderbyitem[“PostedOn”] ascending


Bottom line, it depends on what you need to do :

If you work on a very large collection, you better use CAMAL ( also recommended in the MSDN ).

If you work on a small collection , and the cost of iterating all collection is ok for you, Or when you need to make a certain filtering that requires iteration ( such as column comparison ) then choose Linq.

Enjoy.

Wednesday, November 11, 2009

How to change the regional settings of your site collection

Very simple -

Go to : Site Settings => Modify All Site Settings

Click on "Regional Settings" under "Site Administration" column.
Now just change the time zone...

Good Luck.

Saturday, October 31, 2009

Moss on Windows server 2008 R2

In the last few weeks I have started to sense over my clients the desire of upgrading windows servers from 2003 to 2008.

So if you are about to this move for your Moss WFE server, you better check this link -
http://blogs.msdn.com/sharepoint/archive/2009/10/02/install-sharepoint-server-2007-on-windows-server-2008-r2.aspx

Good luck.

Friday, October 9, 2009

How to check if list is a document library ? Let's Linq it !

Sometimes you need to iterate via the Doclibs of a site for a dedicated reason, and there is no need to iterate via the "regular" lists of the site.

Of course it's very easy so you usually just run something like that -

 
SPWeb web = site.Openweb();
SPListCollection listCol = web.lists;
foreach(SPList list in listCol )
{
//Do your thing
}


So in order to be more efficient, run only in doclibs, and not on all lists that you have in your website ( including hidden ones ).

How you do that ? very simple.

 
SPWeb web = site.Openweb();
SPListCollection listCol = web.lists;
foreach(SPList list in listCol )
{
if(list.BaseType == SPBaseType.DocumentLibrary)
{
//Do your thing
}
}


And to make it even nicer, lets just LINQ it -
 
var docLibs = from SPList list in web.Lists where (list.BaseType == SPBaseType.DocumentLibrary) select list;
foreach (SPList doclib in docLibs)
{
//do your thing
}


Hope it helps.

Tuesday, September 8, 2009

few days ago I came across this nice short video.

Im ashamed to say how much time I spent on doing the same via web services...

Actually, Im just being harsh on myself, because this "idea" is a bit more limited, but still very cute.

Display a SharePoint list on Another Site in 3 minutes from Dux Raymond Sy on Vimeo.