AnsweredAssumed Answered

Cannot retrieve newly created files with API

Question asked by aleksczajka on Dec 4, 2014
I'm having two issues that I think might be related. First one is that if I create a new file, I cannot retrieve it with

I know that this is the right path because a different file that is in there I was able to retrieve. I have checked the file has EVERYONE : Consumer permissions as well as the directory.

My install is on a CentOS VM and it's a bitnami install. The first install was a VM on a remote server and I successfully verified the same issue on a local install. Same version. However, when I install straight from Alfresco and run it on my machine, not a VM, this works correctly.

The other problem that I'm having is that my web script is not finding files. Here's pretty much what it is:

var fileName = url.extension.replaceAll(/"/g, "");

// perform search
var nodes = search.luceneSearch("@cm\\:name:\"test.txt\"");

//stream the first document
model.contentNode = nodes[0];

This script gives me this error

Wrapped Exception (with status template): org.mozilla.javascript.Undefined cannot be cast to org.alfresco.service.cmr.repository.NodeRef

Which I'm assuming it's saying that it cannot convert null content to model.contentNode. this is why i think luceneSearch simply cannot find the file. I even tried to locate the file that I was able to retrieve above and could not get this to work