So, does sessionAtom.GetObject(id) return a Document object?
If so, I don't understand the problem. If not, which C# object does it return?

Btw. You should cast to IDocument. Document is an implementation class and GetObject() might return something different in later releases.


- Florian


Hello Florian,

Thank you very much for your quickly reply.

In fact it's the same object in AtomPub and WebService it's an
DotCMIS.Client.Impl.Document.

And this document comes from a mongoDD database.


{ "_id" : { "$oid" : "54648c9e2e1cb080eb95a6f3"} ,
"cmis:contentStreamData" : { "$binary" :
"iVBORw0KGgoAAAANSUhEUgAABCoAAAKhCAYAAACW8k/ ..." , "$type" : 0} ,
"cmis:contentStreamLength" : "51434" ,
"cmis:path" : "null" ,
"cmis:objectTypeId" : "cmis:document" ,
 "cmis:versionSeriesCheckedOutBy" : "olivier" ,
"cmis:isPrivateWorkingCopy" : "true" ,
"cmis:versionSeriesCheckedOutId" : "54648c9e2e1cb080eb95a6f3" ,
"cmis:versionSeriesId" : "54638bb67afe91ef43fdae21" ,
 "cmis:versionLabel" : "1.1" , "cmis:isLatestVersion" : "false" ,
 "cmis:isVersionSeriesCheckedOut" : "true" ,
 "cmis:lastModifiedBy" : "olivier" ,
"cmis:createdBy" : "olivier" ,
"cmis:isLatestMajorVersion" : "false" ,
 "cmis:contentStreamId" : "null" ,
 "cmis:name" : "MyFile.PNG" ,
"cmis:contentStreamMimeType" : "image/png" ,
"cmis:creationDate" : "13/11/2014 11:49:02" ,
"cmis:secondaryObjectTypeIds" : "null" ,
"cmis:changeToken" : "" ,
 "cmis:acl" : { "admin" : "cmis:all" , "olivier" : "cmis:write"} ,
 "cmis:checkinComment" : "" ,
 "cmis:isMajorVersion" : "false" ,
"cmis:isImmutable" : "false" ,
 "cmis:baseTypeId" : "cmis:document" ,
 "cmis:description" : "" ,
 "cmis:contentStreamFileName" : "MyFile.PNG" ,
 "cmis:lastModificationDate" : "13/11/2014 11:49:02" ,
 "cmis:parentId" : "null" ,
 "cmis:versionSeriesCheckedOutFromId" : "54638bb67afe91ef43fdae21"}


Best Regards,

Olivier Aye


-----Original Message-----
From: Florian Müller [mailto:f...@apache.org]
Sent: jeudi 13 novembre 2014 20:44
To: dev@chemistry.apache.org
Cc: Olivier Aye
Subject: Re: cancel Checkout Atom or Web service

Hi Olivier,

can you tell us what kind of object is returned when you are using AtomPub?


- Florian



DotCmis V 0.5.0.0
OpenCmis 0.11.0
MongoDb 2.6

Hello,

I have an error when I want cast a an object to a document, when this object is checkout in my database, and only with an Atom session.

Currently, if I do the same method, but in WebService the method works properly.

This method works

public ActionResult CancelCheckOut(String id)
        {
            IDocument od = sessionWS.GetObject(id) as Document;
            od.CancelCheckOut();
            return RedirectToAction("Index");
        }


This method doesn't works

public ActionResult CancelCheckOut(String id)
        {
IDocument od = sessionAtom.GetObject(id) as Document; This method return an error at this line
            od.CancelCheckOut();
            return RedirectToAction("Index");
        }

Do you have an idea how I can resolve this problem.

Thanks

Olivier


This email message and any attachments ("the email") are confidential and intended only for the recipient(s) indicated. If you are not an intended recipient, please be advised that any use, dissemination, forwarding or copying of this email whatsoever is prohibited without Evolution Energie's prior written consent. If you have received this email in error, please delete it without saving a copy and notify the sender immediately. Internet emails are not necessarily secured, and declines responsibility for any changes that may have been made to this email after it was sent. While we take all reasonable precautions to ensure that viruses are not transmitted via emails, we recommend that you take your own measures to prevent viruses from entering your computer system.

This email message and any attachments (“the email”) are confidential
and intended only for the recipient(s) indicated. If you are not an
intended recipient, please be advised that any use, dissemination,
forwarding or copying of this email whatsoever is prohibited without
Evolution Energie's prior written consent. If you have received this
email in error, please delete it without saving a copy and notify the
sender immediately. Internet emails are not necessarily secured, and
declines responsibility for any changes that may have been made to
this email after it was sent. While we take all reasonable precautions
to ensure that viruses are not transmitted via emails, we recommend
that you take your own measures to prevent viruses from entering your
computer system.

Reply via email to