By Sitecore Coder to Sitecore Coders

Menu

Category Archives: Sitecore

Post navigation

Sitecore has released Publishing Service Module 1.1 along with Sitecore 8.2 version. Latest version of publishing service avaiable on Sitecore website is Sitecore Publishing Service 2.0 Update-1. This version of the Publishing Service is compatible with Sitecore 8.2 Update-2 and Sitecore 8.2 Update-3. This module is based on Windows Server Hosting (.NET Core). Below are FAQs about Sitecore publishing service

What is Sitecore publishing service?
The Sitecore Publishing Service (“SPS”) module is an optional replacement for the existing Sitecore publishing methods. This module increases publishing throughput, reduces the amount of time spent publishing large volumes of items, and offers greater data consistency and reliability. The module also improves the user experience and provides better visual feedback to the user on the state of the publishing system. The Publishing Service does not use any of the features, pipelines, and settings in the current publishing system, it is an entirely new way of publishing Sitecore items and media.

Does Sitecore publishing service require new license?
There are no incremental Sitecore license implications for installing the service.

What are the infrastructure requirement of Sitecore publishing service? Can it be installed in existing DB/CM servers?
Sitecore Publishing Service is a lightweight service which can be installed on an existing CM/DB server or entirely new VM. While Sitecore Publishing Service will improve publishing performance, it will be important to test and monitor for potential bottlenecks in the Master and Web databases during high throughput publishing. Installation Guide for Publishing Service has some settings that can be configured to improve performance. https://dev.sitecore.net/Downloads/Sitecore_Publishing_Service.aspx
Generally, it is better to have SPS as ‘close’ to the Database Server as possible. It does not have a large footprint and is not massively CPU/Memory hungry so a new dedicated VM may not be necessary. The Sitecore Publishing Host needs to be installed first and has a dependency on .NET Core. Sitecore recommend running it under IIS which requires installing Windows Server Handling package.

Does publishing service uses old APIs?
One of the main differences between the new and old publishing is the data layer. Unlike the old publishing, the publishing service doesn’t talk to the databases via the Sitecore item APIs. However, it uses its own data layer, which only performs databases operations in bulks. The bulk operations improve the performance dramatically by mitigating the network latency problems

How fast is Sitecore Publishing Service as compare to old publishing Method?
We did a POC to compare the performance of the new publishing service vs old publishing method on Sitecore 8.2 with 100,000 items. Standard publishing method took 4:37 hours to publish 100,000 items whereas publishing service took only 6-7 minutes. We did this test on standard VM so this performance can be higher with better hardware machine but important point is that publishing server is much faster than old publishing method

We recently had a requirement about 301 redirect for media item like pdf files. Sitecore Shared Source 301 Redirect module was used for 301 redirect, but it does not support 301 redirect for media item requested url, because sitecore MediaRequestHandler redirect to ItemNotFoundUrl, if requested URL does not exist in sitecore.

CustomMediaRequestHandler allows you to extend the default MediaRequestHandler, so you can easily check if the requested media Url from redirect url module, does not exist in sitecore media library, then get value of “Redirect to Item” or “Redirect to Url”, and redirect web request on these value.

Custom DoRedirect function process if request media is not in sitecore.

Because this configuration is not within the /configuration/sitecore element, this requires one or two updates to the /web.config file itself. Under the /configuration/system.webServer/handlers element:

If you have come to this post, I assume that you’re a beginner with the terms Azure and Sitecore Azure. When you don’t want to be in charge of your own physical kit, you choose to deploy to something like Azure. This includes stuff like hardware, operating system, network load balancing and things that have nothing much to do with the core application.

Before moving forward to Sitecore Azure, let’s have a brief overlook at Microsoft Azure’s interface.

Microsoft Azure Interface

The Management Portal for Microsoft Azure looks somewhat like this:

Here is how the services look like:

Sitecore Azure

Now that you saw how the interface for Microsoft’s much hyped Azure looks like, let us come to using Azure for Sitecore.

We all know that Sitecore itself has had a lot of success as an ‘on-premises’ software solution and content management system that facilitates on-premises deployments. Sitecore, with its advanced personalization capabilities and marketing automation, gives all the power to deliver relevant content or ecommerce offers that their audiences want to see.

