//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
using namespace Tizen::Base::Collection;
using namespace Tizen::App;
-const char* _DATACONTROL_RESULTSET_DIR = "/tmp/osp/DataControlResultSet/\0";
+const char* _DATACONTROL_RESULT_DIR = "/tmp/osp/data-control/result/\0";
+const char* _DATACONTROL_RESULT_COMPAT_DIR = "/tmp/osp/DataControlResult/\0";
namespace Tizen { namespace Io
{
, __pageNo(1)
, __countPerPage(0)
, __result(E_SUCCESS)
- , __tmpPath("")
+ , __tmpPath(L"")
, __reqId(reqId)
{
}
// [sizeof(int)] size
// [ varient ] content
result
-_DataControlResultSetImpl::FillWith(IDbEnumerator* pDbEnum)
+_DataControlResultSetImpl::FillWith(IDbEnumerator* pDbEnum, String& version)
{
- String tempFilePath(_DATACONTROL_RESULTSET_DIR);
+ String tempFilePath;
String columnName;
- String appId;
+ String callerAppId;
String reqType;
String callerReqId;
String* pNo = null;
_ResultInfo* pResultInfo = pAppMgr->__resultManager.FindItem(static_cast< int >(__reqId)); // provider reqId
SysTryReturnResult(NID_IO, pResultInfo, E_OBJ_NOT_FOUND,
- "The data control request specified with the reqId (%ld) did not exist.", __reqId);
+ "The data control request specified with the req (%ld) did not exist.", __reqId);
const _AppArg& arg = pResultInfo->arg;
SysTryReturnResult(NID_IO, requestType == _DATACONTROL_REQUEST_TYPE_SQL_QUERY, E_INVALID_ARG,
"The reqId should be for the data control query request.");
- appId = arg.GetCallerAppId();
+ callerAppId = arg.GetCallerAppId();
callerReqId = arg.GetValue(OSP_K_REQUEST_ID);
// list-based request
Integer::Parse(*pCount, countPerPage);
this->SetCapacity(pageNo, countPerPage);
- tempFilePath.Append(appId);
+ if (version == L"ver_2.1.0.3")
+ {
+ tempFilePath.Append(_DATACONTROL_RESULT_DIR);
+ }
+ else
+ {
+ tempFilePath.Append(_DATACONTROL_RESULT_COMPAT_DIR);
+ }
+ tempFilePath.Append(callerAppId);
tempFilePath.Append(callerReqId);
__tmpPath = tempFilePath;
SysSecureLog(NID_IO, "[DC_PROV_SEND] temp file path: %ls", tempFilePath.GetPointer());
SysTryReturnResult(NID_IO, pFile != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
- r = pFile->Construct(__tmpPath, "w+", true);
+ r = pFile->Construct(__tmpPath, L"w+", true);
SysTryReturn(NID_IO, r == E_SUCCESS, r, r, "[%s] Failed to create temp file (%ls) for result set.",
GetErrorMessage(r), __tmpPath.GetPointer());