harvester/contentinfodb/inc/contentinfodbcommon.h
changeset 23 d4d56f5e7c55
equal deleted inserted replaced
20:556534771396 23:d4d56f5e7c55
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  SQL queries, tagname,macros.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CONTENTINFODBCOMMON_H_
       
    19 #define CONTENTINFODBCOMMON_H_
       
    20 
       
    21 #ifndef CONTENTINFODB_UNITTESTING
       
    22 #define CONTENTINFODB_CLASS(aClassName)
       
    23 #else
       
    24 #define CONTENTINFODB_CLASS(aClassName) class aClassName;
       
    25 #endif 
       
    26 
       
    27 #ifndef CONTENTINFODB_UNITTESTING
       
    28 #define CONTENTINFODB_FRIEND_CLASS(aClassName)
       
    29 #else
       
    30 #define CONTENTINFODB_FRIEND_CLASS(aClassName) friend class aClassName;
       
    31 #endif 
       
    32 
       
    33 #ifdef BUILD_CONTENTINFODB
       
    34 #define DECL_CONTENTINFODB Q_DECL_EXPORT
       
    35 #else
       
    36 #define DECL_CONTENTINFODB Q_DECL_IMPORT
       
    37 #endif
       
    38 
       
    39 //sql queries
       
    40 // sql query to create a master table
       
    41 #define QUERYCREATEMAINTABLE "create table maintable (name varchar(50) primary key,ins int default '0', bls int default '0',actionuri varchar(20),licon varchar(50),baseapp varchar(50),lname varchar(50),displayorder varchar(10),exceptionstring varchar(50),tsfile varchar(50),fieldmap varchar(20),indexcontentsize varchar(5),relevancy varchar(20),policy varchar(50),resultfirstline varchar(20))"
       
    42 
       
    43 // sql query to insert row into the mentioned table
       
    44 #define QUERYINSERTROW "INSERT INTO %1 (%2) values('%3')"
       
    45 
       
    46 //sql query to update the value on mentioned table and field
       
    47 #define QUERYUPDATEDATA "UPDATE %1 SET %2='%3' WHERE %4='%5'"
       
    48 
       
    49 //sql query to create activity uri table
       
    50 #define QUERYCREATEACTIONURITABLE "create table %1 (uristring varchar(300) primary key,licon varchar(50),lname varchar(50),uriref varchar(20),action varchar(20))"
       
    51 
       
    52 //sql query to create field map table
       
    53 #define QUERYCREATEFIELDMAPTABLE "create table %1 (field varchar(300) primary key,urilist varchar(50))"
       
    54 
       
    55 //sql query to create a table for field map values
       
    56 #define QUERYCREATEFIELDMAPSUBTABLE "create table %1 (auri varchar(20) primary key)"
       
    57 
       
    58 //sql query to create a table for firstline information
       
    59 #define QUERYCREATEFIRSTLINETABLE "create table %1 (field varchar(50) primary key)"
       
    60 
       
    61 //sql query to create a table for relevancy information
       
    62 #define QUERYCREATERELEVANCYTABLE "create table %1 (field varchar(50) primary key,boostvalue varchar(20))"
       
    63 
       
    64 #define QUERYDATARETRIVAL "SELECT %1 FROM %2 WHERE %3 ='%4'"
       
    65 
       
    66 #define QUERYPRIMARYKEYS "SELECT DISTINCT %1 FROM %2"
       
    67 
       
    68 #define QUERYFILTERDATA "SELECT %1 FROM %2 WHERE %3 LIKE '%%4%'"
       
    69 
       
    70 #define QUERYSORT "SELECT name FROM maintable ORDER BY displayorder"
       
    71 
       
    72 #define QUERYDELETE "DELETE FROM maintable WHERE name ='%1'"
       
    73 
       
    74 #define QUERYCOUNT "SELECT COUNT(*) FROM maintable"
       
    75 
       
    76 // Database info
       
    77 // master table name
       
    78 #define MAINTABLENAME "maintable"
       
    79 
       
    80 // connection name 
       
    81 #define CONNECTIONNAME "contentinfodb"
       
    82 
       
    83 //database type
       
    84 #define DATABASETYPE "QSQLITE"
       
    85 
       
    86 //path of contentinfo db
       
    87 #define DBNAME "c:\\private\\2001f6fb\\contentinfo.sq"
       
    88 
       
    89 //dynamic table creation
       
    90 #define DYNAMICTABLE "table%1"
       
    91 
       
    92 // xml tag name
       
    93 #define TAGPRIMARYKEY "name"
       
    94 #define TAGACTIONURI "actionuri"
       
    95 #define TAGACTIONURISTRING "uristring"
       
    96 #define TAGFIELDMAP "fieldmap"
       
    97 #define TAGRELEVANCY "relevancy"
       
    98 #define TAGFIELD "field"
       
    99 #define TAGURILIST "urilist"
       
   100 #define TAGAURI "auri" 
       
   101 #define TAGRESULTFIRSTLINE "resultfirstline"
       
   102 #define TAGBOOSTVALUE "boostvalue"
       
   103 #define TAGACTION "action"
       
   104 #define TAGLNAME "lname"
       
   105 #define TAGLICON "licon"
       
   106 #define TAGURIREF "uriref"
       
   107 
       
   108 #define PRIMARYVALUE "primary"
       
   109 #define SECONDARYVALUE "secondary"
       
   110 
       
   111 #endif /* CONTENTINFODBCOMMON_H_ */