Tuesday 10 December 2019

How To Integrate AssetBank DAM in Sitecore?

DAM is very crucial and commonly asked thing from many Sitecore customers. There are several DAM available in the market and many of these DAM provides connector to integrate with Sitecore CMS. Now Sitecore itself is giving DAM out of the box.

Usually customer selects the DAM which can be used across many systems. Recently, one of my Sitecore projects was required to integrate with AssetBank DAM.



AssetBank provides connector to integrate with Sitecore where you can pull all the media assets from AssetBank DAM into Sitecore Media Library. In today's post, we are going to see how can you integrate AssetBank DAM with Sitecore.

So let's get started...

Step 1:
Get AssetBank Sitecore Connector Package > Upload Package 



Step 2:
Install Package



Step 3:
Wait until AssetBank Sitecore Connector Package installation finishes



Step 4:
Locate to AssetBank Configuration folder under App_Config > Include folder


Step 5:
Open Kumquat.SAS.AssetBank.config file > Do necessary changes suggested by AssetBank team.



Step 6:
Go to Sitecore Modules > AssetBank folder  > Connector Settings > Fine tune the field settings if required


Step 7:
Login to AssetBank DAM >  Make sure Sitecore Instance where you installed connector is allowed to access AssetBank DAM


Step 8:
Confirm that your Sitecore Instance can access AssetBank DAM instance by accessing AssetBank asset-search REST API at https://cms.[YourAssetBank].com/assetbank-[YourCompany]/rest/asset-search


Step 9:
Go to Sitecore Media Library > Asset Bank Media folder  > It should list down all media folders from AssetBank DAM under Sitecore now as shown below

That's it!
So after following all the steps mentioned above, if you are able to see "media" under "Asset Bank Media" folder then everything is configured correctly.

Congratulations!!!
You have configured AssetBank Sitecore connector successfully.

Wednesday 20 November 2019

Sitecore PowerShell Script To Upload ANY CSV Data

Are you looking for a quick and handy Sitecore PowerShell script to upload any kind of CSV data? Are you looking to create or update Sitecore items using PowerShell script?

If so, then you landed on right blog post, keep on...



Many times, you require to create/update hundreds of Sitecore items in Sitecore which will take many hours of time if you decide to create/update those items manually.  Moreover, being a techie person it is smart decision to write some script or program to automate such thing and let machine do this bulk and tedious job for you. That's why you are in field of programming, isn't it?

One such incident happen with my team recently where we required to create/update list of 200 countries in Sitecore CMS. We were provided the CSV file with Country name & Country ISO code and we were required to create a Sitecore item for each country resulting 200 items. Hence we decided to spin up some PowerShell script which will read data from CSV file and create Sitecore items accordingly.  A quick search to internet helped us with below Sitecore PowerShell script to do this job in seconds.

#It will create the folder if it is not found
$dataFolder = [Sitecore.Configuration.Settings]::DataFolder
$tempFolder = $dataFolder + "\temp\upload"
$filePath = Receive-File -Path $tempFolder -overwrite

if($filePath -eq "cancel"){
    exit
}

$dropListPath =  "master:/sitecore/content/Master Countries/gigyacountryname"

# Get the item for the Dictionary Folder Container
$dictionaryFolder = Get-Item -Path $dropListPath

#
# Read CSV file
# 1st row needs to have header of Key, Phrase. Other option is to specify the header on
# the Import-CSV method call using the -Header string[] parameter
#

$csv = Import-CSV $filePath -delimiter ","

