Remove author email and href validation 55/61755/1 accepted/tizen/common/20160311.050243 accepted/tizen/common/20160311.201626 accepted/tizen/ivi/20160311.043357 accepted/tizen/ivi/20160311.061056 accepted/tizen/mobile/20160311.043308 accepted/tizen/mobile/20160311.060943 accepted/tizen/tv/20160311.043323 accepted/tizen/tv/20160311.061008 accepted/tizen/wearable/20160311.043345 accepted/tizen/wearable/20160311.061028 submit/tizen/20160310.114904 submit/tizen/20160311.024723
authorTomasz Iwanek <t.iwanek@samsung.com>
Thu, 10 Mar 2016 09:12:42 +0000 (10:12 +0100)
committerTomasz Iwanek <t.iwanek@samsung.com>
Thu, 10 Mar 2016 09:29:33 +0000 (10:29 +0100)
We cannot translate authors email and href into valid one for platform
manifest if they don't exist, therefore for now validation of author is
removed as it is causing trouble when updating wgt package with author
but without email or href.

Change-Id: I70af08ec498fb1234b9d3dea058baae964b82ce3

src/tpk_manifest_handlers/author_handler.cc
src/tpk_manifest_handlers/author_handler.h

index 61b1a28be1cf1f332d1fc865e9161be83bbe1ad7..f0e6fe3239023fca92f7054c9f961a6e9ac0089d 100644 (file)
@@ -58,45 +58,10 @@ bool AuthorHandler::Parse(
 
   ParseAuthorAndStore(*items[0], author.get());
 
-  // TODO(t.iwanek): don't skip it when preloaded apps will be fixed.
-  if (author->name().empty())
-    return true;
-
   *output = std::static_pointer_cast<parser::ManifestData>(author);
   return true;
 }
 
-bool AuthorHandler::Validate(
-    const parser::ManifestData& data,
-    const parser::ManifestDataMap& /*handlers_output*/,
-    std::string* error) const {
-  const AuthorInfo& author =
-      static_cast<const AuthorInfo&>(data);
-
-  if (author.email().empty()) {
-    *error = "The email child element of author element is obligatory";
-    return false;
-  }
-
-  // TODO(t.iwanek): validate email address when preloaded apps will be fixed.
-
-
-  const std::string& href = author.href();
-  if (href.empty()) {
-    *error =
-        "The href child element of author element is obligatory";
-    return false;
-  }
-
-  const std::string& name = author.name();
-  if (name.empty()) {
-    *error =
-        "The name child element of author element is obligatory";
-    return false;
-  }
-  return true;
-}
-
 std::string AuthorInfo::Key() {
   return kAuthorKey;
 }
index 6980cf3f16fb524289fa96bf8b348570eba01e17..827f7438489ae808998d894ca95aa533131c92f7 100644 (file)
@@ -83,10 +83,6 @@ class AuthorHandler : public parser::ManifestHandler {
       const parser::Manifest& manifest,
       std::shared_ptr<parser::ManifestData>* output,
       std::string* error) override;
-  bool Validate(
-      const parser::ManifestData& data,
-      const parser::ManifestDataMap& handlers_output,
-      std::string* error) const override;
   std::string Key() const override;
 };