SharePoint, XBOX, .NET, Technology - What I am reading

    [Home] [Recent] [Site Map] [SharePoint] [XBOX]

   

SharePoint Blogs

5/23/2007 SPS2003 Site Template Gallery

As a follow up from our recent discussion about the SPS2003 List Template Gallery, we should look at the SPS2003 Site Template Gallery.

You find it under Site Settings | Manage Security and Addional Settings.  Again, you roll into the gallery and upload your template and viola...

Say you"ve uploaded your site template.  You should be able to go to the Site Manager area and click on Create Site and select your template.

sigh...

 -robot

5/23/2007 SPS2003 List Templates

So, we know that the top level site owns the list template gallery.  Remember also, when the list template gallery is just another doc library so you can right click on a template and save the .stp file to disk. You can also rename the .stp file to .cab and then open it like any .cab file to see that there"s a manifest.xml  in there and it will define the content and structure of the list.

But also, the portal has its own list template gallery.  Find it under Site Settings | Manage Security and Addional Settings.  so you roll into the gallery and upload your template and viola...

I guess it was too good to be true,  when you go to create a new list in a portal area, you don"t get the option to use your list template. 

Is this supposed to work?  Does anybody know?

Well sure, you say...  The Create List\Library list is trimmed to templates in the gallery that are cut from sites with the same site type.  That is to say, if you create a doc library in a team site and cut a template from it, when you upload the template to a meeting site"s list template gallery and click create, your template will not be an option.  Likewise, the various portal areas are individual site types; if you cut a template from the home area and upload it to the portal"s list template gallery, you won"t be able to use that template in any area that doesn"t use the home template.

At least it"s good to know.

The question remains, however, what does the portal site template gallery do?

-robot

5/23/2007 Custom List Feature

I though creating a Custom List that is implemented as a Feature would be really easy, but as usual Sharpoint had other plans for me. Anyway after spend a lot of time I managed to get it working, I have created an article page with an example of how to create a Custom List Feature. You can view the article here

http://www.sharepointblogs.com/martinbailey/pages/create-a-custom-list-feature.aspx

5/23/2007 Tracing and Logging in MOSS and WSS 3.0

Tracing and Logging in MOSS and WSS 3.0

I was thinking through the ways of putting a logging and tracing mechanism in place in for MOSS and WSS 3.0 features or webparts or for that matter any application that uses the /folder/sharepoint.htm object model.

 

I came across few alternatives.

1.       Putting the events in the Event Viewer of the system: This is the traditional method of putting the tracing mechanism in place but I would say this is not as efficient as it should be. It has few drawbacks like we need to have access to the production system in order to check the trace and need to have specific right to access the event viewer

2.       Putting the events log in a text file: This is also among one of the oldest why where we have the information about the trace file in the application settings section of the web config and we write the information to this file. This will also have the same set of draw back the above approach has.

One of the alternative ways to perform this is to add the trace data in audit information using the MOSS custom event audit feature and have the information as the custom Audit data xml there.

This takes us to a place where audit database will act like a trace database sink for us.

Using this we can have the trace writing capabilities available on the fly with the object model of /folder/sharepoint.htm and then we can write a webpart to read and view the traces over the internet/intraner.

This could be extended to the fact to put the audit information in the form of a document which can be downloaded for the support people on request.

I am not sure how successful this approach is going to be. So I request some comments from you people to do some more brain storming on this.

 

Regards,

Sahil

 

Note: There are lot of resources available on the net to how to access the audit log and add data to it so I am not going into the details for that. I am trying to keep this post as conceptual as possible. May be with the comments with the post I will put some code with this.

