Welcome to MSDN Blogs Sign in | Join | Help

How to determine (find) who created a site on a MOSS 2007

One of my colleague had asked query regarding how to find out the user who created the site in sharepoint 2007, obviously nothing in the UI to find out that. So we will have to do it programmatically and the way to get it is to use the SPWeb.Authors property. More details here: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.author.aspx

In case if someone wants to find out who created the site and not the owner of the site then a small console application can be written that uses the SPWeb.Authors property and running this console applicaiton on one of the sharepoint WFEs in the farm.

Posted by ketaanhs | 0 Comments
Filed under:

Modifying SPThemes.xml Programmatically to deploy new Themes MOSS 2007 (WSS 3.0)

Modifying SPThemes.xml Programmatically to deploy new Themes MOSS 2007 (WSS 3.0)

One of my colleague was looking for modifying the SPThemes.xml file programmatically instead of editing it manually on each and every server. So that the deployment of new themes could be very easy thru the Solution Deployment/Packaging way. All we need is a Feature Receiver for that. In case if you have not already seen the VSEwss 1.3 here check it out, there is a ready made codebehind available that be reused to deploy your custom Themes in sharepoint 2007 (wss 3.0) using the feature / Solution deployment packaging approach. Following is the source code from the Feature receiver from the VSeWSS project (http://www.microsoft.com/downloads/details.aspx?FamilyID=0A87658F-20B8-4DCC-AD7A-09AD22641F3A&displaylang=en)

NOTE: These 10 Theme Features are FARM LEVEL Features and you can find these Features in the Central Admin box under the Operation tab under Farm level Features:

 //--------------------------------------------------------------------------------
// This file is a "Sample" as part of the MICROSOFT SDK SAMPLES FOR SHAREPOINT
// PRODUCTS AND TECHNOLOGIES
//
// (c) 2008 Microsoft Corporation.  All rights reserved. 
//
// This source code is intended only as a supplement to Microsoft
// Development Tools and/or on-line documentation.  See these other
// materials for detailed information regarding Microsoft code samples.
//
// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//--------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using System.IO;
using System.Linq;
using System.Xml.Linq;

namespace TeamSiteTheme
{
    public class TeamSiteThemeFeatureReceiver : SPFeatureReceiver
    {
        private const string _themeName = "TEAM";
        private const string _themeNiceName = "Team";

        private enum ModificationType
        {
            Add,
            Remove
        }
       
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            ModifySPTheme(ModificationType.Add);

            using (SPWeb web = (SPWeb)properties.Feature.Parent)
            {
                web.ApplyTheme(_themeName);
            }
        }

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            ModifySPTheme(ModificationType.Remove);

            using (SPWeb web = (SPWeb)properties.Feature.Parent)
            {
                web.ApplyTheme("none");
            }

        }

        public override void FeatureInstalled(SPFeatureReceiverProperties properties)
        {
            ModifySPTheme(ModificationType.Add);
        }

        public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
        {
            ModifySPTheme(ModificationType.Remove);
        }

        private void ModifySPTheme(ModificationType type)
        {
            XDocument doc = null;
            XNamespace ns = "
http://tempuri.org/SPThemes.xsd";

            // path to the SPTHEMES.XML file
            string spthemePath = Path.Combine(SPUtility.GetGenericSetupPath(@"TEMPLATE\LAYOUTS\1033"), "SPTHEMES.XML");
            string contents = string.Empty;

            // read the contents of the SPTHEMES.XML file
            using (StreamReader streamReader = new StreamReader(spthemePath))
            {
                contents = streamReader.ReadToEnd();
                streamReader.Close();
            }

            using (StringReader stringReader = new StringReader(contents.Trim()))
            {
                // create a new XDocument from the contents of the file
                doc = XDocument.Load(stringReader);

                // retrieve all elements with a TemplateID of our theme.  At most, there should only be one
                var element = from b in doc.Element(ns + "SPThemes").Elements(ns + "Templates")
                              where b.Element(ns + "TemplateID").Value == _themeName
                              select b;

                bool exists = (element != null && element.Count() > 0);

                if (type == ModificationType.Add)
                {
                    if (!exists)
                    {
                        // create an XElement that defines our custom theme
                        XElement xml =
                            new XElement(ns + "Templates",
                                new XElement(ns + "TemplateID", _themeName),
                                new XElement(ns + "DisplayName", string.Format("{0} Site Theme", _themeNiceName)),
                                new XElement(ns + "Description", string.Format("A {0}-like Site Theme", _themeNiceName)),
                                new XElement(ns + "Thumbnail", string.Format("1033/IMAGES/{0}/preview.jpg", _themeName)),
                                new XElement(ns + "Preview", string.Format("1033/IMAGES/{0}/preview.jpg", _themeName)));

                        // add the element to the file and save
                        doc.Element(ns + "SPThemes").Add(xml);
                        doc.Save(spthemePath);
                    }
                }
                else
                {
                    if (exists)
                    {
                        // if the element exists, remove it and save
                        element.Remove();
                        doc.Save(spthemePath);
                    }
                }

                stringReader.Close();
            }
        }

    }
}

 

Posted by ketaanhs | 0 Comments
Filed under: ,

Sharepoint 2007 WSS 3.0 Feature list with GUID

Following is the list of sharepoint features (out of the box) that are available, I wish I could have compiled it but this great job is done by Robert Bogue (MVP) on his blog here:  http://www.thorprojects.com/blog/archive/2007/05/16/list-of-features-with-guids.aspx. I am keeping the same entries on my blog for my reference. Great job Robert, Thank you!!!.

