filter


NAME

filter - create/edit Communiware filters from web interface


DESCRIPTION

Web interface to Communiware filters. Requires Superuser rights. Allows to edit all attribute of filter, create new filters, test filters, analyze their execution plans and delete (only if no templates reference this filter).


FIELDS

Here we give description of all fields in script form.

Name
Keeps name of current edited filter. If you change value in this field and then push Save button, then filter will be saved under new name.

Clean form for new filter creating
This button clears all form fields (except Testing context one). If you want to create new filter ``starting from nothing'' then you shall begin from pushing this button.

Go to filter
This button and following dropdown menu applied for opening another existing filter for editing. You shall choose needed filter in the menu and then push the button.

Query
Full filter text (including surrounding brackets) is entered in this field.

Enable rewritting
Value of this checkbox plays role for SQL-filters only. Selected checkbox allows to rewrite SQL-filter text for extracting additional attributes and changing sort order.

Arguments
This field gives information about arguments of edited filter. It has two possible syntax variants - one for ``usual'' unifilters and another - for SQL-filters.

On case of unifilters this field contains names of parameters separated by comma. Names of these parameters are not valuable, only number of them is important. So values in this field VAL1,VAL2 and PUBLISHED,TITLE are totally equally. An asterisk, *, can be set as the last argument name. Meaning of this is: all the rest of arguments.

On case of SQL filters names of arguments are significal, values of these context attributes will be substituted as paremeters of select request.

Values for testing
The field contains values of filter arguments for testing. The field Arguments sets number of arguments, and this field - thier values.

Attributes for extracting
Filter may not only select items set, but extract some required items attributes too. This field set the names of attributes which must be extracted by filter as well as sort order of extracted items. Names of extracted attributes are splitted by commas. Ascending sort order is set by prepending '+' sign before attribute name, and descending sort oredr - by '-' sign.

Thus value of this field

 TITLE,+EMAIL,-UIN

means that we want to extract TITLE, EMAIL and UIN attributes and returned set of items must be sorted by EMAIL ascending and UIN descending.

Testing context
This field sets the context for testing (surprise?). Context is, as usually, set of named values. The most important of them are ITEM_ID, AUTHOR_ID and SERVER. The script tries to determine values of these attributes from its own execution context - from cookies and query string in url. But it is possible to redefine these attributes as well as define another ones by filling this field.

Value in the Testing context field has following syntax:

 ATTRNAME=ATTRVALUE
 ATTRNAME=VALUE1,VALUE2 LIST/
 ATTRNAME=VALUE1,VALUE2 LIST/TYPE

Everything placed in the line after first '=' sign is treated as attribute value. List value of the attribute can be set by adding LIST/ or LIST/TYPE in the end of line. TYPE is one of communiware data types: NUMBER, DATE, STRING or RICHTEXT. Without explicitely given type script tries to determine type of argument by its name.

Comma signs in attribute value must be written as \, with backslash before comma itself.

Test
This button runs filter with given parameters and in set context. Translated SQL-query is printed also. If filter returns non-empty set of items then the table with returned data is printed.

Limit test output to
If filter returns to many items it is not convinient to get all data in one big chunk. This fild sets maximum number of records showed in one page. If filter returns more items then buttons for ``paging'' forth and back are printed above and below results table.

Execution plan
Script filter allows to learn how the SQL-server will execute the filter. After pushing this button script outputs server-specific data telling about qury execution plan. Thus you should study your SQL-server (Oracle or PostgreSQL) manual for completely understand this output.

Here is the example of execution plan of some filter under PostgreSQL:

 Hash Join  (cost=4.83..7.45 rows=1 width=48)
  ->  Seq Scan on item  (cost=0.00..2.41 rows=41 width=24)
  ->  Hash  (cost=4.83..4.83 rows=1 width=24)
        ->  Index Scan using passive_rel on item_rel
              item_rel_1 (cost=0.00..4.83 rows=1 width=24)

Comment
The field contains random comment to script, for example about its purpose and arguments.

Save
After pushing this button all changes made during filter editing will be stored into Communiware database. The field Name must not be empty during filter saving.

Convert to SQL
Pushing this button converts ``usual'' unifilter to SQL-filter. SQL text is written into Query field. It is possible, that this text and / or values in other fields will require further editing.

Delete filter
This button is present if only there are no templates used this filter. It completely deletes filter from database. Be careful!

16 октябрь 2007 13:45