5/22/2007 Trials with a VPC
So a couple weeks ago I decided that I wanted to toy with a VPC and MOSS 2007 for testing purposes.  I started up a VPC on my external hard drive that was dynamically expanding with 15 gb of space.  About a week later and 15 unplugs to my VPC I had completely eaten all of the possible space on the virtual disk.  I had messed up the hard disk so bad by unplugging it.  Unfortunately, I forgot to install the add-ons that would allow me to create an undo disk.  I was so frustrated that I completely deleted the hard disk and the virtual machine.  I gave up for about 3 weeks.  For some reason last Friday I decided to try again.  I shoved my power cable into a position where I would not completely unplug it and I tried yet again.  This time I followed the internet guide I had found pretty closely (http://www.pptspaces.com/sharepointreporterblog/Lists/Posts/AllPosts.aspx).  Right now I have a fully working MOSS 2007 VPC with Office 2003 and 2007 working side by side.  I am hoping within the next week I can start writing some basic applications to create MOSS 2007 websites.  I am starting to read Developer"s Guide to Windows /folder/sharepoint.htm Services 3.0 by Todd Bleeker, so that I can check on the differences in object models from 03 to 07.  I will keep everyone posted on what happens.  Who knows I may be writing a great post on how to virtually eradicate a MOSS 2007 VPC using code...I"m also officially moving to Kansas City from St. Louis, so I may end up incredibly frustrated with the external hard drive slammed against the cubicle wall.
5/22/2007 Adjusting the top level navigation on all My Sites

Last week when talking to a customer about their new MOSS 2007 environment I was asked whether it was possible to adjust the top level navigation on all My Sites.

In general it is possible to adjust the top level navigation by going to the Site Settings page.
Under Look and Feel you can select Top link bar. Here you can add a new link. Unfortunately doing so in your My Site would mean that you would have to repeat that for every user"s My Site.

In order to adjust the top level navigation in all My Sites you should go the Central Administration and to the SharedServices. Here you will find the link Personalization site links under User Profiles and My Sites.
You can add new links here that will be added to the top level navigation between the My Home link and the My Profile link.

You can also target these links, so you could for instance put a link in there that would point to "My Business Unit". This can be realized by adding a link with the title "My Business Unit" for each of the business unit homepages. These links would then be targeted to audiences that are generated for each business unit. This way a user would only see his or her own business unit link displayed in the My Site.

Of course if you work for two separate business units and if you are in more than one business unit audience the link would be displayed twice, pointing to the two different business unit homepages. So it might be smarter to use the name of the business unit as the title for the link. Oh well, this was just an example.. ;-)

5/22/2007 SharePoint 2007 Custom Authentication using the Asp.Net Membership Database

This article provides step-by-step instructions for configuring SharePoint 2007 to use the Asp.Net Membership database to authenticate users.  I highly recommend reading Andrew Connell"s blog first, since this article is based on his work:

Create the Asp.Net Membership and Role Database

Run the Asp.Net Sql Server Setup utility aspnet_regsql.

If you run the utility without any parameters (or with the –w parameter), a wizard will step you through database creation.  Note: There are additional options on the command line that are not available in the GUI.

Click Next >.

 

Choose the Configure SQL Server for application services option and click Next >.

 

Provide the server and the database name.  In this example, we are creating the database on the SharePoint Sql Server database server.

 

Grant Asp.Net Membership Database Roles to the SharePoint Application Pool Account(s)

 

Grant the SharePoint application pool account(s) access to the following database roles:

 

aspnet_Membership_FullAccess

aspnet_Roles_fullAccess.

Add Users to the Asp.Net  Membership Database

At the time of this writing, user provisioning and management with custom authentication providers through SharePoint 2007 is less than optimal.  The easiest way to manage users is through the Asp.Net website configuration tool available only in Visual Studio 2005.  You can work with the database directly, but be aware that many fields are encrypted (this option can be disabled), and the tool abstracts this complexity.  I"ve also read that IIS 7 will include a configuratioin tool for the Asp.Net Membership database.  In the mean time, you might be interested in this open source project for managing users directly in SharePoint: http://www.codeplex.com/MOSSFormsFeature.

 

