In The Mix

As a SharePoint architect I have the business behind me and the Developers and IT Pro on my shoulders.

BCS Model Receiver August 27, 2010

Filed under: BCS,SharePoint 2010 — fmuntean @ 2:11 pm
Tags:

BCS is now available in SharePoint 2010 at the Foundation level.
However seems that some people inside SharePoint team and Visual Studio team did not got the memo 🙂

The code to install the BCS model is only available inside a dll that is installed with the Standard/Enterprise edition of SharePoint 2010 Server.

I have just published a new project on CodePlex: http://bcsmodelreceiver.codeplex.com/ that will install the missing code as a Farm feature and will permit to install your BCS Model feature correctly on any platform. It is a Farm feature that will ease the pain of deploying BCS Models inside SharePoint 2010 especially the Foundation.

The code used in this project was actually published by Microsoft at: http://code.msdn.microsoft.com/BDCSPFoundation The only thing I have done is to put it together as a reusable feature so you do not have to cut and paste the code in each of the project.

Now, to use this feature, there is a small tweak that the developer has to do in Visual Studio, and that is to reference the BCS Model Feature Class from this project.

 
How To Install:
Install the BCSmodelReceiver.wsp into the SharePoint 2010 Farm.
The BCSModelReceiver Feature will be automatically activated and ready for use.
image
 
 How to use it:
Now in Visual studio you have to change the Feature Receiver used for your Model under the properties:
 
image
Replace the existing value for the Feature Receiver property with: MFD.SharePoint.BDCModelReceiver.ImportModelReceiver, MFD.BCSModelReceiver, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e1e7a9e7f1c01c11
Now just build the WSP and deploy it in the FARM. It will automatically use this event receiver.
Plus optionally on the feature settings you can make your Model Feature depended on the BCSReceiver Feature ID=c1b3a659-a86e-4353-aad3-efe46cbbb4eb
NOTE: Once you  use this receiver you will have to deploy this feature in the Farm even if you are using SharePoint 2010 Standard/Enterprise.
 

Serialization inside SandBox Solutions June 29, 2010

Filed under: SharePoint 2010 — fmuntean @ 4:27 pm
Tags:

When creating a Web Part in SharePoint 2010 that will store configuration/data inside the SP Hierarchical Store at the SPWeb  level, using automatic serialization of an object, I got into the following error: System.Runtime.Serialization.SerializationException was unhandled Message=Unable to find assembly ‘MFD.SandBoxWebPart, Version=1.0.0.0, Culture=neutral ….’

Now to explain in more details the problem and how I choose to resolve it.

The configuration class is nothing else than a DTO class containing the configuration items as public properties and the [Serializable] attribute and be as simple as this example:

  1. [Serializable]
  2. public class MyConfig
  3. {
  4.     public string Config1 { get; set; }
  5.     public long Config2 { get; set; }
  6. }

I got the previous error when adding an instance of this class into the SPWeb Properties as in the following example (the exception gets thrown at line 5):

  1. SPWeb web = SPContext.Current.Web;
  2. {
  3.     var config = new MyConfig()
  4.                     {Config1=“Value1”,Config2=123};
  5.     web.AddProperty(“Key”,config);
  6. }

Now there is nothing wrong with accessing the SPWeb properties inside the Sandbox solutions as the following code will work just fine:

web.AddProperty(“Key”,”Value”);

The problem is that the serialization mechanism inside .NET requires to load the assembly for reflection. The SandBox assembly can’t be found because it is not saved in the GAC or any of the SharePoint folders as it only resides in memory and on the Content Database.

A work around for this to create your own serialization to xml/string using custom methods that will save/restore your data using one of the .NET classes (that can be serialized because they live in GAC).

An example of new MyConfig class will look like this:

  1. [Serializable]
  2. public class MyConfig
  3. {
  4.     public string Config1 { get; set; }
  5.     public long Config2 { get; set; }
  6.     public static MyConfig FromXML(string xml)
  7.     {
  8.         XElement doc = XElement.Parse(xml);
  9.         return new MyConfig()
  10.         {
  11.             Config1= doc.Element(“Config1”).Value,
  12.             Config2 = long.Parse(doc.Element(“Config2”).Value)
  13.         };
  14.     }
  15.      public string ToXml()
  16.         {
  17.             XElement xml = new XElement(“MyConfig”,
  18.                 new XElement(“Config1”,this.Config1),
  19.                 new XElement(“Config2”,this.Config2));
  20.             return xml.ToString();
  21.         }
  22. }