And then, deploying #Sitecore on #Azure makes it even better as #Sitecore Azure.

Implementing a cloud version of Sitecore, using Azure, is definitely a great idea because of the many added benefits you get while using Sitecore on Azure or Sitecore Azure. While using Azure to enjoy the cloud version of Sitecore, you get to choose from cloud platform services like IaaS and PaaS and increase your productivity. Hybrid cloud solutions open new IT options for you without adding on to the complexity of the whole thing. Sitecure Azure makes it way easier and way more efficient to build applications and dal with stuff like data storage, backup, recovery, etc. It’s not only scalable but economical with its per-minute billing to ensure that you pay only for what you use.

Going for Microsoft Azure with Sitecore only brings you more flexibility, superior infrastructure, predictable costs, enhanced performance and opportunity to review workload.

Understanding cloud platform services: IaaS, PaaS, SaaS

When using Sitecore on Azure, it is important to know what the cloud platform services like IaaS, PaaS and SaaS, have to do with Azure and services. Moving to the cloud is a very much hyped things but most remain confused about the various services and what each of them means for organizations. Here we shed some light on the differences between them.

IaaS, PaaS and SaaS are basically three approaches to deploy or consume ‘cloud’ applications.

What do IaaS, PaaS, SaaS stand for?

IaaS stands for Infrastructure as a Service

PaaS stands for Platform as a Service

SaaS stands for Software as a Service

The three of them are not services in themselves. These are just choices that you make about the level of abstraction you require. You can choose a final setup with the elements of any of these or your final Azure setup may also be a combination of IaaS, PaaS and SaaS elements.

Major Difference between IaaS, PaaS, SaaS

IaaS: IaaS or infrastructure as a Service means that you are handling over the responsibility of machines and network to a cloud platform. So, basically, with IaaS approach, you choose virtual machines over physical machines. You can still log in to the virtual machines and configure IIS, mess around in MSSQL or look at your web root.

The basic infrastructure including hardware, networking, servers is supplied by a service provider. A central, knowledgeable group holds the responsibility for infrastructure.

PaaS: However, while using PaaS or Platform as a Service, you are handling over the responsibility for SQL management to the cloud platform using its services. The 5 Azure PaaS services in Sitecore Azure module are:

1. Cloud Service

2. Storage Service

3. SQL Databases Service

4. Traffic Manager Service

5. Cache Service

Under PaaS approach, you let the cloud platform manage all these aspects.

Application platform components like persistence, runtime, frameworks, etc. are provided by a third-party. Private PaaS cloud offered as service provider and Public PaaS cloud that is offered by a third-party company.

The application development organization builds their solutions on a known, stable platform with a consistent set of components.

With PaaS, you need only to develop the application or business level logic.

The application teams and companies would have to pay a fee for this service.

SaaS: Finally, SaaS or Software as a Service takes over all your responsibility. All you need to do is to sign up, SaaS takes care of everything else. For example, Google Apps for Work is a SaaS.

In Saas, business or consumer software application is provided by a third party. Rather than calling it as Software as a Service, you can also call it Application as a Service.

Salesforce.com CRM and SAP SuccessFactors are a good example of SaaS in the business world while Facebook, Gmail and My Yahoo are consumer focused SaaS examples.

Customers typically pay some subscription, either time-based like monthly or yearly, or service-based like pay for n no. of messages, volume of photos, etc.

Where the three approaches should be used?

Who should use IaaS?

IaaS achieves cost-benefit gains at physical infrastructure level. It is a widely applicable approach. Small and medium sized organizations use IaaS from a third-party to alleviate the need for expensive infrastructure and resources in-house. Publc IaaS is used by large organizations to share up internal data centers by taking on additional load during peak periods or is used for temporary purposes like testing.

Who should use PaaS?

PaaS is applicable to organizations who develop their own comprehensive applications. PaaS drives consistency by enforcing a common application framework. It also provides access to a common development platform across the globe. As an organization, you must have knowledge of:

1. The programming languages you need to support

2. Application services/frameworks

3. Accessibility by development and the user base

4. Security policies and regulations

Who should use SaaS?

