intra-mart Accel Platform / ViewCreator Administrator Guide

«  Creating data reference   ::   Contents   ::   Link to an external page (complete list only)  »

Setting the Extraction Condition

Extraction condition can be set on “Edit Query” screen and “Edit Data Reference” screen of aggregate list.

“Search Settings” of aggregate list is a functionality that aims at quick retrieval of information for the user who is browsing the data reference.
“Extraction Condition” is a functionality that refines the information beforehand at administrator side which is not to be displayed to the user.

../../_images/apply_guide_1_1.png

Note

If multiple extraction conditions are set, the search is carried out with default “AND condition”.
“OR condition” can also be speficied by selecting “OR search”.


../../_images/apply_guide_1_2.png

Warning

OR search cannot be set in “Extraction condition” of aggregate list.

Note

The structure of SQL executed at the time of browsing data reference is as follows.

SELECT

    [Column list displayed on Edit Data reference screen]

FROM

   ( SELECT

       [Column list added to the query]

     FROM

       [Table added in query]

     WHERE

       [Extraction condition set in query]

   ) IM__QUERY__

WHERE

   [Extraction condition set in data reference]

As far as possible, data should be refined at the query stage to speed-up the SQL execution. However, it depends on the database implementation.
If multiple data references are created by sharing a single query, setting extraction condition for each data reference is better in some cases.
Carry out appropriate settings based on the usage.



../../_images/apply_guide_1_3.png

Along with fixed values, special values like dynamically changing values can also be set for extraction condition.

Parameter name Generated value
<%DYNAMIC_PARAMETER%>

This is used when parameter value is set through API.

Data reference cannot be created from a query which contains even a single extraction condition for which this parameter is set.

For details, refer jp.co.intra_mart.foundation.viewcreator.model.Query#execute.

<%ENCODING%> Encoding character string associated with login user at the time of SQL execution, is set.
<%LOCALE%> Locale character string associated with login user at the time of SQL execution, is set.
<%NOT_NULL%>

IS NOT NULL is set.

※ When this parameter is selected, select “Exactly matching” in “Extraction method” without fail.

<%NULL%>

IS NULL is set.

※ When this parameter is selected, select “Exactly matching” in “Extraction method” without fail.

<%SYSTEM_DATE(*)%>

System date at the time of SQL execution is set.

Character string is set as per the format wherein data of system date is specified.

Date data generated in character strings is passed to type conversion function prepared for each database.

※This parameter should be set in date format or time stamp format.

<%USER_ID%> Login user code at the time of SQL execution is set.

Note

  • <%SYSTEM_DATE%> can be used to specify time of previous day, an hour before etc..
Parameter <%SYSTEM_DATE(yyyy/MM/dd HH:mm)%> of system date is set at the time of execution.
However, + operator or - operator can be used in format character string part for description.

  • For setting 1 hour before the system date

<%SYSTEM_DATE(yyyy/MM/dd HH-1:mm)%>

  • For setting date previous to the system date

<%SYSTEM_DATE(yyyy/MM/dd-1 HH:mm)%>

※ Only + and - can be used in operators.

※ Do not enter space before or after the operator.

Select “Direct input” when complex condition is to be set.

../../_images/apply_guide_1_4.png

Arithmetic operator cannot be inserted if Direct input is selected.
Enter appropriate operators.

../../_images/apply_guide_1_5.png

WHERE clause can be specified directly.

Note

Dynamic parameter can be used for direct input as well.

Warning

In case of direct input, one needs to take precautions to ensure that tables or records are not corrupted.

Note

Original dynamic parameter can be created by editing the following files.

WEB-INF/conf/viewcreator-config.xml

<param>
  <param-name> Parameter Name </param-name>
  <class-name>jp.co.intra_mart.foundation.viewcreator.params.SystemParameter***</class-name>
</param>

Use only single byte capital letters and underscore in parameter name (value of <param-name> tag).

Specify implementation class of jp.co.intra_mart.foundation.viewcreator.SystemParameter interface in value of <class-name>.

E.g.)
public class SystemParameterLocale implements SystemParameter {

   @Override
   public String get(final String syskey) {
      final AccountContext context = Contexts.get(AccountContext.class);
      return context.getLocale().getLanguage();
   }
}

Note

Restart the server to reflect the changes.

«  Creating data reference   ::   Contents   ::   Link to an external page (complete list only)  »