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
SET(TARGET_AUTO_SAVE_DAO_LIB "wrt-commons-auto-save-dao")
SET(TARGET_AUTO_SAVE_DAO_RW_LIB "wrt-commons-auto-save-dao-rw")
SET(TARGET_AUTO_SAVE_DAO_RO_LIB "wrt-commons-auto-save-dao-ro")
+SET(TARGET_CUSTOM_HANDLER_DAO_RW_LIB "wrt-commons-custom-handler-dao-rw")
+SET(TARGET_CUSTOM_HANDLER_DAO_RO_LIB "wrt-commons-custom-handler-dao-ro")
SET(TARGET_SECURITY_ORIGIN_DAO_LIB "wrt-commons-security-origin-dao")
SET(TARGET_DPL_UTILS_EFL "lib${PROJECT_NAME}-utils-efl")
SET(TARGET_DPL_ENCRYPTION "lib${PROJECT_NAME}-encryption")
ADD_SUBDIRECTORY(widget_dao)
ADD_SUBDIRECTORY(auto_save_dao)
ADD_SUBDIRECTORY(security_origin_dao)
+ADD_SUBDIRECTORY(custom_handler_dao)
ADD_SUBDIRECTORY(popup)
ADD_SUBDIRECTORY(utils)
ADD_SUBDIRECTORY(support)
--- /dev/null
+# Copyright (c) 2012 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 CMakeLists.txt
+# @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+# @brief
+#
+
+configure_and_install_pkg(wrt-commons-custom-handler-dao-ro.pc)
+configure_and_install_pkg(wrt-commons-custom-handler-dao-rw.pc)
--- /dev/null
+prefix=/usr
+exec_prefix=${prefix}
+
+libdir=${prefix}/lib
+includedir=${prefix}/include
+Name: wrt-commons-custom-handler-dao-ro
+Description: wrt-commons-custom-handler-dao-ro
+
+Version: @VERSION@
+Requires: dpl-efl
+Libs: -lwrt-commons-custom-handler-dao-ro -L${libdir}
+Cflags: -I${includedir}/dpl-efl
--- /dev/null
+prefix=/usr
+exec_prefix=${prefix}
+
+libdir=${prefix}/lib
+includedir=${prefix}/include
+Name: wrt-commons-custom-handler-dao-rw
+Description: wrt-commons-custom-handler-dao-rw
+
+Version: @VERSION@
+Requires: dpl-efl wrt-commons-custom-handler-dao-ro
+Libs: -lwrt-commons-custom-handler-dao-rw -lwrt-commons-custom-handler-dao-ro -L${libdir}
+Cflags: -I${includedir}/dpl-efl
WRT_NEW_DB_VERSION=`cat /usr/share/wrt-engine/wrt_db.sql | tr '[:blank:]' '\n' | grep DB_VERSION_`
AUTOSAVE_OLD_DB_VERSION=`sqlite3 /opt/dbspace/.wrt_autosave.db ".tables" | grep "DB_VERSION_"`
AUTOSAVE_NEW_DB_VERSION=`cat /usr/share/wrt-engine/wrt_autosave_db.sql | tr '[:blank:]' '\n' | grep DB_VERSION_`
+ CUSTOM_HANDLER_OLD_DB_VERSION=`sqlite3 /opt/dbspace/.wrt_custom_handler.db ".tables" | grep "DB_VERSION_"`
+ CUSTOM_HANDLER_NEW_DB_VERSION=`cat /usr/share/wrt-engine/wrt_custom_handler_db.sql | tr '[:blank:]' '\n' | grep DB_VERSION_`
echo "OLD wrt database version ${WRT_OLD_DB_VERSION}"
echo "NEW wrt database version ${WRT_NEW_DB_VERSION}"
echo "OLD wrt_autosave database version ${AUTOSAVE_OLD_DB_VERSION}"
echo "NEW wrt_autosave database version ${AUTOSAVE_NEW_DB_VERSION}"
+ echo "OLD wrt_custom_handler database version ${CUSTOM_HANDLER_OLD_DB_VERSION}"
+ echo "NEW wrt_custom_handler database version ${CUSTOM_HANDLER_NEW_DB_VERSION}"
- if [ ${WRT_OLD_DB_VERSION} -a ${WRT_NEW_DB_VERSION} -a ${AUTOSAVE_OLD_DB_VERSION} -a ${AUTOSAVE_NEW_DB_VERSION} ]
+ if [ ${WRT_OLD_DB_VERSION} -a ${WRT_NEW_DB_VERSION} -a ${AUTOSAVE_OLD_DB_VERSION} -a ${AUTOSAVE_NEW_DB_VERSION} -a ${CUSTOM_HANDLER_OLD_DB_VERSION} -a ${CUSTOM_HANDLER_NEW_DB_VERSION}]
then
- if [ ${WRT_NEW_DB_VERSION} = ${WRT_OLD_DB_VERSION} -a ${AUTOSAVE_NEW_DB_VERSION} = ${AUTOSAVE_OLD_DB_VERSION} ]
+ if [ ${WRT_NEW_DB_VERSION} = ${WRT_OLD_DB_VERSION} -a ${AUTOSAVE_NEW_DB_VERSION} = ${AUTOSAVE_OLD_DB_VERSION} -a ${CUSTOM_HANDLER_NEW_DB_VERSION} = ${CUSTOM_HANDLER_OLD_DB_VERSION}]
then
echo "Equal database detected so db installation ignored"
else
# limitations under the License.
#
-for name in wrt wrt_autosave
+for name in wrt wrt_autosave wrt_custom_handler
do
rm -f /opt/dbspace/.$name.db
rm -f /opt/dbspace/.$name.db-journal
ADD_SUBDIRECTORY(widget_dao)
ADD_SUBDIRECTORY(auto_save_dao)
ADD_SUBDIRECTORY(security_origin_dao)
+ADD_SUBDIRECTORY(custom_handler_dao)
include(popup/config.cmake)
include(utils/config.cmake)
include(localization/config.cmake)
--- /dev/null
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_BINARY_DIR}/modules/custom_handler_dao/database_checksum_custom_handler.h
+ COMMAND ${CMAKE_SOURCE_DIR}/modules/custom_handler_dao/orm/gen_db_md5.sh
+ ARGS ${CMAKE_BINARY_DIR}/modules/custom_handler_dao/database_checksum_custom_handler.h
+ ${CMAKE_SOURCE_DIR}/modules/custom_handler_dao/orm/custom_handler_db
+ DEPENDS ${CMAKE_SOURCE_DIR}/modules/custom_handler_dao/orm/custom_handler_db
+ ${CMAKE_SOURCE_DIR}/modules/custom_handler_dao/orm/gen_db_md5.sh
+ COMMENT "Generating WRT custom handlers database checksum"
+ )
+
+ADD_CUSTOM_COMMAND( OUTPUT .wrt_custom_handler.db
+ COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/.wrt_custom_handler.db
+ COMMAND gcc -Wall -include ${CMAKE_BINARY_DIR}/modules/custom_handler_dao/database_checksum_custom_handler.h -I${PROJECT_SOURCE_DIR}/modules/db/include -I${PROJECT_SOURCE_DIR}/modules/custom_handler_dao/orm -E ${PROJECT_SOURCE_DIR}/modules/custom_handler_dao/orm/custom_handler_db_sql_generator.h | grep --invert-match "^#" > ${CMAKE_CURRENT_BINARY_DIR}/wrt_custom_handler_db.sql
+ COMMAND sqlite3 ${CMAKE_CURRENT_BINARY_DIR}/.wrt_custom_handler.db ".read ${CMAKE_CURRENT_BINARY_DIR}/wrt_custom_handler_db.sql" || rm -f ${CMAKE_CURRENT_BINARY_DIR}/.wrt_custom_handler.db
+ DEPENDS ${CMAKE_BINARY_DIR}/modules/custom_handler_dao/database_checksum_custom_handler.h ${PROJECT_SOURCE_DIR}/modules/custom_handler_dao/orm/custom_handler_db_sql_generator.h ${PROJECT_SOURCE_DIR}/modules/custom_handler_dao/orm/custom_handler_db
+ )
+
+ADD_CUSTOM_COMMAND( OUTPUT .wrt_custom_handler.db-journal
+ COMMAND touch
+ ARGS ${CMAKE_CURRENT_BINARY_DIR}/.wrt_custom_handler.db-journal
+ )
+
+ADD_CUSTOM_TARGET(Sqlite3DbCustomHandler ALL DEPENDS .wrt_custom_handler.db .wrt_custom_handler.db-journal)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wrt_custom_handler_db.sql DESTINATION share/wrt-engine/)
+
+###############################################################################
+
+INCLUDE(FindPkgConfig)
+
+PKG_CHECK_MODULES(CUSTOM_HANDLER_DAO_DEPS
+ glib-2.0
+ REQUIRED)
+
+SET(CUSTOM_HANDLER_DAO_INCLUDE_DIRS
+ ${PROJECT_SOURCE_DIR}/modules/custom_handler_dao/include
+ ${PROJECT_SOURCE_DIR}/modules/custom_handler_dao/orm
+ ${PROJECT_SOURCE_DIR}/modules/core/include
+ ${PROJECT_SOURCE_DIR}/modules/db/include
+ ${PROJECT_SOURCE_DIR}/modules/log/include
+)
+
+
+SET(CUSTOM_HANDLER_DAO_RO_SOURCES
+ dao/CustomHandlerDatabase.cpp
+ dao/custom_handler_dao_read_only.cpp
+)
+
+SET(CUSTOM_HANDLER_DAO_RW_SOURCES
+ dao/custom_handler_dao.cpp
+)
+
+
+INCLUDE_DIRECTORIES(${CUSTOM_HANDLER_DAO_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(SYSTEM ${CUSTOM_HANDLER_DAO_DEPS_INCLUDE_DIRS})
+
+ADD_LIBRARY(${TARGET_CUSTOM_HANDLER_DAO_RO_LIB} SHARED ${CUSTOM_HANDLER_DAO_RO_SOURCES})
+SET_TARGET_PROPERTIES(${TARGET_CUSTOM_HANDLER_DAO_RO_LIB} PROPERTIES SOVERSION ${API_VERSION} VERSION ${VERSION})
+SET_TARGET_PROPERTIES(${TARGET_CUSTOM_HANDLER_DAO_RO_LIB} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_BINARY_DIR}/modules/custom_handler_dao/database_checksum_custom_handler.h")
+TARGET_LINK_LIBRARIES(${TARGET_CUSTOM_HANDLER_DAO_RO_LIB} ${TARGET_CUSTOM_HANDLER_DAO_LIB})
+
+ADD_LIBRARY(${TARGET_CUSTOM_HANDLER_DAO_RW_LIB} SHARED ${CUSTOM_HANDLER_DAO_RW_SOURCES})
+SET_TARGET_PROPERTIES(${TARGET_CUSTOM_HANDLER_DAO_RW_LIB} PROPERTIES SOVERSION ${API_VERSION} VERSION ${VERSION})
+SET_TARGET_PROPERTIES(${TARGET_CUSTOM_HANDLER_DAO_RW_LIB} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_BINARY_DIR}/modules/custom_handler_dao/database_checksum_custom_handler.h")
+TARGET_LINK_LIBRARIES(${TARGET_CUSTOM_HANDLER_DAO_RW_LIB} ${TARGET_CUSTOM_HANDLER_DAO_RO_LIB})
+
+INSTALL(TARGETS ${TARGET_CUSTOM_HANDLER_DAO_RO_LIB} DESTINATION lib)
+INSTALL(TARGETS ${TARGET_CUSTOM_HANDLER_DAO_RW_LIB} DESTINATION lib)
+
+INSTALL(FILES
+ include/wrt-commons/custom-handler-dao-ro/common_dao_types.h
+ include/wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h
+ include/wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h
+ DESTINATION include/dpl-efl/wrt-commons/custom-handler-dao-ro
+)
+
+INSTALL(FILES
+ include/wrt-commons/custom-handler-dao-rw/custom_handler_dao.h
+ DESTINATION include/dpl-efl/wrt-commons/custom-handler-dao-rw
+)
--- /dev/null
+/*
+ * Copyright (c) 2012 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 <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
+
+namespace CustomHandlerDB {
+namespace Interface {
+
+namespace {
+const char* CustomHandler_DB_DATABASE = "/opt/dbspace/.wrt_custom_handler.db";
+DPL::DB::SqlConnection::Flag::Type CustomHandler_DB_FLAGS =
+ DPL::DB::SqlConnection::Flag::UseLucene;
+}
+
+DPL::Mutex g_CustomHandlerDbQueriesMutex;
+DPL::DB::ThreadDatabaseSupport m_customHandlerdbInterface(
+ CustomHandler_DB_DATABASE, CustomHandler_DB_FLAGS);
+
+
+void attachDatabaseRO()
+{
+ m_customHandlerdbInterface.AttachToThread(DPL::DB::SqlConnection::Flag::RO);
+}
+
+void attachDatabaseRW()
+{
+ m_customHandlerdbInterface.AttachToThread(DPL::DB::SqlConnection::Flag::RW);
+}
+
+void detachDatabase()
+{
+ m_customHandlerdbInterface.DetachFromThread();
+}
+
+} //namespace Interface
+} //namespace CustomHandlerDB
--- /dev/null
+/*
+ * Copyright (c) 2012 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 custom_handler_dao.cpp
+ * @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version 1.0
+ * @brief This file contains the definition of custom handler dao class.
+ */
+
+#include <wrt-commons/custom-handler-dao-rw/custom_handler_dao.h>
+#include <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
+
+namespace CustomHandlerDB {
+
+CustomHandlerDAO::CustomHandlerDAO(const DPL::String& pkgName) :
+ CustomHandlerDAOReadOnly(pkgName)
+{
+}
+
+CustomHandlerDAO::~CustomHandlerDAO()
+{
+}
+
+} // namespace CustomHandlerDB
--- /dev/null
+/*
+ * 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 custom handler dao class.
+ *
+ * @file custom_handler_dao_read_only.cpp
+ * @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version 1.0
+ * @brief This file contains the declaration of custom handler dao
+ */
+
+#include <wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h>
+#include <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
+
+namespace CustomHandlerDB {
+
+CustomHandlerDAOReadOnly::CustomHandlerDAOReadOnly(const DPL::String& pkgName)
+{
+}
+
+CustomHandlerDAOReadOnly::~CustomHandlerDAOReadOnly()
+{
+}
+
+} // namespace CustomHandlerDB
--- /dev/null
+/*
+ * Copyright (c) 2012 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 _CUSTOM_HANDLER_DATABASE_H_
+#define _CUSTOM_HANDLER_DATABASE_H_
+
+#include <dpl/thread.h>
+#include <dpl/mutex.h>
+#include <dpl/db/thread_database_support.h>
+
+extern DPL::Mutex g_CustomHandlerDbQueriesMutex;
+
+#define CUSTOM_HANDLER_DB_INTERNAL(tlsCommand, InternalType, interface) \
+ static DPL::ThreadLocalVariable<InternalType> *tlsCommand ## Ptr = NULL; \
+ { \
+ DPL::Mutex::ScopedLock lock(&customHandlerDbQueriesMutex); \
+ if (!tlsCommand ## Ptr) { \
+ static DPL::ThreadLocalVariable<InternalType> tmp; \
+ tlsCommand ## Ptr = &tmp; \
+ } \
+ } \
+ DPL::ThreadLocalVariable<InternalType> &tlsCommand = *tlsCommand ## Ptr; \
+ if (tlsCommand.IsNull()) { tlsCommand = InternalType(interface); }
+
+#define CUSTOM_HANDLER_DB_SELECT(name, type, interface) \
+ CUSTOM_HANDLER_DB_INTERNAL(name, type::Select, interface)
+
+#define CUSTOM_HANDLER_DB_INSERT(name, type, interface) \
+ CUSTOM_HANDLER_DB_INTERNAL(name, type::Insert, interface)
+
+#define CUSTOM_HANDLER_DB_UPDATE(name, type, interface) \
+ CUSTOM_HANDLER_DB_INTERNAL(name, type::Update, interface)
+
+#define CUSTOM_HANDLER_DB_DELETE(name, type, interface) \
+ CUSTOM_HANDLER_DB_INTERNAL(name, type::Delete, interface)
+
+namespace CustomHandlerDB {
+namespace Interface {
+
+void attachDatabaseRO();
+void attachDatabaseRW();
+void detachDatabase();
+
+extern DPL::DB::ThreadDatabaseSupport m_customHandlerdbInterface;
+
+} // namespace Interface
+} // namespace CustomHandlerDB
+
+#endif /* _CUSTOM_HANDLER_DATABASE_H_ */
+
--- /dev/null
+/*
+ * Copyright (c) 2012 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 Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version 1.0
+ * @brief This file contains the declaration of
+ * common data types for custom handler database.
+ */
+#ifndef SHARE_COMMON_DAO_TYPES_H_
+#define SHARE_COMMON_DAO_TYPES_H_
+
+namespace CustomHandlerDB {
+
+} // namespace CustomHandlerDB
+
+#endif /* SHARE_COMMON_DAO_TYPES_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2012 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 custom handler dao class.
+ *
+ * @file custom_handler_dao_read_only.h
+ * @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version 1.0
+ * @brief This file contains the declaration of custom handler dao
+ */
+
+#ifndef _CUSTOM_HANDLER_DAO_READ_ONLY_H_
+#define _CUSTOM_HANDLER_DAO_READ_ONLY_H_
+
+#include <dpl/string.h>
+#include <dpl/exception.h>
+
+namespace CustomHandlerDB {
+
+class CustomHandlerDAOReadOnly
+{
+ public:
+ /**
+ * CustomHandlerDAOReadOnly Exception classes
+ */
+ class Exception
+ {
+ public:
+ DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
+ DECLARE_EXCEPTION_TYPE(Base, DatabaseError)
+ };
+
+ public:
+ explicit CustomHandlerDAOReadOnly(const DPL::String& pkgName);
+ virtual ~CustomHandlerDAOReadOnly();
+
+ // TODO
+};
+
+} // namespace CustomHandlerDB
+
+#endif // _CUSTOM_HANDLER_DAO_READ_ONLY_H_
+
--- /dev/null
+/*
+ * Copyright (c) 2012 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 custom handler dao class.
+ *
+ * @file custom_handler_dao.h
+ * @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version 1.0
+ * @brief This file contains the declaration of custom handler dao
+ */
+#ifndef _CUSTOM_HANDLER_DAO_H_
+#define _CUSTOM_HANDLER_DAO_H_
+
+#include <wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h>
+
+namespace CustomHandlerDB {
+
+class CustomHandlerDAO : public CustomHandlerDAOReadOnly
+{
+ public:
+ explicit CustomHandlerDAO(const DPL::String& pkgName);
+ virtual ~CustomHandlerDAO();
+
+ // TODO
+};
+
+} // namespace CustomHandlerDB
+
+#endif // _CUSTOM_HANDLER_DAO_H_
--- /dev/null
+SQL(
+ BEGIN TRANSACTION;
+)
+
+CREATE_TABLE(ProtocolHandlers)
+ COLUMN_NOT_NULL(app_id, TEXT,)
+ COLUMN_NOT_NULL(target, TEXT,)
+ COLUMN_NOT_NULL(base_url, TEXT,)
+ COLUMN_NOT_NULL(url, TEXT,)
+ COLUMN_NOT_NULL(title, TEXT,)
+ COLUMN_NOT_NULL(user_allowed, INT,)
+
+ TABLE_CONSTRAINTS(
+ PRIMARY KEY (app_id, target, url)
+ )
+CREATE_TABLE_END()
+
+CREATE_TABLE(ContentHandlers)
+ COLUMN_NOT_NULL(app_id, TEXT,)
+ COLUMN_NOT_NULL(target, TEXT,)
+ COLUMN_NOT_NULL(base_url, TEXT,)
+ COLUMN_NOT_NULL(url, TEXT,)
+ COLUMN_NOT_NULL(title, TEXT,)
+ COLUMN_NOT_NULL(user_allowed, INT,)
+
+ TABLE_CONSTRAINTS(
+ PRIMARY KEY (app_id, target, url)
+ )
+CREATE_TABLE_END()
+
+SQL(
+ COMMIT;
+)
+
--- /dev/null
+DATABASE_START(custom_handler)
+
+#include "custom_handler_db"
+#include "version_db"
+
+DATABASE_END()
--- /dev/null
+/*
+ * Copyright (c) 2012 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 custom_handler_db_sql_generator.h
+ * @author Krzysztof Jackiewicz (k.jackiewicz@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 <dpl/db/orm_macros.h>
+
+#include "custom_handler_db_definitions"
--- /dev/null
+#!/bin/sh
+# Copyright (c) 2012 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}
+
--- /dev/null
+/*
+ * Copyright (c) 2012 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_CUSTOM_HANDLER_H_
+#define _ORM_GENERATOR_CUSTOM_HANDLER_H_
+
+#define ORM_GENERATOR_DATABASE_NAME custom_handler_db_definitions
+#include <dpl/db/orm_generator.h>
+#undef ORM_GENERATOR_DATABASE_NAME
+
+#endif // _ORM_GENERATOR_CUSTOM_HANDLER_H_
--- /dev/null
+SQL(
+ BEGIN TRANSACTION;
+ CREATE TABLE DB_CHECKSUM (version INT);
+ COMMIT;
+)
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
echo "[WRT] wrt-commons postinst done ..."
<provide>
<label name="wrt-commons::db_wrt"/>
<label name="wrt-commons::db_wrt_autosave"/>
+ <label name="wrt-commons::db_wrt_custom_handler"/>
</provide>
</define>
<request>