Get Session in Translation Plugin

Hi,

We are using Bloomreach version 15.7.2

We have implaemented the Translation Addon using EasyTranslate in our project and it translates documents as expected but on the documents with fileds of type hippostd:html the references to the embebbed links to internal documents are not translated.

In our connector class which extends com.bloomreach.cms.translations.connector.api.AbstractTranslationConnector class I am tring to instantiate the javax.jcr.Session and add the reference to the hippostd:html before I am sending it for translation.

I was able to get the session using the credentials in our develop environment as follows:

Repository repository = (Repository) HstServices.getComponentManager().getComponent(“javax.jcr.Repository”);
SimpleCredentials credentials = new SimpleCredentials(“admin”, “admin”.toCharArray());

Session session = repository.login(credentials);

This is not the solution for a production environment, though. Is there any way I can retireve the Session on my Translation Addon Connector?

I found a way to get the session without hardcoding the credentials:

Repository repository = HstServices.getComponentManager().getComponent("javax.jcr.Repository");
Credentials creds =  HstServices.getComponentManager() .getComponent(Credentials.class.getName() + ".default");
Session session = repository.login(creds);

Glad you found the answer yourself Razvan. We have more documentation for the approach here: Retrieving a pooled session - Bloomreach Experience Manager (PaaS/Self-Hosted) - The Fast and Flexible Headless CMS

Hi @Razvan ,

We are happy you are part of Bloomreach Developer’s Community.
Thank you for reaching out to us.
We hope we have answered your queries and therefore marking this thread for Closure.
We are delighted to acknowledge your ongoing contributions to our esteemed Bloomreach Community.

Best Regards,
Bloomreach