Named Queries are pre-defined queries that allow users of Content Station and Smart Connection to quickly perform a search in Enterprise in order to locate particular files.
Users of Content Station and Smart Connection do this by choosing the Named Query in the Search Application (Content Station) or Smart Connection panel (Smart Connection).
Figure: The default Named Query named 'Templates' that is defined in Enterprise Server (A), appears as an option in the Search Application in Content Station (B).
Named Queries can be seen as static search templates that are made available by the system administrator to all users and which cannot be changed by the end user.
Components
A Named Query consists of the following components:
- Query name. Name of the query as it should appear in the client applications:
- The Search menu of the Smart Connection panel in InDesign or InCopy.
- The Search menu of the Search pane in Content Station.
- Comment. Optional administrator comment about the query, for reference purposes only.
- Interface. List of query parameters. Each parameter must start on a new line, respecting the following syntax:
<name>,<type> [,<default>] [,<list entries>]
- name. (Mandatory.) Name of the parameter. Displayed as pop-up help for the input field in the Smart Connection panel.
- type. (Mandatory.) Data type of parameter. Must be one of the following: string | bool | int | list
- default. (Optional.) Initial value of the parameter. Automatically filled-in the first time when the user selects this Named Query.
- list entries (Optional.) Only used when type is 'list'. Entries listed in combo box to allow user to make a selection. Each entry must be separated using slashes ( / ). When no default is set, the first entry is pre-selected.
-
Query SQL. The SQL statement for this Named Query. The parameters can be used inside the SQL with
<$parametername>
. For string values, this needs to be surrounded by double quotes ("). The name of the user executing the query can be used in the SQL statement as"$user"
.
Note: The SQL statement must contain the following:
|
- Check access. Defines if a check should be made whether or not the user has sufficient rights to access each returned file. If the user does not have sufficient rights, the file is not included in the search results.
Note: Enabling this option can have a negative impact on performance (longer waiting times for the user).
Example: Disable this option when it is known beforehand that all users are authorized the files, such as a query that locates all templates.
Figure: The default Named Query for locating all templates.
Creating a Named Query
Step 1. Access the Overview of Named Queries page.
Choose Named Queries in the Maintenance menu on the left side of the screen or on the Home page.
Step 2. Click New Query.
The Named Queries page appears.
Step 3. Fill out all details.
Note: Take note of the following:
|
Tip: To hide a Named Query client-side, start its name with a dot (for example .MyQuery).
Step 4. Click Update.
Code for the default queries
Below follows the full code for the default Named Queries 'Libraries' and 'Templates'.
Notes:
|
Libraries
Full code for the Libraries query, used for locating all InDesign Library files:
/*SELECT*/
select o.`id` as `ID`, o.`type` as `Type`, o.`name` as `Name`, o.`format` as `Format`, st.`state` as `State`, ul.`fullname` as `LockedBy`, p.`publication` as `Publication`, s.`section` as `Section`, o.`comment` as `Comment`, o.`routeto` as `RouteTo`, un.`fullname` as `Creator`, o.`format` as `Format`, um.`fullname` as `Modifier`, p.`id` as `PublicationId`, s.`id` as `SectionId`, st.`id` as `StateId`, st.`color` as `StateColor`, l.`lockoffline` as `LockForOffline`
/*FROM*/
from `smart_objects` o
/*JOINS*/
left join `smart_publications` p on (o.`publication` = p.`id`)
left join `smart_publsections` s on (o.`section` = s.`id`)
left join `smart_states` st on (o.`state` = st.`id`)
left join `smart_objectlocks` l on (o.`id` = l.`object`)
left join `smart_users` ul on (l.`usr` = ul.`user`)
left join `smart_users` um on (o.`modifier` = um.`user`)
left join `smart_users` un on (o.`creator` = un.`user`)
/*WHERE*/
where (o.`type` = 'Library')
Templates
Full code for the Templates query, used for locating all template files:
/*SELECT*/
select o.`id` as `ID`, o.`type` as `Type`, o.`name` as `Name`, o.`format` as `Format`, st.`state` as `State`, ul.`fullname` as `LockedBy`, p.`publication` as `Publication`, s.`section` as `Section`, o.`comment` as `Comment`, o.`routeto` as `RouteTo`, un.`fullname` as `Creator`, o.`format` as `Format`, um.`fullname` as `Modifier`, p.`id` as `PublicationId`, s.`id` as `SectionId`, st.`id` as `StateId`, st.`color` as `StateColor`, l.`lockoffline` as `LockForOffline`
/*FROM*/
from `smart_objects` o
/*JOINS*/
left join `smart_publications` p on (o.`publication` = p.`id`)
left join `smart_publsections` s on (o.`section` = s.`id`)
left join `smart_states` st on (o.`state` = st.`id`)
left join `smart_objectlocks` l on (o.`id` = l.`object`)
left join `smart_users` ul on (l.`usr` = ul.`user`)
left join `smart_users` um on (o.`modifier` = um.`user`)
left join `smart_users` un on (o.`creator` = un.`user`)
/*WHERE*/
where (o.`type` = 'LayoutTemplate' or o.`type` = 'ArticleTemplate' or o.`type` = 'LayoutModuleTemplate')
Comment
Do you have corrections or additional information about this article? Leave a comment! Do you have a question about what is described in this article? Please contact Support.
0 comments
Please sign in to leave a comment.