Home Blog Page 9

[SharePoint 2010] Free MasterPages from CodePlex

0

Codeplex projects propose some cool free features including 3 master pages for SharePoint 2010 :

Apple.com Master Page

Metro UI Master Page

Buried Alive – Halloween Theme


Those could be apply to your sharepoint 2010 site and customized.
Download link : http://spmasterpage.codeplex.com/
Other codeplex projects : Useful tools for Sharepoint 2010 from Codeplex

[SharePoint 2010 Developpement] Getting started with SharePoint 2010 Developpement, thanks to SharePoint 2010 – 101 Codes Samples (MSDN)

1

Microsoft has published a SharePoint 2010 Code sample pack. Containing 101 Codes samples !
If I had that when i began to learn SharePoint, it would have saved me a lot of time.
Language are C# and VB, for SharePoint on premise AND Online !!
image
Some of really useful features are, for a sharepoint developper :

  • Programmatically create masterpage for Sharepoint 2010, and apply the masterpage programmatically thanks to a Feature Event Receiver
  • Programmatically create content type for Sharepoint 2010
  • Create List definition for SharePoint 2010

Or some advanced one :

  • Use Azure, WCF, Sharepoint Web service in Webpart, event receiver or Jobtimer

Here the complete list :

  • SharePoint 2010 Leveraging HTML5 Objects in SharePoint
  • SharePoint 2010 Developing JQuery-Enabled Web Parts
  • SharePoint 2010 Creating Document Sets Programmatically
  • SharePoint 2010 Developing List Definitions
  • SharePoint 2010 Hosting Silverlight Applications that Call Azure Services
  • SharePoint 2010 Developing AJAX-Enabled Web Parts
  • SharePoint 2010 Developing Styled Master Pages
  • SharePoint 2010 Programmatically Finding Tagged Items
  • SharePoint 2010 Creating Content Types Programmatically
  • SharePoint 2010 Using JavaScript to Enable Notifications
  • SharePoint 2010 Performing Cross-List Queries
  • SharePoint 2010 Using JavaScript and CAML to Query Lists
  • SharePoint 2010 Developing Delegate Controls
  • SharePoint 2010 Developing Connected Silverlight Web Parts
  • SharePoint 2010 Developing Starter Master Pages
  • SharePoint 2010 Developing Application Pages
  • SharePoint 2010 Developing Custom Navigation Providers
  • SharePoint 2010 Working with Disposable Objects
  • SharePoint 2010 Using JavaScript to Show Dialog Boxes
  • SharePoint 2010 Calling RESTful SharePoint Services From Desktop Applications
  • SharePoint 2010 Using REST to Obtain Excel Charts
  • SharePoint 2010 Developing Connected Web Parts
  • SharePoint 2010 Creating List Items from Silverlight
  • SharePoint 2010 Retrieving Single List Items in REST Requests
  • SharePoint 2010 Using REST to Discover the Contents of Excel Worksheets
  • SharePoint 2010 Logging Site Events Programmatically
  • SharePoint 2010 Programmatically Reading User Profile Properties
  • SharePoint 2010 Displaying User Profile Pictures Programmatically
  • SharePoint 2010 Creating Taxonomies Programmatically
  • SharePoint 2010 Using JavaScript to Edit and Save Values in Items
  • SharePoint 2010 Managing Document Sets Programmatically
  • SharePoint 2010 Developing Web Templates
  • SharePoint Online Authenticating Using the Client-Side Object Model
  • SharePoint 2010 Using JavaScript to Create Lists
  • SharePoint 2010 Developing Workflow Activities
  • SharePoint 2010 Creating Custom Timer Jobs
  • SharePoint Online Accessing Web Services
  • SharePoint 2010 Displaying Video Files Stored in Azure
  • SharePoint 2010 Performing Cached Cross-Site Queries
  • SharePoint 2010 Declaring Records Programmatically
  • SharePoint 2010 Developing Custom Expiration Actions
  • SharePoint 2010 Accessing SharePoint Lists from External WCF Services
  • SharePoint 2010 Developing Custom Expiration Formulae
  • SharePoint 2010 Developing Event Receivers
  • SharePoint 2010 Performing Searches from Silverlight
  • SharePoint 2010 Using JQuery to Retrieve List Contents in JSON
  • SharePoint 2010 Using REST to Query Data Ranges in Excel Worksheets
  • SharePoint 2010 Developing Feature Receivers
  • SharePoint 2010 Canceling Synchronous Events
  • SharePoint 2010 Creating Custom SharePoint Service Applications
  • SharePoint 2010 Developing Custom Field Controls
  • SharePoint 2010 Developing Sequential Workflows
  • SharePoint 2010 Creating Custom Field Types
  • SharePoint 2010 Using JavaScript to Get Details About Sites
  • SharePoint 2010 Calling WCF Services from Timer Jobs
  • SharePoint 2010 Developing State Machine Workflows
  • SharePoint 2010 Logging Data to the Developer Dashboard
  • SharePoint Online Deploying Sandboxed Content Types and List Definitions
  • SharePoint Online Creating and Deploying Sandboxed Web Parts
  • SharePoint 2010 Using JavaScript to Retrieve and Interrogate Items in Lists
  • SharePoint 2010 Using JavaScript to Get Details About Site Collections
  • SharePoint 2010 Developing Page Layouts
  • SharePoint Online Accessing Current User Information in Sandboxed Solutions
  • SharePoint 2010 Calling WCF Services from Web Parts
  • SharePoint 2010 Retrieving List Contents and Parsing Atom Responses
  • SharePoint 2010 Developing Editor Web Parts
  • SharePoint 2010 Developing Branded Media Controls
  • SharePoint 2010 Using JavaScript to Delete Items from Lists
  • SharePoint 2010 Using LINQ in REST Requests
  • SharePoint 2010 Uploading SharePoint Library Content to Azure Storage
  • SharePoint 2010 Using JavaScript to Update Site Properties
  • SharePoint 2010 Calling WCF Services Hosted in SharePoint
  • SharePoint 2010 Creating Items in Lists from External WCF Services
  • SharePoint Online Creating Excel Worksheets by Using Excel Web App
  • SharePoint 2010 Developing Sandboxed Web Parts
  • SharePoint 2010 Creating Content Organizer Rules Programmatically
  • SharePoint 2010 Using REST to Create a SharePoint and Bing Maps Mashup
  • SharePoint 2010 Developing Site Definitions
  • SharePoint 2010 Developing Ribbon Drop Down Controls
  • SharePoint 2010 Calling WCF Services from Event Receivers
  • SharePoint 2010 Creating Custom SharePoint Service Applications
  • SharePoint 2010 Developing Custom Field Controls
  • SharePoint 2010 Developing Sequential Workflows
  • SharePoint 2010 Creating Custom Field Types
  • SharePoint 2010 Using JavaScript to Get Details About Sites
  • SharePoint 2010 Calling WCF Services from Timer Jobs
  • SharePoint 2010 Developing State Machine Workflows
  • SharePoint 2010 Logging Data to the Developer Dashboard
  • SharePoint Online Deploying Sandboxed Content Types and List Definitions
  • SharePoint Online Creating and Deploying Sandboxed Web Parts
  • SharePoint 2010 Using JavaScript to Retrieve and Interrogate Items in Lists
  • SharePoint 2010 Using JavaScript to Get Details About Site Collections
  • SharePoint 2010 Developing Page Layouts
  • SharePoint Online Accessing Current User Information in Sandboxed Solutions
  • SharePoint 2010 Calling WCF Services from Web Parts
  • SharePoint 2010 Retrieving List Contents and Parsing Atom Responses
  • SharePoint 2010 Developing Editor Web Parts
  • SharePoint 2010 Developing Branded Media Controls
  • SharePoint 2010 Using JavaScript to Delete Items from Lists
  • SharePoint 2010 Using LINQ in REST Requests
  • SharePoint 2010 Uploading SharePoint Library Content to Azure Storage
  • SharePoint 2010 Using JavaScript to Update Site Properties
  • SharePoint 2010 Calling WCF Services Hosted in SharePoint
  • SharePoint 2010 Creating Items in Lists from External WCF Services
  • SharePoint Online Creating Excel Worksheets by Using Excel Web App
  • SharePoint 2010 Developing Sandboxed Web Parts
  • SharePoint 2010 Creating Content Organizer Rules Programmatically
  • SharePoint 2010 Using REST to Create a SharePoint and Bing Maps Mashup
  • SharePoint 2010 Developing Site Definitions
  • SharePoint 2010 Developing Ribbon Drop Down Controls
  • SharePoint 2010 Calling WCF Services from Event Receivers
  • SharePoint 2010 Accessing List Items from Silverlight
  • SharePoint Online Creating and Deploying Sandboxed Event Receivers
  • SharePoint 2010 Performing Searches from Web Parts
  • SharePoint 2010 Deleting Items in Lists from External WCF Services
  • SharePoint 2010 Developing Solution Validators
  • SharePoint 2010 Updating SQL Azure Records from Web Parts
  • SharePoint 2010 Calling Azure Services from Timer Jobs
  • SharePoint 2010 Importing Content by Using the Content Deployment API
  • SharePoint 2010 Calling WCF Services from Custom Workflow Activities
  • SharePoint Online Creating and Deploying Sandboxed Workflow Activities
  • SharePoint Online Creating Documents Using Word, PowerPoint, or OneNote Web App
  • SharePoint 2010 Calling Azure Services from Web Parts
  • SharePoint 2010 Creating SQL Azure Records from Web Parts
  • SharePoint Online Creating and Deploying Sandboxed Feature Receivers
  • SharePoint 2010 Developing Ribbon Actions
  • SharePoint 2010 Querying SQL Azure Data from Web Parts
  • SharePoint 2010 Retrieving List Contents in JSON Format and Parsing Responses
  • SharePoint 2010 Exporting Content by Using the Content Deployment API
  • SharePoint 2010 Calling Azure Services from Custom Workflow Activities
  • SharePoint 2010 Deleting SQL Azure Records from Web Parts
  • SharePoint 2010 Calling Azure Services from Event Receivers
  • SharePoint 2010 Retrieving List Contents in JSON Format and Parsing Responses
  • SharePoint 2010 Exporting Content by Using the Content Deployment API
  • SharePoint 2010 Calling Azure Services from Custom Workflow Activities
  • SharePoint 2010 Deleting SQL Azure Records from Web Parts
  • SharePoint 2010 Calling Azure Services from Event Receivers
  • SharePoint 2010 Updating SQL Azure Records from Web Parts
  • SharePoint 2010 Calling Azure Services from Timer Jobs
  • SharePoint 2010 Importing Content by Using the Content Deployment API
  • SharePoint 2010 Calling WCF Services from Custom Workflow Activities
  • SharePoint Online Creating and Deploying Sandboxed Workflow Activities
  • SharePoint Online Creating Documents Using Word, PowerPoint, or OneNote Web App
  • SharePoint 2010 Calling Azure Services from Web Parts
  • SharePoint 2010 Creating SQL Azure Records from Web Parts
  • SharePoint Online Creating and Deploying Sandboxed Feature Receivers
  • SharePoint 2010 Developing Ribbon Actions
  • SharePoint 2010 Querying SQL Azure Data from Web Parts
  • SharePoint 2010 Accessing List Items from Silverlight
  • SharePoint Online Creating and Deploying Sandboxed Event Receivers
  • SharePoint 2010 Performing Searches from Web Parts
  • SharePoint 2010 Deleting Items in Lists from External WCF Services
  • SharePoint 2010 Developing Solution Validators

