--- a/harvester/harvesterserver/group/harvesterserver.mmp Mon Apr 19 14:40:16 2010 +0300
+++ b/harvester/harvesterserver/group/harvesterserver.mmp Mon May 03 13:33:22 2010 +0300
@@ -28,21 +28,28 @@
END
USERINCLUDE ../inc
-USERINCLUDE ../../../searchengine/cpix/cpix/inc/public //TODO: Needs to be changed
+USERINCLUDE ../../../searchengine/cpix/cpix/inc/public
+USERINCLUDE ../traces
MW_LAYER_SYSTEMINCLUDE
SOURCEPATH ../src
SOURCE CHarvesterServer.cpp
SOURCE CHarvesterServerSession.cpp
-SOURCE CIndexingManager.cpp CBlacklistMgr.cpp CBlacklistDb.cpp
+SOURCE CIndexingManager.cpp
+SOURCE CBlacklistMgr.cpp
+SOURCE CBlacklistDb.cpp
+SOURCE ccontentinfodb.cpp
+SOURCE contentinfomgr.cpp
+SOURCE ccontentinfo.cpp
LIBRARY euser.lib
-LIBRARY estor.lib
-LIBRARY efsrv.lib
+LIBRARY estor.lib
+LIBRARY efsrv.lib
LIBRARY CPixSearchClient.lib
-LIBRARY CPixHarvesterPluginInterface.lib
+LIBRARY CPixHarvesterPluginInterface.lib
LIBRARY edbms.lib
+LIBRARY sqldb.lib
// Logging
LIBRARY flogger.lib
--- a/harvester/harvesterserver/inc/cblacklistmgr.h Mon Apr 19 14:40:16 2010 +0300
+++ b/harvester/harvesterserver/inc/cblacklistmgr.h Mon May 03 13:33:22 2010 +0300
@@ -20,7 +20,8 @@
#define CBLACKLISTMGR_H
#include <e32base.h>
-#include "CBlacklistDb.h"
+
+class CBlacklistDb;
class CBlacklistMgr : public CBase
{
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/inc/ccontentinfo.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This component is to store the details of harvester plugins
+*
+*/
+#ifndef CCONTENTINFO_H_
+#define CCONTENTINFO_H_
+
+#include <e32base.h>
+
+class CContentInfo : public CBase
+ {
+public :
+ /*
+ * Construction
+ * @return instance of CContentInfo
+ */
+ static CContentInfo* NewL();
+
+ /*
+ * Construction
+ * @return instance of CContentInfo
+ */
+ static CContentInfo* NewLC();
+ //Destructor
+ ~CContentInfo();
+
+private :
+ /*
+ * Default constructor
+ */
+ CContentInfo();
+
+public:
+ /*
+ * @description Returns the name of the content( This is the display
+ * name given in the corresponding plugin RSS file).
+ * @return the descriptor containing the name of the content and it
+ * is the responsibility of the caller to free the allocated memory
+ * Leaves in case of errors.
+ */
+ HBufC* GetNameL();
+
+ /*
+ * @description Returns the Indexing status of the content.
+ * @return the Indexing status of the content
+ */
+ TInt GetIndexStatus();
+
+ /*
+ * @description Returns the Blacklist status of the content.
+ * @return ETrue if the plugin is blacklisted else returns EFalse
+ */
+ TBool GetBlacklistStatus();
+
+ /*
+ * @description Sets the name of the content.
+ * @Param aName is the name of the content
+ * Leaves in case of errors.
+ */
+ void SetNameL( const TDesC& aName );
+
+ /*
+ * @description Sets the Indexing status of the content.
+ * @Param aIndexStatus is the Indexing status of the content
+ */
+ void SetIndexStatus( const TInt aIndexStatus );
+
+ /*
+ * @description Sets the Blacklisting status of the content.
+ * @Param aBlacklistStatus is the Blacklisting status of the content
+ */
+ void SetBlacklistStatus( const TBool aBlacklistStatus );
+
+private:
+ /*
+ * Name of the content.owned
+ */
+ HBufC* iContentName;
+ /*
+ * Indexing status
+ */
+ TInt iIndexStatus;
+ /**
+ * Blacklist status
+ */
+ TBool iBlacklistStatus;
+ };
+
+#endif /* CCONTENTINFO_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/inc/ccotentinfodb.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This component is to store the details of harvester plugins
+*
+*/
+
+#ifndef CCOTENTINFODB_H_
+#define CCOTENTINFODB_H_
+
+#include <e32base.h>
+#include <f32file.h>
+#include <sqldb.h>
+
+class CContentInfo;
+
+class CContentInfoDb : public CBase
+ {
+public :
+ /*
+ * Construction
+ * @return instance of CContentInfo database
+ */
+ static CContentInfoDb* NewL();
+
+ /*
+ * Construction
+ * @return instance of CContentInfo database
+ */
+ static CContentInfoDb* NewLC();
+ //Destructor
+ virtual ~CContentInfoDb();
+
+private :
+ /*
+ * Default constructor
+ */
+ CContentInfoDb();
+
+ /*
+ * Second phase constructor
+ */
+ void ConstructL();
+
+public :
+ /*
+ * @description Adds the given details of a plugin to the contentinfo DB.
+ * @param aContentInfo name,Indexing status,blacklist status of the plugin
+ * @return sysmbian error code
+ * Leaves in case of errors.
+ */
+ TInt AddL( CContentInfo* aContentInfo );
+
+ /*
+ * @description Updates the blacklsit status of the plugin.
+ * @param aContentName name of the plugin
+ * @param aBlacklistStatus blacklist status of plugin
+ * @return sysmbian error code
+ * Leaves in case of errors.
+ */
+ TInt UpdateBlacklistStatusL( const TDesC& aContentName , TInt aBlacklistStatus );
+
+ /*
+ * @description Updates the enable status of the plugin.
+ * @param aContentName name of the plugin
+ * @param aIndexStatus Indexing status of plugin
+ * @return sysmbian error code
+ * Leaves in case of errors.
+ */
+ TInt UpdatePluginIndexStatusL( const TDesC& aContentName , TInt aIndexStatus );
+
+ /*
+ * @description Removes the given details of a plugin from the contentInfo DB.
+ * @param aContentName name of the plugin
+ * Leaves in case of errors.
+ */
+ void RemoveL( const TDesC& aContentName );
+
+ /*
+ * @description Removes all the rows in the database.
+ * Leaves in case of errors.
+ */
+ void ResetDatabaseL( );
+
+ /*
+ * @description Returns the count of the content in content info DB
+ * @return content count
+ * Leaves in case of errors.
+ */
+ TInt GetContentCountL( );
+
+ /*
+ * @description Checks if the plugin details is present in the database.
+ * @param aContentName name of the plugin
+ * Leaves in case of errors.
+ */
+ TBool FindL(const TDesC& aContentName);
+
+
+private :
+ /*
+ * @description Creates the ContentInfo sql database.
+ * Leaves in case of errors.
+ */
+ void CreateDBL();
+
+private:
+ /*
+ * Database to maintain the details of ContentInfo plugin.Owned
+ */
+ RSqlDatabase iDatabase;
+ /**
+ * Flag for, whether database has been opened
+ */
+ TBool iOpened;
+ };
+
+#endif /* CCOTENTINFODB_H_ */
--- a/harvester/harvesterserver/inc/cindexingmanager.h Mon Apr 19 14:40:16 2010 +0300
+++ b/harvester/harvesterserver/inc/cindexingmanager.h Mon May 03 13:33:22 2010 +0300
@@ -25,6 +25,7 @@
const TInt KFilePluginBaseAppClassMaxLen = 64;
//Forward Declaration
class CBlacklistMgr;
+class CContentInfoMgr;
class CIndexingManager : public CActive, public MIndexingService
{
@@ -199,6 +200,8 @@
TTime iPreviousRun;
/* Database to maintain blacklisted plugins.Owned */
CBlacklistMgr* iBlacklistMgr;
+ /* Database to maintain the content info all the plugins.owned*/
+ CContentInfoMgr* iContentInfoMgr;
};
#endif // CINDEXINGMANAGER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/inc/contentinfomgr.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This component is to store the details of harvester plugins
+*
+*/
+
+#ifndef CONTENTINFOMGR_H_
+#define CONTENTINFOMGR_H_
+
+#include <e32base.h>
+
+class CContentInfoDb;
+class CContentInfo;
+
+class CContentInfoMgr : public CBase
+ {
+public :
+ /*
+ * Construction
+ * @return instance of Contentinfo manager
+ */
+ static CContentInfoMgr* NewL();
+
+ /*
+ * Construction
+ * @return instance of content info manager
+ */
+ static CContentInfoMgr* NewLC();
+
+ //Destructor
+ ~CContentInfoMgr();
+
+private :
+ /*
+ * Default constructor
+ */
+ CContentInfoMgr();
+
+ /*
+ * Second phase constructor
+ */
+ void ConstructL();
+
+public :
+ /*
+ * @description Adds the given details of a plugin to the contentinfo DB.
+ * status will be set as 1(Not Blacklisted)
+ * @param aContentInfo name,indexing status,blacklist status of content
+ * @return sysmbian error code
+ * Leaves in case of errors.
+ */
+ TInt AddL( CContentInfo* aContentInfo );
+
+ /*
+ * @description Updates the blacklsit status of the plugin.
+ * @param aContentName name of the plugin
+ * @param aBlacklistStatus blacklist status of plugin
+ * @return sysmbian error code
+ * Leaves in case of errors.
+ */
+ TInt UpdateBlacklistStatusL( const TDesC& aContentName , TInt aBlacklistStatus );
+
+ /*
+ * @description Updates the enable status of the plugin.
+ * @param aContentName name of the plugin
+ * @param aIndexStatus Indexing status of plugin
+ * @return sysmbian error code
+ * Leaves in case of errors.
+ */
+ TInt UpdatePluginIndexStatusL( const TDesC& aContentName , TInt aIndexStatus );
+
+ /*
+ * @description Finds whether the given plugin exists in the
+ * database or not.
+ * @param aContentName name of the plugin
+ * @retutn ETrue if exists else returns EFalse
+ * Leaves in case of errors.
+ */
+ TBool FindL( const TDesC& aContentName );
+
+ /*
+ * @description Removes the given details of a plugin from the contentInfo DB.
+ * @param aContentName name of the plugin
+ * Leaves in case of errors.
+ */
+ void RemoveL( const TDesC& aContentName );
+
+ /*
+ * @description Removes all the rows in the database
+ * Leaves in case of errors.
+ */
+ void ResetL( );
+
+ /*
+ * @description Returns the count of the content in content info DB
+ * @return content count
+ * Leaves in case of errors.
+ */
+ TInt GetContentCountL( );
+
+private:
+ /*
+ * Interface to contentinfo database.Owned
+ */
+ CContentInfoDb* iContentInfoDb;
+ };
+
+#endif /* CONTENTINFOMGR_H_ */
--- a/harvester/harvesterserver/src/cblacklistdb.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/harvester/harvesterserver/src/cblacklistdb.cpp Mon May 03 13:33:22 2010 +0300
@@ -18,6 +18,11 @@
#include "CBlacklistDb.h"
#include <HarvesterServerLogger.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cblacklistdbTraces.h"
+#endif
+
_LIT(KBlacklistFileName,"Blacklist.dat");
@@ -42,10 +47,12 @@
//
CBlacklistDb* CBlacklistDb::NewL()
{
+ OstTraceFunctionEntry0( CBLACKLISTDB_NEWL_ENTRY );
CPIXLOGSTRING("CBlacklistDb::NewL(): Entered");
CBlacklistDb* instance = CBlacklistDb::NewLC();
CleanupStack::Pop( instance );
CPIXLOGSTRING("CBlacklistDb::NewL(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTDB_NEWL_EXIT );
return instance;
}
@@ -87,6 +94,7 @@
//
void CBlacklistDb::ConstructL()
{
+ OstTraceFunctionEntry0( CBLACKLISTDB_CONSTRUCTL_ENTRY );
CPIXLOGSTRING("CBlacklistDb::ConstructL(): Entered");
//Open the sql database.If doesn't exist,create the sql database and open it
User::LeaveIfError( iFs.Connect() );
@@ -116,6 +124,7 @@
if ( error == KErrNone )
{
iOpened = ETrue;
+ OstTrace0( TRACE_NORMAL, CBLACKLISTDB_CONSTRUCTL, "CBlacklistDb::ConstructL(): Database Opened" );
CPIXLOGSTRING("CBlacklistDb::ConstructL(): Database Opened");
}
}
@@ -126,6 +135,7 @@
}
CPIXLOGSTRING("CBlacklistDb::ConstructL(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTDB_CONSTRUCTL_EXIT );
return;
}
@@ -135,7 +145,9 @@
//
TInt CBlacklistDb::AddL( TInt32 aPluginUid , TInt aVersion )
{
+ OstTraceFunctionEntry0( CBLACKLISTDB_ADDL_ENTRY );
//Add the item record to database
+ OstTraceExt2( TRACE_NORMAL, CBLACKLISTDB_ADDL, "CBlacklistDb::AddL;Uid=%x;Version=%d", aPluginUid, aVersion );
CPIXLOGSTRING3("CBlacklistDb::AddL(): Uid = %x and Version = %d" , aPluginUid , aVersion);
if ( !iOpened )
@@ -166,6 +178,7 @@
CleanupStack::PopAndDestroy( &dbView ); // dbView/
User::LeaveIfError( iDatabase.Compact() );
CPIXLOGSTRING("CBlacklistDb::AddL(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTDB_ADDL_EXIT );
return err;
}
@@ -175,6 +188,8 @@
//
void CBlacklistDb::Remove( TInt32 aPluginUid )
{
+ OstTraceFunctionEntry0( CBLACKLISTDB_REMOVE_ENTRY );
+ OstTrace1( TRACE_NORMAL, CBLACKLISTDB_REMOVE, "CBlacklistDb::Remove;Uid=%x", aPluginUid );
CPIXLOGSTRING2("CBlacklistDb::RemoveL(): Uid = %x " , aPluginUid);
if ( !iOpened )
@@ -189,13 +204,16 @@
TInt rowCount( iDatabase.Execute(sql) );
if(rowCount > 0)
{
+ OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTDB_REMOVE, "CBlacklistDb::RemoveL(): Removed UID succesfully" );
CPIXLOGSTRING("CBlacklistDb::RemoveL(): Removed UID succesfully");
}
else
{
+ OstTrace0( TRACE_NORMAL, DUP2_CBLACKLISTDB_REMOVE, "CBlacklistDb::RemoveL(): UID not found" );
CPIXLOGSTRING("CBlacklistDb::RemoveL(): UID not found");
}
CPIXLOGSTRING("CBlacklistDb::RemoveL(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTDB_REMOVE_EXIT );
return ;
}
@@ -205,6 +223,7 @@
//
TBool CBlacklistDb::FindWithVersionL( TInt32 aPluginUid , TInt aVersion )
{
+ OstTraceExt2( TRACE_NORMAL, CBLACKLISTDB_FINDWITHVERSIONL, "CBlacklistDb::FindWithVersionL;Uid=%x;Version=%d", aPluginUid, aVersion );
CPIXLOGSTRING3("CBlacklistDb::FindWithVersionL(): Uid = %x and Version = %d" , aPluginUid , aVersion);
if ( !iOpened )
@@ -233,6 +252,7 @@
TInt version = dbView.ColInt32( versioncolno );
if ( version == aVersion)
{
+ OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTDB_FINDWITHVERSIONL, "CBlacklistDb::FindWithVersionL(): UID found" );
CPIXLOGSTRING("CBlacklistDb::FindWithVersionL(): UID found");
found = ETrue;
}
@@ -247,7 +267,9 @@
//
TInt CBlacklistDb::UpdateL( TInt32 aPluginUid , TInt aVersion )
{
+ OstTraceFunctionEntry0( CBLACKLISTDB_UPDATEL_ENTRY );
//Add the item record to database
+ OstTraceExt2( TRACE_NORMAL, CBLACKLISTDB_UPDATEL, "CBlacklistDb::UpdateL;Uid=%x;Version=%d", aPluginUid, aVersion );
CPIXLOGSTRING3("CBlacklistDb::UpdateL(): Uid = %x and Version = %d" , aPluginUid , aVersion);
if ( !iOpened )
@@ -288,6 +310,7 @@
CleanupStack::PopAndDestroy( &dbView ); // dbView/
User::LeaveIfError( iDatabase.Compact() );
CPIXLOGSTRING("CBlacklistDb::UpdateL(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTDB_UPDATEL_EXIT );
return KErrNone;
}
@@ -297,6 +320,7 @@
//
TBool CBlacklistDb::FindL(TInt32 aPluginUid)
{
+ OstTrace1( TRACE_NORMAL, CBLACKLISTDB_FINDL, "CBlacklistDb::FindL;Uid=%x", aPluginUid );
CPIXLOGSTRING2("CBlacklistDb::FindL(): Uid = %x " , aPluginUid );
if ( !iOpened )
@@ -318,6 +342,7 @@
if ( isAtRow )
{
+ OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTDB_FINDL, "CBlacklistDb::FindL(): UID found" );
CPIXLOGSTRING("CBlacklistDb::FindL(): UID found");
found = ETrue;
}
@@ -330,6 +355,7 @@
//
void CBlacklistDb::CreateDBL()
{
+ OstTraceFunctionEntry0( CBLACKLISTDB_CREATEDBL_ENTRY );
CPIXLOGSTRING("CBlacklistDb::CreateDBL(): Enter");
iDatabase.Close();
@@ -350,6 +376,7 @@
CleanupStack::PopAndDestroy( columns );
CPIXLOGSTRING("CBlacklistDb::CreateDBL(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTDB_CREATEDBL_EXIT );
}
// -----------------------------------------------------------------------------
@@ -358,6 +385,7 @@
//
CDbColSet* CBlacklistDb::CreateColumnSetLC()
{
+ OstTraceFunctionEntry0( CBLACKLISTDB_CREATECOLUMNSETLC_ENTRY );
CPIXLOGSTRING("CBlacklistDb::CreateColumnSetLC(): Enter");
CDbColSet* columns = CDbColSet::NewLC();
@@ -375,5 +403,6 @@
CPIXLOGSTRING("CBlacklistDb::CreateColumnSetLC(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTDB_CREATECOLUMNSETLC_EXIT );
return columns; // columns stays on CleanupStack
}
--- a/harvester/harvesterserver/src/cblacklistmgr.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/harvester/harvesterserver/src/cblacklistmgr.cpp Mon May 03 13:33:22 2010 +0300
@@ -16,7 +16,13 @@
*/
#include "CBlacklistMgr.h"
+#include "CBlacklistDb.h"
#include <HarvesterServerLogger.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cblacklistmgrTraces.h"
+#endif
+
// -----------------------------------------------------------------------------
// CBlacklistMgr::NewL()
@@ -24,10 +30,12 @@
//
CBlacklistMgr* CBlacklistMgr::NewL()
{
+ OstTraceFunctionEntry0( CBLACKLISTMGR_NEWL_ENTRY );
CPIXLOGSTRING("CBlacklistMgr::NewL(): Entered");
CBlacklistMgr* instance = CBlacklistMgr::NewLC();
CleanupStack::Pop( instance );
CPIXLOGSTRING("CBlacklistMgr::NewL(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTMGR_NEWL_EXIT );
return instance;
}
@@ -67,9 +75,11 @@
//
void CBlacklistMgr::ConstructL()
{
+ OstTraceFunctionEntry0( CBLACKLISTMGR_CONSTRUCTL_ENTRY );
CPIXLOGSTRING("CBlacklistMgr::ConstructL(): Entered");
iBlacklistDb = CBlacklistDb::NewL();
CPIXLOGSTRING("CBlacklistMgr::ConstructL(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTMGR_CONSTRUCTL_EXIT );
}
// -----------------------------------------------------------------------------
@@ -78,7 +88,9 @@
//
TInt CBlacklistMgr::AddL( TUid aPluginUid , TInt aVersion )
{
+ OstTraceFunctionEntry0( CBLACKLISTMGR_ADDL_ENTRY );
//Add the item record to database
+ OstTraceExt2( TRACE_NORMAL, CBLACKLISTMGR_ADDL, "CBlacklistMgr::AddL;Uid=%x;Version=%d", aPluginUid.iUid, aVersion );
CPIXLOGSTRING3("CBlacklistMgr::AddL(): Uid = %x and Version = %d" , aPluginUid.iUid , aVersion);
//Check if the record with given plugin uid is already available in database or not
//If available just update version number in the same record
@@ -96,6 +108,7 @@
}
CPIXLOGSTRING("CBlacklistMgr::AddL(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTMGR_ADDL_EXIT );
return err;
}
@@ -105,11 +118,14 @@
//
void CBlacklistMgr::Remove( TUid aPluginUid )
{
+ OstTraceFunctionEntry0( CBLACKLISTMGR_REMOVE_ENTRY );
+ OstTrace1( TRACE_NORMAL, CBLACKLISTMGR_REMOVE, "CBlacklistMgr::Remove;Uid=%x", aPluginUid.iUid );
CPIXLOGSTRING2("CBlacklistMgr::RemoveL(): Uid = %x " , aPluginUid.iUid );
//Remove the item record to database
iBlacklistDb->Remove( aPluginUid.iUid );
CPIXLOGSTRING("CBlacklistMgr::RemoveL(): Exit");
+ OstTraceFunctionExit0( CBLACKLISTMGR_REMOVE_EXIT );
}
// -----------------------------------------------------------------------------
@@ -118,16 +134,19 @@
//
TBool CBlacklistMgr::FindL( TUid aPluginUid , TInt aVersion )
{
+ OstTraceExt2( TRACE_NORMAL, CBLACKLISTMGR_FINDL, "CBlacklistMgr::FindL;Uid=%x;Version=%d", aPluginUid.iUid, aVersion );
CPIXLOGSTRING3("CBlacklistMgr::FindL(): Uid = %x and Version = %d" , aPluginUid.iUid , aVersion);
//Check if the item is available in database
TBool found = iBlacklistDb->FindWithVersionL( aPluginUid.iUid , aVersion );
if(found)
{
+ OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTMGR_FINDL, "UID is Black listed" );
CPIXLOGSTRING("UID is Black listed");
}
else
{
+ OstTrace0( TRACE_NORMAL, DUP2_CBLACKLISTMGR_FINDL, "UID is not Black listed" );
CPIXLOGSTRING("UID is not Black listed");
}
return found;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/src/ccontentinfo.cpp Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ccontentinfo.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "ccontentinfoTraces.h"
+#endif
+
+
+// -----------------------------------------------------------------------------
+// CContentInfo::NewL()
+// -----------------------------------------------------------------------------
+//
+CContentInfo* CContentInfo::NewL()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFO_NEWL_ENTRY );
+ CContentInfo* instance = CContentInfo::NewLC();
+ CleanupStack::Pop( instance );
+ OstTraceFunctionExit0( CCONTENTINFO_NEWL_EXIT );
+ return instance;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfo::NewLC()
+// -----------------------------------------------------------------------------
+//
+CContentInfo* CContentInfo::NewLC()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFO_NEWLC_ENTRY );
+ CContentInfo* instance = new (ELeave) CContentInfo();
+ CleanupStack::PushL( instance );
+ OstTraceFunctionExit0( CCONTENTINFO_NEWLC_EXIT );
+ return instance;
+ }
+// -----------------------------------------------------------------------------
+// CContentInfo::CContentInfo()
+// -----------------------------------------------------------------------------
+//
+CContentInfo::CContentInfo()
+ {
+ //Do necessary initialization here
+ }
+// -----------------------------------------------------------------------------
+// CContentInfo::~CContentInfo()
+// -----------------------------------------------------------------------------
+//
+CContentInfo::~CContentInfo()
+ {
+ delete iContentName;
+ }
+// -----------------------------------------------------------------------------
+// CContentInfo::GetNameL()
+// -----------------------------------------------------------------------------
+//
+HBufC* CContentInfo::GetNameL()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFO_GETNAMEL_ENTRY );
+ HBufC* contentname = NULL;
+ if ( iContentName->Length() )
+ {
+ contentname = iContentName->AllocL();
+ }
+ OstTraceFunctionExit0( CCONTENTINFO_GETNAMEL_EXIT );
+ return contentname;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfo::GetIndexStatusL()
+// -----------------------------------------------------------------------------
+//
+TInt CContentInfo::GetIndexStatus()
+ {
+ return iIndexStatus;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfo::GetBlacklistStatusL()
+// -----------------------------------------------------------------------------
+//
+TInt CContentInfo::GetBlacklistStatus()
+ {
+ return iBlacklistStatus;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfo::SetNameL()
+// -----------------------------------------------------------------------------
+//
+void CContentInfo::SetNameL( const TDesC& aName )
+ {
+ OstTraceFunctionEntry0( CCONTENTINFO_SETNAMEL_ENTRY );
+ if ( iContentName )
+ {
+ delete iContentName;
+ iContentName = NULL;
+ }
+
+ iContentName = HBufC::NewL( aName.Length() );
+ iContentName->Des().Copy( aName );
+ OstTraceFunctionExit0( CCONTENTINFO_SETNAMEL_EXIT );
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfo::SetIndexStatusL()
+// -----------------------------------------------------------------------------
+//
+void CContentInfo::SetIndexStatus( const TInt aIndexStatus )
+ {
+ iIndexStatus = aIndexStatus;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfo::SetBlacklistStatusL()
+// -----------------------------------------------------------------------------
+//
+void CContentInfo::SetBlacklistStatus( const TBool aBlacklistStatus )
+ {
+ iBlacklistStatus = aBlacklistStatus;
+ }
+//EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/src/ccontentinfodb.cpp Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,334 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ccotentinfodb.h"
+#include "ccontentinfo.h"
+#include <cpixcontentinfocommon.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "ccontentinfodbTraces.h"
+#endif
+
+
+// The max length for creating sql query for KCISqlFormatSeek format
+const TInt KCISqlStringMaxLength(100);
+//SQL query to fetch the records with given Plugin name
+_LIT(KCISqlFormatSeek , "SELECT * FROM table1 WHERE NAME='%S'");
+//SQL query to delete the records with given plugin name
+_LIT(KCISqlDelete, "DELETE FROM table1 WHERE NAME='%S'");
+//Syntax for adding a row to sql database
+_LIT(KInsertRowFormat,"INSERT INTO table1(NAME,INS,BLS) values('%S',%d,%d)");
+//syntax to retrieve all the rows from the sql database
+_LIT(KSelectAllRowsFormat,"SELECT * FROM table1");
+//syntax to update Index status for a given plugin
+_LIT(KUpdateISFormat,"UPDATE table1 SET INS=%d WHERE NAME = '%S'");
+//syntax to update Blacklist status for a given plugin
+_LIT(KUpdateBSFormat,"UPDATE table1 SET BLS=%d WHERE NAME = '%S'");
+_LIT(KDriveC, "c:");
+//syntax for removing all the records in the table
+_LIT(KRemoveAll, "DELETE FROM table1" );
+//syntax for creating table with plugin name, indexing status and blacklist status as the columns
+_LIT(KCreateTableFormat,"CREATE TABLE table1(NAME TEXT NOT NULL, INS INTEGER, BLS INTEGER, PRIMARY KEY(NAME))");
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::NewL()
+// -----------------------------------------------------------------------------
+//
+CContentInfoDb* CContentInfoDb::NewL()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_NEWL_ENTRY );
+ CContentInfoDb* instance = CContentInfoDb::NewLC();
+ CleanupStack::Pop( instance );
+ OstTraceFunctionExit0( CCONTENTINFODB_NEWL_EXIT );
+ return instance;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::NewLC()
+// -----------------------------------------------------------------------------
+//
+CContentInfoDb* CContentInfoDb::NewLC()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_NEWLC_ENTRY );
+ CContentInfoDb* instance = new (ELeave) CContentInfoDb();
+ CleanupStack::PushL( instance );
+ instance->ConstructL();
+ OstTraceFunctionExit0( CCONTENTINFODB_NEWLC_EXIT );
+ return instance;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::CContentInfoDb()
+// -----------------------------------------------------------------------------
+//
+CContentInfoDb::CContentInfoDb()
+ {
+ //Do the necessary initialisation
+ iOpened = EFalse;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::~CContentInfoDb
+// -----------------------------------------------------------------------------
+//
+CContentInfoDb::~CContentInfoDb()
+ {
+ iDatabase.Close();
+ }
+
+// -----------------------------------------------------------------------------
+// CBlacklistDb::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CContentInfoDb::ConstructL()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_CONSTRUCTL_ENTRY );
+ //Open the sql database.If doesn't exist,create the sql database and open it
+ RFs fssession;
+ User::LeaveIfError( fssession.Connect() );
+ TFileName privatePath;
+ TFileName datafile;
+ fssession.CreatePrivatePath(EDriveC);
+ fssession.PrivatePath(privatePath);//data caged path of loading process
+ fssession.Close();
+ datafile.Copy(KDriveC);
+ datafile.Append(privatePath);
+ datafile.Append( KContentInfoFileName );
+
+ TInt err = iDatabase.Open( datafile );
+
+ switch ( err )
+ {
+ case KErrNone:
+ iOpened = ETrue;
+ break;
+
+ case KErrNotFound:
+ case KErrPathNotFound:
+ {
+ //Create the database
+ TRAPD( error , CreateDBL() );
+
+ if ( error == KErrNone )
+ {
+ iOpened = ETrue;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ OstTraceFunctionExit0( CCONTENTINFODB_CONSTRUCTL_EXIT );
+ return;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::AddL()
+// -----------------------------------------------------------------------------
+//
+TInt CContentInfoDb::AddL( CContentInfo* aContentInfo )
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_ADDL_ENTRY );
+ //Add the item record to database
+
+ if ( !iOpened )
+ return KErrNotReady;
+
+ //Prepare the sql
+ TBuf<KCISqlStringMaxLength> sql;
+ HBufC* contentname = aContentInfo->GetNameL();
+
+ TInt indexstatus = aContentInfo->GetIndexStatus();
+ TBool blstatus = aContentInfo->GetBlacklistStatus();
+ sql.Format( KInsertRowFormat , contentname , indexstatus , blstatus );
+
+ TInt err = iDatabase.Exec(sql) ;
+
+ delete contentname;
+ OstTraceFunctionExit0( CCONTENTINFODB_ADDL_EXIT );
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::UpdateBlacklistStatusL
+// -----------------------------------------------------------------------------
+//
+TInt CContentInfoDb::UpdateBlacklistStatusL( const TDesC& aContentName , TInt aBlacklistStatus )
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_UPDATEBLACKLISTSTATUSL_ENTRY );
+ //Update the item record to database
+ if ( !iOpened )
+ return KErrNotReady;
+
+ //Prepare the sql
+ TBuf<KCISqlStringMaxLength> sql;
+ sql.Format( KUpdateBSFormat , aBlacklistStatus, &aContentName );
+
+ TInt err = iDatabase.Exec(sql) ;
+
+ OstTraceFunctionExit0( CCONTENTINFODB_UPDATEBLACKLISTSTATUSL_EXIT );
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::UpdatePluginIndexStatusL
+// -----------------------------------------------------------------------------
+//
+TInt CContentInfoDb::UpdatePluginIndexStatusL( const TDesC& aContentName , TInt aIndexStatus )
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_UPDATEPLUGININDEXSTATUSL_ENTRY );
+ //Update the item record to database
+
+ if ( !iOpened )
+ return KErrNotReady;
+
+ //Prepare the sql
+ TBuf<KCISqlStringMaxLength> sql;
+ sql.Format( KUpdateISFormat , aIndexStatus, &aContentName );
+
+ TInt err = iDatabase.Exec(sql) ;
+
+ OstTraceFunctionExit0( CCONTENTINFODB_UPDATEPLUGININDEXSTATUSL_EXIT );
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::RemoveL
+// -----------------------------------------------------------------------------
+//
+void CContentInfoDb::RemoveL( const TDesC& aContentName )
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_REMOVEL_ENTRY );
+ //remove the item record to database
+
+ if ( !iOpened )
+ User::Leave( KErrNotReady );
+
+ //Prepare the sql
+ TBuf<KCISqlStringMaxLength> sql;
+ sql.Format( KCISqlDelete , &aContentName );
+
+ User::LeaveIfError( iDatabase.Exec(sql) );
+ OstTraceFunctionExit0( CCONTENTINFODB_REMOVEL_EXIT );
+ return ;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::ResetDatabaseL
+// -----------------------------------------------------------------------------
+//
+void CContentInfoDb::ResetDatabaseL( )
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_RESETDATABASEL_ENTRY );
+ //remove all the item record to database
+
+ if ( !iOpened )
+ User::Leave( KErrNotReady );
+
+ //Prepare the sql
+ TBuf<KCISqlStringMaxLength> sql;
+ sql.Copy( KRemoveAll );
+
+ User::LeaveIfError( iDatabase.Exec(sql) );
+
+ OstTraceFunctionExit0( CCONTENTINFODB_RESETDATABASEL_EXIT );
+ return ;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::FindL
+// -----------------------------------------------------------------------------
+//
+TBool CContentInfoDb::FindL(const TDesC& aContentName)
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_FINDL_ENTRY );
+ if ( !iOpened )
+ User::Leave( KErrNotReady );
+
+ //Prepare the sql
+ TBuf<KCISqlStringMaxLength> sql;
+ sql.Format( KCISqlFormatSeek, &aContentName );
+
+ RSqlStatement stmt;
+ stmt.Prepare( iDatabase , sql );
+
+ TBool isfound = ( KSqlAtRow == stmt.Next() )?ETrue:EFalse;
+ OstTraceFunctionExit0( CCONTENTINFODB_FINDL_EXIT );
+ return isfound;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::GetContentCountL
+// -----------------------------------------------------------------------------
+//
+TInt CContentInfoDb::GetContentCountL()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_GETCONTENTCOUNTL_ENTRY );
+ if ( !iOpened )
+ User::Leave( KErrNotReady );
+
+ TInt count = 0;
+
+ //Prepare the sql
+ TBuf<KCISqlStringMaxLength> sql;
+ sql.Copy( KSelectAllRowsFormat );
+
+ RSqlStatement stmt;
+ stmt.Prepare( iDatabase , sql );
+
+ while ( KSqlAtEnd != stmt.Next() )
+ ++count;
+
+ OstTraceFunctionExit0( CCONTENTINFODB_GETCONTENTCOUNTL_EXIT );
+ return count;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoDb::CreateDBL
+// -----------------------------------------------------------------------------
+//
+void CContentInfoDb::CreateDBL()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFODB_CREATEDBL_ENTRY );
+
+ iDatabase.Close();
+
+ TFileName privatePath;
+ TFileName datafile;
+ RFs fssession;
+ User::LeaveIfError( fssession.Connect() );
+ fssession.CreatePrivatePath(EDriveC);
+ fssession.PrivatePath(privatePath);//data caged path of loading process
+ fssession.Close();
+ datafile.Copy(KDriveC);
+ datafile.Append(privatePath);
+ datafile.Append( KContentInfoFileName );
+
+ //create the database
+ User::LeaveIfError( iDatabase.Create( datafile ) );
+
+ //Add table
+ TBuf<KCISqlStringMaxLength> sql;
+ sql.Copy( KCreateTableFormat );
+
+ User::LeaveIfError( iDatabase.Exec( sql ) );
+
+ OstTraceFunctionExit0( CCONTENTINFODB_CREATEDBL_EXIT );
+ }
+//EOF
--- a/harvester/harvesterserver/src/cindexingmanager.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/harvester/harvesterserver/src/cindexingmanager.cpp Mon May 03 13:33:22 2010 +0300
@@ -20,6 +20,13 @@
#include "CIndexingManager.h"
#include "HarvesterServerLogger.h"
#include "CBlacklistMgr.h"
+#include "contentinfomgr.h"
+#include "ccontentinfo.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cindexingmanagerTraces.h"
+#endif
+
_LIT(KManagerFileName, "CPixConfig.bin");
const TInt KManagerFileVersion = 1;
@@ -38,8 +45,9 @@
// changed to future) update harvesters start and complete times. This value is
// default difference in RunL calls with additional buffer.
const TInt KMaxTimeDifference = 1 + KDefaultWaitTimeInMinutes;
-
-
+//constants for enable and disable status
+const TInt KEnable = 1;
+const TInt KDisable = 0;
// -----------------------------------------------------------------------------
// CHarvesterServer::NewL()
// -----------------------------------------------------------------------------
@@ -91,6 +99,8 @@
iFs.Close();
delete iBlacklistMgr;
+
+ delete iContentInfoMgr;
}
// -----------------------------------------------------------------------------
@@ -122,12 +132,16 @@
//instantiate blacklist database
iBlacklistMgr = CBlacklistMgr::NewL();
+ //Instantiate Contentinfo manager
+ iContentInfoMgr = CContentInfoMgr::NewL();
// Load plugins
LoadPluginsL();
//release the Blacklist manager as the blacklist functionality is done
delete iBlacklistMgr;
+ //release the content info manager as all the content details of all plugins are stored
+ delete iContentInfoMgr;
StartPlugins();
@@ -159,6 +173,7 @@
{
// Take next harvester from the list to be run
+ OstTrace0( TRACE_NORMAL, CINDEXINGMANAGER_RUNL, "CIndexingManager::RunL" );
CPIXLOGSTRING("CIndexingManager::RunL() ");
// If system time is changed update harvester last complete and start time accordingly.
@@ -172,6 +187,7 @@
if ( err == KErrNone && iPreviousRun.Int64() != 0 &&
( timeDifference.Int() < KMinTimeDifference || timeDifference.Int() > KMaxTimeDifference ) )
{
+ OstTrace0( TRACE_NORMAL, DUP1_CINDEXINGMANAGER_RUNL, "CIndexingManager::RunL() time changed. Update harvester completion and start times" );
CPIXLOGSTRING("CIndexingManager::RunL() time changed. Update harvester completion and start times");
for (TInt i=0; i<iHarvesterArray.Count(); i++)
{
@@ -186,6 +202,7 @@
// Do nothing if already harvesting
if (iState != EStateRunning)
{
+ OstTrace0( TRACE_NORMAL, DUP2_CINDEXINGMANAGER_RUNL, "CIndexingManager::RunL() the indexing manager is not running anymore" );
CPIXLOGSTRING("CIndexingManager::RunL() the indexing manager is not running anymore ");
return;
}
@@ -197,12 +214,15 @@
switch (iHarvesterArray[i].iStatus)
{
case EHarvesterStatusWaiting:
+ OstTraceExt1( TRACE_NORMAL, DUP3_CINDEXINGMANAGER_RUNL, "CIndexingManager::RunL;<%S>, waiting for scheduling..", iHarvesterArray[i].iQualifiedBaseAppClass );
CPIXLOGSTRING2("CIndexingManager::RunL(): <%S>, waiting for scheduling...", &iHarvesterArray[i].iQualifiedBaseAppClass);
break;
case EHarvesterStatusHibernate:
+ OstTraceExt1( TRACE_NORMAL, DUP4_CINDEXINGMANAGER_RUNL, "CIndexingManager::RunL;<%S>, hibernating..", iHarvesterArray[i].iQualifiedBaseAppClass );
CPIXLOGSTRING2("CIndexingManager::RunL(): <%S>, hibernating.", &iHarvesterArray[i].iQualifiedBaseAppClass);
break;
case EHarvesterStatusRunning:
+ OstTraceExt1( TRACE_NORMAL, DUP5_CINDEXINGMANAGER_RUNL, "CIndexingManager::RunL;<%S>, running...", iHarvesterArray[i].iQualifiedBaseAppClass );
CPIXLOGSTRING2("CIndexingManager::RunL(): <%S>, running...", &iHarvesterArray[i].iQualifiedBaseAppClass);
break;
}
@@ -210,6 +230,7 @@
TTimeIntervalMinutes mins_last_start;
timenow.MinutesFrom(iHarvesterArray[i].iLastComplete, mins_last_complete);
timenow.MinutesFrom(iHarvesterArray[i].iLastStart, mins_last_start);
+ OstTraceExt2( TRACE_NORMAL, DUP6_CINDEXINGMANAGER_RUNL, "CIndexingManager::RunL;^^^Previous start %d min ago;Previous complete %d min ago", mins_last_start.Int(), mins_last_complete.Int() );
CPIXLOGSTRING3("CIndexingManager::RunL(): ^^^ previous start %d mins ago, previous complete %d mins ago.", mins_last_start.Int(), mins_last_complete.Int());
if (iHarvesterArray[i].iStatus == EHarvesterStatusRunning)
@@ -237,12 +258,14 @@
// Consider handling the leave in ::RunError instead.
// Run the harvester
+ OstTraceExt1( TRACE_NORMAL, DUP7_CINDEXINGMANAGER_RUNL, "CIndexingManager::RunL;Starting harvesting <%S>.", iHarvesterArray[i].iQualifiedBaseAppClass );
CPIXLOGSTRING2("CIndexingManager::RunL(): Starting harvesting <%S>.", &iHarvesterArray[i].iQualifiedBaseAppClass);
TRAPD(err, iHarvesterArray[i].iPlugin->StartHarvestingL(iHarvesterArray[i].iQualifiedBaseAppClass));
// No need to continue, if something was already started
if (err == KErrNone)
{
+ OstTrace0( TRACE_NORMAL, DUP8_CINDEXINGMANAGER_RUNL, "CIndexingManager::RunL(): Successfully started harvesting." );
CPIXLOGSTRING("CIndexingManager::RunL(): Successfully started harvesting. ");
break;
}
@@ -252,6 +275,7 @@
iHarvesterArray[i].iError = err;
// Do not run it again, unless CIndexingMgr informed to do so
iHarvesterArray[i].iStatus = EHarvesterStatusHibernate;
+ OstTrace1( TRACE_NORMAL, DUP9_CINDEXINGMANAGER_RUNL, "CIndexingManager::RunL;Error %d in starting harvesting", err );
CPIXLOGSTRING2("CIndexingManager::RunL(): Error %d in starting harvesting. ", err);
}
}
@@ -287,6 +311,11 @@
//FFLOGSTRING2( "CFastFindHarvesterPluginControl:: PLUGINS COUNT %d", count );
CIndexingPlugin* plugin = NULL;
+ TInt contentcount(iContentInfoMgr->GetContentCountL() );
+ // If the content count in the content info DB is not equal to the plugin count, reset the content info DB
+ if ( contentcount != count)
+ iContentInfoMgr->ResetL();
+
for ( TInt i = 0; i < count; i++ )
{
TUid uid = infoArray[i]->ImplementationUid(); // Create the plug-ins
@@ -295,12 +324,30 @@
plugin = NULL;
TBool pluginblacklisted = EFalse;
- pluginblacklisted = iBlacklistMgr->FindL( uid , version );
+ pluginblacklisted = iBlacklistMgr->FindL( uid , version );
+
+ TBool iscontentfound = iContentInfoMgr->FindL( infoArray[i]->DisplayName() );
+
+ if( !iscontentfound )
+ {
+ //Add the content details to database
+ CContentInfo* contentinfo = CContentInfo::NewL();
+ contentinfo->SetNameL( infoArray[i]->DisplayName() );
+ contentinfo->SetBlacklistStatus( KEnable );
+ contentinfo->SetIndexStatus( KEnable );
+ iContentInfoMgr->AddL( contentinfo );
+ delete contentinfo;
+ }
+ else
+ {
+ iContentInfoMgr->UpdateBlacklistStatusL( infoArray[i]->DisplayName() , KEnable );
+ }
if ( !pluginblacklisted )
{
// Plugin is not black listed. Add it to database and try to load the plugin
iBlacklistMgr->AddL( uid , version );
+ OstTrace1( TRACE_NORMAL, CINDEXINGMANAGER_LOADPLUGINSL, "CIndexingManager::LoadPluginsL;Plugin with uid=%x is added to DB", uid.iUid );
CPIXLOGSTRING2("CIndexingManager::LoadPluginsL(): Plugin with uid = %x is added to database", uid.iUid);
TRAPD( err, plugin = CIndexingPlugin::NewL( uid ) );
//FFLOGSTRING2( "CFastFindHarvesterPluginControl:: ERROR %d", err );
@@ -308,12 +355,15 @@
{
// Plugin loaded succesfully. Remove it from the database
iBlacklistMgr->Remove(uid);
+ OstTrace1( TRACE_NORMAL, DUP1_CINDEXINGMANAGER_LOADPLUGINSL, "CIndexingManager::LoadPluginsL;Plugin with uid=%x is removed from DB", uid.iUid );
CPIXLOGSTRING2("CIndexingManager::LoadPluginsL(): Plugin with uid = %x is removed from database", uid.iUid);
+ iContentInfoMgr->UpdateBlacklistStatusL( infoArray[i]->DisplayName() , KDisable );
CleanupStack::PushL( plugin );
plugin->SetObserver( *this );
plugin->SetSearchSession( iSearchSession );
iPluginArray.AppendL( plugin ); // and add them to array
CleanupStack::Pop( plugin );
+ OstTrace1( TRACE_NORMAL, DUP2_CINDEXINGMANAGER_LOADPLUGINSL, "CIndexingManager::LoadPluginsL;Plugin with uid=%x is loaded successfully", uid.iUid );
CPIXLOGSTRING2("CIndexingManager::LoadPluginsL(): Plugin with uid = %x is loaded succesfully", uid.iUid);
}
}
@@ -347,6 +397,7 @@
const TDesC& aQualifiedBaseAppClass,
TBool aForceReharvest)
{
+ OstTraceExt1( TRACE_NORMAL, CINDEXINGMANAGER_ADDHARVESTINGQUEUE, "CIndexingManager::AddHarvestingQueue;Queuing requested for <%S>", aQualifiedBaseAppClass );
CPIXLOGSTRING2("CIndexingManager::AddHarvestingQueue(): Queuing requested for <%S>.", &aQualifiedBaseAppClass);
// Find if this harvesting task already exists
@@ -363,6 +414,7 @@
iHarvesterArray[i].iStatus = EHarvesterStatusWaiting;
if (aForceReharvest)
{
+ OstTrace0( TRACE_NORMAL, DUP1_CINDEXINGMANAGER_ADDHARVESTINGQUEUE, "CIndexingManager::AddHarvestingQueue(): Needs Reharvesting." );
CPIXLOGSTRING("CIndexingManager::AddHarvestingQueue(): Needs Reharvesting.");
// iLastCompete Time is reset so that will be reharvested as soon
// as possible
@@ -371,6 +423,7 @@
iHarvesterArrayChanged = ETrue;
}
}
+ OstTrace0( TRACE_NORMAL, DUP2_CINDEXINGMANAGER_ADDHARVESTINGQUEUE, "CIndexingManager::AddHarvestingQueue(): Harvester already in the queue." );
CPIXLOGSTRING("CIndexingManager::AddHarvestingQueue(): Harvester already in the queue.");
return;
}
@@ -384,6 +437,7 @@
if (iState == EStateRunning)
iTimer.Cancel();
+ OstTrace0( TRACE_NORMAL, DUP3_CINDEXINGMANAGER_ADDHARVESTINGQUEUE, "CIndexingManager::AddHarvestingQueue(): Harvester added successfully to the queue." );
CPIXLOGSTRING("CIndexingManager::AddHarvestingQueue(): Harvester added successfully to the queue.");
}
@@ -393,6 +447,7 @@
//
void CIndexingManager::RemoveHarvestingQueue(CIndexingPlugin* aPlugin, const TDesC& aQualifiedBaseAppClass)
{
+ OstTraceExt1( TRACE_NORMAL, CINDEXINGMANAGER_REMOVEHARVESTINGQUEUE, "CIndexingManager::RemoveHarvestingQueue;De-Queuing requested for <%S>", aQualifiedBaseAppClass );
CPIXLOGSTRING2("CIndexingManager::RemoveHarvestingQueue(): De-queuing requested for <%S>.", &aQualifiedBaseAppClass);
// Find if this harvesting task exists
@@ -407,11 +462,13 @@
// No need to set iHarvesterArrayChanged when changing the status only (which is not saved)
iHarvesterArray[i].iStatus = EHarvesterStatusHibernate;
}
+ OstTrace0( TRACE_NORMAL, DUP1_CINDEXINGMANAGER_REMOVEHARVESTINGQUEUE, "CIndexingManager::RemoveHarvestingQueue(): Harvester de-queued successfully." );
CPIXLOGSTRING("CIndexingManager::RemoveHarvestingQueue(): Harvester de-queued successfully.");
return;
}
}
+ OstTrace0( TRACE_NORMAL, DUP2_CINDEXINGMANAGER_REMOVEHARVESTINGQUEUE, "CIndexingManager::RemoveHarvestingQueue(): Harvester in the queue." );
CPIXLOGSTRING("CIndexingManager::RemoveHarvestingQueue(): Harvester in the queue.");
}
@@ -421,6 +478,7 @@
//
void CIndexingManager::HarvestingCompleted(CIndexingPlugin* aPlugin, const TDesC& aQualifiedBaseAppClass, TInt aError)
{
+ OstTraceExt1( TRACE_NORMAL, CINDEXINGMANAGER_HARVESTINGCOMPLETED, "CIndexingManager::HarvestingCompleted;Harvesting completed for <%S>", aQualifiedBaseAppClass );
CPIXLOGSTRING2("CIndexingManager::HarvestingCompleted(): Harvesting completed reported for <%S>.", &aQualifiedBaseAppClass);
// Find this task
@@ -439,10 +497,12 @@
if (iState == EStateRunning)
iTimer.Cancel();
+ OstTrace0( TRACE_NORMAL, DUP1_CINDEXINGMANAGER_HARVESTINGCOMPLETED, "CIndexingManager::HarvestingCompleted(): Harvesting status changed successfully." );
CPIXLOGSTRING("CIndexingManager::HarvestingCompleted(): Harvesting status changed successfully.");
return;
}
}
+ OstTrace0( TRACE_NORMAL, DUP2_CINDEXINGMANAGER_HARVESTINGCOMPLETED, "CIndexingManager::HarvestingCompleted(): Harvester not in the queue." );
CPIXLOGSTRING("CIndexingManager::HarvestingCompleted(): Harvester not in the queue.");
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/src/contentinfomgr.cpp Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "contentinfomgr.h"
+#include "ccotentinfodb.h"
+#include "ccontentinfo.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "contentinfomgrTraces.h"
+#endif
+
+
+// -----------------------------------------------------------------------------
+// CContentInfoMgr::NewL()
+// -----------------------------------------------------------------------------
+//
+CContentInfoMgr* CContentInfoMgr::NewL()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFOMGR_NEWL_ENTRY );
+ CContentInfoMgr* instance = CContentInfoMgr::NewLC();
+ CleanupStack::Pop( instance );
+ OstTraceFunctionExit0( CCONTENTINFOMGR_NEWL_EXIT );
+ return instance;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoMgr::NewLC()
+// -----------------------------------------------------------------------------
+//
+CContentInfoMgr* CContentInfoMgr::NewLC()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFOMGR_NEWLC_ENTRY );
+ CContentInfoMgr* instance = new (ELeave) CContentInfoMgr();
+ CleanupStack::PushL( instance );
+ instance->ConstructL();
+ OstTraceFunctionExit0( CCONTENTINFOMGR_NEWLC_EXIT );
+ return instance;
+ }
+
+// -----------------------------------------------------------------------------
+// Constructor
+// -----------------------------------------------------------------------------
+//
+CContentInfoMgr::CContentInfoMgr()
+ {
+ //Do the necessary initialisation
+ }
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CContentInfoMgr::~CContentInfoMgr()
+ {
+ delete iContentInfoDb;
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoMgr::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CContentInfoMgr::ConstructL()
+ {
+ OstTraceFunctionEntry0( CCONTENTINFOMGR_CONSTRUCTL_ENTRY );
+ iContentInfoDb = CContentInfoDb::NewL();
+ OstTraceFunctionExit0( CCONTENTINFOMGR_CONSTRUCTL_EXIT );
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoMgr::AddL
+// -----------------------------------------------------------------------------
+//
+TInt CContentInfoMgr::AddL( CContentInfo* aContentInfo )
+ {
+ return iContentInfoDb->AddL( aContentInfo );
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoMgr::UpdateBlacklistStatusL
+// -----------------------------------------------------------------------------
+//
+TInt CContentInfoMgr::UpdateBlacklistStatusL( const TDesC& aContentName , TInt aBlacklistStatus )
+ {
+ return iContentInfoDb->UpdateBlacklistStatusL( aContentName, aBlacklistStatus );
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoMgr::UpdatePluginIndexStatusL
+// -----------------------------------------------------------------------------
+//
+TInt CContentInfoMgr::UpdatePluginIndexStatusL( const TDesC& aContentName , TInt aIndexStatus )
+ {
+ return iContentInfoDb->UpdatePluginIndexStatusL( aContentName, aIndexStatus );
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoMgr::FindL
+// -----------------------------------------------------------------------------
+//
+TBool CContentInfoMgr::FindL( const TDesC& aContentName )
+ {
+ return iContentInfoDb->FindL( aContentName );
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoMgr::Remove
+// -----------------------------------------------------------------------------
+//
+void CContentInfoMgr::RemoveL( const TDesC& aContentName )
+ {
+ iContentInfoDb->RemoveL( aContentName );
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoMgr::Remove
+// -----------------------------------------------------------------------------
+//
+void CContentInfoMgr::ResetL( )
+ {
+ iContentInfoDb->ResetDatabaseL();
+ }
+
+// -----------------------------------------------------------------------------
+// CContentInfoMgr::GetContentCountL
+// -----------------------------------------------------------------------------
+//
+TInt CContentInfoMgr::GetContentCountL( )
+ {
+ return iContentInfoDb->GetContentCountL();
+ }
+//EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/traces/CBlacklistDbTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,73 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CBLACKLISTDBTRACES_H__
+#define __CBLACKLISTDBTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6fb
+
+#define CBLACKLISTDB_NEWL_ENTRY 0x8a0001
+#define CBLACKLISTDB_NEWL_EXIT 0x8a0002
+#define CBLACKLISTDB_CONSTRUCTL_ENTRY 0x8a0003
+#define CBLACKLISTDB_CONSTRUCTL_EXIT 0x8a0004
+#define CBLACKLISTDB_ADDL_ENTRY 0x8a0005
+#define CBLACKLISTDB_ADDL_EXIT 0x8a0006
+#define CBLACKLISTDB_REMOVE_ENTRY 0x8a0007
+#define CBLACKLISTDB_REMOVE_EXIT 0x8a0008
+#define CBLACKLISTDB_UPDATEL_ENTRY 0x8a0009
+#define CBLACKLISTDB_UPDATEL_EXIT 0x8a000a
+#define CBLACKLISTDB_CREATEDBL_ENTRY 0x8a000b
+#define CBLACKLISTDB_CREATEDBL_EXIT 0x8a000c
+#define CBLACKLISTDB_CREATECOLUMNSETLC_ENTRY 0x8a000d
+#define CBLACKLISTDB_CREATECOLUMNSETLC_EXIT 0x8a000e
+#define CBLACKLISTDB_CONSTRUCTL 0x860001
+#define CBLACKLISTDB_ADDL 0x860002
+#define CBLACKLISTDB_REMOVE 0x860003
+#define DUP1_CBLACKLISTDB_REMOVE 0x860004
+#define DUP2_CBLACKLISTDB_REMOVE 0x860005
+#define CBLACKLISTDB_FINDWITHVERSIONL 0x860006
+#define DUP1_CBLACKLISTDB_FINDWITHVERSIONL 0x860007
+#define CBLACKLISTDB_UPDATEL 0x860008
+#define CBLACKLISTDB_FINDL 0x860009
+#define DUP1_CBLACKLISTDB_FINDL 0x86000a
+
+
+inline TBool OstTraceGen2( TUint32 aTraceID, TUint aParam1, TInt aParam2 )
+ {
+ TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
+ if ( retval )
+ {
+ TUint8 data[ 8 ];
+ TUint8* ptr = data;
+ *( ( TUint* )ptr ) = aParam1;
+ ptr += sizeof ( TUint );
+ *( ( TInt* )ptr ) = aParam2;
+ ptr += sizeof ( TInt );
+ ptr -= 8;
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 );
+ }
+ return retval;
+ }
+
+inline TBool OstTraceGen2( TUint32 aTraceID, TUint32 aParam1, TInt32 aParam2 )
+ {
+ TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
+ if ( retval )
+ {
+ TUint8 data[ 8 ];
+ TUint8* ptr = data;
+ *( ( TUint* )ptr ) = aParam1;
+ ptr += sizeof ( TUint );
+ *( ( TInt* )ptr ) = aParam2;
+ ptr += sizeof ( TInt );
+ ptr -= 8;
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 );
+ }
+ return retval;
+ }
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/traces/CBlacklistMgrTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,62 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CBLACKLISTMGRTRACES_H__
+#define __CBLACKLISTMGRTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6fb
+
+#define CBLACKLISTMGR_NEWL_ENTRY 0x8a000f
+#define CBLACKLISTMGR_NEWL_EXIT 0x8a0010
+#define CBLACKLISTMGR_CONSTRUCTL_ENTRY 0x8a0011
+#define CBLACKLISTMGR_CONSTRUCTL_EXIT 0x8a0012
+#define CBLACKLISTMGR_ADDL_ENTRY 0x8a0013
+#define CBLACKLISTMGR_ADDL_EXIT 0x8a0014
+#define CBLACKLISTMGR_REMOVE_ENTRY 0x8a0015
+#define CBLACKLISTMGR_REMOVE_EXIT 0x8a0016
+#define CBLACKLISTMGR_ADDL 0x86000b
+#define CBLACKLISTMGR_REMOVE 0x86000c
+#define CBLACKLISTMGR_FINDL 0x86000d
+#define DUP1_CBLACKLISTMGR_FINDL 0x86000e
+#define DUP2_CBLACKLISTMGR_FINDL 0x86000f
+
+
+inline TBool OstTraceGen2( TUint32 aTraceID, TUint aParam1, TInt aParam2 )
+ {
+ TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
+ if ( retval )
+ {
+ TUint8 data[ 8 ];
+ TUint8* ptr = data;
+ *( ( TUint* )ptr ) = aParam1;
+ ptr += sizeof ( TUint );
+ *( ( TInt* )ptr ) = aParam2;
+ ptr += sizeof ( TInt );
+ ptr -= 8;
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 );
+ }
+ return retval;
+ }
+
+inline TBool OstTraceGen2( TUint32 aTraceID, TUint32 aParam1, TInt32 aParam2 )
+ {
+ TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
+ if ( retval )
+ {
+ TUint8 data[ 8 ];
+ TUint8* ptr = data;
+ *( ( TUint* )ptr ) = aParam1;
+ ptr += sizeof ( TUint );
+ *( ( TInt* )ptr ) = aParam2;
+ ptr += sizeof ( TInt );
+ ptr -= 8;
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 );
+ }
+ return retval;
+ }
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/traces/CIndexingManagerTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,110 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CINDEXINGMANAGERTRACES_H__
+#define __CINDEXINGMANAGERTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6fb
+
+#define CINDEXINGMANAGER_RUNL 0x860010
+#define DUP1_CINDEXINGMANAGER_RUNL 0x860011
+#define DUP2_CINDEXINGMANAGER_RUNL 0x860012
+#define DUP3_CINDEXINGMANAGER_RUNL 0x860013
+#define DUP4_CINDEXINGMANAGER_RUNL 0x860014
+#define DUP5_CINDEXINGMANAGER_RUNL 0x860015
+#define DUP6_CINDEXINGMANAGER_RUNL 0x860016
+#define DUP7_CINDEXINGMANAGER_RUNL 0x860017
+#define DUP8_CINDEXINGMANAGER_RUNL 0x860018
+#define DUP9_CINDEXINGMANAGER_RUNL 0x860019
+#define CINDEXINGMANAGER_LOADPLUGINSL 0x86001a
+#define DUP1_CINDEXINGMANAGER_LOADPLUGINSL 0x86001b
+#define DUP2_CINDEXINGMANAGER_LOADPLUGINSL 0x86001c
+#define CINDEXINGMANAGER_ADDHARVESTINGQUEUE 0x86001d
+#define DUP1_CINDEXINGMANAGER_ADDHARVESTINGQUEUE 0x86001e
+#define DUP2_CINDEXINGMANAGER_ADDHARVESTINGQUEUE 0x86001f
+#define DUP3_CINDEXINGMANAGER_ADDHARVESTINGQUEUE 0x860020
+#define CINDEXINGMANAGER_REMOVEHARVESTINGQUEUE 0x860021
+#define DUP1_CINDEXINGMANAGER_REMOVEHARVESTINGQUEUE 0x860022
+#define DUP2_CINDEXINGMANAGER_REMOVEHARVESTINGQUEUE 0x860023
+#define CINDEXINGMANAGER_HARVESTINGCOMPLETED 0x860024
+#define DUP1_CINDEXINGMANAGER_HARVESTINGCOMPLETED 0x860025
+#define DUP2_CINDEXINGMANAGER_HARVESTINGCOMPLETED 0x860026
+
+
+#ifndef __KERNEL_MODE__
+inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 )
+ {
+ TBool retval;
+ TInt size = aParam1.Size();
+ // BTrace assumes that parameter size is atleast 4 bytes
+ if (size % 4 == 0)
+ {
+ TUint8* ptr = ( TUint8* )aParam1.Ptr();
+ // Data is written directly and length is determined from trace message length
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size );
+ }
+ else
+ {
+ TUint8 data[ KOstMaxDataLength ];
+ TUint8* ptr = data;
+ if (size > KOstMaxDataLength)
+ {
+ size = KOstMaxDataLength;
+ }
+ TInt sizeAligned = ( size + 3 ) & ~3;
+ memcpy( ptr, aParam1.Ptr(), size );
+ ptr += size;
+ // Fillers are written to get 32-bit alignment
+ while ( size++ < sizeAligned )
+ {
+ *ptr++ = 0;
+ }
+ ptr -= sizeAligned;
+ size = sizeAligned;
+ // Data is written directly and length is determined from trace message length
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size );
+ }
+ return retval;
+ }
+#endif
+
+
+inline TBool OstTraceGen2( TUint32 aTraceID, TInt aParam1, TInt aParam2 )
+ {
+ TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
+ if ( retval )
+ {
+ TUint8 data[ 8 ];
+ TUint8* ptr = data;
+ *( ( TInt* )ptr ) = aParam1;
+ ptr += sizeof ( TInt );
+ *( ( TInt* )ptr ) = aParam2;
+ ptr += sizeof ( TInt );
+ ptr -= 8;
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 );
+ }
+ return retval;
+ }
+
+inline TBool OstTraceGen2( TUint32 aTraceID, TInt32 aParam1, TInt32 aParam2 )
+ {
+ TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
+ if ( retval )
+ {
+ TUint8 data[ 8 ];
+ TUint8* ptr = data;
+ *( ( TInt* )ptr ) = aParam1;
+ ptr += sizeof ( TInt );
+ *( ( TInt* )ptr ) = aParam2;
+ ptr += sizeof ( TInt );
+ ptr -= 8;
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 );
+ }
+ return retval;
+ }
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/traces/OstTraceDefinitions.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/traces/ccontentinfoTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,22 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CCONTENTINFOTRACES_H__
+#define __CCONTENTINFOTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6fb
+
+#define CCONTENTINFO_NEWL_ENTRY 0x8a0017
+#define CCONTENTINFO_NEWL_EXIT 0x8a0018
+#define CCONTENTINFO_NEWLC_ENTRY 0x8a0019
+#define CCONTENTINFO_NEWLC_EXIT 0x8a001a
+#define CCONTENTINFO_GETNAMEL_ENTRY 0x8a001b
+#define CCONTENTINFO_GETNAMEL_EXIT 0x8a001c
+#define CCONTENTINFO_SETNAMEL_ENTRY 0x8a001d
+#define CCONTENTINFO_SETNAMEL_EXIT 0x8a001e
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/traces/ccontentinfodbTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,36 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CCONTENTINFODBTRACES_H__
+#define __CCONTENTINFODBTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6fb
+
+#define CCONTENTINFODB_NEWL_ENTRY 0x8a001f
+#define CCONTENTINFODB_NEWL_EXIT 0x8a0020
+#define CCONTENTINFODB_NEWLC_ENTRY 0x8a0021
+#define CCONTENTINFODB_NEWLC_EXIT 0x8a0022
+#define CCONTENTINFODB_CONSTRUCTL_ENTRY 0x8a0023
+#define CCONTENTINFODB_CONSTRUCTL_EXIT 0x8a0024
+#define CCONTENTINFODB_ADDL_ENTRY 0x8a0025
+#define CCONTENTINFODB_ADDL_EXIT 0x8a0026
+#define CCONTENTINFODB_UPDATEBLACKLISTSTATUSL_ENTRY 0x8a0027
+#define CCONTENTINFODB_UPDATEBLACKLISTSTATUSL_EXIT 0x8a0028
+#define CCONTENTINFODB_UPDATEPLUGININDEXSTATUSL_ENTRY 0x8a0029
+#define CCONTENTINFODB_UPDATEPLUGININDEXSTATUSL_EXIT 0x8a002a
+#define CCONTENTINFODB_REMOVEL_ENTRY 0x8a002b
+#define CCONTENTINFODB_REMOVEL_EXIT 0x8a002c
+#define CCONTENTINFODB_RESETDATABASEL_ENTRY 0x8a002d
+#define CCONTENTINFODB_RESETDATABASEL_EXIT 0x8a002e
+#define CCONTENTINFODB_FINDL_ENTRY 0x8a002f
+#define CCONTENTINFODB_FINDL_EXIT 0x8a0030
+#define CCONTENTINFODB_GETCONTENTCOUNTL_ENTRY 0x8a0031
+#define CCONTENTINFODB_GETCONTENTCOUNTL_EXIT 0x8a0032
+#define CCONTENTINFODB_CREATEDBL_ENTRY 0x8a0033
+#define CCONTENTINFODB_CREATEDBL_EXIT 0x8a0034
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/traces/contentinfomgrTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,20 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CONTENTINFOMGRTRACES_H__
+#define __CONTENTINFOMGRTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6fb
+
+#define CCONTENTINFOMGR_NEWL_ENTRY 0x8a0035
+#define CCONTENTINFOMGR_NEWL_EXIT 0x8a0036
+#define CCONTENTINFOMGR_NEWLC_ENTRY 0x8a0037
+#define CCONTENTINFOMGR_NEWLC_EXIT 0x8a0038
+#define CCONTENTINFOMGR_CONSTRUCTL_ENTRY 0x8a0039
+#define CCONTENTINFOMGR_CONSTRUCTL_EXIT 0x8a003a
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/harvesterserver/traces/fixed_id.definitions Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,99 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FLOW=0x8a
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_ADDL_ENTRY=0x5
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_ADDL_EXIT=0x6
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_CONSTRUCTL_ENTRY=0x3
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_CONSTRUCTL_EXIT=0x4
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_CREATECOLUMNSETLC_ENTRY=0xd
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_CREATECOLUMNSETLC_EXIT=0xe
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_CREATEDBL_ENTRY=0xb
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_CREATEDBL_EXIT=0xc
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_NEWL_ENTRY=0x1
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_NEWL_EXIT=0x2
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_REMOVE_ENTRY=0x7
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_REMOVE_EXIT=0x8
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_UPDATEL_ENTRY=0x9
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTDB_UPDATEL_EXIT=0xa
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTMGR_ADDL_ENTRY=0x13
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTMGR_ADDL_EXIT=0x14
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTMGR_CONSTRUCTL_ENTRY=0x11
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTMGR_CONSTRUCTL_EXIT=0x12
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTMGR_NEWL_ENTRY=0xf
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTMGR_NEWL_EXIT=0x10
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTMGR_REMOVE_ENTRY=0x15
+[TRACE]TRACE_FLOW[0x8A]_CBLACKLISTMGR_REMOVE_EXIT=0x16
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_ADDL_ENTRY=0x25
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_ADDL_EXIT=0x26
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_CONSTRUCTL_ENTRY=0x23
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_CONSTRUCTL_EXIT=0x24
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_CREATEDBL_ENTRY=0x33
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_CREATEDBL_EXIT=0x34
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_FINDL_ENTRY=0x2f
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_FINDL_EXIT=0x30
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_GETCONTENTCOUNTL_ENTRY=0x31
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_GETCONTENTCOUNTL_EXIT=0x32
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_NEWLC_ENTRY=0x21
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_NEWLC_EXIT=0x22
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_NEWL_ENTRY=0x1f
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_NEWL_EXIT=0x20
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_REMOVEL_ENTRY=0x2b
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_REMOVEL_EXIT=0x2c
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_RESETDATABASEL_ENTRY=0x2d
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_RESETDATABASEL_EXIT=0x2e
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_UPDATEBLACKLISTSTATUSL_ENTRY=0x27
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_UPDATEBLACKLISTSTATUSL_EXIT=0x28
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_UPDATEPLUGININDEXSTATUSL_ENTRY=0x29
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFODB_UPDATEPLUGININDEXSTATUSL_EXIT=0x2a
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFOMGR_CONSTRUCTL_ENTRY=0x39
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFOMGR_CONSTRUCTL_EXIT=0x3a
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFOMGR_NEWLC_ENTRY=0x37
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFOMGR_NEWLC_EXIT=0x38
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFOMGR_NEWL_ENTRY=0x35
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFOMGR_NEWL_EXIT=0x36
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFO_GETNAMEL_ENTRY=0x1b
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFO_GETNAMEL_EXIT=0x1c
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFO_NEWLC_ENTRY=0x19
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFO_NEWLC_EXIT=0x1a
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFO_NEWL_ENTRY=0x17
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFO_NEWL_EXIT=0x18
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFO_SETNAMEL_ENTRY=0x1d
+[TRACE]TRACE_FLOW[0x8A]_CCONTENTINFO_SETNAMEL_EXIT=0x1e
+[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTDB_ADDL=0x2
+[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTDB_CONSTRUCTL=0x1
+[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTDB_FINDL=0x9
+[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTDB_FINDWITHVERSIONL=0x6
+[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTDB_REMOVE=0x3
+[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTDB_UPDATEL=0x8
+[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTMGR_ADDL=0xb
+[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTMGR_FINDL=0xd
+[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTMGR_REMOVE=0xc
+[TRACE]TRACE_NORMAL[0x86]_CINDEXINGMANAGER_ADDHARVESTINGQUEUE=0x1d
+[TRACE]TRACE_NORMAL[0x86]_CINDEXINGMANAGER_HARVESTINGCOMPLETED=0x24
+[TRACE]TRACE_NORMAL[0x86]_CINDEXINGMANAGER_LOADPLUGINSL=0x1a
+[TRACE]TRACE_NORMAL[0x86]_CINDEXINGMANAGER_REMOVEHARVESTINGQUEUE=0x21
+[TRACE]TRACE_NORMAL[0x86]_CINDEXINGMANAGER_RUNL=0x10
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTDB_FINDL=0xa
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTDB_FINDWITHVERSIONL=0x7
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTDB_REMOVE=0x4
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTMGR_FINDL=0xe
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CINDEXINGMANAGER_ADDHARVESTINGQUEUE=0x1e
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CINDEXINGMANAGER_HARVESTINGCOMPLETED=0x25
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CINDEXINGMANAGER_LOADPLUGINSL=0x1b
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CINDEXINGMANAGER_REMOVEHARVESTINGQUEUE=0x22
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CINDEXINGMANAGER_RUNL=0x11
+[TRACE]TRACE_NORMAL[0x86]_DUP2_CBLACKLISTDB_REMOVE=0x5
+[TRACE]TRACE_NORMAL[0x86]_DUP2_CBLACKLISTMGR_FINDL=0xf
+[TRACE]TRACE_NORMAL[0x86]_DUP2_CINDEXINGMANAGER_ADDHARVESTINGQUEUE=0x1f
+[TRACE]TRACE_NORMAL[0x86]_DUP2_CINDEXINGMANAGER_HARVESTINGCOMPLETED=0x26
+[TRACE]TRACE_NORMAL[0x86]_DUP2_CINDEXINGMANAGER_LOADPLUGINSL=0x1c
+[TRACE]TRACE_NORMAL[0x86]_DUP2_CINDEXINGMANAGER_REMOVEHARVESTINGQUEUE=0x23
+[TRACE]TRACE_NORMAL[0x86]_DUP2_CINDEXINGMANAGER_RUNL=0x12
+[TRACE]TRACE_NORMAL[0x86]_DUP3_CINDEXINGMANAGER_ADDHARVESTINGQUEUE=0x20
+[TRACE]TRACE_NORMAL[0x86]_DUP3_CINDEXINGMANAGER_RUNL=0x13
+[TRACE]TRACE_NORMAL[0x86]_DUP4_CINDEXINGMANAGER_RUNL=0x14
+[TRACE]TRACE_NORMAL[0x86]_DUP5_CINDEXINGMANAGER_RUNL=0x15
+[TRACE]TRACE_NORMAL[0x86]_DUP6_CINDEXINGMANAGER_RUNL=0x16
+[TRACE]TRACE_NORMAL[0x86]_DUP7_CINDEXINGMANAGER_RUNL=0x17
+[TRACE]TRACE_NORMAL[0x86]_DUP8_CINDEXINGMANAGER_RUNL=0x18
+[TRACE]TRACE_NORMAL[0x86]_DUP9_CINDEXINGMANAGER_RUNL=0x19
--- a/qcpix/sis/createsis.bat Mon Apr 19 14:40:16 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-@rem
-@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-@rem All rights reserved.
-@rem This component and the accompanying materials are made available
-@rem under the terms of "Eclipse Public License v1.0"
-@rem which accompanies this distribution, and is available
-@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-@rem
-@rem Initial Contributors:
-@rem Nokia Corporation - initial contribution.
-@rem
-@rem Contributors:
-@rem
-@rem Description:
-@rem
-
-call makesis ..\qcpixsearchclient_template.pkg qcpixsearchclient.sis
-call signsis -s qcpixsearchclient.sis qcpixsearchclient.sisx RDTest_02.der RDTest_02.key
\ No newline at end of file
--- a/qcpix/src/platform/s60/src/qcpixsearcherprivate.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/qcpix/src/platform/s60/src/qcpixsearcherprivate.cpp Mon May 03 13:33:22 2010 +0300
@@ -47,11 +47,13 @@
void QCPixSearcherPrivate::HandleSearchResultsL(TInt aError, TInt aEstimatedResultCount)
{
+ PERF_TIME_NOW("Async search complete");
emit iSearchParent->handleSearchResults( aError, aEstimatedResultCount );
}
void QCPixSearcherPrivate::HandleDocumentL(TInt aError, CSearchDocument* aDocument)
{
+ PERF_TIME_NOW("Async get document complete")
emit iSearchParent->handleDocument( aError, QCPixDocFromCPixDoc( aDocument ) );
}
--- a/qcpix/src/qcpixsearcher.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/qcpix/src/qcpixsearcher.cpp Mon May 03 13:33:22 2010 +0300
@@ -31,6 +31,8 @@
QCPixSearcher::QCPixSearcher( QString aDefaultSearchField )
:iPvtImpl( new QCPixSearcherPrivate( this ) )
{
+ PERF_SEARCH_START_TIMER
+ PERF_GETDOC_START_TIMER
}
QCPixSearcher::~QCPixSearcher()
@@ -81,6 +83,7 @@
int QCPixSearcher::search( QString aSearchString, QString aDefaultSearchField )
{
+ PERF_SEARCH_RESTART_TIMER
TBuf<KMaxStringLength> searchString( aSearchString.utf16() );
TBuf<KMaxStringLength> defaultSearchField( aDefaultSearchField.utf16() );
//ideally would have had just the following single line:
@@ -88,11 +91,13 @@
//But the RCVT compiler throws up warnings. The following is just to suppress those warnings.
int tmp = 0;
QT_TRAP_THROWING( tmp = iPvtImpl->iSearcher->SearchL( searchString, defaultSearchField ) );
+ PERF_SEARCH_ENDLOG
return tmp;
}
void QCPixSearcher::searchAsync( QString aSearchString, QString aDefaultSearchField )
{
+ PERF_TIME_NOW("Async search start")
TBuf<KMaxStringLength> searchString( aSearchString.utf16() );
TBuf<KMaxStringLength> defaultSearchField( aDefaultSearchField.utf16() );
QT_TRAP_THROWING( iPvtImpl->iSearcher->SearchL( *iPvtImpl, searchString, defaultSearchField ) );
@@ -100,13 +105,16 @@
QCPixDocument* QCPixSearcher::getDocument( int aIndex )
{
+ PERF_GETDOC_RESTART_TIMER
QCPixDocument* tmp = 0;
QT_TRAP_THROWING( tmp = QCPixDocFromCPixDoc( iPvtImpl->iSearcher->GetDocumentL( aIndex ) ) );
+ PERF_GETDOC_ENDLOG
return tmp;
}
-
+
void QCPixSearcher::getDocumentAsync( int aIndex )
{
+ PERF_TIME_NOW("Async get document start")
QT_TRAP_THROWING( iPvtImpl->iSearcher->GetDocumentL( aIndex, *iPvtImpl ) );
}
--- a/qcpix/tsrc/orbitsearch/main.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/qcpix/tsrc/orbitsearch/main.cpp Mon May 03 13:33:22 2010 +0300
@@ -20,33 +20,39 @@
#include <hbapplication.h>
#include <hbmainwindow.h>
#include <hbwidget.h>
-
-#include "searchhelper.h"
+#include <hbpushbutton.h>
+#include <hbtextedit.h>
+#include "testsearch.h"
+#include "testci.h"
int main(int argc, char *argv[])
{
HbApplication a(argc, argv);
- //Declare controls
- ORBIT_SEARCH_CONTROLS
-
+ //Declare controls
+ HbTextEdit* choiceBox;
+ HbPushButton* schButton;//button to start search test
+ HbPushButton* ciButton; //button to start content info test
HbMainWindow mainWindow;
HbWidget *w = new HbWidget;
QGraphicsLinearLayout *layout = new QGraphicsLinearLayout;
layout->setOrientation(Qt::Vertical);
-
+
//Initialize controls
- searchBox = new HbLineEdit;
- layout->addItem( searchBox );
+ choiceBox = new HbTextEdit();
+ layout->addItem( choiceBox );
+
+ schButton = new HbPushButton( "Test Search" );
+ layout->addItem( schButton );
- searchButton = new HbPushButton( "Search" );
- layout->addItem( searchButton );
+ ciButton = new HbPushButton( "Test Content Info" );
+ layout->addItem( ciButton );
+ choiceBox->setPlainText ("Select the Test : ");
+ TestSearch* ts = new TestSearch( );
+ QObject::connect( schButton, SIGNAL( clicked() ), ts, SLOT( doSearchTest() ) );
- resultsBox = new HbTextEdit;
- layout->addItem( resultsBox );
-
- SearchHelper* sh = new SearchHelper(searchBox, searchButton, resultsBox);
- QObject::connect( searchButton, SIGNAL( clicked() ), sh, SLOT(doSearch()) );
+ TestCI* tc = new TestCI( );
+ QObject::connect( ciButton, SIGNAL( clicked() ), tc, SLOT( doCITest() ) );
w->setLayout( layout );
mainWindow.addView( w );
--- a/qcpix/tsrc/orbitsearch/orbitsearch.pro Mon Apr 19 14:40:16 2010 +0300
+++ b/qcpix/tsrc/orbitsearch/orbitsearch.pro Mon May 03 13:33:22 2010 +0300
@@ -18,13 +18,14 @@
TARGET = OrbitSearch
QT += core
-QT += gui
+QT += gui
+QT += sql
CONFIG += qtestlib
LIBS += -lqcpixsearchclient -lxqservice
-HEADERS += searchHandler.h uicontrols.h searchhelper.h
+HEADERS += uicontrols.h searchhelper.h testsearch.h testci.h
SOURCES += OrbitSearch_reg.rss \
- main.cpp searchHandler.cpp searchhelper.cpp
+ main.cpp searchhelper.cpp testsearch.cpp testci.cpp
symbian:TARGET.UID3 = 0xE11D1102
symbian:TARGET.CAPABILITY = ALL -TCB -DRM
--- a/qcpix/tsrc/orbitsearch/searchhandler.cpp Mon Apr 19 14:40:16 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "searchhandler.h"
-#include <qcpixsearcher.h>
-#include <qcpixdocument.h>
-
-CSearchHandler::CSearchHandler()
- {
- iSearchInterface = QCPixSearcher::newInstance("root","_aggregate");
- iSearchInterface->connect(iSearchInterface, SIGNAL(handleSearchResults(int,int)), this, SLOT(__handleSearchResult(int,int)));
- iSearchInterface->connect(iSearchInterface, SIGNAL(handleDocument(int,QCPixDocument*)), this, SLOT(__getDocumentAsync(int,QCPixDocument*)));
- }
-
-void CSearchHandler::__handleSearchResult(int aError, int estimatedResultCount)
- {
- qDebug() << aError << estimatedResultCount;
- iSearchresultCount= estimatedResultCount;
- emit handleAsyncSearchResult(aError, estimatedResultCount);
- }
-
-void CSearchHandler::__getDocumentAsync(int aError, QCPixDocument* aDocument )
- {
- emit handleDocument( aError, aDocument );
- }
-
-QCPixDocument* CSearchHandler::getDocumentAtIndex(int aIndex)
- {
- return iSearchInterface->getDocument( aIndex );
- }
-
-void CSearchHandler::search(QString aSearchString)
- {
- qDebug() << "CSearchHandler::search Enter";
- iSearchresultCount = iSearchInterface->search( aSearchString );
- emit handleSearchResult( KErrNone, iSearchresultCount );
- qDebug() << "CSearchHandler::search Exit";
- }
-
-CSearchHandler::~CSearchHandler()
- {
- delete iSearchInterface;
- }
-
-int CSearchHandler::getSearchResultCount()
- {
- return iSearchresultCount;
- }
-
-void CSearchHandler::getDocumentAsyncAtIndex( int aIndex )
- {
- iSearchInterface->getDocumentAsync( aIndex );
- }
-
-void CSearchHandler::searchAsync(QString aSearchString)
- {
- iSearchInterface->searchAsync( aSearchString );
- }
-
-void CSearchHandler::cancelLastSearch()
- {
- iSearchInterface->cancelSearch();
- }
--- a/qcpix/tsrc/orbitsearch/searchhandler.h Mon Apr 19 14:40:16 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include <QtCore>
-#include <QCoreApplication>
-#include <QDebug>
-#include <QTest>
-
-class QCPixSearcher;
-class QCPixDocument;
-
-class CSearchHandler: public QObject
- {
-Q_OBJECT
-public:
- CSearchHandler();
-
-signals:
- void handleSearchResult(int, int);
- void handleAsyncSearchResult(int, int);
- void handleDocument(int aError, QCPixDocument* aDoc);
-
-private slots:
- void __handleSearchResult(int aError, int estimatedResultCount);
- void __getDocumentAsync(int aError, QCPixDocument* aDocument );
-
-public:
- ~CSearchHandler();
- QCPixDocument* getDocumentAtIndex(int aIndex);
- void getDocumentAsyncAtIndex(int aIndex);
- void search(QString aSearchString);
- void searchAsync(QString aSearchString);
- void cancelLastSearch();
- int getSearchResultCount();
-
-private:
- QCPixSearcher *iSearchInterface;
- QList<QVariantMap> searchResults;
- int iSearchresultCount;
- };
--- a/qcpix/tsrc/orbitsearch/searchhelper.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/qcpix/tsrc/orbitsearch/searchhelper.cpp Mon May 03 13:33:22 2010 +0300
@@ -39,21 +39,42 @@
int hits = 0;
QString resultString("");
resultsBox->setPlainText( resultString );
+ searchTime.restart();
+ QString searchString = searchBox->text();
+
+#if STAR_SEARCH
+ searchString += "*";
+#elif NO_STAR_SEARCH
+ ;//do nothing
+#elif ESCAPE_SPECIAL_CHARS
+ //C-style array query - so that we dont have to hard code the length.
+ //Escape '\' first so that it does not re-escape all the other escapes.
+ QString escapeTheseCharacters [] = {"\\", "+", "-", "&&", "||", "!",
+ "(", ")", "{", "}", "[", "]", "^",
+ "~", "*", "?", ":", "\0"};
+ for( int i=0; escapeTheseCharacters[i] != "\0"; i++ ){
+ QString escapedCharacter = "\\" + escapeTheseCharacters[i];
+ searchString.replace( escapeTheseCharacters[i], escapedCharacter );
+ }
+#endif
- searchTime.restart();
- hits = searcher->search( searchBox->text() + "*" );
+ hits = searcher->search( searchString );
+
resultString = "SearchTime: " + QString().setNum( searchTime.elapsed() ) + " ms \r\n";
resultString += "Hits: " + QString().setNum( hits ) + "\r\n";
resultsBox->setPlainText( resultString );
-
+
+#if !DONT_SHOW_RESULTS
if( hits > 0 )
{
- QCPixDocument* temp = QCPixDocument::newInstance();
+ QCPixDocument* temp = NULL;
int docCount = 0;
do{
temp = searcher->getDocument( docCount++ );
resultString += temp->baseAppClass() + " " + temp->docId() + " " + temp->excerpt() + "\r\n\r\n";
+ delete temp;
}while( hits > docCount );
}
resultsBox->setPlainText( resultString );
+#endif //DONT_SHOW_RESULTS
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/qcpix/tsrc/orbitsearch/testci.cpp Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QtGui>
+#include <QGraphicsLayout>
+#include <hbmainwindow.h>
+#include <hbwidget.h>
+#include <hbtextedit.h>
+#include <qsql.h>
+#include <qsqldatabase.h>
+#include <qsqlquery.h>
+#include "testci.h"
+
+TestCI::TestCI( )
+{
+}
+
+TestCI::~TestCI()
+{
+
+}
+
+void TestCI::updatedbcontent( HbTextEdit* aHbTextEdit )
+ {
+ QString mConnectionName("cpixcontentinfo.sq");
+ QString mDatabaseName("c:\\Private\\2001f6fb\\cpixcontentinfo.sq");
+
+ QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", mConnectionName);
+ db.setDatabaseName(mDatabaseName);
+
+ QSqlQuery query(QSqlDatabase::database(mConnectionName));
+ QString statement = "SELECT * FROM table1";
+
+ query.prepare(statement);
+ query.exec();
+ QString resultinstring("Database View : \n");
+ resultinstring.append( "ContentName INS BLS \n" );
+ resultinstring.append( "--------------------------------\n" );
+
+ while (query.next())
+ {
+ QString category_name = query.value(0).toString();
+ int ins = query.value(1).toInt ();
+ int bls = query.value(2).toInt ( );
+ resultinstring += category_name + " " + QString().setNum( ins ) + " " +QString().setNum( bls ) + "\n";
+ aHbTextEdit->setPlainText ( resultinstring );
+ }
+
+ db.close();
+ return;
+ }
+
+void TestCI::doCITest()
+{
+ //Declare controls
+ HbTextEdit* resultsBox;
+
+ HbMainWindow *BigScreen = new HbMainWindow();
+ HbWidget *w = new HbWidget;
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout;
+ layout->setOrientation(Qt::Vertical);
+
+ //Initialize controls
+ resultsBox = new HbTextEdit;
+ layout->addItem( resultsBox );
+
+ resultsBox->setReadOnly( true );
+
+ updatedbcontent ( resultsBox );
+
+ w->setLayout( layout );
+ BigScreen->addView ( w );
+ BigScreen->show();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/qcpix/tsrc/orbitsearch/testci.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef TESTCI_H_
+#define TESTCI_H_
+
+#include <QObject>
+#include <hbtextedit.h>
+class TestCI: public QObject
+ {
+Q_OBJECT
+public:
+ TestCI( );
+ ~TestCI();
+
+public slots:
+ void doCITest();
+
+private:
+ void updatedbcontent( HbTextEdit* aHbTextEdit );
+
+ };
+
+#endif //TESTCI_H_
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/qcpix/tsrc/orbitsearch/testsearch.cpp Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QtGui>
+#include <QGraphicsLayout>
+#include <hbmainwindow.h>
+#include <hbwidget.h>
+#include "uicontrols.h"
+#include "testsearch.h"
+#include "searchhelper.h"
+
+TestSearch::TestSearch( )
+{
+}
+
+TestSearch::~TestSearch()
+{
+
+}
+
+void TestSearch::doSearchTest()
+{
+ //Declare controls
+ ORBIT_SEARCH_CONTROLS
+ HbMainWindow *BigScreen = new HbMainWindow();
+ HbWidget *w = new HbWidget;
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout;
+ layout->setOrientation(Qt::Vertical);
+
+ //Initialize controls
+ searchBox = new HbLineEdit;
+ layout->addItem( searchBox );
+
+ searchButton = new HbPushButton( "Search" );
+ layout->addItem( searchButton );
+
+ resultsBox = new HbTextEdit;
+ layout->addItem( resultsBox );
+
+ SearchHelper* sh = new SearchHelper(searchBox, searchButton, resultsBox);
+ QObject::connect( searchButton, SIGNAL( clicked() ), sh, SLOT(doSearch()) );
+
+ w->setLayout( layout );
+ BigScreen->addView ( w );
+ BigScreen->show();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/qcpix/tsrc/orbitsearch/testsearch.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef TESTSEARCH_H_
+#define TESTSEARCH_H_
+
+#include <QObject>
+class TestSearch: public QObject
+ {
+Q_OBJECT
+public:
+ TestSearch( );
+ ~TestSearch();
+
+public slots:
+ void doSearchTest();
+
+ };
+
+#endif //TESTSEARCH_H_
--- a/qcpix/tsrc/orbitsearch/uicontrols.h Mon Apr 19 14:40:16 2010 +0300
+++ b/qcpix/tsrc/orbitsearch/uicontrols.h Mon May 03 13:33:22 2010 +0300
@@ -22,6 +22,28 @@
#include <hbpushbutton.h>
#include <hbtextedit.h>
+//***********************************************************
+//Fine controls for custom builds.
+
+//Default search mode. Append "*" to the end of search string
+//NOTE: These macros are mutually exclusive and precedence
+//in the order below.
+//i.e., STAR_SEARCH over-rides NO_STAR_SEARCH which overrides
+//ESCAPE_SPECIAL_CHARS.
+#define STAR_SEARCH 1
+
+//Vanilla search. Send search string to engine "as-is".
+#define NO_STAR_SEARCH 0
+
+//Will escape the following characters:
+//+,-,&&,||,!,(,),{,},[,],^,",~,*,?,:and '\'
+#define ESCAPE_SPECIAL_CHARS 0
+
+//If you dont want to see results, define this flag.
+#define DONT_SHOW_RESULTS 0
+
+//************************************************************
+
#define ORBIT_SEARCH_CONTROLS \
HbLineEdit* searchBox; \
HbPushButton* searchButton; \
--- a/searchengine/cpix/cpix/group/cpix.mmp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/cpix/group/cpix.mmp Mon May 03 13:33:22 2010 +0300
@@ -53,6 +53,7 @@
SOURCE common/refcountedbase.cpp
SOURCE common/cloners.cpp
SOURCE ifieldfilter.cpp
+SOURCE prefixopt.cpp
SOURCE filters/quadfilter.cpp
SOURCE fileparser/fileparser.cpp
SOURCE fileparser/textfileparser.cpp
@@ -65,6 +66,7 @@
SOURCE qrytypes/termsqrytype.cpp
SOURCE qrytypes/dumpqrytype.cpp
SOURCE qrytypes/quadqrytype.cpp
+SOURCE qrytypes/prefixqrytype.cpp
SOURCE spi/exif.cpp
SOURCE spi/s60/exifreader.cpp
SOURCE spi/id3.cpp
--- a/searchengine/cpix/cpix/inc/private/analyzer.h Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/cpix/inc/private/analyzer.h Mon May 03 13:33:22 2010 +0300
@@ -56,6 +56,39 @@
// Class definitions
namespace Cpix
{
+
+ /**
+ * This is a special filter that is used to generate prefixes
+ * of the searched words.
+ *
+ * For example token "chapter" will be split into tokens "ch" and "c"
+ * if maxPrefixLength is set as 2.
+ */
+ class PrefixGenerator : public lucene::analysis::TokenFilter {
+
+ public:
+
+ PrefixGenerator(lucene::analysis::TokenStream* in,
+ bool deleteTS,
+ size_t maxPrefixLength);
+
+ virtual ~PrefixGenerator();
+
+ /**
+ * Returns
+ */
+ virtual bool next(lucene::analysis::Token* token);
+
+ private:
+
+ lucene::analysis::Token token_;
+
+ size_t prefixLength_;
+
+ size_t maxPrefixLength_;
+
+ };
+
/**
* Aggregates token streams from all fields marked from aggregation.
* Used to generate the contents of the _aggregate field.
--- a/searchengine/cpix/cpix/inc/private/initparams.h Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/cpix/inc/private/initparams.h Mon May 03 13:33:22 2010 +0300
@@ -313,7 +313,12 @@
* of housekeep rounds. How many housekeep rounds later,
* is defined by this enum here.
*/
- DISCARD_SAFETY_PERIOD = 2
+ DISCARD_SAFETY_PERIOD = 2,
+
+ /**
+ * Up to this long prefixes will be optimized by default
+ */
+ OPTIMIZED_PREFIX_MAX_LENGTH = 2
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searchengine/cpix/cpix/inc/private/prefixopt.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef PREFIXOPT_H_
+#define PREFIXOPT_H_
+
+#include <string>
+#include <wchar.h>
+
+// Forward declarations
+namespace lucene {
+ namespace search {
+ class Query;
+ }
+}
+
+namespace Cpix
+{
+
+ /**
+ * Goes throught the query hiearchy and converts queries of
+ * form "field:c*" into form "field_prefix:c".
+ *
+ */
+ class PrefixOptQueryRewriter
+ {
+ public:
+
+ PrefixOptQueryRewriter(int maxPrefixLength,
+ const wchar_t* optimizedField,
+ const wchar_t* prefixField);
+
+ ~PrefixOptQueryRewriter();
+
+ std::auto_ptr<lucene::search::Query>
+ rewrite(std::auto_ptr<lucene::search::Query> query);
+
+ private:
+
+ int maxPrefixLength_;
+
+ std::wstring optimizedField_;
+
+ std::wstring prefixField_;
+
+ };
+
+}
+
+#endif /* PREFIXOPT_H_ */
--- a/searchengine/cpix/cpix/inc/public/appclass-hierarchy.txt Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/cpix/inc/public/appclass-hierarchy.txt Mon May 03 13:33:22 2010 +0300
@@ -17,12 +17,15 @@
|
|
+-- file
- | [ BaseName ] {EStoreYes | EIndexTokenized}
- | [ Extension ] {EStoreYes | EIndexTokenized}
- | [ FullName ] {EStoreYes | EIndexTokenized}
- | [ Contents ] {EStoreYes | EIndexTokenized}
- |
- |
+ | |
+ | |
+ | +-- Content
+ | | [ Contents ] {EStoreYes | EIndexTokenized}
+ | |
+ | +-- folder
+ | [ Name ] {EStoreYes | EIndexTokenized}
+ | [ Extension ] {EStoreYes | EIndexUnTokenized}
+ |
|
+-- media
| |
--- a/searchengine/cpix/cpix/src/analyzer.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/cpix/src/analyzer.cpp Mon May 03 13:33:22 2010 +0300
@@ -38,6 +38,7 @@
#include "indevicecfg.h"
+#include "initparams.h"
namespace
{
const char AGGR_NONFILEREADERPROXY_ERR[]
@@ -50,6 +51,44 @@
namespace Cpix {
+ PrefixGenerator::PrefixGenerator(
+ lucene::analysis::TokenStream* in,
+ bool deleteTS,
+ size_t maxPrefixLength)
+ : TokenFilter(in, deleteTS),
+ token_(),
+ prefixLength_(0),
+ maxPrefixLength_(maxPrefixLength) {}
+
+
+ PrefixGenerator::~PrefixGenerator() {
+ }
+
+
+ bool PrefixGenerator::next(lucene::analysis::Token* token) {
+ token_.setPositionIncrement(0);
+
+ while (prefixLength_ == 0) {
+ token_.setPositionIncrement(1); // default position increment
+ if (!input->next(&token_)) {
+ return false;
+ }
+ prefixLength_ = std::min(token_.termTextLength(), maxPrefixLength_);
+ }
+
+ // Clip token
+ std::wstring clipped;
+ clipped = token_.termText();
+ token_.setText(clipped.substr(0, prefixLength_).c_str());
+
+ // Copy
+ token->set(token_.termText(), token_.startOffset(), token_.endOffset(), token_.type());
+ token->setPositionIncrement(token_.getPositionIncrement());
+
+ // Reduce prefixLength_
+ prefixLength_--;
+ return true;
+ }
AggregateFieldTokenStream::AggregateFieldTokenStream(lucene::analysis::Analyzer& analyzer,
DocumentFieldIterator* fields)
@@ -136,6 +175,12 @@
lucene::util::Reader * reader) {
if ( wcscmp( fieldName, LCPIX_DEFAULT_FIELD ) == 0 ) {
return new AggregateFieldTokenStream( analyzer_, document_.fields());
+ } else if ( wcscmp( fieldName, LCPIX_DEFAULT_PREFIX_FIELD ) == 0 ) {
+ return
+ new PrefixGenerator(
+ new AggregateFieldTokenStream( analyzer_, document_.fields()),
+ true,
+ OPTIMIZED_PREFIX_MAX_LENGTH);
} else {
return analyzer_.tokenStream( fieldName, reader );
}
@@ -428,6 +473,34 @@
int min_, max_;
std::auto_ptr<TokenStreamFactory> factory_;
};
+
+ /**
+ * Specialized PrefixGenerator factory is needed, because PrefixGenerator
+ * requires the max prefix size.
+ */
+ template<>
+ class FilterFactory<PrefixGenerator> : public TokenStreamFactory
+ {
+ public:
+ FilterFactory(const Invokation& invokation,
+ auto_ptr<TokenStreamFactory> factory)
+ : factory_(factory) {
+ using namespace Cpt::Parser;
+ if (invokation.params().size() != 1 ||
+ !dynamic_cast<IntegerLit*>(invokation.params()[0])) {
+ THROW_CPIXEXC("Prefix generator takes exactly one integer parameter");
+ }
+ maxPrefixLength_ = dynamic_cast<IntegerLit*>(invokation.params()[0])->value();
+ }
+ virtual lucene::analysis::TokenStream* tokenStream(const TCHAR * fieldName,
+ lucene::util::Reader * reader) {
+ return _CLNEW PrefixGenerator(factory_->tokenStream(fieldName, reader), true, maxPrefixLength_ );
+ }
+ private:
+ int maxPrefixLength_;
+ std::auto_ptr<TokenStreamFactory> factory_;
+ };
+
typedef auto_ptr<TokenStreamFactory> (*TokenizerFactoryCreator)(const Invokation& invokation);
typedef auto_ptr<TokenStreamFactory> (*FilterFactoryCreator)(const Invokation& invokation,
@@ -507,6 +580,7 @@
{CPIX_FILTER_STOP, FilterFactoryCtor<lucene::analysis::StopFilter>::create},
{CPIX_FILTER_STEM, FilterFactoryCtor<lucene::analysis::SnowballFilter>::create},
{CPIX_FILTER_LENGTH, FilterFactoryCtor<lucene::analysis::LengthFilter>::create},
+ {CPIX_FILTER_PREFIXES, FilterFactoryCtor<PrefixGenerator>::create},
// TODO: Add more Filters
--- a/searchengine/cpix/cpix/src/fileparser/pdffileparser.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/cpix/src/fileparser/pdffileparser.cpp Mon May 03 13:33:22 2010 +0300
@@ -46,6 +46,71 @@
#include "cluceneext.h"
#include "cpixstrtools.h"
+namespace
+{
+ const char EXTENSION[] = ".txt";
+ const char EXTENSION_UPPER[] = ".TXT";
+
+ const char DEFAULT_ENCODING[] = "UTF-8";
+
+ /**
+ * Returns 1 on success, 0 on eof.
+ */
+ int clgetline(lucene::util::Reader& reader, std::wstring& line)
+ {
+ line = L"";
+
+ // read line
+ while (true)
+ {
+ int c = reader.read();
+ switch (c) {
+ case -1: // EOF
+ return line.length() > 0;
+ case '\n': // line break
+ case '\r': // line break
+ return 1;
+ default:
+ line += static_cast<wchar_t>(c);
+ if (line.length() > 500)
+ return 1;
+ }
+ }
+ }
+
+ void getExcerptOfFile(wchar_t * dst,
+ const char * path,
+ size_t maxWords,
+ size_t bufSize)
+ {
+ using namespace std;
+ using namespace lucene::util;
+
+ // Lucene reader can do UTF-8 magic, so let's use it
+ FileReader file( path, DEFAULT_ENCODING );
+
+ if ( file.reader->getStatus() == jstreams::Ok )
+ {
+ cpix_EPIState
+ epiState;
+ cpix_init_EPIState(&epiState);
+
+ wstring
+ line;
+
+ while (bufSize > 0 && maxWords > 0 && clgetline(file, line))
+ {
+ dst = cpix_getExcerptOfWText(dst,
+ line.c_str(),
+ &maxWords,
+ &bufSize,
+ &epiState);
+ }
+ }
+ }
+
+}
+
using namespace std;
using namespace Cpt;
@@ -633,6 +698,7 @@
const char DEFAULT_ENCODING[] = "UTF-8";
char tempFile[254];
FILE *fp;
+ wchar_t* excerpt = new wchar_t[MAX_EXCERPT_LENGTH];
convertPDFToText(path);
@@ -658,18 +724,30 @@
doc->add(newField.get());
newField.release();
+ getExcerptOfFile(excerpt,
+ tempFile,
+ 10, // max words
+ sizeof(excerpt) / sizeof(wchar_t));
+ doc->setExcerpt(excerpt);
+
}
else
{
+ //For empty file setting the path as excerpt
+ doc->setExcerpt(doc->get(LCPIX_DOCUID_FIELD));
+
getTempFileName(path,tempFile);
strcat(tempFile,".txt");
remove(tempFile);
}
- doc->setAppClass(PDFAPPCLASS);
+ doc->setAppClass(CONTENTAPPCLASS);
doc->setMimeType(LPDFFILE_MIMETYPE);
+ delete excerpt;
GenericFileProcessor(doc,path);
}
}
+
+
--- a/searchengine/cpix/cpix/src/fileparser/textfileparser.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/cpix/src/fileparser/textfileparser.cpp Mon May 03 13:33:22 2010 +0300
@@ -139,15 +139,28 @@
doc->add(newField.get());
newField.release();
- wchar_t
- excerpt[512];
- getExcerptOfFile(excerpt,
+ /* determine file size. if the stream is not seekable, the size will be -1
+ * Here if the file is empty then we put the path name contained in
+ * "_docuid" as excerpt
+ */
+ FILE* textFilePtr = fopen(path, "r");
+ fseek(textFilePtr, 0, SEEK_END);
+ long long size = ftell(textFilePtr);
+ fseek(textFilePtr, 0, SEEK_SET);
+ fclose(textFilePtr);
+ if (size > 0) {
+ wchar_t excerpt[512];
+ getExcerptOfFile(excerpt,
path,
10, // max words
sizeof(excerpt) / sizeof(wchar_t));
-
- doc->setExcerpt(excerpt);
- doc->setAppClass(TEXTAPPCLASS);
+ doc->setExcerpt(excerpt);
+
+ } else {
+ //For empty file setting the path as excerpt
+ doc->setExcerpt(doc->get(LCPIX_DOCUID_FIELD));
+ }
+ doc->setAppClass(CONTENTAPPCLASS);
doc->setMimeType(LTEXTFILE_MIMETYPE);
// Always perform generic file processing
GenericFileProcessor(doc,path);
--- a/searchengine/cpix/cpix/src/idxdb.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/cpix/src/idxdb.cpp Mon May 03 13:33:22 2010 +0300
@@ -1044,6 +1044,13 @@
doc->native().add(* newField.get());
newField.release();
+ newField.reset(new ld::Field(LCPIX_DEFAULT_PREFIX_FIELD,
+ L"",
+ ld::Field::STORE_NO |
+ ld::Field::INDEX_TOKENIZED));
+
+ doc->native().add(* newField.get());
+ newField.release();
AggregateFieldAnalyzer
aggrAnalyzer(*doc, *analyzer);
--- a/searchengine/cpix/cpix/src/iqrytype.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/cpix/src/iqrytype.cpp Mon May 03 13:33:22 2010 +0300
@@ -198,6 +198,32 @@
*
* The same as above, but now it looks for the term pizza in the field
* specified to the query parser as a default search field.
+ *
+ *
+ * 6 Prefix query
+ * ------------
+ *
+ *
+ *
+ * '$Prefix(QRY)'
+ *
+ * these two have the same meaning, namely, dump all documents that
+ * adhere the actual criteria given by QRY. In fact, these are
+ * resolved as plain, clucene queries. In other words, these for query
+ * syntaxes are equivalent:
+ *
+ * '$Prefix(QRY)'
+ *
+ * The reason dump query is made special by delegating tasks to plain
+ * clucene query is that clients may have easier time to construct
+ * query strings. For instance, the first term might be a word the
+ * user entered or '*' if she entered nothing, and depending on
+ * whether there is some extra search criteria (like '_appclass:'root
+ * file media jpg') can be concatenated at will. That is, the two
+ * parts of a query string can be independently constructed based on
+ * two unrelated variables (1: whether the user has entered anything,
+ * 2: what context / extra criteria we have).
+ *
*/
@@ -218,6 +244,9 @@
// from qrytype/quadqrytype.cpp
IQryType * CreateQuadQryType();
+ // from qrytype/prefixqrytype.cpp
+ IQryType * CreatePrefixQryType();
+
bool StartsWith(const wchar_t * qryStr,
wchar_t wc)
@@ -271,6 +300,7 @@
{ L"address", &Cpix::CreateAddressQryType },
{ L"terms", &Cpix::CreateTermsQryType },
{ L"quad", &Cpix::CreateQuadQryType },
+ { L"prefix", &Cpix::CreatePrefixQryType },
// TODO more search plugins here
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searchengine/cpix/cpix/src/prefixopt.cpp Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "prefixopt.h"
+
+#include "CLucene.h"
+
+#include "cpixsearch.h"
+
+#include "cpixstrtools.h"
+
+namespace Cpix {
+
+ using namespace lucene::search;
+
+ using namespace lucene::index;
+
+ PrefixOptQueryRewriter::PrefixOptQueryRewriter(
+ int maxPrefixLength,
+ const wchar_t* optimizedField,
+ const wchar_t* prefixField )
+ : maxPrefixLength_( maxPrefixLength ),
+ optimizedField_( optimizedField ),
+ prefixField_( prefixField )
+ {}
+
+
+ PrefixOptQueryRewriter::~PrefixOptQueryRewriter()
+ {}
+
+
+ std::auto_ptr<Query> PrefixOptQueryRewriter::rewrite(auto_ptr<Query> query)
+ {
+ PrefixQuery* wildq =
+ dynamic_cast<PrefixQuery*>( query.get() );
+
+ if ( wildq )
+ {
+ Term* term = wildq->getPrefix(false);
+
+ if ( optimizedField_ == term->field() )
+ {
+ int length = wcslen( term->text() );
+ if ( length != -1 && length <= maxPrefixLength_ )
+ {
+ // rewrite term
+ std::wstring text( term->text() );
+ text = text.substr(0, length);
+ term = new Term(prefixField_.c_str(), text.c_str(), true);
+
+ // rewrite query
+ std::auto_ptr<Query> ret( new TermQuery( term ) );
+ query.reset(); // delete old
+ return ret; // return ownership
+ }
+ }
+ }
+ BooleanQuery* boolq =
+ dynamic_cast<BooleanQuery*>( query.get() );
+
+ if ( boolq )
+ {
+ // Just modify the query
+ Cpt::auto_array<BooleanClause*> clauses( boolq->getClauses() );
+
+ for ( int i = 0; i < boolq->getClauseCount(); i++ )
+ {
+ // Transfer ownership to stack
+ std::auto_ptr<Query> clauseq(
+ clauses.get()[i]->query );
+ clauses.get()[i]->query = 0;
+
+ // Rewrite and restore ownership
+ clauseq = rewrite( clauseq );
+ clauses.get()[i]->query = clauseq.release();
+ }
+ }
+
+ return query; // return ownership
+ }
+
+}
--- a/searchengine/cpix/cpix/src/qrytypes/cluceneqrytype.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/cpix/src/qrytypes/cluceneqrytype.cpp Mon May 03 13:33:22 2010 +0300
@@ -31,7 +31,10 @@
#include "cpixutil.h"
#include "iqrytype.h"
-
+//Introduced for prefix optimization.
+#include "prefixopt.h"
+#include "cpixmaindefs.h"
+#include "iqrytype.h"
namespace Cpix
{
@@ -84,9 +87,16 @@
{
THROW_CPIXEXC(PL_ERROR "No arguments needed here");
}
-
+
+ //Can we do get rid of this parse here?
clQuery_ = clQueryParser_->parse(qryStr);
-
+ PrefixOptQueryRewriter prefixOpt_(OPTIMIZED_PREFIX_MAX_LENGTH,
+ LCPIX_DEFAULT_FIELD,
+ LCPIX_DEFAULT_PREFIX_FIELD );
+ //Switch query ownership to stack and back
+ std::auto_ptr<lucene::search::Query> q( clQuery_ ); clQuery_ = NULL;
+ clQuery_ = prefixOpt_.rewrite( q ).release();
+
if (clQuery_ == NULL)
{
THROW_CPIXEXC("Query reduced to empty query.");
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searchengine/cpix/cpix/src/qrytypes/prefixqrytype.cpp Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <wchar.h>
+
+#include "clucene.h"
+#include "clucene/queryParser/multifieldqueryparser.h"
+
+#include "cpixtools.h"
+
+#include "cpixhits.h"
+#include "cpixsearch.h"
+#include "cpixidxdb.h"
+#include "cpixexc.h"
+#include "iidxdb.h"
+#include "initparams.h"
+#include "cpixutil.h"
+#include "iqrytype.h"
+
+#include "cpixmaindefs.h"
+
+
+namespace Cpix
+{
+
+ /**
+ * Format and semantics are described in iqrytype.cpp
+ */
+ class PrefixQryType : public IQryType
+ {
+ private:
+ //
+ // private members
+ //
+ lucene::queryParser::QueryParser * clQueryParser_;
+ lucene::search::Query * clQuery_;
+
+ public:
+ //
+ // public operators
+ //
+
+ //
+ // from interface IQryType
+ //
+
+ virtual void setUp(cpix_QueryParser * queryParser,
+ const std::list<std::wstring> & args,
+ const wchar_t * qryStr)
+ {
+ wchar_t mQryStr[250];
+
+ wmemset(mQryStr,0,250);
+ getAnalyzedString(qryStr, mQryStr );
+
+ clQueryParser_ = Cast2Native<cpix_QueryParser>(queryParser);
+
+ if (args.size() > 0)
+ {
+ THROW_CPIXEXC(PL_ERROR "No arguments needed here");
+ }
+
+ clQuery_ = clQueryParser_->parse((const wchar_t *)mQryStr);
+
+ if (clQuery_ == NULL)
+ {
+ THROW_CPIXEXC("Query reduced to empty query.");
+ }
+ }
+
+
+ virtual cpix_Hits * search(cpix_IdxSearcher * idxSearcher)
+ {
+ return CLuceneSearchIdx(idxSearcher,
+ clQuery_);
+ }
+
+
+ virtual cpix_Hits * search(cpix_IdxDb * idxDb)
+ {
+ return CLuceneSearchIdx(idxDb,
+ clQuery_);
+ }
+
+ void getAnalyzedString(const wchar_t* input, wchar_t* output)
+ {
+
+ CL_NS_USE(index)
+ CL_NS_USE(util)
+ CL_NS_USE(store)
+ CL_NS_USE(search)
+ CL_NS_USE(document)
+ CL_NS_USE(queryParser)
+ CL_NS_USE(analysis)
+ CL_NS_USE2(analysis,standard)
+
+ StandardAnalyzer sAnalyser;
+
+ Reader* reader = _CLNEW StringReader(input);
+ TokenStream* ts = sAnalyser.tokenStream(_T("dummy"), reader );
+ Token t;
+
+ while(ts->next(&t))
+ {
+ wcscat(output,t.termText());
+ wcscat(output,L"* ");
+ }
+ size_t len = wcslen(output);
+
+ if(len == 0)
+ wcscpy(output,L"*");
+ else
+ {
+ if(output[len-1] == L' ')
+ output[len-1] = L'\0';
+ }
+
+ ts->close();
+ _CLDELETE(ts);
+ _CLDELETE(reader);
+
+
+ }
+
+
+ private:
+ //
+ // private implementation details
+ //
+ };
+
+
+
+ IQryType * CreatePrefixQryType()
+ {
+ return new PrefixQryType;
+ }
+
+}
Binary file searchengine/cpix/tsrc/cpixunittest/data/cpixunittestcorpus/pdf/DCTDecode.pdf has changed
Binary file searchengine/cpix/tsrc/cpixunittest/data/cpixunittestcorpus/pdf/Empty.pdf has changed
--- a/searchengine/cpix/tsrc/cpixunittest/group/cpixunittest.mmp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/group/cpixunittest.mmp Mon May 03 13:33:22 2010 +0300
@@ -44,21 +44,26 @@
SOURCE whiteboxtests.cpp
SOURCE destructivetests.cpp
SOURCE prematureqrytests.cpp
+// Avoid media Testcases if MDS not present.
+#ifdef MDS_PRESENT
SOURCE en_stemtests.cpp
+SOURCE geotests.cpp
+SOURCE spi/exifunittest.cpp
+SOURCE spi/id3unittest.cpp
+#endif
+
SOURCE aggregatetests.cpp
-SOURCE geotests.cpp
SOURCE multivolumetests.cpp
SOURCE domainselectiontests.cpp
SOURCE suggestion.cpp
SOURCE negativetests.cpp
-SOURCE utf8.cpp
-SOURCE utf8path.cpp
+SOURCE utf8.cpp
+SOURCE utf8path.cpp
SOURCE analysis.cpp
SOURCE analysiswhitebox.cpp
SOURCE mapstests.cpp
SOURCE documenttest.cpp
-SOURCE spi/exifunittest.cpp
-SOURCE spi/id3unittest.cpp
+
SOURCE flushtests.cpp
SOURCE heartbeattests.cpp
SOURCE terms.cpp
@@ -66,7 +71,7 @@
SOURCE config.cpp
SOURCE clq/uxqry.cpp
SOURCE clq/clqry.cpp
-SOURCE pdftests.cpp
+SOURCE pdftests.cpp querytest.cpp
USERINCLUDE ../../../../../searchsrv_plat/cpix_utility_api/inc
USERINCLUDE ../inc
--- a/searchengine/cpix/tsrc/cpixunittest/sis/cpixunittestcorpus.pkg Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/sis/cpixunittestcorpus.pkg Mon May 03 13:33:22 2010 +0300
@@ -98,6 +98,7 @@
"..\data\cpixunittestcorpus\stem\en\2.txt" - "e:\data\cpixunittestcorpus\stem\en\2.txt"
"..\data\cpixunittestcorpus\stem\en\3.txt" - "e:\data\cpixunittestcorpus\stem\en\3.txt"
"..\data\cpixunittestcorpus\stem\en\4.txt" - "e:\data\cpixunittestcorpus\stem\en\4.txt"
+"..\data\cpixunittestcorpus\stem\en\Empty.txt" - "e:\data\cpixunittestcorpus\stem\en\Empty.txt"
"..\data\cpixunittestcorpus\stem\en\longline.txt" - "e:\data\cpixunittestcorpus\stem\en\longline.txt"
"..\data\cpixunittestcorpus\stem\fi\1.txt" - "e:\data\cpixunittestcorpus\stem\fi\1.txt"
"..\data\cpixunittestcorpus\stem\fi\2.txt" - "e:\data\cpixunittestcorpus\stem\fi\2.txt"
@@ -107,3 +108,6 @@
"..\data\cpixunittestcorpus\pdf\geology.pdf" - "e:\data\cpixunittestcorpus\pdf\geology.pdf"
"..\data\cpixunittestcorpus\pdf\samplepdf.pdf" - "e:\data\cpixunittestcorpus\pdf\samplepdf.pdf"
"..\data\cpixunittestcorpus\pdf\windjack.pdf" - "e:\data\cpixunittestcorpus\pdf\windjack.pdf"
+"..\data\cpixunittestcorpus\pdf\DCTDecode.pdf" - "e:\data\cpixunittestcorpus\pdf\DCTDecode.pdf"
+"..\data\cpixunittestcorpus\pdf\Empty.pdf" - "e:\data\cpixunittestcorpus\pdf\Empty.pdf"
+
--- a/searchengine/cpix/tsrc/cpixunittest/src/cpixunittest.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/cpixunittest.cpp Mon May 03 13:33:22 2010 +0300
@@ -57,6 +57,7 @@
Itk::TesterBase * CreateDocumentTests();
Itk::TesterBase * CreateTermSearchTests();
Itk::TesterBase * CreatePdfSearchTests();
+Itk::TesterBase * CreateQueryTests();
Itk::TesterBase * CreateFlushTests();
Itk::TesterBase * CreateHeartbeatTests();
@@ -67,6 +68,8 @@
Itk::TesterBase * CreateASyncTests();
+// Avoid media Testcases if MDS not present.
+#ifdef MDS_PRESENT
// Spi
Itk::TesterBase * CreateExifTests();
Itk::TesterBase * CreateId3Tests();
@@ -84,7 +87,7 @@
return spi;
}
-
+#endif
Itk::TesterBase * CreateTestHierarchy()
@@ -95,7 +98,7 @@
SuiteTester
* all = new SuiteTester("all");
-
+//
all->add(CreateSuiteTesterRandom());
all->add(CreateDestructiveTests());
all->add(CreatePrematureQryTests());
@@ -104,28 +107,33 @@
all->add(CreatePartialSmsTests());
all->add(CreateDeletionTests());
all->add(CreateWhiteBoxTests());
- all->add(CreateStemTests());
all->add(CreateAggregateTests());
all->add(CreateNegativeTests());
- all->add(CreateGeoTests());
+
all->add(CreateMultiVolumeTests());
all->add(CreateDomainSelectionTests());
all->add(CreateUtf8Tests());
all->add(CreateUtf8PathTests());
all->add(CreateAnalysisTests());
- all->add(CreateMapsTests());
+
all->add(CreateDocumentTests());
all->add(CreateFlushTests());
all->add(CreateHeartbeatTests());
all->add(CreateTermSearchTests());
- //all->add(CreatePdfSearchTests());
+ all->add(CreatePdfSearchTests());
// TODO enable later Itk::TesterBase * CreateClQryHierarchy();
all->add(CreateASyncTests());
- all->add(CreateSpiHierarchy());
+#ifdef MDS_PRESENT
+ //all->add(CreateStemTests()); //Commented for STEMMER
+ //all->add(CreateGeoTests()); //Comment for GEO
+ //all->add(CreateMapsTests()); //Comment for MAP
+ // all->add(CreateSpiHierarchy()); // Commented for JPG/EXIF files checks
+#endif
+ all->add(CreateQueryTests());
// add more top level test suites here
// ...
--- a/searchengine/cpix/tsrc/cpixunittest/src/pdftests.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/pdftests.cpp Mon May 03 13:33:22 2010 +0300
@@ -37,20 +37,22 @@
#include "testutils.h"
#include "suggestion.h"
-const char * PdfDocsToIndex[5] = {
- FILE_TEST_CORPUS_PATH "\\pdf\\ctutor.pdf",
-// FILE_TEST_CORPUS_PATH "\\pdf\\geology.pdf",
-// FILE_TEST_CORPUS_PATH "\\pdf\\samplepdf.pdf",
-// FILE_TEST_CORPUS_PATH "\\pdf\\windjack.pdf",
+const char * PdfDocsToIndex[7] = {
+ "c:\\data\\cpixunittestcorpus\\pdf\\ctutor.pdf",
+ "c:\\data\\cpixunittestcorpus\\stem\\pdf\\geology.pdf",
+ "c:\\data\\cpixunittestcorpus\\stem\\pdf\\samplepdf.pdf",
+ "c:\\data\\cpixunittestcorpus\\stem\\pdf\\windjack.pdf",
+ "c:\\data\\cpixunittestcorpus\\stem\\pdf\\DCTDecode.pdf",
+ "c:\\data\\cpixunittestcorpus\\stem\\pdf\\Empty.pdf",
NULL
};
const wchar_t * PdfSearchParameters[5] = {
L"inline",
-// L"CALDEBA",
-// L"sample",
-// L"reset",
+ L"CALDEBA",
+ L"sample",
+ L"reset",
NULL
};
@@ -67,7 +69,7 @@
std::auto_ptr<FileIdxUtil> util( new FileIdxUtil );
- util->init();
+ util->init(TRUE);
cpix_Analyzer* analyzer = cpix_CreateSimpleAnalyzer(&result);
@@ -78,12 +80,7 @@
util->indexFile( PdfDocsToIndex[i], analyzer, testMgr );
}
- for (int i = 0; Mp3TestCorpus[i]; i++)
- {
- util->indexFile( Mp3TestCorpus[i], analyzer, testMgr );
- }
-
- util->flush();
+ util->flush();
for (int i = 0; PdfSearchParameters[i]; i++)
{
@@ -98,12 +95,7 @@
}
std::wostringstream queryString;
- if ( appclassPrefix ) {
- queryString<<L"$terms<5,'"<<appclassPrefix<<L"'>("<<PdfSearchParameters[i]<<L")";
- } else {
- queryString<<L"$terms<5>("<<PdfSearchParameters[i]<<L")";
- }
-
+ queryString<<L"adobe";
cpix_Query* query = cpix_QueryParser_parse(queryParser,
queryString.str().c_str());
if (cpix_Failed(queryParser)
@@ -114,23 +106,23 @@
cpix_QueryParser_destroy(queryParser);
ITK_PANIC("Could not parse query string");
}
- cpix_QueryParser_destroy(queryParser);
-
+
cpix_Hits
* hits = cpix_IdxDb_search(util->idxDb(),
query );
int32_t hitsLength = cpix_Hits_length(hits);
- cpix_Query_destroy( query );
-
+
wprintf(L"Results for %S:\n", PdfSearchParameters[i]);
Suggestion::printSuggestions(hits,
- testMgr);
-
+ testMgr);
printf("\n");
-
- cpix_Hits_destroy( hits );
+
+ cpix_Analyzer_destroy(analyzer);
+ cpix_Hits_destroy( hits );
+ cpix_Query_destroy( query );
+ cpix_QueryParser_destroy(queryParser);
}
}
@@ -151,5 +143,3 @@
return pdfTests;
}
-
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searchengine/cpix/tsrc/cpixunittest/src/querytest.cpp Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,248 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <wchar.h>
+#include <stddef.h>
+
+#include <iostream>
+#include <sstream>
+#include "indevicecfg.h"
+
+#include "cpixidxdb.h"
+
+#include "itk.h"
+//#include "xmllog.h"
+#include "config.h"
+#include "testutils.h"
+#include "suggestion.h"
+
+
+const char * docsToIndex[5] = {
+CORPUS_PATH "\\query\\query1.txt",
+CORPUS_PATH "\\query\\query2.txt",
+CORPUS_PATH "\\query\\query3.txt",
+CORPUS_PATH "\\query\\query4.txt",
+NULL
+};
+
+void setupPlainQuery(Itk::TestMgr * testMgr)
+ {
+ cpix_Result
+ result;
+
+ cpix_IdxDb_dbgScrapAll(&result);
+ ITK_ASSERT(testMgr,
+ cpix_Succeeded(&result),
+ "Could not get rid of all test qbac-idx pairs");
+ std::auto_ptr<FileIdxUtil> util( new FileIdxUtil );
+ util->init(true);
+ cpix_Analyzer* analyzer = cpix_Analyzer_create(&result, L"standard");
+ if ( cpix_Failed( &result) ) ITK_PANIC("Analyzer could not be created");
+ for (int i = 0; docsToIndex[i]; i++)
+ {
+ util->indexFile( docsToIndex[i], analyzer, testMgr );
+ }
+ util->flush();
+ cpix_Analyzer_destroy(analyzer);
+ }
+
+void setupPrefixQuery(Itk::TestMgr * testMgr)
+ {
+ cpix_Result
+ result;
+
+ cpix_IdxDb_dbgScrapAll(&result);
+ ITK_ASSERT(testMgr,
+ cpix_Succeeded(&result),
+ "Could not get rid of all test qbac-idx pairs");
+ std::auto_ptr<FileIdxUtil> util( new FileIdxUtil );
+ util->init(true);
+ cpix_Analyzer* analyzer = cpix_Analyzer_create(&result, L"standard");
+ if ( cpix_Failed( &result) ) ITK_PANIC("Analyzer could not be created");
+
+ util->indexFile( CORPUS_PATH "\\query\\query5.txt", analyzer, testMgr );
+
+ util->flush();
+ util->indexFile( CORPUS_PATH "\\query\\query6.txt", analyzer, testMgr );
+
+ util->flush();
+ cpix_Analyzer_destroy(analyzer);
+ }
+
+void testQuery(Itk::TestMgr * testMgr, const wchar_t *qryStr, int hitLen)
+{
+cpix_Result
+ result;
+int32_t hitsLength = 0;
+
+ std::auto_ptr<FileIdxUtil> util( new FileIdxUtil );
+
+ util->init(false);
+ cpix_Analyzer* analyzer = cpix_Analyzer_create(&result, L"standard");
+ if ( cpix_Failed( &result) ) ITK_PANIC("Analyzer could not be created");
+ cpix_QueryParser
+ * queryParser = cpix_QueryParser_create(&result,
+ LCPIX_DEFAULT_FIELD,
+ analyzer );
+ if (queryParser == NULL)
+ {
+ cpix_Analyzer_destroy( analyzer );
+ ITK_PANIC("Could not create query parser");
+ }
+
+
+
+ cpix_Query* query = cpix_QueryParser_parse(queryParser,
+ qryStr);
+ if (cpix_Failed(queryParser)
+ || query == NULL)
+ {
+ cpix_Analyzer_destroy(analyzer);
+ cpix_ClearError(queryParser);
+ cpix_QueryParser_destroy(queryParser);
+ ITK_PANIC("Could not parse query string");
+ }
+ cpix_QueryParser_destroy(queryParser);
+
+ cpix_Hits
+ * hits = cpix_IdxDb_search(util->idxDb(),
+ query );
+
+ if (cpix_Succeeded(hits))
+ {
+ hitsLength = cpix_Hits_length(hits);
+ cpix_Hits_destroy( hits );
+ }
+ if(hitsLength == hitLen )
+ {
+
+ ITK_MSG(testMgr, "Query %S, returned %d hits. Passed \n",qryStr,hitsLength );
+ }
+ else
+ {
+
+ ITK_MSG(testMgr, "Query %S, didnt return expected hits. Expected is %d hits. Returned is %d. Failed \n",qryStr,hitLen,hitsLength);
+ }
+
+ cpix_Query_destroy( query );
+
+ cpix_Analyzer_destroy(analyzer);
+}
+
+
+
+void CreatePlainQueryTest(Itk::TestMgr * testMgr)
+{
+ bool val = true;
+ setupPlainQuery(testMgr);
+ testQuery(testMgr,L"Nokia", 2);
+ testQuery(testMgr,L"iNdia", 1);
+ testQuery(testMgr,L"\"London Finland\"", 1);
+ testQuery(testMgr,L"Contents:Nokia", 2);
+ testQuery(testMgr,L"Contents:Nokia AND country", 1);
+ testQuery(testMgr,L"Contents:Nokia && country", 1);
+ testQuery(testMgr,L"Nokia Selvaraj", 3);
+ testQuery(testMgr,L"Lo?don", 1);
+ testQuery(testMgr,L"countr?", 1);
+ testQuery(testMgr,L"country?", 0);
+ testQuery(testMgr,L"?india", 0);
+ testQuery(testMgr,L"nok*", 2);
+ testQuery(testMgr,L"count?ry", 0);
+ testQuery(testMgr,L"roam~", 2);
+ testQuery(testMgr,L"ro~am", 0);
+ testQuery(testMgr,L"\"london country\"~10", 1);
+ testQuery(testMgr,L"\"nokia country\"~2", 0);
+ testQuery(testMgr,L"nokia basker", 3);
+ testQuery(testMgr,L"Nokia^5 basker", 3);
+ testQuery(testMgr,L"Nokia basker^5", 3);
+ testQuery(testMgr,L"Nokia || basker", 3);
+ testQuery(testMgr,L"Nokia OR basker", 3);
+ testQuery(testMgr,L"Nokia AND basker", 0);
+ testQuery(testMgr,L"Nokia && basker", 0);
+ testQuery(testMgr,L"+nokia country", 2);
+ testQuery(testMgr,L"+nokia roam", 2);
+ testQuery(testMgr,L"Nokia !country", 1);
+ testQuery(testMgr,L"nokia NOT country", 1);
+ testQuery(testMgr,L"nokia NOT basker", 2);
+ testQuery(testMgr,L"NOT India", 1);
+ testQuery(testMgr,L"(india OR Mobile) AND Nokia", 2);
+ testQuery(testMgr,L"(india OR Mobile) AND Country", 1);
+ // create_xml(val,__func__,__FILE__,__LINE__);
+}
+
+void CreatePrefixQueryTest(Itk::TestMgr * testMgr)
+{
+ bool val = true;
+ setupPrefixQuery(testMgr);
+ testQuery(testMgr,L"$prefix(\"new-notes\")", 1);
+ testQuery(testMgr,L"$prefix(\"notes\")", 1);
+ testQuery(testMgr,L"$prefix(\"new\")", 1);
+ testQuery(testMgr,L"$prefix(\"-india\")", 1);
+ testQuery(testMgr,L"$prefix(\"tamil-nadu\")", 1);
+ testQuery(testMgr,L"$prefix(\"testing\")", 2);
+ testQuery(testMgr,L"$prefix(\"*shankar\")", 2);
+ testQuery(testMgr,L"$prefix(\"Ani*rban\")", 1);
+ testQuery(testMgr,L"$prefix(\"kumar*\")", 1);
+ testQuery(testMgr,L"$prefix(\"carrot^\")", 1);
+ testQuery(testMgr,L"$prefix(\"carrot\")", 1);
+ testQuery(testMgr,L"$prefix(\"ani\")", 1);
+ testQuery(testMgr,L"$prefix(\"question\")", 1);
+ testQuery(testMgr,L"$prefix(\"question?\")", 1);
+ testQuery(testMgr,L"$prefix(\"|pipe\")", 1);
+ testQuery(testMgr,L"$prefix(\"&&ambersend\")", 1);
+ testQuery(testMgr,L"$prefix(\"!=Exclamation\")", 1);
+ testQuery(testMgr,L"$prefix(\":colon\")", 1);
+ testQuery(testMgr,L"$prefix(\"http:\\www.nokia.com\")", 1);
+ testQuery(testMgr,L"$prefix(\"%percentage\")", 1);
+ testQuery(testMgr,L"$prefix(\"(testing)\")", 2);
+ testQuery(testMgr,L"$prefix(\"mail-id\")", 1);
+ testQuery(testMgr,L"$prefix(\"mail id\")", 1);
+ testQuery(testMgr,L"$prefix(\"shankar.rajendran@nokia.com\")", 1);
+ testQuery(testMgr,L"$prefix(\"~tild\")", 1);
+ testQuery(testMgr,L"$prefix(\"shankar\")", 2);
+ testQuery(testMgr,L"$prefix(\"`singlequote\")", 1);
+ testQuery(testMgr,L"$prefix(\"singlequote\")", 1);
+ testQuery(testMgr,L"$prefix(\"\"doublequote\")", 1);
+ testQuery(testMgr,L"$prefix(\"doublequote\")", 1);
+ testQuery(testMgr,L"$prefix(\";semicolon\")", 1);
+ testQuery(testMgr,L"$prefix(\"/slash\")", 1);
+ testQuery(testMgr,L"$prefix(\"slash\")", 1);
+ testQuery(testMgr,L"$prefix(\"\\backslash\")", 1);
+ testQuery(testMgr,L"$prefix(\"backslash\")", 1);
+ testQuery(testMgr,L"$prefix(\"[squarebracket]\")", 1);
+ testQuery(testMgr,L"$prefix(\"{flowerbracket}\")", 1);
+ testQuery(testMgr,L"$prefix(\"<lessthan\")", 1);
+ testQuery(testMgr,L"$prefix(\">greaterthan\")", 1);
+ testQuery(testMgr,L"$prefix(\"worked for motorola .\")", 1);
+
+}
+
+Itk::TesterBase * CreateQueryTests()
+{
+ using namespace Itk;
+
+ ContextTester
+ * qryTests = new ContextTester("Query Tests", NULL);
+
+ qryTests->add("PlainQueryTest", &CreatePlainQueryTest);
+ qryTests->add("PrefixQueryTest", &CreatePrefixQueryTest);
+
+ return qryTests;
+}
+
+
--- a/searchengine/oss/cl/clucene/src/clucene/search/phrasequery.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/oss/cl/clucene/src/clucene/search/phrasequery.cpp Mon May 03 13:33:22 2010 +0300
@@ -5,7 +5,7 @@
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "clucene/stdheader.h"
-#include "PhraseQuery.h"
+#include "phrasequery.h"
#include "searchheader.h"
#include "scorer.h"
--- a/searchengine/oss/cl/clucene/src/clucene/search/phrasescorer.h Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/oss/cl/clucene/src/clucene/search/phrasescorer.h Mon May 03 13:33:22 2010 +0300
@@ -11,7 +11,7 @@
# pragma once
#endif
-#include "CLucene/search/phrasequeue.h"
+#include "clucene/search/phrasequeue.h"
#include "clucene/search/phrasepositions.h"
#include "clucene/search/scorer.h"
#include "clucene/search/similarity.h"
--- a/searchengine/oss/cl/clucene/src/clucene/search/sort.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/oss/cl/clucene/src/clucene/search/sort.cpp Mon May 03 13:33:22 2010 +0300
@@ -5,7 +5,7 @@
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "clucene/stdheader.h"
-#include "Sort.h"
+#include "sort.h"
#include "compare.h"
CL_NS_USE(util)
--- a/searchengine/oss/cl/clucene/src/clucene/search/termquery.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/oss/cl/clucene/src/clucene/search/termquery.cpp Mon May 03 13:33:22 2010 +0300
@@ -10,7 +10,7 @@
#include "searchheader.h"
#include "scorer.h"
#include "clucene/index/term.h"
-#include "TermScorer.h"
+#include "termscorer.h"
#include "clucene/index/indexreader.h"
#include "clucene/util/stringbuffer.h"
#include "clucene/index/terms.h"
--- a/searchengine/oss/cl/clucene/src/clucene/search/termscorer.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searchengine/oss/cl/clucene/src/clucene/search/termscorer.cpp Mon May 03 13:33:22 2010 +0300
@@ -5,7 +5,7 @@
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "clucene/stdheader.h"
-#include "TermScorer.h"
+#include "termscorer.h"
#include "clucene/index/terms.h"
#include "termquery.h"
--- a/searcher/searchclient/group/searchclient.mmp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/searchclient/group/searchclient.mmp Mon May 03 13:33:22 2010 +0300
@@ -32,6 +32,7 @@
SOURCE RSearchServerSession.cpp
USERINCLUDE ../inc
+USERINCLUDE ../traces
USERINCLUDE ../../../searchsrv_plat/cpix_utility_api/inc
MW_LAYER_SYSTEMINCLUDE
--- a/searcher/searchclient/src/ccpixsearcher.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/searchclient/src/ccpixsearcher.cpp Mon May 03 13:33:22 2010 +0300
@@ -23,6 +23,11 @@
#include "CCPixSearcher.h"
#include "MCPixSearcherObserver.h"
#include "SearchServerCommon.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "ccpixsearcherTraces.h"
+#endif
+
// CCPixSearcher::NewL()
// Two-phased constructor.
@@ -179,6 +184,7 @@
// Issues a new search
EXPORT_C TInt CCPixSearcher::SearchL(const TDesC& aQueryString, const TDesC& aDocumentField)
{
+ OstTraceFunctionEntry0( CCPIXSEARCHER_SEARCHL_ENTRY );
PERFORMANCE_LOG_START("CCPixSearcher::SearchL");
if ( !iIsDatabaseOpen )
@@ -200,6 +206,7 @@
EXPORT_C void CCPixSearcher::SearchL(MCPixSearchRequestObserver& aObserver, const TDesC& aQueryString, const TDesC& aDocumentField)
{
+ OstTraceFunctionEntry0( DUP1_CCPIXSEARCHER_SEARCHL_ENTRY );
PERFORMANCE_LOG_START("CCPixSearcher::SearchL");
if ( !iIsDatabaseOpen ) User::Leave( KErrNotReady );
@@ -215,12 +222,13 @@
iObserver.iSearch = &aObserver;
iState = EStateSearch;
iSubSession.Search( *iQueryString, iStatus );
- SetActive();
-
+ OstTraceFunctionExit0( CCPIXSEARCHER_SEARCHL_EXIT );
+ SetActive();
}
EXPORT_C CSearchDocument* CCPixSearcher::GetDocumentL(TInt aIndex)
{
+ OstTraceFunctionEntry0( CCPIXSEARCHER_GETDOCUMENTL_ENTRY );
PERFORMANCE_LOG_START("CCPixSearcher::GetDocumentL");
if ( !iIsDatabaseOpen ) User::Leave( KErrNotReady );
@@ -234,6 +242,7 @@
EXPORT_C void CCPixSearcher::GetDocumentL(TInt aIndex, MCPixNextDocumentRequestObserver& aObserver)
{
+ OstTraceFunctionEntry0( DUP1_CCPIXSEARCHER_GETDOCUMENTL_ENTRY );
PERFORMANCE_LOG_START("CCPixSearcher::GetDocumentL");
if ( !iIsDatabaseOpen ) User::Leave( KErrNotReady );
@@ -246,7 +255,8 @@
iState = EStateGetDocument;
iSubSession.GetDocument(aIndex, iStatus);
- SetActive();
+ OstTraceFunctionExit0( CCPIXSEARCHER_GETDOCUMENTL_EXIT );
+ SetActive();
}
// CCPixSearcher::RunL()
--- a/searcher/searchclient/src/rsearchserversession.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/searchclient/src/rsearchserversession.cpp Mon May 03 13:33:22 2010 +0300
@@ -24,6 +24,11 @@
#include "SearchServerCommon.h"
#include "RSearchServerSession.h"
#include "CSearchDocument.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "rsearchserversessionTraces.h"
+#endif
+
// FUNCTION PROTOTYPES
@@ -191,6 +196,7 @@
// RSearchServerSubSession::Search()
EXPORT_C void RSearchServerSubSession::SearchL(const TDesC& aSearchTerms)
{
+ OstTraceFunctionEntry0( RSEARCHSERVERSUBSESSION_SEARCHL_ENTRY );
PERFORMANCE_LOG_START("RSearchServerSubSession::SearchL");
iEstimatedResultsCount = 0;
@@ -203,10 +209,12 @@
// descriptors as they will be out of scope by the time the server
// attempts to read or write
User::LeaveIfError( SendReceive(ESearchServerSearch, args) );
+ OstTraceFunctionExit0( RSEARCHSERVERSUBSESSION_SEARCHL_EXIT );
}
EXPORT_C void RSearchServerSubSession::Search(const TDesC& aSearchTerms, TRequestStatus& aStatus)
{
+ OstTraceFunctionEntry0( RSEARCHSERVERSUBSESSION_SEARCH_ENTRY );
PERFORMANCE_LOG_START("RSearchServerSubSession::SearchL");
iEstimatedResultsCount = 0;
@@ -219,6 +227,7 @@
// descriptors as they will be out of scope by the time the server
// attempts to read or write
SendReceive(ESearchServerSearch, args, aStatus);
+ OstTraceFunctionExit0( RSEARCHSERVERSUBSESSION_SEARCH_EXIT );
}
// RSearchServerSubSession::GetEstimatedDocumentCount()
@@ -230,6 +239,7 @@
// RSearchServerSubSession::GetDocument()
EXPORT_C CSearchDocument* RSearchServerSubSession::GetDocumentL(TInt aIndex)
{
+ OstTraceFunctionEntry0( RSEARCHSERVERSUBSESSION_GETDOCUMENTL_ENTRY );
PERFORMANCE_LOG_START("RSearchServerSubSession::GetDocumentL");
iDocumentSize = 0;
@@ -244,6 +254,7 @@
EXPORT_C void RSearchServerSubSession::GetDocument(TInt aIndex, TRequestStatus& aStatus)
{
+ OstTraceFunctionEntry0( RSEARCHSERVERSUBSESSION_GETDOCUMENT_ENTRY );
PERFORMANCE_LOG_START("RSearchServerSubSession::GetDocument");
iDocumentSize = 0;
@@ -252,11 +263,13 @@
TIpcArgs args(aIndex, &iDocumentSizePckg);
SendReceive(ESearchServerGetDocument, args, aStatus );
+ OstTraceFunctionExit0( RSEARCHSERVERSUBSESSION_GETDOCUMENT_EXIT );
}
EXPORT_C CSearchDocument* RSearchServerSubSession::GetDocumentObjectL()
{
+ OstTraceFunctionEntry0( RSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_ENTRY );
PERFORMANCE_LOG_START("CCPixSearcher::GetDocumentObjectL");
CSearchDocument* document = NULL;
@@ -275,6 +288,7 @@
CleanupStack::PopAndDestroy(buf);
}
+ OstTraceFunctionExit0( RSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_EXIT );
return document;
}
@@ -323,8 +337,10 @@
EXPORT_C void RSearchServerSubSession::UpdateL(const TDesC8& aSerializedDocument)
{
TIpcArgs args(&aSerializedDocument);
+ OstTrace0( TRACE_NORMAL, RSEARCHSERVERSUBSESSION_UPDATEL, "RSearchServerSubSession::UpdateL(): sending the request to server" );
CPIXLOGSTRING( "RSearchServerSubSession::UpdateL(): sending the request to server" );
User::LeaveIfError( SendReceive(ESearchServerUpdate, args) );
+ OstTrace0( TRACE_NORMAL, DUP1_RSEARCHSERVERSUBSESSION_UPDATEL, "RSearchServerSubSession::UpdateL(): sent the request to server success" );
CPIXLOGSTRING( "RSearchServerSubSession::UpdateL(): sent the request to server success" );
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchclient/traces/CCPixSearcherTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,20 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CCPIXSEARCHERTRACES_H__
+#define __CCPIXSEARCHERTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6fe
+
+#define CCPIXSEARCHER_SEARCHL_ENTRY 0x8a0001
+#define DUP1_CCPIXSEARCHER_SEARCHL_ENTRY 0x8a0002
+#define CCPIXSEARCHER_SEARCHL_EXIT 0x8a0003
+#define CCPIXSEARCHER_GETDOCUMENTL_ENTRY 0x8a0004
+#define DUP1_CCPIXSEARCHER_GETDOCUMENTL_ENTRY 0x8a0005
+#define CCPIXSEARCHER_GETDOCUMENTL_EXIT 0x8a0006
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchclient/traces/OstTraceDefinitions.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchclient/traces/RSearchServerSessionTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,25 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __RSEARCHSERVERSESSIONTRACES_H__
+#define __RSEARCHSERVERSESSIONTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6fe
+
+#define RSEARCHSERVERSUBSESSION_SEARCHL_ENTRY 0x8a0007
+#define RSEARCHSERVERSUBSESSION_SEARCHL_EXIT 0x8a0008
+#define RSEARCHSERVERSUBSESSION_SEARCH_ENTRY 0x8a0009
+#define RSEARCHSERVERSUBSESSION_SEARCH_EXIT 0x8a000a
+#define RSEARCHSERVERSUBSESSION_GETDOCUMENTL_ENTRY 0x8a000b
+#define RSEARCHSERVERSUBSESSION_GETDOCUMENT_ENTRY 0x8a000c
+#define RSEARCHSERVERSUBSESSION_GETDOCUMENT_EXIT 0x8a000d
+#define RSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_ENTRY 0x8a000e
+#define RSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_EXIT 0x8a000f
+#define RSEARCHSERVERSUBSESSION_UPDATEL 0x860001
+#define DUP1_RSEARCHSERVERSUBSESSION_UPDATEL 0x860002
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchclient/traces/fixed_id.definitions Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,20 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FLOW=0x8a
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCHER_GETDOCUMENTL_ENTRY=0x4
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCHER_GETDOCUMENTL_EXIT=0x6
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCHER_SEARCHL_ENTRY=0x1
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCHER_SEARCHL_EXIT=0x3
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CCPIXSEARCHER_GETDOCUMENTL_ENTRY=0x5
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CCPIXSEARCHER_SEARCHL_ENTRY=0x2
+[TRACE]TRACE_FLOW[0x8A]_RSEARCHSERVERSUBSESSION_GETDOCUMENTL_ENTRY=0xb
+[TRACE]TRACE_FLOW[0x8A]_RSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_ENTRY=0xe
+[TRACE]TRACE_FLOW[0x8A]_RSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_EXIT=0xf
+[TRACE]TRACE_FLOW[0x8A]_RSEARCHSERVERSUBSESSION_GETDOCUMENT_ENTRY=0xc
+[TRACE]TRACE_FLOW[0x8A]_RSEARCHSERVERSUBSESSION_GETDOCUMENT_EXIT=0xd
+[TRACE]TRACE_FLOW[0x8A]_RSEARCHSERVERSUBSESSION_SEARCHL_ENTRY=0x7
+[TRACE]TRACE_FLOW[0x8A]_RSEARCHSERVERSUBSESSION_SEARCHL_EXIT=0x8
+[TRACE]TRACE_FLOW[0x8A]_RSEARCHSERVERSUBSESSION_SEARCH_ENTRY=0x9
+[TRACE]TRACE_FLOW[0x8A]_RSEARCHSERVERSUBSESSION_SEARCH_EXIT=0xa
+[TRACE]TRACE_NORMAL[0x86]_DUP1_RSEARCHSERVERSUBSESSION_UPDATEL=0x2
+[TRACE]TRACE_NORMAL[0x86]_RSEARCHSERVERSUBSESSION_UPDATEL=0x1
--- a/searcher/searchserver/group/searchserver.mmp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/searchserver/group/searchserver.mmp Mon May 03 13:33:22 2010 +0300
@@ -36,6 +36,7 @@
OS_LAYER_GLIB_SYSTEMINCLUDE
USERINCLUDE ../inc
+USERINCLUDE ../traces
USERINCLUDE ../../../searchsrv_plat/cpix_utility_api/inc
USERINCLUDE ../../SearchClient/inc
USERINCLUDE ../../../searchengine/cpix/cpix/inc/public
--- a/searcher/searchserver/inc/csearchserversubsession.h Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/searchserver/inc/csearchserversubsession.h Mon May 03 13:33:22 2010 +0300
@@ -153,6 +153,7 @@
private:
void ConstructL();
CSearchServerSubSession(CSearchServerSession* aSession);
+ void LimitExcerptToMaxLengthL(CSearchDocument* aSearchDocument);
private:
CCPixIdxDb* iIndexDb;
--- a/searcher/searchserver/src/ccpixidxdb.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/searchserver/src/ccpixidxdb.cpp Mon May 03 13:33:22 2010 +0300
@@ -25,12 +25,18 @@
#include "SearchServerConfiguration.h"
#include "SearchServerHelper.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "ccpixidxdbTraces.h"
+#endif
+
namespace {
void DumpDocument(const CSearchDocument& aDocument)
{
#ifdef CPIX_LOGGING_ENABLED
+ OstTraceExt1( TRACE_NORMAL, CPIXIDXDB_DUMPDOCUMENT, "::DumpDocument;Start_docuid=%S", (aDocument.Id()) );
CPIXLOGSTRING2("DumpDocument START _docuid=%S", &(aDocument.Id()));
_LIT(KDocUid, CPIX_DOCUID_FIELD);
@@ -43,8 +49,10 @@
{
continue; // lets not print this information out twice.
}
+ OstTraceExt2( TRACE_NORMAL, DUP1_CPIXIDXDB_DUMPDOCUMENT, "::DumpDocument;Fieldname=%S;Value=%S", (field.Name()), (field.Value()) );
CPIXLOGSTRING3("DumpDocument FieldName=%S,Value=%S", &(field.Name()), &(field.Value()));
}
+ OstTraceExt1( TRACE_NORMAL, DUP2_CPIXIDXDB_DUMPDOCUMENT, "::DumpDocument;End_docuid=%S", (aDocument.Id()) );
CPIXLOGSTRING2("DumpDocument END _docuid=%S", &(aDocument.Id()));
#endif // CPIX_LOGGING_ENABLED
}
@@ -280,6 +288,7 @@
cpix_Document* document = NULL;
document = ConvertToCpixDocumentLC(aDocument);
+ OstTrace0( TRACE_NORMAL, CCPIXIDXDB_ADDL, "CCPixIdxDb::AddL" );
CPIXLOGSTRING("CCPixIdxDb::AddL");
DumpDocument(aDocument);
iPendingJobId = cpix_IdxDb_asyncAdd(iIdxDb, document, iAnalyzer, (void*)this, &CompletionCallback);
@@ -305,6 +314,7 @@
cpix_Document* document = NULL;
document = ConvertToCpixDocumentLC(aDocument);
+ OstTrace0( TRACE_NORMAL, CCPIXIDXDB_UPDATEL, "CCPixIdxDb::UpdateL" );
CPIXLOGSTRING("CCPixIdxDb::UpdateL");
DumpDocument(aDocument);
iPendingJobId = cpix_IdxDb_asyncUpdate(iIdxDb, document, iAnalyzer, (void*)this, &CompletionCallback);
@@ -327,6 +337,7 @@
if (iIsPending)
User::Leave(KErrInUse);
+ OstTraceExt1( TRACE_NORMAL, CCPIXIDXDB_DELETEDOCUMENTSL, "CCPixIdxDb::DeleteDocumentsL;aDocUid=%S", aDocUid );
CPIXLOGSTRING2("CCPixIdxDb::DeleteDocumentsL aDocUid=%S", &aDocUid);
HBufC* docUid = HBufC::NewLC(aDocUid.Length() + 1);
--- a/searcher/searchserver/src/ccpixsearch.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/searchserver/src/ccpixsearch.cpp Mon May 03 13:33:22 2010 +0300
@@ -21,6 +21,11 @@
#include "SearchServerLogger.h"
#include "CCPixAsyncronizer.h"
#include "SearchServerHelper.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "ccpixsearchTraces.h"
+#endif
+
namespace {
@@ -117,6 +122,7 @@
void CCPixSearch::LogCancelAction(cpix_CancelAction aCancelAction)
{
#ifdef CPIX_LOGGING_ENABLED
+ OstTrace1( TRACE_NORMAL, CCPIXSEARCH_LOGCANCELACTION, "CCPixSearch::LogCancelAction;Cancel action code=%d", aCancelAction );
CPIXLOGSTRING2("Cancel action code %d", aCancelAction);
#endif // CPIX_LOGGING_ENABLED
}
@@ -137,6 +143,7 @@
TBool CCPixSearch::SearchL(const TDesC& aSearchTerms, MCPixAsyncronizerObserver* aObserver, const RMessage2& aMessage)
{
+ OstTraceFunctionEntry0( CCPIXSEARCH_SEARCHL_ENTRY );
PERFORMANCE_LOG_START("CCPixSearch::SearchL");
if (iPendingTask != EPendingTaskNone)
@@ -170,15 +177,18 @@
iPendingTask = EPendingTaskSearch;
iAsyncronizer->Start(ECPixTaskTypeSearch, aObserver, aMessage);
+ OstTraceFunctionExit0( CCPIXSEARCH_SEARCHL_EXIT );
return ETrue;
}
// Search was not committed
+ OstTraceFunctionExit0( DUP1_CCPIXSEARCH_SEARCHL_EXIT );
return EFalse;
}
TInt CCPixSearch::SearchCompleteL()
{
+ OstTraceFunctionEntry0( CCPIXSEARCH_SEARCHCOMPLETEL_ENTRY );
PERFORMANCE_LOG_START("CCPixSearch::SearchCompleteL");
// Request is no more pending
iPendingTask = EPendingTaskNone;
@@ -189,11 +199,13 @@
iDocumentCount = cpix_Hits_length(iHits);
SearchServerHelper::CheckCpixErrorL(iHits, KErrDatabaseQueryFailed);
+ OstTraceFunctionExit0( CCPIXSEARCH_SEARCHCOMPLETEL_EXIT );
return iDocumentCount;
}
void CCPixSearch::GetDocumentL(TInt aIndex, MCPixAsyncronizerObserver* aObserver, const RMessage2& aMessage)
{
+ OstTraceFunctionEntry0( CCPIXSEARCH_GETDOCUMENTL_ENTRY );
PERFORMANCE_LOG_START("CCPixSearch::GetDocumentL");
if (iPendingTask != EPendingTaskNone)
@@ -213,10 +225,12 @@
User::Leave(KErrDocumentAccessFailed);
}
iAsyncronizer->Start(ECPixTaskTypeGetDocument, aObserver, aMessage);
+ OstTraceFunctionExit0( CCPIXSEARCH_GETDOCUMENTL_EXIT );
}
CSearchDocument* CCPixSearch::GetDocumentCompleteL()
{
+ OstTraceFunctionEntry0( CCPIXSEARCH_GETDOCUMENTCOMPLETEL_ENTRY );
PERFORMANCE_LOG_START("CCPixSearch::GetDocumentCompleteL");
// Request is no more pending
@@ -284,6 +298,7 @@
CleanupStack::Pop(document);
+ OstTraceFunctionExit0( CCPIXSEARCH_GETDOCUMENTCOMPLETEL_EXIT );
return document;
}
--- a/searcher/searchserver/src/csearchserver.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/searchserver/src/csearchserver.cpp Mon May 03 13:33:22 2010 +0300
@@ -27,6 +27,11 @@
#include "SearchServerTesting.h"
#include "CHouseKeepingHandler.h"
#include "SearchServerLogger.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "csearchserverTraces.h"
+#endif
+
// Server security policy
@@ -113,6 +118,7 @@
//
void CSearchServer::ConstructL()
{
+ OstTraceFunctionEntry0( CSEARCHSERVER_CONSTRUCTL_ENTRY );
CPIXLOGSTRING("Creating search server");
@@ -126,6 +132,7 @@
// Initialize the OpenC search
CCPixIdxDb::InitializeL();
StartL(KSearchServerName);
+ OstTraceFunctionExit0( CSEARCHSERVER_CONSTRUCTL_EXIT );
}
// -----------------------------------------------------------------------------
@@ -148,6 +155,7 @@
//
CSearchServer::~CSearchServer()
{
+ OstTrace0( TRACE_NORMAL, CSEARCHSERVER_CSEARCHSERVER, "Deleting search server" );
CPIXLOGSTRING("Deleting search server");
// Delete the container index
--- a/searcher/searchserver/src/csearchserversession.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/searchserver/src/csearchserversession.cpp Mon May 03 13:33:22 2010 +0300
@@ -31,6 +31,12 @@
#include "CLogPlayerRecorder.h"
#include "indevicecfg.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "csearchserversessionTraces.h"
+#endif
+
+
// ========================= MEMBER FUNCTIONS ==================================
@@ -75,6 +81,7 @@
//
CSearchServerSession::CSearchServerSession()
{
+ OstTrace0( TRACE_NORMAL, CSEARCHSERVERSESSION_CSEARCHSERVERSESSION, "Creating search server session" );
CPIXLOGSTRING("Creating search server session");
}
@@ -85,6 +92,7 @@
//
CSearchServerSession::~CSearchServerSession()
{
+ OstTrace0( TRACE_NORMAL, DUP1_CSEARCHSERVERSESSION_CSEARCHSERVERSESSION, "Deleting search server session" );
CPIXLOGSTRING("Deleting search server session");
}
--- a/searcher/searchserver/src/csearchserversubsession.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/searchserver/src/csearchserversubsession.cpp Mon May 03 13:33:22 2010 +0300
@@ -29,6 +29,11 @@
#include "SearchServerLogger.h"
#include "SearchServer.pan"
#include "CLogPlayerRecorder.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "csearchserversubsessionTraces.h"
+#endif
+
// Contants
//_LIT8( KFileBaseAppClass, "root file" );
@@ -50,6 +55,7 @@
CSearchServerSubSession::CSearchServerSubSession(CSearchServerSession* aSession) : iSession(aSession)
{
+ OstTrace0( TRACE_NORMAL, CSEARCHSERVERSUBSESSION_CSEARCHSERVERSUBSESSION, "Creating search server subsession" );
CPIXLOGSTRING("Creating search server subsession");
// Dont ask why but I seem to have a compulsion to set everything NULL in constructor - AL
@@ -60,6 +66,7 @@
CSearchServerSubSession::~CSearchServerSubSession()
{
+ OstTrace0( TRACE_NORMAL, DUP1_CSEARCHSERVERSUBSESSION_CSEARCHSERVERSUBSESSION, "Deleting search server subsession" );
CPIXLOGSTRING("Deleting search server subsession");
delete iIndexDb;
@@ -151,12 +158,14 @@
void CSearchServerSubSession::SearchL(const RMessage2& aMessage)
{
+ OstTraceFunctionEntry0( CSEARCHSERVERSUBSESSION_SEARCHL_ENTRY );
PERFORMANCE_LOG_START("CSearchServerSubSession::SearchL");
// Sanity check
if (!iSearchDb->IsOpen())
{
iSession->PanicClient(aMessage, EDatabaseNotOpen);
+ OstTraceFunctionExit0( CSEARCHSERVERSUBSESSION_SEARCHL_EXIT );
return;
}
@@ -181,10 +190,12 @@
// Cleanup search terms
CleanupStack::PopAndDestroy(searchTerms);
+ OstTraceFunctionExit0( DUP1_CSEARCHSERVERSUBSESSION_SEARCHL_EXIT );
}
void CSearchServerSubSession::SearchCompleteL(const RMessage2& aMessage)
{
+ OstTraceFunctionEntry0( CSEARCHSERVERSUBSESSION_SEARCHCOMPLETEL_ENTRY );
PERFORMANCE_LOG_START("CSearchServerSubSession::SearchCompleteL");
// Complete search
@@ -194,18 +205,21 @@
TPckgBuf<TInt> resultCountPackage(resultCount);
aMessage.WriteL(1, resultCountPackage);
+ OstTraceFunctionExit0( CSEARCHSERVERSUBSESSION_SEARCHCOMPLETEL_EXIT );
}
// CSearchServerSession::GetDocumentL().
// Client gets the next documents (result) when SearchL has completed
void CSearchServerSubSession::GetDocumentL(const RMessage2& aMessage)
{
+ OstTraceFunctionEntry0( CSEARCHSERVERSUBSESSION_GETDOCUMENTL_ENTRY );
PERFORMANCE_LOG_START("CSearchServerSubSession::GetDocumentL");
// Sanity check
if (!iSearchDb->IsOpen())
{
iSession->PanicClient(aMessage, EDatabaseNotOpen);
+ OstTraceFunctionExit0( CSEARCHSERVERSUBSESSION_GETDOCUMENTL_EXIT );
return;
}
@@ -216,27 +230,32 @@
iNextDocument = NULL;
LOG_PLAYER_RECORD( CLogPlayerRecorder::LogGetDocumentL( reinterpret_cast<TUint>( this ), index ) );
iSearchDb->GetDocumentL(index, this, aMessage);
+ OstTraceFunctionExit0( DUP1_CSEARCHSERVERSUBSESSION_GETDOCUMENTL_EXIT );
}
void CSearchServerSubSession::GetDocumentCompleteL(const RMessage2& aMessage)
{
+ OstTraceFunctionEntry0( CSEARCHSERVERSUBSESSION_GETDOCUMENTCOMPLETEL_ENTRY );
PERFORMANCE_LOG_START("CSearchServerSubSession::GetDocumentCompleteL");
iNextDocument = iSearchDb->GetDocumentCompleteL();
TPckgBuf<TInt> documentSizePackage(iNextDocument ? iNextDocument->Size() : 0);
aMessage.WriteL(1, documentSizePackage);
+ OstTraceFunctionExit0( CSEARCHSERVERSUBSESSION_GETDOCUMENTCOMPLETEL_EXIT );
}
// CSearchServerSession::GetDocumentObjectL()
// Client gets the object after GetDocumentL() has completed
void CSearchServerSubSession::GetDocumentObjectL(const RMessage2& aMessage)
{
+ OstTraceFunctionEntry0( CSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_ENTRY );
PERFORMANCE_LOG_START("CSearchServerSubSession::GetDocumentObjectL");
// Sanity check
if (!iSearchDb->IsOpen())
{
iSession->PanicClient(aMessage, EDatabaseNotOpen);
+ OstTraceFunctionExit0( CSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_EXIT );
return;
}
@@ -272,6 +291,7 @@
// Complete the request
aMessage.Complete(KErrNone);
+ OstTraceFunctionExit0( DUP1_CSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_EXIT );
}
void CSearchServerSubSession::AddL(const RMessage2& aMessage)
@@ -304,12 +324,33 @@
CLogPlayerRecorder::LogAddL( reinterpret_cast<TUint>(this), *document );
}
);
+ //check if excerpt is more then maximum allowed
+ LimitExcerptToMaxLengthL(document);
iIndexDb->AddL(*document, this, aMessage);
CleanupStack::PopAndDestroy(document);
CleanupStack::PopAndDestroy(serializedDocument);
}
+void CSearchServerSubSession::LimitExcerptToMaxLengthL(CSearchDocument* aSearchDocument)
+ {
+ //check if excerpt is more then maximum allowed
+ if(aSearchDocument->Excerpt().Length() > MAX_EXCERPT_LENGTH)
+ {
+ OstTraceExt1( TRACE_NORMAL, CSEARCHSERVERSUBSESSION_LIMITEXCERPTTOMAXLENGTHL, "CSearchServerSubSession::LimitExcerptToMaxLengthL;docuid=%S", (aSearchDocument->Id()) );
+ CPIXLOGSTRING2("CSearchServerSubSession::AddL docuid=%S", &(aSearchDocument->Id()));
+ OstTrace1( TRACE_NORMAL, DUP1_CSEARCHSERVERSUBSESSION_LIMITEXCERPTTOMAXLENGTHL, "CSearchServerSubSession::LimitExcerptToMaxLengthL;Excerpt Length=%d", aSearchDocument->Excerpt().Length() );
+ CPIXLOGSTRING2("CSearchServerSubSession::AddL Excerpt Length =%d", aSearchDocument->Excerpt().Length());
+ const TDesC& excerpt = aSearchDocument->Excerpt();
+ HBufC* bufExcerpt = HBufC::NewLC(MAX_EXCERPT_LENGTH);
+ TPtr ptrExcerpt = bufExcerpt->Des();
+ ptrExcerpt.Append(excerpt.Ptr(),MAX_EXCERPT_LENGTH - 1);
+ ptrExcerpt.Append(KNullDesC); //Append NULL
+ aSearchDocument->AddExcerptL(*bufExcerpt);
+ CleanupStack::PopAndDestroy(bufExcerpt);
+ }
+ }
+
void CSearchServerSubSession::AddCompleteL(const RMessage2& /*aMessage*/)
{
iIndexDb->AddCompleteL();
@@ -341,6 +382,7 @@
// Index the thing
LOG_PLAYER_RECORD( CLogPlayerRecorder::LogUpdateL( reinterpret_cast<TUint>(this), *document ) );
+ LimitExcerptToMaxLengthL(document);
iIndexDb->UpdateL(*document, this, aMessage);
CleanupStack::PopAndDestroy(document);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchserver/traces/CCPixIdxDbTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,142 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CCPIXIDXDBTRACES_H__
+#define __CCPIXIDXDBTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6f7
+
+#define CPIXIDXDB_DUMPDOCUMENT 0x860001
+#define DUP1_CPIXIDXDB_DUMPDOCUMENT 0x860002
+#define DUP2_CPIXIDXDB_DUMPDOCUMENT 0x860003
+#define CCPIXIDXDB_ADDL 0x860004
+#define CCPIXIDXDB_UPDATEL 0x860005
+#define CCPIXIDXDB_DELETEDOCUMENTSL 0x860006
+
+
+#ifndef __KERNEL_MODE__
+inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 )
+ {
+ TBool retval;
+ TInt size = aParam1.Size();
+ // BTrace assumes that parameter size is atleast 4 bytes
+ if (size % 4 == 0)
+ {
+ TUint8* ptr = ( TUint8* )aParam1.Ptr();
+ // Data is written directly and length is determined from trace message length
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size );
+ }
+ else
+ {
+ TUint8 data[ KOstMaxDataLength ];
+ TUint8* ptr = data;
+ if (size > KOstMaxDataLength)
+ {
+ size = KOstMaxDataLength;
+ }
+ TInt sizeAligned = ( size + 3 ) & ~3;
+ memcpy( ptr, aParam1.Ptr(), size );
+ ptr += size;
+ // Fillers are written to get 32-bit alignment
+ while ( size++ < sizeAligned )
+ {
+ *ptr++ = 0;
+ }
+ ptr -= sizeAligned;
+ size = sizeAligned;
+ // Data is written directly and length is determined from trace message length
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size );
+ }
+ return retval;
+ }
+#endif
+
+
+#ifndef __KERNEL_MODE__
+inline TBool OstTraceGen2( TUint32 aTraceID, const TDesC16& aParam1, const TDesC16& aParam2 )
+ {
+ TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
+ if ( retval )
+ {
+ TInt length = 0;
+ // Check that parameter lenght is not too long
+ TInt length1 = aParam1.Size();
+ if ((length + length1 + sizeof ( TUint32 )) > KOstMaxDataLength)
+ {
+ length1 = KOstMaxDataLength - (length + sizeof ( TUint32 ));
+ }
+ TInt lengthAligned1 = ( length1 + 3 ) & ~3;
+ if (lengthAligned1 > 0)
+ {
+ length = length + sizeof ( TUint32 ) + lengthAligned1;
+ }
+ // Check that parameter lenght is not too long
+ TInt length2 = aParam2.Size();
+ if ((length + length2 + sizeof ( TUint32 )) > KOstMaxDataLength)
+ {
+ length2 = KOstMaxDataLength - (length + sizeof ( TUint32 ));
+ }
+ TInt lengthAligned2 = ( length2 + 3 ) & ~3;
+ if (lengthAligned2 > 0)
+ {
+ length = length + sizeof ( TUint32 ) + lengthAligned2;
+ }
+ TUint8 data[ KOstMaxDataLength ];
+ TUint8* ptr = data;
+ // Set length to zero and calculate it againg
+ // when adding parameters
+ length = 0;
+ if (length1 > 0)
+ {
+ // Number of elements is written before data
+ // In case of Unicode string, number of elements is half of length
+ *( ( TUint32* )ptr ) = length1 / (aParam1.Size() / aParam1.Length());
+ ptr += sizeof ( TUint32 );
+ memcpy( ptr, aParam1.Ptr(), length1 );
+ ptr += length1;
+ // Fillers are written to get 32-bit alignment
+ while ( length1++ < lengthAligned1 )
+ {
+ *ptr++ = 0;
+ }
+ length += sizeof ( TUint32 ) + lengthAligned1;
+ }
+ else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength)
+ {
+ *( ( TUint32* )ptr ) = 0;
+ ptr += sizeof ( TUint32 );
+ length += sizeof ( TUint32 );
+ }
+ if (length2 > 0)
+ {
+ // Number of elements is written before data
+ // In case of Unicode string, number of elements is half of length
+ *( ( TUint32* )ptr ) = length2 / (aParam2.Size() / aParam2.Length());
+ ptr += sizeof ( TUint32 );
+ memcpy( ptr, aParam2.Ptr(), length2 );
+ ptr += length2;
+ // Fillers are written to get 32-bit alignment
+ while ( length2++ < lengthAligned2 )
+ {
+ *ptr++ = 0;
+ }
+ length += sizeof ( TUint32 ) + lengthAligned2;
+ }
+ else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength)
+ {
+ *( ( TUint32* )ptr ) = 0;
+ ptr += sizeof ( TUint32 );
+ length += sizeof ( TUint32 );
+ }
+ ptr -= length;
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, length );
+ }
+ return retval;
+ }
+#endif
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchserver/traces/CCPixSearchTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,24 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CCPIXSEARCHTRACES_H__
+#define __CCPIXSEARCHTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6f7
+
+#define CCPIXSEARCH_LOGCANCELACTION 0x860007
+#define CCPIXSEARCH_SEARCHL_ENTRY 0x8a0001
+#define CCPIXSEARCH_SEARCHL_EXIT 0x8a0002
+#define DUP1_CCPIXSEARCH_SEARCHL_EXIT 0x8a0003
+#define CCPIXSEARCH_SEARCHCOMPLETEL_ENTRY 0x8a0004
+#define CCPIXSEARCH_SEARCHCOMPLETEL_EXIT 0x8a0005
+#define CCPIXSEARCH_GETDOCUMENTL_ENTRY 0x8a0006
+#define CCPIXSEARCH_GETDOCUMENTL_EXIT 0x8a0007
+#define CCPIXSEARCH_GETDOCUMENTCOMPLETEL_ENTRY 0x8a0008
+#define CCPIXSEARCH_GETDOCUMENTCOMPLETEL_EXIT 0x8a0009
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchserver/traces/CSearchServerSessionTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,16 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CSEARCHSERVERSESSIONTRACES_H__
+#define __CSEARCHSERVERSESSIONTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6f7
+
+#define CSEARCHSERVERSESSION_CSEARCHSERVERSESSION 0x860009
+#define DUP1_CSEARCHSERVERSESSION_CSEARCHSERVERSESSION 0x86000a
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchserver/traces/CSearchServerSubSessionTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,69 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CSEARCHSERVERSUBSESSIONTRACES_H__
+#define __CSEARCHSERVERSUBSESSIONTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6f7
+
+#define CSEARCHSERVERSUBSESSION_CSEARCHSERVERSUBSESSION 0x86000b
+#define DUP1_CSEARCHSERVERSUBSESSION_CSEARCHSERVERSUBSESSION 0x86000c
+#define CSEARCHSERVERSUBSESSION_LIMITEXCERPTTOMAXLENGTHL 0x86000d
+#define DUP1_CSEARCHSERVERSUBSESSION_LIMITEXCERPTTOMAXLENGTHL 0x86000e
+#define CSEARCHSERVERSUBSESSION_SEARCHL_ENTRY 0x8a000c
+#define CSEARCHSERVERSUBSESSION_SEARCHL_EXIT 0x8a000d
+#define DUP1_CSEARCHSERVERSUBSESSION_SEARCHL_EXIT 0x8a000e
+#define CSEARCHSERVERSUBSESSION_SEARCHCOMPLETEL_ENTRY 0x8a000f
+#define CSEARCHSERVERSUBSESSION_SEARCHCOMPLETEL_EXIT 0x8a0010
+#define CSEARCHSERVERSUBSESSION_GETDOCUMENTL_ENTRY 0x8a0011
+#define CSEARCHSERVERSUBSESSION_GETDOCUMENTL_EXIT 0x8a0012
+#define DUP1_CSEARCHSERVERSUBSESSION_GETDOCUMENTL_EXIT 0x8a0013
+#define CSEARCHSERVERSUBSESSION_GETDOCUMENTCOMPLETEL_ENTRY 0x8a0014
+#define CSEARCHSERVERSUBSESSION_GETDOCUMENTCOMPLETEL_EXIT 0x8a0015
+#define CSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_ENTRY 0x8a0016
+#define CSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_EXIT 0x8a0017
+#define DUP1_CSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_EXIT 0x8a0018
+
+
+#ifndef __KERNEL_MODE__
+inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 )
+ {
+ TBool retval;
+ TInt size = aParam1.Size();
+ // BTrace assumes that parameter size is atleast 4 bytes
+ if (size % 4 == 0)
+ {
+ TUint8* ptr = ( TUint8* )aParam1.Ptr();
+ // Data is written directly and length is determined from trace message length
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size );
+ }
+ else
+ {
+ TUint8 data[ KOstMaxDataLength ];
+ TUint8* ptr = data;
+ if (size > KOstMaxDataLength)
+ {
+ size = KOstMaxDataLength;
+ }
+ TInt sizeAligned = ( size + 3 ) & ~3;
+ memcpy( ptr, aParam1.Ptr(), size );
+ ptr += size;
+ // Fillers are written to get 32-bit alignment
+ while ( size++ < sizeAligned )
+ {
+ *ptr++ = 0;
+ }
+ ptr -= sizeAligned;
+ size = sizeAligned;
+ // Data is written directly and length is determined from trace message length
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size );
+ }
+ return retval;
+ }
+#endif
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchserver/traces/CSearchServerTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,17 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CSEARCHSERVERTRACES_H__
+#define __CSEARCHSERVERTRACES_H__
+
+#define KOstTraceComponentID 0x2001f6f7
+
+#define CSEARCHSERVER_CSEARCHSERVER 0x860008
+#define CSEARCHSERVER_CONSTRUCTL_ENTRY 0x8a000a
+#define CSEARCHSERVER_CONSTRUCTL_EXIT 0x8a000b
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchserver/traces/OstTraceDefinitions.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searcher/searchserver/traces/fixed_id.definitions Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,41 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FLOW=0x8a
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCH_GETDOCUMENTCOMPLETEL_ENTRY=0x8
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCH_GETDOCUMENTCOMPLETEL_EXIT=0x9
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCH_GETDOCUMENTL_ENTRY=0x6
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCH_GETDOCUMENTL_EXIT=0x7
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCH_SEARCHCOMPLETEL_ENTRY=0x4
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCH_SEARCHCOMPLETEL_EXIT=0x5
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCH_SEARCHL_ENTRY=0x1
+[TRACE]TRACE_FLOW[0x8A]_CCPIXSEARCH_SEARCHL_EXIT=0x2
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVERSUBSESSION_GETDOCUMENTCOMPLETEL_ENTRY=0x14
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVERSUBSESSION_GETDOCUMENTCOMPLETEL_EXIT=0x15
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVERSUBSESSION_GETDOCUMENTL_ENTRY=0x11
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVERSUBSESSION_GETDOCUMENTL_EXIT=0x12
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_ENTRY=0x16
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_EXIT=0x17
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVERSUBSESSION_SEARCHCOMPLETEL_ENTRY=0xf
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVERSUBSESSION_SEARCHCOMPLETEL_EXIT=0x10
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVERSUBSESSION_SEARCHL_ENTRY=0xc
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVERSUBSESSION_SEARCHL_EXIT=0xd
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVER_CONSTRUCTL_ENTRY=0xa
+[TRACE]TRACE_FLOW[0x8A]_CSEARCHSERVER_CONSTRUCTL_EXIT=0xb
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CCPIXSEARCH_SEARCHL_EXIT=0x3
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CSEARCHSERVERSUBSESSION_GETDOCUMENTL_EXIT=0x13
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CSEARCHSERVERSUBSESSION_GETDOCUMENTOBJECTL_EXIT=0x18
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CSEARCHSERVERSUBSESSION_SEARCHL_EXIT=0xe
+[TRACE]TRACE_NORMAL[0x86]_CCPIXIDXDB_ADDL=0x4
+[TRACE]TRACE_NORMAL[0x86]_CCPIXIDXDB_DELETEDOCUMENTSL=0x6
+[TRACE]TRACE_NORMAL[0x86]_CCPIXIDXDB_UPDATEL=0x5
+[TRACE]TRACE_NORMAL[0x86]_CCPIXSEARCH_LOGCANCELACTION=0x7
+[TRACE]TRACE_NORMAL[0x86]_CPIXIDXDB_DUMPDOCUMENT=0x1
+[TRACE]TRACE_NORMAL[0x86]_CSEARCHSERVERSESSION_CSEARCHSERVERSESSION=0x9
+[TRACE]TRACE_NORMAL[0x86]_CSEARCHSERVERSUBSESSION_CSEARCHSERVERSUBSESSION=0xb
+[TRACE]TRACE_NORMAL[0x86]_CSEARCHSERVERSUBSESSION_LIMITEXCERPTTOMAXLENGTHL=0xd
+[TRACE]TRACE_NORMAL[0x86]_CSEARCHSERVER_CSEARCHSERVER=0x8
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CPIXIDXDB_DUMPDOCUMENT=0x2
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CSEARCHSERVERSESSION_CSEARCHSERVERSESSION=0xa
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CSEARCHSERVERSUBSESSION_CSEARCHSERVERSUBSESSION=0xc
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CSEARCHSERVERSUBSESSION_LIMITEXCERPTTOMAXLENGTHL=0xe
+[TRACE]TRACE_NORMAL[0x86]_DUP2_CPIXIDXDB_DUMPDOCUMENT=0x3
--- a/searcher/tsrc/cpixsearchertest/Bmarm/cpixsearchertestU.DEF Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/Bmarm/cpixsearchertestU.DEF Mon May 03 13:33:22 2010 +0300
@@ -1,3 +1,49 @@
EXPORTS
- LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+ ?DeleteL@CCPixIndexer@@QAEXABVTDesC16@@@Z @ 1 NONAME ; void CCPixIndexer::DeleteL(class TDesC16 const &)
+ ?DeleteL@CCPixIndexer@@QAEXAAVMCPixIndexingRequestObserver@@ABVTDesC16@@@Z @ 2 NONAME ; void CCPixIndexer::DeleteL(class MCPixIndexingRequestObserver &, class TDesC16 const &)
+ ?SetAnalyzerL@RSearchServerSubSession@@QAEXABVTDesC16@@@Z @ 3 NONAME ; void RSearchServerSubSession::SetAnalyzerL(class TDesC16 const &)
+ ?GetDocument@RSearchServerSubSession@@QAEXHAAVTRequestStatus@@@Z @ 4 NONAME ; void RSearchServerSubSession::GetDocument(int, class TRequestStatus &)
+ ?SetAnalyzerL@CCPixIndexer@@QAEXAAVMCPixSetAnalyzerRequestObserver@@ABVTDesC16@@@Z @ 5 NONAME ; void CCPixIndexer::SetAnalyzerL(class MCPixSetAnalyzerRequestObserver &, class TDesC16 const &)
+ ?Update@RSearchServerSubSession@@QAEXABVTDesC8@@AAVTRequestStatus@@@Z @ 6 NONAME ; void RSearchServerSubSession::Update(class TDesC8 const &, class TRequestStatus &)
+ ?Delete@RSearchServerSubSession@@QAEXABVTDesC16@@AAVTRequestStatus@@@Z @ 7 NONAME ; void RSearchServerSubSession::Delete(class TDesC16 const &, class TRequestStatus &)
+ ?SetAnalyzer@RSearchServerSubSession@@QAEXABVTDesC16@@AAVTRequestStatus@@@Z @ 8 NONAME ; void RSearchServerSubSession::SetAnalyzer(class TDesC16 const &, class TRequestStatus &)
+ ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 9 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+ ?ForceHouseKeeping@RSearchServerSession@@QAEHXZ @ 10 NONAME ; int RSearchServerSession::ForceHouseKeeping(void)
+ ?DeleteL@RSearchServerSubSession@@QAEXABVTDesC16@@@Z @ 11 NONAME ; void RSearchServerSubSession::DeleteL(class TDesC16 const &)
+ ?IsDatabaseOpen@CCPixIndexer@@QBEHXZ @ 12 NONAME ; int CCPixIndexer::IsDatabaseOpen(void) const
+ ?Flush@RSearchServerSubSession@@QAEXAAVTRequestStatus@@@Z @ 13 NONAME ; void RSearchServerSubSession::Flush(class TRequestStatus &)
+ ?UpdateL@CCPixIndexer@@QAEXAAVMCPixIndexingRequestObserver@@ABVCSearchDocument@@@Z @ 14 NONAME ; void CCPixIndexer::UpdateL(class MCPixIndexingRequestObserver &, class CSearchDocument const &)
+ ?ResetL@CCPixIndexer@@QAEXAAVMCPixIndexingRequestObserver@@@Z @ 15 NONAME ; void CCPixIndexer::ResetL(class MCPixIndexingRequestObserver &)
+ ?StopHouseKeeping@RSearchServerSession@@QAEHXZ @ 16 NONAME ; int RSearchServerSession::StopHouseKeeping(void)
+ ?Connect@RSearchServerSession@@QAEHXZ @ 17 NONAME ; int RSearchServerSession::Connect(void)
+ ?AddL@CCPixIndexer@@QAEXABVCSearchDocument@@@Z @ 18 NONAME ; void CCPixIndexer::AddL(class CSearchDocument const &)
+ ?SetAnalyzerL@CCPixIndexer@@QAEXABVTDesC16@@@Z @ 19 NONAME ; void CCPixIndexer::SetAnalyzerL(class TDesC16 const &)
+ ?CancelAll@RSearchServerSubSession@@QBEXXZ @ 20 NONAME ; void RSearchServerSubSession::CancelAll(void) const
+ ?ResetL@RSearchServerSubSession@@QAEXXZ @ 21 NONAME ; void RSearchServerSubSession::ResetL(void)
+ ?Close@RSearchServerSession@@QAEXXZ @ 22 NONAME ; void RSearchServerSession::Close(void)
+ ?GetDocumentObjectL@RSearchServerSubSession@@QAEPAVCSearchDocument@@XZ @ 23 NONAME ; class CSearchDocument * RSearchServerSubSession::GetDocumentObjectL(void)
+ ?GetBaseAppClass@CCPixIndexer@@QBEABVTDesC16@@XZ @ 24 NONAME ; class TDesC16 const & CCPixIndexer::GetBaseAppClass(void) const
+ ?UpdateL@CCPixIndexer@@QAEXABVCSearchDocument@@@Z @ 25 NONAME ; void CCPixIndexer::UpdateL(class CSearchDocument const &)
+ ?OpenDatabaseL@CCPixIndexer@@QAEXABVTDesC16@@@Z @ 26 NONAME ; void CCPixIndexer::OpenDatabaseL(class TDesC16 const &)
+ ?OpenDatabaseL@CCPixIndexer@@QAEXAAVMCPixOpenDatabaseRequestObserver@@ABVTDesC16@@@Z @ 27 NONAME ; void CCPixIndexer::OpenDatabaseL(class MCPixOpenDatabaseRequestObserver &, class TDesC16 const &)
+ ??0RSearchServerSession@@QAE@XZ @ 28 NONAME ; RSearchServerSession::RSearchServerSession(void)
+ ?SearchL@RSearchServerSubSession@@QAEXABVTDesC16@@@Z @ 29 NONAME ; void RSearchServerSubSession::SearchL(class TDesC16 const &)
+ ?DefineVolume@RSearchServerSession@@QAEHABVTDesC16@@0@Z @ 30 NONAME ; int RSearchServerSession::DefineVolume(class TDesC16 const &, class TDesC16 const &)
+ ?NewL@CCPixIndexer@@SAPAV1@AAVRSearchServerSession@@@Z @ 31 NONAME ; class CCPixIndexer * CCPixIndexer::NewL(class RSearchServerSession &)
+ ?Version@RSearchServerSession@@QBE?AVTVersion@@XZ @ 32 NONAME ; class TVersion RSearchServerSession::Version(void) const
+ ?AddL@CCPixIndexer@@QAEXAAVMCPixIndexingRequestObserver@@ABVCSearchDocument@@@Z @ 33 NONAME ; void CCPixIndexer::AddL(class MCPixIndexingRequestObserver &, class CSearchDocument const &)
+ ?Reset@RSearchServerSubSession@@QAEXAAVTRequestStatus@@@Z @ 34 NONAME ; void RSearchServerSubSession::Reset(class TRequestStatus &)
+ ?Add@RSearchServerSubSession@@QAEXABVTDesC8@@AAVTRequestStatus@@@Z @ 35 NONAME ; void RSearchServerSubSession::Add(class TDesC8 const &, class TRequestStatus &)
+ ?GetDocumentL@RSearchServerSubSession@@QAEPAVCSearchDocument@@H@Z @ 36 NONAME ; class CSearchDocument * RSearchServerSubSession::GetDocumentL(int)
+ ?FlushL@CCPixIndexer@@QAEXAAVMCPixIndexingRequestObserver@@@Z @ 37 NONAME ; void CCPixIndexer::FlushL(class MCPixIndexingRequestObserver &)
+ ?FlushL@RSearchServerSubSession@@QAEXXZ @ 38 NONAME ; void RSearchServerSubSession::FlushL(void)
+ ?FlushL@CCPixIndexer@@QAEXXZ @ 39 NONAME ; void CCPixIndexer::FlushL(void)
+ ?ResetL@CCPixIndexer@@QAEXXZ @ 40 NONAME ; void CCPixIndexer::ResetL(void)
+ ?ContinueHouseKeeping@RSearchServerSession@@QAEHXZ @ 41 NONAME ; int RSearchServerSession::ContinueHouseKeeping(void)
+ ?NewLC@CCPixIndexer@@SAPAV1@AAVRSearchServerSession@@@Z @ 42 NONAME ; class CCPixIndexer * CCPixIndexer::NewLC(class RSearchServerSession &)
+ ??1CCPixIndexer@@UAE@XZ @ 43 NONAME ; CCPixIndexer::~CCPixIndexer(void)
+ ?Search@RSearchServerSubSession@@QAEXABVTDesC16@@AAVTRequestStatus@@@Z @ 44 NONAME ; void RSearchServerSubSession::Search(class TDesC16 const &, class TRequestStatus &)
+ ?UpdateL@RSearchServerSubSession@@QAEXABVTDesC8@@@Z @ 45 NONAME ; void RSearchServerSubSession::UpdateL(class TDesC8 const &)
+ ?UnDefineVolume@RSearchServerSession@@QAEHABVTDesC16@@@Z @ 46 NONAME ; int RSearchServerSession::UnDefineVolume(class TDesC16 const &)
+ ?AddL@RSearchServerSubSession@@QAEXABVTDesC8@@@Z @ 47 NONAME ; void RSearchServerSubSession::AddL(class TDesC8 const &)
--- a/searcher/tsrc/cpixsearchertest/Bwins/cpixsearchertestU.DEF Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/Bwins/cpixsearchertestU.DEF Mon May 03 13:33:22 2010 +0300
@@ -1,5 +1,5 @@
EXPORTS
- ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+ ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
?DeleteL@CCPixIndexer@@QAEXABVTDesC16@@@Z @ 2 NONAME ; void CCPixIndexer::DeleteL(class TDesC16 const &)
?DeleteL@CCPixIndexer@@QAEXAAVMCPixIndexingRequestObserver@@ABVTDesC16@@@Z @ 3 NONAME ; void CCPixIndexer::DeleteL(class MCPixIndexingRequestObserver &, class TDesC16 const &)
?SetAnalyzerL@RSearchServerSubSession@@QAEXABVTDesC16@@@Z @ 4 NONAME ; void RSearchServerSubSession::SetAnalyzerL(class TDesC16 const &)
@@ -46,4 +46,49 @@
?UpdateL@RSearchServerSubSession@@QAEXABVTDesC8@@@Z @ 45 NONAME ; void RSearchServerSubSession::UpdateL(class TDesC8 const &)
?UnDefineVolume@RSearchServerSession@@QAEHABVTDesC16@@@Z @ 46 NONAME ; int RSearchServerSession::UnDefineVolume(class TDesC16 const &)
?AddL@RSearchServerSubSession@@QAEXABVTDesC8@@@Z @ 47 NONAME ; void RSearchServerSubSession::AddL(class TDesC8 const &)
+ ?OpenDatabaseL@CCPixSearcher@@QAEXAAVMCPixOpenDatabaseRequestObserver@@ABVTDesC16@@@Z @ 48 NONAME ; void CCPixSearcher::OpenDatabaseL(class MCPixOpenDatabaseRequestObserver &, class TDesC16 const &)
+ ?NewL@CSearchDocument@@SAPAV1@ABVTDesC16@@00W4TFilterId@1@@Z @ 49 NONAME ; class CSearchDocument * CSearchDocument::NewL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, enum CSearchDocument::TFilterId)
+ ?SearchL@CCPixSearcher@@QAEHABVTDesC16@@0@Z @ 50 NONAME ; int CCPixSearcher::SearchL(class TDesC16 const &, class TDesC16 const &)
+ ?OpenDatabaseL@CCPixSearcher@@QAEXABVTDesC16@@@Z @ 51 NONAME ; void CCPixSearcher::OpenDatabaseL(class TDesC16 const &)
+ ?SetAnalyzerL@CCPixSearcher@@QAEXABVTDesC16@@@Z @ 52 NONAME ; void CCPixSearcher::SetAnalyzerL(class TDesC16 const &)
+ ?Size@CSearchDocument@@QBEHXZ @ 53 NONAME ; int CSearchDocument::Size(void) const
+ ?AppClass@CSearchDocument@@QBEABVTDesC16@@XZ @ 54 NONAME ; class TDesC16 const & CSearchDocument::AppClass(void) const
+ ?NewL@CCPixSearcher@@SAPAV1@AAVRSearchServerSession@@ABVTDesC16@@@Z @ 55 NONAME ; class CCPixSearcher * CCPixSearcher::NewL(class RSearchServerSession &, class TDesC16 const &)
+ ?GetDocumentL@CCPixSearcher@@QAEPAVCSearchDocument@@H@Z @ 56 NONAME ; class CSearchDocument * CCPixSearcher::GetDocumentL(int)
+ ??1CDocumentField@@UAE@XZ @ 57 NONAME ; CDocumentField::~CDocumentField(void)
+ ??1CSearchDocument@@UAE@XZ @ 58 NONAME ; CSearchDocument::~CSearchDocument(void)
+ ?Value@CDocumentField@@QBEABVTDesC16@@XZ @ 59 NONAME ; class TDesC16 const & CDocumentField::Value(void) const
+ ?NewLC@CDocumentField@@SAPAV1@AAVRReadStream@@@Z @ 60 NONAME ; class CDocumentField * CDocumentField::NewLC(class RReadStream &)
+ ?IsDatabaseOpen@CCPixSearcher@@QBEHXZ @ 61 NONAME ; int CCPixSearcher::IsDatabaseOpen(void) const
+ ?SearchL@CCPixSearcher@@QAEXAAVMCPixSearchRequestObserver@@ABVTDesC16@@1@Z @ 62 NONAME ; void CCPixSearcher::SearchL(class MCPixSearchRequestObserver &, class TDesC16 const &, class TDesC16 const &)
+ ?Id@CSearchDocument@@QBEABVTDesC16@@XZ @ 63 NONAME ; class TDesC16 const & CSearchDocument::Id(void) const
+ ?GetBaseAppClass@CCPixSearcher@@QBEABVTDesC16@@XZ @ 64 NONAME ; class TDesC16 const & CCPixSearcher::GetBaseAppClass(void) const
+ ?InternalizeL@CDocumentField@@QAEXAAVRReadStream@@@Z @ 65 NONAME ; void CDocumentField::InternalizeL(class RReadStream &)
+ ?AddExcerptL@CSearchDocument@@QAEXABVTDesC16@@@Z @ 66 NONAME ; void CSearchDocument::AddExcerptL(class TDesC16 const &)
+ ?Config@CDocumentField@@QBEHXZ @ 67 NONAME ; int CDocumentField::Config(void) const
+ ?Boost@CDocumentField@@QBEMXZ @ 68 NONAME ; float CDocumentField::Boost(void) const
+ ?ExternalizeL@CSearchDocument@@QBEXAAVRWriteStream@@@Z @ 69 NONAME ; void CSearchDocument::ExternalizeL(class RWriteStream &) const
+ ?Size@CDocumentField@@QBEHXZ @ 70 NONAME ; int CDocumentField::Size(void) const
+ ?NewL@CDocumentField@@SAPAV1@AAVRReadStream@@@Z @ 71 NONAME ; class CDocumentField * CDocumentField::NewL(class RReadStream &)
+ ?NewLC@CSearchDocument@@SAPAV1@ABVTDesC16@@00W4TFilterId@1@@Z @ 72 NONAME ; class CSearchDocument * CSearchDocument::NewLC(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, enum CSearchDocument::TFilterId)
+ ?NewLC@CDocumentField@@SAPAV1@ABVTDesC16@@0H@Z @ 73 NONAME ; class CDocumentField * CDocumentField::NewLC(class TDesC16 const &, class TDesC16 const &, int)
+ ??1CCPixSearcher@@UAE@XZ @ 74 NONAME ; CCPixSearcher::~CCPixSearcher(void)
+ ?SetBoost@CSearchDocument@@QAEXM@Z @ 75 NONAME ; void CSearchDocument::SetBoost(float)
+ ?NewL@CDocumentField@@SAPAV1@ABVTDesC16@@0H@Z @ 76 NONAME ; class CDocumentField * CDocumentField::NewL(class TDesC16 const &, class TDesC16 const &, int)
+ ?Field@CSearchDocument@@QBEPBVCDocumentField@@ABVTDesC16@@@Z @ 77 NONAME ; class CDocumentField const * CSearchDocument::Field(class TDesC16 const &) const
+ ?NewLC@CSearchDocument@@SAPAV1@AAVRReadStream@@@Z @ 78 NONAME ; class CSearchDocument * CSearchDocument::NewLC(class RReadStream &)
+ ?AddFieldL@CSearchDocument@@QAEAAVCDocumentField@@ABVTDesC16@@0H@Z @ 79 NONAME ; class CDocumentField & CSearchDocument::AddFieldL(class TDesC16 const &, class TDesC16 const &, int)
+ ?Field@CSearchDocument@@QBEABVCDocumentField@@H@Z @ 80 NONAME ; class CDocumentField const & CSearchDocument::Field(int) const
+ ?FieldCount@CSearchDocument@@QBEHXZ @ 81 NONAME ; int CSearchDocument::FieldCount(void) const
+ ?NewLC@CCPixSearcher@@SAPAV1@AAVRSearchServerSession@@ABVTDesC16@@@Z @ 82 NONAME ; class CCPixSearcher * CCPixSearcher::NewLC(class RSearchServerSession &, class TDesC16 const &)
+ ?Excerpt@CSearchDocument@@QBEABVTDesC16@@XZ @ 83 NONAME ; class TDesC16 const & CSearchDocument::Excerpt(void) const
+ ?SetAnalyzerL@CCPixSearcher@@QAEXAAVMCPixSetAnalyzerRequestObserver@@ABVTDesC16@@@Z @ 84 NONAME ; void CCPixSearcher::SetAnalyzerL(class MCPixSetAnalyzerRequestObserver &, class TDesC16 const &)
+ ?Boost@CSearchDocument@@QBEMXZ @ 85 NONAME ; float CSearchDocument::Boost(void) const
+ ?InternalizeL@CSearchDocument@@QAEXAAVRReadStream@@@Z @ 86 NONAME ; void CSearchDocument::InternalizeL(class RReadStream &)
+ ?Name@CDocumentField@@QBEABVTDesC16@@XZ @ 87 NONAME ; class TDesC16 const & CDocumentField::Name(void) const
+ ?RemoveField@CSearchDocument@@QAEHABVTDesC16@@@Z @ 88 NONAME ; int CSearchDocument::RemoveField(class TDesC16 const &)
+ ?GetDocumentL@CCPixSearcher@@QAEXHAAVMCPixNextDocumentRequestObserver@@@Z @ 89 NONAME ; void CCPixSearcher::GetDocumentL(int, class MCPixNextDocumentRequestObserver &)
+ ?SetBoost@CDocumentField@@QAEXM@Z @ 90 NONAME ; void CDocumentField::SetBoost(float)
+ ?NewL@CSearchDocument@@SAPAV1@AAVRReadStream@@@Z @ 91 NONAME ; class CSearchDocument * CSearchDocument::NewL(class RReadStream &)
+ ?ExternalizeL@CDocumentField@@QBEXAAVRWriteStream@@@Z @ 92 NONAME ; void CDocumentField::ExternalizeL(class RWriteStream &) const
--- a/searcher/tsrc/cpixsearchertest/conf/cpixsearchertest.cfg Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/conf/cpixsearchertest.cfg Mon May 03 13:33:22 2010 +0300
@@ -19,56 +19,56 @@
[Test]
title TestAddDocument
create cpixsearchertest foobar
-foobar TestAddDocument play c:\\Data\\cpixS60unittest\\act0.txt
+foobar TestAddDocument play c:\Data\cpixS60unittest\act0.txt
delete foobar
[Endtest]
[Test]
title TestAddDocument
create cpixsearchertest foobar
-foobar TestAddDocument ipod c:\\Data\\cpixS60unittest\\act1.txt
+foobar TestAddDocument Countess c:\Data\cpixS60unittest\act1.txt
delete foobar
[Endtest]
[Test]
title TestAddDocument
create cpixsearchertest foobar
-foobar TestAddDocument ipod c:\\Data\\cpixS60unittest\\act2.txt
+foobar TestAddDocument King c:\Data\cpixS60unittest\act2.txt
delete foobar
[Endtest]
[Test]
title TestAddDocument
create cpixsearchertest foobar
-foobar TestAddDocument ipod c:\\Data\\cpixS60unittest\\act3.txt
+foobar TestAddDocument pleasure c:\Data\cpixS60unittest\act3.txt
delete foobar
[Endtest]
[Test]
title TestAddDocument
create cpixsearchertest foobar
-foobar TestAddDocument ipod c:\\Data\\cpixS60unittest\\act4.txt
+foobar TestAddDocument produce c:\Data\cpixS60unittest\act4.txt
delete foobar
[Endtest]
[Test]
title TestAddDocument
create cpixsearchertest foobar
-foobar TestAddDocument ipod c:\\Data\\cpixS60unittest\\act5.txt
+foobar TestAddDocument Helena c:\Data\cpixS60unittest\act5.txt
delete foobar
[Endtest]
[Test]
title TestAddDocument
create cpixsearchertest foobar
-foobar TestAddDocument king c:\\Data\\cpixS60unittest\\act6.txt
+foobar TestAddDocument Exeunt c:\Data\cpixS60unittest\act6.txt
delete foobar
[Endtest]
[Test]
title TestAddCancel
create cpixsearchertest foobar
-foobar TestAddCancel uniquewordonlyfoundonceincorpus c:\\Data\\cpixS60unittest\\act0.txt
+foobar TestAddCancel uniquewordonlyfoundonceincorpus c:\Data\cpixS60unittest\act0.txt
delete foobar
[Endtest]
@@ -82,7 +82,7 @@
[Test]
title TestUpdateDocument
create cpixsearchertest foobar
-foobar TestUpdateDocument uniquewordonlyfoundonceincorpus c:\\Data\\cpixS60unittest\\act0.txt
+foobar TestUpdateDocument uniquewordonlyfoundonceincorpus c:\Data\cpixS60unittest\act0.txt
delete foobar
[Endtest]
@@ -96,7 +96,7 @@
[Test]
title TestDeleteDocument
create cpixsearchertest foobar
-foobar TestDeleteDocument uniquewordonlyfoundonceincorpus c:\\Data\\cpixS60unittest\\act0.txt
+foobar TestDeleteDocument uniquewordonlyfoundonceincorpus c:\Data\cpixS60unittest\act0.txt
delete foobar
[Endtest]
@@ -110,7 +110,7 @@
[Test]
title TestReset
create cpixsearchertest foobar
-foobar TestReset uniquewordonlyfoundonceincorpus c:\\Data\\cpixS60unittest\\act0.txt
+foobar TestReset uniquewordonlyfoundonceincorpus c:\Data\cpixS60unittest\act0.txt
delete foobar
[Endtest]
@@ -198,12 +198,12 @@
delete foobar
[Endtest]
-[Test]
-title TestRemoveSnowballAnalyzer
-create cpixsearchertest foobar
-foobar TestRemoveSnowballAnalyzer
-delete foobar
-[Endtest]
+#[Test]
+#title TestRemoveSnowballAnalyzer
+#create cpixsearchertest foobar
+#foobar TestRemoveSnowballAnalyzer
+#delete foobar
+#[Endtest]
[Test]
title TestKnownTerm
@@ -288,4 +288,11 @@
foobar TestGetInvalidDocumentAsync
delete foobar
[Endtest]
+
+[Test]
+title TestExerptLength
+create cpixsearchertest foobar
+foobar TestExerptLength
+delete foobar
+[Endtest]
\ No newline at end of file
--- a/searcher/tsrc/cpixsearchertest/group/cpixsearchertest.mmp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/group/cpixsearchertest.mmp Mon May 03 13:33:22 2010 +0300
@@ -86,6 +86,9 @@
SOURCE rsearchserversession.cpp
SOURCE ccpixindexer.cpp
+SOURCE ccpixsearcher.cpp
+SOURCE cdocumentfield.cpp
+SOURCE csearchdocument.cpp
LIBRARY cpixsearchclient.lib
LIBRARY FLOGGER.lib
--- a/searcher/tsrc/cpixsearchertest/group/cpixsearchertest_DoxyFile.txt Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/group/cpixsearchertest_DoxyFile.txt Mon May 03 13:33:22 2010 +0300
@@ -1,4 +1,4 @@
-#
+##
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
@@ -13,7 +13,8 @@
#
# Description:
#
-#
+##
+
# Doxyfile 1.4.1
--- a/searcher/tsrc/cpixsearchertest/inc/cpixindexerterster.h Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/inc/cpixindexerterster.h Mon May 03 13:33:22 2010 +0300
@@ -48,7 +48,7 @@
private:
void CreateFileIndexItemL(const TDesC& aFilename);
- TInt SearchForTextL(const TDesC& aQueryString, const TDesC& aDefaultField);
+ TInt SearchForTextL(const TDesC& aQueryString, const TDesC& aDefaultField, TBool aFlush = ETrue);
TBool CheckBaseAppClassIsExpectedL(const TDesC& aExpectedAppClass,
const TDesC& aDocUid);
@@ -67,7 +67,10 @@
public:
void setUp();
void tearDown();
-
+ void InitSearcher();
+ void ReleaseSearcher();
+ void InitAsyncModules();
+ void ReleaseAsyncModules();
void testOpenIndexDb();
void testAddL();
void testAsyncAddL();
@@ -88,9 +91,8 @@
CCPixIndexer* iIndexer;// CPix database
CCPixSearcher* iSearcher;
RSearchServerSession iSession;
- TInt iCurrentIndex;
CHandleIndexingResultLeaves* iHandleResultLeaves;
- CActiveSchedulerWait* iWait;
+ CActiveSchedulerWait* iIndexerWait;
CAOTestClass* iMyAOClass;
};
--- a/searcher/tsrc/cpixsearchertest/inc/cpixsearchertest.h Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/inc/cpixsearchertest.h Mon May 03 13:33:22 2010 +0300
@@ -179,6 +179,7 @@
virtual TInt TestDeleteIndexDbWhileSearchingL( CStifItemParser& aItem );
virtual TInt TestGetDocumentAsyncL( CStifItemParser& aItem );
virtual TInt TestGetInvalidDocumentAsyncL( CStifItemParser& aItem );
+ virtual TInt TestExerptLengthL( CStifItemParser& aItem );
/**
* Method used to log version of test class
*/
--- a/searcher/tsrc/cpixsearchertest/inc/cpixsearchertester.h Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/inc/cpixsearchertester.h Mon May 03 13:33:22 2010 +0300
@@ -36,8 +36,15 @@
{
public:
CTestSearcher(){}
- void setUp();
+ void initialsetUp();
+ void createandinitindexer();
+ void createsearcher();
+ void harvesttestcontent( TInt aCount );
+ void InitAsyncComponents();
void tearDown();
+ void ReleaseIndexer();
+ void ReleaseSearcher();
+ void ReleaseAsyncComponents();
private:
TInt SearchForTextL(const TDesC& aText, const TDesC& aDefaultField);
@@ -62,7 +69,7 @@
* Basic search tests - requires IndexDb with Shakespeare corpus data
* already indexed.
*/
- TInt testKnownTermTestsL();
+ void testKnownTermTestsL();
/*
* Simple tests for wildcard searches
*/
@@ -107,6 +114,8 @@
* search statemachine.
*/
void testGetInvalidDocumentAsync();
+
+ TInt testEcerptLenth();
private:
CCPixSearcher* iSearcher;
RSearchServerSession iSession;
--- a/searcher/tsrc/cpixsearchertest/src/capsmod_searcher/group/capsmod_searcher.mmp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/src/capsmod_searcher/group/capsmod_searcher.mmp Mon May 03 13:33:22 2010 +0300
@@ -32,7 +32,7 @@
#ifdef SBSV2
#if defined(__S60_)
- OSEXT_LAYER_SYSTEMINCLUDE
+ OS_LAYER_SYSTEMINCLUDE
#else // __S60_ not defined
SYSTEMINCLUDE /epoc32/include
SYSTEMINCLUDE /epoc32/include/internal
--- a/searcher/tsrc/cpixsearchertest/src/cpixindexertester.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/src/cpixindexertester.cpp Mon May 03 13:33:22 2010 +0300
@@ -69,42 +69,42 @@
iIndexer = CCPixIndexer::NewL(iSession);
iIndexer->OpenDatabaseL(KFileBaseAppClassC);
iIndexer->ResetL();
-
+ }
+
+void CTestIndexer::InitSearcher()
+ {
iSearcher = CCPixSearcher::NewL(iSession);
iSearcher->OpenDatabaseL(KFileBaseAppClassC);
-
- iHandleResultLeaves = new (ELeave) CHandleIndexingResultLeaves;
-
- // iWait will cause waiting until some asynchronous event has happened
- iWait = new (ELeave) CActiveSchedulerWait;
- iMyAOClass = CAOTestClass::NewL(this);
-
- iCurrentIndex = 0;
}
-void CTestIndexer::tearDown()
+void CTestIndexer::ReleaseSearcher()
+ {
+ delete iSearcher;
+ iSearcher = NULL;
+ }
+void CTestIndexer::InitAsyncModules()
{
- iCurrentIndex = 0;
-
- iIndexer->ResetL();
-
+ iHandleResultLeaves = new (ELeave) CHandleIndexingResultLeaves;
+ iIndexerWait = new (ELeave) CActiveSchedulerWait;
+ iMyAOClass = CAOTestClass::NewL(this);
+ }
+void CTestIndexer::ReleaseAsyncModules()
+ {
if( iMyAOClass )
{
delete iMyAOClass;
iMyAOClass = NULL;
}
-
- delete iIndexer;
- iIndexer = NULL;
-
- delete iSearcher;
- iSearcher = NULL;
-
delete iHandleResultLeaves;
iHandleResultLeaves = NULL;
- delete iWait;
-
+ delete iIndexerWait;
+ }
+void CTestIndexer::tearDown()
+ {
+ iIndexer->ResetL();
+ delete iIndexer;
+ iIndexer = NULL;
iSession.UnDefineVolume(KFileBaseAppClassC);
iSession.Close();
}
@@ -124,12 +124,12 @@
}
-TInt CTestIndexer::SearchForTextL(const TDesC& aQueryString, const TDesC& aDefaultField)
+TInt CTestIndexer::SearchForTextL(const TDesC& aQueryString, const TDesC& aDefaultField, TBool aFlush )
{
TInt estimatedDocumentCount(KErrNotFound);
// Make sure CPix flush is done before searching
- if (iIndexer)
+ if ( aFlush && iIndexer)
{
iIndexer->FlushL();
}
@@ -172,19 +172,19 @@
void CTestIndexer::HandleOpenDatabaseResultL( TInt /* aError */ )
{
- if (iWait && iWait->IsStarted())
+ if (iIndexerWait && iIndexerWait->IsStarted())
{
// All done, signal that can continue now.
- iWait->AsyncStop();
+ iIndexerWait->AsyncStop();
}
}
void CTestIndexer::HandleSetAnalyzerResultL(TInt /*aError*/)
{
- if (iWait && iWait->IsStarted())
+ if (iIndexerWait && iIndexerWait->IsStarted())
{
// All done, signal that can continue now.
- iWait->AsyncStop();
+ iIndexerWait->AsyncStop();
}
}
@@ -192,19 +192,19 @@
{
TS_ASSERT(aError == KErrNone);
- // if the test case started iWait, then stop it
- if (iWait && iWait->IsStarted())
+ // if the test case started iIndexerWait, then stop it
+ if (iIndexerWait && iIndexerWait->IsStarted())
{
- iWait->AsyncStop();
+ iIndexerWait->AsyncStop();
}
}
// Timeout callback
void CTestIndexer::CallCompleted( int /* i */ )
{
- if (iWait && iWait->IsStarted())
+ if (iIndexerWait && iIndexerWait->IsStarted())
{
- iWait->AsyncStop();
+ iIndexerWait->AsyncStop();
}
}
@@ -242,7 +242,7 @@
// to be triggered.
iMyAOClass->StartL(1000000*10); //Async call: Maximum TimeOut time 10 seconds
- iWait->Start();
+ iIndexerWait->Start();
TS_ASSERT(indexer->IsDatabaseOpen());
CleanupStack::PopAndDestroy(indexer);
}
@@ -314,24 +314,19 @@
TS_ASSERT(result == 0);
//Improve code coverage
- CSearchDocument* index_item = CSearchDocument::NewL(KTestFileAct0, KNullDesC, _L("excerpt"), CSearchDocument::EFileParser);
+ CSearchDocument* index_item = CSearchDocument::NewL(KTestFileAct0, KNullDesC, _L("excerpt"), CSearchDocument::EFileParser);
CleanupStack::PushL(index_item);
- //CSearchDocument* index_item = CSearchDocument::NewLC(KTestFileAct0, KNullDesC, KNullDesC, CSearchDocument::EFileParser);
-
iIndexer->AddL(*this, *index_item);
CleanupStack::PopAndDestroy(index_item);
- iWait->Start();
-
- result = SearchForTextL(KUniqueSearchTermInAct0Txt, KNullDesC);
+ iIndexerWait->Start();
+ User::After( 30000000 );
+ result = SearchForTextL(KUniqueSearchTermInAct0Txt, KNullDesC, false);
TS_ASSERT(result == 1);
CSearchDocument* doc = iSearcher->GetDocumentL(0);
TS_ASSERT(doc != NULL);
- //TS_ASSERT(doc->Excerpt() != KNullDesC);//Should not be NULL
- delete doc;
- CDocumentField* docField = CDocumentField::NewL(_L("test"),_L("test"));
- TS_ASSERT(docField != NULL);
- delete docField;
+ TS_ASSERT(doc->Excerpt() != KNullDesC);//Should not be NULL
+ delete doc;
}
void CTestIndexer::testCancelAddL()
@@ -392,7 +387,7 @@
iIndexer->UpdateL(*this, *index_item);
CleanupStack::PopAndDestroy(index_item);
- iWait->Start();
+ iIndexerWait->Start();
// As the document has been updated the amount of search hits
// must remain the same as before.
@@ -458,7 +453,7 @@
{
iIndexer->DeleteL(*this, KTestFileAct0);
}
- iWait->Start();
+ iIndexerWait->Start();
// Now that deleted act0.txt, the same search must yield zero results.
result = SearchForTextL(KUniqueSearchTermInAct0Txt, KNullDesC);
@@ -530,14 +525,14 @@
CleanupStack::PopAndDestroy(index_item);
// No flush. Term should not be in the indexDb
- result = SearchForTextL(KUniqueSearchTermInAct0Txt, KNullDesC);
+ result = SearchForTextL(KUniqueSearchTermInAct0Txt, KNullDesC, false);
// TODO: Feature not yet in CPix. Change when flush is required.
//TS_ASSERT(result == 0);
- TS_ASSERT(result == 1);
+ TS_ASSERT(result == 0);
iIndexer->FlushL(*this);
- iWait->Start();
+ iIndexerWait->Start();
// After flush term should be in the indexDb
result = SearchForTextL(KUniqueSearchTermInAct0Txt, KNullDesC);
@@ -558,7 +553,7 @@
iIndexer->ResetL(*this);
- iWait->Start();
+ iIndexerWait->Start();
result = SearchForTextL(KUniqueSearchTermInAct0Txt, KNullDesC);
TS_ASSERT(result == 0);
@@ -593,7 +588,7 @@
const TDesC& db = iIndexer->GetBaseAppClass();//Increase Coverage
}
iIndexer->SetAnalyzerL(*this,_L( "" CPIX_ANALYZER_STANDARD ));
- iWait->Start();//wait till it returns
+ iIndexerWait->Start();//wait till it returns
TS_ASSERT(result == 0);
}
--- a/searcher/tsrc/cpixsearchertest/src/cpixsearchertestBlocks.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/src/cpixsearchertestBlocks.cpp Mon May 03 13:33:22 2010 +0300
@@ -21,10 +21,10 @@
#include <StifTestInterface.h>
#include "cpixsearchertest.h"
-#include "ccpixsearcher.h"
-#include "CSearchDocument.h"
-#include "CCPixIndexer.h"
-#include "common.h"
+#include <ccpixsearcher.h>
+#include <CSearchDocument.h>
+#include <CCPixIndexer.h>
+#include <common.h>
#include "cpixsearchertester.h"
#include "multithreadtester.h"
#include "cpixboostertester.h"
@@ -162,7 +162,8 @@
ENTRY( "TestOpenIndexDb", Ccpixsearchertest::TestOpenIndexDbL),
ENTRY( "TestDeleteIndexDbWhileSearching", Ccpixsearchertest::TestDeleteIndexDbWhileSearchingL),
ENTRY( "TestGetDocumentAsync", Ccpixsearchertest::TestGetDocumentAsyncL),
- ENTRY( "TestGetInvalidDocumentAsync", Ccpixsearchertest::TestGetInvalidDocumentAsyncL),
+ ENTRY( "TestGetInvalidDocumentAsync", Ccpixsearchertest::TestGetInvalidDocumentAsyncL),
+ ENTRY( "TestExerptLength", Ccpixsearchertest::TestExerptLengthL),
//ADD NEW ENTRY HERE
// [test cases entries] - Do not remove
@@ -200,11 +201,7 @@
indexer = NULL;
iSession.UnDefineVolume( KFileBaseAppClassC );
iSession.Close();
- doLog( iLog, error, KTestFormBaseAppClassNoError );
- /*CTestSearcher* testsearcher = new CTestSearcher();
- TInt error = KErrNone;
- testsearcher->setUp();
- testsearcher->tearDown();*/
+ doLog( iLog, error, KTestFormBaseAppClassNoError );
return error;
}
@@ -237,7 +234,7 @@
// -----------------------------------------------------------------------------
//
TInt Ccpixsearchertest::TestAddDocumentL( CStifItemParser& aItem )
- {
+ {
RSearchServerSession iSession;
TInt error = KErrNotFound;
TPtrC fileName;
@@ -246,16 +243,8 @@
User::LeaveIfError(iSession.Connect());
iSession.DefineVolume(KFileBaseAppClassC, KNullDesC);
_LIT( KTestFormBaseAppClassNoError, "TestAddDocumentL: No Error" );
- TInt result = doSearch( KQueryString , KFileBaseAppClassC );
- if ( result > 0 )
- {
- doLog( iLog, KErrUnknown, KTestFormBaseAppClassNoError );
- iSession.UnDefineVolume( KFileBaseAppClassC );
- iSession.Close();
- return KErrUnknown;
- }
CCPixIndexer* indexer = CCPixIndexer::NewLC(iSession);
- TRAPD(err, indexer->OpenDatabaseL( KFileBaseAppClassC ) );
+ TRAPD(err, indexer->OpenDatabaseL( KFileBaseAppClassC ) );
// creating CSearchDocument object with unique ID for this application
if( aItem.GetNextString ( fileName ) == KErrNone )
@@ -268,10 +257,9 @@
indexer->AddL(*index_item);
}
CleanupStack::PopAndDestroy(index_item);
- }
- //@TODO add wait here to harvest
- User::After((TTimeIntervalMicroSeconds32)16000000);
- result = doSearch( KQueryString , KFileBaseAppClassC );
+ }
+ User::After((TTimeIntervalMicroSeconds32)30000000);
+ TInt result = doSearch( searchstring , KFileBaseAppClassC );
if ( result > 0 )
error = KErrNone;
indexer->ResetL();
@@ -295,17 +283,11 @@
aItem.GetNextString ( searchstring );
User::LeaveIfError(iSession.Connect());
iSession.DefineVolume(KFileBaseAppClassC, KNullDesC);
- _LIT( KTestFormBaseAppClassNoError, "TestAddCancelL: No Error" );
- TInt result = doSearch( searchstring , KFileBaseAppClassC );
- if ( result > 0 )
- {
- doLog( iLog, KErrUnknown, KTestFormBaseAppClassNoError );
- return KErrUnknown;
- }
+ _LIT( KTestFormBaseAppClassNoError, "TestAddCancelL: No Error" );
CCPixIndexer* indexer = CCPixIndexer::NewLC(iSession);
TRAPD(err, indexer->OpenDatabaseL( KFileBaseAppClassC ) );
// creating CSearchDocument object with unique ID for this application
-
+ indexer->ResetL();
if( aItem.GetNextString ( fileName ) == KErrNone )
{
CSearchDocument* index_item = CSearchDocument::NewLC(fileName, KNullDesC, KNullDesC, CSearchDocument::EFileParser);
@@ -321,7 +303,7 @@
CleanupStack::PopAndDestroy(indexer);
indexer = NULL;
// Cancelled, but the document will still have been added to the IndexDB
- result = doSearch( searchstring , KFileBaseAppClassC );
+ TInt result = doSearch( searchstring , KFileBaseAppClassC );
if ( result > 0 )
error = KErrNone;
iSession.UnDefineVolume( KFileBaseAppClassC );
@@ -339,7 +321,11 @@
CTestIndexer* testindexer = new CTestIndexer();
testindexer->setUp();
- TRAPD ( error , testindexer->testAsyncAddL() );
+ testindexer->InitSearcher();
+ testindexer->InitAsyncModules();
+ TRAPD ( error , testindexer->testAsyncAddL() );
+ testindexer->ReleaseSearcher();
+ testindexer->ReleaseAsyncModules();
testindexer->tearDown();
delete testindexer;
doLog( iLog, error, KTestFormBaseAppClassNoError );
@@ -362,7 +348,7 @@
CCPixIndexer* indexer = CCPixIndexer::NewLC(iSession);
TRAPD(err, indexer->OpenDatabaseL( KFileBaseAppClassC ) );
// creating CSearchDocument object with unique ID for this application
-
+ indexer->ResetL();
if( aItem.GetNextString ( fileName ) == KErrNone )
{
CSearchDocument* index_item = CSearchDocument::NewLC(fileName, KNullDesC, KNullDesC, CSearchDocument::EFileParser);
@@ -373,7 +359,7 @@
indexer->AddL(*index_item);
}
CleanupStack::PopAndDestroy(index_item);
-
+ User::After((TTimeIntervalMicroSeconds32)30000000);
TInt result = doSearch( searchstring , KFileBaseAppClassC );
index_item = CSearchDocument::NewLC(fileName, KNullDesC, KNullDesC, CSearchDocument::EFileParser);
// Send for indexing
@@ -382,7 +368,7 @@
indexer->UpdateL(*index_item);
}
CleanupStack::PopAndDestroy(index_item);
- User::After((TTimeIntervalMicroSeconds32)16000000);
+ User::After((TTimeIntervalMicroSeconds32)30000000);
TInt result1 = doSearch( searchstring , KFileBaseAppClassC );
if ( result != result1)
@@ -404,7 +390,11 @@
_LIT( KTestFormBaseAppClassNoError, "TestAsyncUpdateL: No Error" );
CTestIndexer* testindexer = new CTestIndexer();
testindexer->setUp();
- TRAPD ( error , testindexer->testAsyncUpdateL() );
+ testindexer->InitSearcher();
+ testindexer->InitAsyncModules();
+ TRAPD ( error , testindexer->testAsyncUpdateL() );
+ testindexer->ReleaseSearcher();
+ testindexer->ReleaseAsyncModules();
testindexer->tearDown();
delete testindexer;
doLog( iLog, error, KTestFormBaseAppClassNoError );
@@ -438,7 +428,7 @@
indexer->AddL(*index_item);
}
CleanupStack::PopAndDestroy(index_item);
- User::After((TTimeIntervalMicroSeconds32)16000000);
+ User::After((TTimeIntervalMicroSeconds32)30000000);
TInt result = doSearch( searchstring , KFileBaseAppClassC );
// Send for indexing
@@ -446,12 +436,13 @@
{
indexer->DeleteL(fileName);
}
- User::After((TTimeIntervalMicroSeconds32)16000000);
+ User::After((TTimeIntervalMicroSeconds32)30000000);
TInt result1 = doSearch( searchstring , KFileBaseAppClassC );
if ( (result-1) != result1)
error = KErrUnknown;
}
+ indexer->ResetL();
CleanupStack::PopAndDestroy(indexer);
indexer = NULL;
iSession.UnDefineVolume( KFileBaseAppClassC );
@@ -469,7 +460,11 @@
_LIT( KTestFormBaseAppClassNoError, "TestAsyncDeleteL: No Error" );
CTestIndexer* testindexer = new CTestIndexer();
testindexer->setUp();
- TRAPD ( error , testindexer->testAsyncDeleteL() );
+ testindexer->InitSearcher();
+ testindexer->InitAsyncModules();
+ TRAPD ( error , testindexer->testAsyncDeleteL() );
+ testindexer->ReleaseSearcher();
+ testindexer->ReleaseAsyncModules();
testindexer->tearDown();
delete testindexer;
doLog( iLog, error, KTestFormBaseAppClassNoError );
@@ -503,7 +498,7 @@
indexer->AddL(*index_item);
}
CleanupStack::PopAndDestroy(index_item);
- User::After((TTimeIntervalMicroSeconds32)16000000);
+ User::After((TTimeIntervalMicroSeconds32)30000000);
TInt result = doSearch( searchstring , KFileBaseAppClassC );
if ( result )
@@ -535,7 +530,9 @@
_LIT( KTestFormBaseAppClassNoError, "TestFlushL: No Error" );
CTestIndexer* testindexer = new CTestIndexer();
testindexer->setUp();
- TRAPD ( error , testindexer->testFlushL() );
+ testindexer->InitSearcher();
+ TRAPD ( error , testindexer->testFlushL() );
+ testindexer->ReleaseSearcher();
testindexer->tearDown();
delete testindexer;
doLog( iLog, error, KTestFormBaseAppClassNoError );
@@ -550,7 +547,11 @@
_LIT( KTestFormBaseAppClassNoError, "TestAsyncFlushL: No Error" );
CTestIndexer* testindexer = new CTestIndexer();
testindexer->setUp();
- TRAPD ( error , testindexer->testAsyncFlushL() );
+ testindexer->InitSearcher();
+ testindexer->InitAsyncModules();
+ TRAPD ( error , testindexer->testAsyncFlushL() );
+ testindexer->ReleaseSearcher();
+ testindexer->ReleaseAsyncModules();
testindexer->tearDown();
delete testindexer;
doLog( iLog, error, KTestFormBaseAppClassNoError );
@@ -565,7 +566,11 @@
_LIT( KTestFormBaseAppClassNoError, "TestAsyncResetL: No Error" );
CTestIndexer* testindexer = new CTestIndexer();
testindexer->setUp();
- TRAPD ( error , testindexer->testAsyncResetL() );
+ testindexer->InitSearcher();
+ testindexer->InitAsyncModules();
+ TRAPD ( error , testindexer->testAsyncResetL() );
+ testindexer->ReleaseSearcher();
+ testindexer->ReleaseAsyncModules();
testindexer->tearDown();
delete testindexer;
doLog( iLog, error, KTestFormBaseAppClassNoError );
@@ -581,7 +586,11 @@
_LIT( KTestFormBaseAppClassNoError, "TestHandleIndexingResultL: No Error" );
CTestIndexer* testindexer = new CTestIndexer();
testindexer->setUp();
- TRAPD ( error , testindexer->testHandleIndexingResultL_Leaves() );
+ testindexer->InitSearcher();
+ testindexer->InitAsyncModules();
+ TRAPD ( error , testindexer->testHandleIndexingResultL_Leaves() );
+ testindexer->ReleaseSearcher();
+ testindexer->ReleaseAsyncModules();
testindexer->tearDown();
delete testindexer;
doLog( iLog, error, KTestFormBaseAppClassNoError );
@@ -596,7 +605,9 @@
_LIT( KTestFormBaseAppClassNoError, "TestSetAnalyzerAsyncL: No Error" );
CTestIndexer* testindexer = new CTestIndexer();
testindexer->setUp();
- TRAPD ( error , testindexer->testSetAnalyzerAsync() );
+ testindexer->InitAsyncModules();
+ TRAPD ( error , testindexer->testSetAnalyzerAsync() );
+ testindexer->ReleaseAsyncModules();
testindexer->tearDown();
delete testindexer;
doLog( iLog, error, KTestFormBaseAppClassNoError );
@@ -726,11 +737,15 @@
//
TInt Ccpixsearchertest::TestKnownTermL( CStifItemParser& /*aItem*/ )
{
- TInt err = KErrNone;
_LIT( KTestFormBaseAppClassNoError, "TestKnownTermL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
- err = testsearcher->testKnownTermTestsL();
+ testsearcher->initialsetUp();
+ testsearcher->createandinitindexer();
+ testsearcher->createsearcher();
+ testsearcher->harvesttestcontent( 8 );
+ TRAPD ( err , testsearcher->testKnownTermTestsL() );
+ testsearcher->ReleaseIndexer();
+ testsearcher->ReleaseSearcher();
testsearcher->tearDown();
delete testsearcher;
doLog( iLog, err, KTestFormBaseAppClassNoError );
@@ -744,8 +759,13 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestWildcardTermL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
- TRAPD ( err , testsearcher->testWildcardTermTests() );
+ testsearcher->initialsetUp();
+ testsearcher->createandinitindexer();
+ testsearcher->createsearcher();
+ testsearcher->harvesttestcontent( 8 );
+ TRAPD ( err , testsearcher->testWildcardTermTests() );
+ testsearcher->ReleaseIndexer();
+ testsearcher->ReleaseSearcher();
testsearcher->tearDown();
delete testsearcher;
doLog( iLog, err, KTestFormBaseAppClassNoError );
@@ -759,7 +779,7 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestDefineVolumeWorksNonEmptyPathL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
+ testsearcher->initialsetUp();
TRAPD ( err , testsearcher->testDefineVolumeWorksNonEmptyPath() );
testsearcher->tearDown();
delete testsearcher;
@@ -774,7 +794,7 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestDefineVolumeWorksWithEmptyPathL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
+ testsearcher->initialsetUp();
TRAPD ( err , testsearcher->testDefineVolumeWorksWithEmptyPath() );
testsearcher->tearDown();
delete testsearcher;
@@ -789,7 +809,7 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestDefineVolumeErrorScenariosL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
+ testsearcher->initialsetUp();
TRAPD ( err , testsearcher->testDefineVolumeErrorScenarios() );
testsearcher->tearDown();
delete testsearcher;
@@ -804,8 +824,15 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestSearchCancellationL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
- TRAPD ( err , testsearcher->testSearchCancellation() );
+ testsearcher->initialsetUp();
+ testsearcher->createandinitindexer();
+ testsearcher->createsearcher();
+ testsearcher->harvesttestcontent( 8 );
+ testsearcher->InitAsyncComponents();
+ TRAPD ( err , testsearcher->testSearchCancellation() );
+ testsearcher->ReleaseIndexer();
+ testsearcher->ReleaseSearcher();
+ testsearcher->ReleaseAsyncComponents();
testsearcher->tearDown();
delete testsearcher;
doLog( iLog, err, KTestFormBaseAppClassNoError );
@@ -819,8 +846,15 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestSearchAsynchronousL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
- TRAPD ( err , testsearcher->testSearchAsynchronous() );
+ testsearcher->initialsetUp();
+ testsearcher->createandinitindexer();
+ testsearcher->createsearcher();
+ testsearcher->harvesttestcontent( 4 );
+ testsearcher->InitAsyncComponents();
+ TRAPD ( err , testsearcher->testSearchAsynchronous() );
+ testsearcher->ReleaseIndexer();
+ testsearcher->ReleaseSearcher();
+ testsearcher->ReleaseAsyncComponents();
testsearcher->tearDown();
delete testsearcher;
doLog( iLog, err, KTestFormBaseAppClassNoError );
@@ -834,8 +868,15 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestSearchLeavesIfNotCancelledL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
- TRAPD ( err , testsearcher->testSearchLeavesIfNotCancelled() );
+ testsearcher->initialsetUp();
+ testsearcher->createandinitindexer();
+ testsearcher->createsearcher();
+ testsearcher->harvesttestcontent( 4 );
+ testsearcher->InitAsyncComponents();
+ TRAPD ( err , testsearcher->testSearchLeavesIfNotCancelled() );
+ testsearcher->ReleaseIndexer();
+ testsearcher->ReleaseSearcher();
+ testsearcher->ReleaseAsyncComponents();
testsearcher->tearDown();
delete testsearcher;
doLog( iLog, err, KTestFormBaseAppClassNoError );
@@ -849,8 +890,13 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestOpenIndexDbL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
- TRAPD ( err , testsearcher->testOpenIndexDb() );
+ testsearcher->initialsetUp();
+ testsearcher->createandinitindexer();
+ testsearcher->harvesttestcontent( 4 );
+ testsearcher->InitAsyncComponents();
+ TRAPD ( err , testsearcher->testOpenIndexDb() );
+ testsearcher->ReleaseIndexer();
+ testsearcher->ReleaseAsyncComponents();
testsearcher->tearDown();
delete testsearcher;
doLog( iLog, err, KTestFormBaseAppClassNoError );
@@ -864,8 +910,10 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestDeleteIndexDbWhileSearchingL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
+ testsearcher->initialsetUp();
+ testsearcher->InitAsyncComponents();
TRAPD ( err , testsearcher->testDeleteIndexDbWhileSearching() );
+ testsearcher->ReleaseAsyncComponents();
testsearcher->tearDown();
delete testsearcher;
doLog( iLog, err, KTestFormBaseAppClassNoError );
@@ -879,8 +927,15 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestGetDocumentAsyncL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
- TRAPD ( err , testsearcher->testGetDocumentAsync() );
+ testsearcher->initialsetUp();
+ testsearcher->createandinitindexer();
+ testsearcher->createsearcher();
+ testsearcher->harvesttestcontent( 4 );
+ testsearcher->InitAsyncComponents();
+ TRAPD ( err , testsearcher->testGetDocumentAsync() );
+ testsearcher->ReleaseIndexer();
+ testsearcher->ReleaseSearcher();
+ testsearcher->ReleaseAsyncComponents();
testsearcher->tearDown();
delete testsearcher;
doLog( iLog, err, KTestFormBaseAppClassNoError );
@@ -894,14 +949,40 @@
{
_LIT( KTestFormBaseAppClassNoError, "TestGetInvalidDocumentAsyncL: No Error" );
CTestSearcher* testsearcher = new CTestSearcher();
- testsearcher->setUp();
- TRAPD ( err , testsearcher->testGetInvalidDocumentAsync() );
+ testsearcher->initialsetUp();
+ testsearcher->createandinitindexer();
+ testsearcher->createsearcher();
+ testsearcher->harvesttestcontent( 4 );
+ testsearcher->InitAsyncComponents();
+ TRAPD ( err , testsearcher->testGetInvalidDocumentAsync() );
+ testsearcher->ReleaseIndexer();
+ testsearcher->ReleaseSearcher();
+ testsearcher->ReleaseAsyncComponents();
testsearcher->tearDown();
delete testsearcher;
doLog( iLog, err, KTestFormBaseAppClassNoError );
return err;
}
// -----------------------------------------------------------------------------
+// Ccpixsearchertest::TestExerptLengthL
+// -----------------------------------------------------------------------------
+//
+TInt Ccpixsearchertest::TestExerptLengthL( CStifItemParser& /*aItem*/ )
+ {
+ _LIT( KTestFormBaseAppClassNoError, "TestExerptLengthL: No Error" );
+ TInt err = KErrNone;
+ CTestSearcher* testsearcher = new CTestSearcher();
+ testsearcher->initialsetUp();
+ testsearcher->createandinitindexer();
+ testsearcher->createsearcher();
+ err = testsearcher->testEcerptLenth();
+ testsearcher->ReleaseSearcher();
+ testsearcher->ReleaseIndexer();
+ testsearcher->tearDown();
+ doLog( iLog, err, KTestFormBaseAppClassNoError );
+ return err;
+ }
+// -----------------------------------------------------------------------------
// Ccpixsearchertest::?member_function
// ?implementation_description
// (other items were commented in a header).
--- a/searcher/tsrc/cpixsearchertest/src/cpixsearchertester.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/searcher/tsrc/cpixsearchertest/src/cpixsearchertester.cpp Mon May 03 13:33:22 2010 +0300
@@ -26,7 +26,7 @@
#include "common.h"
#define TS_ASSERT(a) \
- if ( !a ) return KErrNotFound
+ if ( !a ) User::Leave(KErrNotFound)
_LIT(KQueryString, "act");
@@ -69,34 +69,70 @@
CleanupStack::PopAndDestroy(doc);
}
-void CTestSearcher::setUp()
+void CTestSearcher::initialsetUp()
{
- iFs.Connect();
User::LeaveIfError(iSession.Connect());
-
-
iSession.UnDefineVolume(KTestFileBaseAppClassC);
// define a test volume
iSession.DefineVolume(KTestFileBaseAppClassC, KNullDesC);
+ }
+void CTestSearcher::createandinitindexer()
+ {
iIndexer = CCPixIndexer::NewL(iSession);
iIndexer->OpenDatabaseL(KTestFileBaseAppClassC);
iIndexer->ResetL();
-
- AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act0.txt"));
- AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act1.txt"));
- AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act2.txt"));
- AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act3.txt"));
- AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act4.txt"));
- AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act5.txt"));
- AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act6.txt"));
- AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\complete.txt"));
- AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\index.txt"));
- AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\introduction.txt"));
+ }
+void CTestSearcher::createsearcher()
+ {
iSearcher = CCPixSearcher::NewL(iSession);
iSearcher->OpenDatabaseL(KTestFileBaseAppClassC);
+ }
+void CTestSearcher::harvesttestcontent( TInt aCount )
+ {
+ for (int i = 0; i < aCount; i++)
+ {
+ switch (i)
+ {
+ case 0:
+ AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act0.txt"));
+ break;
+ case 1:
+ AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act1.txt"));
+ break;
+ case 2:
+ AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act2.txt"));
+ break;
+ case 3:
+ AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act3.txt"));
+ break;
+ case 4:
+ AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act4.txt"));
+ break;
+ case 5:
+ AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act5.txt"));
+ break;
+ case 6:
+ AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\act6.txt"));
+ break;
+ case 7:
+ AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\complete.txt"));
+ break;
+ case 8:
+ AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\index.txt"));
+ break;
+ default:
+ AddFileToIndexL(_L("c:\\Data\\cpixS60unittest\\introduction.txt"));
+ break;
+ }
+ }
+ }
+
+void CTestSearcher::InitAsyncComponents()
+ {
+
// iWait will cause waiting until some asynchronous event has happened
iWait = new (ELeave) CActiveSchedulerWait;
iMyAOClass = CAOTestClass::NewL(this);
@@ -106,39 +142,43 @@
iHandleSetAnalyzerCalled = EFalse;
}
-void CTestSearcher::tearDown()
+void CTestSearcher::ReleaseIndexer()
+ {
+ if (iIndexer)
+ {
+ iIndexer->ResetL();
+ }
+ delete iIndexer;
+ iIndexer = NULL;
+ }
+void CTestSearcher::ReleaseSearcher()
+ {
+ delete iSearcher;
+ iSearcher = NULL;
+ }
+
+void CTestSearcher::ReleaseAsyncComponents()
{
iDocumentCount = 0;
-
- delete iSearcher;
- iSearcher = NULL;
-
if ( iDocument )
{
delete iDocument;
iDocument = NULL;
}
-
- if (iIndexer)
- {
- iIndexer->ResetL();
- }
-
if( iWait )
{
delete iWait;
iWait = NULL;
}
-
+
if( iMyAOClass )
{
delete iMyAOClass;
iMyAOClass = NULL;
}
-
- delete iIndexer;
- iIndexer = NULL;
-
+ }
+void CTestSearcher::tearDown()
+ {
// undefine a test volume
iSession.UnDefineVolume(KTestFileBaseAppClassC);
@@ -204,7 +244,7 @@
}
}
-TInt CTestSearcher::testKnownTermTestsL()
+void CTestSearcher::testKnownTermTestsL()
{
// Shakespeare's corpus files have plenty of terms "act" in them EXPECTED RESULTS > 0
TInt result = SearchForTextL(KQueryString, KNullDesC);
@@ -219,7 +259,7 @@
for (TInt i=0; i<result; i++)
{
CSearchDocument* document = iSearcher->GetDocumentL(i);
- //TS_ASSERT(document != NULL);
+ TS_ASSERT(document != NULL);
delete document;
}
}
@@ -234,107 +274,106 @@
TS_ASSERT(result == 0);
// can search for a known value in a different field
- result = SearchForTextL(KRootFileUserTxt, KAppClassField);
+ result = SearchForTextL(_L("usrdoc"), KAppClassField);
TS_ASSERT(result > 0);
// can search for a known value in a different field
-// result = SearchForTextL(KRootFileUserTxt, KNonExistentField);
-// TS_ASSERT(result == 0); // TODO XXX TIM why does searching for an existing term in a non-existent field return a non-zero value
- return KErrNone;
+ result = SearchForTextL(_L("usrdoc"), KNonExistentField);
+ TS_ASSERT(result == 0); // TODO XXX TIM why does searching for an existing term in a non-existent field return a non-zero value
}
void CTestSearcher::testWildcardTermTests()
{
// Shakespeare's corpus files have plenty of terms "act" in them EXPECTED RESULTS > 0
TInt result = SearchForTextL(_L("a*t"), KNullDesC);
- //TS_ASSERT(result > 0);
+ TS_ASSERT(result > 0);
// Shakespeare's corpus files have plenty of terms "act" in them EXPECTED RESULTS > 0
result = SearchForTextL(_L("sc*ne"), KNullDesC);
- // TS_ASSERT(result > 0);
+ TS_ASSERT(result > 0);
}
void CTestSearcher::testDefineVolumeWorksNonEmptyPath()
{
TBuf8<KMaxFileSize> cpixRegBuf;
-
+ iFs.Connect();
// open up the cpixreg.txt file again and make sure
// that it IS NOT in there
TInt err = iFile.Open(iFs, KCpixRegFile, EFileStreamText);
iFile.Read(0, cpixRegBuf);
err = cpixRegBuf.Find(KRootMapsGbr8());
- // TS_ASSERT(KErrNotFound == err);
+ TS_ASSERT(KErrNotFound == err);
err = cpixRegBuf.Find(KRootMapsGbrPath8());
- // TS_ASSERT(KErrNotFound == err);
+ TS_ASSERT(KErrNotFound == err);
iFile.Close();
// define a new volume
err = iSession.DefineVolume(KRootMapsGbr, KRootMapsGbrPath);
- // TS_ASSERT(err == KErrNone);
+ TS_ASSERT(err == KErrNone);
// open up the cpixreg.txt file and make sure that it IS in there
err = iFile.Open(iFs, KCpixRegFile, EFileStreamText);
iFile.Read(0, cpixRegBuf);
err = cpixRegBuf.Find(KRootMapsGbr8());
- // TS_ASSERT(KErrNotFound != err);
+ TS_ASSERT(KErrNotFound != err);
err = cpixRegBuf.Find(KRootMapsGbrPath8());
- // TS_ASSERT(KErrNotFound != err);
+ TS_ASSERT(KErrNotFound != err);
iFile.Close();
// now undefine the same volume
err = iSession.UnDefineVolume(KRootMapsGbr);
- // TS_ASSERT(err == KErrNone);
+ TS_ASSERT(err == KErrNone);
// open up the cpixreg.txt file again and make sure
// that it IS NOT in there
err = iFile.Open(iFs, KCpixRegFile, EFileStreamText);
iFile.Read(0, cpixRegBuf);
err = cpixRegBuf.Find(KRootMapsGbr8());
- // TS_ASSERT(KErrNotFound == err);
+ TS_ASSERT(KErrNotFound == err);
err = cpixRegBuf.Find(KRootMapsGbrPath8());
- // TS_ASSERT(KErrNotFound == err);
+ TS_ASSERT(KErrNotFound == err);
iFile.Close();
}
void CTestSearcher::testDefineVolumeWorksWithEmptyPath()
{
TBuf8<KMaxFileSize> cpixRegBuf;
-
+ iFs.Connect();
// open up the cpixreg.txt file again and make sure
// that it IS NOT in there
TInt err = iFile.Open(iFs, KCpixRegFile, EFileStreamText);
iFile.Read(0, cpixRegBuf);
err = cpixRegBuf.Find(KRootMapsGbr8());
- // TS_ASSERT(KErrNotFound == err);
+ TS_ASSERT(KErrNotFound == err);
err = cpixRegBuf.Find(KRootMapsGbrPath8());
- // TS_ASSERT(KErrNotFound == err);
+ TS_ASSERT(KErrNotFound == err);
iFile.Close();
// define a new volume
err = iSession.DefineVolume(KRootMapsGbr, KNullDesC);
- // TS_ASSERT(err == KErrNone);
+ TS_ASSERT(err == KErrNone);
// open up the cpixreg.txt file and make sure that it IS in there
err = iFile.Open(iFs, KCpixRegFile, EFileStreamText);
iFile.Read(0, cpixRegBuf);
err = cpixRegBuf.Find(KRootMapsGbr8());
- // TS_ASSERT(KErrNotFound != err);
+ TS_ASSERT(KErrNotFound != err);
iFile.Close();
// now try to redefine the same volume again
err = iSession.DefineVolume(KRootMapsGbr, KNullDesC);
- // TS_ASSERT(err == KErrNone);
+ TS_ASSERT(err == KErrNone);
// now undefine the same volume
err = iSession.UnDefineVolume(KRootMapsGbr);
- // TS_ASSERT(err == KErrNone);
+ TS_ASSERT(err == KErrNone);
// open up the cpixreg.txt file again and make sure
// that it IS NOT in there
err = iFile.Open(iFs, KCpixRegFile, EFileStreamText);
iFile.Read(0, cpixRegBuf);
err = cpixRegBuf.Find(KRootMapsGbr8());
- // TS_ASSERT(KErrNotFound == err);
+ TS_ASSERT(KErrNotFound == err);
iFile.Close();
}
@@ -342,20 +381,20 @@
{
// Attempt to define a volume for a invalid qualified base app classes.
TInt result = iSession.DefineVolume(KInvalidQualifiedBaseAppClass1, KNullDesC);
- // TS_ASSERT(result == KErrCannotDefineVolume);
+ TS_ASSERT(result == KErrCannotDefineVolume);
result = iSession.DefineVolume(KInvalidQualifiedBaseAppClass2, KNullDesC);
- // TS_ASSERT(result == KErrCannotDefineVolume);
+ TS_ASSERT(result == KErrCannotDefineVolume);
result = iSession.DefineVolume(KInvalidQualifiedBaseAppClass3, KNullDesC);
- // TS_ASSERT(result == KErrCannotDefineVolume);
+ TS_ASSERT(result == KErrCannotDefineVolume);
result = iSession.DefineVolume(KInvalidQualifiedBaseAppClass4, KNullDesC);
- // TS_ASSERT(result == KErrCannotDefineVolume);
+ TS_ASSERT(result == KErrCannotDefineVolume);
// Attempt to undefine a volume that was not defined.
result = iSession.UnDefineVolume(KRootMapsGbr);
- // TS_ASSERT(result == KErrNone);
+ TS_ASSERT(result == KErrNone);
}
void CTestSearcher::testSearchCancellation()
@@ -371,14 +410,14 @@
// Wait until either HandleSearchResultsL or Timeout exceeded
iWait->Start();
- // TS_ASSERT(iDocumentCount == 0);
+ TS_ASSERT(iDocumentCount == 0);
// Now make sure that subsequent searches work correctly
iSearcher->SearchL(*this, KQueryString);
// Wait until HandleSearchResultsL completes
iWait->Start();
- // TS_ASSERT(iDocumentCount > 0);
+ TS_ASSERT(iDocumentCount > 0);
}
void CTestSearcher::testSearchAsynchronous()
@@ -387,25 +426,25 @@
// Wait until HandleSearchResultsL completes
iWait->Start();
- // TS_ASSERT(iDocumentCount > 0);
+ TS_ASSERT(iDocumentCount > 0);
}
void CTestSearcher::testSearchLeavesIfNotCancelled()
{
// Perform first search
TRAPD(err, iSearcher->SearchL(*this, KQueryString) );
- // TS_ASSERT(iDocumentCount == 0);
- // TS_ASSERT(err == KErrNone);
+ TS_ASSERT(iDocumentCount == 0);
+ TS_ASSERT(err == KErrNone);
// before ::HandleSearchResults has been called,
// initiate a second search.
TRAP(err, iSearcher->SearchL(*this, KQueryString));
- // TS_ASSERT(err == KErrInUse);
+ TS_ASSERT(err == KErrInUse);
// Wait until HandleSearchResultsL completes
iWait->Start();
- // TS_ASSERT(iDocumentCount > 0);
+ TS_ASSERT(iDocumentCount > 0);
}
void CTestSearcher::testOpenIndexDb()
@@ -414,10 +453,10 @@
_LIT(KInvalidQualifiedBaseAppClass, "@x:test invalid");
CCPixSearcher* searcher = CCPixSearcher::NewLC(iSession);
TRAPD(err, searcher->OpenDatabaseL(KInvalidQualifiedBaseAppClass) );
- // TS_ASSERT(!searcher->IsDatabaseOpen());
- // TS_ASSERT(err == KErrCannotOpenDatabase);
+ TS_ASSERT(!searcher->IsDatabaseOpen());
+ TS_ASSERT(err == KErrCannotOpenDatabase);
TRAP(err, searcher->SearchL(KQueryString));
- // TS_ASSERT(err == KErrNotReady);
+ TS_ASSERT(err == KErrNotReady);
CleanupStack::PopAndDestroy(searcher);
searcher = NULL;
@@ -425,15 +464,15 @@
// check that same searcher object can open a second indexDb
searcher = CCPixSearcher::NewLC(iSession);
TRAP(err, searcher->OpenDatabaseL(_L("root")));
- // TS_ASSERT(searcher->IsDatabaseOpen());
+ TS_ASSERT(searcher->IsDatabaseOpen());
searcher->SearchL(KQueryString);
- // TS_ASSERT(err == KErrNone);
+ TS_ASSERT(err == KErrNone);
TRAP(err, searcher->OpenDatabaseL(KTestFileBaseAppClassC));
- // TS_ASSERT(err == KErrNone);
- // TS_ASSERT(searcher->IsDatabaseOpen());
+ TS_ASSERT(err == KErrNone);
+ TS_ASSERT(searcher->IsDatabaseOpen());
const TInt docCount = searcher->SearchL(KQueryString);
- // TS_ASSERT(docCount > 0);
+ TS_ASSERT(docCount > 0);
CleanupStack::PopAndDestroy(searcher);
searcher = NULL;
@@ -448,7 +487,7 @@
iMyAOClass->StartL(1000000*10); //Async call: Maximum TimeOut time 10 seconds
iWait->Start();
- // TS_ASSERT(searcher->IsDatabaseOpen());
+ TS_ASSERT(searcher->IsDatabaseOpen());
CleanupStack::PopAndDestroy(searcher);
}
@@ -456,12 +495,13 @@
{
CCPixSearcher* searcher = CCPixSearcher::NewLC(iSession);
TRAPD(err, searcher->OpenDatabaseL(KTestFileBaseAppClassC) );
- // TS_ASSERT(searcher->IsDatabaseOpen());
- // TS_ASSERT(searcher->GetBaseAppClass() != KNullDesC);
+ TS_ASSERT(searcher->IsDatabaseOpen());
+ //TS_ASSERT(searcher->GetBaseAppClass() != KNullDesC);
+ TS_ASSERT( (searcher->GetBaseAppClass().Compare( KNullDesC)) );
//Set Standard Analyzer to improve code coverage of search
searcher->SetAnalyzerL(*this,_L( "" CPIX_ANALYZER_STANDARD ));
iWait->Start(); //Start Wait AO
- // TS_ASSERT(iHandleSetAnalyzerCalled);
+ TS_ASSERT(iHandleSetAnalyzerCalled);
TRAP(err, searcher->SearchL(*this, KQueryString));
// don't wait for the search results.
CleanupStack::PopAndDestroy(searcher);
@@ -472,7 +512,7 @@
void CTestSearcher::testGetDocumentAsync()
{
const TInt result = SearchForTextL(KQueryString, KNullDesC);
- // TS_ASSERT(result > 0);
+ TS_ASSERT(result > 0);
TInt loopCount(0);
@@ -480,23 +520,23 @@
{
iSearcher->GetDocumentL(loopCount, *this);
iWait->Start();
- // TS_ASSERT(iDocument != NULL);
+ TS_ASSERT(iDocument != NULL);
delete iDocument;
iDocument = NULL;
}
- // TS_ASSERT(loopCount == result);
+ TS_ASSERT(loopCount == result);
}
void CTestSearcher::testGetInvalidDocumentAsync()
{
const TInt result = SearchForTextL(KQueryString, KNullDesC);
- // TS_ASSERT(result > 0);
+ TS_ASSERT(result > 0);
// request a document that does not exist.
TRAPD(err, iSearcher->GetDocumentL(result+1, *this));
// above call is not exepected to leave
- // TS_ASSERT(err == KErrNone);
+ TS_ASSERT(err == KErrNone);
iMyAOClass->StartL(1000000*10); //Async call: Maximum TimeOut time 10 seconds
@@ -505,7 +545,29 @@
// Either the iMyAOClass Timeout executed or the the HandleDocumentL
// function. If the HandleDocumentL function was executed, then
// this assert will be true.
- // TS_ASSERT(iHandleDocumentLFunctionCalled);
+ TS_ASSERT(iHandleDocumentLFunctionCalled);
// as requested an invalid document, this must be NULL
- // TS_ASSERT(iDocument == NULL);
+ TS_ASSERT(iDocument == NULL);
}
+
+TInt CTestSearcher::testEcerptLenth()
+ {
+ TInt length = 0;
+ _LIT(KExcerpt , "Transfer the binary output file (found under the traces on the same drive as your activation file, or on the system drive if the drive is a ROM drive) to the PC for viewing." );
+ _LIT ( KFileName , "c:\\Data\\cpixS60unittest\\act0.txt");
+ iIndexer->ResetL();
+ CSearchDocument* doc = CSearchDocument::NewLC( KFileName, KNullDesC, KNullDesC, CSearchDocument::EFileParser );
+ doc->AddExcerptL( KExcerpt );
+ iIndexer->AddL( *doc );
+ CleanupStack::PopAndDestroy( doc );
+ User::After((TTimeIntervalMicroSeconds32)30000000);
+ TInt result = SearchForTextL(KQueryString, KNullDesC);
+ if(result > 0)
+ {
+ CSearchDocument* document = iSearcher->GetDocumentL(0);
+ TS_ASSERT(document != NULL);
+ length = document->Excerpt().Length();
+ delete document;
+ }
+ return ( length > 125 )?KErrGeneral:KErrNone;
+ }
--- a/searchsrv_plat/cpix_search_api/inc/qcpixsearcher.h Mon Apr 19 14:40:16 2010 +0300
+++ b/searchsrv_plat/cpix_search_api/inc/qcpixsearcher.h Mon May 03 13:33:22 2010 +0300
@@ -18,6 +18,35 @@
#ifndef _QCPIXSEARCHER_H
#define _QCPIXSEARCHER_H
+//Uncomment the following line to enable performance measurements
+//#define OST_TRACE_COMPILER_IN_USE
+
+#ifdef OST_TRACE_COMPILER_IN_USE
+
+#include <qdatetime.h>
+#include <qdebug.h>
+#define PERF_SEARCH_START_TIMER searchTimer.start();
+#define PERF_SEARCH_RESTART_TIMER searchTimer.restart();
+#define PERF_SEARCH_ENDLOG qDebug() << "Search QT API took: " << searchTimer.elapsed() << "msec";
+
+#define PERF_GETDOC_START_TIMER getDocumentTimer.start();
+#define PERF_GETDOC_RESTART_TIMER getDocumentTimer.restart();
+#define PERF_GETDOC_ENDLOG qDebug() << "Search QT API took: " << getDocumentTimer.elapsed() << "msec";
+
+#define PERF_TIME_NOW(message) qDebug() << "Search QT API: " << QString(message) << ": " << QTime::currentTime().toString("hh:mm:ss.zzz");
+
+#else
+
+#define PERF_SEARCH_START_TIMER
+#define PERF_SEARCH_RESTART_TIMER
+#define PERF_SEARCH_ENDLOG
+#define PERF_GETDOC_START_TIMER
+#define PERF_GETDOC_RESTART_TIMER
+#define PERF_GETDOC_ENDLOG
+#define PERF_TIME_NOW(message)
+
+#endif
+
/**
* @file
* @ingroup Search Client API fpr Qt Clients
@@ -224,6 +253,11 @@
QCPixSearcherPrivate* const iPvtImpl;
Q_DECLARE_PRIVATE_D( iPvtImpl, QCPixSearcher )
+
+#ifdef OST_TRACE_COMPILER_IN_USE
+ QTime searchTimer;
+ QTime getDocumentTimer;
+#endif
};
#endif //_QCPIXSEARCHER_H
--- a/searchsrv_plat/cpix_utility_api/group/bld.inf Mon Apr 19 14:40:16 2010 +0300
+++ b/searchsrv_plat/cpix_utility_api/group/bld.inf Mon May 03 13:33:22 2010 +0300
@@ -27,4 +27,5 @@
../inc/fileharvesterdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(fileharvesterdefs.h)
../inc/indevicecfg.h MW_LAYER_PLATFORM_EXPORT_PATH(indevicecfg.h)
../inc/messageharvesterdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(messageharvesterdefs.h)
-../inc/searchserverdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(searchserverdefs.h)
\ No newline at end of file
+../inc/searchserverdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(searchserverdefs.h)
+../inc/cpixcontentinfocommon.h MW_LAYER_PLATFORM_EXPORT_PATH(cpixcontentinfocommon.h)
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searchsrv_plat/cpix_utility_api/inc/cpixcontentinfocommon.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This component is to store the details of harvester plugins
+*
+*/
+
+#ifndef CPIXCONTENTINFOCOMMON_H_
+#define CPIXCONTENTINFOCOMMON_H_
+
+//ContentInfo DB path
+_LIT( KCIDBPath , "c:\\Private\\2001f6fb" );
+//Content Info DB filename
+_LIT(KContentInfoFileName,"cpixcontentinfo.sq");
+
+//Table name in ContentInfo database
+_LIT( KContentInfoTableName , "table1" );
+
+//Max length for plugin display name
+const TInt KMaxPluginNameLength(20);
+
+//column name for content name column
+_LIT( KContentName , "NAME" );
+
+//column name for Indexing status column
+_LIT( KIndexingStatus , "INS" );
+
+//column name for Blacklist status column
+_LIT( KBlacklistStatus , "BLS" );
+
+//Primary key
+_LIT( KPrimaryKey , "NAME" );
+
+#endif /* CPIXCONTENTINFOCOMMON_H_ */
--- a/searchsrv_plat/cpix_utility_api/inc/cpixmaindefs.h Mon Apr 19 14:40:16 2010 +0300
+++ b/searchsrv_plat/cpix_utility_api/inc/cpixmaindefs.h Mon May 03 13:33:22 2010 +0300
@@ -112,6 +112,12 @@
*/
#define LCPIX_DEFAULT_FIELD L"_aggregate"
+ /**
+ * The default field to search for prefixes (aggregate of the contents of
+ * prefixes of other fields).
+ */
+#define LCPIX_DEFAULT_PREFIX_FIELD L"_aggregate_prefix"
+
/**
* Documents, as created by the client may undergo a further
@@ -207,6 +213,10 @@
#define LAPPLICATION_MIMETYPE L"application/application"
#define NOTES_MIMETYPE "application/notes"
#define LNOTES_MIMETYPE L"application/notes"
+#define FILE_MIMETYPE "type/file"
+#define LFILE_MIMETYPE L"type/file"
+#define FOLDER_MIMETYPE "type/folder"
+#define LFOLDER_MIMETYPE L"type/folder"
/*
* Analyzer definition related constants
@@ -232,10 +242,13 @@
#define CPIX_FILTER_STOP L"stop"
#define CPIX_FILTER_STEM L"stem"
#define CPIX_FILTER_LENGTH L"length"
+#define CPIX_FILTER_PREFIXES L"prefixes"
#define CPIX_WLANG_EN L"en"
#define CPIX_WLANG_FI L"fi"
#define CPIX_WLANG_HU L"hu"
#define CPIX_WLANG_RU L"ru"
+#define MAX_EXCERPT_LENGTH 125 //maximum exceprt length
+
#endif /*__CPIXMAINDEFS_H__*/
--- a/searchsrv_plat/cpix_utility_api/inc/fileharvesterdefs.h Mon Apr 19 14:40:16 2010 +0300
+++ b/searchsrv_plat/cpix_utility_api/inc/fileharvesterdefs.h Mon May 03 13:33:22 2010 +0300
@@ -26,6 +26,8 @@
#define FILEAPPCLASS "root file"
#define LFILEAPPCLASS L"root file"
+#define CONTENTAPPCLASS "root file content"
+#define LCONTENTAPPCLASS L"root file content"
#define TEXTAPPCLASS "root file usrdoc text"
#define LTEXTAPPCLASS L"root file usrdoc text"
#define PDFAPPCLASS "root file usrdoc pdf"
@@ -42,8 +44,8 @@
#define LBASENAME_FIELD L"BaseName"
#define EXTENSION_FIELD "Extension"
#define LEXTENSION_FIELD L"Extension"
-#define FULLNAME_FIELD "FullName"
-#define LFULLNAME_FIELD L"FullName"
+#define FULLNAME_FIELD "Name"
+#define LFULLNAME_FIELD L"Name"
#define CONTENTS_FIELD L"Contents"
--- a/tsrc/cpixmwtester/EABI/cpixmwtesteru.def Mon Apr 19 14:40:16 2010 +0300
+++ b/tsrc/cpixmwtester/EABI/cpixmwtesteru.def Mon May 03 13:33:22 2010 +0300
@@ -4,4 +4,10 @@
_ZTI13CBlacklistMgr @ 3 NONAME
_ZTV12CBlacklistDb @ 4 NONAME
_ZTV13CBlacklistMgr @ 5 NONAME
+ _ZTI12CContentInfo @ 6 NONAME
+ _ZTI14CContentInfoDb @ 7 NONAME
+ _ZTI15CContentInfoMgr @ 8 NONAME
+ _ZTV12CContentInfo @ 9 NONAME
+ _ZTV14CContentInfoDb @ 10 NONAME
+ _ZTV15CContentInfoMgr @ 11 NONAME
--- a/tsrc/cpixmwtester/conf/cpixmwtester.cfg Mon Apr 19 14:40:16 2010 +0300
+++ b/tsrc/cpixmwtester/conf/cpixmwtester.cfg Mon May 03 13:33:22 2010 +0300
@@ -1,3 +1,6 @@
+[StifSettings]
+CapsModifier= capsmod_mw.exe
+[EndStifSettings]
[Test]
title TestBlacklistPlugin
@@ -19,3 +22,45 @@
foobar TestWatchdog
delete foobar
[Endtest]
+
+[Test]
+title TestDeleteContentInfoDB
+create CPixMWTester foobar
+foobar TestDeleteContentInfoDB
+delete foobar
+[Endtest]
+
+[Test]
+title TestAddContent
+create CPixMWTester foobar
+foobar TestAddContent contacts
+delete foobar
+[Endtest]
+
+[Test]
+title TestRemoveContent
+create CPixMWTester foobar
+foobar TestRemoveContent contacts
+delete foobar
+[Endtest]
+
+[Test]
+title TestResetContent
+create CPixMWTester foobar
+foobar TestResetContent contacts
+delete foobar
+[Endtest]
+
+[Test]
+title TestUpdateBLStatus
+create CPixMWTester foobar
+foobar TestUpdateBLStatus contacts
+delete foobar
+[Endtest]
+
+[Test]
+title TestUpdateINStatus
+create CPixMWTester foobar
+foobar TestUpdateINStatus contacts
+delete foobar
+[Endtest]
\ No newline at end of file
--- a/tsrc/cpixmwtester/group/cpixmwtester.mmp Mon Apr 19 14:40:16 2010 +0300
+++ b/tsrc/cpixmwtester/group/cpixmwtester.mmp Mon May 03 13:33:22 2010 +0300
@@ -87,9 +87,12 @@
//------------------Added for Blacklist database --------------------------
USERINCLUDE ../../../harvester/harvesterserver/inc
+USERINCLUDE ../../../harvester/harvesterserver/traces
SOURCEPATH ../../../harvester/harvesterserver/src
SOURCE CBlacklistDb.cpp CBlacklistMgr.cpp
+SOURCE ccontentinfo.cpp ccontentinfodb.cpp contentinfomgr.cpp
+LIBRARY sqldb.lib
//------------------End for Blacklist database ----------------------------
-
+EPOCALLOWDLLDATA
// End of File
--- a/tsrc/cpixmwtester/inc/cpixmwtester.h Mon Apr 19 14:40:16 2010 +0300
+++ b/tsrc/cpixmwtester/inc/cpixmwtester.h Mon May 03 13:33:22 2010 +0300
@@ -164,6 +164,18 @@
*/
virtual TInt TestWatchdogL( CStifItemParser& aItem );
+ virtual TInt TestDeleteContentInfoDBL( CStifItemParser& aItem );
+
+ virtual TInt TestAddContentL( CStifItemParser& aItem );
+
+ virtual TInt TestRemoveContentL( CStifItemParser& aItem );
+
+ virtual TInt TestResetContentL( CStifItemParser& aItem );
+
+ virtual TInt TestUpdateBLStatusL( CStifItemParser& aItem );
+
+ virtual TInt TestUpdateINStatusL( CStifItemParser& aItem );
+
/**
* Method used to log version of test class
*/
--- a/tsrc/cpixmwtester/src/capsmod_mw/group/capsmod_mw.mmp Mon Apr 19 14:40:16 2010 +0300
+++ b/tsrc/cpixmwtester/src/capsmod_mw/group/capsmod_mw.mmp Mon May 03 13:33:22 2010 +0300
@@ -32,7 +32,7 @@
#ifdef SBSV2
#if defined(__S60_)
- OSEXT_LAYER_SYSTEMINCLUDE
+ OS_LAYER_SYSTEMINCLUDE
#else // __S60_ not defined
SYSTEMINCLUDE /epoc32/include
SYSTEMINCLUDE /epoc32/include/internal
--- a/tsrc/cpixmwtester/src/cpixmwtesterblocks.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/tsrc/cpixmwtester/src/cpixmwtesterblocks.cpp Mon May 03 13:33:22 2010 +0300
@@ -21,8 +21,11 @@
#include <e32svr.h>
#include <StifParser.h>
#include <Stiftestinterface.h>
-
+#include <cpixcontentinfocommon.h>
+#include <sqldb.h>
#include "CBlacklistMgr.h"
+#include "contentinfomgr.h"
+#include "ccontentinfo.h"
// EXTERNAL DATA STRUCTURES
//extern ?external_data;
@@ -40,7 +43,7 @@
//For Watchdog
_LIT(KTestHarvesterServer,"CPixHarvesterServer");
_LIT(aEXeFileName , "WatchDog.exe");
-
+_LIT(KDriveC, "c:");
// MACROS
//#define ?macro ?macro_def
@@ -65,6 +68,48 @@
if( KErrNone == error ) logger->Log( KNoErrorString );
else logger->Log( errorString );
}
+
+void getcontentstatus ( TPtrC aContent , TInt& aBLstatus ,TInt& aINstatus)
+ {
+ RSqlDatabase sqlDB;
+ RFs fssession;
+ User::LeaveIfError( fssession.Connect() );
+ TFileName privatePath;
+ TFileName datafile;
+ fssession.CreatePrivatePath(EDriveC);
+ fssession.PrivatePath(privatePath);//data caged path of loading process
+ fssession.Close();
+ datafile.Copy(KDriveC);
+ datafile.Append(privatePath);
+ datafile.Append( KContentInfoFileName );
+ TInt err = sqlDB.Open( datafile );
+
+ if ( err ==KErrNone )
+ {
+ TSqlScalarFullSelectQuery fullSelectQuery(sqlDB);
+
+ TBuf<100> sql;
+ // Query with INS column
+ _LIT(KgetINstatusSqlFormat, "SELECT INS FROM table1 WHERE NAME = '");
+ _LIT(Kendtag, "'");
+ sql.Copy( KgetINstatusSqlFormat);
+ sql.Append( aContent);
+ sql.Append( Kendtag );
+ //sql.Format( KgetINstatusSqlFormat , aContent );
+ // Read INS as integer.
+ aINstatus = fullSelectQuery.SelectIntL(sql);
+
+ _LIT(KgetBLstatusSqlFormat, "SELECT BLS FROM table1 WHERE NAME = '");
+ sql.FillZ();
+ sql.Copy( KgetBLstatusSqlFormat);
+ sql.Append( aContent);
+ sql.Append( Kendtag );
+ //sql.Format( KgetBLstatusSqlFormat , aContent );
+ // Read BLS as integer.
+ aBLstatus = fullSelectQuery.SelectIntL(sql);
+ }
+ sqlDB.Close();
+ }
// -----------------------------------------------------------------------------
// ?function_name ?description.
// ?description
@@ -115,7 +160,13 @@
// Second is the actual implementation member function.
ENTRY( "TestBlacklistPlugin", CCPixMWTester::TestBlacklistPluginL ),
ENTRY( "TestBlacklistPluginVersion", CCPixMWTester::TestBlacklistPluginVersionL ),
- ENTRY( "TestWatchdog",CCPixMWTester::TestWatchdogL ),
+ ENTRY( "TestWatchdog",CCPixMWTester::TestWatchdogL ),
+ ENTRY( "TestDeleteContentInfoDB",CCPixMWTester::TestDeleteContentInfoDBL ),
+ ENTRY( "TestAddContent",CCPixMWTester::TestAddContentL ),
+ ENTRY( "TestRemoveContent",CCPixMWTester::TestRemoveContentL ),
+ ENTRY( "TestResetContent",CCPixMWTester::TestResetContentL ),
+ ENTRY( "TestUpdateBLStatus",CCPixMWTester::TestUpdateBLStatusL ),
+ ENTRY( "TestUpdateINStatus",CCPixMWTester::TestUpdateINStatusL ),
//ADD NEW ENTRY HERE
// [test cases entries] - Do not remove
@@ -192,7 +243,7 @@
// CCPixMWTester::TestWatchdogL
// -----------------------------------------------------------------------------
//
-TInt CCPixMWTester::TestWatchdogL( CStifItemParser&)
+TInt CCPixMWTester::TestWatchdogL( CStifItemParser& /*aItem*/)
{
TInt err = KErrNone;
//Start the watchdog exe
@@ -215,6 +266,176 @@
return err;
}
// -----------------------------------------------------------------------------
+// CCPixMWTester::TestDeleteContentInfoDBL
+// -----------------------------------------------------------------------------
+//
+TInt CCPixMWTester::TestDeleteContentInfoDBL( CStifItemParser& /*aItem*/)
+ {
+ RFs fssession;
+ CContentInfoMgr* contentInfoMgr = NULL;
+ User::LeaveIfError( fssession.Connect() );
+ TFileName privatePath;
+ TFileName datafile;
+ fssession.CreatePrivatePath(EDriveC);
+ fssession.PrivatePath(privatePath);//data caged path of loading process
+ datafile.Copy(KDriveC);
+ datafile.Append(privatePath);
+ datafile.Append( KContentInfoFileName );
+ //delete the database file
+ fssession.Delete( datafile );
+ TRAPD ( err , contentInfoMgr = CContentInfoMgr::NewL() );
+ delete contentInfoMgr;
+ doLog( iLog, err, KNoErrorString );
+ return err;
+ }
+// -----------------------------------------------------------------------------
+// CCPixMWTester::TestAddContentL
+// -----------------------------------------------------------------------------
+//
+TInt CCPixMWTester::TestAddContentL( CStifItemParser& aItem)
+ {
+ RFs fssession;
+ TPtrC content;
+ TInt err = KErrNone;
+ aItem.GetNextString( content );
+ CContentInfoMgr* contentInfoMgr = CContentInfoMgr::NewL();
+ CContentInfo* contentinfo = CContentInfo::NewL();
+ //Add the content with given content name and 0 as BL status and 1 as IN status
+ contentinfo->SetNameL( content );
+ contentinfo->SetBlacklistStatus( 0 );
+ contentinfo->SetIndexStatus( 1 );
+ contentInfoMgr->AddL( contentinfo );
+ delete contentinfo;
+ //TBuf<50> name;
+ //name.Copy( content.Ptr() );
+ //Find if the content exists
+ TBool found = contentInfoMgr->FindL( content );
+ delete contentInfoMgr;
+ if ( !found ) err = KErrNotFound;
+ doLog( iLog, err, KNoErrorString );
+ return err;
+ }
+// -----------------------------------------------------------------------------
+// CCPixMWTester::TestRemoveContentL
+// -----------------------------------------------------------------------------
+//
+TInt CCPixMWTester::TestRemoveContentL( CStifItemParser& aItem)
+ {
+ RFs fssession;
+ TPtrC content;
+ TInt err = KErrNotFound;
+ aItem.GetNextString( content );
+ CContentInfoMgr* contentInfoMgr = CContentInfoMgr::NewL();
+ contentInfoMgr->ResetL();
+ CContentInfo* contentinfo = CContentInfo::NewL();
+ //Add the content with given content name and 0 as BL status and 1 as IN status
+ contentinfo->SetNameL( content );
+ contentinfo->SetBlacklistStatus( 0 );
+ contentinfo->SetIndexStatus( 1 );
+ contentInfoMgr->AddL( contentinfo );
+ delete contentinfo;
+ //check if the added content exists
+ TBool found = contentInfoMgr->FindL( content );
+ if ( found )
+ {
+ //remove the content from DB and find it
+ contentInfoMgr->RemoveL( content );
+ found = contentInfoMgr->FindL( content );
+ if ( !found ) err = KErrNone;
+ }
+ delete contentInfoMgr;
+ doLog( iLog, err, KNoErrorString );
+ return err;
+ }
+// -----------------------------------------------------------------------------
+// CCPixMWTester::TestResetContentL
+// -----------------------------------------------------------------------------
+//
+TInt CCPixMWTester::TestResetContentL( CStifItemParser& aItem)
+ {
+ RFs fssession;
+ TPtrC content;
+ TInt err = KErrNotFound;
+ aItem.GetNextString( content );
+ CContentInfoMgr* contentInfoMgr = CContentInfoMgr::NewL();
+ CContentInfo* contentinfo = CContentInfo::NewL();
+ //Add the content with given content name and 0 as BL status and 1 as IN status
+ contentinfo->SetNameL( content );
+ contentinfo->SetBlacklistStatus( 0 );
+ contentinfo->SetIndexStatus( 1 );
+ contentInfoMgr->AddL( contentinfo );
+ delete contentinfo;
+ //make sure there is some content exists in the database
+ TInt count = contentInfoMgr->GetContentCountL();
+ if ( count )
+ {
+ //reset the DB and get the count . the count should be 0
+ contentInfoMgr->ResetL();
+ count = contentInfoMgr->GetContentCountL( );
+ if ( !count ) err = KErrNone;
+ }
+ delete contentInfoMgr;
+ doLog( iLog, err, KNoErrorString );
+ return err;
+ }
+// -----------------------------------------------------------------------------
+// CCPixMWTester::TestUpdateBLStatusL
+// -----------------------------------------------------------------------------
+//
+TInt CCPixMWTester::TestUpdateBLStatusL( CStifItemParser& aItem)
+ {
+ RFs fssession;
+ TPtrC content;
+ TInt err = KErrNotFound;
+ aItem.GetNextString( content );
+ CContentInfoMgr* contentInfoMgr = CContentInfoMgr::NewL();
+ contentInfoMgr->ResetL();
+ CContentInfo* contentinfo = CContentInfo::NewL();
+ //Add the content with given content name and 0 as BL status and 1 as IN status
+ contentinfo->SetNameL( content );
+ contentinfo->SetBlacklistStatus( 0 );
+ contentinfo->SetIndexStatus( 1 );
+ contentInfoMgr->AddL( contentinfo );
+ delete contentinfo;
+ //Update the blacklist status to 1
+ contentInfoMgr->UpdateBlacklistStatusL( content , 1);
+ TInt blstatus =0,instatus = 0;
+ getcontentstatus ( content , blstatus , instatus);
+ if ( blstatus ) err = KErrNone;
+ delete contentInfoMgr;
+ doLog( iLog, err, KNoErrorString );
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// CCPixMWTester::TestUpdateINStatusL
+// -----------------------------------------------------------------------------
+//
+TInt CCPixMWTester::TestUpdateINStatusL( CStifItemParser& aItem)
+ {
+ RFs fssession;
+ TPtrC content;
+ TInt err = KErrNotFound;
+ aItem.GetNextString( content );
+ CContentInfoMgr* contentInfoMgr = CContentInfoMgr::NewL();
+ contentInfoMgr->ResetL();
+ CContentInfo* contentinfo = CContentInfo::NewL();
+ //Add the content with given content name and 0 as BL status and 1 as IN status
+ contentinfo->SetNameL( content );
+ contentinfo->SetBlacklistStatus( 0 );
+ contentinfo->SetIndexStatus( 1 );
+ contentInfoMgr->AddL( contentinfo );
+ delete contentinfo;
+ //Update the Indexing status to 0
+ contentInfoMgr->UpdatePluginIndexStatusL( content , 0);
+ TInt blstatus = 0,instatus = 1;
+ getcontentstatus ( content , blstatus , instatus);
+ if ( !blstatus ) err = KErrNone;
+ delete contentInfoMgr;
+ doLog( iLog, err, KNoErrorString );
+ return err;
+ }
+// -----------------------------------------------------------------------------
// CCPixMWTester::?member_function
// ?implementation_description
// (other items were commented in a header).
--- a/watchdog/group/watchdog.mmp Mon Apr 19 14:40:16 2010 +0300
+++ b/watchdog/group/watchdog.mmp Mon May 03 13:33:22 2010 +0300
@@ -25,6 +25,7 @@
END
USERINCLUDE ../inc
+USERINCLUDE ../traces
MW_LAYER_SYSTEMINCLUDE
--- a/watchdog/src/cwdmonitor.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/watchdog/src/cwdmonitor.cpp Mon May 03 13:33:22 2010 +0300
@@ -19,6 +19,11 @@
#include "WatchDogCommon.h"
#include "CWDTimer.h"
#include <HarvesterServerLogger.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cwdmonitorTraces.h"
+#endif
+
// -----------------------------------------------------------------------------
// CWDMonitor::NewL
// -----------------------------------------------------------------------------
@@ -73,6 +78,7 @@
//
void CWDMonitor::HandleWDTimerL()
{
+ OstTrace0( TRACE_NORMAL, CWDMONITOR_HANDLEWDTIMERL, "CWDMonitor::HandleWDTimerL(): Check the servers" );
CPIXLOGSTRING("CWDMonitor::HandleWDTimerL(): Check the servers");
TFindServer harvesterServer(KHarvesterServer);
TFindServer searchServer(KSearchServer);
@@ -81,6 +87,7 @@
if ( harvesterServer.Next(name) != KErrNone)
{
+ OstTrace0( TRACE_NORMAL, DUP1_CWDMONITOR_HANDLEWDTIMERL, "Harvester Server is down, Starting Harvester Server" );
CPIXLOGSTRING("Harvester Server is down, Starting Harvester Server");
//Harvester server is not running.
//Start Harvester server
@@ -88,6 +95,7 @@
}
else if ( searchServer.Next( name ) != KErrNone)
{
+ OstTrace0( TRACE_NORMAL, DUP2_CWDMONITOR_HANDLEWDTIMERL, "Search Server is down, Starting Search Server" );
CPIXLOGSTRING("Search Server is down, Starting Search Server");
//Search server is not running.
//Start search server
@@ -101,8 +109,10 @@
//
void CWDMonitor::StartMonitor()
{
+ OstTraceFunctionEntry0( CWDMONITOR_STARTMONITOR_ENTRY );
CPIXLOGSTRING("CWDMonitor::StartMonitor(): Entered");
iWDTimer->StartWDTimer();
+ OstTraceFunctionExit0( CWDMONITOR_STARTMONITOR_EXIT );
}
// -----------------------------------------------------------------------------
--- a/watchdog/src/cwdtimer.cpp Mon Apr 19 14:40:16 2010 +0300
+++ b/watchdog/src/cwdtimer.cpp Mon May 03 13:33:22 2010 +0300
@@ -20,6 +20,11 @@
#include "WatchDogCommon.h"
#include "MWDTimerHandler.h"
#include <HarvesterServerLogger.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cwdtimerTraces.h"
+#endif
+
// -----------------------------------------------------------------------------
// CWDTimer::NewL
// -----------------------------------------------------------------------------
@@ -78,10 +83,12 @@
//
void CWDTimer::StartWDTimer()
{
+ OstTraceFunctionEntry0( CWDTIMER_STARTWDTIMER_ENTRY );
CPIXLOGSTRING("CWDTimer::StartWDTimer(): Entered");
//start the timer
iTimer.After( iStatus , MONITORING_DELAY ); // Wait 60 seconds before checking the servers
- SetActive();
+ OstTraceFunctionExit0( CWDTIMER_STARTWDTIMER_EXIT );
+ SetActive();
}
// -----------------------------------------------------------------------------
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/watchdog/traces/CWDMonitorTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,19 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CWDMONITORTRACES_H__
+#define __CWDMONITORTRACES_H__
+
+#define KOstTraceComponentID 0x20029ab8
+
+#define CWDMONITOR_HANDLEWDTIMERL 0x860001
+#define DUP1_CWDMONITOR_HANDLEWDTIMERL 0x860002
+#define DUP2_CWDMONITOR_HANDLEWDTIMERL 0x860003
+#define CWDMONITOR_STARTMONITOR_ENTRY 0x8a0001
+#define CWDMONITOR_STARTMONITOR_EXIT 0x8a0002
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/watchdog/traces/CWDTimerTraces.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,16 @@
+// Created by TraceCompiler 2.1.2
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CWDTIMERTRACES_H__
+#define __CWDTIMERTRACES_H__
+
+#define KOstTraceComponentID 0x20029ab8
+
+#define CWDTIMER_STARTWDTIMER_ENTRY 0x8a0003
+#define CWDTIMER_STARTWDTIMER_EXIT 0x8a0004
+
+
+#endif
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/watchdog/traces/OstTraceDefinitions.h Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/watchdog/traces/fixed_id.definitions Mon May 03 13:33:22 2010 +0300
@@ -0,0 +1,10 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FLOW=0x8a
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FLOW[0x8A]_CWDMONITOR_STARTMONITOR_ENTRY=0x1
+[TRACE]TRACE_FLOW[0x8A]_CWDMONITOR_STARTMONITOR_EXIT=0x2
+[TRACE]TRACE_FLOW[0x8A]_CWDTIMER_STARTWDTIMER_ENTRY=0x3
+[TRACE]TRACE_FLOW[0x8A]_CWDTIMER_STARTWDTIMER_EXIT=0x4
+[TRACE]TRACE_NORMAL[0x86]_CWDMONITOR_HANDLEWDTIMERL=0x1
+[TRACE]TRACE_NORMAL[0x86]_DUP1_CWDMONITOR_HANDLEWDTIMERL=0x2
+[TRACE]TRACE_NORMAL[0x86]_DUP2_CWDMONITOR_HANDLEWDTIMERL=0x3