GUID  Scope  Feature Name  Installed By
001f4bd7-746d-403b-aa09-a6cc43de7942 Farm PublishingStapling 00000000-0000-0000-0000-000000000000
00bfea71-1c5e-4a24-b310-ba51c3eb7a57 Site BasicWebParts 00000000-0000-0000-0000-000000000000
00bfea71-1e1d-4562-b56a-f05371bb0115 Web XmlFormLibrary 00000000-0000-0000-0000-000000000000
00bfea71-2062-426c-90bf-714c59600103 Web LinksList 00000000-0000-0000-0000-000000000000
00bfea71-2d77-4a75-9fca-76516689e21a Web workflowProcessList 00000000-0000-0000-0000-000000000000
00bfea71-3a1d-41d3-a0ee-651d11570120 Web GridList 00000000-0000-0000-0000-000000000000
00bfea71-4ea5-48d4-a4ad-305cf7030140 Web WorkflowHistoryList 00000000-0000-0000-0000-000000000000
00bfea71-4ea5-48d4-a4ad-7ea5c011abe5 Web TeamCollab 00000000-0000-0000-0000-000000000000
00bfea71-513d-4ca0-96c2-6a47775c0119 Web GanttTasksList 00000000-0000-0000-0000-000000000000
00bfea71-52d4-45b3-b544-b1c71b620109 Web PictureLibrary 00000000-0000-0000-0000-000000000000
00bfea71-5932-4f9c-ad71-1557e5751100 Web IssuesList 00000000-0000-0000-0000-000000000000
00bfea71-6a49-43fa-b535-d15c05500108 Web DiscussionsList 00000000-0000-0000-0000-000000000000
00bfea71-7e6d-4186-9ba8-c047ac750105 Web ContactsList 00000000-0000-0000-0000-000000000000
00bfea71-a83e-497e-9ba0-7a5c597d0107 Web TasksList 00000000-0000-0000-0000-000000000000
00bfea71-c796-4402-9f2f-0eb9a6e71b18 Web WebPageLibrary 00000000-0000-0000-0000-000000000000
00bfea71-d1ce-42de-9c63-a44004ce0104 Web AnnouncementsList 00000000-0000-0000-0000-000000000000
00bfea71-dbd7-4f72-b8cb-da7ac0440130 Web DataConnectionLibrary 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
00bfea71-de22-43b2-a848-c05709900100 Web CustomList 00000000-0000-0000-0000-000000000000
00bfea71-e717-4e80-aa17-d0c71b360101 Web DocumentLibrary 00000000-0000-0000-0000-000000000000
00bfea71-eb8a-40b1-80c7-506be7590102 Web SurveysList 00000000-0000-0000-0000-000000000000
00bfea71-ec85-4903-972d-ebe475780106 Web EventsList 00000000-0000-0000-0000-000000000000
00bfea71-f381-423d-b9d1-da7a54c50110 Web DataSourceLibrary 00000000-0000-0000-0000-000000000000
00bfea71-f600-43f6-a895-40c0de7b0117 Web NoCodeWorkflowLibrary 00000000-0000-0000-0000-000000000000
0125140f-7123-4657-b70a-db9aa1f209e5 Farm FeaturePushdown 00000000-0000-0000-0000-000000000000
02464c6a-9d07-4f30-ba04-e9035cf54392 Site ReviewWorkflows 00000000-0000-0000-0000-000000000000
034947cc-c424-47cd-a8d1-6014f0e36925 Web MySiteQuickLaunch 00000000-0000-0000-0000-000000000000
065c78be-5231-477e-a972-14177cc5b3c7 Web BizAppsListTemplates 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
068f8656-bea6-4d60-a5fa-7f077f8f5c20 Web OsrvLinks 00000000-0000-0000-0000-000000000000
0806d127-06e6-447a-980e-2e90b03101b8 Web PremiumWeb 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
0b4aad40-406f-425c-bdd9-5894c42cffcb Web OsrvTasks 00000000-0000-0000-0000-000000000000
0be49fe9-9bc9-409d-abf9-702753bd878d Web SlideLibrary 00000000-0000-0000-0000-000000000000
0ea1c3b6-6ac0-44aa-9f3f-05e8dbe6d70b WebApplication PremiumWebApplication 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
0f121a23-c6bc-400f-87e4-e6bbddf6916d Farm ContentLightup 00000000-0000-0000-0000-000000000000
0faf7d1b-95b1-4053-b4e2-19fd5c9bbc88 Farm MySiteCleanup 00000000-0000-0000-0000-000000000000
10bdac29-a21a-47d9-9dff-90c7cae1301e Web OssNavigation 00000000-0000-0000-0000-000000000000
11df38ab-5bbb-4304-9da8-221c5c4100b0 Farm SpsSsoLinks 00000000-0000-0000-0000-000000000000
14173c38-5e2d-4887-8134-60f9df889bad WebApplication PageConverters 00000000-0000-0000-0000-000000000000
14aafd3a-fcb9-4bb7-9ad7-d8e36b663bbd Site LocalSiteDirectoryControl 00000000-0000-0000-0000-000000000000
1dbf6063-d809-45ea-9203-d3ba4a64f86d WebApplication SearchAndProcess 00000000-0000-0000-0000-000000000000
1ec2c859-e9cb-4d79-9b2b-ea8df09ede22 Farm DMContentTypeSettings 00000000-0000-0000-0000-000000000000
22a9ef51-737b-4ff2-9346-694633fe4416 Web Publishing 00000000-0000-0000-0000-000000000000
24d7018d-bf48-4813-a28d-dbf3dba173b1 Site PublishingB2TRHop2SiteFilesUpgrade 00000000-0000-0000-0000-000000000000
2510d73f-7109-4ccc-8a1c-314894deeb3a Web ReportListTemplate 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
29d85c25-170c-4df9-a641-12db0b9d4130 Web TransMgmtLib 00000000-0000-0000-0000-000000000000
2ac1da39-c101-475c-8601-122bc36e3d67 WebApplication SPSearchFeature 00000000-0000-0000-0000-000000000000
2ed1c45e-a73b-4779-ae81-1524e4de467a Site WebPartAdderGroups 00000000-0000-0000-0000-000000000000
2fa4db13-4109-4a1d-b47c-c7991d4cc934 Web UpgradeOnlyFile 00000000-0000-0000-0000-000000000000
306936fd-9806-4478-80d1-7e397bfa6474 Web RedirectPageContentTypeBinding 00000000-0000-0000-0000-000000000000
319d8f70-eb3a-4b44-9c79-2087a87799d6 Farm GlobalWebParts 00000000-0000-0000-0000-000000000000
389156cf-498b-41cd-a078-6cb086d2474b Site pwsctypes 538c0384-48ab-483d-90ac-e3a09f755ca5
395702f0-184c-46a2-9bb5-0a64b048738c Farm Analytics 00000000-0000-0000-0000-000000000000
3cb475e7-4e87-45eb-a1f3-db96ad7cf313 Site ExcelServerSite 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
3f59333f-4ce1-406d-8a97-9ecb0ff0337f Web BDR 00000000-0000-0000-0000-000000000000
4248e21f-a816-4c88-8cab-79d82201da7b Site BizAppsSiteTemplates 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
43f41342-1a37-4372-8ca0-b44d881e4434 Site BizAppsCTypes 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
448e1394-5e76-44b4-9e1c-169b7a389a1b Web pwsrisks 538c0384-48ab-483d-90ac-e3a09f755ca5
4750c984-7721-4feb-be61-c660c6190d43 WebApplication OSearchEnhancedFeature 00000000-0000-0000-0000-000000000000
49571cd1-b6a1-43a3-bf75-955acc79c8d8 Site MySiteHost 00000000-0000-0000-0000-000000000000
4d0d9bec-5103-4663-b88d-27cfab1029ff Farm FeaturePushdownTask 00000000-0000-0000-0000-000000000000
4f56f9fa-51a0-420c-b707-63ecbb494db1 WebApplication BaseWebApplication 00000000-0000-0000-0000-000000000000
525dc00c-0745-47c0-8073-221c2ec22f0f Web pwsdoclibs 538c0384-48ab-483d-90ac-e3a09f755ca5
541f5f57-c847-4e16-b59a-b31e90e6f9ea Web NavigationProperties 00000000-0000-0000-0000-000000000000
56dd7fe7-a155-4283-b5e6-6147560601ee Web AnalyticsLinks 00000000-0000-0000-0000-000000000000
5a979115-6b71-45a5-9881-cdc872051a69 Site BizAppsFields 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
5b1e6e3b-83c2-483b-8500-16a025777ed1 Web GradualUpgrade 00000000-0000-0000-0000-000000000000
5f3b0127-2f1d-4cfd-8dd2-85ad1fb00bfc Site PortalLayouts 00000000-0000-0000-0000-000000000000
60d1e34f-0eb3-4e56-9049-85daabfec68c Web pwsissues 538c0384-48ab-483d-90ac-e3a09f755ca5
612d671e-f53d-4701-96da-c3a4ee00fdc5 Farm SpellChecking 00000000-0000-0000-0000-000000000000
65d96c6b-649a-4169-bf1d-b96505c60375 Farm SlideLibraryActivation 00000000-0000-0000-0000-000000000000
6928b0e5-5707-46a1-ae16-d6e52522d52b Site MySiteLayouts 00000000-0000-0000-0000-000000000000
695b6570-a48b-4a8e-8ea5-26ea7fc1d162 Site CTypes 00000000-0000-0000-0000-000000000000
69cc9662-d373-47fc-9449-f18d11ff732c Farm MySite 00000000-0000-0000-0000-000000000000
6adff05c-d581-4c05-a6b9-920f15ec6fd9 Web MySiteNavigation 00000000-0000-0000-0000-000000000000
6c09612b-46af-4b2f-8dfc-59185c962a29 Site SignaturesWorkflow 00000000-0000-0000-0000-000000000000
6d127338-5e7d-4391-8f62-a11e43b1d404 Farm RecordsManagement 00000000-0000-0000-0000-000000000000
6e53dd27-98f2-4ae5-85a0-e9a8ef4aa6df Web LegacyDocumentLibrary 00000000-0000-0000-0000-000000000000
7094bd89-2cfe-490a-8c7e-fbace37b4a34 Site Reporting 00000000-0000-0000-0000-000000000000
713a65a1-2bc7-4e62-9446-1d0b56a8bf7f Farm SPSDisco 00000000-0000-0000-0000-000000000000
750b8e49-5213-4816-9fa2-082900c0201a Web IPFSAdminWeb 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
75a0fea7-0017-4993-85fe-c37971507bbc Web ProjMilestones 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-02cb-4f87-bb11-1ffde748a953 Web HelpDeskModules 3d7fb834-5d7d-48e9-b66f-194fde445c0c
75a0fea7-040e-4abb-b94b-32f1e7572840 Web AVMAbsencesList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-056a-445f-9a78-db1b38bb0b74 Web AVMListInstances d9d569e3-ec65-4e38-a1b0-b3b3ff1aef8e
75a0fea7-07c7-453d-866c-979c401d0105 Web DocumentReviewModules 5e33b0a9-1aaa-4509-8b2d-0e60abefdbca
75a0fea7-08d9-4a8f-b1cd-953d4f15467f Web ResourceTypesList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-0cb9-4862-8e76-9f5e149236f5 Web CallCenterCustomer 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-0e55-4249-b117-4757adfcc704 Web CompProcListInstances 8b9300af-e90f-4b49-9309-ebafb126a7bf
75a0fea7-12fa-4e77-a477-d75778ef90e9 Web ProjModules 25d59dca-500c-41c0-bc5d-1894b9bb1e11
75a0fea7-12fe-4cad-a1b2-525fa776c07e Web KnowledgeBaseKeywordsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-1651-4b91-8cdf-3f24e57526ed Web ProjChangeCRList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-1757-461b-8997-6c3a4afd86c9 Web RecruitingModules 0ebcf2cc-6297-4354-bf55-2962f423a386
75a0fea7-1906-4f0d-8e04-96eaefb60294 Web CompProcModules 8b9300af-e90f-4b49-9309-ebafb126a7bf
75a0fea7-24d7-4907-81ec-2d71dd3dfde9 Web DRProvisioningFeature 5e33b0a9-1aaa-4509-8b2d-0e60abefdbca
75a0fea7-2791-45a2-896f-e538f91032d8 Web ProjProjects 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-2812-45ce-aa8a-b0a8e7c70151 Web ERModules c430946f-ca17-4925-bdc6-868a47f7877f
75a0fea7-2d1e-451a-b445-16bc346d7d8e Web BugList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-30ba-45d8-bf12-3c0855491ad1 Web LendingLibraryTransactionsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-3737-40a1-b908-c325e30d77de Web InventoryTrackingModules f9dbe862-60d5-4de5-92f1-1544f51647d3
75a0fea7-377d-4b4f-b864-984379ed0f42 Web ResourcesList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-37d2-484b-b362-dcff1538e2a4 Web BugTrackingListInstances 0e2f7540-e92f-4eb2-b916-cb2364c3941c
75a0fea7-3a7f-40c2-bf9c-503f36caca93 Web InventoryTrackingListInstances f9dbe862-60d5-4de5-92f1-1544f51647d3
75a0fea7-3b2a-4838-8a0c-57ba864feed3 Web HelpDeskTasks 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-3cc9-4c20-bf74-9bfa9fd5d614 Web DocumentReviewDiscussionList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-42e8-4527-8313-f63c4c49a7e6 Web BugCategoriesList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-4d56-4479-a469-230a0eb68184 Web SalesOpportunitiesList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-518a-485e-841d-ababd2145e27 Web RecruitingCandidatesList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-51e8-4065-a3ef-a2b24f209dca Web ITTeamWorkflows bed8bd64-d0ac-469a-96fc-cb867001368a
75a0fea7-5797-48cd-958d-805cbf270087 Web CompProcCompReg 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-57fb-44e4-ac79-48513cac5416 Web ReservationsListInstances 1df107e5-6d9b-4490-bf91-28cb419748c7
75a0fea7-585d-4862-b7e8-2fdef3ccc537 Web CallCenterModules 08ec3335-c9b0-458b-a848-6d739b6a74e5
75a0fea7-5871-41eb-bac0-5ecedf198c44 Web RecruitingListInstances 0ebcf2cc-6297-4354-bf55-2962f423a386
75a0fea7-5dd8-40af-b960-12af3053f5ec Web LendingLibraryList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-5f52-4bb0-aef8-bd4135d19e5e Web SalesTeamListInstances 964e2241-baa9-49d4-8ae8-aef77d4a07d6
75a0fea7-5f69-4282-83ae-22808c0fbfd9 Web ContactManagementModules 96555d19-e225-44f9-92e7-5efc880bc8c4
75a0fea7-625d-4b31-be9e-24cee53d0d72 Web AssetTrackingAssetsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-6667-4a63-9224-5108aca1c5de Web LendingLibraryListInstances 1a76aee6-bad7-4934-b8d7-5cc4d933db21
75a0fea7-6e3f-4d4a-8f78-245bda567b60 Web RecruitingCandidateFeedbackList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-70e3-40b1-b395-c06f85d0d158 Web HelpDeskSupportFaqList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-7370-403f-a48c-fd5e141ea776 Web ITProvisioningFeature f9dbe862-60d5-4de5-92f1-1544f51647d3
75a0fea7-7478-44e1-8b39-d600e3f4f53f Web EPPersonalEvents 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-76e5-47c4-931a-a90da71c69b7 Web AssetTrackingListInstances 8ed0be87-c777-421e-88cf-024a5a76dbc5
75a0fea7-775b-4ae1-bbc6-ad5ef0d22413 Web DocumentReviewDocsForReviewList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-7851-4350-a082-3b2476621a57 Web AVMModules d9d569e3-ec65-4e38-a1b0-b3b3ff1aef8e
75a0fea7-7afc-4a13-b91a-7dc661f04785 Web RecruitingRequisitionsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-7c51-4a75-92c1-cbaccb371622 Web KnowledgeBaseListInstances 975d6932-0820-41e3-82fe-bb4f8889d935
75a0fea7-7ce3-4ba1-84b7-4bd9da4c9468 Web AssetTrackingProposalsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-7f1b-4b63-a41c-2a2a55fa2709 Web SalesAccountsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-8464-4a6e-9d51-f370bb34ee9c Web CallCenterServiceRequestsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-84d9-447d-b9ec-bc49570874db Web KBProvisioningFeature 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-85b8-4e88-8a0b-3a04a572e20c Web KnowledgeBaseModules 975d6932-0820-41e3-82fe-bb4f8889d935
75a0fea7-86b0-4778-b957-7d6953160dbd Web EPModules c5932b68-e0b1-4879-aa4a-c3099d183297
75a0fea7-8b9f-489a-a971-497418e43698 Web ProjChangeModules 6ec9e585-6d56-4d2b-911e-2e3b99948e35
75a0fea7-8d3c-455d-89d3-4ece8739402d Web AVMAbsenceTypeList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-90ea-4d39-9749-bacfe713d4bb Web AssetTrackingModules 8ed0be87-c777-421e-88cf-024a5a76dbc5
75a0fea7-92c2-4fdf-9b21-8cfbb6d3b240 Web AssetTrackingCategoriesList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-9454-48ab-883d-ede5b98710d6 Web ProjIssues 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-9507-49c7-a473-0ce55c18ef89 Web ERExpenseFormsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-97c5-4487-88e4-70fde8f79b25 Web HelpDeskListInstances 3d7fb834-5d7d-48e9-b66f-194fde445c0c
75a0fea7-9c7f-4881-b7f1-7d0271a1ea16 Web ERListInstances c430946f-ca17-4925-bdc6-868a47f7877f
75a0fea7-9d96-4f02-a800-a3512154efcd Web BugTrackingModules 0e2f7540-e92f-4eb2-b916-cb2364c3941c
75a0fea7-9f82-4120-96a3-6a3f93272a97 Web ReservationsModules 1df107e5-6d9b-4490-bf91-28cb419748c7
75a0fea7-a4ce-4a83-867d-f6be0ffdd867 Web ContactManagementListInstances 96555d19-e225-44f9-92e7-5efc880bc8c4
75a0fea7-a64d-4dfa-a39f-d0076127771e Web InventoryTrackingInventoryList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-ada5-4d30-a123-330bff54d0be Web CompProcTasks 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-ada9-4441-893d-39ec3b945c91 Web InventoryTrackingTransactionsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-b0ef-434e-90d6-ce997d970564 Web PostProvisioningFeature 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-b4c2-46ca-b4b1-819331cf2e4b Web EPPeopleList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-b5a0-47d5-90e6-4b3205b02278 Web AVMResponsibilityAdoptionList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-bbb4-488d-bfc6-79da8ff3ed21 Web SalesTeamModules 964e2241-baa9-49d4-8ae8-aef77d4a07d6
75a0fea7-bfc1-42fe-b08b-ae44bca6a536 Web ProjChangeRisksList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-c1cd-40f9-9f5d-88b7b0c7fc00 Web ProjListInstances 25d59dca-500c-41c0-bc5d-1894b9bb1e11
75a0fea7-c256-49cb-bf7f-de124ca9bf13 Web ProjTasks 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-c285-4c09-839e-0b5e1453e387 Web ITTeamListInstances bed8bd64-d0ac-469a-96fc-cb867001368a
75a0fea7-c54f-46b9-86b1-2e103a8fedba Web TSAimage 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-c671-4696-ac6f-5decfca3173e Web DocumentReviewListInstances 5e33b0a9-1aaa-4509-8b2d-0e60abefdbca
75a0fea7-c966-4e74-b74e-8f77e7bae175 Web EPEventsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-ca3c-4d71-9d2c-5efc8e68a5a8 Web SalesLeadsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-caef-4454-be97-4bf0e784650a Web ProjChangeListInstances 6ec9e585-6d56-4d2b-911e-2e3b99948e35
75a0fea7-cbdd-4360-90cb-12aed8c69f43 Web EPListInstances c5932b68-e0b1-4879-aa4a-c3099d183297
75a0fea7-cd50-401e-af0e-782f3662a299 Site TSATypes 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-d01e-48b3-ba36-8cbbdfeef1d6 Web ProjChangeRequestStatusList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-d27d-4319-af1c-9f2d26486cb8 Web CallCenterListInstances 08ec3335-c9b0-458b-a848-6d739b6a74e5
75a0fea7-d31d-491a-9177-f0e461a81e3f Web KnowledgeBaseKnowledgeBaseList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-d6d3-47bc-95be-1b26b5927180 Web HelpDeskInIssuesList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-e632-4b1f-bfa4-a77c0adcdf41 Web ITTeamModules bed8bd64-d0ac-469a-96fc-cb867001368a
75a0fea7-e63b-4059-8f5a-ce9cbbadad2a Web HelpDeskExpertsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-ebe9-4501-8897-74c984588afa Web EPAnnouncementsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-ee78-4bca-9d7c-9c2fd2593798 Web LendingLibraryModules 1a76aee6-bad7-4934-b8d7-5cc4d933db21
75a0fea7-f13a-4670-8b69-97e90d05f7c8 Web RecruitingInterviewCalendarList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-f780-458c-b53d-441b33a9ac32 Web ITTeamBugList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-fe65-41c3-a965-c5df83fb098b Web ListPropertyFeature 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-fe9d-4119-9615-2c2ef22d6fdb Web HelpDeskServiceRequestsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-ff19-4b2e-953b-bea234eba14a Web ReservationsList 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-ff47-418f-8bfc-9498b0bc1a85 Web CompProcProjects 0273f170-f34b-4f05-9973-494e875dee24
75a0fea7-ffa9-4c2d-8b20-88401290692e Web CompProcIssues 0273f170-f34b-4f05-9973-494e875dee24
7ac8cc56-d28e-41f5-ad04-d95109eb987a Site OSSSearchSearchCenterUrlSiteFeature 00000000-0000-0000-0000-000000000000
7acfcb9d-8e8f-4979-af7e-8aed7e95245e Web OSSSearchSearchCenterUrlFeature 00000000-0000-0000-0000-000000000000
7c637b23-06c4-472d-9a9a-7c175762c5c4 Site ViewFormPagesLockDown 00000000-0000-0000-0000-000000000000
7fe16263-b3fd-454f-a3e8-ed05fdf2adb6 Web MigrationLinks 00000000-0000-0000-0000-000000000000
8156ee99-ddfb-47bb-8835-7ae42d40d9b9 Site ReportCenterCreation 00000000-0000-0000-0000-000000000000
81ebc0d6-8fb2-4e3f-b2f8-062640037398 Farm EnhancedHtmlEditing 00000000-0000-0000-0000-000000000000
82e2ea42-39e2-4b27-8631-ed54c1cfc491 Farm TransMgmtFunc 00000000-0000-0000-0000-000000000000
8581a8a7-cf16-4770-ac54-260265ddb0b2 Site PremiumSite 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
863da2ac-3873-4930-8498-752886210911 Site MySiteBlog 00000000-0000-0000-0000-000000000000
89e0306d-453b-4ec5-8d68-42067cdbf98e Site Navigation 00000000-0000-0000-0000-000000000000
8a663fe0-9d9c-45c7-8297-66365ad50427 Farm MasterSiteDirectoryControl 00000000-0000-0000-0000-000000000000
8c6a6980-c3d9-440e-944c-77f93bc65a7e Web WikiWelcome 00000000-0000-0000-0000-000000000000
8f15b342-80b1-4508-8641-0751e2b55ca6 Web LocalSiteDirectoryMetaData 00000000-0000-0000-0000-000000000000
90014905-433f-4a06-8a61-fd153a27a2b5 Web pws 538c0384-48ab-483d-90ac-e3a09f755ca5
937f97e9-d7b4-473d-af17-b03951b2c66b Farm SkuUpgradeLinks 00000000-0000-0000-0000-000000000000
94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb Web PublishingWeb 00000000-0000-0000-0000-000000000000
97a2485f-ef4b-401f-9167-fa4fe177c6f6 Farm BaseSiteStapling 00000000-0000-0000-0000-000000000000
99ee0928-7342-4739-865d-35b61ea4eaf0 Farm BDCAdminUILinks 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
99fe402e-89a0-45aa-9163-85342e865dc8 Web BaseWeb 00000000-0000-0000-0000-000000000000
9e56487c-795a-4077-9425-54a1ecb84282 Web Hold 00000000-0000-0000-0000-000000000000
a0e5a010-1329-49d4-9e09-f280cdbed37d Web IPFSWebFeatures 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
a10b6aa4-135d-4598-88d1-8d4ff5691d13 Farm ipfsAdminLinks 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
a311bf68-c990-4da3-89b3-88989a3d7721 Web SitesList 00000000-0000-0000-0000-000000000000
a392da98-270b-4e85-9769-04c0fde267aa Site PublishingPrerequisites 00000000-0000-0000-0000-000000000000
a573867a-37ca-49dc-86b0-7d033a7ed2c8 Farm PremiumSiteStapling 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
aebc918d-b20f-4a11-a1db-9ed84d79c87e Site PublishingResources 00000000-0000-0000-0000-000000000000
aeef8777-70c0-429f-8a13-f12db47a6d47 Farm BulkWorkflow 00000000-0000-0000-0000-000000000000
af847aa9-beb6-41d4-8306-78e41af9ce25 Farm ProfileSynch 00000000-0000-0000-0000-000000000000
b21b090c-c796-4b0f-ac0f-7ef1659c20ae Site BaseSite 00000000-0000-0000-0000-000000000000
bc29e863-ae07-4674-bd83-2c6d0aa5623f WebApplication OSearchBasicFeature 00000000-0000-0000-0000-000000000000
c43a587e-195b-4d29-aba8-ebb22b48eb1a Farm SRPProfileAdmin 00000000-0000-0000-0000-000000000000
c5d947d6-b0a2-4e07-9929-8e54f5a9fff9 Web ReportCenterSampleData 00000000-0000-0000-0000-000000000000
c6561405-ea03-40a9-a57f-f25472942a22 Site TranslationWorkflow 00000000-0000-0000-0000-000000000000
c85e5759-f323-4efb-b548-443d2216efb5 Site ExpirationWorkflow 00000000-0000-0000-0000-000000000000
c88c4ff1-dbf5-4649-ad9f-c6c426ebcbf5 Site IPFSSiteFeatures 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
c922c106-7d0a-4377-a668-7f13d52cb80f Farm OSearchCentralAdminLinks 00000000-0000-0000-0000-000000000000
c9c9515d-e4e2-4001-9050-74f980f93160 Site OffWFCommon 00000000-0000-0000-0000-000000000000
ca2543e6-29a1-40c1-bba9-bd8510a4c17b Web DeploymentLinks 00000000-0000-0000-0000-000000000000
ca7bd552-10b1-4563-85b9-5ed1d39c962a Site Fields 00000000-0000-0000-0000-000000000000
cdfa39c6-6413-4508-bccf-bf30368472b3 Farm DataConnectionLibraryStapling 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
d250636f-0a26-4019-8425-a5232d592c09 Web AddDashboard 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
d3f51be2-38a8-4e44-ba84-940d35be1566 Site PublishingLayouts 00000000-0000-0000-0000-000000000000
d8d8df90-7b1f-49c1-b170-6f46a94f8c3c Web pwscommitments 538c0384-48ab-483d-90ac-e3a09f755ca5
d992aeca-3802-483a-ab40-6c9376300b61 WebApplication BulkWorkflowTimerJob 00000000-0000-0000-0000-000000000000
e15ed6d2-4af1-4361-89d3-2acf8cd485de WebApplication ExcelServerWebApplication 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
e4e6a041-bc5b-45cb-beab-885a27079f74 Farm ExcelServer 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
e8734bb6-be8e-48a1-b036-5a40ff0b8a81 Web RelatedLinksScopeSettingsLink 00000000-0000-0000-0000-000000000000
e978b1a6-8de7-49d0-8600-09a250354e14 Site LocalSiteDirectorySettingsLink 00000000-0000-0000-0000-000000000000
eaf6a128-0482-4f71-9a2f-b1c650680e77 Site SearchWebParts 00000000-0000-0000-0000-000000000000
edf48246-e4ee-4638-9eed-ef3d0aee7597 Farm OSearchPortalAdminLinks 00000000-0000-0000-0000-000000000000
ee21b29b-b0d0-42c6-baff-c97fd91786e6 Farm StapledWorkflows 00000000-0000-0000-0000-000000000000
f0deabbb-b0f6-46ba-8e16-ff3b44461aeb Farm UserMigrator 00000000-0000-0000-0000-000000000000
f324259d-393d-4305-aa48-36e8d9a7a0d6 Farm SharedServices 00000000-0000-0000-0000-000000000000
f386a1b6-b0f4-46d2-a122-b3a1e56eeb16 Site pwsfields 538c0384-48ab-483d-90ac-e3a09f755ca5
f41cc668-37e5-4743-b4a8-74d1db3fd8a4 Web MobilityRedirect 00000000-0000-0000-0000-000000000000
f6924d36-2fa8-4f0b-b16d-06b7250180fa Site PublishingSite 00000000-0000-0000-0000-000000000000
fc33ba3b-7919-4d7e-b791-c6aeccf8f851 Farm ListTargeting 00000000-0000-0000-0000-000000000000
fcd4c704-ed7a-42fb-ab30-2bb0ab6494c8 Farm OSearchSRPAdminLinks 00000000-0000-0000-0000-000000000000
fd3dd145-e35e-4871-9a6d-bf17f28a1c19 Site PublishingB2TRSiteFilesUpgrade 00000000-0000-0000-0000-000000000000
fde5d850-671e-4143-950a-87b473922dc7 Site IssueTrackingWorkflow 00000000-0000-0000-0000-000000000000
fead7313-4b9e-4632-80a2-98a2a2d83297 Farm SiteSettings 00000000-0000-0000-0000-000000000000
fead7313-4b9e-4632-80a2-ff00a2d83297 Farm ContentTypeSettings 00000000-0000-0000-0000-000000000000
fead7313-ae6d-45dd-8260-13b563cb4c71 Web AdminLinks 00000000-0000-0000-0000-000000000000

