06-11-2013 03:07 PM
I need to access the CoreSession for the Principal passed as a parameter into SQLQuery.Transformer.transform(Principal, SQLQuery). I was hoping that ((NuxeoPrincipal) principal).getModel().getCoreSession() would provide it but it is almost always null. Is there another way besides creating a new CoreSession?
06-19-2013 12:18 PM
No CoreSession
is available at this level, because the query transformers are called at a lower-level API level than CoreSession
(from the QueryMaker
s inside VCS).
06-12-2013 09:18 AM
You can use for instance the following code:
LoginContext loginContext = Framework.login();
RepositoryManager mgr = Framework.getService(RepositoryManager.class);
Repository repository = mgr.getDefaultRepository();
CoreSession session = null;
if (repository != null) {
session = repository.open();
}
if (session == null) {
log.error("session is null, exit connect");
}
06-12-2013 03:01 PM
I believe your code is creating a new CoreSession which I was hoping to avoid. Instead I would like to access the existing CoreSession already associated with the Principal.
06-19-2013 12:18 PM
No CoreSession
is available at this level, because the query transformers are called at a lower-level API level than CoreSession
(from the QueryMaker
s inside VCS).
06-19-2013 02:02 PM
I need to access specific properties from the principal's UserProfile document from within my query transformer. Do you have a recommendation for how this would best be done?
06-20-2013 09:21 AM
What properties do you need to access?
06-20-2013 10:54 AM
My own custom properties.
06-20-2013 11:56 AM
The solution would be to update the Principal object directly with the properties you need at login, when the Principal is created. See how the MultiTenantUserManager
does it for instance, to use another class than NuxeoPrincipalImpl
.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.