[Release] wrt-plugins-common_0.3.79 submit/tizen_2.1/20130401.130344
authorJihoon Chung <jihoon.chung@samsung.com>
Mon, 1 Apr 2013 13:03:24 +0000 (22:03 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Mon, 1 Apr 2013 13:03:24 +0000 (22:03 +0900)
14 files changed:
packaging/wrt-plugins-common.spec
src/modules/API/WidgetDB/IWidgetFeature.h
src/modules/tizen/WidgetDB/WidgetDB.cpp
src/modules/tizen/WidgetDB/WidgetFeature.cpp
src/modules/tizen/WidgetDB/WidgetFeature.h
src/plugin-loading/js_page_session.cpp
src/plugin-loading/plugin_container_support.cpp
src/plugin-loading/plugin_container_support.h
src/standards/CMakeLists.txt
src/standards/W3C/Widget/CMakeLists.txt [changed mode: 0755->0644]
src/standards/standard-features-list [deleted file]
tests/dao/WidgetDBTest.cpp
wrt-popup-ace-runtime.rule
wrt-popup-wrt-runtime.rule

index 438d720..48d6742 100644 (file)
@@ -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
index 17e635d..2371c1e 100644 (file)
@@ -32,24 +32,12 @@ namespace Api {
 class IWidgetFeature
 {
   public:
-    typedef std::pair<std::string, std::string> Param;
-    typedef std::list<Param> 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;
 };
 
index b37711c..08c3f42 100644 (file)
@@ -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
index 5733926..aee4902 100644 (file)
 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");
index 11be686..d14dc69 100644 (file)
@@ -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
index 2fe19cd..bc9d44f 100644 (file)
@@ -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();
index a9cf516..41effcf 100644 (file)
 #include <dpl/wrt-dao-ro/feature_dao_read_only.h>
 #include <dpl/wrt-dao-ro/global_config.h>
 
-namespace {
-const char *STANDARD_FEATURES_LIST_FILE = "standard-features-list";
-}
-
-using namespace WrtDB;
+ using namespace WrtDB;
 
 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
 
 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<std::string> PluginContainerSupport::getAllowedFeatures(
 
 void PluginContainerSupport::readAllowedPlugins(int widgetHandle)
 {
-    std::list<std::string> allowedFeatures(m_standardFeatureList);
+    std::list<std::string> 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;
index c5df084..1f0b2aa 100644 (file)
@@ -46,8 +46,6 @@ class PluginContainerSupport
     // Main plugin list. Always equal to DB plugin list
     typedef std::set<PluginModelPtr> 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<WrtDB::FeatureHandle, std::string> DeviceCapList;
@@ -84,8 +81,6 @@ class PluginContainerSupport
     std::list<std::string> getAllowedFeatures(int widgetHandle) const;
     void readAllowedPlugins(int widgetHandle);
     void readRootPlugins(int widgetHandle);
-    FeaturesList getStandardFeatures() const;
-    PluginsList  getStandardPlugins() const;
     PluginsList  getRootPlugins() const;
     PluginsList  getPluginsList() const;
 
index 6bab9bf..83ff664 100644 (file)
@@ -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})
old mode 100755 (executable)
new mode 100644 (file)
index e6ab932..70ef116
@@ -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 (file)
index 4ef06c8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-http://w3cWidgetInterface.com/w3c-widget-interface
index ea6ca11..d210f9d 100644 (file)
@@ -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
index 8b27008..a6b2509 100644 (file)
@@ -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
 
index 0667ebe..8da70b8 100644 (file)
@@ -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