Posted by ketaanhs | 0 Comments
Filed under:

Audiences in Inter Farm SSP (Sharepoint 2007 / MOSS)

We were doing some brain storming on Sharing the SSP (Shared Service Provider) between multiple farms i.e. the Parent Farm will be the provider/source of the SSP and the Child farm will consume the SSP. (Needless to say this is MOSS or sharepoint 2007).

It is very easy to set up the sharing of the SSP between farms basically going to the Central Administration àApplication ManagementàUnder office Shared Service provider (Grant or configure shared services between farms ) and here you can configure whether the current farm on which CA is hosted for that farm will be a consumer or provider of the SSP.

 

Ok so now we wanted to keep the Audiences in one place i.e. in the Parent farm and share these Audiences between the Parent and the Child farm. The question came in what would happen if the Parent farm is down for maintenance i.e. Service Pack upgrades, etc. What would happen to Audience targeting that is done on some of the content pages on the Child farm sites? Will it work or will it not? Will the Audiences resolve or not. So we did a quick small POC and following were our findings on that:

 

Case 1: All WFE’s and CA box from the Parent farm is down but not the SQL box from the parent farm: Audience still works (as Parent SQL box is still up and running).

Case 2:  The entire farm is down (all WFEs, CA box) along with the Parent farm SQL Box: The audiences don’t work as expected.

 

 

