ConnectionManager get connection for already authenticated user
Author: jean-claude_bac
Publication Date: 11/25/2011 12:36
I wrote a Service modul
public class PimImportServiceImpl implements PimImportService,
de.espirit.firstspirit.module.Service<PimImportService> {
...
}
that imports data into a project opening a connection using the Connection Manager:
Connection connection = ConnectionManager.getConnection(host, port, ConnectionManager.HTTP_MODE,login, password);
to write data into the database of a FirstSpirit project.
The import of the data is triggered by a user that is already logged into the CMS using a beanshell script. I am looking for a way to avoid having a user to provide their password again as needed by the ConnectionManager interface.
Is there another way to handle that?
-
Author: Peter_Jodeleit - 11/25/2011 12:54
The interface Service has an "init" method which is called by FirstSpirit, providing a ServerEnvironment instanance. This in turn has a method "getConnection()". So there is no need to create a connection by yourself.
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
1 commentaire