Adobe Drive is not scriptable so it is not an option here. But you can use the CMIS library swc to achieve what you want to do. A sample project - CMISWorkflow - for ExtensionBuilder 2 is attached.
You want to stucture your code so that the classes that deal with InDesign and those that deal with the CMIS library are distinct so that the collision on the Document type name (InDesign versus CMIS) is less confusing. In the sample code the InDesignController deals with InDesign documents and the CMISController deals with CMIS documents.
To integrate the distinct layers you can use a local file cache class such as FileCache in the sample code. Documents are downloaded from the CMIS repository and cached in files in a well known location on your local filesystem - under the ~/CMISWorkflow/cache folder in the case of the sample.
You can map from a CMIS document to an InDesign document as follows:
1) Download the CMIS document's content stream into a flash.filesystem.File on your local drive. The approach taken by the sample code is to reflect the structure of the remote repository in the structure of the local cache - so a file with a path /foo/bar.indd on the server gets downloaded into ~/CMISWorkflow/cache/foo/bar.indd. Then it is easy to map from local path to the associated path on the CMIS server.
2) Use InDesign.app.open() to open the file as an InDesign Document.
Entries in the sample FileCache are keyed by the local file. You can store the CMIS document object associated with a file being edited in the FileCache so that you can check it back in later.
Hope this info helps you get started.
CMISWorkflow.fxp.zip 12.0 K
REALL THANK YOU FOR YOUR REPLY .. I LL CHECK YOUR SOLUTION RIGHT NOW ... THANK YOU AGAIN
There is an issue when export new pdf triggered by onSave , the following trace raise
nSave: afterSave [object Document]
saveHandler: [IndexEvent type="documentSaved" document=[object Document] bubbles=false cancelable=false eventPhase=2]
8/30/2012 13:04:05.168 [INFO] CSAWLib.CSLogger TypeConUtils.getAnyPossibleClassDefinitionFor() Failed to find any class definition for com.adobe.indesign::File
8/30/2012 13:04:05.169 [INFO] CSAWLib.CSLogger TypeConUtils.getAnyPossibleClassDefinitionFor() Failed to find any class definition for com.adobe.indesign::File
Creating document at path: \Collaboration\test2.indd.pdf
ERROR: GetObjectByPathRequest has invalid arguments(400)
i am usuing a local Nuxeo DAM server ...
i think this error raise in the following line
[line 164] var getObjectRequest:GetObjectByPathRequest = new GetObjectByPathRequest(_session);
any idea ?
You must use CMIS paths when calling GetObjectByPath - they use / as a separator so you want to use "/Collaboration/test2.indd.pdf". Yup this is a bug in the sample code which was put together for you on a Mac.
Thank you Seoras for your reply
i also was trying to do with your providedD Alfresco repo. when i save ... an Inesign prompt window "Save As" show up ... i di dnot understand what that was for
i fixed the to return the cmis path:
public function resolveRemotePath(file:File):String
if (file.nativePath.indexOf(LOCAL_FILE_CACHE.nativePath) != 0)
var remoptePath:String =file.nativePath.substr(LOCAL_FILE_CACHE.nativePath.length);
trace("resolveRemotePath  : "+ remoptePath);
//var pattern:RegExp = /(\/)/g;
var pattern:RegExp = /(\\)/g;
remoptePath = remoptePath.replace(pattern ,"/");
trace("resolveRemotePath  : "+ remoptePath);
i have another issue, why everytime update the generated pdf it creates new pdf file with same name in the cmis repo .. does the pdf is not updatable over the cmis service ???
Step through the upload code in the debugger.
Are you somehow calling CreateDocumentRequest repeatedly with a path that already exists in the server? That seems the most likely cause of what you are observing. There is a call to GetObjectByPathRequest that should fail if the document does not already exist and needs to be created. Is that logic working?
Or are you saying that calling SetContentStreamRequest on an existing document causes a new document with the same name to be created in your server?
yes i run the extension through the debugger ,, you think that the issue ??
i use ur code as it is .. i make changes to the indesign file and make save several time, each time new pdf uploaded with the same name up to your implemented senario.
the use case is, as we use cmis to keep versionning of InDesign file, we have also to keep versionning of generated exported .pdf and .swf. i still examine your code .. did not change any, do i have to check put the previous generated pdf, and stream the new pdf to the old version remote .pdf then check in ???
If you want versioning of the pdf and other generated artefacts why don't you try a check out / check in workflow with them.