So bottom line is the Child farm talks directly to the SQL box of the parent farm (i.e. the SSP db of the parent farm) and it is independent of any services on the WFE/CA box of the Parent farm.

Programmatically provision hostheader site collection (MOSS/Sharepoint 2007)

I was looking for a sample on creating a Host header based site collection (programmatically) i.e. using WSS/Sharepoint 2007 API and came across the msdn article, but there is no sample: http://msdn.microsoft.com/en-us/library/ms479602.aspx

 

We can easily do it thru STSADM:

stsadm -o createsite -url http://THE-HOST-HEADER-FOR-THE-SITE-COLLECTION -ownerlogin DOMAIN\username -owneremail username@domain.com -hhurl http://THE-URL-OF-THE-WEBAPPLICATION-THE-SITE-COLLECTION-IS-GOING-INTO

 But then I got the sample, thanks again to TROY STARR he is a great help, thought of sharing this with a larger community in case if someone wants to do it:

 

SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://the-url-of-the-webapplication-the-site-collection-is-going-into"));

 

webApp.Sites.Add(

                "http://the-host-header-for-the-site-collection", // site URL

                "The Site Title", // site title

                "The Site Description", // site description

                1033, // site LCID that represents the language, e.g. 1033 = en-US

                "STS#0", // site template, e.g. STS#0 = Team Site

                @"DOMAIN\username", // site owner login

                "Firstname Lastname", // site owner name

                "username@domain.com", // site owner e-mail address

                NULL, // secondary owner login

                NULL, // secondary owner name

                NULL, // secondary owner e-mail address

                true); // is this a host-named site collection

