#include <Commons/Exception.h>
#include <CommonsJavaScript/Converter.h>
#include <dpl/exception.h>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
#include <dpl/foreach.h>
using namespace std;
bool PluginManager::loadChild(const string &name) const
{
- LogInfo("loading " << name);
+ _D("loading %s", name.c_str());
string localUri = m_objectUri;
localUri.append(SEPARATOR).append(name);
WrtDB::DbPluginHandle handle =
WrtDB::PluginDAOReadOnly::getPluginHandleForImplementedObject(localUri);
if (handle == WrtDB::INVALID_PLUGIN_HANDLE) {
- LogError("Plugin not found");
+ _E("Plugin not found");
return false;
}
{
// Error while reading database - widget handle may
// be invalid or some data may be missing in database
- LogError("Cannot get feature list");
+ _E("Cannot get feature list");
return false;
}
{
if (it->pluginId == handle) {
if (it->rejected) {
- LogWarning("Feature rejected by ACE");
+ _E("Feature rejected by ACE");
continue;
}
const_cast<JSGlobalContextRef>(m_context));
}
}
- LogError("Plugin not loaded");
+ _E("Plugin not loaded");
return false;
}
JSValueRef PluginManager::getProperty(const string &name) const
{
- LogDebug("getProperty " << name);
+ _D("getProperty %s", name.c_str());
ObjectList::const_iterator it = m_objectList.find(name);
if (it != m_objectList.end()) {
//return already set value
bool PluginManager::setProperty(const string &name,
JSValueRef value)
{
- LogDebug("setProperty " << name);
+ _D("setProperty %s", name.c_str());
if (m_objectList.count(name) > 0) {
JSValueUnprotect(m_context, m_objectList[name]);
}
bool PluginManager::deleteProperty(const string &name)
{
if (m_objectList.count(name) > 0) {
- LogDebug("deleteProperty " << name);
+ _D("deleteProperty %s", name.c_str());
JSValueUnprotect(m_context, m_objectList[name]);
m_objectList.erase(name);
return true;
Api::IPluginManager::PropertyList PluginManager::getProperties() const
{
+ using namespace WrtDB;
+
if (!m_propertyCache.IsNull()) {
return *m_propertyCache;
}
m_propertyCache = PropertyList();
- WrtDB::WidgetDAOReadOnly dao(m_widgetHandle);
+ WidgetDAOReadOnly dao(m_widgetHandle);
string localUri = m_objectUri + SEPARATOR;
- if (dao.getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP) {
- WrtDB::PluginHandleList pluginHandleList =
- WrtDB::PluginDAOReadOnly::getPluginHandleList();
+ if (dao.getWidgetType() == APP_TYPE_TIZENWEBAPP)
+ {
+ static ImplementedObjectsList implObjectList =
+ PluginDAOReadOnly::getImplementedObjects();
- FOREACH(it_pluginHandle, pluginHandleList)
+ FOREACH(it_implObject, implObjectList)
{
- WrtDB::ImplementedObjectsList implObjectList =
- WrtDB::PluginDAOReadOnly::getImplementedObjectsForPluginHandle(
- *it_pluginHandle);
-
- FOREACH(it_implObject, implObjectList)
- {
- //check if implemented object stats with localUri
- if (it_implObject->find(localUri) == 0) {
- string property = *it_implObject;
- //remove local uri that predicts property name.
- property.erase(0, localUri.size());
- //check if property has its own properties.
- size_t pos = property.find(SEPARATOR);
- if (pos != string::npos) {
- //if so then remove them.
- property.erase(pos);
- }
- m_propertyCache->push_back(property);
+ //check if implemented object stats with localUri
+ if (it_implObject->find(localUri) == 0) {
+ string property = *it_implObject;
+ //remove local uri that predicts property name.
+ property.erase(0, localUri.size());
+ //check if property has its own properties.
+ size_t pos = property.find(SEPARATOR);
+ if (pos != string::npos) {
+ //if so then remove them.
+ property.erase(pos);
}
+
+ m_propertyCache->push_back(property);
}
}
- } else {
- WrtDB::DbWidgetFeatureSet features;
+ }
+ else
+ {
+ DbWidgetFeatureSet features;
Try
{
features = dao.getFeaturesList();
}
- Catch(WrtDB::WidgetDAOReadOnly::Exception::Base)
+ Catch(WidgetDAOReadOnly::Exception::Base)
{
- LogError("Cannot get feature list");
+ _E("Cannot get feature list");
ReThrow(Commons::PlatformException);
}
- WrtDB::DbWidgetFeatureSet::const_iterator feature = features.begin();
+ DbWidgetFeatureSet::const_iterator feature = features.begin();
for (; feature != features.end(); ++feature) {
- WrtDB::ImplementedObjectsList implObjs =
- WrtDB::PluginDAOReadOnly::getImplementedObjectsForPluginHandle(
+ ImplementedObjectsList implObjs =
+ PluginDAOReadOnly::getImplementedObjectsForPluginHandle(
feature->pluginId);
FOREACH(it, implObjs) {
//check if implemented object stats with localUri