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.
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
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.
Installation is done in a matter of minutes.
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.
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.
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.
This completes the setup.
Confirmation of operation
Access the image field of the Sitecore item. Note that the administration screen is in English.
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.
Select an item and specify a public link. If there is no public link, create one here.
Once a selection is made, a thumbnail will appear in the item field specifying the image, as shown below.
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.