Hopefully the Remoting features will be stable enough to make the final release.
To enable your non-sitecore project (for example a Forms application) to use Sitecore Remoting, simply add a reference to Sitecore.Kernel.dll and you are good to go.
Access to Sitecore API is achieved through the new Sitecore.Remoting namespace, where you will have to know about two new types: The RemoteFactory and RemotingClientConfigurator. Only one line of code is necessary in order to get a remote reference to Sitecore:
Sitecore.Remoting.RemotingClientConfigurator.Configure(_sitecoreurl, "admin", "");
This snippet sets up the connection to Sitecore at a given url, with the username 'admin' and the empty password.
To access Sitecore objects, simply use the new RemoteFactory object (a remoting enabled version of the Factory class):
RemoteFactory factory = new RemoteFactory();
You now have access to all Sitecore objects. For example:
factory.GetDatabase("master").GetRootItem()
This will get you the root item of the master database.
In a later post, I will show how Sitecore can be managed and scripted through Microsofts new shell: MONAD using the new Remoting features.
Hopefully other more or less useful programs will be developed as a result of the introduction of .NET Remoting in Sitecore. I talked to Alexy Rusakov (Sitecore developer from our Ukraine division) about creating an addin to the Google toolbar showing a list of items who's workflow step is assigned to a specific user.
Only your imagination is the limit :-)
Regards
2 kommentarer:
What about _sitecoreurl? What value does it hold?
How do I connect to a particular instance of Sitecore when running multiple sites on the same machine?
The sitecoreUrl parameter should hold the location of the root of a Sitecore site. For example, if you have made a default installation on your local PC, the sitecoreUrl parameter should be: http://localhost
RemotingClientConfigurator translates this to: http://localhost/RemoteFactory.rem wich is the main resource to Remoting through Sitecore. It also sets up security by adding a logical call context that is used by the server to authenticate users.
Send en kommentar