AnsweredAssumed Answered

get node Content

Question asked by ericc on Dec 20, 2007
Latest reply on Apr 12, 2010 by nowhere
Hello, I'm new in Alfresco so it might be "stupid" question.

I display on  a menu all my recordrer research, all is fine. When I click on one of the research I want to replay it.

So first step I try to get the content of the recorded research (and after use it for things I want to do), but I can't have the node content…

Here is my code :
public void navigate(ActionEvent event)
      {
         // work out which node was clicked from the event data
         UIRecentSpacesShelfItem.RecentSpacesEvent spaceEvent = (UIRecentSpacesShelfItem.RecentSpacesEvent)event;
         Node selectedNode = this.shortcuts.get(spaceEvent.Index);
         NodeRef nodeRef = selectedNode.getNodeRef();
         try
         {
            // then navigate to the appropriate node in UI
            // use browse bean functionality for this as it will update the breadcrumb for us
            //this.browseBean.updateUILocation(nodeRef);
           
           
            //this.nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT);
            ContentReader contentReader = this.contentService.getReader(nodeRef, ContentModel.PROP_CONTENT);
           

             contentReader.getContentString();


When getContent is call an exeption occured :

contentUrl=store://2007/12/18/16/55/b52af51c-ad81-11dc-895d-d76a1b20d501.bin| mimetype=text/xml|size=463|encoding=UTF-8|locale=fr_FR_ ) la méthode getContentString me renvois une exeption :
org.alfresco.service.cmr.repository.ContentIOException: Failed to open stream onto channel:
accessor: ContentAccessor[ contentUrl=store://2007/12/18/16/55/b52af51c-ad81-11dc-895d-d76a1b20d501.bin, mimetype=text/xml, size=463, encoding=UTF-8, locale=fr_FR]
caused by:
java.lang.RuntimeException: A channel has already been opened

Someone have an idea to help me? (maybe I'm not on the right way…)

Thanks.

Outcomes