AuthenticationUtils.startSession(login,password)
et WebServiceFactory.getRepositoryService()
Mais cela ne permet pas de différencier les utilisateurs ! (je prends toujours le dernier ticket crée ce qui est logique avec ce singleton)public String getNouveauTicketDeConnexion(String username, String password) throws AuthenticationFault
{
AuthenticationResult result = null;
try
{
/** Démarre la session qu'on ne fermera jamais. TODO vérifier qu'Alfresco a des timeout pour ces tickets, et les supprime au bout de qq temps*/
result = this.webServiceFactory.getAuthenticationService().startSession(username, password);
}
catch (RemoteException exception)
{
/** Rethrow the authentication exception */
if (exception instanceof AuthenticationFault) {throw (AuthenticationFault)exception;}
/** Throw the exception as a wrapped runtime exception */
else {throw new WebServiceException("Error starting session.", exception);}
}
/** On retourne le ticket épuré de son prefixe TICKET_*/
return result != null ? result.getTicket().substring("TICKET_".length()) : null;
}
AuthenticationUtils.startSession("user1","password")
//Traitement avec les WS d'alfresco :
Predicate ressourceAEffacer = new Predicate(new Reference[]{new Reference(ConnecteurGEDAlfresco.STORE, idElementGed, null)}, null, null);
CMLDelete cmlDelete = new CMLDelete(ressourceAEffacer);
CML cml = new CML();
cml.setDelete(new CMLDelete[]{cmlDelete});
this.getWebServiceFactory().getRepositoryService().update(cml);
//Fin de la session
AuthenticationUtils.stopSession();
Mais je pense que tu as du t'inspirer des exemples et des tests Junit des webservices, car il ne faut pas trop compter sur la documentation qui est quasi inexistante…
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.