From 92f767312639a0b4a8194bc69c0a1b2f8e8fa1ce Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Mon, 15 Apr 2013 23:15:39 +0900 Subject: [PATCH] [Release] wrt-commons_0.2.109 Change-Id: Ie4df2fa523ea3cae9ef52456b4c595bc0399ccfb --- .gitignore | 1 - build/CMakeLists.txt | 1 - build/encryption/CMakeLists.txt | 5 +- etc/wrt_commons_create_clean_db.sh | 2 +- modules/CMakeLists.txt | 1 - modules/auto_save_dao/CMakeLists.txt | 98 ---------------------- modules/auto_save_dao/dao/AutoSaveDatabase.cpp | 30 ------- modules/auto_save_dao/dao/auto_save_dao.cpp | 97 --------------------- .../auto_save_dao/dao/auto_save_dao_read_only.cpp | 86 ------------------- modules/auto_save_dao/dao/common_dao_types.cpp | 28 ------- .../auto-save-dao-ro/auto_save_dao_read_only.h | 64 -------------- .../wrt-commons/auto-save-dao-rw/auto_save_dao.h | 48 ----------- .../wrt-commons/auto-save-dao/AutoSaveDatabase.h | 57 ------------- .../wrt-commons/auto-save-dao/common_dao_types.h | 60 ------------- modules/auto_save_dao/orm/autosave_db | 13 --- modules/auto_save_dao/orm/autosave_db_definitions | 6 -- .../auto_save_dao/orm/autosave_db_sql_generator.h | 27 ------ modules/auto_save_dao/orm/gen_db_md5.sh | 19 ----- modules/auto_save_dao/orm/orm_generator_autosave.h | 24 ------ modules/auto_save_dao/orm/version_db | 5 -- modules/widget_dao/dao/widget_dao_read_only.cpp | 27 +++++- packaging/wrt-commons.spec | 10 +-- wrt-commons.manifest | 1 - 23 files changed, 31 insertions(+), 679 deletions(-) delete mode 100644 modules/auto_save_dao/CMakeLists.txt delete mode 100644 modules/auto_save_dao/dao/AutoSaveDatabase.cpp delete mode 100644 modules/auto_save_dao/dao/auto_save_dao.cpp delete mode 100644 modules/auto_save_dao/dao/auto_save_dao_read_only.cpp delete mode 100644 modules/auto_save_dao/dao/common_dao_types.cpp delete mode 100644 modules/auto_save_dao/include/wrt-commons/auto-save-dao-ro/auto_save_dao_read_only.h delete mode 100644 modules/auto_save_dao/include/wrt-commons/auto-save-dao-rw/auto_save_dao.h delete mode 100644 modules/auto_save_dao/include/wrt-commons/auto-save-dao/AutoSaveDatabase.h delete mode 100644 modules/auto_save_dao/include/wrt-commons/auto-save-dao/common_dao_types.h delete mode 100644 modules/auto_save_dao/orm/autosave_db delete mode 100644 modules/auto_save_dao/orm/autosave_db_definitions delete mode 100644 modules/auto_save_dao/orm/autosave_db_sql_generator.h delete mode 100755 modules/auto_save_dao/orm/gen_db_md5.sh delete mode 100644 modules/auto_save_dao/orm/orm_generator_autosave.h delete mode 100644 modules/auto_save_dao/orm/version_db diff --git a/.gitignore b/.gitignore index 79ad2fa..4c72b9c 100755 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,6 @@ cmake_install.cmake Makefile documentation.list -modules/auto_save_dao/database_checksum_autosave.h modules/widget_dao/database_checksum.h modules/security_origin_dao/database_checksum_security_origin.h modules/custom_handler_dao/database_checksum_custom_handler.h diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 10e05ce..d151c82 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -27,7 +27,6 @@ ADD_SUBDIRECTORY(rpc) ADD_SUBDIRECTORY(test) #ADD_SUBDIRECTORY(log) ADD_SUBDIRECTORY(widget_dao) -ADD_SUBDIRECTORY(auto_save_dao) ADD_SUBDIRECTORY(security_origin_dao) ADD_SUBDIRECTORY(custom_handler_dao) ADD_SUBDIRECTORY(utils) diff --git a/build/encryption/CMakeLists.txt b/build/encryption/CMakeLists.txt index 7949864..6e643b2 100644 --- a/build/encryption/CMakeLists.txt +++ b/build/encryption/CMakeLists.txt @@ -23,6 +23,8 @@ INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(SYS_ENCRYPTION dlog openssl + cryptsvc + dukgenerator REQUIRED ) @@ -54,9 +56,6 @@ TARGET_LINK_LIBRARIES(${TARGET_DPL_ENCRYPTION} ${TARGET_DPL_EFL} ) -TARGET_LINK_LIBRARIES(${TARGET_DPL_ENCRYPTION} "-ldukgenerator" ) -TARGET_LINK_LIBRARIES(${TARGET_DPL_ENCRYPTION} "-lcryptsvc" ) - # Target library properties SET_TARGET_PROPERTIES(${TARGET_DPL_ENCRYPTION} PROPERTIES SOVERSION ${API_VERSION} diff --git a/etc/wrt_commons_create_clean_db.sh b/etc/wrt_commons_create_clean_db.sh index f1287c2..710fb97 100755 --- a/etc/wrt_commons_create_clean_db.sh +++ b/etc/wrt_commons_create_clean_db.sh @@ -14,7 +14,7 @@ # limitations under the License. # -for name in wrt wrt_autosave wrt_custom_handler +for name in wrt wrt_custom_handler do # extract smack label before removal DB_LABEL="" diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index a057a4b..20f132c 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -28,7 +28,6 @@ include(rpc/config.cmake) include(test/config.cmake) include(log/config.cmake) ADD_SUBDIRECTORY(widget_dao) -ADD_SUBDIRECTORY(auto_save_dao) ADD_SUBDIRECTORY(security_origin_dao) ADD_SUBDIRECTORY(custom_handler_dao) ADD_SUBDIRECTORY(certificate_dao) diff --git a/modules/auto_save_dao/CMakeLists.txt b/modules/auto_save_dao/CMakeLists.txt deleted file mode 100644 index 232f836..0000000 --- a/modules/auto_save_dao/CMakeLists.txt +++ /dev/null @@ -1,98 +0,0 @@ -SET(TARGET_AUTO_SAVE_DAO_DB "Sqlite3DbAutoSave") - -ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h - COMMAND ${CMAKE_SOURCE_DIR}/modules/auto_save_dao/orm/gen_db_md5.sh - ARGS ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h - ${CMAKE_SOURCE_DIR}/modules/auto_save_dao/orm/autosave_db - DEPENDS ${CMAKE_SOURCE_DIR}/modules/auto_save_dao/orm/autosave_db - ${CMAKE_SOURCE_DIR}/modules/auto_save_dao/orm/gen_db_md5.sh - COMMENT "Generating WRT auto save database checksum" - ) - -ADD_CUSTOM_COMMAND( OUTPUT .wrt_autosave.db - COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/.wrt_autosave.db - COMMAND gcc -Wall -include ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h -I${PROJECT_SOURCE_DIR}/modules/db/include -I${PROJECT_SOURCE_DIR}/modules/auto_save_dao/orm -E ${PROJECT_SOURCE_DIR}/modules/auto_save_dao/orm/autosave_db_sql_generator.h | grep --invert-match "^#" > ${CMAKE_CURRENT_BINARY_DIR}/wrt_autosave_db.sql - COMMAND sqlite3 ${CMAKE_CURRENT_BINARY_DIR}/.wrt_autosave.db ".read ${CMAKE_CURRENT_BINARY_DIR}/wrt_autosave_db.sql" || rm -f ${CMAKE_CURRENT_BINARY_DIR}/.wrt_autosave.db - DEPENDS ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h ${PROJECT_SOURCE_DIR}/modules/auto_save_dao/orm/autosave_db_sql_generator.h ${PROJECT_SOURCE_DIR}/modules/auto_save_dao/orm/autosave_db - ) - -ADD_CUSTOM_COMMAND( OUTPUT .wrt_autosave.db-journal - COMMAND touch - ARGS ${CMAKE_CURRENT_BINARY_DIR}/.wrt_autosave.db-journal - ) - -ADD_CUSTOM_TARGET(${TARGET_AUTO_SAVE_DAO_DB} ALL DEPENDS .wrt_autosave.db .wrt_autosave.db-journal) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wrt_autosave_db.sql DESTINATION share/wrt-engine/) - -############################################################################### - -INCLUDE(FindPkgConfig) - -PKG_CHECK_MODULES(AUTO_SAVE_DAO_DEPS - glib-2.0 - REQUIRED) - -SET(AUTO_SAVE_DAO_INCLUDE_DIRS - ${PROJECT_SOURCE_DIR}/modules/auto_save_dao/include - ${PROJECT_SOURCE_DIR}/modules/auto_save_dao/orm - ${PROJECT_SOURCE_DIR}/modules/core/include - ${PROJECT_SOURCE_DIR}/modules/db/include - ${PROJECT_SOURCE_DIR}/modules/log/include -) - - -SET(AUTO_SAVE_DAO_SOURCES - dao/common_dao_types.cpp - dao/AutoSaveDatabase.cpp -) - -SET(AUTO_SAVE_DAO_RO_SOURCES - dao/auto_save_dao_read_only.cpp -) - -SET(AUTO_SAVE_DAO_RW_SOURCES - dao/auto_save_dao.cpp -) - - -INCLUDE_DIRECTORIES(${AUTO_SAVE_DAO_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES(SYSTEM ${AUTO_SAVE_DAO_DEPS_INCLUDE_DIRS}) - -ADD_LIBRARY(${TARGET_AUTO_SAVE_DAO_LIB} SHARED ${AUTO_SAVE_DAO_SOURCES}) -SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_LIB} PROPERTIES SOVERSION ${API_VERSION} VERSION ${VERSION}) -SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_LIB} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h") -TARGET_LINK_LIBRARIES(${TARGET_AUTO_SAVE_DAO_LIB} ${TARGET_DPL_EFL} ${TARGET_DPL_DB_EFL} ${AUTO_SAVE_DAO_DEPS_LIBRARIES}) -ADD_DEPENDENCIES(${TARGET_AUTO_SAVE_DAO_LIB} ${TARGET_AUTO_SAVE_DAO_DB}) - -ADD_LIBRARY(${TARGET_AUTO_SAVE_DAO_RO_LIB} SHARED ${AUTO_SAVE_DAO_RO_SOURCES}) -SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_RO_LIB} PROPERTIES SOVERSION ${API_VERSION} VERSION ${VERSION}) -SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_RO_LIB} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h") -TARGET_LINK_LIBRARIES(${TARGET_AUTO_SAVE_DAO_RO_LIB} ${TARGET_AUTO_SAVE_DAO_LIB}) -ADD_DEPENDENCIES(${TARGET_AUTO_SAVE_DAO_RO_LIB} ${TARGET_AUTO_SAVE_DAO_DB}) - -ADD_LIBRARY(${TARGET_AUTO_SAVE_DAO_RW_LIB} SHARED ${AUTO_SAVE_DAO_RW_SOURCES}) -SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_RW_LIB} PROPERTIES SOVERSION ${API_VERSION} VERSION ${VERSION}) -SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_RW_LIB} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h") -TARGET_LINK_LIBRARIES(${TARGET_AUTO_SAVE_DAO_RW_LIB} ${TARGET_AUTO_SAVE_DAO_RO_LIB}) -ADD_DEPENDENCIES(${TARGET_AUTO_SAVE_DAO_RW_LIB} ${TARGET_AUTO_SAVE_DAO_DB}) - -INSTALL(TARGETS ${TARGET_AUTO_SAVE_DAO_LIB} DESTINATION lib) -INSTALL(TARGETS ${TARGET_AUTO_SAVE_DAO_RO_LIB} DESTINATION lib) -INSTALL(TARGETS ${TARGET_AUTO_SAVE_DAO_RW_LIB} DESTINATION lib) - -INSTALL(FILES - include/wrt-commons/auto-save-dao/common_dao_types.h - include/wrt-commons/auto-save-dao/AutoSaveDatabase.h - DESTINATION include/dpl-efl/wrt-commons/auto-save-dao -) - -INSTALL(FILES - include/wrt-commons/auto-save-dao-ro/auto_save_dao_read_only.h - DESTINATION include/dpl-efl/wrt-commons/auto-save-dao-ro -) - -INSTALL(FILES - include/wrt-commons/auto-save-dao-rw/auto_save_dao.h - DESTINATION include/dpl-efl/wrt-commons/auto-save-dao-rw -) diff --git a/modules/auto_save_dao/dao/AutoSaveDatabase.cpp b/modules/auto_save_dao/dao/AutoSaveDatabase.cpp deleted file mode 100644 index 5b21316..0000000 --- a/modules/auto_save_dao/dao/AutoSaveDatabase.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include -#include - -using namespace AutoSaveDB; - -namespace { -const char* AUTOSAVE_DB_DATABASE = "/opt/dbspace/.wrt_autosave.db"; -DPL::DB::SqlConnection::Flag::Type AUTOSAVE_DB_FLAGS = - DPL::DB::SqlConnection::Flag::UseLucene; -} - -DPL::Mutex g_autoSaveDbQueriesMutex; -DPL::DB::ThreadDatabaseSupport Interface::m_autoSavedbInterface( - AUTOSAVE_DB_DATABASE, AUTOSAVE_DB_FLAGS); - diff --git a/modules/auto_save_dao/dao/auto_save_dao.cpp b/modules/auto_save_dao/dao/auto_save_dao.cpp deleted file mode 100644 index 8c9ecf5..0000000 --- a/modules/auto_save_dao/dao/auto_save_dao.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * @file auto_save_dao.cpp - * @author Jihoon Chung (jihoon.chung@samsung.com) - * @version 1.0 - * @brief This file contains the definition of auto save dao class. - */ -#include -#include -#include -#include -#include - -using namespace DPL::DB::ORM; -using namespace DPL::DB::ORM::autosave; -using namespace AutoSaveDB::Interface; - -namespace AutoSaveDB { -#define SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN Try - -#define SQL_CONNECTION_EXCEPTION_HANDLER_END(message) \ - Catch(DPL::DB::SqlConnection::Exception::Base) { \ - LogError(message); \ - ReThrowMsg(AutoSaveDAO::Exception::DatabaseError, \ - message); \ - } - -AutoSaveDAO::AutoSaveDAO() : - AutoSaveDAOReadOnly() -{} - -AutoSaveDAO::~AutoSaveDAO() -{} - -void AutoSaveDAO::attachDatabaseRW(void) -{ - m_autoSavedbInterface.AttachToThread( - DPL::DB::SqlConnection::Flag::RW); -} - -void AutoSaveDAO::detachDatabase(void) -{ - m_autoSavedbInterface.DetachFromThread(); -} - -void AutoSaveDAO::setAutoSaveSubmitFormData( - const DPL::String &url, - const SubmitFormData & - submitFormData) -{ - SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN - { - ScopedTransaction transaction(&m_autoSavedbInterface); - - SubmitFormData submitData = getAutoSaveSubmitFormData(url); - if (!submitData.empty()) { - AUTOSAVE_DB_DELETE(del, - AutoSaveSubmitFormElement, - &m_autoSavedbInterface) - del->Where(Equals(url)); - del->Execute(); - } - - FOREACH(pSubmitFormData, submitFormData) { - AutoSaveSubmitFormElement::Row row; - row.Set_address(url); - row.Set_key(pSubmitFormData->key); - row.Set_value(pSubmitFormData->value); - - AUTOSAVE_DB_INSERT( - insert, AutoSaveSubmitFormElement, &m_autoSavedbInterface); - insert->Values(row); - insert->Execute(); - } - - transaction.Commit(); - } - SQL_CONNECTION_EXCEPTION_HANDLER_END( - "Fail to register id, passwd for autosave") -} -#undef SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN -#undef SQL_CONNECTION_EXCEPTION_HANDLER_END -} // namespace AutoSaveDB diff --git a/modules/auto_save_dao/dao/auto_save_dao_read_only.cpp b/modules/auto_save_dao/dao/auto_save_dao_read_only.cpp deleted file mode 100644 index 0089e19..0000000 --- a/modules/auto_save_dao/dao/auto_save_dao_read_only.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This file contains the declaration of auto save dao class. - * - * @file auto_save_dao_read_only.cpp - * @author Jihoon Chung (jihoon.chung@samsung.com) - * @version 1.0 - * @brief This file contains the declaration of auto save dao - */ -#include -#include -#include -#include -#include - -using namespace DPL::DB::ORM; -using namespace DPL::DB::ORM::autosave; -using namespace AutoSaveDB::Interface; - -namespace AutoSaveDB { -#define SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN Try - -#define SQL_CONNECTION_EXCEPTION_HANDLER_END(message) \ - Catch(DPL::DB::SqlConnection::Exception::Base) { \ - LogError(message); \ - ReThrowMsg(AutoSaveDAOReadOnly::Exception::DatabaseError, \ - message); \ - } - -AutoSaveDAOReadOnly::AutoSaveDAOReadOnly() -{} - -AutoSaveDAOReadOnly::~AutoSaveDAOReadOnly() -{} - -void AutoSaveDAOReadOnly::attachDatabaseRO(void) -{ - m_autoSavedbInterface.AttachToThread( - DPL::DB::SqlConnection::Flag::RO); -} - -void AutoSaveDAOReadOnly::detachDatabase(void) -{ - m_autoSavedbInterface.DetachFromThread(); -} - -SubmitFormData AutoSaveDAOReadOnly::getAutoSaveSubmitFormData( - const DPL::String &url) -{ - SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN - { - AUTOSAVE_DB_SELECT(select, - AutoSaveSubmitFormElement, - &m_autoSavedbInterface); - select->Where(Equals(url)); - AutoSaveSubmitFormElement::Select::RowList rows = select->GetRowList(); - - SubmitFormData submitFormData; - FOREACH(it, rows) { - SubmitFormElement element; - element.key = it->Get_key(); - element.value = it->Get_value(); - submitFormData.push_back(element); - } - return submitFormData; - } - SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get autosave data string") -} - -#undef SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN -#undef SQL_CONNECTION_EXCEPTION_HANDLER_END -} // namespace AutoSaveDB diff --git a/modules/auto_save_dao/dao/common_dao_types.cpp b/modules/auto_save_dao/dao/common_dao_types.cpp deleted file mode 100644 index 5dec0e7..0000000 --- a/modules/auto_save_dao/dao/common_dao_types.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * @file common_dao_types.cpp - * @author Jihoon Chung (jihoon.chung@samsung.com) - * @version 1.0 - * @brief This file contains the implementation of - * common data types for autoSavedb - */ -#include -#include -#include - -namespace AutoSaveDB {} // namespace AutoSaveDB diff --git a/modules/auto_save_dao/include/wrt-commons/auto-save-dao-ro/auto_save_dao_read_only.h b/modules/auto_save_dao/include/wrt-commons/auto-save-dao-ro/auto_save_dao_read_only.h deleted file mode 100644 index 7c1c449..0000000 --- a/modules/auto_save_dao/include/wrt-commons/auto-save-dao-ro/auto_save_dao_read_only.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This file contains the declaration of auto save dao class. - * - * @file auto_save_dao_read_only.h - * @author Jihoon Chung (jihoon.chung@samsung.com) - * @version 1.0 - * @brief This file contains the declaration of auto save dao - */ - -#ifndef _AUTO_SAVE_DAO_READ_ONLY_H_ -#define _AUTO_SAVE_DAO_READ_ONLY_H_ - -#include -#include -#include -#include - -namespace AutoSaveDB { -class AutoSaveDAOReadOnly -{ - public: - /** - * AutoSaveDAOReadOnly Exception classes - */ - class Exception - { - public: - DECLARE_EXCEPTION_TYPE(DPL::Exception, Base) - DECLARE_EXCEPTION_TYPE(Base, DatabaseError) - }; - - public: - - AutoSaveDAOReadOnly(); - virtual ~AutoSaveDAOReadOnly(); - - static void attachDatabaseRO(void); - static void detachDatabase(void); - - /** - * This method gets Autofill for Webkit - */ - static SubmitFormData getAutoSaveSubmitFormData( - const DPL::String &url); -}; -} // namespace AutoSaveDB - -#endif // _AUTO_SAVE_DAO_READ_ONLY_H_ - diff --git a/modules/auto_save_dao/include/wrt-commons/auto-save-dao-rw/auto_save_dao.h b/modules/auto_save_dao/include/wrt-commons/auto-save-dao-rw/auto_save_dao.h deleted file mode 100644 index d0bd940..0000000 --- a/modules/auto_save_dao/include/wrt-commons/auto-save-dao-rw/auto_save_dao.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * This file contains the declaration of auto save dao class. - * - * @file auto_save_dao.h - * @author Jihoon Chung (jihoon.chung@samsung.com) - * @version 1.0 - * @brief This file contains the declaration of auto save dao - */ -#ifndef _AUTO_SAVE_DAO_H_ -#define _AUTO_SAVE_DAO_H_ - -#include - -namespace AutoSaveDB { -class AutoSaveDAO : public AutoSaveDAOReadOnly -{ - public: - - AutoSaveDAO(); - virtual ~AutoSaveDAO(); - - static void attachDatabaseRW(void); - static void detachDatabase(void); - - /** - * This method sets Autofill for Webkit - */ - static void setAutoSaveSubmitFormData( - const DPL::String& url, const SubmitFormData &submitFormData); -}; -} // namespace AutoSaveDB - -#endif // _AUTO_SAVE_DAO_H_ diff --git a/modules/auto_save_dao/include/wrt-commons/auto-save-dao/AutoSaveDatabase.h b/modules/auto_save_dao/include/wrt-commons/auto-save-dao/AutoSaveDatabase.h deleted file mode 100644 index 3d7bcd2..0000000 --- a/modules/auto_save_dao/include/wrt-commons/auto-save-dao/AutoSaveDatabase.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _AUTOSAVEDATABASE_H_ -#define _AUTOSAVEDATABASE_H_ - -#include -#include -#include - -extern DPL::Mutex g_autoSaveDbQueriesMutex; - -#define AUTOSAVE_DB_INTERNAL(tlsCommand, InternalType, interface) \ - static DPL::ThreadLocalVariable *tlsCommand##Ptr = NULL; \ - { \ - DPL::Mutex::ScopedLock lock(&g_autoSaveDbQueriesMutex); \ - if (!tlsCommand##Ptr) { \ - static DPL::ThreadLocalVariable tmp; \ - tlsCommand##Ptr = &tmp; \ - } \ - } \ - DPL::ThreadLocalVariable &tlsCommand = *tlsCommand##Ptr; \ - if (tlsCommand.IsNull()) { tlsCommand = InternalType(interface); } - -#define AUTOSAVE_DB_SELECT(name, type, interface) \ - AUTOSAVE_DB_INTERNAL(name, type::Select, interface) - -#define AUTOSAVE_DB_INSERT(name, type, interface) \ - AUTOSAVE_DB_INTERNAL(name, type::Insert, interface) - -#define AUTOSAVE_DB_UPDATE(name, type, interface) \ - AUTOSAVE_DB_INTERNAL(name, type::Update, interface) - -#define AUTOSAVE_DB_DELETE(name, type, interface) \ - AUTOSAVE_DB_INTERNAL(name, type::Delete, interface) - -namespace AutoSaveDB { -namespace Interface { -extern DPL::DB::ThreadDatabaseSupport m_autoSavedbInterface; -} // namespace Interface -} // namespace AutoSaveDB - -#endif /* _AUTOSAVEDATABASE_H_ */ - diff --git a/modules/auto_save_dao/include/wrt-commons/auto-save-dao/common_dao_types.h b/modules/auto_save_dao/include/wrt-commons/auto-save-dao/common_dao_types.h deleted file mode 100644 index f0c22b6..0000000 --- a/modules/auto_save_dao/include/wrt-commons/auto-save-dao/common_dao_types.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * @file common_dao_types.h - * @author Jihoon Chung (jihoon.chung@samsung.com) - * @version 1.0 - * @brief This file contains the declaration of - * common data types for auto save database. - */ -#ifndef SHARE_COMMON_DAO_TYPES_H_ -#define SHARE_COMMON_DAO_TYPES_H_ - -#include -#include - -namespace AutoSaveDB { -struct SubmitFormElement -{ - DPL::String key; - DPL::String value; - - SubmitFormElement() - {} - - SubmitFormElement( - const DPL::String& keyData, - const DPL::String& valueData) : - key(keyData), - value(valueData) - {} - - bool operator== (const SubmitFormElement& other) const - { - return (!DPL::StringCompare(key, other.key) && - !DPL::StringCompare(value, other.value)); - } - - bool operator!= (const SubmitFormElement& other) const - { - return !(*this == other); - } -}; -typedef std::list SubmitFormData; -} // namespace AutoSaveDB - -#endif /* SHARE_COMMON_DAO_TYPES_H_ */ diff --git a/modules/auto_save_dao/orm/autosave_db b/modules/auto_save_dao/orm/autosave_db deleted file mode 100644 index 5f79edf..0000000 --- a/modules/auto_save_dao/orm/autosave_db +++ /dev/null @@ -1,13 +0,0 @@ -SQL( - BEGIN TRANSACTION; -) - -CREATE_TABLE(AutoSaveSubmitFormElement) - COLUMN_NOT_NULL(address, VARCHAR(256),) - COLUMN_NOT_NULL(key, TEXT,) - COLUMN_NOT_NULL(value, TEXT,) -CREATE_TABLE_END() - -SQL( - COMMIT; -) diff --git a/modules/auto_save_dao/orm/autosave_db_definitions b/modules/auto_save_dao/orm/autosave_db_definitions deleted file mode 100644 index 5674d7b..0000000 --- a/modules/auto_save_dao/orm/autosave_db_definitions +++ /dev/null @@ -1,6 +0,0 @@ -DATABASE_START(autosave) - -#include "autosave_db" -#include "version_db" - -DATABASE_END() diff --git a/modules/auto_save_dao/orm/autosave_db_sql_generator.h b/modules/auto_save_dao/orm/autosave_db_sql_generator.h deleted file mode 100644 index e6720a0..0000000 --- a/modules/auto_save_dao/orm/autosave_db_sql_generator.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * @file autosave_db_sql_generator.h - * @author Jihoon Chung (jihoon.chung@samsung.com) - * @version 1.0 - * @brief Macro definitions for generating the SQL - * input file from database definition. - */ - -//Do not include this file directly! It is used only for SQL code generation. -#include - -#include "autosave_db_definitions" diff --git a/modules/auto_save_dao/orm/gen_db_md5.sh b/modules/auto_save_dao/orm/gen_db_md5.sh deleted file mode 100755 index 38587b7..0000000 --- a/modules/auto_save_dao/orm/gen_db_md5.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -CHECKSUM=`cat ${2} ${3} 2>/dev/null | md5sum 2>/dev/null | cut -d\ -f1 2>/dev/null` -echo "#define DB_CHECKSUM DB_VERSION_${CHECKSUM}" > ${1} -echo "#define DB_CHECKSUM_STR \"DB_VERSION_${CHECKSUM}\"" >> ${1} - diff --git a/modules/auto_save_dao/orm/orm_generator_autosave.h b/modules/auto_save_dao/orm/orm_generator_autosave.h deleted file mode 100644 index 57765cd..0000000 --- a/modules/auto_save_dao/orm/orm_generator_autosave.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _ORM_GENERATOR_AUTOSAVE_H_ -#define _ORM_GENERATOR_AUTOSAVE_H_ - -#define ORM_GENERATOR_DATABASE_NAME autosave_db_definitions -#include -#undef ORM_GENERATOR_DATABASE_NAME - -#endif // _ORM_GENERATOR_AUTOSAVE_H_ diff --git a/modules/auto_save_dao/orm/version_db b/modules/auto_save_dao/orm/version_db deleted file mode 100644 index 7e20d8d..0000000 --- a/modules/auto_save_dao/orm/version_db +++ /dev/null @@ -1,5 +0,0 @@ -SQL( - BEGIN TRANSACTION; - CREATE TABLE DB_CHECKSUM (version INT); - COMMIT; -) diff --git a/modules/widget_dao/dao/widget_dao_read_only.cpp b/modules/widget_dao/dao/widget_dao_read_only.cpp index 960a322..2afc1b9 100755 --- a/modules/widget_dao/dao/widget_dao_read_only.cpp +++ b/modules/widget_dao/dao/widget_dao_read_only.cpp @@ -155,6 +155,27 @@ TizenAppId getTizenAppIdByPkgId(const TizenPkgId tzPkgid) } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle") } + +WidgetPkgName getTizenPkgIdByHandle(const DbWidgetHandle handle) +{ + LogDebug("Getting TizenPkgId by DbWidgetHandle: " << handle); + + SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN + { + WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) + select->Where(Equals(handle)); + WidgetInfo::Select::RowList rowList = select->GetRowList(); + + if (rowList.empty()) { + ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist, + "Failed to get widget by handle"); + } + WidgetPkgName tzPkgid = rowList.front().Get_tizen_pkgid(); + + return tzPkgid; + } + SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle") +} } // namespace IWacSecurity::~IWacSecurity() @@ -220,17 +241,17 @@ DbWidgetHandle WidgetDAOReadOnly::getHandle(const DPL::String tzAppId) WidgetPkgName WidgetDAOReadOnly::getPkgName() const { - return getTzAppId(); + return getTizenPkgIdByHandle(m_widgetHandle); } WidgetPkgName WidgetDAOReadOnly::getPkgName(const WidgetGUID GUID) { - return getTzAppId(GUID); + return getTizenPkgIdByHandle(getHandle(GUID)); } WidgetPkgName WidgetDAOReadOnly::getPkgName(const DbWidgetHandle handle) { - return getTzAppId(handle); + return getTizenPkgIdByHandle(handle); } TizenAppId WidgetDAOReadOnly::getTzAppId() const diff --git a/packaging/wrt-commons.spec b/packaging/wrt-commons.spec index 740ac73..8ffb518 100644 --- a/packaging/wrt-commons.spec +++ b/packaging/wrt-commons.spec @@ -1,7 +1,7 @@ -#git:framework/web/wrt-commons wrt-commons 0.2.108 +#git:framework/web/wrt-commons wrt-commons 0.2.109 Name: wrt-commons Summary: Wrt common library -Version: 0.2.108 +Version: 0.2.109 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 @@ -23,8 +23,8 @@ BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(libiri) BuildRequires: pkgconfig(libidn) -BuildRequires: libcryptsvc-devel -BuildRequires: dukgenerator-devel +BuildRequires: pkgconfig(cryptsvc) +BuildRequires: pkgconfig(dukgenerator) Requires: libcryptsvc %description @@ -123,8 +123,6 @@ fi # Set Smack label for db files chsmack -a 'wrt-commons::db_wrt' /opt/dbspace/.wrt.db chsmack -a 'wrt-commons::db_wrt' /opt/dbspace/.wrt.db-journal -chsmack -a 'wrt-commons::db_wrt_autosave' /opt/dbspace/.wrt_autosave.db -chsmack -a 'wrt-commons::db_wrt_autosave' /opt/dbspace/.wrt_autosave.db-journal chsmack -a 'wrt-commons::db_wrt_custom_handler' /opt/dbspace/.wrt_custom_handler.db chsmack -a 'wrt-commons::db_wrt_custom_handler' /opt/dbspace/.wrt_custom_handler.db-journal diff --git a/wrt-commons.manifest b/wrt-commons.manifest index fb4bfc3..9b907d3 100644 --- a/wrt-commons.manifest +++ b/wrt-commons.manifest @@ -3,7 +3,6 @@ -- 2.7.4