ConfigParserData::AppControlInfo& m_data;
};
+ struct DispositionParser : public ElementParser
+ {
+ public:
+ virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+ const DPL::String& /*name*/)
+ {
+ return &IgnoringParser::Create;
+ }
+
+ virtual void Accept(const Text& /*text*/)
+ {}
+
+ virtual void Accept(const Element& /*element*/)
+ {}
+
+ virtual void Accept(const XmlAttribute& attribute)
+ {
+ if (attribute.name == L"name") {
+ if (attribute.value.size() > 0) {
+ m_value = attribute.value;
+ NormalizeString(m_value);
+ }
+ }
+ }
+
+ virtual void Verify()
+ {
+ if (m_value.IsNull() || *m_value == L"") {
+ return;
+ }
+
+ DPL::String windowString(L"window");
+ DPL::String inlineString(L"inline");
+
+ if (*m_value == L"window") {
+ m_data.m_disposition =
+ ConfigParserData::AppControlInfo::Disposition::WINDOW;
+ } else if (*m_value == L"inline") {
+ m_data.m_disposition =
+ ConfigParserData::AppControlInfo::Disposition::INLINE;
+ } else {
+ LogDebug("Ignoring dispostion value " <<
+ DPL::ToUTF8String(*m_value));
+ }
+ }
+
+ DispositionParser(ConfigParserData::AppControlInfo& data) :
+ ElementParser(),
+ m_properNamespace(false),
+ m_data(data)
+ {}
+
+ private:
+ bool m_properNamespace;
+ DPL::OptionalString m_value;
+ ConfigParserData::AppControlInfo& m_data;
+ };
+
virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
const DPL::String& name)
{
return DPL::MakeDelegate(this, &AppControlParser::OnUriElement);
} else if (name == L"mime") {
return DPL::MakeDelegate(this, &AppControlParser::OnMimeElement);
+ } else if (name == L"disposition") {
+ return DPL::MakeDelegate(this,
+ &AppControlParser::OnDispositionElement);
} else {
return &IgnoringParser::Create; //ignore unknown according to w3c
}
return ElementParserPtr(new MimeParser(m_appControl));
}
+ ElementParserPtr OnDispositionElement()
+ {
+ return ElementParserPtr(new DispositionParser(m_appControl));
+ }
+
AppControlParser(ConfigParserData& data) :
ElementParser(),
m_data(data),
* limitations under the License.
*/
/*
- * @file task_certify.cpp
+ * @file task_certify_level.cpp
* @author Jihoon Chung (jihoon.chung@samgsung.com)
* @version
* @brief
void TaskCertifyLevel::stepCertifyLevel()
{
LogDebug("================ Step: <<Certify Level>> ENTER ===============");
- if (!checkSettingLevel(getCertifyLevel())) {
+ if (!checkConfigurationLevel(getCertifyLevel())) {
ThrowMsg(Exceptions::PrivilegeLevelViolation, "setting level violate");
}
LogDebug("================ Step: <<Certify Level>> DONE ================");
return level;
}
+bool TaskCertifyLevel::checkConfigurationLevel(
+ TaskCertifyLevel::Level level)
+{
+ if (!checkSettingLevel(level)) {
+ return false;
+ }
+ if (!checkAppcontrolHasDisposition(level)) {
+ return false;
+ }
+ return true;
+}
+
bool TaskCertifyLevel::checkSettingLevel(
TaskCertifyLevel::Level level)
{
return true;
}
+bool TaskCertifyLevel::checkAppcontrolHasDisposition(
+ TaskCertifyLevel::Level level)
+{
+ // tizen:disposition -> platform
+ FOREACH(it, m_contextData.widgetConfig.configInfo.appControlList) {
+ if (ConfigParserData::AppControlInfo::Disposition::UNDEFINE !=
+ it->m_disposition)
+ {
+ if (level < Level::PLATFORM) {
+ LogError("\"tizen:disposition\" needs \"" <<
+ enumToString(Level::PLATFORM) <<
+ "\" level");
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
std::string TaskCertifyLevel::enumToString(
TaskCertifyLevel::Level level)
{
void getSignatureFiles(const std::string& path,
ValidationCore::SignatureFileInfoSet& file);
Level getCertifyLevel();
+ bool checkConfigurationLevel(Level level);
bool checkSettingLevel(Level level);
+ bool checkAppcontrolHasDisposition(Level level);
std::string enumToString(Level level);
Level certTypeToLevel(ValidationCore::CertStoreId::Type type);
LogDebug("ProcessAppControlInfo");
using namespace WrtDB;
- WrtDB::ConfigParserData::AppControlInfo::Disposition disposition =
- WrtDB::ConfigParserData::AppControlInfo::Disposition::WINDOW;
- FOREACH(it, m_installContext.widgetConfig.configInfo.settingsList) {
- if (!strcmp(DPL::ToUTF8String(it->m_name).c_str(), "nodisplay") &&
- !strcmp(DPL::ToUTF8String(it->m_value).c_str(), "true"))
+ // In case of dispostion is inline, set the seperate execute
+ int index = 1;
+ // 0 index is reserved by default execute
+ FOREACH(it, m_installContext.widgetConfig.configInfo.appControlList) {
+ if (it->m_disposition ==
+ ConfigParserData::AppControlInfo::Disposition::INLINE)
{
- disposition =
- WrtDB::ConfigParserData::AppControlInfo::Disposition::INLINE;
- }
- }
-
- std::map<std::string, int> srcMap;
- int index = 0;
- // index = 0 is reserved for start file
- FOREACH(startFileIt, m_installContext.widgetConfig.localizationData.startFiles)
- {
- if (!startFileIt->propertiesForLocales.empty()) {
- std::string src = DPL::ToUTF8String(startFileIt->path);
- if (srcMap.find(src) == srcMap.end()) {
- LogDebug("Insert [" << src << "," << index << "]");
- srcMap.insert(std::pair<std::string, int>(src, index++));
- }
- }
- }
-
- FOREACH(appControlIt, m_installContext.widgetConfig.configInfo.appControlList)
- {
- appControlIt->m_disposition = disposition;
- std::string src = DPL::ToUTF8String(appControlIt->m_src);
- LogDebug("src = [" << src << "]");
- std::map<std::string, int>::iterator findIt = srcMap.find(src);
- if (findIt == srcMap.end()) {
- LogDebug("Insert [" << src << "," << index << "]");
- srcMap.insert(std::pair<std::string, int>(src, index));
- appControlIt->m_index = index++;
+ it->m_index = index++;
} else {
- LogDebug("Exist [" << src << "," << findIt->second << "]");
- appControlIt->m_index = findIt->second;
+ it->m_index = 0;
}
}
}