Difference between revisions of "Cgi/users/lookup/"
Line 11: | Line 11: | ||
** '''sql''' - Similar to file, but uses an SQL table to do the lookup. The table is specified by the CGI param "title" but will be prefixed with "ac_". So a title param of "badger" would lookup in table "ac_badger". This table must contain a column titled "value" containing lookup terms and a column titled "xml" containing an XML autocomplete block. | ** '''sql''' - Similar to file, but uses an SQL table to do the lookup. The table is specified by the CGI param "title" but will be prefixed with "ac_". So a title param of "badger" would lookup in table "ac_badger". This table must contain a column titled "value" containing lookup terms and a column titled "xml" containing an XML autocomplete block. | ||
** '''title_duplicates''' - This works only on the "title" field and warns of duplicates, rather than offering completion. | ** '''title_duplicates''' - This works only on the "title" field and warns of duplicates, rather than offering completion. | ||
+ | |||
+ | The file, simple_file, sql and simple_sql scripts may take a second CGI parameter, "mode". This may be set to "phrase" or "prefix". "phrase" is the default, and searches for the partial string anywhere withing the lookup value. If set to prefix then this only matches starting a the start of the lookup value. This is primarily useful for large SQL tables, if you've added an index to the "value" field. | ||
You can drop your own custom scripts into this directory. | You can drop your own custom scripts into this directory. |
Revision as of 16:15, 3 January 2007
These are scripts used by the autocomplete system in the workflow.
- eprints3/cgi/users/lookup
- event_by_name - Can only be linked from the event_name field. Looks up existing events with the same name and suggests them filling in other parts of the even data such as dates, location and type.
- file - This uses a file in eprints3/archives/ARCHIVEID/cfg/autocomplete/. The name of the file is specified in the CGI param "file". The format of the file is a set of lines. Each line contains a lookup string, a tab, and a chunk of XML. This XML is a single autocomplete block.
- journal_by_issn - Lookup journal details (issn, name, publisher) from the issn field. Looks at only records already in the repository.
- journal_by_name - Lookup journal details (issn, name, publisher) from the journal title field. Looks at only records already in the repository.
- name - Lookup the name of creators (and their email), uses existing creators.
- simple_file - As with "file" above, but just contains a list of lookup values, one of which may be selected to populate the current field only.
- simple_sql - As with SQL (see below), but just uses the "value" field to populate the current field only.
- sql - Similar to file, but uses an SQL table to do the lookup. The table is specified by the CGI param "title" but will be prefixed with "ac_". So a title param of "badger" would lookup in table "ac_badger". This table must contain a column titled "value" containing lookup terms and a column titled "xml" containing an XML autocomplete block.
- title_duplicates - This works only on the "title" field and warns of duplicates, rather than offering completion.
The file, simple_file, sql and simple_sql scripts may take a second CGI parameter, "mode". This may be set to "phrase" or "prefix". "phrase" is the default, and searches for the partial string anywhere withing the lookup value. If set to prefix then this only matches starting a the start of the lookup value. This is primarily useful for large SQL tables, if you've added an index to the "value" field.
You can drop your own custom scripts into this directory.