syncmlfw/common/syncagent/src/nsmlstatuscontainer.cpp
branchRCL_3
changeset 21 490439ac0bd4
parent 0 b497e44ab2fc
child 24 13d7c31c74e0
equal deleted inserted replaced
19:696f5dd11939 21:490439ac0bd4
    14 * Description:  Client's Status command buffering
    14 * Description:  Client's Status command buffering
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 
    19 #include <utf.h>
       
    20 #include <DevManInternalCRKeys.h>
       
    21 #include <centralrepository.h>
    20 //#include "nsmlcliagdefines.h"
    22 //#include "nsmlcliagdefines.h"
    21 #include "NSmlStatusContainer.h"
    23 #include "NSmlStatusContainer.h"
    22 #include "nsmlcliagconstants.h"
    24 #include "nsmlcliagconstants.h"
    23 #include "nsmlerror.h"
    25 #include "nsmlerror.h"
    24 #include "smlmetinfdtd.h"
    26 #include "smlmetinfdtd.h"
   200 			}
   202 			}
   201 		if ( aFixStatus)
   203 		if ( aFixStatus)
   202 			{
   204 			{
   203 			(*iStatusArray)[aEntryID-1].statusIsFixed = ETrue;
   205 			(*iStatusArray)[aEntryID-1].statusIsFixed = ETrue;
   204 			}
   206 			}
   205 		}
   207  // TargertUri Fix
       
   208 		
       
   209 	TPtrC8 cmd( (TUint8*) (*iStatusArray)[aEntryID-1].status->cmd->content, (*iStatusArray)[aEntryID-1].status->cmd->length );
       
   210 	if ( cmd == KNSmlAgentExec )
       
   211 	{ 
       
   212 		CRepository* cenrep = NULL;
       
   213   	TInt err(KErrNone);
       
   214 	  TRAP(err, cenrep = CRepository::NewL( KCRUidDeviceManagementInternalKeys ));
       
   215 	  if(err == KErrNone)
       
   216 	  {
       
   217 	  	TBuf8<256> targetPath;	
       
   218     	TInt result = cenrep->Get( KNSmlDMSCOMOTargetRef, targetPath );    	
       
   219     	if((targetPath.Length()) && (result == KErrNone))
       
   220 			{					
       
   221 				TPtrC8 sourcePath( (TUint8*) (*iStatusArray)[aEntryID-1].status->targetRefList->targetRef->content, (*iStatusArray)[aEntryID-1].status->targetRefList->targetRef->length );
       
   222 			
       
   223 				SmlSource_t* source = new( ELeave ) SmlSource_t; 
       
   224     		source->locURI = new( ELeave ) SmlPcdata_t;
       
   225 	   		source->locURI->SetDataL( sourcePath );
       
   226     		source->locURI->contentType = SML_PCDATA_OPAQUE;   
       
   227     		source->locURI->extension = SML_EXT_UNDEFINED;
       
   228     		source->locName = NULL;
       
   229     		
       
   230     		SmlTarget_t* target = new( ELeave ) SmlTarget_t; 
       
   231     		target->locURI = new( ELeave ) SmlPcdata_t;
       
   232 	   		target->locURI->SetDataL( targetPath );
       
   233     		target->locURI->contentType = SML_PCDATA_OPAQUE;   
       
   234     		target->locURI->extension = SML_EXT_UNDEFINED;
       
   235     		target->locName = NULL;
       
   236     		AddSourceRefL( aEntryID, source );
       
   237     		
       
   238     		SmlTargetRefList_t** targetRefList;
       
   239 				targetRefList = &(*iStatusArray)[aEntryID-1].status->targetRefList;
       
   240 				while( *targetRefList )
       
   241 				{
       
   242 					if ((*targetRefList)->next == NULL )
       
   243 						 break;
       
   244 					targetRefList = &(*targetRefList)->next;
       
   245 				} 
       
   246 				*targetRefList = new( ELeave ) SmlTargetRefList_t;
       
   247 				CreateTargetRefL( target, (*targetRefList)->targetRef );
       
   248     		
       
   249  				_LIT8(KNullString, "");
       
   250     		result = cenrep->Set( KNSmlDMSCOMOTargetRef, KNullString ); 
       
   251     	}
       
   252     	delete cenrep;
       
   253     	cenrep = NULL;
       
   254 		}
       
   255 	}
       
   256 	
   206 	CleanupStack::PopAndDestroy(); //statusCode
   257 	CleanupStack::PopAndDestroy(); //statusCode
       
   258 	}
   207 	}
   259 	}
   208 // ---------------------------------------------------------
   260 // ---------------------------------------------------------
   209 // CNSmlStatusContainer::SetChalL()
   261 // CNSmlStatusContainer::SetChalL()
   210 // Creates Chal element 
   262 // Creates Chal element 
   211 // ---------------------------------------------------------
   263 // ---------------------------------------------------------