Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PDF] Need different PdfViewerCaConfig on publish #1144

Open
rzasap opened this issue Aug 21, 2020 · 6 comments
Open

[PDF] Need different PdfViewerCaConfig on publish #1144

rzasap opened this issue Aug 21, 2020 · 6 comments
Labels
enhancement New feature, or improvement to an existing feature.
Milestone

Comments

@rzasap
Copy link

rzasap commented Aug 21, 2020

PDFViewer component needs context aware config com.adobe.cq.wcm.core.components.internal.services.pdfviewer.PdfViewerCaConfig which varies per domain.
As stated in Adobe Document Services documentation: "Your Credentials is restricted to the domain you enter here, plus any subdomains. It is recommended that you create a separate Credentials for each sub-domain." - so we need different configurations for the author and for the publish.

Let's suppose that we have multiple sites with different domains. We also want the PDFViewer component to work on the author.

Here is example content structure:

/content/my-project/siteA
/content/my-project/siteB 
/content/my-project/siteC
... 

and corresponding configuration:

/conf/my-project/siteA
/conf/my-project/siteB
/conf/my-project/siteC
...

On /content/my-project/siteA we set sling:configRef to /conf/my-project/siteA and simmilary on /content/my-project/siteB.
We have added the required configuration for the author domain on the author instance.

Now everything works fine on the author, but on publish I need to have different configurations.
Do I need to go to every publish and change it? This sounds rather troublesome.
Ideally, I would like to be able to edit the configuration on the author and replicate the changes to all publish instances.

We have thought of setting different sling:configRef at /content/my-project/siteA on author (/conf/my-project.author/siteA) and different on publish (/conf/my-project.publish/siteA) but this is not ideal either, because it can be overriden when author activate the /content/my-project/siteA.

Do you gays have some recommendations for keeping and maintaining such configuration?

@jckautzmann
Copy link
Contributor

jckautzmann commented Aug 21, 2020

Now everything works fine on the author, but on publish I need to have different configurations.

Why would you have different configurations on publish? Could you please elaborate?

@rzasap
Copy link
Author

rzasap commented Aug 21, 2020

Let's suppose we have domains like this:

author -> author.my-project.com
publish, site A -> sitea.com
publish, site B -> siteb.com

According to Adobe Document Services we need a separate configuration per domain.

If I use the config from author -> author.my-project.com then PDF Viewer component does not work, because it is used on
the site with a different domain.

@ky940819
Copy link
Contributor

I haven't tested it but I think you can use the OSGI configuration Apache Sling Context-Aware Configuration Override Provider: OSGi configuration

Make a configuration for this and scope that configuration to author runmode.

@rzasap
Copy link
Author

rzasap commented Aug 24, 2020

Thanks @ky940819,
I will definitely test it and give you feedback. Maybe is it worth mentioning it in component documentation?

@jckautzmann jckautzmann added the bug Unexpected problem or unintended behavior that impairs normal functioning of the product. label Aug 28, 2020
@jckautzmann
Copy link
Contributor

We discussed this topic internally. One solution would be to introduce a specific PdfViewerCaConfigPublish configuration for the publish instance which falls back to PdfViewerCaConfig (configuration for the author instance) if not set. The logic in PdfViewerImpl would take the configuration based on the run mode (author/publish).

@gabrielwalt gabrielwalt changed the title [Question] PDF Viewer Component - what are the best practices for keeping and maintaining the context-aware configuration? [PDF] Need different PdfViewerCaConfig on publish Aug 28, 2020
@rzasap
Copy link
Author

rzasap commented Aug 31, 2020

Thanks @jckautzmann ,
I will wait for the changes 👍
I have also tested proposed by @ky940819 workaround and it seems to work fine for a now.

@gabrielwalt gabrielwalt added enhancement New feature, or improvement to an existing feature. and removed bug Unexpected problem or unintended behavior that impairs normal functioning of the product. labels Aug 31, 2020
@gabrielwalt gabrielwalt added this to the 2.12.0 milestone Aug 31, 2020
@msagolj msagolj modified the milestones: 2.12.0, 2.13.0 Oct 26, 2020
@msagolj msagolj modified the milestones: 2.13.0, 2.14 Dec 1, 2020
@msagolj msagolj modified the milestones: 2.14.0, 2.15.0 Jan 28, 2021
@vladbailescu vladbailescu modified the milestones: 2.15.0, 2.16.0 Feb 23, 2021
@vladbailescu vladbailescu modified the milestones: 2.16.0, Minor Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, or improvement to an existing feature.
Projects
None yet
Development

No branches or pull requests

6 participants