<xs:simpleType name="applicationIdType">
<xs:restriction base="xs:string">
- <xs:pattern value="[0-9a-zA-Z]{10}[.][0-9a-zA-Z]{1,}"/>
+ <xs:pattern value="[0-9a-zA-Z]{10}[.][0-9a-zA-Z]{1,52}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="appWidgetIdType">
<xs:restriction base="xs:string">
- <xs:pattern value="[0-9a-zA-Z]{10}.[0-9a-zA-Z]{1,}.[0-9a-zA-Z]{1,}"/>
+ <xs:pattern value="[0-9a-zA-Z]{10}.[0-9a-zA-Z]{1,52}.[0-9a-zA-Z]{1,}"/>
</xs:restriction>
</xs:simpleType>
<xs:attribute ref="xml:lang"/>
</xs:complexType>
</xs:element>
+
+ <xs:element name="metadata">
+ <xs:complexType>
+ <xs:attribute name="key" type="xs:string" use="required"/>
+ <xs:attribute name="value" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
</xs:schema>
<icon src="icon.png" />
<!-- tizen application element -->
- <tizen:application id="GfeI4eyhBG.Test" package="GfeI4eyhBG" required_version="2.1"/>
+ <tizen:application id="GfeI4eyhBG.1" package="GfeI4eyhBG" required_version="2.1"/>
<!-- tizen setting element -->
<tizen:setting screen-orientation="landscape" context-menu="disable" background-support="enable" encryption="enable" install-location="internal-only"/>
<!-- tizen allow-navigation element -->
<tizen:allow-navigation>test.com</tizen:allow-navigation>
+
+ <!-- tizen metadata -->
+ <tizen:metadata key="key_1" value="value_1"/>
</widget>
<xs:element ref="tizen:allow-navigation" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
<xs:element ref="tizen:app-widget" minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
<xs:element ref="tizen:account" minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
+ <xs:element ref="tizen:metadata" minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
</xs:choice>\r
<xs:attribute ref="xml:lang"/>\r
<xs:attribute name="id" type="xs:anyURI"/>\r
-#git:framework/web/wrt-installer wrt-installer_0.1.56
+#git:framework/web/wrt-installer wrt-installer_0.1.57
Name: wrt-installer
Summary: Installer for tizen Webruntime
-Version: 0.1.56
+Version: 0.1.57
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
bool m_multiSupport;
};
+class MetadataParser : public ElementParser
+{
+ public:
+ virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+ const DPL::String& /*name*/)
+ {
+ return &IgnoringParser::Create;
+ }
+
+ virtual void Accept(const XmlAttribute& attribute)
+ {
+ if (m_properNamespace) {
+ if (attribute.name == L"key") {
+ m_key = attribute.value;
+ } else if (attribute.name == L"value") {
+ m_value = attribute.value;
+ }
+ }
+ }
+
+ virtual void Accept(const Element& element)
+ {
+ if (element.ns == ConfigurationNamespace::TizenWebAppNamespaceName) {
+ m_properNamespace = true;
+ }
+ }
+
+ virtual void Accept(const Text& /*text*/)
+ {
+ ThrowMsg(Exception::ParseError, "param element must be empty");
+ }
+
+ virtual void Verify()
+ {
+ if (m_key.IsNull()) {
+ LogWarning("metadata element must have key attribute");
+ return;
+ }
+ NormalizeString(m_key);
+ NormalizeString(m_value);
+ ConfigParserData::Metadata metaData(*m_key, *m_value);
+ FOREACH(it, m_data.metadataList) {
+ if (!DPL::StringCompare(it->key, *m_key)) {
+ LogError("Key isn't unique");
+ return;
+ }
+ }
+ m_data.metadataList.push_back(metaData);
+ }
+
+ MetadataParser(ConfigParserData& data) :
+ ElementParser(),
+ m_data(data),
+ m_properNamespace(false)
+ {}
+
+ private:
+ DPL::OptionalString m_key;
+ DPL::OptionalString m_value;
+ ConfigParserData& m_data;
+ bool m_properNamespace;
+};
+
ElementParser::ActionFunc WidgetParser::GetElementParser(
const DPL::String& /*ns*/,
const DPL::String&
DPL::MakeDelegate(this, &WidgetParser::OnAllowNavigationElement);
#endif
m_map[L"account"] = DPL::MakeDelegate(this, &WidgetParser::OnAccountElement);
+ m_map[L"metadata"] = DPL::MakeDelegate(this, &WidgetParser::OnMetadataElement);
}
ElementParserPtr WidgetParser::OnNameElement()
return ElementParserPtr(new AccountParser(m_data));
}
+ElementParserPtr WidgetParser::OnMetadataElement()
+{
+ return ElementParserPtr(new MetadataParser(m_data));
+}
+
void WidgetParser::Accept(const Element& element)
{
if (element.ns != ConfigurationNamespace::W3CWidgetNamespaceName &&
ElementParserPtr OnCspReportOnlyElement();
ElementParserPtr OnAllowNavigationElement();
ElementParserPtr OnAccountElement();
+ ElementParserPtr OnMetadataElement();
virtual ActionFunc GetElementParser(const DPL::String& ns,
const DPL::String& name);
writeAttribute(writer, "name", *c);
endElement(writer);
}
+ FOREACH(m, this->metadata) {
+ m->serialize(writer);
+ }
endElement(writer);
}
}
endElement(writer);
}
+
+void Metadata::serialize(xmlTextWriterPtr writer)
+{
+ startElement(writer, "metadata");
+ writeAttribute(writer, "key", this->key);
+ writeAttribute(writer, "value", this->value);
+ endElement(writer);
+}
} //namespace Jobs
} //namespace WidgetInstall
typedef DPL::String OperationType, MimeType, UriType, TypeType, PackageType;
typedef DPL::OptionalString InstallLocationType, CategoriesType;
typedef DPL::String AppCategoryType;
+typedef DPL::String KeyType, ValueType;
/**
* xmllib2 wrappers
typedef Privilege PrivilegeType;
+class Metadata
+{
+ public:
+ Metadata(KeyType k, ValueType v) :
+ key(k),
+ value(v)
+ {}
+ void serialize(xmlTextWriterPtr writer);
+
+ private:
+ KeyType key;
+ ValueType value;
+};
+
+typedef Metadata MetadataType;
+
+
/**
* @brief ime-application element
*/
{
this->appCategory.push_back(x);
}
+ void addMetadata(const MetadataType &m)
+ {
+ this->metadata.push_back(m);
+ }
void serialize(xmlTextWriterPtr writer);
private:
std::list<IconType> icon;
std::list<AppControlType> appControl;
std::list<AppCategoryType> appCategory;
+ std::list<MetadataType> metadata;
};
typedef UiApplication UiApplicationType;
setWidgetManifest(manifest);
setWidgetOtherInfo(uiApp);
setAppCategory(uiApp);
+ setMetadata(uiApp);
setLiveBoxInfo(manifest);
setAccount(manifest);
setPrivilege(manifest);
setWidgetIcons(uiApp);
setAppControlInfo(uiApp, *it);
setAppCategory(uiApp);
+ setMetadata(uiApp);
manifest.addUiApplication(uiApp);
}
#else
setWidgetOtherInfo(uiApp);
setAppControlsInfo(uiApp);
setAppCategory(uiApp);
+ setMetadata(uiApp);
setLiveBoxInfo(manifest);
setAccount(manifest);
setPrivilege(manifest);
}
}
+void TaskManifestFile::setMetadata(UiApplication &uiApp)
+{
+ WrtDB::ConfigParserData::MetadataList metadataList =
+ m_context.widgetConfig.configInfo.metadataList;
+
+ if (metadataList.empty()) {
+ LogInfo("Web application doesn't contain metadata");
+ return;
+ }
+ FOREACH(it, metadataList) {
+ MetadataType metadataType(it->key, it->value);
+ uiApp.addMetadata(metadataType);
+ }
+}
+
void TaskManifestFile::stepAbortParseManifest()
{
LogError("[Parse Manifest] Abroting....");
void setAppControlInfo(UiApplication & uiApp,
const WrtDB::ConfigParserData::AppControlInfo & service);
void setAppCategory(UiApplication & uiApp);
+ void setMetadata(UiApplication & uiApp);
void setLiveBoxInfo(Manifest& manifest);
void setAccount(Manifest& uiApp);
void setPrivilege(Manifest& manifest);
namespace Jobs {
namespace WidgetInstall {
+namespace {
+const DPL::String PRIVILEGE_TESTAUTOMATION =
+ L"http://tizen.org/privilege/testautomation";
+const DPL::String DEVICE_CAPABILITY_TESTAUTOMATION = L"testautomation";
+}
FeatureLogic::FeatureLogic(const WrtDB::TizenAppId & tzAppid) :
m_rejected(false)
{
WidgetFeatureSet featureSet = widgetDao.getFeaturesList();
FOREACH(it, featureSet) {
LogInfo("Feature name : " << it->name);
- WrtDB::DeviceCapabilitySet dcs =
- WrtDB::GlobalDAOReadOnly::GetDeviceCapability(it->name);
+ WrtDB::DeviceCapabilitySet dcs;
+ if (!DPL::StringCompare(it->name, PRIVILEGE_TESTAUTOMATION)) {
+ // special privilege
+ // This privilege doesn't have plugin in the target
+ // only use to special behavior
+ dcs.insert(DEVICE_CAPABILITY_TESTAUTOMATION);
+ } else {
+ // normal privilege
+ dcs = WrtDB::GlobalDAOReadOnly::GetDeviceCapability(it->name);
+ }
FOREACH(devCap, dcs) {
LogInfo("--- dev cap : " << *devCap);
}