Thanks microsoft & msdn Clignement d'œil
Download link : http://code.msdn.microsoft.com/SharePoint-2010-101-Code-da251182

[SharePoint 2010 – Error Fixing] Error “Object reference not set to an instance of an object.” when trying to add links in top navigation bar, as sub menu. With a custom created Sharepoint web template

0

If you created a webtemplate based on any Site Definition (Team Site…) and if you comment the navbars part

[SharePoint 2010 – Error Fixing] SPException invalid date/time (Erreur : Valeur de date/d’heure non valide. Un champ de date/d’heure contient des données non valides. Vérifiez la valeur, puis réessayez)

1

What did i try to do ?

I’m creating SPListItem Programmatically (create elements in a list) and when the item.update(); is called by the code, the following error is thrown :
“Erreur : Valeur de date/d’heure non valide.Un champ de date/d’heure contient des données non valides. Vérifiez la valeur, puis réessayez”
or in english :
“SPException : invalid date/time…”

What could be the problem ?

  1. The date format is not correct
  2. The date is not correct (minimum date for SharePoint ?)

Solving the problem

I’m giving an example of an incorrect date value “01/01/0001 00:00:00” :

   1: SPList list = web.Lists["myList"];
   2:  
   3: SPListItem item;
   4: string date = "01/01/0001 00:00:00";
   5:  
   6: item = list.Items.Add();
   7:  
   8: item["currentDate"] = date;
   9: if (DateTime.TryParse(row["currentDate"].ToString(), out dateTime) == true)
  10: {
  11:     //si la date est définit
  12:     if (dateTime.ToString() != "01/01/0001 00:00:00")
  13:     {
  14:         item["currentDate"] = SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Parse(date));
  15:     }
  16: }
  17:  
  18: item.update();
  19: list.update();

