Archive for November 2014
How to generate pkcs12 certificate on windows?
Open a command prompt and go to the bin directory under the installation directory.
For the public certificate type: “openssl req –new –key private-key.pem –x509 –days 365 –out public-cert.pem”
Now it will ask you to enter some information, you can just skip them by pressing [Enter].
Reference: http://docs.ucommerce.net/ucommerce/v6/payment-providers/setup-paypal-standard-website-payments-as-a-payment-method.html
To create the private certificate type: “openssl genrsa –out private-key.pem 1024” and press [Enter].
Now it will ask you to enter some information, you can just skip them by pressing [Enter].
Now we need to create the p12 file. Type the following in the prompt:
“openssl pkcs12 –export –in public-cert.pem –inkey private-key.pem –out
my_pkcs12.p12” followed by [Enter].
Razor Code and Configuration for Umbraco Examine Search
Examine allows you to index and search data easily and wraps the Lucene.Net indexing/searching engine. Lucene is super
fast and allows for very fast searching even on very large amounts of
data. Examine is provider based so is very extensible and allows you to
configure as many indexes as you like and each may be configured
individually. Out of the box our UmbracoExamine library that is shipped with Umbraco gives you Umbraco based implementations for indexers and searchers to get started quickly.
Configuration:
Step 1: Open
the ‘ExamineSettings.config’ file
from the ‘config’ folder.
Step 2: Create
a new Index Provider in the ExamineIndexProviders section:
<add name="MyIndexer" type="UmbracoExamine.UmbracoContentIndexer,
UmbracoExamine"/>
Step 3: Create
a new Search Provider in the ExamineSearchProviders section:
<add name="MySearcher" type="UmbracoExamine.UmbracoExamineSearcher,
UmbracoExamine"/>
Step 4: Open
the ‘ExamineIndex.config’ file from
the ‘config’ folder.
Create a new Index Set in the ExamineLuceneIndexSets section:
<IndexSet SetName="MyIndexSet" IndexPath="~/App_Data/TEMP/MyIndex" />
Code:
@using
Examine;
@{
var searchTerm =
Request.QueryString["search"];
}
<ul class="search-results">
@foreach
(var result in ExamineManager.Instance.Search(searchTerm, true))
{
<li>
<span>@result.Score</span>
<a href="@umbraco.library.NiceUrl(result.Id)">
@result.Fields["nodeName"]
</a>
</li>
}
</ul>