In Visual Studio 2005, create a new web application.  Add a web.config to the web application.  Update web.config to include the membership and role configuration information below (but use your environment-specific information).

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <connectionStrings>
    <add 
      name="MyCompanyFormsAuthMembershipDB" 
      connectionString="SERVER=mydatabase.mycompany.com;DATABASE=SP_Forms_Auth;TRUSTED_CONNECTION=true;" />
  </connectionStrings>
  <system.web>
    <authentication mode="Forms" />
    <membership defaultProvider="MyCompanyFormsAuthMembershipProvider">
      <providers>
        <add 
          name="MyCompanyFormsAuthMembershipProvider" 
          type="System.Web.Security.SqlMembershipProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" 
          connectionStringName="MyCompanyFormsAuthMembershipDB" 
          enablePasswordRetrieval="false" 
          enablePasswordReset="true" 
          requiresQuestionAndAnswer="true" 
          applicationName="/" 
          requiresUniqueEmail="false" 
          passwordFormat="Hashed" 
          maxInvalidPasswordAttempts="5" 
          minRequiredPasswordLength="7" 
          minRequiredNonalphanumericCharacters="1" 
          passwordAttemptWindow="10" 
          passwordStrengthRegularExpression="" />
      </providers>
    </membership>
    <roleManager enabled="true" defaultProvider="MyCompanyFormsAuthRoleProvider">
      <providers>
        <add
          name="MyCompanyFormsAuthRoleProvider"
          connectionStringName="MyCompanyFormsAuthMembershipDB"
          applicationName="/"
          type="System.Web.Security.SqlRoleProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
      </providers>
    </roleManager>
  </system.web>
</configuration>

Once you have updated the web.config and saved it, open the Asp.Net Website Configuration Tool

Select Security and then Create User.  The following screen appears:

Note: You can have the same user names as Windows accounts, but be aware when you add them to SharePoint, you will either have to search for the user or prefix the user name with the membership provider in the format [provider name]:[username].  For example, if my Windows user name is mycompany\johpow, I can create johpow in the Asp.Net Membership database, but I’d have to tell SharePoint which johpow I want to use, because if I typed in johpow, SharePoint will resolve the Active Directory user first.

Create the SharePoint Application for Windows Authentication 

You will need two web applications: one for Windows authentication and one for Asp.Net Membership authentication.  If you tried to use one web application configured for the Asp.Net Membership provider you would not be able to login with your Windows account.  You would be able to login with users from the Asp.Net Membership database, but none of them would have access to the SharePoint site!  It"s the "chicken before the egg!" This is why you need a second application with Windows authentication so you can login and grant access to the users in the Asp.Net Membership database. 

 

You should determine the urls for the entry points into your web application and determine which authentication scheme will be used for which url.  In this example, I want to create an Internet-facing site http://aspnetmembership.mycompany.com that is enabled for Asp.Net Membersip login.  I want our employees to be able to access the site with their Windows account, so I make their entry point http://windows.mycompany.com.  Although you can use host files for testing, you might also want to consider DNS entries before proceeding, especially if your organization requires a formal request for new urls.

 

In my experience, the order of application creation is important--the first application is set as the Default zone.  Create the Windows authentication entry point first and then extend that application to the custom authentication entry point.   

 

 

In Central Administration > Application Management, select Create or extend Web application.

 

Select Create a new Web application

 

 

Provide the values appropriate for your environment and click OK.  Note you cannot select a zone because the first application is set to the Default zone.

 

Create the SharePoint Application for Asp.Net Membership Authentication

 

 

In Central Administration > Application Management, select Create or extend Web application. 

 

 

Select Extend an existing Web application.

 

 

Change the web application to the web application you created in the step above.

 

 

For this example, this is an Internet-facing entry point, so change the Zone to Internet.

 

Configure the Asp.Net Membership Provider in the Web.config

You will need to modify the web.config for the two applications you created in the steps above.  In addition you will also need to modify the web.config for the Central Administration website so you can apply policies. 

 

Locate the virtual directories for all three applications.  Make a backup of your current web.config files.  Then copy and paste sections of the web.config from your Visual Studio 2005 web application web.config file to the SharePoint application web.config file.

 

