WorkFlow Manager 1.0 Configuration Exception

December 8, 2015 1 comment

I have been working on SharePoint 2013 project, and one of the requirements is installing and configuring workflow manager, according to our topology design, there is a separate server for workflow manager. The installing started smoothly by running Microsoft Web Platform Installer, workflow manager 1.0 component has been installed successfully, and then I tried to install Cumulative Update for Service Bus 1.0 by using Microsoft Web Platform Installer (to install Cumulative Update 2 for Workflow Manager 1.0 we must install Cumulative Update for Service Bus 1.0), when I started to search about the component using Microsoft Web Platform Installer, it appears Cumulative Update for Service Bus 1.0 already installed ! any way , Cumulative Update 2 for Workflow Manager 1.0 has installed successfully by using Microsoft Web Platform Installer Also . Finally, I started to configure workflow manager farm, create workflow instance databases and configure service bus using workflow manager configuration manager wizard , at first steps everything is fine until “Get Service Bus Client Configuration ” step of the configuration , it thrown  the following exception

The remote server returned an error: (400) Bad Request. The api-version in the query string is not supported. Either remove it from the Uri or use one of ‘2012-03’


That issue Looks like a service bus version issue. So you have to ensure that Cumulative Update for Service Bus 1.0 is already installed on this server, try using Microsoft Web Platform Installer or you can download that component directly from Microsoft website then install it . i solved my issue by this way



2013 in review

January 1, 2014 Leave a comment

The stats helper monkeys prepared a 2013 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 16,000 times in 2013. If it were a concert at Sydney Opera House, it would take about 6 sold-out performances for that many people to see it.

Click here to see the complete report.

Categories: Uncategorized

Integrate MooTools FrameWork With SharePoint 2010

Here i’m talking about integrating MooTools FraweWork with Sharepoint 2010 , firstly let me describe and define what is Mootools FraweWork ??

MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.

The Stats

MooTools Core
Library Size 64.3K
License MIT
DOM Utilites yes
Animation yes
Event Handling yes
CSS3 Selectors yes (a subset)
Ajax yes
Native Extensions (excluding Element) about six dozen for Array, Object, String, Function, and Number
Inheritance Provided with Class constructor
Other Considerations
plug-ins Roughly 4 dozen official plug-ins available at Unofficial plugin directory at
Official UI library no

so we can do nice tasks with MooTools FrameWork, here going to display Create SharePoint 2010 web part using MooToolsEditable, The SharePoint 2010 web part should allow a user to add the web part to a page where a small html editor will appear.

The editor should be like the one on this page:

but integrating SharePoint with Mootools framework will raise many issues, especially with Out of the Box Javascriopt files , Script Manager on MasterPage, and Microsoft Ajax .

one of the exception which you may face is ” sys.res.enumreservedname’ is null or not an object” , this is error occuered becuase of a conflict between ScriptManager in Sharepoint Master Page and MooTools Javascript files.

Through my research i found 2 steps i should to do in MooTools.Js to override all of the issues, as as the following

