AdobeBridgeCS5SDK

Class CustomSearchExtensionHandler

Object
   |
   +--CustomSearchExtensionHandler

class CustomSearchExtensionHandler


Demonstrates how to implement a custom node search with a node-handling extension.

Usage

  1. Make sure the icon files required by this sample are in the ./resources folder (BEHFileIconxx.png)
  2. Run the snippet in the ExtendScript Toolkit (see Readme.txt) with Bridge CS5 as the target; note you can do this only once, then you must restart Bridge for this sample.
  3. In Adobe Bridge, select the new icon added to the Favorites panel, which is named CSRoot.
  4. Navigate through the node hierarchy in the Content pane
  5. Choose Edit > Find to open the Find dialog
  6. Select search criteria and click 'Find'
  7. If there are nodes in the hierarchy matching your search specification, you should see them returned in the Content pane within a "SearchNode"
  8. You can use the Back button in the Bridge browser window to return you to the previous context of your search.

Description

Shows how to implement an ExtensionHandler and ExtensionModel with customized search over a node hierarchy. This sample uses SearchDefinition, SearchCriteria, SearchSpecification and SearchCondition objects from the Bridge scripting DOM to implement the custom search features.

The getSearchDefinition() method in the script-defined ExtensionModel returns a SearchDefinition object, which Bridge uses to display a customized Find dialog. The Find dialog has 3 sections; the Source section, the Criteria section and the Results section.

The Source section shows the current thumbnail, at which to start the search.

In the Criteria section, each of the 3 elements is customized using SearchCriteria and Operand objects. Custom search field values include 'Custom String' and 'Custom Boolean'.

The Results section displays two custom check boxes, "SDKSearch: Search subfolders" and "SDKSearch: Search hidden files". If you select "SDKSearch: Search subfolders" the search is performed recursively through subfolders. (The other checkbox is not considered.)

This search only supports "OR" searches; you can expand it to include "AND" searches.

The script-defined node extensions are defined by two supporting classes, SDKSystem and SDKNode; see the documentation on these classes for more detail on their capabilities.

The run() function of this sample creates several nodes of the type SDKNode, and one manager (SDKSystem) object. It stores the node-identifying prefix and root node in the SDKSystem (manager) object.

The run() function also creates the ExtensionHandler object, whose definition includes the 'makeModel()' method, which Bridge uses to create the ExtensionModel object at node-display time. The run() function also registers the ExtensionHandler, associating it with the node-identifying prefix.

See the Adobe Bridge CS5 JavaScript Guide for more details of node-handling mechanisms you can implement.

See:

Defined in CustomSearchExtensionHandler.jsx


Field Summary
 String requiredContext
          The context in which this sample can run.
 
Constructor Summary
CustomSearchExtensionHandler()
           
 
Method Summary
 Boolean canRun()
           Determines whether sample can be run given current context.
 Object initModel(csModel, sys)
           Initialize the model and define the methods that this model supports
 Boolean run()
           Functional part of this sample, creates several nodes of the type SDKNode, and one manager (SDKSystem) object, which stores the node-identifying prefix and root node.

Field Detail

requiredContext

String requiredContext

Constructor Detail

CustomSearchExtensionHandler

CustomSearchExtensionHandler()

Method Detail

canRun

Boolean canRun()

initModel

Object initModel(csModel, sys)

run

Boolean run()

AdobeBridgeCS5SDK

http://www.adobe.com/devnet/bridge
Documentation generated by JSDoc on Tue Apr 27 10:21:34 2010