SaaS can be used by organizations of any size and in any type of business. Any organization can be used as a single SaaS application while large organizations can make use of several different SaaS applications like Salesforce.com for CRM, Office365 or Box.net.

Other Important Terms

Once you start with Sitecore Azure, there are two very important terms in Sitecore Azure:

1. Azure Search – Sitecore

2. Redis Cache – Sitecore

Check out my next posts to know more about what each one of them means and what they have to do with Sitecore Azure.

I recently started looking into the features of Sitecore Experience Accelerator module and in this post I will share my understanding for few new ways of assigning datasource to a rendering that comes with SXA.

Motivation

With the new concept of page/partial design in SXA I noticed following things those motivated me to know more about it and write this blog post.

1. Relative Data Source:The first thing I noticed is the datasource field value as relative path in the rendering. As you can see in the below image, the selected item is a partial design item named as “Footer” and the control properties window shows the relative datasource for a control with some special starting keyword as “local” and after that a relative item path.

Figure 1: Page Relative Datasource

Clearly it means there must be some resolvers those will be doing the magic of converting a relative path to full item path.
The questions are which resolver is doing that? And are there any more resolvers?

2. Datasource change is not allowed from page for a rendering that belongs to partial design:
On a page if rendering is coming from partial design than from that page content authors cannot change the datasource for the item. The datasource can only be set on the partial design itself.

But lets assume there is a requirement to design a product detail page with using partial design. A rendering should be there in the partial design that must pick the content from product item field itself.
The question is does SXA has any solution?

2. Code Datasource:
A custom class can be created and type name of the class can be passed in the datasource. The custom class must implement the interface Sitecore.Buckets.FieldTypes.IDataSource. This interface contains single method named ListQuery. The method signature is as follows:

Item[] ListQuery(Sitecore.Data.Items.Item item)

As per the method signature, a Sitecore item will be retrieved as input and array of item will be returned. The resulting data source will be the IDs list of all items returned.

3. Page Relative Datasource
Instead of giving the full path of the item, a relative path can be passed that will be evaluated in respect of the Context Item, SXA will get the full path of the context item, appends the relative path mentioned in datasource at end and creates a full item path. This new full item path will be used as datasource value for the rendering. This resolver is used for the Relative Data Source item I mentioned in motivation section.

1. Page Relative Datasource
I have few items created under the home page and one of those is “About Us” page. I have placed the rendering on home page and used the relative page path in data source.

Figure 3: Page Relative Datasource assignment in presentation

Once published we can see the full item path on the page:

Figure 4: Page Relative Datasource result

2. Field Datasource
I have placed the rendering on the home page and used the field data source method and used the field name as “title”.

Figure 5: Field Datasource assignment in presentation

Once published we can see the title field value on the page:

Figure 6: Field Datasource result

There is no sample in this post with a link field but that is easy to do. You can add a link field to the page template and assign it a target Sitecore item. After that just go to the presentation details and change the field name to your link field name, publish all changes and open the page, you will see the item id of the item selected in link field.

3. Code DatasourceLet’s first decide what should the custom code must perform. For simplicity I want to build a custom code functionality that will treat all children item from the context item as datasource. Let’s add a custom data source class:

At the Sitecore end we have two items under the home item, let’s check their IDs first.

Figure 7: First child item under home

Figure 8: Another child item under home

Now let’s place the code source in the rendering data source:

Figure 9: Code Datasource assignment in presentation

Once published we can see the IDs of children pages on the home page:

Figure 10: Code Datasource result

Conclusion

Sitecore provides several ways to assign data source to a rendering. The existing data souring ways include providing full path of the Sitecore item, providing a Sitecore item ID or writing a query. SXA adds some new ways for data souring and gives more flexibility and power to the Sitecore architectures to design the solution.

This blog post will guide you to migrate Sitecore SQL Server databases to Amazon RDS.

Unfortunately, you won’t be able to directly use the MDF and LDF files in AWS at the moment so to migrate SQL database to Amazon RDS we are going to use SQL Azure Migration Wizard. Follow below steps for migration –

Before starting migration please make sure

You are able to connect to Amazon RDS. To check it you can utilize SQL Server Management Studio