Posted by ketaanhs | 4 Comments

Host header site collection in MOSS (some details)

If you search on the web on how to create a host header (HH) site-collection you will get a lot of results as lot of community folks have blogged about it. Thanks to all of them for the great work. So following is the command used to create a HH site-collection is:

stsadm -o createsite -url http://THE-HOST-HEADER-FOR-THE-SITE-COLLECTION -ownerlogin DOMAIN\username -owneremail username@domain.com -hhurl http://THE-URL-OF-THE-WEBAPPLICATION-THE-SITE-COLLECTION-IS-GOING-INTO (take from: http://callahansspace.spaces.live.com/Blog/cns!A125D1CFA42E21F7!860.entry)

And in case if you want to create it in a new content database then following is something you can use, inspired and referred from http://sharepointhawaii.com/wenhe/Lists/Posts/Post.aspx?List=dbcd4f5c%2D63e1%2D416c%2Db34a%2Ddd391d48beab&ID=9:

stsadm -o CreateSiteInNewDB -URL http://The URL for HH site collection    -owneremail myemail@myserver.com 
-ownerlogin domain\username -HHURL http://The webapp in which sitecollection needs to be provisioned  -databaseserver DBServerName 
-databasename NameOfTheNewDBForSiteCollection
 
I had some simple queries on some basics of the hostheader site collection and Troy Starr (from MOSS Product team) was a *BIG* help (as always) in answering my queries:
Queries:
 