1- Everything is based on Type Class, Replace “Type” in JS File with “mooType”. don’t forget to rename the “this.Type” to “this.mooType” too, then do a search for “new Type(” and replace with “new mooType(“, then do a search for “Type.” and replace with “mooType.” .

2- Function.implement “hide: function(){” renamed to “hide2: function(){” and global replace “hide()” to “hide2()”

Attached here, updated Version 1.3 of MooTools.js File after above steps.

Next Article, will be an example with MooTools FrameWork

mootools-core.js (After Downloading The file, change the extension from JPG to JS)


Creating Custom Profile Property in SharePoint Server 2010

March 31, 2013 Leave a comment

if you have requirements to create Custom Profile Property in SharePoint 2010

below function do That

void CreateCustomProperty(string profilePropertyText,SPSite siteColl)




siteColl.AllowUnsafeUpdates = true;

siteColl.OpenWeb().AllowUnsafeUpdates = true;

//SPContext.Current.Web.AllowUnsafeUpdates = true;

SPServiceContext serviceContext = SPServiceContext.GetContext(siteColl);

UserProfileConfigManager profileConfigManager = new

CorePropertyManager coreProperties = profileConfigManager.ProfilePropertyManager.GetCoreProperties();



List<string> MyCustomProperties = new


ProfilePropertyManager propertyManager = profileConfigManager.ProfilePropertyManager;

foreach (string profileProperty in MyCustomProperties)


if (coreProperties.GetPropertyByName(profileProperty) == null)


CoreProperty propertyInstance = coreProperties.Create(false);

propertyInstance.Name = profileProperty.Replace(” “, string.Empty);

propertyInstance.Type = PropertyDataType.String;

propertyInstance.Length = 2000;

//propertyInstance.Separator = MultiValueSeparator.Semicolon;

propertyInstance.DisplayName = profileProperty;

propertyInstance.Description = profileProperty;

propertyInstance.IsAlias = false;

propertyInstance.IsSearchable = true;


ProfileTypePropertyManager profileTypePropertyMgr = propertyManager.GetProfileTypeProperties(ProfileType.User);

ProfileTypeProperty profileTypeProperty = profileTypePropertyMgr.Create(propertyInstance);

profileTypeProperty.IsVisibleOnViewer = true;

profileTypeProperty.IsVisibleOnEditor = true;


ProfileSubtypeManager psm = ProfileSubtypeManager.Get(serviceContext);

ProfileSubtype ps = psm.GetProfileSubtype(ProfileSubtypeManager.GetDefaultProfileName(ProfileType.User));

ProfileSubtypePropertyManager pspm = ps.Properties;

ProfileSubtypeProperty psp = pspm.Create(profileTypeProperty);

psp.IsUserEditable = true;





siteColl.AllowUnsafeUpdates = false;

//SPContext.Current.Web.AllowUnsafeUpdates = false;

siteColl.OpenWeb().AllowUnsafeUpdates = true;


catch (DuplicateEntryException exception)


siteColl.AllowUnsafeUpdates = false;

SPContext.Current.Web.AllowUnsafeUpdates = false;

logMessage(exception.Message, EventLogEntryType.Error);




to check if specific Profile Property exist or not

bool CheckCustomPropertyExistance(string profileProperty, SPSite siteColl)


bool exist = false;



SPServiceContext serviceContext = SPServiceContext.GetContext(siteColl);

UserProfileConfigManager profileConfigManager = new

CorePropertyManager coreProperties = profileConfigManager.ProfilePropertyManager.GetCoreProperties();



if (coreProperties.GetPropertyByName(profileProperty) != null)


exist = true;



catch (DuplicateEntryException exception)


logMessage(exception.Message, EventLogEntryType.Error);



return exist;


Using List Picker Control in Custom WebPart Properties

March 31, 2013 2 comments

if you are developig custom webpart and one of the requirements is getting list title as webpart property. so, you can do that by just adding custom Property as text and the user write list title and you in code behind will handle and validate list title and check if this list already exist or not. Also if you want to query , add or update list in subsite , you will need to add relative path to the list. to override all of these , you can add Out of the Box List Picker, just you will develop custom toolpane for the list and add TextBox and Button to handle user Click.

Let us do an example ,

1-firstly, we need to create custom toolpane Class as the following, here, we need two controls TextBox to get Full path of selected List and Button to handle User Click.

namespace SharePoint14.Webparts.QuickLinkWebPart


ListPicker: EditorPart


TextBox txt;

Button btn;

2-then add Custom ToolPane ID and Title in Construct ,also define Control Init function.

public ListPicker(string webPartID, string webpartname)


this.ID = “listpicker” + webPartID;

this.Title = “Custom WebPart Settings”;

//this = webpartname;

this.Init += new


3- define Init Function, in this function will add define Script Link Control , and in Name Property add “AssetPickers.JS” Load OOTB JavaScript File which is responsible for Opening nice picker dialog where you can choose the List

void ImagePickerToolPart_Init(object sender, EventArgs e)


txt = new

btn = new

sl = new

lit = new

sl.Name = “AssetPickers.js”;

sl.Localizable = true;

sl.Language = “javascript”;

btn.Text = “…”;



4- Define CreateChildControls()

void CreateChildControls()




Label() { Text = “Select a List” });




string strRelativeWebURL = SPEncode.HtmlEncode(SPControl.GetContextWeb(Context).ServerRelativeUrl);

if (strRelativeWebURL.Trim() ==“/”)


strRelativeWebURL =“”; //blank browses the root spweb


string strAssetPickerConfig = string.Format(@”

<script type=’text/javascript’>

with(new AssetPickerConfig(‘testAssetPickerObj’))










UseImageAssetPicker=true; //make this false to show Documents instead



ReturnCallback = null;}}




lit.Text = strAssetPickerConfig;


btn.OnClientClick = “APD_LaunchAssetPickerUseConfigCurrentUrl(‘testAssetPickerObj’); return false;”;


i hope this help you

Importing SharePoint Solution Package (WSP) into Visual Studio 2010

December 30, 2012 1 comment

In this article I’m talking about importing WSP as a result of exporting site template into visual studio 2010.

Let us go to our demo steps

1-      Go to site setting -> Save site as template


2-Give exported template a name and description, and check Include Content checkbox in case you want to export all site contents

3- Go to site setting,  You will get a link to your “solution gallery”, which has your template.

4-Open visual studio 2010 -> Create New Project  ->Import SharePoint Solution Package

5- Select “Deploy as Farm “ option

6-Select the path of existing solution

7-    After importing this WSP, a wizard will appear with all contents of WSP and give developers to select and deselects items.

8-Visual studio Solution

Creating a custom WCF service in SharePoint Server 2010

October 11, 2012 Leave a comment

Developing a WCF in SharePoint 2007 was not easy Job. and for now in SharePoint Server 2010 ASP.NET web services are obsolete . in SharePoint 2010, the recommended approach is developing WCF. Creating Custom WCF and hosting it in SharePoint 2010 isn’t difficult task where we can achieve that through multiple approaches like using an open source Visual Studio 2010 extension know as Community Kit for SharePoint: Development Tools Edition which makes developing Custom WCF more easily or Creating Empty SharePoint Project , then Map to ISAP folder then add WCF files ( Interface , Classes, Configuration Files) to it.

Here i going to use Community Kit for SharePoint . The Community Kit for SharePoint: Development Tools Edition extends the Visual Studio 2010 SharePoint project system with advanced templates and tools.

Create WCF Service

1- create a new empty SharePoint Project.

2- Select Deploy as farm solution.

3- Add new Item, Right Click on Project Name , then Select WCFService (CKSDEV).

Services Type

There are 3 different type of service

1- SOAP Service.

2- REST Service

3- ADO.NET Data Service

if you want to change the service type,please modify the factory in .SVC

SOAP Service Factory : MultipleBaseAddressBasicHttpBindingServiceHostFactory

REST Service Factory: MultipleBaseAddressWebServiceHostFactory

ADO.NET Service Factory : MultipleBaseAddressDataServiceHostFactory

Browsing Custom WCF Service

After Service deploy, you need to use the service in another projects. First try to access the service in browser. But remember you need to access the MEX endpoint either you will not get the service accessible in browser. To access the MEX endpoint, you should add “/MEX” at the end of the service name as shown below: