From 151239cd48b67a8ce40162e5ec9ae811b28396c6 Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Mon, 1 Apr 2013 22:03:24 +0900 Subject: [PATCH] [Release] wrt-plugins-common_0.3.79 --- packaging/wrt-plugins-common.spec | 5 +- src/modules/API/WidgetDB/IWidgetFeature.h | 12 ---- src/modules/tizen/WidgetDB/WidgetDB.cpp | 10 --- src/modules/tizen/WidgetDB/WidgetFeature.cpp | 21 ------ src/modules/tizen/WidgetDB/WidgetFeature.h | 10 --- src/plugin-loading/js_page_session.cpp | 29 +++----- src/plugin-loading/plugin_container_support.cpp | 96 ++----------------------- src/plugin-loading/plugin_container_support.h | 7 +- src/standards/CMakeLists.txt | 3 - src/standards/W3C/Widget/CMakeLists.txt | 2 +- src/standards/standard-features-list | 1 - tests/dao/WidgetDBTest.cpp | 63 ---------------- wrt-popup-ace-runtime.rule | 4 +- wrt-popup-wrt-runtime.rule | 4 +- 14 files changed, 25 insertions(+), 242 deletions(-) mode change 100755 => 100644 src/standards/W3C/Widget/CMakeLists.txt delete mode 100644 src/standards/standard-features-list diff --git a/packaging/wrt-plugins-common.spec b/packaging/wrt-plugins-common.spec index 438d720..48d6742 100644 --- a/packaging/wrt-plugins-common.spec +++ b/packaging/wrt-plugins-common.spec @@ -1,7 +1,7 @@ -#git:framework/web/wrt-plugins-common wrt-plugins-common_0.3.78 +#git:framework/web/wrt-plugins-common wrt-plugins-common_0.3.79 Name: wrt-plugins-common Summary: wrt-plugins common library -Version: 0.3.78 +Version: 0.3.79 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 @@ -70,7 +70,6 @@ touch /opt/share/widget/plugin-installation-required %{_libdir}/*.so %{_libdir}/*.so.* %{_libdir}/wrt-plugins/w3c-widget-interface/libwrt-plugins-w3c-widget-interface.so -%attr(644,root,root) %{_libdir}/wrt-plugins/standard-features-list %attr(644,root,root) /usr/share/wrt-plugins-common/widget_interface_db.sql %attr(755,root,root) %{_bindir}/wrt-popup-ace-runtime %attr(755,root,root) %{_bindir}/wrt-popup-wrt-runtime diff --git a/src/modules/API/WidgetDB/IWidgetFeature.h b/src/modules/API/WidgetDB/IWidgetFeature.h index 17e635d..2371c1e 100644 --- a/src/modules/API/WidgetDB/IWidgetFeature.h +++ b/src/modules/API/WidgetDB/IWidgetFeature.h @@ -32,24 +32,12 @@ namespace Api { class IWidgetFeature { public: - typedef std::pair Param; - typedef std::list Params; - typedef Params::const_iterator ParamsIterator; - - public: virtual ~IWidgetFeature() {} virtual std::string getName() const = 0; - virtual bool isRequired() const = 0; - - virtual Params getParams() const = 0; - - virtual void addParam(const std::string& paramName, - const std::string& paramValue) = 0; - virtual bool isRequestedByWidget() const = 0; }; diff --git a/src/modules/tizen/WidgetDB/WidgetDB.cpp b/src/modules/tizen/WidgetDB/WidgetDB.cpp index b37711c..08c3f42 100644 --- a/src/modules/tizen/WidgetDB/WidgetDB.cpp +++ b/src/modules/tizen/WidgetDB/WidgetDB.cpp @@ -273,16 +273,7 @@ Api::Features WidgetDB::getWidgetFeatures() const { Api::IWidgetFeaturePtr feature( new WidgetFeature(DPL::ToUTF8String((*it).name), - (*it).required, true)); // requested (WidgetFeature param) - // iterating multimap - FOREACH(iterator, (*it).params) - { - // adding features with key(first) and value(second) - feature->addParam(DPL::ToUTF8String(iterator->first), - DPL::ToUTF8String(iterator->second)); - } - outFeatures.push_back(feature); } @@ -327,7 +318,6 @@ Api::Features WidgetDB::getRegisteredFeatures() const // 'required' property false Api::IWidgetFeaturePtr newFeature(new WidgetFeature( dao.GetName(), - false, false)); // TODO what about feature params? aren't they needed diff --git a/src/modules/tizen/WidgetDB/WidgetFeature.cpp b/src/modules/tizen/WidgetDB/WidgetFeature.cpp index 5733926..aee4902 100644 --- a/src/modules/tizen/WidgetDB/WidgetFeature.cpp +++ b/src/modules/tizen/WidgetDB/WidgetFeature.cpp @@ -25,10 +25,8 @@ namespace WrtDeviceApis { namespace WidgetDB { WidgetFeature::WidgetFeature(const std::string& name, - bool required, bool requested) : m_name(name), - m_required(required), m_requested(requested) { //LogDebug("entered"); @@ -40,25 +38,6 @@ std::string WidgetFeature::getName() const return m_name; } -bool WidgetFeature::isRequired() const -{ - //LogDebug("entered"); - return m_required; -} - -Api::IWidgetFeature::Params WidgetFeature::getParams() const -{ - //LogDebug("entered"); - return m_params; -} - -void WidgetFeature::addParam(const std::string& paramName, - const std::string& paramValue) -{ - //LogDebug("entered"); - m_params.push_back(std::make_pair(paramName, paramValue)); -} - WidgetFeature::~WidgetFeature() { //LogDebug("entered"); diff --git a/src/modules/tizen/WidgetDB/WidgetFeature.h b/src/modules/tizen/WidgetDB/WidgetFeature.h index 11be686..d14dc69 100644 --- a/src/modules/tizen/WidgetDB/WidgetFeature.h +++ b/src/modules/tizen/WidgetDB/WidgetFeature.h @@ -31,27 +31,17 @@ class WidgetFeature : public Api::IWidgetFeature { public: WidgetFeature(const std::string& name, - bool required, bool requested); std::string getName() const; - bool isRequired() const; - - Api::IWidgetFeature::Params getParams() const; - virtual ~WidgetFeature(); - virtual void addParam(const std::string& paramName, - const std::string& paramValue); - virtual bool isRequestedByWidget() const; private: std::string m_name; - bool m_required; bool m_requested; - Params m_params; }; } // WidgetDB } // WrtDeviceApis diff --git a/src/plugin-loading/js_page_session.cpp b/src/plugin-loading/js_page_session.cpp index 2fe19cd..bc9d44f 100644 --- a/src/plugin-loading/js_page_session.cpp +++ b/src/plugin-loading/js_page_session.cpp @@ -101,8 +101,8 @@ class JSPageSession::Impl PluginPtr loadLibrary(PluginModelPtr& pluginModel); void loadInjectedJavaScript(); - void installStandardFeatures(); - void installRootPlugins(); + void installStandardFunctions(); + void installRootPlugins(); void installRequestedFeatures(); //returns true if success or false if failed @@ -167,28 +167,17 @@ JSPageSession::Impl::~Impl() LogDebug("Deinitializing plugin Logic..."); } -void JSPageSession::Impl::installStandardFeatures() -{ - LogInfo("Installing standard widget features..."); + void JSPageSession::Impl::installStandardFunctions() + { + LogInfo("Installing standard functions..."); //add standard functions - FOREACH(it, JsFunctionManagerSingleton::Instance().getFunctions()) - { + FOREACH(it, JsFunctionManagerSingleton::Instance().getFunctions()) { m_objectExplorer->registerObject(*it, NULL); } - //add standard objects - LogDebug("Installing standard extensions..."); - - auto standardPlugins = m_pluginsSupport->getStandardPlugins(); - FOREACH(it, standardPlugins) - { - //loadFeatureToSession(*it); - installPlugin(*it); - } - - LogInfo("Standard widget features installed."); -} + LogInfo("Standard functions installed."); + } void JSPageSession::Impl::installRootPlugins() { @@ -516,7 +505,7 @@ void JSPageSession::Impl::startSession(int widgetHandle, m_context = context; // Register standard features - installStandardFeatures(); + installStandardFunctions(); WidgetDAOReadOnly dao(m_widgetHandle); WidgetType appType = dao.getWidgetType(); diff --git a/src/plugin-loading/plugin_container_support.cpp b/src/plugin-loading/plugin_container_support.cpp index a9cf516..41effcf 100644 --- a/src/plugin-loading/plugin_container_support.cpp +++ b/src/plugin-loading/plugin_container_support.cpp @@ -27,20 +27,13 @@ #include #include -namespace { -const char *STANDARD_FEATURES_LIST_FILE = "standard-features-list"; -} - -using namespace WrtDB; + using namespace WrtDB; #include PluginContainerSupport::PluginContainerSupport() : m_initialized(false) { - // Reading standard features list from file - readStandardFeaturesList(); - - // Reading root plugins list from so files + // Reading root plugins list from so files readRootPluginsList(); } @@ -51,10 +44,7 @@ PluginContainerSupport::~PluginContainerSupport() // Remove all feature models m_featureModels.clear(); - - // Clear standard features list - m_standardFeatureList.clear(); -} + } void PluginContainerSupport::Initialize(int widgetHandle) { @@ -87,7 +77,7 @@ std::list PluginContainerSupport::getAllowedFeatures( void PluginContainerSupport::readAllowedPlugins(int widgetHandle) { - std::list allowedFeatures(m_standardFeatureList); + std::list allowedFeatures; auto requested = getAllowedFeatures(widgetHandle); FOREACH(f, requested) { @@ -177,39 +167,7 @@ void PluginContainerSupport::registerPluginModel(DbPluginHandle handle) m_pluginModels.insert(model); } -void PluginContainerSupport::readStandardFeaturesList() -{ - LogDebug("Reading standard features list from file..."); - - std::string path = GlobalConfig::GetDevicePluginPath(); - path += "/"; - path += STANDARD_FEATURES_LIST_FILE; - - std::ifstream standardFeatureFile; - standardFeatureFile.open(path.c_str(), std::ifstream::in); - - if (!standardFeatureFile.is_open()) { - LogError("Reading standard features list from file FAILED."); - return; - } - - char buffer[1024]; - - while (!standardFeatureFile.eof()) { - standardFeatureFile.getline(buffer, sizeof(buffer)); - - if (buffer[0] == '\0') { - break; - } - - LogDebug("Standard Feature: <" << buffer << ">"); - m_standardFeatureList.push_back(std::string(buffer)); - } - - standardFeatureFile.close(); -} - -void PluginContainerSupport::readRootPluginsList() + void PluginContainerSupport::readRootPluginsList() { LogDebug("Reading root plugins list from so files..."); @@ -277,49 +235,7 @@ PluginContainerSupport::getPluginModel(const FeatureModelPtr &feature) const return getPluginModelById(feature->PHandle.Get()); } -PluginContainerSupport::FeaturesList -PluginContainerSupport::getStandardFeatures() const -{ - //TODO use move - FeaturesList standardFeatures; - - FOREACH(it, m_standardFeatureList) - { - FeatureModelPtr feature = getFeatureModel(*it); - if (!feature) { - LogWarning("Feature does not exist in DB " << *it); - continue; - } - - //TODO maybe it should be sorted - standardFeatures.push_back(feature); - } - - return standardFeatures; -} - -PluginContainerSupport::PluginsList -PluginContainerSupport::getStandardPlugins() const -{ - PluginsList plugins; - - auto features = getStandardFeatures(); - - FOREACH(it, features) - { - auto plugin = getPluginModel(*it); - if (!plugin) { - LogError("PluginModel not found"); - continue; - } - - plugins.push_back(plugin); - } - - return plugins; -} - -PluginContainerSupport::PluginsList + PluginContainerSupport::PluginsList PluginContainerSupport::getRootPlugins() const { PluginsList plugins; diff --git a/src/plugin-loading/plugin_container_support.h b/src/plugin-loading/plugin_container_support.h index c5df084..1f0b2aa 100644 --- a/src/plugin-loading/plugin_container_support.h +++ b/src/plugin-loading/plugin_container_support.h @@ -46,8 +46,6 @@ class PluginContainerSupport // Main plugin list. Always equal to DB plugin list typedef std::set PluginModelsContainer; - StandardFeatureList m_standardFeatureList; - WrtDB::PluginHandleList m_rootPluginsList; PluginModelsContainer m_pluginModels; @@ -58,8 +56,7 @@ class PluginContainerSupport private: // Reading - void readStandardFeaturesList(); - void readRootPluginsList(); + void readRootPluginsList(); // Plugin models typedef std::multimap DeviceCapList; @@ -84,8 +81,6 @@ class PluginContainerSupport std::list getAllowedFeatures(int widgetHandle) const; void readAllowedPlugins(int widgetHandle); void readRootPlugins(int widgetHandle); - FeaturesList getStandardFeatures() const; - PluginsList getStandardPlugins() const; PluginsList getRootPlugins() const; PluginsList getPluginsList() const; diff --git a/src/standards/CMakeLists.txt b/src/standards/CMakeLists.txt index 6bab9bf..83ff664 100644 --- a/src/standards/CMakeLists.txt +++ b/src/standards/CMakeLists.txt @@ -12,8 +12,5 @@ # See the License for the specific language governing permissions and # limitations under the License. # -set(STANDARD_FILE_DESTINATION /usr/lib/wrt-plugins) add_subdirectory(W3C) - -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/standard-features-list DESTINATION ${STANDARD_FILE_DESTINATION}) diff --git a/src/standards/W3C/Widget/CMakeLists.txt b/src/standards/W3C/Widget/CMakeLists.txt old mode 100755 new mode 100644 index e6ab932..70ef116 --- a/src/standards/W3C/Widget/CMakeLists.txt +++ b/src/standards/W3C/Widget/CMakeLists.txt @@ -44,4 +44,4 @@ target_link_libraries(${TARGET_NAME} wrt-plugins-storageevent ) -INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION ${STANDARD_FILE_DESTINATION}/w3c-widget-interface) +INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION /usr/lib/wrt-plugins/w3c-widget-interface) diff --git a/src/standards/standard-features-list b/src/standards/standard-features-list deleted file mode 100644 index 4ef06c8..0000000 --- a/src/standards/standard-features-list +++ /dev/null @@ -1 +0,0 @@ -http://w3cWidgetInterface.com/w3c-widget-interface diff --git a/tests/dao/WidgetDBTest.cpp b/tests/dao/WidgetDBTest.cpp index ea6ca11..d210f9d 100644 --- a/tests/dao/WidgetDBTest.cpp +++ b/tests/dao/WidgetDBTest.cpp @@ -439,67 +439,4 @@ RUNNER_TEST(widgetDB_test_check_installation_status_latest) } } -/* - * Name: widgetDB_test_widget_feature - * Description: check accessiblity of widget features and their values by - * WidgetDB - * Expected: feature names and values should match this, which was inserted into - * widget database - */ -RUNNER_TEST(widgetDB_test_widget_feature) -{ - try { - IWidgetDBPtr widget = getWidgetDB(2000); - Features features = widget->getWidgetFeatures(); - - RUNNER_ASSERT(features.size() == 5); - - FOREACH(it, features) - { - std::string name = (*it)->getName(); - if ("first_2000" == name) { - RUNNER_ASSERT((*it)->getParams().size() == 4); - - RUNNER_ASSERT((*it)->isRequired()); - } else if ("second_2000" == name) { - RUNNER_ASSERT((*it)->getParams().size() == 1); - } else if ("third_2000" == name) { - IWidgetFeature::Params params = (*it)->getParams(); - - RUNNER_ASSERT(params.size() == 1); - RUNNER_ASSERT_WHAT_EQUALS("third_2000", params.begin()->first); - RUNNER_ASSERT_WHAT_EQUALS("thirdValue1", params.begin()->second); - RUNNER_ASSERT(!(*it)->isRequired()); - } else if ("fourth_2000" == name) { - RUNNER_ASSERT((*it)->getParams().size() == 0); - } else if ("fifth_2000" == name) { - RUNNER_ASSERT((*it)->getParams().size() == 0); - } else { - RUNNER_ASSERT(false); - } - } - } catch (const WrtDeviceApis::Commons::SecurityException &e) { - LogError("Exception thrown." << e.DumpToString()); - RUNNER_ASSERT(false); - } -} - -/* - * Name: widgetDB_test_widget_feature2 - * Description: check if requesting features from WidgetDB throw excpetion if - * widget does not exists - * Expected: exception should be raise if widget does not exists - */ -RUNNER_TEST(widgetDB_test_widget_feature2) -{ - try { - IWidgetDBPtr widget = getWidgetDB(2011); //no such widget - Features features = widget->getWidgetFeatures(); - - RUNNER_ASSERT(false); - } catch (const WrtDeviceApis::Commons::SecurityException &e) { - LogDebug("OK. Exception thrown." << e.DumpToString()); - } -} - #undef RUNNER_ASSERT_WHAT_EQUALS diff --git a/wrt-popup-ace-runtime.rule b/wrt-popup-ace-runtime.rule index 8b27008..a6b2509 100644 --- a/wrt-popup-ace-runtime.rule +++ b/wrt-popup-ace-runtime.rule @@ -7,5 +7,7 @@ wrt-popup-ace-runtime system::vconf rwx wrt-popup-ace-runtime sound_server rw e17 wrt-popup-ace-runtime w wrt-popup-ace-runtime system::share rwx -wrt-popup-ace-runtime pulseaudio wx +wrt-popup-ace-runtime pulseaudio rwx +wrt-popup-ace-runtime mobileprint x +wrt-popup-ace-runtime dbus r diff --git a/wrt-popup-wrt-runtime.rule b/wrt-popup-wrt-runtime.rule index 0667ebe..8da70b8 100644 --- a/wrt-popup-wrt-runtime.rule +++ b/wrt-popup-wrt-runtime.rule @@ -7,5 +7,7 @@ wrt-popup-wrt-runtime system::vconf rwx wrt-popup-wrt-runtime sound_server rw e17 wrt-popup-wrt-runtime w wrt-popup-wrt-runtime system::share rwx -wrt-popup-wrt-runtime pulseaudio wx +wrt-popup-wrt-runtime pulseaudio rwx +wrt-popup-wrt-runtime mobileprint x +wrt-popup-wrt-runtime dbus r -- 2.7.4