Q: how does Sharepoint handle the HH site urls (as there is no entry anywhere on the IIS)  how does sharepoint know about the url to the HH site (when the url itself is different). basically I have a web-app with url: http://usctapMOSS  now i create a HH site-collection with a url: http://msfturltest.abc.com  and then I create a required DNS entry for that url  now how does sharepoint know to redirect the "http://msfturltest.abc.com" to the correct site-collection in the http://usctapMOSS web-app.

 

A: When the IIS web site receives the request for _http://msfturltest.abc.com, it will pass it off to SharePoint.  SharePoint will then look at the properties of the request, including its protocol scheme, host name, and port number, to determine the request URL.  It will then look up that request URL in its internal table of AAM URLs and host-named site collection URLs to find a match.  Once it has a match, it opens the site collection associated with that URL and goes from there. The internal table referred here is logical and by looking at the Path column in the configuration database's SiteMap table we can see the host headers assigned to individual site collections. Also note that this lookup information for the site will be cached on the WFE after the first browse.

 

 

Q: Can we restore a backup taken from a non-HH site-collection to a HH-kind of site-collection. (Both the source and target site-collection are in the same web-app and have their own Content database each).

 

A: In general, yes, you can back up a non-HH site collection and restore it as an HH site collection.  Also, in case if this restore of a host-named site collection causes a content database corruption, we can try to fix that corruption by immediately running the stsadm -o renamesite operation after the restore and renaming the HH site URL to itself.

 

Thought of sharing this information in case if someone else had similar doubts.

Posted by ketaanhs | 1 Comments

Sharepoint Content Deployment results in "Value cannot be null"

We were working on a publishing site and had couple of custom field types and controls also as part of our custom development. We were doing Content Deployment to publish our Sharepoint 2007 (MOSS) authoring site to the Publishing site. While doing so typically we were getting following errors:

 

1.       VALUE CANNOT BE NULL

 

OR

 

2.       Object reference not set to an instance of an object

 

 

After carefully looking at the custom developed features we found that some of the custom code was using SPCONTEXT and that code was getting executed during Content Deployment (How did we find this: We attached the owstimer.exe service on the server and ran our custom code in the debug mode).

The problem was with the code of the custom field type was relying on the usage of SPContext object and this object can only be used inside a http request to a sharepoint site. Hence it will always fail during the content deployment (as OWSTIMER.EXE will always have SPContext null) and where no SPContext object exists. We resolved this issue by checking for value of SPContext i.e. we introduced SPContext != null before executing the code and we got over that issue.

 

Make sure to restart the OWSTIMER service after you re-deploy the changed code. Always remember that HTTPContext will not exists while doing the Content deployment and if you have any custom code that directly relies on SPContext will tend to fail and hence the content deployment also.

Hope this helps someone.

Posted by ketaanhs | 1 Comments

How to force a wordbreaker to be used in Sharepoint Search

I had a requirement to crawl Japanese content and we had an English Install of Sharepoint 2007 (MOSS). Now for some reason the locale was not being identified by the crawler for the HTML (i.e. all the Publishing pages) as 1041 (i.e. the Japanese locale), and the default English (US) word breaker was used. I wanted to force the Japanese wordbreaker and finally found that I need to make a registry change (*** PLEASE NOTE REGISTRY CHANGE IS NOT A GOOD IDEA, BEFORE DOING ANY REGISTRY CHANGE PLEASE TAKE A BACKUP OF YOUR REGISTRY***).

To force the crawler to use the JAPANESE WORD BREAKER, I changed the following registry key to use the Japanese WBreakerClass (This change is required on your Index Server):

 

*********************************************************************************************************************************************************************

                                                                                                                       

 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\ContentIndexCommon\LanguageResources\Default\English (United States)]                                            

"WBreakerClass"="{E1E8F15E-8BEC-45df-83BF-50FF84D0CAB5}"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

*********************************************************************************************************************************************************************

 

Now the crawler uses Japanese WBreakerClass instead of English WBreakerClass and all my content is crawled properly as well as the Search results are working great with proper hithighlighting  (which was not working earlier).

Please note that by only forcing Japanese wordbreaker even for English content has a side effect such as breaking definition extraction.

 

Posted by ketaanhs | 1 Comments

Programmatically loop thru Publishing site collection or rather WARMP UP Script for FBA site

I wanted to write a WARMP UP SCRIPT For FBA enabled Publishing site for Sharepoint 2007/ MOSS. 

 

REQUIREMENT:

We have a web-application set up with FBA and we have some of the sites accessible anonymously and other for only authenticated users.

We would like to programmatically loop thru the entire site-collection, I am somehow not able to loop thru the site collection for the authenticated sites and I get access denied.

 

I am sure I am missing some simple step on creating a generic principal with Forms based authentication but not sure where and how I make sure that I can loop thru the site collection.

 

using System;

using System.Collections.Generic;

 

using System.Text;

using Microsoft.SharePoint;

using Microsoft.SharePoint.Publishing;

using System.Net;

using System.Web.Security;

 

 

namespace ConsoleApplication2

{

    class Program

    {

        static void Main(string[] args)

        {

            //args[0]: This is the Site Collection url, e.g.: http://pub-staging.ABCD.com

            //args[1]: This is web service URL for Authentication, e.g: http://pub-staging.ABCD.com/_vti_bin/Authentication.asmx

            //args[2]: This is the username

            //args[3]: This is the password

 

            //string strSiteURL = "http://pub-staging.ABCD.com";

            string strSiteURL = args[0];

 

 

            System.Net.CookieContainer cookie;

            bool blnStatus = FBAAuthenticate(out cookie,args[1],args[2],args[3]);

           

            using (SPSite site = new SPSite(strSiteURL))

                {

 

                    foreach (SPWeb web in site.AllWebs)

                    {

 

                        Console.WriteLine("***********************************************************");

                        Console.WriteLine(web.Url.ToString());

                        Console.WriteLine("***********************************************************");

 

                        //FormsAuthenticationTicket fbaTkt = new FormsAuthenticationTicket("fsegment10", true, 10);

 

                        if (PublishingWeb.IsPublishingWeb(web))

                        {

                            PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);

                            PublishingPageCollection pageColl = publishingWeb.GetPublishingPages();

                            //Call the web service Authentication

                         

                            foreach (SPListItem listItem in publishingWeb.PagesList.Items)

                            {

                                if (PublishingPage.IsPublishingPage(listItem))

                                {

                                    PublishingPage page = PublishingPage.GetPublishingPage(listItem);

                                    try

                                    {

                                        System.Net.HttpWebRequest req =  (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(page.Uri.ToString());  

                                        req.CookieContainer = cookie;

                                        HttpWebResponse res  = (HttpWebResponse)req.GetResponse();

                                        using (System.IO.Stream str = res.GetResponseStream())

                                        {

                                            using (System.IO.StreamReader strReader = new System.IO.StreamReader(str))

                                            {

                                                Console.WriteLine(strReader.ReadToEnd());

                                                strReader.Dispose();

                                            }

                                        }

                                    }

                                    catch (Exception ex)

                                    {

                                    }

                                }

                            }

                        }

                    }

                }

         

             }

 

    

 

        /// <summary>

        /// Sharepoint forms based authentication (FBA) web method call.

        /// </summary>

        /// <param name="cookieContainer">CookieContainer</param>

        /// <param name="strSiteId">String</param>

        /// <returns>Boolean</returns>

        private static bool FBAAuthenticate(out System.Net.CookieContainer cookieContainer, string webServiceURL, string userName, string pwd)

