sapi_logging/tsrc/testing/tlogprovidertest/src/tdelete.cpp
changeset 0 14df0fbfcc4e
equal deleted inserted replaced
-1:000000000000 0:14df0fbfcc4e
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 #include <LiwServiceHandler.h>
       
    19 #include <LiwCommon.h>
       
    20 #include <logcli.h>
       
    21 #include <logwrap.h>
       
    22 #include "tlogprovidertest.h"
       
    23 #include "serviceerrno.h"
       
    24 #include "tcallback.h"
       
    25 
       
    26  #include "tconstants.h"
       
    27 #include "tfilterdetails.h"
       
    28  #include"teventdetails.h"
       
    29  
       
    30  
       
    31  
       
    32  _LIT8(KEventIdKey , "EventId");
       
    33  
       
    34  TInt deletetest1L(CEventDetails *aDetails)
       
    35 {
       
    36 
       
    37 
       
    38 CLiwServiceHandler* ServiceHandler = CLiwServiceHandler::NewL();
       
    39      // Input and output parameter list
       
    40     CLiwGenericParamList* inputlist = &(ServiceHandler->InParamListL());
       
    41     
       
    42     CLiwGenericParamList* outputlist = &(ServiceHandler->OutParamListL());
       
    43     
       
    44     CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KDsInterfaceName , KLoggingContents) ;
       
    45     
       
    46   
       
    47     
       
    48     crit->SetServiceClass(TUid::Uid(KLiwClassBase));
       
    49     
       
    50     RCriteriaArray a;
       
    51     
       
    52 	
       
    53 	a.AppendL(crit);
       
    54 
       
    55    
       
    56     
       
    57 	
       
    58 	ServiceHandler->AttachL(a) ;
       
    59 	
       
    60 	
       
    61 	ServiceHandler->ExecuteServiceCmdL(*crit, *inputlist, *outputlist);
       
    62 	 
       
    63  	
       
    64 
       
    65 	
       
    66     TInt pos = 0;
       
    67 	
       
    68  
       
    69 	const TLiwGenericParam *genericparm = outputlist->FindFirst(pos  , KDsInterfaceName);
       
    70 	
       
    71 	if(!genericparm)
       
    72 	{
       
    73 
       
    74 	 
       
    75 	 User :: Leave(KErrArgument) ;
       
    76 	}
       
    77 	
       
    78    MLiwInterface* LogInterface = (genericparm->Value()).AsInterface();
       
    79     
       
    80     
       
    81   TBufC8<20>CmdBufSet(KCmdAdd) ;
       
    82   
       
    83   outputlist->Reset() ;
       
    84   
       
    85   inputlist->Reset() ;
       
    86   
       
    87   CLiwDefaultMap *EventDetails = CLiwDefaultMap :: NewL() ;
       
    88   
       
    89   
       
    90   
       
    91   EventDetails->InsertL(KEventTypeKey , TLiwVariant(aDetails->GetEventType()) );
       
    92   
       
    93   
       
    94  if(((unsigned int)aDetails->GetDurationType()!=0))
       
    95  	{
       
    96  	EventDetails->InsertL(KEventDurationKey ,TLiwVariant((unsigned int)aDetails->GetDurationType()) );
       
    97  	}
       
    98     
       
    99  if(aDetails->GetContactType() !=0 )
       
   100  	{
       
   101  	EventDetails->InsertL(KContactidKey , TLiwVariant(aDetails->GetContactType()) );
       
   102  	}
       
   103     
       
   104  if((unsigned int)aDetails->GetLinkType()!=0)
       
   105  	{
       
   106  	EventDetails->InsertL(KLinkKey , TLiwVariant((unsigned int)aDetails->GetLinkType()) );
       
   107  	}
       
   108     
       
   109  if(aDetails->GetTimer() !=0 )
       
   110  	{
       
   111  	EventDetails->InsertL(KEventTimeKey , TLiwVariant(aDetails->GetTimer())) ;
       
   112  	}
       
   113     
       
   114    
       
   115   TBuf<10> EmptyDes ;
       
   116    
       
   117    
       
   118    if(aDetails->GetSubjectType() != EmptyDes)
       
   119    	{
       
   120    	 EventDetails->InsertL(KSubjectKey , TLiwVariant(aDetails->GetSubjectType())) ;
       
   121    	}
       
   122     
       
   123    
       
   124    
       
   125     
       
   126  if(aDetails->GetNumberType()!= EmptyDes)
       
   127  	{
       
   128  	EventDetails->InsertL(KPhoneNumberKey , TLiwVariant(aDetails->GetNumberType())) ;
       
   129  	}
       
   130     
       
   131  if(aDetails->GetRemotePartyType() != EmptyDes)
       
   132  	{
       
   133  	EventDetails->InsertL(KRemotePartyKey , TLiwVariant(aDetails->GetRemotePartyType())) ;
       
   134  	}
       
   135     
       
   136  if(aDetails->GetDirectionType() >= 0 )
       
   137 	 {
       
   138  	EventDetails->InsertL(KDirectionKey , TLiwVariant(aDetails->GetDirectionType())) ;
       
   139  	}
       
   140     
       
   141  if(aDetails->GetDescriptionType() != EmptyDes)
       
   142  	{
       
   143  	EventDetails->InsertL(KDescriptionKey , TLiwVariant(aDetails->GetDescriptionType())) ;
       
   144  	}
       
   145     
       
   146  if(aDetails->GetStatusType() >= 0  )
       
   147  	{
       
   148  	EventDetails->InsertL(KDeliveryStatusKey , TLiwVariant(aDetails->GetStatusType())) ;
       
   149  	}
       
   150     
       
   151   
       
   152 
       
   153   TBuf16 <10> Contents(KContentType) ;
       
   154   
       
   155   inputlist->AppendL(TLiwGenericParam(KContentTypeKey , TLiwVariant(Contents))) ;
       
   156   
       
   157   inputlist->AppendL(TLiwGenericParam(KEventDetails , TLiwVariant(EventDetails))) ;
       
   158   EventDetails->DecRef();
       
   159     
       
   160   LogInterface->ExecuteCmdL(CmdBufSet , *inputlist , *outputlist ); 
       
   161  
       
   162   
       
   163   
       
   164   
       
   165    TInt index = 0 ;
       
   166    
       
   167    const TLiwGenericParam *ErrCode  = outputlist->FindFirst(index , KErrCode) ;
       
   168    
       
   169    if(!ErrCode )
       
   170     {
       
   171     
       
   172   	 User :: Leave(KErrArgument) ;
       
   173     }
       
   174     
       
   175     TInt retval  = ErrCode->Value().AsTInt32() ;
       
   176   
       
   177   if(retval != SErrNone )
       
   178   	{
       
   179   	
       
   180   	    LogInterface->Close() ;
       
   181   	   delete ServiceHandler;
       
   182   	   a.ResetAndDestroy();
       
   183    	   a.Close();
       
   184     
       
   185       
       
   186     
       
   187   	 User :: Leave(KErrArgument) ;
       
   188   	}
       
   189    
       
   190  
       
   191   
       
   192    
       
   193   index = 0 ;
       
   194   const TLiwGenericParam *genparm = outputlist->FindFirst(index , KResponse) ;
       
   195   
       
   196   if(!genparm)
       
   197     {
       
   198    
       
   199    	 User :: Leave(KErrArgument) ;
       
   200     }
       
   201     
       
   202     
       
   203      
       
   204    TBufC<20> itemid = (genparm->Value()).AsDes() ;
       
   205     
       
   206     
       
   207     
       
   208      inputlist->Reset() ; outputlist->Reset() ;
       
   209   
       
   210    
       
   211    //Insert the contenttype to inputlist
       
   212    CLiwDefaultMap *Idmap = CLiwDefaultMap :: NewL() ;
       
   213    Idmap->InsertL(KLogId ,TLiwVariant(itemid)) ;
       
   214    
       
   215     TBufC16<10> contentType(KContentType) ;
       
   216    //Insert the contenttype to inputlist
       
   217    inputlist->AppendL(TLiwGenericParam(KContentTypeKey , TLiwVariant(contentType))) ;
       
   218  
       
   219    
       
   220  // inputlist->AppendL(TLiwGenericParam(KLogId , TLiwVariant((TInt32)itemid))) ;
       
   221     inputlist->AppendL(TLiwGenericParam(KData , TLiwVariant(Idmap))) ; 
       
   222     Idmap->DecRef();
       
   223  // CmdBuf = KCmdDelete ;
       
   224   
       
   225   
       
   226   TBufC8<20>CmdBuf(KCmdDelete) ;
       
   227   LogInterface->ExecuteCmdL(CmdBuf , *inputlist , *outputlist) ;
       
   228   
       
   229   pos = 0 ;
       
   230   const TLiwGenericParam *Errprm = outputlist->FindFirst(pos , KErrCode ) ;
       
   231   
       
   232   if(!Errprm)
       
   233   	{
       
   234    
       
   235   	 User :: Leave(KErrArgument) ;
       
   236   	}
       
   237   	
       
   238   TInt retval1  = Errprm->Value().AsTInt32() ;
       
   239   
       
   240   if(retval1 != SErrNone )
       
   241   	{
       
   242    
       
   243   	 User :: Leave(KErrArgument) ;
       
   244   	}
       
   245     
       
   246    
       
   247   
       
   248 
       
   249   
       
   250   
       
   251    
       
   252       LogInterface->Close() ;
       
   253      delete ServiceHandler;
       
   254     // delete crit;
       
   255    
       
   256    	 a.ResetAndDestroy();
       
   257    	 a.Close();
       
   258     
       
   259    
       
   260     } 
       
   261    
       
   262     
       
   263 
       
   264       
       
   265  
       
   266 
       
   267 TInt deletetest1_0L(CEventDetails *aDetails)
       
   268 {
       
   269 
       
   270 
       
   271 CLiwServiceHandler* ServiceHandler = CLiwServiceHandler::NewL();
       
   272      // Input and output parameter list
       
   273     CLiwGenericParamList* inputlist = &(ServiceHandler->InParamListL());
       
   274     
       
   275     CLiwGenericParamList* outputlist = &(ServiceHandler->OutParamListL());
       
   276     
       
   277     CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KDsInterfaceName , KLoggingContents) ;
       
   278     
       
   279   
       
   280     
       
   281     crit->SetServiceClass(TUid::Uid(KLiwClassBase));
       
   282     
       
   283     RCriteriaArray a;
       
   284     
       
   285 	
       
   286 	a.AppendL(crit);
       
   287 
       
   288    
       
   289     
       
   290 	
       
   291 	ServiceHandler->AttachL(a) ;
       
   292 	
       
   293 	
       
   294 	ServiceHandler->ExecuteServiceCmdL(*crit, *inputlist, *outputlist);
       
   295 	 
       
   296  	
       
   297 
       
   298 	
       
   299     TInt pos = 0;
       
   300 	
       
   301  
       
   302 	const TLiwGenericParam *genericparm = outputlist->FindFirst(pos  , KDsInterfaceName);
       
   303 	
       
   304 	if(!genericparm)
       
   305 	{
       
   306 
       
   307 	 
       
   308 	 User :: Leave(KErrArgument) ;
       
   309 	}
       
   310 	
       
   311    MLiwInterface* LogInterface = (genericparm->Value()).AsInterface();
       
   312     
       
   313     
       
   314   TBufC8<20>CmdBufSet(KCmdAdd) ;
       
   315   
       
   316   outputlist->Reset() ;
       
   317   
       
   318   inputlist->Reset() ;
       
   319   
       
   320   CLiwDefaultMap *EventDetails = CLiwDefaultMap :: NewL() ;
       
   321   
       
   322   
       
   323   
       
   324   EventDetails->InsertL(KEventTypeKey , TLiwVariant(aDetails->GetEventType()) );
       
   325   
       
   326   
       
   327  if(((unsigned int)aDetails->GetDurationType()!=0))
       
   328  	{
       
   329  	EventDetails->InsertL(KEventDurationKey ,TLiwVariant((unsigned int)aDetails->GetDurationType()) );
       
   330  	}
       
   331     
       
   332  if(aDetails->GetContactType() !=0 )
       
   333  	{
       
   334  	EventDetails->InsertL(KContactidKey , TLiwVariant(aDetails->GetContactType()) );
       
   335  	}
       
   336     
       
   337  if((unsigned int)aDetails->GetLinkType()!=0)
       
   338  	{
       
   339  	EventDetails->InsertL(KLinkKey , TLiwVariant((unsigned int)aDetails->GetLinkType()) );
       
   340  	}
       
   341     
       
   342  if(aDetails->GetTimer() !=0 )
       
   343  	{
       
   344  	EventDetails->InsertL(KEventTimeKey , TLiwVariant(aDetails->GetTimer())) ;
       
   345  	}
       
   346     
       
   347    
       
   348   TBuf<10> EmptyDes ;
       
   349    
       
   350    
       
   351    if(aDetails->GetSubjectType() != EmptyDes)
       
   352    	{
       
   353    	 EventDetails->InsertL(KSubjectKey , TLiwVariant(aDetails->GetSubjectType())) ;
       
   354    	}
       
   355     
       
   356    
       
   357    
       
   358     
       
   359  if(aDetails->GetNumberType()!= EmptyDes)
       
   360  	{
       
   361  	EventDetails->InsertL(KPhoneNumberKey , TLiwVariant(aDetails->GetNumberType())) ;
       
   362  	}
       
   363     
       
   364  if(aDetails->GetRemotePartyType() != EmptyDes)
       
   365  	{
       
   366  	EventDetails->InsertL(KRemotePartyKey , TLiwVariant(aDetails->GetRemotePartyType())) ;
       
   367  	}
       
   368     
       
   369  if(aDetails->GetDirectionType() >= 0 )
       
   370 	 {
       
   371  	EventDetails->InsertL(KDirectionKey , TLiwVariant(aDetails->GetDirectionType())) ;
       
   372  	}
       
   373     
       
   374  if(aDetails->GetDescriptionType() != EmptyDes)
       
   375  	{
       
   376  	EventDetails->InsertL(KDescriptionKey , TLiwVariant(aDetails->GetDescriptionType())) ;
       
   377  	}
       
   378     
       
   379  if(aDetails->GetStatusType() >= 0  )
       
   380  	{
       
   381  	EventDetails->InsertL(KDeliveryStatusKey , TLiwVariant(aDetails->GetStatusType())) ;
       
   382  	}
       
   383     
       
   384   
       
   385 
       
   386   TBuf16 <10> Contents(KContentType) ;
       
   387   
       
   388   inputlist->AppendL(TLiwGenericParam(KContentTypeKey , TLiwVariant(Contents))) ;
       
   389   
       
   390   inputlist->AppendL(TLiwGenericParam(KEventDetails , TLiwVariant(EventDetails))) ;
       
   391   EventDetails->DecRef();
       
   392     
       
   393   LogInterface->ExecuteCmdL(CmdBufSet , *inputlist , *outputlist ); 
       
   394  
       
   395   
       
   396   
       
   397   
       
   398    TInt index = 0 ;
       
   399    
       
   400    const TLiwGenericParam *ErrCode  = outputlist->FindFirst(index , KErrCode) ;
       
   401    
       
   402    if(!ErrCode )
       
   403     {
       
   404     
       
   405   	 User :: Leave(KErrArgument) ;
       
   406     }
       
   407     
       
   408     TInt retval  = ErrCode->Value().AsTInt32() ;
       
   409   
       
   410   if(retval != SErrNone )
       
   411   	{
       
   412   	
       
   413   	    LogInterface->Close() ;
       
   414   	   delete ServiceHandler;
       
   415   	   a.ResetAndDestroy();
       
   416    	   a.Close();
       
   417     
       
   418       
       
   419     
       
   420   	 User :: Leave(KErrArgument) ;
       
   421   	}
       
   422    
       
   423  
       
   424   
       
   425    
       
   426   index = 0 ;
       
   427   const TLiwGenericParam *genparm = outputlist->FindFirst(index , KResponse) ;
       
   428   
       
   429   if(!genparm)
       
   430     {
       
   431    
       
   432    	 User :: Leave(KErrArgument) ;
       
   433     }
       
   434     
       
   435     
       
   436      
       
   437    TBufC<20> itemid = (genparm->Value()).AsDes() ;
       
   438     
       
   439     
       
   440     
       
   441      inputlist->Reset() ; outputlist->Reset() ;
       
   442   
       
   443       //Insert the contenttype to inputlist
       
   444    CLiwDefaultMap *Idmap = CLiwDefaultMap :: NewL() ;
       
   445    Idmap->InsertL(KLogId ,TLiwVariant(itemid)) ;
       
   446    
       
   447     TBufC16<10> contentType(KContentType) ;
       
   448    //Insert the contenttype to inputlist
       
   449    inputlist->AppendL(TLiwGenericParam(KContentTypeKey , TLiwVariant(contentType))) ;
       
   450  
       
   451    
       
   452  // inputlist->AppendL(TLiwGenericParam(KLogId , TLiwVariant((TInt32)itemid))) ;
       
   453     inputlist->AppendL(TLiwGenericParam(KData , TLiwVariant(Idmap))) ; 
       
   454     Idmap->DecRef();
       
   455  // CmdBuf = KCmdDelete ;
       
   456   
       
   457   
       
   458   TBufC8<20>CmdBuf(KCmdDelete) ;
       
   459   LogInterface->ExecuteCmdL(CmdBuf , *inputlist , *outputlist) ;
       
   460   
       
   461   pos = 0 ;
       
   462   const TLiwGenericParam *Errprm = outputlist->FindFirst(pos , KErrCode ) ;
       
   463   
       
   464   if(!Errprm)
       
   465   	{
       
   466    
       
   467   	 User :: Leave(KErrArgument) ;
       
   468   	}
       
   469   	
       
   470   TInt retval1  = Errprm->Value().AsTInt32() ;
       
   471   
       
   472   if(retval1 != SErrNone )
       
   473   	{
       
   474    
       
   475   	 User :: Leave(KErrArgument) ;
       
   476   	}
       
   477     
       
   478    
       
   479   
       
   480    
       
   481   
       
   482   //deleting twice
       
   483   
       
   484     LogInterface->ExecuteCmdL(CmdBuf , *inputlist , *outputlist) ;
       
   485   
       
   486   pos = 0 ;
       
   487   const TLiwGenericParam *Errprm1 = outputlist->FindFirst(pos , KErrCode ) ;
       
   488   
       
   489   if(!Errprm1)
       
   490   	{
       
   491    
       
   492   	 User :: Leave(KErrArgument) ;
       
   493   	}
       
   494   	
       
   495   TInt retval2  = Errprm1->Value().AsTInt32() ;
       
   496   
       
   497   if(retval2 != SErrNotFound )
       
   498   	{
       
   499    
       
   500   	 User :: Leave(KErrArgument) ;
       
   501   	}
       
   502   
       
   503   
       
   504   
       
   505   
       
   506   
       
   507   
       
   508   
       
   509    
       
   510       LogInterface->Close() ;
       
   511      delete ServiceHandler;
       
   512     // delete crit;
       
   513    
       
   514    	 a.ResetAndDestroy();
       
   515    	 a.Close();
       
   516     
       
   517    
       
   518     } 
       
   519    
       
   520     
       
   521 
       
   522 
       
   523 
       
   524 TInt deletetest2L(CEventDetails *aDetails)
       
   525 {
       
   526 tcallback iCallback;
       
   527 
       
   528 CLiwServiceHandler* ServiceHandler = CLiwServiceHandler::NewL();
       
   529      // Input and output parameter list
       
   530     CLiwGenericParamList* inputlist = &(ServiceHandler->InParamListL());
       
   531     
       
   532     CLiwGenericParamList* outputlist = &(ServiceHandler->OutParamListL());
       
   533     
       
   534     CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KDsInterfaceName , KLoggingContents) ;
       
   535     
       
   536   
       
   537     
       
   538     crit->SetServiceClass(TUid::Uid(KLiwClassBase));
       
   539     
       
   540     RCriteriaArray a;
       
   541     
       
   542 	
       
   543 	a.AppendL(crit);
       
   544 
       
   545    
       
   546     
       
   547 	
       
   548 	ServiceHandler->AttachL(a) ;
       
   549 	
       
   550 	
       
   551 	ServiceHandler->ExecuteServiceCmdL(*crit, *inputlist, *outputlist);
       
   552 	 
       
   553  	
       
   554 
       
   555 	
       
   556     TInt pos = 0;
       
   557 	
       
   558  
       
   559 	const TLiwGenericParam *genericparm = outputlist->FindFirst(pos  , KDsInterfaceName);
       
   560 	
       
   561 	if(!genericparm)
       
   562 	{
       
   563 
       
   564 	 
       
   565 	 User :: Leave(KErrArgument) ;
       
   566 	}
       
   567 	
       
   568    MLiwInterface* LogInterface = (genericparm->Value()).AsInterface();
       
   569     
       
   570     
       
   571   TBufC8<20>CmdBufSet(KCmdAdd) ;
       
   572   
       
   573   outputlist->Reset() ;
       
   574   
       
   575   inputlist->Reset() ;
       
   576   
       
   577   CLiwDefaultMap *EventDetails = CLiwDefaultMap :: NewL() ;
       
   578   
       
   579   
       
   580   
       
   581   EventDetails->InsertL(KEventTypeKey , TLiwVariant(aDetails->GetEventType()) );
       
   582   
       
   583   
       
   584  if(((unsigned int)aDetails->GetDurationType()!=0))
       
   585  	{
       
   586  	EventDetails->InsertL(KEventDurationKey ,TLiwVariant((unsigned int)aDetails->GetDurationType()) );
       
   587  	}
       
   588     
       
   589  if(aDetails->GetContactType() !=0 )
       
   590  	{
       
   591  	EventDetails->InsertL(KContactidKey , TLiwVariant(aDetails->GetContactType()) );
       
   592  	}
       
   593     
       
   594  if((unsigned int)aDetails->GetLinkType()!=0)
       
   595  	{
       
   596  	EventDetails->InsertL(KLinkKey , TLiwVariant((unsigned int)aDetails->GetLinkType()) );
       
   597  	}
       
   598     
       
   599  if(aDetails->GetTimer() !=0 )
       
   600  	{
       
   601  	EventDetails->InsertL(KEventTimeKey , TLiwVariant(aDetails->GetTimer())) ;
       
   602  	}
       
   603     
       
   604    
       
   605   TBuf<10> EmptyDes ;
       
   606    
       
   607    
       
   608    if(aDetails->GetSubjectType() != EmptyDes)
       
   609    	{
       
   610    	 EventDetails->InsertL(KSubjectKey , TLiwVariant(aDetails->GetSubjectType())) ;
       
   611    	}
       
   612     
       
   613    
       
   614    
       
   615     
       
   616  if(aDetails->GetNumberType()!= EmptyDes)
       
   617  	{
       
   618  	EventDetails->InsertL(KPhoneNumberKey , TLiwVariant(aDetails->GetNumberType())) ;
       
   619  	}
       
   620     
       
   621  if(aDetails->GetRemotePartyType() != EmptyDes)
       
   622  	{
       
   623  	EventDetails->InsertL(KRemotePartyKey , TLiwVariant(aDetails->GetRemotePartyType())) ;
       
   624  	}
       
   625     
       
   626  if(aDetails->GetDirectionType() >= 0 )
       
   627 	 {
       
   628  	EventDetails->InsertL(KDirectionKey , TLiwVariant(aDetails->GetDirectionType())) ;
       
   629  	}
       
   630     
       
   631  if(aDetails->GetDescriptionType() != EmptyDes)
       
   632  	{
       
   633  	EventDetails->InsertL(KDescriptionKey , TLiwVariant(aDetails->GetDescriptionType())) ;
       
   634  	}
       
   635     
       
   636  if(aDetails->GetStatusType() >= 0  )
       
   637  	{
       
   638  	EventDetails->InsertL(KDeliveryStatusKey , TLiwVariant(aDetails->GetStatusType())) ;
       
   639  	}
       
   640     
       
   641   
       
   642 
       
   643   TBuf16 <10> Contents(KContentType) ;
       
   644   
       
   645   inputlist->AppendL(TLiwGenericParam(KContentTypeKey , TLiwVariant(Contents))) ;
       
   646   
       
   647   inputlist->AppendL(TLiwGenericParam(KEventDetails , TLiwVariant(EventDetails))) ;
       
   648   EventDetails->DecRef();
       
   649     
       
   650   LogInterface->ExecuteCmdL(CmdBufSet , *inputlist , *outputlist ); 
       
   651  
       
   652   
       
   653   
       
   654   
       
   655    TInt index = 0 ;
       
   656    
       
   657    const TLiwGenericParam *ErrCode  = outputlist->FindFirst(index , KErrCode) ;
       
   658    
       
   659    if(!ErrCode )
       
   660     {
       
   661     
       
   662   	 User :: Leave(KErrArgument) ;
       
   663     }
       
   664     
       
   665     TInt retval  = ErrCode->Value().AsTInt32() ;
       
   666   
       
   667   if(retval != SErrNone )
       
   668   	{
       
   669   	
       
   670   	    LogInterface->Close() ;
       
   671   	   delete ServiceHandler;
       
   672   	   a.ResetAndDestroy();
       
   673    	   a.Close();
       
   674     
       
   675       
       
   676     
       
   677   	 User :: Leave(KErrArgument) ;
       
   678   	}
       
   679    
       
   680  
       
   681   
       
   682    
       
   683   index = 0 ;
       
   684   const TLiwGenericParam *genparm = outputlist->FindFirst(index , KResponse) ;
       
   685   
       
   686   if(!genparm)
       
   687     {
       
   688    
       
   689    	 User :: Leave(KErrArgument) ;
       
   690     }
       
   691     
       
   692     
       
   693      
       
   694    TBufC<20> itemid = (genparm->Value()).AsDes() ;
       
   695     
       
   696     
       
   697     
       
   698      inputlist->Reset() ; outputlist->Reset() ;
       
   699   
       
   700    
       
   701    //Insert the contenttype to inputlist
       
   702    CLiwDefaultMap *Idmap = CLiwDefaultMap :: NewL() ;
       
   703    Idmap->InsertL(KLogId ,TLiwVariant(itemid)) ;
       
   704    
       
   705     TBufC16<10> contentType(KContentType) ;
       
   706    //Insert the contenttype to inputlist
       
   707    inputlist->AppendL(TLiwGenericParam(KContentTypeKey , TLiwVariant(contentType))) ;
       
   708  
       
   709    
       
   710  // inputlist->AppendL(TLiwGenericParam(KLogId , TLiwVariant((TInt32)itemid))) ;
       
   711     inputlist->AppendL(TLiwGenericParam(KData , TLiwVariant(Idmap))) ; 
       
   712     Idmap->DecRef();
       
   713  // CmdBuf = KCmdDelete ;
       
   714    
       
   715   TBufC8<20>CmdBuf(KCmdDelete) ;
       
   716  LogInterface->ExecuteCmdL(CmdBuf , *inputlist , *outputlist ,KLiwOptASyncronous, &iCallback) ;
       
   717   
       
   718   pos = 0 ;
       
   719   const TLiwGenericParam *Errprm = outputlist->FindFirst(pos , KErrCode ) ;
       
   720   
       
   721   if(!Errprm)
       
   722   	{
       
   723    
       
   724   	 User :: Leave(KErrArgument) ;
       
   725   	}
       
   726   	
       
   727   TInt retval1  = Errprm->Value().AsTInt32() ;
       
   728   
       
   729   if(retval1 != SErrNone )
       
   730   	{
       
   731    
       
   732   	 User :: Leave(KErrArgument) ;
       
   733   	}
       
   734     
       
   735    
       
   736    iCallback.Start() ;
       
   737    
       
   738       LogInterface->Close() ;
       
   739      delete ServiceHandler;
       
   740     // delete crit;
       
   741    
       
   742    	 a.ResetAndDestroy();
       
   743    	 a.Close();
       
   744     
       
   745    
       
   746     } 
       
   747    
       
   748     
       
   749 
       
   750       
       
   751  
       
   752 
       
   753 
       
   754 
       
   755 
       
   756 
       
   757 
       
   758 
       
   759 
       
   760 
       
   761 
       
   762 
       
   763 
       
   764 
       
   765 
       
   766 
       
   767 
       
   768 
       
   769 
       
   770 
       
   771 
       
   772