As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
AuthenticationUtils.startSession(login,password)
WebServiceFactory.getRepositoryService()
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();