        {

            bool blnStatus;

             FBAPORTAL.Authentication auth = new FBAPORTAL.Authentication();

            //auth.Url = "http://pub-staging.ABCD.com/_vti_bin/Authentication.asmx";

             auth.Url = webServiceURL;

 

            auth.CookieContainer = new System.Net.CookieContainer();

            auth.AllowAutoRedirect = true;

           

 

            //FBAPORTAL.LoginResult loginResult = auth.Login("fbaadminstaging", "fba1234");

            FBAPORTAL.LoginResult loginResult = auth.Login(userName,pwd );

            if (loginResult.ErrorCode == FBAPORTAL.LoginErrorCode.NoError)

            {

                blnStatus = true;

                cookieContainer = auth.CookieContainer;           

            }

            else

            {

                blnStatus = false;

                cookieContainer = null;

            }

            

                        return blnStatus;

        }

    }

    }

 

 

 

Posted by ketaanhs | 1 Comments
Filed under: , , ,

Check Approval is enabled on Pages Library/List

I was trying to locate how to check if the Approval is enabled on the Pages library or any other list/library, found this infor:

listItem.ModerationInformation.Status.Equals(SPModerationStatusType.Pending)

Posted by ketaanhs | 1 Comments

MOSS / Sharepoint 2007 Custom Error Page and Access denied Page

In case if you are interested in creating your own custom error page and custom access denied page instead of the out of the box MOSS / Sharepoint error page (generally the requirements in Publishing internet site). You can use the following HTTPModule (this is just a sample, you can change it to suit your requirements):

 

Note to have following Web.config Entries:

Following entries in the <appsettings> section in the web.config file:

  1. Following entry is for a custom error page to be displayed for anonymous users, the key should be in the format: “CustomAnonCustErrPG-SiteCollectionURL” as shown below:

<add key="CustomAnonCustErrPG-http://xyz.com" value="/Pages/default.aspx" />

  1. Following entry is for a custom error page to be displayed for authenticated users, the key should be in the format: “CustomAuthCustErrPG-SiteCollectionURL” as shown below:

<add key="CustomAuthCustErrPG-http:// xyz.com " value="/Pages/default.aspx" />

  1. Following entry is for a custom error page to be displayed for access denied errors, the key should be in the format: “CustomCustAcsDndPG -SiteCollectionURL” as shown below:

<add key="CustomCustAcsDndPG-http://xyz.com" value="/_layouts/XYZ/CustomErrPg.aspx " />

 

Create an entry on all the WFEs web-application specific web.config in the HTTPModules section, as follows just below the <HTTPModule> tag This should be the first entry in the HTTPModules section:

<add name="XYZExceptionHandler" type="XYZ.Sharepoint.HTTPModule.CustomErrorPages.CustomErrors, XYZ.Sharepoint.HTTPModule.CustomErrorPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=PUBLICKEYGUID" />

 

NOTE: Add your own Public key for PublicKeyToken per your snk used, replace the PUBLICKEYGUID with your own snk value

 

///////////////////////////////////////////////////////////////////////////////////////////////

// This is a HTTPModule used for redirecting the user to Home or Home Anon site depending on whether

// s/he is authenticated or anonymous.

//

// The module checks if the url is accessdenied.aspx and redirects the user to proper url.

////////////////////////////////////////////////////////////////////////////////////////////////

 

using System;

using System.Web;

using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;

using System.Configuration;

using Microsoft.SharePoint;

 

namespace XYZ.Sharepoint.HTTPModule.CustomErrorPages

{

    public class CustomErrors : IHttpModule

    {

 

        #region -- Private fields --

 

        private static AppSettingsReader m_Reader = new AppSettingsReader();

        private static string m_SiteCollAnonCustomErrPG = "CustomAnonCustErrPG";

        private static string m_SiteCollAuthCustomErrPG = "CustomAuthCustErrPG";

        private static string m_SiteCollCustAcsDndPG = "CustomCustAcsDndPG";

       

        #endregion

 

 

        public void Init(HttpApplication context)

        {

            //Attaching event handlers for access denied and error respectively

            //context.BeginRequest += new EventHandler(context_AcessDenied);

            context.EndRequest += new EventHandler(context_AcessDenied);

            context.Error += new EventHandler(context_Error);

 

        }

 

        void context_AcessDenied(object sender, EventArgs e)

        {

            try

            {

                HttpApplication httpApp = sender as HttpApplication;

                HttpContext context = httpApp.Context;

 

                string httpUrl = context.Request.Url.ToString();

                string strCustomAcssDndURL = string.Empty;

                string strSiteURL = string.Empty;

 

                if (httpUrl.ToLower().Contains("/_layouts/accessdenied.aspx"))

                {

                    SPSecurity.RunWithElevatedPrivileges(delegate()

                    {

                        using (SPSite site = new SPSite(httpUrl))

                        {

                            strSiteURL = site.Url;

                        }

                    });

                    HttpContext.Current.Server.ClearError();

                    HttpContext.Current.Response.Clear();

                    strCustomAcssDndURL = getAppSettingsValue(m_SiteCollCustAcsDndPG + "-" + strSiteURL);

                    HttpContext.Current.Response.Redirect(strCustomAcssDndURL, false);

                }

            }

            catch (Exception ex)

            {

                //Do your exception handling

            }

          }

 

 

        void context_Error(object sender, EventArgs e)

        {

            try

            {

                string strURL = string.Empty;

                string strSiteURL = SPContext.Current.Site.Url;

                Exception[] unhandledExceptions = HttpContext.Current.AllErrors;

                //logging all the exceptions thru the Exception policy file

                foreach (Exception ex in unhandledExceptions)

                {

                //Do your exception handling

                }

 

                HttpContext.Current.Server.ClearError();

                HttpContext.Current.Response.Clear();

 

                if (HttpContext.Current.User.Identity.IsAuthenticated)

                {

                    strURL = getAppSettingsValue(m_SiteCollAuthCustomErrPG + "-" + strSiteURL);

                    HttpContext.Current.Response.Redirect(strURL, false);

                }

                else

                {

                    strURL = getAppSettingsValue(m_SiteCollAnonCustomErrPG + "-" + strSiteURL);

                    HttpContext.Current.Response.Redirect(strURL, false);

                }

            }

            catch (Exception ex)

            {

                //Do your exception handling

            }

        }

        

        public void Dispose()

        {

        }

 

        //Method used to read Appsettings value from web.config for the webapplication

        private static string getAppSettingsValue(string sKey)

        {

            string sValue = null;

 

            try

            {

                sValue = m_Reader.GetValue(sKey, typeof(string)) as string;

            }

            catch (Exception ex)

            {

                                //Do your exception handling

            }

 

            return sValue;

        }

    }

}

Posted by ketaanhs | 0 Comments

Disable Event handlers during Content Deployment (Sharepoint 2007/MOSS)

When we are doing a content deployment in a publishing site and there are lot of event handlers attached to list/libraries then be aware that by default content deployment tells PRIME not to fire events during import. You can change this setting, but beware that you’ll see a performance hit (and a small additional one for the actual event handler code you run).

 

So how do you do it?

 

EnableEventReceivers

Possible Values: 0 = No, 1 = Yes, Default Value: No.

This property allows you to control whether event receivers are allowed to fire during the import or not. The default is that event receivers are disabled during import. This configures the SPImportSettings.SuppressAfterEvents setting for the remote import job.

To modify this option please use the following STSADM command:

STSADM -o editcontentdeploymentpath -pathname <pathname> -enableeventreceivers yes | no

 

 Note: In case if you get an error while running the STSADM command that looks like: Failed to update the content deployment path with name................................... Just make sure that you are running the command with proper privileges (one hack just run this command with the same app-pool account as the Central admin, but yes if you run it with a proper privileged account that should not be a problem).

 

Another important thing that I have observed is we restart the OWSTIMER service then we need to run the STSAM -o editContentDeploymentPath command to enable or disable the eventhandlers again.

Javascript RichHTMLField control sharepoint Page Layouts

We are working on a Publishing portal (MOSS / Sharepoint 2007) and we had a requirement to allow the authors to enter  Rich HTML content and that can contain javascript to popup some images that appear as small images in the content or just as a link. Now out of the box the RichHTMLField control rips off all javascript that you enter, but we wanted to allow the users to enter "onclick popup the page" kind of javascript in the content so that in DISPLAY mode the Jscript function could execute.

