NormalizeString(txt, true);
}
-bool ConfigParserData::Param::operator==(const Param& other) const
-{
- return name == other.name && value == other.value;
-}
-
-bool ConfigParserData::Param::operator!=(const Param& other) const
-{
- return name != other.name || value != other.value;
-}
-
-bool ConfigParserData::Param::operator >(const Param& other) const
-{
- if (name == other.name) {
- return value > other.value;
- } else {
- return name > other.name;
- }
-}
-
-bool ConfigParserData::Param::operator>=(const Param& other) const
-{
- if (name >= other.name) {
- return true;
- } else {
- return value >= other.value;
- }
-}
-
-bool ConfigParserData::Param::operator <(const Param& other) const
-{
- if (name == other.name) {
- return value < other.value;
- } else {
- return name < other.name;
- }
-}
-
-bool ConfigParserData::Param::operator<=(const Param& other) const
-{
- if (name <= other.name) {
- return true;
- } else {
- return value <= other.value;
- }
-}
-
bool ConfigParserData::Feature::operator==(const Feature& other) const
{
- return name == other.name && paramsList == other.paramsList;
+ return name == other.name;
}
bool ConfigParserData::Feature::operator!=(const Feature& other) const
{
- return name != other.name || paramsList != other.paramsList;
+ return name != other.name;
}
bool ConfigParserData::Feature::operator >(const Feature& other) const
{
- if (name > other.name) {
- return true;
- }
- if (name < other.name) {
- return false;
- }
- return paramsList > other.paramsList;
+ return name > other.name;
}
bool ConfigParserData::Feature::operator>=(const Feature& other) const
{
- if (name > other.name) {
- return true;
- }
- if (name < other.name) {
- return false;
- }
- return paramsList >= other.paramsList;
+ return name >= other.name;
}
bool ConfigParserData::Feature::operator <(const Feature& other) const
{
- if (name < other.name) {
- return true;
- }
- if (name > other.name) {
- return false;
- }
- return paramsList < other.paramsList;
+ return name < other.name;
}
bool ConfigParserData::Feature::operator<=(const Feature& other) const
{
- if (name < other.name) {
- return true;
- }
- if (name > other.name) {
- return false;
- }
- return paramsList <= other.paramsList;
+ return name <= other.name;
}
bool ConfigParserData::Privilege::operator==(const Privilege& other) const
wrt::WidgetFeature::Row widgetFeature;
widgetFeature.Set_app_id(widgetHandle);
widgetFeature.Set_name(pWidgetFeature->name);
- widgetFeature.Set_required(pWidgetFeature->required);
widgetFeature.Set_rejected(false);
- wrt::WidgetFeature::widget_feature_id::ColumnType widgetFeatureID;
- {
- WRT_DB_INSERT(insert, wrt::WidgetFeature, &WrtDatabase::interface())
- insert->Values(widgetFeature);
- widgetFeatureID = static_cast<int>(insert->Execute());
- }
-
- // Insert into table FeatureParam
- wrt::FeatureParam::Row featureParam;
- featureParam.Set_widget_feature_id(widgetFeatureID);
-
- FOREACH(iter, pWidgetFeature->paramsList)
- {
- featureParam.Set_name(iter->name);
- featureParam.Set_value(iter->value);
-
- DO_INSERT(featureParam, wrt::FeatureParam)
- }
+ DO_INSERT(widgetFeature, wrt::WidgetFeature)
}
}
for (RowList::iterator i = list.begin(); i != list.end(); ++i) {
DbWidgetFeature feature;
feature.name = i->Get_name();
- feature.required = i->Get_required();
feature.rejected = i->Get_rejected();
- feature.params = getFeatureParams(i->Get_widget_feature_id());
FeatureDAOReadOnly featureDao(DPL::ToUTF8String(i->Get_name()));
feature.pluginId = featureDao.GetPluginHandle();
resultSet.insert(feature);
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get features list")
}
-WidgetParamMap WidgetDAOReadOnly::getFeatureParams(int id)
-{
- WidgetFeatureId widgetFeatureId(id);
- LogDebug("Getting feature Params. featureId: " << widgetFeatureId);
- SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
- {
- WRT_DB_SELECT(select, FeatureParam, &WrtDatabase::interface())
- select->Where(Equals<FeatureParam::widget_feature_id>(
- widgetFeatureId));
-
- WidgetParamMap resultMap;
- typedef std::list<FeatureParam::Row> RowList;
- RowList list = select->GetRowList();
-
- FOREACH(i, list)
- resultMap.insert(std::make_pair(i->Get_name(), i->Get_value()));
-
- return resultMap;
- }
- SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get feature params")
-}
-
bool WidgetDAOReadOnly::hasFeature(const std::string& featureName) const
{
LogDebug(
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get key common name")
}
-ResourceAttributeList WidgetDAOReadOnly::getResourceAttribute(
- const std::string &resourceId) const
-{
- WRT_DB_SELECT(select, WidgetFeature, &WrtDatabase::interface())
- select->Where(And(Equals<WidgetFeature::app_id>(m_widgetHandle),
- Equals<WidgetFeature::name>(
- DPL::FromUTF8String(resourceId))));
-
- std::list<WidgetFeature::Row> list = select->GetRowList();
- ResourceAttributeList result;
- if (!list.empty()) {
- int widgetFeatureId = list.begin()->Get_widget_feature_id();
- WidgetParamMap map = getFeatureParams(widgetFeatureId);
-
- FOREACH(i, map)
- result.push_back(DPL::ToUTF8String(i->first));
- }
- return result;
-}
-
void WidgetDAOReadOnly::getWidgetAccessInfo(
WidgetAccessInfoList& outAccessInfoList) const
{
typedef std::set<EncryptedFileInfo> EncryptedFileList;
/**
- * @brief Widget configuration parameter key
- */
-typedef DPL::String WidgetParamKey;
-
-/**
- * @brief Widget configuration parameter value
- */
-typedef DPL::String WidgetParamValue;
-
-/**
- * @brief A map of widget configuration parameters.
- *
- * Widget configuration parameters are read from database and are stored
- * along with feature that they describe.
- */
-typedef std::multimap<WidgetParamKey, WidgetParamValue> WidgetParamMap;
-
-/**
* @brief Widget feature host information about possible javascript extensions
* that widget may use
*
struct DbWidgetFeature
{
DPL::String name; /// Feature name
- bool required; /// Whether feature is required
bool rejected; /// Api feature was rejected by ace
DbPluginHandle pluginId; /// Plugin id that implement this feature
- WidgetParamMap params; /// Widget's params
DbWidgetFeature() :
- required(false),
pluginId(INVALID_PLUGIN_HANDLE)
{}
};
const DbWidgetFeature &featureB)
{
return featureA.name == featureB.name &&
- featureA.required == featureB.required &&
featureA.pluginId == featureB.pluginId;
}
class ConfigParserData
{
public:
- struct Param
- {
- Param(const DPL::String& _name) : name(_name)
- {}
- DPL::String name;
- DPL::String value;
- bool operator==(const Param&) const;
- bool operator!=(const Param&) const;
- bool operator >(const Param&) const;
- bool operator>=(const Param&) const;
- bool operator <(const Param&) const;
- bool operator<=(const Param&) const;
- };
- typedef std::set<Param> ParamsList;
-
struct Feature
{
- Feature(const DPL::String& _name,
- bool _required = true) : name(_name),
- required(_required)
+ Feature(const DPL::String& _name) : name(_name)
{}
DPL::String name;
- bool required;
- ParamsList paramsList;
bool operator==(const Feature&) const;
bool operator!=(const Feature&) const;
enum IconSectionType
{
DefaultIcon =0,
- SmallIcon,
+ SmallIcon
};
typedef std::set<std::pair<IconSectionType, DPL::String>> IconSet;
*/
DbWidgetFeatureSet getFeaturesList() const;
- static WidgetParamMap getFeatureParams(int widgetFeatureId);
/**
* This method checks whether widget has specified feature.
*
*/
std::string getBaseFolder() const;
- /* This method gets the parameter list for resource.
- */
- ResourceAttributeList getResourceAttribute(
- const std::string &resourceId) const;
-
/* This method checks read only flag for given property
*/
DPL::OptionalInt checkPropertyReadFlag(
COLUMN_NOT_NULL(widget_feature_id, INTEGER, primary key autoincrement)
COLUMN_NOT_NULL(app_id, INT,)
COLUMN_NOT_NULL(name, TEXT,)
- COLUMN_NOT_NULL(required, INT,)
COLUMN_NOT_NULL(rejected, INT,)
TABLE_CONSTRAINTS(
FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
)
CREATE_TABLE_END()
-CREATE_TABLE(FeatureParam)
- COLUMN_NOT_NULL(widget_feature_id, INTEGER,)
- COLUMN_NOT_NULL(name, TEXT,)
- COLUMN_NOT_NULL(value, TEXT,)
- TABLE_CONSTRAINTS(
- FOREIGN KEY (widget_feature_id) REFERENCES WidgetFeature (widget_feature_id) ON DELETE CASCADE
- )
-CREATE_TABLE_END()
-
CREATE_TABLE(WidgetPrivilege)
COLUMN_NOT_NULL(widget_privilege_id, INTEGER, primary key autoincrement)
COLUMN_NOT_NULL(app_id, INT,)
regInfo.configInfo.preferencesList.insert(pref);
//widget feature
- ConfigParserData::Feature feat(DPL::FromUTF8String(""), false);
- ConfigParserData::Param par(DPL::FromUTF8String(("")));
+ ConfigParserData::Feature feat(DPL::FromUTF8String(""));
par.value = DPL::FromUTF8String("");
feat.paramsList.insert(par);
regInfo.configInfo.featuresList.insert(feat);
INS_ALL_WIDGET_LOC_STARTFILE="insert into WidgetLocalizedStartFile(app_id, start_file_id, widget_locale, type, encoding)"
INS_ALL_WIDGET_DEFPREF="insert into WidgetDefaultPreference(app_id, key_name, key_value, readonly)"
INS_ALL_WIDGET_PREF="insert into WidgetPreference(tizen_appid, key_name, key_value, readonly)"
- INS_ALL_WIDGET_FEATURE="insert into WidgetFeature(app_id, name, required)"
- INS_ALL_WIDGET_FEATURE_PARAM="insert into FeatureParam(widget_feature_id, name, value)"
+ INS_ALL_WIDGET_FEATURE="insert into WidgetFeature(app_id, name)"
INS_ALL_WIDGET_WINMODES="insert into WidgetWindowModes(app_id, window_mode)"
INS_ALL_WIDGET_WARP="insert into WidgetWARPInfo(app_id, iri, subdomain_access)"
INS_ALL_WIDGET_CERT="insert into WidgetCertificateFingerprint(app_id, owner, chainid, type, md5_fingerprint, sha1_fingerprint, common_name)"