Insert the <connectionStrings> section right after the closing SharePoint element (</SharePoint>).

 

Insert the <membership> and <roleManager> sections right after the opening System.web element (<system.web>).

 

** IMPORTANT: the Central Administration configuration has a minor difference.  You must set the roleManager defaultProvider attribute to AspNetWindowsTokenRoleProvider or Central Administration will not work properly.  Here is how the element should look:

 

<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider">

 

Repeat this step for all three web applications and if you have multiple front-end servers, make sure you copy the web.config changes to them as well!

 

For good measure, reset IIS on all web front end SharePoint servers.

 

Configure the Asp.Net Membership Provider

 

 

From Central Administration > Application Security, select Authentication Providers.

 

 

Choose the web application (in this example http://windows.mycompany.com).

 

Set Authentcation Type to Forms.

Check enable Anonymous access.

Enter the name of the membership provider and role manager.  These names must match your web.config entries exactly.

Click Save.

 

Grant the Asp.Net Membership users access to the SharePoint site

 

Access the application using the Windows authentication entry point.  Then add users as site collection administrators or assign the appropriate permission levels to the site.  When you log in to the Windows authentication entry point you will be able to add both Windows users and Asp.Net Membership datasbase users.  The reason this works is because you put the membership provider and role manager information in the Windows authentication web application.  You will also be able to add both Windows and Asp.Net Membership database users from the Asp.Net Membership entry point.

 

Test Asp.Net Membership Forms Authentication

 

Access the site using the Asp.Net Membership entry point.  You should be prompted with the default SharePoint forms authentication login form.

 

 

You might also be interested in this blog which goes through enabling / disabling anonymous access.

 

5/22/2007 Primary key violation when using the SPExport object

Last month we made a simple utility that creates backup for a single MOSS list/document library or a given set of lists/document libraries, and imports the backup. It was similar to the code you can read on Ton Stegeman’s blog.

After using it successfully for a few weeks we found that in some cases it throws an exception like this: Violation of PRIMARY KEY constraint "PK__#ExportObjects____XXXXXXXX". Cannot insert duplicate key in object "dbo.#ExportObjects". The exception was thrown at the "Progress: Calculating Objects to Export." phase of the export.

This message was not new for us, because we had this previously when running content deployment in incremental mode. At that time we found that it is a known issue, since Ryan Steeno posted a comment on this on Ton Stegeman’s blog. Later we found a similar post on Jespers’ blog. Unfortunately none of the version setting workarounds suggested (Site Collection Images, Site Collection Style Library, and we tried several others) worked for us, so we left with the full deployment option.

Getting this exception from the utility was a new thing we haven’t read about. Since for this problem we haven’t found workaround and we were curious we decided to create SQL trace to catch the source of the problem.

We found that the SPExport.Run() calls several proc_Depl* stored procedures. In the case of the error, the proc_DeplAddListItemDependencies SP (that is called directly by the proc_DeplAddExportObjectDependencies SP) causes the PKV. We checked the code and found that the first part of this SP is responsible for the error. This SP inserts new records to the #ExportObject table, and although there is a check that only items that have IDs not existing already in the table, nothing guaranties that the ID of the inserted items are unique.

In this case, for the items with type 8 (that seems to be content type) in #ExportObject, the ID is calculated from the last 16 digits of the content type ID. Since the INSERT statement tries to insert a single content type several times (seems to have a single item for each content type –folder pair), the same ID is calculated for the same content type each time, so PKV is not a bug surprise.

We modified (hacked) the proc_DeplAddExportObjectDependencies in our test system to have only a single item for each content type. Alternative is to have several content type – folder pairs for each content types and generate the ID with NEWID(). This latter one also requires a helper temporary table because using NEWID() simple in the SELECT statement would cause additional records because of the DISTINCT used.

With this modification the incremental content deployment is working, and also there is no exception with the export utility. But this is for sure not a suggested (or supported) scenario for a production environment.

After doing this, we found that exporting sites with STSADM is working. Since from the output messages it was clear that the STSADM should use the SPExport API as well, we hoped that by checking its code we will found a correct resolution for our problem.

The site export function in the STSADM is done by Microsoft.SharePoint.StsAdmin.SPExportOperation.Run(). There were several differences between the SPExportSetting we used in our code and the one was used in STSADM. We found that the PKV problem can be solved by using the ExcludeDependencies = true setting.

Today we were notified that the hotfix for the incremental content deployment PKV is available from Microsoft, and we read the same information on William Cornwill’s blog. Although the export utility now runs with this setting we hope the fix will solve the issue of running SPExport with the default SPExportSettings ExcludeDependencies = false as well.

5/21/2007 Notifier des utilisateurs par Mail

Pour envoyer un mail depuis MOSS c"est trés simple il existe deux deux API dans SPUtility. (Cet espace de nom contient plein de petits trucs sympas).
SPUtility.IsEmailServerSet qui retourne true si un serveur de mail sortant est défini dans MOSS pour le spweb spécifié.
SPUtility.SendEmail pour envoyer le mail.

Voici un exemple de code:

if ( SPUtility.IsEmailServerSet(mySPWeb) == true )
{
   bool bAppendHTML = true;
   bool bEncodeHTML = false;
   string sTo = "dupond@dupond.com";
   string sSubject = "Le sujet du message";
   string sHtmlBody = "Corps de message avec du <b>Gras</g><br>Un saut de ligne";

   SPUtility.SendEmail(mySPWeb, bAppendHTMLTag, bEncodeHTML, sTo, sSubject, sHtmlBody);
}

5/21/2007 Welcome to Kevin Vieira"s House of Blog

Hello,

My name is Kevin Vieira and I work for Microsoft Flight Simulator Community team in Redmond, Washington as a Web Developer. On April 18th, 2007 the FS Community team released a public facing internet site that I developed using MOSS 2007 and a whole lot of patience. In my blog I am going to share what I"ve learned about MOSS 2007 and I really hope it helps at least one developer avoid having to stay up all night. Let me tell you, in the 4-6 weeks it took to get http://www.fsinsider.com/ from conception to reality, there were many nights where I didn"t sleep.

上一页 1 2 3 4 5 6 7 8 9 10 下一页

   

Site List:
>>Xbox Live_s Major Nelson
>>Xbox 360 & SharePoint 2007 Weblog
>>Carsten Keutmann_s Blog
>>Mohamed Zaki_s Blog [Sharepoint MVP]
>>The Mit_s Blog
>>Mart Muller_s Sharepoint Weblog
>>Microsoft SharePoint Products and Technologies Team Blog
>>SharePoint Solutions Blog
>>4GuysFromRolla.com Headlines
>>ASP.NET Blogs
>>SharePoint Blogs
>>SharePoint Blogs
>>Joel on Software
>>ADO Guy_s Rants and Raves
>>Microsoft Live Labs
>>GadgetNews
>>Windows Vista Team Blog
>>VoIP & Gadgets Blog
>>schrankmonster blog
>>Via Virtual Earth Blog
>>Feed
>>MSDN Blogs
>>Mashable!

Links:
Jack's Readings

Month Archives:
Oct 2007
Sep 2007

Top Tags:
social software social networking .NET mashable Sharepoint ASP.NET Web 2.0 Web2.0 Startups Community News Search Marketplace General Software Development AJAX Windows Vista Visual Studio Microsoft myspace Silverlight People Powered! YouTube Vista MOSS Featured News C# Events MOSS 2007 Google WPF Office 2007 Web Community Security General Personal Xbox 360 facebook Tools development SharePoint 2007 Fun Atlas Architecture ASP.NET AJAX myspace codes TheLongTail IIS SQL Server Developers Revenue Sharing Video Pictures WCF Mobile 2.0 Announcements Orcas MIX07 Arcade Team System JavaScript News



@2007 All rights Reserved