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.
… NewUserDetails[] newUsers = new NewUserDetails[] { new NewUserDetails( usuario, password, createPersonProperties( "workspace://SpacesStore/046fc85b-8fda-11dd-baf9-d1d8da1d6f05", "Simpatico", "saludando", "siempre", "buenos@dias.com", "saludador")) }; WebServiceFactory.getAdministrationService().createUsers(newUsers); System.out.println("Usuario creado"); … private static NamedValue[] createPersonProperties(String homeFolder, String firstName, String middleName, String lastName, String email, String orgId) { // Create the new user objects return new NamedValue[] { new NamedValue(Constants.PROP_USER_HOMEFOLDER, false, homeFolder, null), new NamedValue(Constants.PROP_USER_FIRSTNAME, false, firstName, null), new NamedValue(Constants.PROP_USER_MIDDLENAME, false, middleName, null), new NamedValue(Constants.PROP_USER_LASTNAME, false, lastName, null), new NamedValue(Constants.PROP_USER_EMAIL, false, email, null), new NamedValue(Constants.PROP_USER_ORGID, false, orgId, null) }; }
String path = "/app:company_home/cm:para_x0020_Jaime"; // Montamos la query para encontrar el id de nodo String texto_query = "+PATH:\"" + path + "\""; System.out.println("Query para obtener id de nodo: " + texto_query); Query query = new Query(Constants.QUERY_LANG_LUCENE, texto_query); try { // Ejecutamos la consulta para encontrar la bustia del usuario QueryResult queryResult = repositoryService.query(STORE, query, false); // Mostramos los resultados… ResultSet resultSet = queryResult.getResultSet(); ResultSetRow[] rows = resultSet.getRows(); if (rows != null) { // Obtenemos los registros de la query…en principio sólo 1… for (ResultSetRow row : rows) { String id = row.getNode().getId(); System.out.println("Encontrado store de usuarios con id: " + id); Reference reference = new Reference(STORE, id, null); NewUserDetails[] newUsers = new NewUserDetails[] { new NewUserDetails( usuario, password, createPersonProperties( "workspace://SpacesStore/" + reference.getUuid(), nombre, apellido1, apellido2, email, nombre)) }; WebServiceFactory.getAdministrationService().createUsers(newUsers); System.out.println("Usuario creado"); } } } catch (java.rmi.RemoteException exp) { System.out.println("ERROR al realizar la consulta"); exp.printStackTrace(); }