So we came up with a simple approach to add a client side handler (i.e. Java script that will find and replace the required tags) to replace a specific TAG on our page with the actual javascript tag (as our tags were constant). Following Java Script that we have added to the Master Page in the Head tag just before the </Head> tag (Thank you Rajendra Rawat  for creating this Javascript) should help understand how to overcome the limitation:

<script language="javascript" type="text/javascript">

// Add an entry to the _spBodyOnLoadFunctionNames array
// so that our function will run on the pageLoad event.

_spBodyOnLoadFunctionNames.push("EnableLinks");

//onload=EnableLinks;

function EnableLinks()
{
     if(!IsInDesignMode())
     {
           var cstIdentifier='id="ThisStringToReplace_onclick=';
    
           // Create an array to store all the anchor elements in the page.
           var anchors = document.getElementsByTagName("a");
    
           // Loop through the anchors array.
           for (var i=0; i<anchors.length; i++)
           {
                // Check if this anchor element contain cstIdentifier text.
                if (anchors[i].outerHTML.indexOf(cstIdentifier) > 0)
                {
                     //alert(anchors[i].outerHTML);
                    
                     // Store the HTML for this anchor element.
                     oldText = anchors[i].outerHTML;
          
                     //rewrite the URL to remove our test text and add a target instead
                     newText = oldText.replace(cstIdentifier, 'onclick="');
          
                     // Write the HTML back to the browser.
                     anchors[i].outerHTML = newText;
                    
                     //alert(newText);
                }
           }
     }
}

function IsInDesignMode()
{
   if(document.getElementById("MSOLayout_InDesignMode").value == '1') return true;
   if(document.getElementById("MSOTlPn_SelectedWpId").value != "") return true;
   return false;
}

</script>
------------------------------------------------------------------------------------------------------------

Ensure body tag in master page looks like:
<BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">

otherwise
_spBodyOnLoadFunctionNames will come as  ‘Undefined’ and code won’t execute.

And Following is the sample HTML (that you might add to the RICHHTMLFIELD):

 

<a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts§ionid=5160&postid=9471322#" id="ThisStringToReplace_onclick=javascript:alert('hi');" >click here</a>

<table cellpadding="0" cellspacing="0" border="0" align="center">

     <tr>

      <td align="right"><a href="" id="ThisStringToReplace_onclick=popWindow('/foo/foo/Pages/POPUPD14C86P01.aspx','620','610')" title="月経困難症の診断と治療方針の決定"><img src="http://blogs.msdn.com/foo/foo/PublishingImages/86_01s.jpg" alt="月経困難症の診断と治療方針の決定" width="230" height="204" border="0"></a></td>

     </tr>

    </table>

   </div>

  </td>

  <td align="left" valign="bottom">

   <div class="NANZAN_popup_btn"><a href="" id="ThisStringToReplace_onclick=popWindow('/foo/foo/Pages/POPUPD14C86P01.aspx','620','610')" title="拡大">拡大</a></div>

  </td>

 </tr>

</table>

 

By the way if you want to check on the client side whether the PAGE is in EDIT mode or DISPLAY Mode you can use the following:

function IsInDesignMode()
{
   if(document.getElementById("MSOLayout_InDesignMode").value == '1') return true;
   if(document.getElementById("MSOTlPn_SelectedWpId").value != "") return true;
   return false;
}

 

Posted by ketaanhs | 0 Comments
Filed under: ,

Running our MOSS sites in IE-7 compat with IE-8

We had worked on some MOSS portal sites and wanted to make sure the rendering is fine in IE-8 also without making any changes to the CSS, so the best thing we did was we added the following tag to our Master Page just below the HEAD html tag and then it rendered all our pages in IE-7 mode even while browsing from IE-8:

<!-- Use IE7 mode in IE8 browser -->

 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

<!—End of Use IE7 mode in IE8 browser -->

Following article cam in handy: http://support.microsoft.com/kb/956197

Posted by ketaanhs | 1 Comments
Filed under: ,

Presence indicator problem with Custom Master Page scrolling

Problem:

I have got a unique problem that when you hover over any contact, the actual presence icon appears several pixels below the actual icon.

This only happens when the page is scrolled down and works perfectly when the page is not in scrolled position.  

Also, it works fine when I apply the default master page to the site.

 

 

Solution 1:
The problem is identified sometimes back with the init.js function IMNGetOOUILocation() that returns a fixed location (coordinate) 0, and probably this is causing issue in your custom master page scenario also.

Add this function in the master page, to check if that resolves the issue you are having:

****************************************************************************************************************************************

 

function IMNGetOOUILocation(obj)

{

var objRet=new Object;

var objSpan=obj;

var objOOUI=obj;

var oouiX=0, oouiY=0, objDX=0;

 

// Changed  Fixed scroll up coordination problem due to master page

var scrollTopY = (document.documentElement &&

document.documentElement.scrollTop) ? document.documentElement.scrollTop :

(document.body.scrollTop ? document.body.scrollTop : 0);

var fRtl=document.dir=="rtl";

 

while (objSpan && objSpan.tagName !="SPAN" && objSpan.tagName

!="TABLE")

{

objSpan=objSpan.parentNode;

}

if (objSpan)

{

var collNodes=objSpan.tagName=="TABLE" ?

objSpan.rows(0).cells(0).childNodes

:

objSpan.childNodes;

var i;

for (i=0; i < collNodes.length;++i)

{

if

(collNodes.item(i).tagName=="IMG" && collNodes.item(i).id)

{

 

objOOUI=collNodes.item(i);

break;

}

if (collNodes.item(i).tagName=="A"

&&

 

collNodes.item(i).childNodes.length > 0 &&

 

collNodes.item(i).childNodes.item(0).tagName=="IMG" &&

 

collNodes.item(i).childNodes.item(0).id)

{

 

objOOUI=collNodes.item(i).childNodes.item(0);

break;

}

}

}

obj=objOOUI;

while (obj)

{

if (fRtl)

{

if (obj.scrollWidth

>=obj.clientWidth+obj.scrollLeft)

 

objDX=obj.scrollWidth - obj.clientWidth - obj.scrollLeft;

else

 

objDX=obj.clientWidth+obj.scrollLeft - obj.scrollWidth;

oouiX+=obj.offsetLeft+objDX;

}

else

oouiX+=obj.offsetLeft -

obj.scrollLeft;

// Changed  Fixed scroll up coordination problem due to master page

//oouiY+=obj.offsetTop - obj.scrollTop;

oouiY+=obj.offsetTop;

 

obj=obj.offsetParent;

}

try

{

obj=window.frameElement;

while (obj)

{

if (fRtl)

{

if (obj.scrollWidth

>=obj.clientWidth+obj.scrollLeft)

 

objDX=obj.scrollWidth - obj.clientWidth - obj.scrollLeft;

else

 

objDX=obj.clientWidth+obj.scrollLeft - obj.scrollWidth;

 

oouiX+=obj.offsetLeft+objDX;

}

else

 

oouiX+=obj.offsetLeft - obj.scrollLeft;

// Changed  Fixed scroll up coordination problem due to master page

// oouiY+=obj.offsetTop -

obj.scrollTop;

oouiY+=obj.offsetTop;

obj=obj.offsetParent;

}

} catch(e)

{

};

objRet.objSpan=objSpan;

objRet.objOOUI=objOOUI;

objRet.oouiX=oouiX;

 

//!!! This is the code change:

// Changed  Fixed scroll up coordination problem due to

master page

//objRet.oouiY=oouiY

objRet.oouiY=oouiY - scrollTopY;

 

if (fRtl)

objRet.oouiX+=objOOUI.offsetWidth;

return objRet;

}

 

****************************************************************************************************************************************

 

Solution 2: (Suggested by Madhur Ahuja):

Also, there is another workaround , Add the following CSS:

body

{

                position:static;

}

 

form

{

                position:relative;

}

 

Posted by ketaanhs | 6 Comments
Filed under: ,
More Posts Next page »
 
Page view tracker