#
# Wrap the foreach loop in the BulkUPdateContext so we do not fire events and prevent indexing 
#after individual create/update opertaion
#
New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) {
   
    foreach($row in $csv) {
       
        $name = SanitizeName $row.Name
        $itemPath = $dropListPath + "/" + $name
       
        $item = Get-Item -Path $itemPath -ErrorAction SilentlyContinue
       
        #check is item already exits
        if($item -eq $null)
        {
            Write-Host ("Creating New Item at: " +  $itemPath)
            Write-Host ("Name:" + $name)
            try
            {
                $item = New-Item -Path $itemPath -ItemType "/sitecore/templates/Project/CountryDropDown"
              
                Write-Host "Item created: " $item.Name
            }
            catch{
                Write-Host "Failed to create Item: " $item.Name
                Write-Host $_.Exception.Message
            }
        }
        else{
            Write-Host ("Updating Item:" + $item.Name)
        }
        $item.Editing.BeginEdit()
        $item["Name"] = $row.Name
        $item["Value"] = $row.Value
        $item.Editing.EndEdit() | Out-Null 
        # we don't want to send the output to the console otherwise it will print False in the console.
        Add-ItemLanguage -Path $item.Paths.Path -Language "en" -TargetLanguage 
        "ar-AE" -IfExist OverwriteLatest  -IgnoredFields ""
    }
}

