AnsweredAssumed Answered

help getting reference to avm content - frustrated :(

Question asked by marcik on Apr 24, 2009
I am having trouble getting a Reference to some known content.

i am using the PreviewURIService. It tells me my store name is: CMS–admin. I can successfully create a new Store object with the code: Store cmsStore = new Store("avm", "CMS–admin");

PreviewURIService then tells me the path to the asset i want is: /www/avm_webapps/ROOT/data/pages/AboutUs.xml

So i try to create a new reference as follows: Reference dataFolder = new Reference(cmsStore, null, "/www/avm_webapps/ROOT/data/pages/AboutUs.xml");

this doesn't seem to work. When i try to use the Reference as follows, it gives me a ContentFault:

           Reference dataFolder = new Reference(cmsStore, null, "/www/avm_webapps/ROOT/data/pages/AboutUs.xml");
           
            Reference[] folderRefs = {dataFolder};
           
            Predicate predicate = new Predicate(folderRefs, cmsStore, null);
           
             org.alfresco.webservice.content.Content[] contentList = contentService.read(predicate,Constants.PROP_CONTENT);

Message from the ContentFault is: Failed to resolve to a single NodeRef with parameters (store=avm:CMS–admin uuid=null path=/www/avm_webapps/ROOT/data/pages/AboutUs.xml), found 0 nodes.

What is the correct way to create the Reference object, given a known path?

Thanks so much!!

Outcomes