Revision ade6513a src/market/MarketPlaceApp.cc

View differences:

src/market/MarketPlaceApp.cc
99 99
    type = IMAGE;
100 100

  
101 101
    //Known attributes
102
    //ORIGIN
102
    //ORIGIN_ID
103 103
    //DESCRIPTION
104 104
    //APPTEMPLATE64
105 105
    //PUBLISHER
106 106
    //VERSION
107
    erase_template_attribute("ORIGIN", origin);
108

  
109
    if (origin.empty())
107
    if (!get_template_attribute("ORIGIN_ID", origin_id))
110 108
    {
111 109
        goto error_origin;
112 110
    }
113 111

  
112
    remove_template_attribute("ORIGIN_ID");
113

  
114 114
    get_template_attribute("DESCRIPTION", description);
115 115

  
116 116
    get_template_attribute("APPTEMPLATE64", apptemplate64);
......
136 136
    return insert_replace(db, false, error_str);
137 137

  
138 138
error_origin:
139
    error_str = "Missing ORIGIN for the MARKETPLACEAPP";
139
    error_str = "Missing ORIGIN_ID for the MARKETPLACEAPP";
140 140
    NebulaLog::log("MKP", Log::ERROR, error_str);
141 141
    return -1;
142 142
}
......
241 241
			"<GNAME>"          << gname         << "</GNAME>" <<
242 242
			"<DATE>"           << date          << "</DATE>" <<
243 243
			"<NAME>"           << name          << "</NAME>" <<
244
            "<ORIGIN>"         << origin        << "</ORIGIN>" <<
244
            "<ORIGIN_ID>"      << origin_id     << "</ORIGIN_ID>" <<
245 245
            "<SOURCE>"         << source        << "</SOURCE>" <<
246 246
            "<CHECKSUM>"       << checksum      << "</CHECKSUM>" <<
247 247
            "<SIZE>"           << size_mb       << "</SIZE>" <<
......
283 283
    rc += xpath(gname,        "/MARKETPLACEAPP/GNAME", "not_found");
284 284
    rc += xpath(name,         "/MARKETPLACEAPP/NAME", "not_found");
285 285
    rc += xpath(date,         "/MARKETPLACEAPP/DATE", -1);
286
    rc += xpath(source,       "/MARKETPLACEAPP/SOURCE","not_found");
287
    rc += xpath(origin,       "/MARKETPLACEAPP/ORIGIN","not_found");
286
    rc += xpath(source,       "/MARKETPLACEAPP/SOURCE", "not_found");
287
    rc += xpath(origin_id,    "/MARKETPLACEAPP/ORIGIN_ID", -1);
288 288
    rc += xpath(istate,       "/MARKETPLACEAPP/STATE", -1);
289 289
    rc += xpath(itype,        "/MARKETPLACEAPP/TYPE",  -1);
290 290
    rc += xpath(description,  "/MARKETPLACEAPP/DESCRIPTION", "not_found");

Also available in: Unified diff