Once you open SQLAzureMW.exe. you will see a page like shown in below image. In this step you have to select process. Since we are migrating Sitecore database so we will select Database under Analyze/Migrate. For Target Server dropdown list select Azure SQL Database and click next

Choose Source database

This step allows you to choose the source database. First connect to your SQL server database by providing connection details. Once database server is connected successfully select source database and click on the button that says ‘Next.’ Please see below image

Choose action

Once source database is selected then in this step select an option named as ‘Script all database objects’. This option can enable to do the complete migration of the database. But if you don’t want to migrate entire database then you select an option that says ‘Select specific database objects.’ Please see below image

Create SQl script

Tool will create script of selected source database for the objects selected in previous step. You should save the script on local hard drive and the move ahead by hitting a click on a button ‘Next’.

Select Destination Database

In this step provide your Amazon RDS server details and connect it. Once connected select the target database. If you have not created any database earlier, then create a new one using Create Database option and go next

Final Step and Review Target server Response

Once you hit next in above step migration will start and you can review result of migration in this step. You can now connect to RDs database using your SQL Server Management Studio and check all the migrated data. This tool will save a lot of time.

You may see below errors in migration reportStoredProcedure [dbo].[aspnet_Setup_RemoveAllRoleMembers] — sp_helpuser is not supported in current version of Azure SQL DatabaseTo make sure there is no problem in migrated database because of above error I recommend connect to RDS database and make sure Stored Procedure aspnet_Setup_RemoveAllRoleMembers is there.

SUGJPR or the Sitecore User Group Jaipur organized their first ever technical meetup in Jaipur on November 19, 2016 from 2 p.m.-6p.m. at Hotel Sarovar Portico, Vaishali Nagar. The entire event was sponsored by Unicolumn Software Private Limited, which is a digital agency established in 2011 and a pioneer in the field of Sitecore development.

Why SUGJPR?

The founders talked about why they have come up with SUGJPR. And the reason is to foster use of Sitecore development. The platform aims to connect developers and people who have interest in learning new tips and tricks about Sitecore development.

Sitecore® Experience Platform™ – How you can own experience(Presented by Jagmohan Rathore Sitecore MVP 2017)

The meetup event started with a presentation on Introduction to Sitecore where we explore the power of Sitecore and learn Features and talked about the need of using a CMS, what Sitecore is, how it brings a lot of opportunities for developers, content writers as well as marketers. The features, which make it such a desirable asset for large enterprises were also talked about such as managing multiple websites, using content between different websites, multi-lingual, drag and drop functionality, SEO optimization, automated deployment, easy integration of APIs, AB testing, Sitecore Analysis, etc.

The idea was to make the audiences aware of what Sitecore CMS is and how its ample amount of features could actually be very beneficial for your businesses.

Getting started with Sitecore – Building A Very Simple Website (Presented by Mahendra Shekhawat and Gaurav Agarwal) –

Basic of Sitecore installation, configuration and tuning of Sitecore in .NET environment, design and implement templates & layouts for a very simple website. Both gave a demo on how to build a website using Sitecore, which involved the basic functionality of the platform, hosting and accessing tools.

Networking Break -

The SUGJPR meetup event included a short networking break where students, developers, core organizers and others from the audience took some time to interact and connect with each other while enjoying snacks with tea or coffee.

Sitecore Experience Accelerator (SXA)(Presented by Vipin Banka)-

Later in the day, Vipin Banka, Solution Architect at Unicolumn and a Sitecore certified .NET developer 6.0, introduced Sitecore Experience Accelerator (SXA) to the audience. He also gave a detailed demo on the installation process and use of SXA among developers and content editors

Whats Next?

Next meet up is plan in the first quarter of 2017, So please stay tune and join us on Meetup –

Sitecore® Experience Platform™ – How you can own experience -Explore the power of Sitecore and learn Features, Uses of Sitecore and how it is better then other CMSs.

Getting started with Sitecore – Building A Very Simple Website – Basic of Sitecore installation, configuration and tuning of Sitecore in .NET environment, design and implement templates & layouts for a very simple website.

Sitecore Experience Accelerator (SXA) -A set of toolings and processes to allow the rapid creation of websites by increasing the amount of work that can be done in parallel.

