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.
public String getData(String Id){ String result = null; try { // Obtener el servicio adecuado. ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService(); // Construimos la Referencia en base a su UUID. Node nodo = this.getNode(Id); Reference ref = nodo.getReference(); // Leemos del repositorio el elemento. Content[] readResult = contentService.read( new Predicate(new Reference[]{ref}, STORE, null), Constants.PROP_CONTENT); Content content = readResult[0]; // Obtenemos el contenido a partir de su URL y se muestra. System.out.println(ContentUtils.getContentAsString(content)); result = ContentUtils.getContentAsString(content); } catch (ContentFault e) { System.out.println("No se ha podido leer el fichero."); } catch (RemoteException e) { System.out.println("Error de servicio."); } return result; }
protected Node getNode(String uuid){ RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService(); Node myNode = null; Reference reference = new Reference(STORE, uuid, null); Predicate predicate = new Predicate(new Reference[]{reference}, null, null); Node[] nodes; try { nodes = repositoryService.get(predicate); // Obtenemos el nodo. myNode = nodes[0]; } catch (RepositoryFault e) { System.out.println("Datos no encontrados."); } catch (RemoteException e) { System.out.println("Error de servicio remoto."); } return myNode; }