Hi, I am trying to read the content of a document whitin a custom action. I can get the Node and the NodeRef using browseBean.getDocument().Then I try to use fileFolderService.getReader(nodeRef) to get the content but when I call that function Alfresco throws an exception:
java.lang.NullPointerException
at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.toFileInfo(FileFolderServiceImpl.java:224)
at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.getReader(FileFolderServiceImpl.java:924)
at org.alfresco.sample.AddSignatureDialog.finishImpl(AddSignatureDialog.java:68)
I know that the node references a document because the name and the path fields of that Node have the name of the document.Here you have the source code
65: Node documentNode = browseBean.getDocument();
66: NodeRef documentNodeRef = documentNode.getNodeRef();
67: fileFolderService = new FileFolderServiceImpl();
68: ContentReader contentReader = fileFolderService.getReader(documentNodeRef);
69: String contentURL = contentReader.getContentUrl();
Any idea?Thanks, Pau Carré Cardona