Reference reference = new Reference(STORE, document.getId(), path);
Content[] readResult = contentRepository.read(new Predicate(new Reference[]{reference}, STORE, null), Constants.PROP_CONTENT);
byte[] contentBytes = null;
if(readResult!=null){
Content content = (Content) readResult[0];
contentBytes = UtilsFile.getByteContent(content);
document.setContent(contentBytes);
}
Predicate predicate = new Predicate(new Reference[]{reference}, null, null);
Node[] nodes = repository.get(predicate);
// Se recupera la propiedad FileName
AlfrescoDatosEspecificosVO datosEspecificosVO = (AlfrescoDatosEspecificosVO) document.getDatosEspecificos();
Map metadata = new HashMap();
if (nodes != null){
for(int i=0;i<nodes.length;i++){
Node node = nodes[i];
NamedValue[] prop = node.getProperties();
for(int f=0;f<prop.length;f++){
NamedValue namedValue = (NamedValue)prop[f];
String name = namedValue.getName().split("}")[1];
AlfrescoDatosEspecificosValueVO alfrescoDatosEspecificosValueVO = null;
alfrescoDatosEspecificosValueVO = (AlfrescoDatosEspecificosValueVO) datosEspecificosVO.getValues().get(name);
if (alfrescoDatosEspecificosValueVO!=null)
{
//document.setName(namedValue.getValue());
alfrescoDatosEspecificosValueVO.setValue(namedValue.getValue());
metadata.put(name, alfrescoDatosEspecificosValueVO);
}
}
}
}
AlfrescoDatosEspecificosValueVO alfrescoDatosEspecificosValueVO =(AlfrescoDatosEspecificosValueVO)metadata.get(datosEspecificosVO.getFileKey());
datosEspecificosVO.setValues(metadata);
document.setName(alfrescoDatosEspecificosValueVO.getValue());
return document;
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.