PDF Viewer Component ClientID different domains | Adobe Higher Education
Skip to main content
JeffreyVSpringbok
Level 2
October 27, 2023
Beantwortet

PDF Viewer Component ClientID different domains

  • October 27, 2023
  • 2 Antworten
  • 3082 Ansichten

Hi

 

I'm playing around with the PDF viewer component on AEM.
For testing purpose I created the context aware configuration and added a clientID (mapped on my localhost domain) and that works fine (PDF viewer is showing and is functional).

Now I want to roll it out on all our domains (talking about an AEM setup with 20+ different PRD domains no subdomains) hosted on Adobe cloun.
How do I need to do this?

Do we need to create for every domain a separated context aware configuration and create different keys for it, mapped to the right /content path?
Or is their an easier approach (a general client ID that can be used for this)?

 

Thanks 

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von JeffreyVSpringbok

I went with the following solution:
I extended the PDF viewer component with my own Sling model, with a getClientId function.
I added on the page template a new field in the page properties where a clientId can be filled in.

The following logic is applied in the function:
if it is an author environment take the OSGi config, if it is on the publish environment use the id that is configured on the page properties (with inheritance valuemap).
With this setup it is very easy to create an clientId and use it on the right domain..

 

2 Antworten

arunpatidar
Community Advisor
Community Advisor
October 27, 2023

Hi,

If you have same value for all the domains, then you have to create only one at root level(/content or /content/mytenant)

  1. clientId - Required - the client key obtained by registering for the view sdk api - https://www.adobe.com/go/dcsdks_credentials
  2. reportSuiteId - Adobe Analytics ID

 

https://github.com/adobe/aem-core-wcm-components/tree/main/content/src/content/jcr_root/apps/core/wcm/components/pdfviewer/v1/pdfviewer#context-aware-config 

Arun Patidar
JeffreyVSpringbok
Level 2
October 27, 2023

Hi

We will have different values (due to different domains) if the explanation text on the creation screen.
Example domain structure we have: 

- site1.co.uk

- site1.com
- site.fr
- site.de
-....

So I don't think the single clientId will work

arunpatidar
Community Advisor
Community Advisor
October 27, 2023

Certainly, you can also implement property inheritance using context-aware configurations.

For example, if the clientId is different but the reportSuiteId is the same, you can set the reportSuiteId in the context-aware configuration of the root node. Then, for domain-specific context-aware configurations, you can set the clientId accordingly.

More examples are in the below blogs

https://cqdump.joerghoh.de/2018/05/16/sling-context-aware-configuration-part-4-using-inheritance/ 

Arun Patidar
kautuk_sahni
Community Manager
Community Manager
October 30, 2023

@jeffreyvspringbok Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni
JeffreyVSpringbok
JeffreyVSpringbokAutorAntwort
Level 2
October 31, 2023

I went with the following solution:
I extended the PDF viewer component with my own Sling model, with a getClientId function.
I added on the page template a new field in the page properties where a clientId can be filled in.

The following logic is applied in the function:
if it is an author environment take the OSGi config, if it is on the publish environment use the id that is configured on the page properties (with inheritance valuemap).
With this setup it is very easy to create an clientId and use it on the right domain..