01/01/2001 is an incorrect value for a date in sharepoint.

And we check the date in order to respect sharepoint dates rules, using the method : CreateISO8601DateTimeFromSystemDateTime.

Have you ever had other issue with dates and SPListItem ?

[Perso] I got MCTS – SharePoint 2010, Application Development 70-573

0

First certification, but not the last 🙂 :

 

 

Thanks to becky bertram post, that helped me a lot to review it :
http://blog.beckybertram.com/Lists/Exam%2070667%20Study%20Guide/AllItems.aspx

[SharePoint 2010 – Developpement] Allow embedded youtube video in blog post content (as content editor webpart), with new embedded youtube code (iframe) for SharePoint 2010 blog post

1

What is that ?

Based on this excellent tutorial from kirk Evans : http://blog.evepoints.com/2010/11/add-video-sharepoint-2010-blog.html
This will allow you to add youtube video in a blog content.
Basic sharepoint feature permit you to add the video by modifying the HTML code, from the Insert HTML button of sharepoint, but that is not really user friendly.
Preview, on a blog post :
image

 

New youtube embedded format ?

I modified one of the method of Kirk Evans in order to accept the new youtube embedded video format. The new embedded video format looks like this :

New youtube embedded code for video (<iframe) :

image

Old youtube embedded code for video (object) :

