Sharepoint : Using BaseFieldControl

What for ? Sharepoint’s API provides some standard form controls to render each column. This is the controls used to render the standard add and edit forms. And they all inherit the BaseFieldControl class. In other word: In any SPList, you have some SPField fields and each of these SPField has the super power to create a BaseFieldControl. Each BaseFieldControl is a CompositeControl containing ASP.Net controls. For a single line field, you will just have a wrapped TextBox. But for some more advanced fields like a multi-select lookup field (SPFieldLookup) or rich text field, it can generate some “complex” controls and their related javascript code. ...

July 28, 2009 · Florent Clairambault

Mono Tools for Visual Studio

Just a little post for all these people who seem to think Mono is just an other short-term open-source software. I’ve used it for quite some time with a production “real time” network server, which is running for something like 6 months now, and it performs very well. I do everything on my Windows host and then copy and launch the final app on the Linux host. But there are still two problems : ...

July 27, 2009 · Florent Clairambault

Debugging on Sharepoint 2007

Sharepoint debugging isn’t fully automated. So you should really know how to debug and diagnose your assemblies in any given situation. 1. Attaching to the process It only applies to a debugging environnement. This is the one that everybody knows (or should at least). You deploy your DLL in the GAC, restart your application pool, access your sharepoint web application in order to load the application pool and the DLL and then attach to the right w3wp.exe process (or every w3wp.exe process if you don’t really know which one to choose). ...

July 26, 2009 · Florent Clairambault

Innovation

Google innovation chick, Marissa Mayer, says in her stanford show : Innovation: Not instant perfection. Launch early and often get to the market. Share everything you can: Information is KEY and powerful. You’re brilliant, we’re hiring: Hire generalists than can speak to all areas of your organization. Specialists create silos. A license to pursue your dreams: Give people a choice us to where they would like to invest their time and thinking. Ideas come from everywhere: The power of many wins. Don’t politic: Use data. Consensus of data wins not power or hierarchy. Creavity loves constraint: Stay in the sandbox and focus on direction/output. Users and usage are key: Money will follow. Don’t kill projects: Morph them. Adjust or tweak and more on. I really like what she says even if I don’t feel very concerned by the two last points. ...

July 20, 2009 · Florent Clairambault

Sharepoint : SPWebConfigModification

I’ve seen lots of Sharepoint software having an installation manual of at least 20 pages (sometimes 60). Most of the operations they describe could be fully automated. And these software were made by freaking big companies. They should be ashamed of themselves. Maybe they just forgot that computer science is all about saving some time (and not only making money). One good example is MOSS Faceted search 2.5 (I haven’t tested the 3.0). It takes at least 40 minutes to uninstall this crap. Why isn’t it just ONE WSP or at least one BAT file launching the WSP installation and the other steps ? Is there any real reason for that ? ...

July 19, 2009 · Florent Clairambault

Sharepoint 2010

Finally, Microsoft decided to communicate on Sharepoint 2010 on their website. Wow, they really seem to have understood all of the sharepoint developers problems. Look at the full developer video. Everything is incredible : Sharepoint Extensions seem complete and cutomizable, there is the new developper dashboard which displays for instance the number of opened SPRequest the time spent on each loading stage of the page, the Business Data Catalog model allows to use any data inside sharepoint within “external lists”, the official LinQ for Sharepoint, the new WSP package which allow to specify which deployment actions to use. This runs on top of Windows Server 2008 and Visual Studio 2010. ...

July 18, 2009 · Florent Clairambault

Sharepoint – Updating webparts

I’ve talked about this before. When you create versions of webparts, you have two main solutions to update existing webparts : Create a binding redirect within the web.config file. Update each and every webpart instance of the collection site (or just the site). The first one is really the best solution : It’s simple and very fast. But, it applies to the whole Web Application. Sometimes, the client might want to only update the site collection or even the website. In this case, we need to apply the second solution : update each webpart. ...

July 6, 2009 · Florent Clairambault

My little Sharepoint

I recently bought a new laptop. I choose a P8600 processor to make sure to have virtualization support and a little TDP (Thermal Dissipation Power) because I don’t really like the fan noise. And it has 4GB or RAM for these little virtual hosts. So today, I decided to have a little Sharepoint 2007 of my own. I installed Windows Server 2008 on a VMWare host, activated Remote Desktop, added Sharepoint 2007 and then MOSS 2007. I choose the x86 version of WS2008 because I wanted to limit RAM usage. With only 1GB of RAM, it worked like a charm and it is really fast. ...

July 3, 2009 · Florent Clairambault

GAC Download Cache

There’s one little feature that you must have totally forgotten in the .Net framework, but it is great. We can tell our apps to download automatically some DLL we would expect to be in the GAC and that are not. This is one freaking great feature. Instead of forcing your users to install the librairies in their GAC or including the libraries with your applications, you can specify the URL(s) of the DLL(s) your software application depends on. When you launch your program, the .Net framework program will download them automatically if they’re not already in the GAC download cache. ...

June 25, 2009 · Florent Clairambault

Access your Google Latitude position from PHP

The code to access your Google Latitude position is even simpler in PHP than it is in .Net : <?PHP header('Content-Type: text/plain'); $userId = '5616045291659744796'; if ( $_GET['user'] ) { if ( is_numeric( $_GET['user'] ) ) $userId = $_GET['user']; else exit('This isn\'t a valid user id.'); } $url = 'http://www.google.com/latitude/apps/badge/api?user='.$userId.'&type=json'; // We get the content $content = file_get_contents( $url ); // We convert the JSON to an object $json = json_decode( $content ); $coord = $json->features[0]->geometry->coordinates; $timeStamp = $json->features[0]->properties->timeStamp; if ( ! $coord ) exit('This user doesn\'t exist.'); $date = date( 'd/m/Y H:i:s', $timeStamp ); $lat = $coord[1]; $lon = $coord[0]; echo $date.' : '.$lat.' x '.$lon; ?> This program is available for testing here. It requires PHP 5.2.0 to run the json_decode method. ...

June 22, 2009 · Florent Clairambault