- In the Server Behaviors panel (Window >
Server Behaviors), click the Plus (+) button, and select New Server
Behavior.
- From the Document Type pop‑up menu, select the document
type that you are developing the server behavior for.
- In the Name box, enter a name for the server behavior.
- (Optional) To copy an existing server behavior to add
to the behavior you are creating, select the Copy Existing Server
Behavior option, and then select the server behavior in the Behavior
to Copy pop‑up menu. Click OK.
The Server Behavior Builder dialog box is displayed.
- To add a new code block, click the Plus (+) button, enter
a name for the code block, and click OK.
The name you enter appears in the Server Behavior Builder,
with the appropriate scripting tags visible in the Code block box.
- In the Code Block box, enter the run-time code necessary
to implement the server behavior.
Note: When entering code in the Code Block box, you can only
insert a single tag or code block for each named code block (for
example, myBehavior_block1, myBehavior_block2, myBehavior_blockn,
etc.). If you have to enter multiple tags or code blocks, create
an individual code block for each one. You can also copy and paste code
from other pages.
- Place the insertion point in the code block where you’d
like to insert the parameter, or select a string to replace with
a parameter.
- Click the Insert Parameters in Code Block button.
- Enter a name for the parameter in the Parameter Name
box (for example, Session), and click OK.
The parameter is inserted into the code block at the location
where you placed the insertion point prior to defining the parameter.
If you selected a string, every instance of the selected string
in the code block is replaced with a parameter marker (for example, @@Session@@).
- Select an option from the Insert Code pop‑up menu specifying
where to embed the code blocks.
- (Optional) To specify additional information about the
server behavior, click the Advanced button.
- To create more code blocks, repeat steps 5 through 11.
- If the server behavior requires that parameters be supplied
to it, you must create a dialog box that accepts parameters from
the person applying the behavior. See the link below.
- After you perform the required steps to create the server
behavior, click OK.
The Server Behaviors panel lists the server behavior.
- Test the server behavior and ensure that it functions
properly.