// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
{
if (__pBookmarkPresentationModel)
{
+ __pBookmarkPresentationModel->UnInitialize();
delete __pBookmarkPresentationModel;
__pBookmarkPresentationModel = null;
}
DateTime dt;
String bookmarkId;
String bookmarkTitle = bookmark.GetBookmarkTitle();
- bookmarkTitle.Replace(L"'", L"''");
+ bookmarkTitle.Replace(L"'", L"\'");
String bookmarkUrl = bookmark.GetUrl();
- bookmarkUrl.Replace(L"'", L"''");
+ bookmarkUrl.Replace(L"'", L"\'");
AppLog("BookmarkPresentationModel::SaveBookmark");
String bookmarkTable(BOOKMARK_URL_TABLE);
result r = E_FAILURE;
bool nextRowPresent = false;
- text.Replace(L"'", L"''");
+ text.Replace(L"'", L"\'");
query.Append(L"SELECT COUNT(ID) FROM ");
query.Append(bookmarkTable);
query.Append(" OR ");
query.Append(L"ADDRESS LIKE '%");
query.Append(text);
- query.Append("%')");
+ query.Append("%'");
+ query.Append(" ESCAPE '/')");
query.Append(" AND ADDRESS != ''");
r = BookmarkPresentationModel::ExecuteQuery(query, count);
}
searchBookmarkCount = intVal;
- CATCH: return r;
+ CATCH:
+// text.Replace(L"''", L"'");
+ return r;
+
}
String bookmarkTable(BOOKMARK_URL_TABLE);
result r = E_FAILURE;
bool nextRowPresent = false;
- text.Replace(L"'", L"''");
+ text.Replace(L"'", L"\'");
query.Append(L"SELECT COUNT(ID) FROM ");
query.Append(bookmarkTable);
query.Append(L" WHERE TITLE LIKE '%");
query.Append(text);
query.Append("%'");
+ query.Append(" ESCAPE '/'");
query.Append(" AND ADDRESS = ''");
r = BookmarkPresentationModel::ExecuteQuery(query, count);
}
searchFolderCount = intVal;
- CATCH: return r;
+ CATCH:
+// text.Replace(L"''", L"'");
+ return r;
}
String bookmarkTable(BOOKMARK_URL_TABLE);
result r = E_FAILURE;
- text.Replace(L"'", L"''");
+ text.Replace(L"'", L"\'");
query.Append(L"SELECT * FROM ");
query.Append(bookmarkTable);
- query.Append(L" WHERE (TITLE LIKE '%");
+ query.Append(L" WHERE ((TITLE LIKE '%");
query.Append(text);
- query.Append("%')");
+ query.Append("%' ESCAPE '/')");
query.Append(" OR ");
query.Append(L"(ADDRESS LIKE '%");
query.Append(text);
- query.Append("%')");
- query.Append(" AND ADDRESS != ''");
+ query.Append("%' ESCAPE '/') )");
+ query.Append(" AND (ADDRESS != '')");
//Append LIMIT
if (limit > 0)
{
query.Append(startIndex);
}
}
-
+ AppLog("Query is %ls", query.GetPointer());
r = BookmarkPresentationModel::ExecuteQuery(query, count);
TryCatch( r == E_SUCCESS,,"BookmarkPresentationModel::GetSearchBookmark query failed %s",GetErrorMessage(r));
r = CreateBookmarkList(count, pBookmarkList);
TryCatch( r == E_SUCCESS,,"BookmarkPresentationModel::CreateBookmarkList failed %s",GetErrorMessage(r));
- CATCH: return r;
+ CATCH:
+// text.Replace(L"''", L"'");
+ return r;
}
result
String query;
String bookmarkTable(BOOKMARK_URL_TABLE);
result r = E_FAILURE;
- text.Replace(L"'", L"''");
+ text.Replace(L"'", L"\'");
query.Append(L"SELECT * FROM ");
query.Append(bookmarkTable);
query.Append(text);
//query.Append("%')");
query.Append("%'");
+ query.Append(" ESCAPE '/'");
query.Append(" AND ADDRESS = ''");
//Append LIMIT
r = CreateFolderList(count, pFolderList);
TryCatch( r == E_SUCCESS,,"BookmarkPresentationModel::CreateBookmarkList failed %s",GetErrorMessage(r));
- CATCH: return r;
+ CATCH:
+// text.Replace(L"''", L"'");
+ return r;
}
result
query.Append(bookmarkTable);
query.Append(" WHERE ADDRESS = '");
query.Append(Url);
+ if(Url.EndsWith(L"/"))
+ {
+ query.Append("' OR ADDRESS = '");
+ String newUrl = L"";
+ Url.SubString(0,Url.GetLength()-1 ,newUrl);
+ query.Append(newUrl);
+ }
+ else
+ {
+ query.Append("' OR ADDRESS = '");
+ String newUrl = Url;
+// Url.SubString(0,Url.GetLength()-1 ,newUrl);
+ newUrl.Append(L"/");
+ query.Append(newUrl);
+ }
+
if(checkParentId == true)
{
query.Append(L"' AND PARENT = '");
query.Append(bookmarkTable);
query.Append(" WHERE ADDRESS = '");
query.Append(url);
+
+ if(url.EndsWith(L"/"))
+ {
+ query.Append("' OR ADDRESS = '");
+ String newUrl = L"";
+ url.SubString(0,url.GetLength()-1 ,newUrl);
+ query.Append(newUrl);
+ }
+ else
+ {
+ query.Append("' OR ADDRESS = '");
+ String newUrl = url;
+// Url.SubString(0,Url.GetLength()-1 ,newUrl);
+ newUrl.Append(L"/");
+ query.Append(newUrl);
+
+ }
+
query.Append(L"'");
r = BookmarkPresentationModel::ExecuteQuery(query, resultCount);