Cause - Sitecore added an additional key to its license file. Sitecore 8.1 requires this new key to enable xDB features. Following could be the reason:

Your license does not contain this new key.

Your license does not allow xDB features.

SolutionSitecore 8.1 now requires a license with the “Sitecore.xDB.base” key to enable all features of the Experience Platform. If your license file does not contain this key, Sitecore will default to Experience Management (CMS-only) mode. Any customers or partners with a license to Experience Platform should contact their account manager or login to SPN if they are missing this key.

And then click on logging button on the left side and saw there were so many errors as shown in the below image.

By looking into the image, we can see that there are some language specific error. Like “zh” for Chinese, “ko” for Korean.

So now what to do?

Then after some searching I found that we have to do something with physical solr files. Now go to solr folder where you have configured solr for your project. Let’s assume you have configured solr with the name “project_master” and “project_web”. So follow the steps –

1) Go to “solr/project_master/conf” folder.

2) Then you will find an xml file named “schema.xml” there.

3) Open this schema.xml file in notepad or so and search for “dynamicField” that is under fields section.

If you don’t find schema.xml file in conf folder then you need to follow following steps –

1) Go to sitename/Sitecore

2) Log into Sitecore with username and password.

3) Then click on Sitecore button that is in left bottom corner.

4) Then navigate to Control Panel, a screen will popup like following image.

5) In this there are 2 links, then you need to click on “Generate the Solr Schema.xml file”.

6) You will see there are 2 fields “Source File” and “Target File”.

7) In the Source File you need to provide a default schema.xml file. You can download default schema.xml here.

8) In the Target File provide the target folder, where you want it to be.

9) Now you are ready to customize “schema.xml” file.

When you will open this schema.xml, you will find that lots of dynamic fields are there something like this –

Note – Before making changes in schema.xml you need to take care of apache server. In your PC click on “Start” button and search for “Monitor Tomcat”, click on it. You need to click on “Stop service”, after that you can make changes in schema.xml file.

In these dynamic field search for “zh, ko”, and you will find that there are no entries with these names, so now we need to make entry for these language types like below image. Make sure you have entry for each language that is causing error.

What “*” means, it will include all the entries ending with e.g. “t_zh”.

In one of our project I faced a requirement to give multiple Datasource location to single Rendering, so that they can select whatever datasource they need. After doing some research I found that it is possible to give multiple datasource. For this first of all Login to your Sitecore.

Let’s say you have a #Sitecore structure like this -

Sitecore

-Content

-Site Node

-Globals

-Datasource Folder

-Home

-_Resource

-Datasource Folder

-Item 1

-_Resource

-Datasource Folder

Now we need to set 2 Datasource Locations for single Rendering. For this follow the below steps-

1) Go to particular rendering where you want to set datasource

2) Let’s say go to

-sitecore

-content

-Layout

-Renderings

-Your Rendering

3) Click on “Your Rendering”

4) Then in right hand side go to “Editor Options”

5) Firstly, go to “Datasource Template” field.

Click on “Insert Link”, a pop up will open, in which you need to select “Datasource Folder Template”

2) In which “_Resource” is the first datasource location (Left part of pipe sign (|)), that is let’s say we want to give datasource to “Home” item’s rendering. So first you can see there is “_Resource” folder directly under “Home” item, so it is the path of that “_Resource” folder

3) Now we have 2nd datasource location (Right part of pipe sign (|)), that is a query. In this query you need to set “Template Names”. Let’s say you want to set 2nd location to “Datasource Folder” that is under “Globals” Folder. So all you need to do is to set “Template Name” starting from your “Site Node” to that “Globals Folder Template”, don’t include datasource folder template in this. If your datasource is under any other node under Globals folder, then need to set template names just above your datasource folder.

For ex – Your sitecore tree is like – sitecore/content/sitenode/globals/datasource folder, so set template names starting from sitenode template to globals folder.

4) Here it is all. Now go to “Home” item.

5) Click on “Presentation” tab.

6) In that click on “Details”.

7) A pop up will open in which click on “Your Rendering”

8) Then in the “General” tab, go to “Data Source” field and click on “Browse”, now you can see there are 2 datasource location, in which you can select datasource from either Globals Folder’s Datasource or _Resource Folder’s Datasource.