Now all you have to do to store the config in SPWeb properties is to:

  1. SPWeb web = SPContext.Current.Web;
  2. {
  3.     var config = new MyConfig()
  4.                     {Config1=“Value1”,Config2=123};
  5.     web.AddProperty(“Key”,config.ToXML());
  6. }
 

SharePoint Saturday Boston 2010 February 27, 2010

Filed under: Conference,Presentations,SharePoint 2010 — fmuntean @ 1:55 pm

Thanks everybody for attending my session on SharePoint 2010.

I have uploaded the presentation on Slide Share for you to have, including the speaker notes. Feel free to drop me a line if you have any questions.

As you learn more about SharePoint 2010 you will see that there is a lot that I have to let out due to the time allowed for the presentation. There was no rule on that so if you want more talks or info on a specific feature drop me a line.

I will go over the evaluations once I get them back from the organizers and will update this post or add more to answer all your questions as promised.

 

SharePoint Saturday Boston Feb 2010 February 19, 2010

Filed under: Conference,Presentations,SharePoint 2010 — fmuntean @ 4:31 pm

The clock is ticking, the event is closing and preparations are undergoing to make this event one of the best for SharePoint enthusiasts.

Join us on February 27, 2010 for a day of fun learning with almost 30 presenters multiple tracks and many hours to learn about SharePoint.

If you have not register for the event here.

To help with choosing the correct room for presentations so we don’t cram 300 people in a small room please Respond to this Survey, and I hope to see you for my presentation “Introducing SharePoint 2010 to Administrators”.

Now I am going back to prepare for the event. See you there.

SharePointSatBoston

 

Sandbox Solutions issue in SharePoint 2010 Beta February 2, 2010

Filed under: SharePoint 2010 — fmuntean @ 10:23 am
Tags:

For those who start building sandboxed solutions in SharePoint 2010 beta and have trouble seeing their sandboxed solution web part on the page,or deployment errors there is a known bug in there that can be corrected by applying the following Power Shell script witch fix the ACL for the sandboxed code:

 

#Fix SharePoint Sandboxed Solutions Bug – Web Part Not Visible
$acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName
$person = [System.Security.Principal.NTAccount]"Users"
$access = [System.Security.AccessControl.RegistryRights]::FullControl
$inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit"
$propagation = [System.Security.AccessControl.PropagationFlags]::None
$type = [System.Security.AccessControl.AccessControlType]::Allow
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type)
$acl.AddAccessRule($rule)
Set-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $acl

 

SharePoint 2010 – Technical diagrams December 14, 2009

Filed under: SharePoint 2010 — fmuntean @ 7:23 pm

Up on TechNet Microsoft have released a lot of diagrams based on the Beta 2 version of SharePoint 2010.

Many of these resources are visual representations of recommended solutions. They include poster-sized documents available in formats including Microsoft Office Visio 2007 files (.vsd), PDF files, and XPS files.

If you want a poster size diagram from areas like: Services, Topologies, Hosting Environments, Search Technologies, Business Connectivity Services Model, Content Deployment, Upgrade Planning, and business intelligence in SharePoint Server 2010 then get them all from here.

 

External Lists Limitations in SP2010 December 13, 2009

Filed under: SharePoint 2010 — fmuntean @ 8:33 pm
Tags: ,

Currently SharePoint 2010 is in Beta 2 phase and I am investigation the new possibilities given by the new External List feature.

During the investigation found few limitation that I will document them here:

  • RSS feeds are not enabled
  • InfoPath Forms can be generated but if try to customize them you get in a lot of limitations including not supporting other data connections.
    image
  • Creating Access View not working
  • Data Sheet View is disabled
  • Export To Excel is disabled
  • Adding extra columns not from the external content Type are not allowed
  • Ratings and Workflow are not allowed.
  • Trying to change “Information management policy settings” gives error.

SharePoint is currently only in the beta phase but It seems again that external list have a lot of limitations and I don’t know how much of them will be removed by RTM.

Even if Microsoft was trying to make the External Lists to be as transparent as possible for the End User we’ll need to be careful when recommending and use this list because of the existing limitations.

I have hoped that when Microsoft have designed this External List to just decoupled the data storage and data access layer from the rest of the SPList type.