As you know, I run windows 2008 on my laptop - to take advantage of hyper-v, and to be able to develop and demo sharepoint FAST.
The only problem I had so far was the bluetooth - which I solved in past installations, and then something broke and I couldnt get it to work again. Well - if you have the same problem as me, here is the solution that solved my issues: http://www.dev-toast.com/2007/01/05/uncrippling-bluetooth-in-vista-rtm
Sharepoint Tips And Tricks is Ishai Sagi's sharepoint information blog. It specializes in Microsoft SharePoint technologies, including web parts, development, configuration, customization, and best practices for the use of Microsoft SharePoint Server and Windows SharePoint Services. It also provides some related Office Information, including VSTO and VSTA and other office application development tips.
Wednesday, February 25, 2009
Finally - a solution to having bluetooth in windows 2008
Monday, February 09, 2009
Preventing IIS from logging activity on a specific sharepoint site
A friend at "Kraft Foods" sent me the following tip to share with you. I must say that I didn't try it myself - so use at your own risk.
The problem
IIS logs activity for a sharepoint web application, for all sites. If you have a web application with a lot of sites, and a lot of activity, the IIS logs may grow out of proportion and make analysis of the logs harder and harder. What if you don't want it to audit all sites, but just some of them? what if we want to exclude a certain site that is hit often, and we don't care if it is audited by IIS?
Well, if our site was a regular .net site, we would have the folders of that site (the virtual directories) shown and we could mark places in the hierarchy that we do not want to audit. But SharePoint does not create virtual folders in IIS, instead IIS has only one folder for all site collections in the web application.
The solution
According to my friend, the solution is to manually create folders under the IIS physical folder by the url names of the sites that you want to exclude. For example, if you have a site called "News" that you want to exclude from the logs, go to "C:\inetpub\wwwroot\wss\VirtualDirectories\{your web application}" and create a folder "News". Then, in IIS right click the folder, and configure it to be excluded from the logs.
More Info
I couldnt find how to exclude the folder in windows 2008 - but in IIS6 you can do that under "Directories" tab, by setting "Log Visits" = unchecked.
Sunday, February 08, 2009
New MOSS internet site launched - good case study
One of the three Israeli mobile communication companies has released a new web site – using MOSS. From my initial review, it is one of the best implementations I have seen so far in that it:
- Works (I couldn’t find a page with errors or place holder text which is usual in new sites)
- works reasonably fast
- usable – nice big global navigation, in sub sites there is a nice distinct secondary navigation
- different sections have different backgrounds – so the shop pages look different from the customer relations pages
- makes use of personalisation – users can log on, see their account and special offers
- even search looks good and is optimised with keywords and best bets – although they could have used a different font for the description to make it different from the link)
- system pages are properly disabled – showing a user friendly error message
- same for page not found error
Does anyone know who built the site for them? kudos!
Sunday, February 01, 2009
Dispose check tool - to check your best practices
Paul Andrew from Microsoft has just announced that the SPDisposeCheck tool was released to the public. I have tested this tool in Alpha and Beta, and provided Microsoft with feedback -and now the completed tool is ready for you to download. A must for every sharepoint developer! See Paul's blog post or go to the MSDN download page
Monday, January 26, 2009
Memberships
I was puzzled why on my development server the memberships web parts never showed the sites that my test users were members of. After much searching and tinkering I found that I needed to run a full profile import and a full search crawl. It could be that only one was required - but I cannot verify it. The profile import does say that it updates memberships, but even after that it didnt add the memberships - only after I performed a full search crawl that it started working.
Tuesday, January 06, 2009
Discounted Microsoft Certification code
Want to do a Microsoft certification exam? is it a Microsoft Certified Technology Specialist (MCTS), Microsoft Certified IT Professional (MCITP) and Microsoft Certified Professional Developer (MCPD) exam?
Here is how you can get 10% off the price, and get a free retake if you fail the first try.
Simply go to http://www.learnandcertify.com/ and click on "Get my exam offer voucher" and when it asks you for the MVP promotion code, enter AUD2D426 and you will be sent a voucher to use in a Prometric exam centre of your choice.
This offer is valid until March 2009 - so go on, get the vouchers and start taking exams!
Have fun!
Monday, December 15, 2008
Changing fields by code - common oversight
I just helped someone on the OzMOss mailing list who had the following problem - he was trying to change a SPField object, but it was not getting updated, despite of no errors being thrown. Here is a sample of the code he was using:
Guid listID = web.Lists.Add("test", "", SPListTemplateType.PictureLibrary);
SPList list =web.Lists[listID];
SPField myField = list.Fields.GetFieldByInternalName("Title");
myField.Title = "TEST";
list.Update();
The problem with that code is a common oversight that developers who are new to the SharePoint object model usually make - the field object has to be updated. updating the list will have no effect, since the object that was modified was a column on the list, not a property of the list.
The right code would be:
Guid listID = web.Lists.Add("test", "", SPListTemplateType.PictureLibrary);
SPList list =web.Lists[listID];
SPField myField = list.Fields.GetFieldByInternalName("Title");
myField.Title = "TEST";
myField.Update();
Tuesday, November 25, 2008
How to copy attachments from one list item to another
The microsoft support article for WSS 2 shows us how to download attachments from a list item. Basically, the attachments for a list item are stored as SPFile objects under a hidden folder in the list where those attachments are (a folder called "Attachments") - where each list item that has an attachment has its own folder - with the ID of the item being the folder's name. Here is a code sample for a function to copy attachments from one item to another.
private void CopyAttachments(SPListItem sourceItem, SPListItem targetItem) { try { //get the folder with the attachments for the source item SPFolder sourceItemAttachmentsFolder = sourceItem.Web.Folders["Lists"].SubFolders[sourceItem.ParentList.Title].SubFolders["Attachments"].SubFolders[sourceItem.ID.ToString()]; //Loop over the attachments, and add them to the target item foreach (SPFile file in sourceItemAttachmentsFolder.Files) { byte[] binFile = file.OpenBinary(); targetItem.Attachments.AddNow(file.Name, binFile); } } catch { } finally { sourceItem.Web.Dispose(); } }
Thursday, November 20, 2008
Custom fields with custom properties - important link
If you have developed a custom field type that has custom properties, and now want to create a feature that uses that custom field (to add a site column for example) and want to set the custom property, you may be puzzled how to set the custom property, since the schema of the elements file does not allow it.
I found that Péter Holpár has a solution - I tested, and it works. Basically, just add the custom property with a custom name space - for example, using my datevalidator field type from my teched presentation, you can define it as a site column thus (important bits are highlighted):
<?xml version="1.0" encoding="utf-8"?> <!-- --> <Elements xmlns="http://schemas.microsoft.com/sharepoint/" xmlns:custom="http://www.sharepoint-tips.com/customfields"> <Field ID="{BBC8063E-252E-4fc0-9DC6-CA162512BB33}" SourceID="http://schemas.microsoft.com/sharepoint/v3" Type="DateValidationFieldType" Name="MyTestValidationField" StaticName="MyTestValidationField" DisplayName="My Test Validation Field" Group="Custom" Hidden="FALSE" ReadOnly="FALSE" Required="FALSE" RowOrdinal="0" custom:StartDateFieldName="Start Date" custom:EndDateFieldName ="Due Date" > </Field> </Elements>
I hope it solves your questions as well.
Thursday, November 13, 2008
Using the People picker - how to specify what can users choose
Just got this question in the Ask-The-Experts stand in Tech.ED europe. If I use the people picker like I showed in a previous article, how can I specify if the users can pick a user or a security group or a distribution list?
Well, the answer was in the SDK - there is a property "SelectionSet" that accepts a comma-delimited list of strings that say what can be picked.
For example, "User,DL,SecGroup" will allow users to pick user accounts, distribution lists and security groups. Choosing just "User" will allow only people accounts. The sharepoint people picker ususaly sets "User,SecGroup,SPGroup" or "User,SecGroup" or just "User"