In a previous blog entry, we introduced the procedure for installing the connector that integrates Sitecore's CMS with Content Hub. The new version of the connector has been released and now supports installation using the Sitecore Install Framework.
![](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F4JBUamSubjHohA7Jy3OhTi%2Fd12057eedbbfa60ee79fe819fccf6cfc%2Fcontenthub08.png&w=3840&q=75)
The previous articles are as follows.The changes include the module installation procedure and configuration. Please refer to the previous article on CMP.
Prerequisite
This time, we will perform the installation in the following environment.
- Sitecore Experience Manager 10.2
- Sitecore Connect for Content Hub 5.0
- Sitecore Content Hub 4.1.10
This connector is available for both XM and XP Sitecore, and Content Hub versions 4.1, 4.0 and 3.4.
Module Preparation
To begin installation, please download the Sitecore Connect™ for Content Hub SIF Package and Sitecore Connect™ for Content Hub WDP Package files from the following pages
File Extraction and Execution
First, extract the Sitecore Connect™ for Content Hub SIF Package file (SIF Installation Scripts For Sitecore Connector Content Hub 5.0.0 rev. 00328.zip) to the following folder Extract the file to the following folder
- C:\projects\contenthub50
Then copy the file Sitecore.Connector.ContentHub.WDP.5.0.0-r00328.4145.scwdp.zip to the same folder. The finished product should look like the following
![contenthub01.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2FyHZSae7lvDoPO0ZS3Lev9%2F98fc7bb9a528d47df8c1343fccf2618d%2Fcontenthub01.png&w=3840&q=75)
The next step is to set up the environmentally-ready values for the scripted installation, which can be found in the first part of the deploy.ps1 file.
param
(
[string] $ScchWdpPackage = "$($PSScriptRoot)\Sitecore.Connector.ContentHub.WDP.scwdp.zip",
[string] $InstanceName = "sitecore",
[string] $InstanceUrl = "https://$($InstanceName)",
[string] $SitecoreAdminUser = "admin",
[string] $SitecoreAdminPass = "b",
[string] $SqlInstanceName = "$InstanceName",
[string] $SqlUser = "sa",
[string] $SqlPass = "Password12345",
[string] $SqlServerName = ".",
[bool] $SkipDatabaseInstallation = $false
)
The main items to be changed are as follows
Parameters | Default value | Value |
---|---|---|
$ScchWdpPackage | Sitecore.Connector.ContentHub.WDP.scwdp.zip | Sitecore.Connector.ContentHub.WDP.5.0.0-r00328.4145.scwdp.zip |
$InstanceName | sitecore | Name of the instance being installed |
$SitecoreAdminPass | b | Admin password |
$SqlPass | Password12345 | SQL Server Password |
$SqlInstanceName | $InstanceName | Set database prefix (e.g. XM1) |
$SkipDatabaseInstallation | $false | Set to $true for 10.2 |
If you are satisfied with the above configuration, run it in PowerShell.
![contenthub02.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F5cZM6qTCaCbBDqJ0fl3pRP%2F9a8c4ad805ee60f377993e1612292d4d%2Fcontenthub02.png&w=3840&q=75)
Installation is done in a matter of minutes.
![contenthub03.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2FhdESDw3q8CbGUu67ckO22%2F5e3a67848545a837edbf3f00ae9ad428%2Fcontenthub03.png&w=3840&q=75)
Install on CD server
Install the module on the CD server as well. Change the instance name $InstanceName in the script you have already run and run it.
In addition, please make the following changes to the xslt file in the \xsl folder on the CD server so that it can be listed as an image, i.e., a field image.
<!-- entry point -->
<xsl:template match="*">
<div>
<h1 class="contentTitle">
<sc:text field="title"/>
</h1>
<div class="contentDescription">
<sc:text field="text" />
<sc:image field="image" />
</div>
</div>
</xsl:template>
This completes the installation with respect to the CD server.
Installing Japanese Language Resources
You can download the resource file in Japanese from the module download page. The file name is Sitecore Connect for Content Hub 5.0.0 rev. 00328 (en-JP).zip.
Extract this file to the folder where you have installed Sitecore.
- App_Data\localization\chub.texts.ja-JP.xml
- App_Data\items\master\localization\chub.items.master.ja-JP.dat
Once you have confirmed that the above two files have been extracted, restart the Sitecore instance. The resources will be loaded automatically.
After the import of Japanese resources is complete, a Browse Sitecore DAM item will be added to the Image Designation field.
![contenthub04.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F7GDF9u7671j0twtCoOPJEK%2F10773e3ba9dfe5ebdd8a686e77d39692%2Fcontenthub04.png&w=3840&q=75)
Connecting Sitecore and Content Hub
Change Sitecore settings
First, we will modify the configuration of Sitecore. To adjust the connection strings, change the settings in ConnectionStrings.config in App_Config. The items are as follows
<add name="DAM.ContentHub" connectionString="ClientId={client_id};ClientSecret={client_secret};UserName={username};Password={password};URI={uri};"/>
<add name="DAM.SearchPage" connectionString="{Content Hub search page URI}"/>
<add name="DAM.ExternalRedirectKey" connectionString="{External redirect key}"/>
- ClientId: Obtained from the OAuth client in the configuration. In this case, LogicApp is used.
- ClientSecret: Use the secret key associated with the above ClientId.
- UserName: Sets the account that can log in to the Sitecore Content Hub.
- Password: Set the password for the above account
- URI: Sets the URL of the server
- Example: https://sitecorecontenthubdemo.cloud/ja-jp/sitecore-dam-connect/approved-assets
The next step is to configure web.config. As described in the installation documentation, this is the procedure to enable the integration with the Content Hub instance that will be used together with Sitecore. If the delivery and management URLs are different, they will be aligned, but in this case, the settings are the same, so the following sample is used (please change the instance name).
<add name="Content-Security-Policy" value="default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data https://sitecorecontenthubdemo.cloud/; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' 'unsafe-inline' https://fonts.gstatic.com; upgrade-insecure-requests; block-all-mixed-content; child-src 'self' https://sitecorecontenthubdemo.cloud/; connect-src 'self' https://sitecorecontenthubdemo.cloud/; media-src https://sitecorecontenthubdemo.cloud/;" />
Change Content Hub settings
Regarding the Sitecore Content Hub configuration, please make the following two changes. First, configure CORS settings for server-to-server integration. Open the PortalConfiguration - CORSConfiguration page. Add the URLs of the Sitecore administration screen, delivery server, and other necessary servers here.
![contenthub05.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F1fIISixLcMGVpQi8kcoom8%2F349a07b5c5baee2e34a49654738cda70%2Fcontenthub05.png&w=3840&q=75)
Next is authentication. This item too can be configured by opening PortalConfiguration - Authentication from the Settings page, which will bring up the Login Authentication settings page. Change the authentication_mode to Passive so that Sitecore authentication can be used for login authentication.
![contenthub06.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2FlxzVsodtBH3RKV5oO7e08%2F47e3dbf9e378bea0d67f4a5525e1d3be%2Fcontenthub06.png&w=3840&q=75)
This completes the setup.
Confirmation of operation
Access the image field of the Sitecore item. Note that the administration screen is in English.
![contenthub07.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F3nsHcdkLKKmusota1CLX4w%2F5948e2a905e1a22819cc159df7985cae%2Fcontenthub07.png&w=3840&q=75)
First, click on the Browse Sitecore DAM icon. After a few moments, you will be prompted to authenticate, so please log in. This will proceed using the account that has access to the DAM, not the account you used when setting up the connection string. Once you have successfully logged in, you will be able to select the authenticated assets as shown below.
![contenthub08.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F4JBUamSubjHohA7Jy3OhTi%2Fd12057eedbbfa60ee79fe819fccf6cfc%2Fcontenthub08.png&w=3840&q=75)
Select an item and specify a public link. If there is no public link, create one here.
![contenthub09.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F6iDxV2qw1TMmEq3nOsQyVs%2Fe0f787303e5c345469bd16f7f9d39a48%2Fcontenthub09.png&w=3840&q=75)
Once a selection is made, a thumbnail will appear in the item field specifying the image, as shown below.
![contenthub10.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F6DSy5sA6QHt4CcdQjHOKYl%2F54ffff034cb95ddaf118df6df1652e9b%2Fcontenthub10.png&w=3840&q=75)
This completes the setup.
Summary
This article introduces the latest version of the Sitecore Content Hub connector, which is slightly different between 4.0 and 5.0, but we hope you will find it useful. Please refer to the following page.