/* It also checks port and schema */
bool isSubDomain(const WarpIRI &second) const;
bool isAccessDefinition() const;
- // KW bool isIRIValid() const;
bool getSubDomain() const;
- /* This is debug function */
- // KW void print() const {
- // KW LogInfo("P:" << m_port << " S:" << m_schema);
- // KW for (size_t i = 0; i < m_host.size(); ++i)
- // KW LogInfo(" " << m_host[i]);
- // KW }
-
static bool isIRISchemaIgnored(const char *iri);
bool operator ==(const WarpIRI &other) const
return m_isAccessDefinition;
}
-// KW bool WarpIRI::isIRIValid() const {
-// KW return m_isIRIValid;
-// KW }
-
bool WarpIRI::getSubDomain() const
{
return m_domain;
row.Set_app_id(widgetHandle);
// row.Set_share_href (DPL::FromUTF8String(regInfo.shareHref));
row.Set_signature_type(regInfo.signatureType);
- row.Set_factory_widget(regInfo.isFactoryWidget);
row.Set_test_widget(regInfo.isTestWidget);
row.Set_install_time(regInfo.installedTime);
row.Set_splash_img_src(regInfo.configInfo.splashImgSrc);
FOREACH(pWidgetSetting, widgetConfigurationInfo.settingsList)
{
- SettginsList::Row row;
+ SettingsList::Row row;
row.Set_appId(widgetHandle);
row.Set_settingName(pWidgetSetting->m_name);
row.Set_settingValue(pWidgetSetting->m_value);
- DO_INSERT(row, SettginsList)
+ DO_INSERT(row, SettingsList)
}
}
GlobalConfig::GetUserInstalledWidgetPath());
DPL::String srcPath = DPL::FromUTF8String(GlobalConfig::GetWidgetSrcPath());
- bool isFactoryWidget = isFactory();
-
- if (isFactoryWidget) {
- WidgetGUID widgetGUID = getGUID();
- if (!widgetGUID) {
- Throw(WidgetDAOReadOnly::Exception::GUIDisNull);
- }
- path += L"/" + *widgetGUID + L"/";
- } else {
- // if the widget is a "downloaded widget",
- // use unique package name.
- DPL::OStringStream strAppId;
- strAppId << m_widgetHandle;
- DPL::OptionalString pkgname = getPkgname();
- path += L"/" + *pkgname;
- path += srcPath + L"/";
- }
+ DPL::OStringStream strAppId;
+ strAppId << m_widgetHandle;
+ DPL::OptionalString pkgname = getPkgname();
+ path += L"/" + *pkgname;
+ path += srcPath + L"/";
return path;
}
if (ret.IsNull() || *ret == 0) { return false; } else { return true; }
}
-bool WidgetDAOReadOnly::isFactory() const
-{
- SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
- {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- WRT_DB_SELECT(select, WidgetExtendedInfo, &WrtDatabase::interface())
- select->Where(Equals<WidgetExtendedInfo::app_id>(m_widgetHandle));
-
- WidgetExtendedInfo::Select::RowList rows = select->GetRowList();
- if (rows.empty()) {
- ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist,
- "Cannot find widget. Handle: " << m_widgetHandle);
- }
-
- DPL::OptionalInt ret = rows.front().Get_factory_widget();
- if (ret.IsNull()) {
- return false;
- }
- return static_cast<bool>(*ret);
- }
- SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get isFactory")
-}
-
time_t WidgetDAOReadOnly::getInstallTime() const
{
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
return baseFolder;
}
-bool WidgetDAOReadOnly::isDeletable() const
-{
- return !WidgetDAOReadOnly::isFactory();
-}
-
WidgetCertificateDataList WidgetDAOReadOnly::getCertificateDataList() const
{
//TODO check widget existance
path << WidgetConfig::GetWidgetWebLocalStoragePath(*pkgname);
path << "/";
- if (isFactory()) {
- WidgetGUID widgetGUID = getGUID();
- if (!widgetGUID) {
- Throw(WidgetDAOReadOnly::Exception::GUIDisNull);
- }
- path << DPL::ToUTF8String(*widgetGUID);
- }
-
return path.str();
}
{
using namespace DPL::DB::ORM;
using namespace DPL::DB::ORM::wrt;
- WRT_DB_SELECT(select, SettginsList, &WrtDatabase::interface())
- select->Where(Equals<SettginsList::appId>(m_widgetHandle));
+ WRT_DB_SELECT(select, SettingsList, &WrtDatabase::interface())
+ select->Where(Equals<SettingsList::appId>(m_widgetHandle));
- SettginsList::Select::RowList rows = select->GetRowList();
+ SettingsList::Select::RowList rows = select->GetRowList();
FOREACH(it, rows)
{
return "/usr/share/wrt-engine/wrt_widget_default_icon.png";
}
-/**
- * WRT downloaded widgets
- */
-// KW inline const char* GetDownloadedWidgetPath()
-// KW {
-// KW return "/opt/share/widget/test-widgets";
-// KW }
-
inline const char* GetSignatureXmlSchema()
{
//TODO please rename, this filename is not descriptive enough
WidgetRegisterInfo() :
type(APP_TYPE_UNKNOWN),
signatureType(SIGNATURE_TYPE_UNIDENTIFIED),
- isFactoryWidget(0),
isTestWidget(0),
configInfo(),
pType(PKG_TYPE_UNKNOWN)
std::string shareHref;
std::string baseFolder;
WidgetSignatureType signatureType;
- int isFactoryWidget;
int isTestWidget;
ConfigParserData configInfo;
LocalizationData localizationData;
std::string getShareHref() const;
/**
- * This method checks whether specified widget is a factory widget.
- *
- * @param[in] widgetHandle widget's app id
- * @return true if yes, false if no.
- */
- bool isFactory() const;
-
- /**
* This method get widget installed time
*
* @return time_t : return widget's install time
*/
std::string getBaseFolder() const;
- /**
- * This method gets deletable property of widget.
- *
- * @return true: can be deleted; false: can not be deleted
- * @exception WRT_CONF_ERR_GCONF_FAILURE
- * @exception WRT_CONF_ERR_EMDB_FAILURE
- * @exception WRT_CONF_ERR_EMDB_NO_RECORD
- */
- bool isDeletable() const;
-
/* This method gets the parameter list for resource.
*/
ResourceAttributeList getResourceAttribute(
COLUMN(option_state, INT, DEFAULT 0)
COLUMN(share_href, VARCHAR(256), DEFAULT '')
COLUMN(signature_type, INT, DEFAULT 0)
- COLUMN(factory_widget, INT, DEFAULT 0)
COLUMN(updated, INT, DEFAULT 0)
COLUMN(update_policy, INT, DEFAULT 0)
COLUMN_NOT_NULL(test_widget, INT, CHECK(test_widget between 0 and 1) DEFAULT 0)
COLUMN(next_update_time, BIGINT,)
CREATE_TABLE_END()
-CREATE_TABLE(SettginsList)
+CREATE_TABLE(SettingsList)
COLUMN_NOT_NULL(appId, INT,)
COLUMN_NOT_NULL(settingName, TEXT, )
COLUMN_NOT_NULL(settingValue, TEXT, )