Creating a New Provider for Protean CMS - Eonic/ProteanCMS GitHub Wiki

##Prerequsites

Get the folder named 'Example' from 'ProteanCMS/Providers/Membership' (This will be a template for you to use to get up and running)

##Adding the New Provider

Navigate to the current project to which you want to add the new provider.

At the root of the project add the files, if they don't already exist, assemblies/providers/[typeOfProvider e.g. membership]/.

Once these folders have been created you can now add the 'Example' folder that you got from ProteanCMS and add it to the last folder that you created and rename it with the name of your provider.

Now in Visual Studio you can add the provider to your solution by right-clicking your solution and clicking Add > Existing Project.

You can then find the solution within assemblies/providers/[typeOfProvider]/[providerName]/.

Next, you will want to create a config file at the root of your site named protean.[providerName].config.

In this file you're going to want to include the following code to get started:

<?xml version="1.0"?>
<ProviderName>
	<add key="operationMode" value="staging" />
	<add key="stagingURL" value="" />
        <add key="liveURL" value="" />
        <add key="stagingKey" value="" /> <!-- not always required -->
        <add key="liveKey" value="" /> <!-- not always required -->
</ProviderName>

Now that everything has been added for your provider make sure that you go though all of the files in the new provider that you've added and change all of the NOD names to the name of your provider.

Now check that your site is using the new provider that you've added as a dependancy.

##Amending web.config

Now were going to be editing the 'web.config' file so that the functions that are created in the provider will overwrite the desired ones in Protean.

Navigate to the 'web.config' file at the root of ProteanCMS.

Firstly you're going to want to add a

to the '' as follows:
<section name="NOD" type="System.Configuration.NameValueFileSectionHandler, System, Version=1.0.5000.0, Culture-neutral, PublicKeyToken=publicKey" restartOnExternalChanges="false"/>

Next, underneath the 'protean' tag your going to want to add the name of your provider as a tag and then add the type of provider that you're using. In my example here I'm going to use NOD and a Membership provider as an example:

<protean>
     <NOD configSource="protean.NOD.config" />
     <membershipProviders>
    	     <providers>
		     <add name="NOD" className="Protean.Providers.Membership.NOD" rootClass="Protean" type="path" path="/bin/Protean.Providers.Membership.NOD.dll" />
	     </providers>
     </membershipProviders>
<protean/>

Congratulations, your have now successfully created a new provider and added it to your project!



⚠️ **GitHub.com Fallback** ⚠️