Because every day I learn new things and I had been looking for good place to store interesting websites I decided to create new category “Worth To Know” on my blog to share what in my opinion should be shared/promoted in developers community (not only with those who work with Sitecore).
So today I’m giving for you some links about SOLID architecture principles which I try to watch/read once a week to remember how important are they.
- SOLID architecture principles using simple C# examples by Shivprasad Koirala – website / click
- SOLID Design Patterns in C# by Free Programming Course – youtube / click
These rules are also important when you work with Sitecore – as you probably know it is also possible to destroy a pleasure of work with Sitecore if code will be done very badly.
Everyone who have worked with Lucene indexes in Sitecore probably asked one day him self – “how my content looks after tokenization process?”.
The answer of course is different depending on the type of used analyzer. (About types of analyzers you can read here. I will not provide those information here because it is not in the scope of this post)
Few days ago one of my colleagues (Wojciech Urban – thanks for that!), found the very useful tool which provide us following information:
- how tokenized text looks like
- how get tokens which are equal to those inside Lucene index
< You can find this tool here >
How tokenized text looks like?
As you can see in the image you are able to insert any description and test the tokenization process results.
You can also change types of analyzers – you can choose from the following list:
With this tool, results of your queries would never surprise you again!
How to get tokens which are equal to those inside Lucene index?
If you need tokens – let say for do something with your search results you can do something like this:
// get the analyzer which you use
var analyzer = new StandardAnalyzer(Version.LUCENE_30);
// prepare StringReader object with your text inside
StringReader stringReader = new StringReader(text);
// get the tokens stream
TokenStream tokenStream = analyzer.TokenStream("defaultFieldName", stringReader);
ITermAttribute termAtt = tokenStream.AddAttribute<ITermAttribute>();
var term = termAtt.Term;
// ... do something with your term
In this post I will provide you some information about configuration of your Sitecore for work with Solr server.
Probably everyone who faced with that task, found the most popular and really good guide from sitecore-community.github.io (click).
But there is a one more thing which should be made. About this additional configuration I will write today.
We have to configure our Inversion of Control containers.
When we want to use Sitecore with Solr we have to configure at lease two inversion of control containers to work parallel. (Autofac and Windsor).
So lets do it!
Open your Global.asax.cs file and check your MvcApplication class definition – it should extend a WindsorApplication. So code will look in the following way:
public class MvcApplication : WindsorApplication
Ok, the next step is initialization code for your containers. This code should looks like:
public override void Application_Start()
this.Container = (IWindsorContainer)new WindsorContainer();
When you have your application configured in this way you may be sure that Sitecore tools (like administration panel) and communication with Solr server will work properly.
Well and the last but not least thing – check your Global.asax file – code inside it should look like:
<%@ Application Codebehind="Global.asax.cs" Inherits="<PROJECT_NAMESPACE>.MvcApplication" Language="C#" %>
If you have any questions or problems, do not hesitate to ask or comment bellow the post.
Where can I download Sitecore?
Question from the title is very often asked question by everyone who wants to learn Sitecore.
The answer is very simple – you can not just download installer if you do not have Sitecore account with appropriate permissions.
So You probably want to know – how to get the account with appropriate permissions?
The answer is also simple. The only way to have account which has permissions to download Sitecore and Sitecore Modules is get account connected with company which is a Sitecore Partner.
In other words You have to work for someone who is a Sitecore Partner or just be a Sitecore Partner.
When you have appriopriate account you can visit two websites to download Sitecore.
For sitecore 6-7.5 you should visit sdn.sitecore.net
For Sitecore 8.0 – *.* you should visit dev.sitecore.net
Ok I’ve downloaded the Sitecore – can I install it?
No you can not. Sorry. The licence is required.
Licence for Sitecore is a XML file with licence data. You should be able to select path to the licence file during the installation process.
Licence is available to download only from spn.sitecore.net
When you will notice a following error message inside Form Desinger:
“ComponentArt Grid :: Unlicensed control. Click here for more information”
Which looks in following way:
You have to know that you probably removed licence file from bin directory. The solution is very easy.
Just copy file “ComponentArt.UIFramework.lic” from sitecore installation zip file and paste it into your instance.
Everything should work.