You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Ethem YUKSEL <et...@siemens.com> on 2005/03/22 10:35:13 UTC

org.apache.slide.structure.ObjectNotFoundException

Hi to all,
when i try to execute the code below; 

NamespaceAccessToken token = Domain.accessNamespace(new
SecurityToken(this),nameSpace);
Content content = token.getContentHelper();
content.create(this.slideToken,"c:\\slide\\sample.txt",true);

i got exception:

org.apache.slide.structure.ObjectNotFoundException: No object found at
/c:\slide\sample.txt

how can i fix this problem or where does  "/" refer at filesystem.

please help me,
Ethem Yuksel


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: org.apache.slide.structure.ObjectNotFoundException

Posted by A B <ha...@gmail.com>.
> NamespaceAccessToken token = Domain.accessNamespace(new
> SecurityToken(this),nameSpace);
> Content content = token.getContentHelper();
> content.create(this.slideToken,"c:\\slide\\sample.txt",true); 

The signature for this method is:
void create(SlideToken token,  java.lang.String strUri, boolean isVersioned)

The value for strUri is the value of the URI _on the server_. So, if
you want to create a versioned resource at
"/files/sample/example_one.txt", you would make the call this way:

content.create( slideToken, "/files/sample/example_one.txt", true)

That will create the revision descriptors on the server, you then need
to go get those descriptors and add content. Here's some pseudo code:

nodeRevisions = content.retrieve( slideToken, "/files/sample/example_one.txt" )
nodeRevision = content.retrieve( slideToken, nodeRevisions )
nodeContent = content.retrieve( slideToken, nodeRevisions, nodeRevision )
nodeContent.setContent( byte[] of your local file contents )
content.store( slideToken, "/files/sample/example_one.txt",
nodeRevision, nodeContent)

I haven't had a chance to test this code, but it seems that it should
work. Where I get hung up is whether the client needs to create a new
NodeRevisionDescriptor for each update to the NodeContent -- does the
server do that? Anyone know a better way? (Anyone know the *right* way
 ;-)

-AB

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org