01-09-2007 04:14 PM
01-10-2007 06:55 AM
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;
}
01-10-2007 11:01 AM
10-11-2007 04:56 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.