How to open an InDesign file from CMIS repository?
we using cs sdk 2.0 , looking use cmis keep versionning of .indd file. uss case following:
- form our de4veloped indesign pluging, user click button
- the button open .indd file cmis repository
- plugin check-out file, open within indesign ide
- user make changes
- user make save
- the plugin export pdf , swf files current document, if files exists update, aslo on cmis repo keep versions of exported pdf , swf, if files not exist in first time .. create
- when user clos document , check in.
the problem there no sufficent sample code for, thinking use adobe drive, there no adobe drive sdk flex.
i used fuse sdk,
| private function getfilebypath(spath:string):fileable { | |||||||||
| appstatus = ">> file path"; | |||||||||
| message = ""; | |||||||||
| viewenabled = false; | |||||||||
| var request:getobjectbypathrequest = new getobjectbypathrequest(session); | |||||||||
| var ofileable:fileable; | |||||||||
| request.path = spath; | |||||||||
| request.execute(onsuccess, onerror); | |||||||||
| function onsuccess (event:getobjectbypathresponse) : void { | |||||||||
| ofileable = event.object; | |||||||||
| //var odoc2:document = new document(event.object); | |||||||||
| doc = event.object document ; | |||||||||
| //children = new arraycollection(vectortoarray(event.target)); | |||||||||
| appstatus = ">> getfilebypath : success"; | |||||||||
| viewenabled = true; | |||||||||
| } | |||||||||
| return ofileable; | |||||||||
| } | |||||||||
| private function checkoutfile(ofile:document):document{ | |||||||||
| appstatus = ">> check out file"; | |||||||||
| message = ""; | |||||||||
| viewenabled = false; | |||||||||
| var request:checkoutrequest = new checkoutrequest(session); | |||||||||
| request.object = doc; | |||||||||
| var odocument:document; | |||||||||
| request.execute(onsuccess, onerror); | |||||||||
| function onsuccess (event:checkoutresponse) : void { | |||||||||
| odocument = event.object ; | |||||||||
| appstatus = ">> check out file : success"; | |||||||||
| viewenabled = true; | |||||||||
| } | |||||||||
| return odocument; | |||||||||
| } |
private function opentestfile():void {
appstatus = "open test file";
message = "";
viewenabled = false;
var ofile:fileable = getfilebypath("/collaboration/test.indd");
//var odoc2:document = new document(ofile);
var odoc:document = checkoutfile(doc);
}
i not know method in cs sdk open document fom active window and how map cmis document com.adobe.indesign document ?
adobe drive not scriptable not option here. can use cmis library swc achieve want do. sample project - cmisworkflow - extensionbuilder 2 attached.
you want stucture code classes deal indesign , deal cmis library distinct collision on document type name (indesign versus cmis) less confusing. in sample code indesigncontroller deals indesign documents , cmiscontroller deals cmis documents.
to integrate distinct layers can use local file cache class such filecache in sample code. documents downloaded cmis repository , cached in files in known location on local filesystem - under ~/cmisworkflow/cache folder in case of sample.
you can map cmis document indesign document follows:
1) download cmis document's content stream flash.filesystem.file on local drive. approach taken sample code reflect structure of remote repository in structure of local cache - file path /foo/bar.indd on server gets downloaded ~/cmisworkflow/cache/foo/bar.indd. easy map local path associated path on cmis server.
2) use indesign.app.open() open file indesign document.
entries in sample filecache keyed local file. can store cmis document object associated file being edited in filecache can check in later.
hope info helps started.
best regards,
seoras
More discussions in Creative Suite SDK
adobe
Comments
Post a Comment