#
# Clean the name in case it has restricted characters
# Todo: use Sitecore.Data.Items.ItemUtil.ProposeValidItemName($args[0])
#
function SanitizeName{
 $args[0].Replace(".", "").Replace(" ", "").Replace("/", "").Replace("-", "").
Replace("&", "").Replace(":", "").Replace("""", "").Replace("#", "")

}

Steps:

  1. Go to Sitecore PowerShell ISE > Copy/Paste above script. 
  2. This will open file dialog > Select CSV file

Below is the CSV format which we were using for above PowerShell Script.



Hope this will help someone!

Monday 18 November 2019

Sitecore GPI Translation Connector Step By Step

There are many translation service and translation connector for Sitecore avialable in market. Recently, I got a chance to work and intergrate Sitecore GPI Translator.



GPI stands for Globalization Partners International. It provides comprehensive website translation and localization services including:

  • Translation and Copy Writing
  • Multilingual Desktop Publishing
  • Software Localization
  • Website Localization
  • Sitecore Translation Services Connector
  • Global Search Engine Optimization (SEO/SEA/Social Media Localization)

GPI has Translation Connector which enables Sitecore users to manage multi-language websites and initiate translation workflows easily.

Visit https://www.translationplugin.com/index.php/sitecore-translation/ to request Sitecore GPI Translator connector demo or aquire the connector.

Now let's look how can you use GPI Conector to translate Sitecore page to different language(s).

Step 1: Select Page > Send for Translation



Step 2: It will open the translation wizard > Click Next



Step 3: Select Source Language and other options > Select Next



Step 4: Select Translation Language in which you want to translate source language page



Step 5: Once Translation is finished by GPI, you will see new language added with translated data



Step 6: If you want to see GPI Translation Service Quote for the page you submitted, you can select View Dashboard under GPI menu



Step 7: You can find all the Translation Service Quote as shown below under GPI Connector



That's it!

Which Sitecore Translation Service / Connector are you using? Share your answer in comment section below.

Sunday 1 September 2019

Hurray, SUGUAE Completed Three Years!

Hello #Sitecore Heroes!

Did you know SUGUAE is the FIRST-EVER Sitecore User Group in this region?

Yes, SUGUAE journey was started back in 2016 and there were 20+ amazing Sitecore sessions delivered by Internationally Exposed Sitecore veteran speakers.

SUGUAE has completed three successful years of existence and we are totally mesmerized by the trust and interest you people have shown to us.




It's been now three years and I still remember these pictures taken back in Nov, 2016 during our first year's Sitecore User Group Event at The Shades, Address Dubai.


It gave us the confidence to do better in every session and we tried doing more better than our previous effort just to make sure that trust bond remains the same between you and us!

It is a journey that started with very few but now you all are part of this. Thanks for being there with us, it really means a lot.

Thank you to all speakers for delivering those amazing sessions and thank you very much to all attendees to invest your time and showing interest to join all those action packed Sitecore sessions!

Stay tuned with us on our official website @ http://suguae.net/ and follow us on Facebook and Twitter for upcoming #Sitecore sessions.

Once again thank you very much for showing your interest in Sitecore User Group UAE! 

Wednesday 5 June 2019

5 Tips Before You Appear For Sitecore Interview!

Friends - in this changing world, technology and tools are changing day by day likewise interview method is also changing.


When you appear for an interview, you may think that you have tough job and interviewer has very relaxing job. But it's not like that, in-fact interviewer has to make sure that he selects the right candidate. Interviewer needs to focus on many other parameters apart from technical knowledge of a candidate such as:

- How is candidate's attitude?
- How is candidate's problem solving skills?
- How is candidate's fundamental knowledge of Sitecore?
- Does candidate know about the company where he is applying for job?
- How does candidate behave in some conflicting situation with team of customer?

But many times candidates only focus on preparing technical part of interview and ignore above mentioned parameters. As a result, a technically sound candidate sometimes get disqualified due to lack of preparation in such parameters.



Hence it is highly recommended to think about these points before you appear for an interview and I am sure this video will help you to impress the interviewer.

Have a Happy Interview!

Friday 25 January 2019

Sitecore ERROR : Exception When Executing Agent Aggregation

Are you facing below mentioned xConnect error? Not able to find out the possible cause and fix?



Well, one of my colleague was struggling with this error on Processing Server. Log files were full of below mentioned error.

8556 13:04:06 ERROR Exception when executing agent aggregation/aggregator Exception: Sitecore.XConnect.XdbCollectionUnavailableException Message: An error occurred while sending the request. Source: Sitecore.XConnect.Client at Sitecore.XConnect.Client.WebApi.CollectionBatchWebApiClient.<ExecuteBatch>d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.XConnect.Client.Operations.HttpOperationInvoker.<Execute>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.XConnect.XdbContext.<ExecuteBatchAsyncInternal>d__79.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Sitecore.XConnect.XdbContext.<ExecuteBatchAsyncInternal>d__79.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.XConnect.XdbContext.<ExecuteAsync>d__72.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.XConnect.XdbContext.<GetAsync>d__35`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Analytics.Processing.AsyncPoolScheduler`2.<TryGetNextAsync>d__14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Analytics.Aggregation.InteractionAggregationAgent.<ExecuteCoreAsync>d__15.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Analytics.Core.Agent.<ExecuteAsync>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Analytics.Core.AsyncBackgroundService.<ExecuteAgentAsync>d__22.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Analytics.Core.AsyncBackgroundService.<RunAsync>d__26.MoveNext() Nested Exception Exception: Sitecore.Xdb.Common.Web.ConnectionTimeoutException Message: A task was canceled. Source: Sitecore.Xdb.Common.Web at Sitecore.Xdb.Common.Web.CommonWebApiClient`1.<ExecuteAsync>d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.XConnect.Client.WebApi.CollectionBatchWebApiClient.<ExecuteBatch>d__11.MoveNext() Nested Exception Exception: System.Threading.Tasks.TaskCanceledException Message: A task was canceled. Source: mscorlib at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Xdb.Common.Web.CommonWebApiClient`1.<ExecuteAsync>d__37.MoveNext() 

This seems Scaling issue as the error was now completely disappeared after scaling up. So try scaling up your instance to get rid of such issue. Thanks to my colleague Thom for sharing this resoultion!

Let me know if you find any other resolution.

Friday 11 January 2019

A Tip To Install Sitecore Package Faster!

Are you installing large Sitecore package? It could be update or any other Sitecore package. Is it taking a long time to install?



Then you can follow this tip to make installer 3 times faster.

Tip:
For time being, go and disable ContentSearch event handler in "packageinstall:items:ended"



Please note that installed items will not be indexed automatically as we have disabled above settings. So you are advised to do manual indexing once package is installed and revert above changes by enabling ContentSearch event handler.

Please note that this tip is also shared by someone on twitter and I am just documenting it to spread this tip to others because sharing is caring.