< Day Day Up > |
These tags and attributes are valid within the EDML participant files. <participant>Description This tag contains all the specifications for a single participant. Parent None. Type Block tag. Required Yes. <participant> attributesThe following items are valid attributes of the participant tag. versionDescription This attribute defines which version of Dreamweaver server behavior processing the current server behavior targets. For Dreamweaver 8, the version number is 7. If no version is specified, Dreamweaver assumes version 7. For this release of Dreamweaver, all groups and participants that the Server Behavior Builder creates have the version attribute set to 7.0. NOTE The participant version attribute overrides the group version attribute if they are different. But, the participant file will use the group version attribute if the participant does not specify one. For participant files, this attribute determines if code-block merging should occur. For participants without this attribute (or have it set to 4 or earlier), the inserted code blocks are not merged with other code blocks on the page. Participants that have this set to version 5 or later are merged with other code blocks on the page when possible. Please note that code-block merging occurs only for participants above and below the HTML tag. Parent participant Type Attribute. Required No. <quickSearch>Description This tag is a simple search string that is used for performance reasons. It cannot be a regular expression. If the string is found in the current document, the rest of the search patterns are called to locate specific instances. This string can be empty to always use the search patterns. Parent participant Type Block tag. Required No. Value The searchString value is a literal string that exists on the page if the participant exists. The string should be as unique as possible to maximize performance, but the string does not have to be definitively unique. It is not case-sensitive, but be careful with nonessential spaces that can be changed by the user, as shown in the following example: <quickSearch>Response.Redirect</quickSearch> If the quickSearch tag is empty, it is considered to match, and more precise searches use the regular expressions that are defined in the searchPattern tags. This is helpful if a simple string cannot be used to express a reliable search pattern and regular expressions are required. <insertText>Description This tag provides information about what to insert in the document and where to insert it. It contains the text to insert. Parts of the text that are customized should be indicated by using the @@parameterName@@ format. In some cases, such as a translator-only participant, you might not need this tag. Parent implementation Type Block tag. Required No. Value The value is the text to insert in the document. If any parts of the text need customizing, they can be passed in later as parameters. Parameters should be embedded within two at (@@) signs. Because this text can interfere with the EDML structure, it should use the CDATA construct, as shown in the following example: <insertText location="aboveHTML"> <![CDATA[<%= @@recordset@@).cursorType %>]]> </insertText> When the text is inserted, the @@recordset@@ parameter is replaced by a recordset name that the user supplies. For more information on conditional and repeating code blocks, see the "Adding Custom Server Behaviors" chapter in Getting Started with Dreamweaver <insertText> attributesThe following items are valid attributes of the insertText tag. locationDescription This attribute specifies where the participant text should be inserted. The insert location is related to the whereToSearch attribute of the searchPatterns tag, so be sure to set both carefully (see whereToSearch on page 353). Parent insertText Type Attribute. Required Yes. Values aboveHTML[+weight], belowHTML[+weight], beforeSelection, replaceSelection, wrapSelection, afterSelection, beforeNode, replaceNode, afterNode, firstChildOfNode, lastChildOfNode, nodeAttribute[+attribute]
NOTE For the location="nodeAttribute" attribute value, the last search pattern determines where the attribute starts and ends. Make sure that the last pattern finds the entire statement. nodeParamNameDescription This attribute is used only for node-relative insert locations. It indicates the name of the parameter that passes the node in at insertion time. Parent insertText Type Attribute. Required This attribute is required only if the insert location contains the word node. Value The tagtype__Tag value is a user-specified name for the node parameter that passes with the parameter object to the dwscripts.applySB() function. For example, if you insert some text into a form, you might use a form__tag parameter. In your server behavior applyServerBehavior() function, you could use the form__tag parameter to indicate the exact form to update, as shown in the following example: function applyServerBehavior(ssRec) { var paramObj = new Object(); paramObj.rs = getRecordsetName(); paramObj.form__tag = getFormNode(); dwscripts.applySB(paramObj, sbObj); } You can indicate the form__tag node parameter in your EDML file, as shown in the following example: <insertText location="lastChildOfNode" nodeParamName="form__tag"> <![CDATA[<input type="hidden" name="MY_DATA">]]> </insertText> The text is inserted as the lastChildOfNode value, and the specific node passes in using the form__tag property of the parameter object. <searchPatterns>Description This tag provides information about finding the participant text in the document, and it contains a list of patterns that are used when searching for a participant. If multiple search patterns are defined, they must all be found within the text being searched (the search patterns have a logical AND relationship), unless they are marked as optional using the isOptional flag. Parent implementation Type Block tag. Required No. <searchPatterns> attributesThe following items are valid attributes of the searchPatterns tag. whereToSearchDescription This attribute specifies where to search for the participant text. This attribute is related to the insert location, so be sure to set each attribute carefully (see "location" on page 349). Parent searchPatterns Type Attribute. Required Yes. Values directive, tag+tagName, tag+*, comment, text
<searchPattern>Description This tag is a pattern that identifies participant text and extracts parameter values from it. Each parameter subexpression must be enclosed in parentheses (). You can have patterns with no parameters (which are used to identify participant text), patterns with one parameter, or patterns with many parameters. All non-optional patterns must be found, and each parameter must be named and found exactly once. For more information about using the searchPattern tag, see "Finding server behaviors" on page 369. Parent searchPatterns Type Block tag. Required Yes. Values searchString, /regularExpression/, <empty>
<searchPattern> attributesThe following items are valid attributes of the searchPattern tag. paramNamesDescription This attribute is a comma-separated list of parameter names whose values are being extracted. These parameters are assigned in the order of the subexpression. You can assign single parameters or use a comma-separated list to assign multiple parameters. If other parenthetical expressions are used but do not indicate parameters, extra commas can be used as placeholders in the Parameter Name list. The parameter names should match the ones that are specified in the insertion text and the update parameters. Parent searchPattern Type Attribute. Required Yes. Values paramName1, paramName2, ... Each parameter name should be the exact name of a parameter that is used in the insertion text. For example, if the insertion text contains @@p1@@, you should define exactly one parameter with that name: <searchPattern paramNames="p1">patterns</searchPattern> To extract multiple parameters using a single pattern, use a comma-separated list of parameter names, in the order that the subexpressions appear in the pattern. Suppose the following example shows your search pattern: <searchPattern paramName="p1,,p2">/(\w+)_(BIG|SMALL)_(\w+)/</searchPattern> There are two parameters (with some text in between them) to extract. Given the text: <%= a_BIG_b %>, the first subexpression in the search pattern matches "a", so p1="a". The second subexpression is ignored (note the ,, in the paramName value). The third subexpression matches "b", so p2="b". limitSearchDescription This attribute limits the search to some part of the whereToSearch tag. Parent searchPattern Type Attribute. Required No. Values all, attribute+attribName, tagOnly, innerOnly
isOptionalDescription This attribute is a flag that indicates that the search pattern is not required to find the participant. This is useful for complex participants that might have non-critical parameters to extract. You can create some patterns for distinctly identifying a participant and have some optional patterns for extracting non-critical parameters. Parent searchPattern Type Attribute. Required No. Values true, false
For example, consider the following simple recordset string: <% var Recordset1 = Server.CreateObject("ADODB.Recordset"); Recordset1.ActiveConnection = "dsn=andescoffee;"; Recordset1.Source = "SELECT * FROM PressReleases"; Recordset1.CursorType = 3; Recordset1.Open(); %> The search patterns must identify the participant and extract several parameters. However, if a parameter such as cursorType is not found, you should still recognize this pattern as a recordset. The cursor parameter is optional. In the EDML, the search patterns might look like the following example: <searchPattern paramNames="rs">/var (\w+) = Server.CreateObject/ </searchPattern> <searchPattern paramNames="src">/ActiveConnection = "([^\r\n]*)"/</searchPattern> <searchPattern paramNames="conn">/Source = "([^\r\n]*)"/</searchPattern> <searchPattern paramNames="cursor" isOptional="true">/CursorType = (\d+)/ </searchPattern> The first three patterns are required to identify the recordset. If the last parameter is not found, the recordset is still identified. <updatePatterns>Description This optional advanced feature lets you update the participant precisely. Without this tag, the participant is updated automatically by replacing the entire participant text each time. If you specify an <updatePatterns> tag, it must contain specific patterns to find and replace each parameter within the participant. This tag is beneficial if the user edits the participant text. It performs precise updates only to the parts of the text that need changing. Parent implementation Type Block tag. Required No. <updatePattern>Description This tag is a specific type of regular expression that lets you update participant text precisely. There should be at least one update pattern definition for every unique parameter that is declared in the insertion text (of the form @@paramName@@). Parent updatePatterns Type Block tag. Required Yes (at least one, if you declare the updatePatterns tag). Values The value is a regular expression that finds a parameter between two parenthetical subexpressions, in the form /(pre-pattern)parameter-pattern(post-pattern)/. You need to define at least one update pattern for each unique @@paramName@@ in the insertion text. The following example shows how your insertion text might look: <insertText location="afterSelection"> <![CDATA[<%= @@rs@@.Field.Items("@@col@@") %>]]> </insertText> A particular instance of the insertion text on a page might look like the following example: <%= RS1.Field.Items("author_id") %> There are two parameters, rs and col. To update this text after you insert it on the page, you need two update pattern definitions: <updatePattern paramName="rs" > /(\b)\w+(\.Field\.Items)/ </updatePattern> <updatePattern paramName="col"> /(\bItems\(")\w+("\))/ </updatePattern> The literal parentheses, as well as other special regular expression characters, are escaped by preceding them with a backslash (\). The middle expression, defined as \w+, is updated with the latest value that passed in for parameters "rs" and "col", respectively. The values "RS1" and "author_id" can be precisely updated with new values. Multiple occurrences of the same pattern can be updated simultaneously by using the regular expression global flag "g" after the closing slash (such as /pattern/g). If the participant text is long and complex, you might need multiple patterns to update a single parameter, as shown in the following example: <% ... Recordset1.CursorType = 0; Recordset1.CursorLocation = 2; Recordset1.LockType = 3; %> To update the recordset name in all three positions, you need three update patterns for a single parameter, as shown in the following example: <updatePattern paramName="rs"> /(\b)\w+(\.CursorType)/ </updatePattern> <updatePattern paramName="rs"> /(\b)\w+(\.CursorLocation)/ </updatePattern> <updatePattern paramName="rs"> /(\b)\w+(\.LockType)/ </updatePattern> Now you can pass in a new value for the recordset, and it is precisely updated in three locations. <updatePattern> attributesThe following items are valid attributes of the updatePattern tag. paramNameDescription This attribute indicates the name of the parameter whose value is used to update the participant. This parameter should match the ones that are specified in the insertion text and search parameters. Parent updatePattern Type Attribute. Required Yes. Values The value is the exact name of a parameter that is used in the insertion text. In the following example, if the insertion text contains an @@rs@@ value, you should have a parameter with that name: <updatePattern paramName="rs">pattern</updatePattern> <delete>Description This tag is an optional advanced feature lets you control how to delete a participant. Without this tag, the participant is deleted by removing it completely but only if no server behaviors refer to it. By specifying a <delete> tag, you can specify that it should never be deleted or that only portions should be deleted. Parent implementation Type Tag. Required No. <delete> attributesThe following items are valid attributes of the delete tag. deleteTypeDescription This attribute is used to indicate the type of delete to perform. It has different meanings, depending on whether the participant is a directive, a tag, or an attribute. By default, the entire participant is deleted. Parent delete Type Attribute. Required No. Values all, none, tagOnly, innerOnly, attribute+attribName, attribute+*
If your server behavior converts selected text into a link, you can remove the link by removing the outer tag only, as shown in the following example: <delete deleteType="tagOnly"/> This example changes a link participant from <A HREF="...">HELLO</A> to HELLO. <translator>Description This tag provides information for translating a participant so that it can be rendered differently and have a custom Property inspector. Parent implementation Type Block tag. Required No. <searchPatterns>Description This tag lets Dreamweaver find each specified instance in a document. If multiple search patterns are defined, they must all be found within the text being searched (the search patterns have a logical AND relationship), unless they are marked as optional using the isOptional flag. Parent translator Type Block tag. Required Yes. <translations>Description This tag contains a list of translation instructions where each instruction indicates where to search for the participant and what to do with the participant. Parent translator Type Block tag. Required No. <translation>Description This tag contains a single translation instruction that includes the location for the participant, what type of translation to perform, and the content that should replace the participant text. Parent translations Type Block tag. Required No. <translation> attributesThe following items are valid attributes of the translation tag. whereToSearchDescription This attribute specifies where to search for the text, which is related to the insert location, so be sure to set each location carefully (see "location" on page 349). Parent translation Type Attribute. Required Yes. limitSearchDescription This attribute limits the search to some part of the whereToSearch tag. Parent translation Type Attribute. Required No. translationTypeDescription This attribute indicates the type of translation to perform. These types are preset and give the translation specific functionality. For example, if you specify "dynamic data", any data that is translated should behave the same as Dreamweaver dynamic data; that is, it should have the dynamic data placeholder look in the Design view (curly braces ({}) notation with dynamic background color) and appear in the Server Behaviors panel. Parent translation Type Attribute. Required Yes. Values dynamic data, dynamic image, dynamic source, tabbed region start, tabbed region end, custom
<openTag>Description This optional tag can be inserted at the beginning of the translation section. This tag lets certain other extensions, such as custom Property inspectors, find the translation. Parent translation Type Block tag. Required No. Values The tagName value is a valid tag name. It should be unique to prevent conflicts with known tag types. For example, if you specify <openTag>MM_DYNAMIC_CONTENT</openTag> the dynamic data is translated to the MM_DYNAMIC_CONTENT tag. <attributes>Description This tag contains a list of attributes to add to the translated tag that is specified by the openTag tag. Alternatively, if the openTag tag is not defined and the searchPattern tag specifies tag, this tag contains a list of translated attributes to add to the tag that is found. Parent translation Type Block tag. Required No. <attribute>Description This tag specifies a single attribute (or translated attribute) to add to the translated tag. Parent attributes Type Block tag. Required Yes (at least one). Values The attributeName="attributeValue" specification sets an attribute to a value. Typically, the attribute name is fixed, and the value contains some parameter references that are extracted by the parameter patterns, as shown in the following example: <attribute>SOURCE="@@rs@@"</attribute> <attribute>BINDING="@@col@@"</attribute> or <attribute> mmTranslatedValueDynValue="VALUE={@@rs@@.@@col@@}" </attribute> <display>Description This tag is an optional display string that should be inserted in the translation. Parent translation Type Block tag. Required No. Values The displayString value is any string comprising text and HTML. It can include parameter references that are extracted by the parameter patterns. For example, <display>{@@rs@@.@@col@@}</display> causes the translation to render as {myRecordset.myCol}. <closeTag>Description This optional tag should be inserted at the end of the translated section. This tag enables certain other extensions, such as custom Property inspectors, to find the translation. Parent translation Type Block tag. Required No. Values The tagName value is a valid tag name; it should match a translation openTag tag. Example If you specify the value <closeTag>MM_DYNAMIC_CONTENT</closeTag>, the dynamic data is translated to end with the </MM_DYNAMIC_CONTENT> tag. |
< Day Day Up > |