From: Andrzej Surdej Date: Mon, 17 Dec 2012 15:21:33 +0000 (+0100) Subject: Custom Handlers DAO extended with new api X-Git-Tag: submit/trunk/20121220.070221~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a3adb8375acfbba0398243644a61d0dce2a8c7a;p=platform%2Fframework%2Fweb%2Fwrt-commons.git Custom Handlers DAO extended with new api [Issue#] N/A [Problem] No possible way to remove all widget handlers during widget uninstall. [Cause] N/A [Solution] Added new api to provide this finctions. [Verification] To verif build repo and run some custom_handlers.wgt tests Change-Id: I9af542a35f6098f81e69e41123c389f96fd2003a --- diff --git a/modules/custom_handler_dao/dao/custom_handler_dao.cpp b/modules/custom_handler_dao/dao/custom_handler_dao.cpp index 89f6144..555655e 100644 --- a/modules/custom_handler_dao/dao/custom_handler_dao.cpp +++ b/modules/custom_handler_dao/dao/custom_handler_dao.cpp @@ -268,4 +268,33 @@ void CustomHandlerDAO::unregisterProtocolHandler(const DPL::String& target, } +void CustomHandlerDAO::removeWidgetProtocolHandlers() +{ + LogDebug("ente"); + Try { + CUSTOM_HANDLER_DB_DELETE(deleteProtocol, ProtocolHandlers); + deleteProtocol->Where(Equals(m_pkgName)); + deleteProtocol->Execute(); + + } Catch(DPL::DB::SqlConnection::Exception::Base) { + ReThrowMsg(CustomHandlerDAO::Exception::DatabaseError, + "Failed to remove widget protoc"); + } +} + +void CustomHandlerDAO::removeWidgetContentHandlers() +{ + LogDebug("ente"); + Try { + CUSTOM_HANDLER_DB_DELETE(deleteContent, ContentHandlers); + deleteContent->Where(Equals(m_pkgName)); + deleteContent->Execute(); + + } Catch(DPL::DB::SqlConnection::Exception::Base) { + ReThrowMsg(CustomHandlerDAO::Exception::DatabaseError, + "Failed to remove widget entries"); + } +} + + } // namespace CustomHandlerDB diff --git a/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-rw/custom_handler_dao.h b/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-rw/custom_handler_dao.h index f773681..1ce61cf 100644 --- a/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-rw/custom_handler_dao.h +++ b/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-rw/custom_handler_dao.h @@ -62,6 +62,12 @@ class CustomHandlerDAO : public CustomHandlerDAOReadOnly void unregisterProtocolHandler(const DPL::String& target, const DPL::String& url, const DPL::String& baseURL); + + /** + * Removes all widget entries connected to given ID + */ + void removeWidgetProtocolHandlers(); + void removeWidgetContentHandlers(); }; } // namespace CustomHandlerDB