521 |
521 |
522 default: |
522 default: |
523 err = ELawMoUnknown; |
523 err = ELawMoUnknown; |
524 break; |
524 break; |
525 } |
525 } |
|
526 |
|
527 CRepository* crepository = NULL; |
|
528 crepository = CRepository::NewLC( KCRUidLawmoAdapter ); |
|
529 // Do the operations based on Sync or Nonsync Exec command |
526 if((identifier == ENodeWipe)||(identifier == ENodeWipeAll)) |
530 if((identifier == ENodeWipe)||(identifier == ENodeWipeAll)) |
527 { |
531 { |
528 CRepository* crep = NULL; |
|
529 TInt reterr(KErrNone); |
532 TInt reterr(KErrNone); |
530 TBuf<MAXBUFLEN> argument; |
533 TBuf<MAXBUFLEN> argument; |
531 TBuf<MAXBUFLEN> opURI; |
534 TBuf<MAXBUFLEN> opURI; |
532 argument.Copy(aArgument); |
535 argument.Copy(aArgument); |
533 opURI.Copy(aURI); |
536 opURI.Copy(aURI); |
534 crep = CRepository::NewLC( KCRUidLawmoAdapter ); |
|
535 if(argument.Length()!=0) |
537 if(argument.Length()!=0) |
536 reterr = crep->Set( KLawmoCorrelator, argument ); |
538 reterr = crepository->Set( KLawmoCorrelator, argument ); |
537 RDEBUG_2("CLawmoDMAdapter write correlator %d", reterr); |
539 RDEBUG_2("CLawmoDMAdapter write correlator %d", reterr); |
538 reterr = crep->Set( KLawmoSourceURI, opURI); |
540 reterr = crepository->Set( KLawmoSourceURI, opURI); |
539 RDEBUG_2("CLawmoDMAdapter write sourceURI %d", reterr); |
541 RDEBUG_2("CLawmoDMAdapter write sourceURI %d", reterr); |
540 CleanupStack::PopAndDestroy(crep); |
542 } |
541 } |
|
542 else |
543 else |
543 { |
544 { |
544 CRepository* crep = NULL; |
545 CRepository* crep = NULL; |
545 _LIT8(KNsmlNull,"null"); |
546 _LIT8(KNsmlNull,"null"); |
546 crep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys ); |
547 crep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys ); |
547 RDEBUG("CLawmoDMAdapter::ExecuteCommandL Sourceref Crep"); |
548 RDEBUG("CLawmoDMAdapter::ExecuteCommandL Sourceref Crep"); |
548 TInt reterr = crep->Set( KNSmlDMSCOMOTargetRef, KNsmlNull ); |
549 TInt reterr = crep->Set( KNSmlDMSCOMOTargetRef, KNsmlNull ); |
549 RDEBUG_2("CLawmoDMAdapter::cenrep set for SourceRef, %d",reterr); |
550 RDEBUG_2("CLawmoDMAdapter::cenrep set for SourceRef, %d",reterr); |
550 CleanupStack::PopAndDestroy(); |
551 CleanupStack::PopAndDestroy(); |
|
552 if(err==ELawMoSuccess) |
|
553 { |
|
554 TInt resCode; |
|
555 RDEBUG("CLawmoDMAdapter check for the synchronous result code"); |
|
556 //check the cenrep to determine which sync result code to send |
|
557 reterr = crepository->Get(KLawmoSyncRetVal, resCode); |
|
558 if(resCode==KSyncCmdStatus) |
|
559 { |
|
560 RDEBUG("CLawmoDMAdapter Lock return status 200"); |
|
561 err = ELawMoOk; |
|
562 } |
|
563 } |
551 } |
564 } |
|
565 CleanupStack::PopAndDestroy(crepository); |
552 status = MapErrorToStatus( err ); //map lawmo/syncml error codes |
566 status = MapErrorToStatus( err ); //map lawmo/syncml error codes |
553 } |
567 } |
554 else |
568 else |
555 { |
569 { |
556 RDEBUG("CLawmoDMAdapter::ExecuteCommandL() NOT factory prof"); |
570 RDEBUG("CLawmoDMAdapter::ExecuteCommandL() NOT factory prof"); |