image

So to update Kirk Evans code, replace the last method by :

   1: private string ReplaceEmbedsWithTokens(string body)
   2:         {
   3:             //VARS
   4:                 string returnString = null;
   5:                 //Old version of youtube embedded
   6:                 Regex rx = new Regex("(&lt;object).*?(&lt;embed src=&quot;)(?<src>.*?)(&quot;)(.*?)(&lt;/object&gt;)");
   7:
   8:             //CLEANING from a text editor
   9:             body = body.Replace("nr", " ");
  10:             body = body.Replace("rn", " ");
  11:
  12:             if (rx.IsMatch(body) == false)
  13:             {
  14:                 //New version of youtube embedded
  15:                 rx = new Regex("(&lt;iframe).*?(src=&quot;)(?<src>.*?)(&quot;)(.*?)(&lt;/iframe&gt;)");
  16:                 returnString = rx.Replace(body, "[[BLOGVIDEO: ${src}]]");
  17:                 returnString = returnString.Replace("embed", "v");
  18:             }
  19:             else
  20:             {
  21:                 //Old version of youtube embedded
  22:                 returnString = rx.Replace(body, "[[BLOGVIDEO: ${src}]]");
  23:             }
  24:
  25:
  26:             return returnString;
  27:         }

It also fix a bug : when you paste the embedded code in a word document in order to save it, and then you paste it in a blog, it won’t work properly.

Enjoy, and thanks again Kirk Evans

[SharePoint 2010] – Cumulative Update December Issues –Document content type is missing after programmatically have created Content Type

8

Issues :


After patching SharePoint 2010, with the cumulative Update of December, you could get some issues if you created custom content type by Visual Studio, using programmatically method (C#) :

  • The document content type is missing
    • The error prompting on sharepoint is : 0x0101 is missing
  • The element content type is missing :
    • The error prompting on sharepoint is : 0x01 is missing
  • The error prompting : The parent content type specified by content type identifier 0x0…. does not exist

Solution : Here is the content type declaration in Visual Studio, this content type is added in a feature :

   1: <?xml version="1.0" encoding="utf-8"?>
   2: <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   3:   <ContentType ID="0x0101000726C67DDB280345872AA6FCED5762D104"
   4:                Name="CustomContentType"
   5:                Group="Custom Group"
   6:            Inherits="True"
   7:            Overwrite="True"
   8:                xmlns="http://schemas.microsoft.com/sharepoint/">
   9:     <Folder TargetName="_cts/CustomContentType" />
  10:     <FieldRefs>
  11:       <FieldRef ID="{8553196d-ec8d-4564-9861-3dbe931050c8}" Name="FileLeafRef" Required="TRUE" />
  12:     </FieldRefs>
  13: </Elements>

After the patch, this declaration won’t work, you’ll correct it by deleting “Inherits” and “Overwrite” attribute.           Inherits=”True”            Overwrite=”True”


[Edit 01/03/2012] : You’ll need to redeploy the .wsp package, or to modify directly in the /14 folder, the deployed content type + iisreset (not tested).


Did you have any other issue after the cumulative update of december 2011 for SharePoint 2010 ?

[VmWare Workstation] Vmware workstation error : “Taking ownership of this virtual machine failed. The virtual machine is in use by an application on your host computer. Configuration file…”

0

Problem

Launching a vm leaded me that message error : “Taking ownership of this virtual machine failed.

Resolution

The virtual machine is in use by an application on your host computer.

Configuration file” To solve the problem, delete lck files in the machine virtual folder content, search for : *.lck

[Sharepoint 2010 – Error Fixing] The file has been modified by … unknown

0

I got the following error message in visual studio during programing :

“The file has been modified by … unknown”

It was because i called two times (by error) the item.update(); method.

This could happen as well when you code an event receiver (sometime happening when you do something on a list, web, site….) and you use item.update(), in order to fix that :

  •  call and disable event firing before your code with : base.EventFiringEnabled = false;
  • update your item by calling item.systemUpdate(false); 
  • enable event firing with : base.EventFiringEnabled = true;

[Microsoft Techdays 2012] Techdays 2012 en préparation

0

Pour ceux qui ne connaissent pas, les techdays ce sont des jours consacrés à la présentations des technologies Microsoft.

J’étais présent en tant qu’un des représentants étudiants du laboratoire Microsoft de mon école SUPINFO en 2011

Lien :
http://www.microsoft.com/france/mstechdays/

A bientot aux techdays 2012 !