ADOBE VERSION CUE CS3 CLIENT PROGRAMMER’S GUIDE
© 2007 Adobe Systems Incorporated. All rights reserved. Adobe Version Cue CS3 Client Programmer’s Guide Technical note #10306 Adobe, the Adobe logo, Bridge, Creative Suite, Version Cue, and Version Cue Server are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Mac OS is a trademark of Apple Computer, Inc., registered in the United States and other countries.
Contents Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Key Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Customizing Asset Icons/ Thumbnails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents 4 Adobe Version Cue CS3 Client Programmer’s Guide
Adobe Version Cue CS3 Client Programmer’s Guide Terminology Adobe Version Cue CS3 Client Programmer’s Guide This document describes the Adobe® Version Cue® client from a programmer’s perspective. It is intended for system integrators integrating with Version Cue, who are already writing plugins for Version Cue Server™.
Adobe Version Cue CS3 Client Programmer’s Guide Introduction z Version Cue Server — The server component of Version Cue CS3. z Version Cue Server plug-in — A plug-in developed in Java™ using the Version Cue SDK, conforming to the pattern required to be loaded and called by Version Cue Server. NOTE: Unless noted otherwise, references to any Adobe product always mean the CS3 product.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations mon User Interface also let you customize how assets appear in the user interface of Adobe Bridge CS3, which is tightly integrated with Version Cue. To see the the Adobe File > Open dialog from the Adobe Common User Interface, using a client such as Adobe InDesign CS3.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations The custom project icon in Figure 1 is provided by a sample plug-in for Version Cue Server named sample.customproject; this sample plug-in is the reference implementation for connecting to an external system and provides a model of how you would implement an adapter between your external system and the Adobe Creative Suite CS3 point products.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations Custom Metadata Version Cue clients can display custom metadata provided by your Version Cue Server plugins, in contexts such as the Inspector Panel of Adobe Bridge CS3 or the File Info area of the Adobe File > Open dialog.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations used to remove menu items from the context-sensitive menu shown when an asset is selected in one of your custom projects, if some operations are not supported. Figure 4 shows context-sensitive menu items when a file in a standard Version Cue project is selected in Adobe Bridge CS3. Note how there are nearly twenty menu items shown for this context-sensitive menu.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations FIGURE 5 Context-sensitive Menu for Custom Project This is achieved by restricting the project capabilities that sample.customproject provides. See the ProjectCapabilities class in that sample to discover why there are fewer menu items for the context-sensitive menu on the custom project compared to the standard project.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations Your Version Cue Server plug-in can use this external reference to propagate any changes to a syndicated asset in the standard Version Cue project back to the external system. For example, if your external DAM system supports versioning, you may want to create a new version of the original asset in the external system when a Creative Suite end user saves a new version of the syndicated asset to the standard project.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations FIGURE 6 An Asset Syndicated from a Custom Project In the CustomProject sample plug-in, the external asset and the asset in the standard (WIP) project are kept in synchronization, using a storeContent listener. When a new version of the asset in the standard project is saved, the external asset in the custom project from which it was downloaded also is updated.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations Restrictions The following restrictions apply to asset syndication through drag-and-drop or copy/paste in the user interface of Adobe Bridge CS3: z Both source and target projects must be mounted before starting the drag-and-drop (or copy/paste) operation. z Both source and target projects must have authentication switched off; that is, no login should be required for either project to complete the gesture.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations FIGURE 7 Custom Check-in Dialog on Ingest To test the metadata capture enforcement feature and make the customized check-in dialog appear, you need to open a file, modify it, and check in the modified version to a Version Cue project. 1. Ensure Version Cue Server is running with a plug-in like sample.customdialog loaded for the custom check-in dialog to appear. 2.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations FIGURE 8 Custom Check-in Dialog Figure 8 shows a custom check-in dialog provided by the sample plug-in for Version Cue Server named sample.customdialog. The custom check-in dialog shows fields that include the name of the user responsible for the check-in, status, a check-in comment, and a check box indicating an operation that should be performed on check-in.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations For More Information See Help within the IDE of VersionCueSDK: Help > Version Cue SDK Help > Samples Guide > CustomDialog Customizing Menus Version Cue extensibility enables you to contribute custom submenus and custom menu items in the following contexts: z Tools menu in the Adobe File > Open dialog: Use the VersionCue.TOOLSMENU symbolic constant for the menu base path in your scripts.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations FIGURE 9 Custom Menus within Adobe Bridge CS3 Content pane The Version Cue client receives JavaScript code— using a JavaScript library from Adobe named ScriptUI— that enables custom menus to be created when first visiting a Version Cue project. To see the scripts associated with creating the user interface, see the data/scripts folder of the sample.custommenu SDK sample.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations Restrictions Support for custom menus has some limitations: z The Version Cue client receives the custom menu information from the Version Cue Server when you enter the project for the first time; for instance, by double-clicking the project in the File > Open dialog.
Adobe Version Cue CS3 Client Programmer’s Guide Key Operations “Special Metadata”. The former is of type “enum”; the latter, “string.” You can select one of those new categories and retrieve search results from the Version Cue Server. FIGURE 10 Project Search over Sample Custom Project If you have the plug-in loaded, to see this dialog, navigate within the Adobe Bridge CS3 to “Sample Custom Project” and execute Edit > Find once the root folders of the project are visible in the Content pane of Bridge.
Adobe Version Cue CS3 Client Programmer’s Guide Version Cue Client Architecture FIGURE 11 Project Search with Paged Result Set For More Information See the section on custom search criteria in the plug-in sample documentation: VersionCueSDK IDE Help > Version Cue SDK Help > Samples Guide > Custom Project. See the plug-in sample documentation: VersionCueSDK IDE Help > Version Cue SDK Help > Samples Guide > Search Paging.
Adobe Version Cue CS3 Client Programmer’s Guide Version Cue Client Architecture ent versions of an image to be created in Photoshop. Integration with Version Cue enables InDesign to change the state of a link in its user interface when an asset is updated on a Version Cue Server by another user, as if it were a local file (rather than a managed asset). The Version Cue asset-management features are largely transparent to the end user of applications like InDesign and Photoshop.
Adobe Version Cue CS3 Client Programmer’s Guide Version Cue Client Architecture Version Cue Server plug-in provides a single point of integration with Version Cue for adding server-side functionality, the same integration model is followed on the client side; that is, having a single point of integration to add client-side functionality. The mechanism that makes possible a single point of integration for client-side extensibility is server-driven scripts sent to the client.
Adobe Version Cue CS3 Client Programmer’s Guide Version Cue Client Architecture FIGURE 12 Conceptual Threading Model for Version Cue Client network Version Cue Client operations explore-assets get-preview critical-section Version Cue Server: performs server-side processing to handle the SOAP request from the Version Cue Client, obtain a list of assets given request parameters (or preview of those assets) and create SOAP response given the request, which is then sent back to the Client process SOAP r
Adobe Version Cue CS3 Client Programmer’s Guide Scripting Environment The thread executing in the critical section sends a SOAP request, receives a SOAP response (or a time-out period is exceeded, if there is network congestion or a Version Cue Server is unavailable), and leaves the critical section, releasing the mutex. The next thread acquires the mutex, enters the critical section, sends the SOAP request, waits for a SOAP response (or timeout period to be exceeded), and so on.
Adobe Version Cue CS3 Client Programmer’s Guide Scripting Environment For help in developing, debugging, and testing scripts, ExtendScript provides the following: z The ExtendScript Toolkit itself, which has a full-featured source-level debugger and development environment for writing JavaScript code. z A global debugging object, the dollar ($) object, which can emit trace to the JavaScript console in the ExtendScript Toolkit. See “Debugging, Logging, and Profiling with the Toolkit” on page 26.
Adobe Version Cue CS3 Client Programmer’s Guide Scripting Environment The JavaScript console is a key feature of the Toolkit. In addition to seeing trace output, you can use its command line to execute lines of JavaScript, in the current execution context, and also see directly the results of executing JavaScript in the output field. A key feature of ExtendScript for debugging is the built-in dollar object, used as follows: $.writeln(...
Adobe Version Cue CS3 Client Programmer’s Guide Scripting Environment To exercise Version Cue features, use Adobe Bridge CS3 or other Version Cue clients such as Adobe Photoshop CS3 and Adobe InDesign CS3. Enabling the Version Cue Client Scripting Interface from other Scripting Contexts There is one contract that you need to be aware of before using the client scripting interface to Version Cue from a context such as a JavaScript running against the Adobe Bridge CS3 scripting engine.
Adobe Version Cue CS3 Client Programmer’s Guide Scripting Environment 5. Enter the code below into the editor window: Window.alert("Hello World."); 6. Within the Toolkit, run the script you just created, by selecting Debug > Run or using the Run icon button on the toolbar (a rightward-pointing triangle). 7. Verify that you can see an alert popped from the context of the Version Cue client.
Adobe Version Cue CS3 Client Programmer’s Guide Scripting Environment Follow these steps: 1. If you have not already done so, launch the ExtendScript Toolkit 2.0. 2. To ensure you have at least one Version Cue Server available to the client, launch Version Cue Server in the usual fashion, as described in Getting Started with Adobe Version Cue CS3 Development. 3. Enter the code shown in Example 1. Make sure “Adobe Bridge” is the target application in the Toolkit. 4. Execute the script.
Adobe Version Cue CS3 Client Programmer’s Guide Scripting Environment FIGURE 13 Running Example 1 in ExtendScript Toolkit Example: List Projects in a Version Cue Server In the next example, we execute code to list the names of projects in a Version Cue Server. We assume that the client is Adobe Bridge CS3. Follow these steps: 1. Launch Version Cue Server, if you have not already done so. 2. Make sure you have at least one project in the Version Cue Server. 3.
Adobe Version Cue CS3 Client Programmer’s Guide Scripting Environment EXAMPLE 2 do { // Visit our local Server var serverURL = "http://localhost:3703"; var providerName = "VC20"; var server = VCSession.declareServer( serverURL, providerName); // Determine that this is actually online var flags = new Array; flags[0] = VCFlagConstants.TRY_RECOVER_SERVER; var status = server.verifyConnection(flags); if(!status.isSuccess) break; $.writeln("Connection to server verified..."); status = VCSession.
Adobe Version Cue CS3 Client Programmer’s Guide Scripting Environment FIGURE 14 Running Example 2 in ExtendScript Toolkit For More Information See the following resources: z The Scripting Interface Reference in the Version Cue SDK, for information on working with the scripting interface to the Version Cue client libraries. z The JavaScript Tools Guide CS3 in the Bridge CS3 SDK, for information on the ExtendScript Toolkit and the Adobe JavaScript library for creating user interfaces named ScriptUI.
Adobe Version Cue CS3 Client Programmer’s Guide References References z ECMA-262: ECMAScript Language Specification http://www.ecma-international.org/publications/standards/Ecma-262.htm z ECMA-357: ECMAScript for XML (E4X) Specification http://www.ecma-international.org/publications/standards/Ecma-357.htm 34 z Adobe Bridge CS3 SDK. Adobe Systems Inc., 2007. z Version Cue Client Scripting Interface Reference. Integrated with Help in the IDE of Adobe Version Cue CS3 SDK.