I was asked to create several sites automatically, i had two options rather made it via stsadm or via the object model.
but first I had to look for the web sites templates identifiers -
GLOBAL#0 = Global template
STS#0 = Team Site
STS#1 = Blank Site
STS#2 = Document Workspace
MPS#0 = Basic Meeting Workspace
MPS#1 = Blank Meeting Workspace
MPS#2 = Decision Meeting Workspace
MPS#3 = Social Meeting Workspace
MPS#4 = Multipage Meeting Workspace
CENTRALADMIN#0 = Central Admin Site
WIKI#0 = Wiki Site
BLOG#0 = Blog
BDR#0 = Document Center
OFFILE#0 = Records Center
OFFILE#1 = Records Center
OSRV#0 = Shared Services Administration Site
SPS#0 = SharePoint Portal Server Site
SPSPERS#0 = SharePoint Portal Server Personal Space
SPSMSITE#0 = Personalization Site
SPSTOC#0 = Contents area Template
SPSTOPIC#0 = Topic area template
SPSNEWS#0 = News Site
CMSPUBLISHING#0 = Publishing Site
BLANKINTERNET#0 = Publishing Site
BLANKINTERNET#1 = Press Releases Site
BLANKINTERNET#2 = Publishing Site with Workflow
SPSNHOME#0 = News Site SPSSITES#0 = Site Directory
SPSCOMMU#0 = Community area template
SPSREPORTCENTER#0 = Report Center
SPSPORTAL#0 = Collaboration Portal
SRCHCEN#0 = Search Center with Tabs
PROFILES#0 = Profiles
BLANKINTERNETCONTAINER#0 = Publishing Portal
SPSMSITEHOST#0 = My Site Host
SRCHCENTERLITE#0 = Search Center
SRCHCENTERLITE#1 = Search Center
SPSBWEB#0 = SharePoint Portal Server BucketWeb Template
This blog shares my thoughts and tips with Sharepoint/Moss and SQL Server
Sunday, March 15, 2009
Tuesday, February 24, 2009
What is the diffrence between AllUsers, SiteUsers, Users ?
In the SPWeb object you have those three properties that sounds a like, but there is a slight diffrence between them -
AllUsers - Returns "almost" all users in the site collection ( including "guests" ).
SiteUsers - Returns all users that are really exist in the site collection, including groups such as "authenticated users" and system accounts and etc.
Users - Returns only the users that appear in that specific web site.
The explanation in the SDK wasn't clear enough ( as for now , before the service packs ).
If you want to check it yourself just run this short code and see the difference.
AllUsers - Returns "almost" all users in the site collection ( including "guests" ).
SiteUsers - Returns all users that are really exist in the site collection, including groups such as "authenticated users" and system accounts and etc.
Users - Returns only the users that appear in that specific web site.
The explanation in the SDK wasn't clear enough ( as for now , before the service packs ).
If you want to check it yourself just run this short code and see the difference.
//Open a SPWeb object ( a site collection )
using (SPWeb web = colSites[i].OpenWeb())
{
SPUserCollection colUsers = web.Users;
foreach (SPUser user in colUsers)
{
Console.WriteLine(user.Name);
}
Console.WriteLine("=======================");
SPUserCollection colUsers1 = web.SiteUsers;
foreach (SPUser user in colUsers1)
{
Console.WriteLine(user.Name);
}
Console.WriteLine("=======================");
SPUserCollection colUsers2 = web.AllUsers;
foreach (SPUser user in colUsers2)
{
Console.WriteLine(user.Name);
}
}
Friday, February 13, 2009
How to block SPD from editing your sites ?
When I got into the SharePoint world a few years ago, I was told about the damages frontpage can make to Sharepoint websites ( though it can make some good stuff too ).
So one of the first things I did when I start learning about Moss, it's how to block the option of the end user to edit their website with Sharepoint Designer -
1. Go to the onet.xml file ( it's in the sharepoint hive of course ).
2. Look for the line that starts with - " 3. Add the - DisableWebDesignFeatures="wdfopensite"
4. Do an iisreset.
Now, You can't edit your sites with SPD.
Good Luck.
So one of the first things I did when I start learning about Moss, it's how to block the option of the end user to edit their website with Sharepoint Designer -
1. Go to the onet.xml file ( it's in the sharepoint hive of course ).
2. Look for the line that starts with - "
4. Do an iisreset.
Now, You can't edit your sites with SPD.
Good Luck.
Tuesday, February 10, 2009
Moss Css chart
Very useful link when you need to edit/brand/customize sharepoint sites or just working on the CSS files.
Moss css chart
Moss css chart
Wednesday, January 7, 2009
IE 6 Cache problems with Moss
Oy. You have no idea how much I worked on that issue...
So let me explain what was wrong, and how we solved it :
The problem - all end users who use IE 6 sp2 gets after a few moments of browsing the Moss sites, javascript error which led to CSS error ( actually it's not being downloaded well ).
We didn't notice this problem in IE6 sp3, so we thought we are almost half way to solve this issue. But the problem was now only in computer who works on windows 2000 operating system ( in which you can't install IE sp3 there .... ).
After doing more searching, we realized that this issue happens only because of the static compression that made by the IIS that being enabled automatically by Moss installation. After disabling this option the problem was gone.
So to sums things up, the files that were compressed by the IIS weren't available to the end users who used the windows 2000 computers, in other words they couldn't work on moss websites.
Three last comments -
1. You can still avoid it by changing the expiration date of the page and then postpone this problem from occurring or go 10 years back and force the IE to work on the HTTP 1.0 protocol.
2. By disabling the static compression, Im sending to the users files that are almost five times bigger than the size I usually send ( we are talking about all the CSS / JS files such core.css / ie55up.js and etc ).
3. You should disable the dynamic compression, it's not recommended by MS ( its written in the MSDN ). Yeah , I do ask why the hell they put it there on the first place ?
So let me explain what was wrong, and how we solved it :
The problem - all end users who use IE 6 sp2 gets after a few moments of browsing the Moss sites, javascript error which led to CSS error ( actually it's not being downloaded well ).
We didn't notice this problem in IE6 sp3, so we thought we are almost half way to solve this issue. But the problem was now only in computer who works on windows 2000 operating system ( in which you can't install IE sp3 there .... ).
After doing more searching, we realized that this issue happens only because of the static compression that made by the IIS that being enabled automatically by Moss installation. After disabling this option the problem was gone.
So to sums things up, the files that were compressed by the IIS weren't available to the end users who used the windows 2000 computers, in other words they couldn't work on moss websites.
Three last comments -
1. You can still avoid it by changing the expiration date of the page and then postpone this problem from occurring or go 10 years back and force the IE to work on the HTTP 1.0 protocol.
2. By disabling the static compression, Im sending to the users files that are almost five times bigger than the size I usually send ( we are talking about all the CSS / JS files such core.css / ie55up.js and etc ).
3. You should disable the dynamic compression, it's not recommended by MS ( its written in the MSDN ). Yeah , I do ask why the hell they put it there on the first place ?
Saturday, January 3, 2009
Problems editing SharePoint site with IE7
Saw it over several of the end users over my clients.
The cause for that issue is kind of simple -
Just open your browser On the the menu choose :
Tools -> Internet Options, switch to Advance Tab, and disable "Disable script debugging (Internet Explorer)".
The cause for that issue is kind of simple -
Just open your browser On the the menu choose :
Tools -> Internet Options, switch to Advance Tab, and disable "Disable script debugging (Internet Explorer)".
Saturday, February 2, 2008
How to cheat the Prescan ? or just call it a Workaround...
A few days ago, after installing sp1 on my moss server, I saw that I can't run an upgrade for database that didn't pass the prescan without any errors.
I had this small database that I wanted to upgrade but god knows what a weird error I got on a certain website, that didn't have any special customization or any unusual data.
So I just wanted to get over with it, and move on.
I checked what is the difference between the sites that did pass the prescan, and dthen decided to do a small change in my content database...
Be aware, this tweak is NOT supported. But it does work.
So what you need to do ?
Change the 'bitflags' column in the 'sites' table in the content database so that its marked for a successful prescan.
If the prescan hasn't been running then value is 0 and after successful prescan the value changes to 262144.
I had this small database that I wanted to upgrade but god knows what a weird error I got on a certain website, that didn't have any special customization or any unusual data.
So I just wanted to get over with it, and move on.
I checked what is the difference between the sites that did pass the prescan, and dthen decided to do a small change in my content database...
Be aware, this tweak is NOT supported. But it does work.
So what you need to do ?
Change the 'bitflags' column in the 'sites' table in the content database so that its marked for a successful prescan.
If the prescan hasn't been running then value is 0 and after successful prescan the value changes to 262144.
Subscribe to:
Posts (Atom)