-#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
%{_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
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;
};
{
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);
}
// 'required' property false
Api::IWidgetFeaturePtr newFeature(new WidgetFeature(
dao.GetName(),
- false,
false));
// TODO what about feature params? aren't they needed
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");
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");
{
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
PluginPtr loadLibrary(PluginModelPtr& pluginModel);
void loadInjectedJavaScript();
- void installStandardFeatures();
- void installRootPlugins();
+ void installStandardFunctions();
+ void installRootPlugins();
void installRequestedFeatures();
//returns true if success or false if failed
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()
{
m_context = context;
// Register standard features
- installStandardFeatures();
+ installStandardFunctions();
WidgetDAOReadOnly dao(m_widgetHandle);
WidgetType appType = dao.getWidgetType();
#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();
}
// Remove all feature models
m_featureModels.clear();
-
- // Clear standard features list
- m_standardFeatureList.clear();
-}
+ }
void PluginContainerSupport::Initialize(int widgetHandle)
{
void PluginContainerSupport::readAllowedPlugins(int widgetHandle)
{
- std::list<std::string> allowedFeatures(m_standardFeatureList);
+ std::list<std::string> allowedFeatures;
auto requested = getAllowedFeatures(widgetHandle);
FOREACH(f, requested)
{
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...");
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;
// Main plugin list. Always equal to DB plugin list
typedef std::set<PluginModelPtr> PluginModelsContainer;
- StandardFeatureList m_standardFeatureList;
-
WrtDB::PluginHandleList m_rootPluginsList;
PluginModelsContainer m_pluginModels;
private:
// Reading
- void readStandardFeaturesList();
- void readRootPluginsList();
+ void readRootPluginsList();
// Plugin models
typedef std::multimap<WrtDB::FeatureHandle, std::string> DeviceCapList;
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;
# 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})
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)
+++ /dev/null
-http://w3cWidgetInterface.com/w3c-widget-interface
}
}
-/*
- * 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
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
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