Hi,
I'm using the GoogleBaseData JavaClient API to upload my products to a
google base feed.
I can't insert my custom attributs like spring deflection or others
via the api.
Can anyone help me. A litte cutout of my code:
private static Pair<GoogleBaseEntry, Integer> creatGoogleBaseEntry
(int index)
throws UnsupportedEncodingException {
GoogleBaseEntry entry = new GoogleBaseEntry();
entry.setTitle(TextConstruct
.plainText("TEST" + index));
entry.setId("345-033828");
entry.addLink(itemLink);
entry
.addHtmlLink(
"http://www.tolstych.de/p/345-033828/test.html?
PageID=FG-252-033828",
null, null);
entry.setContent(TextConstruct.plainText("TEST 1234 TEST" +
index));
entry.setUpdated(DateTime.now());
float price = (float) 35.41 + index;
entry.getGoogleBaseAttributes().addFloatAttribute("preis",
price);
entry.getGoogleBaseAttributes().addTextAttribute("id",
"345-033828" + index);
entry.getGoogleBaseAttributes().addTextAttribute("marke",
"Plantronics");
entry.getGoogleBaseAttributes().addTextAttribute("mpn",
"78094-05");
entry.getGoogleBaseAttributes().addTextAttribute("ean",
"5033588012345" + index);
entry.getGoogleBaseAttributes().addTextAttribute
("zahlungsmethode", "Lastschrift");
entry.getGoogleBaseAttributes().addTextAttribute("preisart",
"fixed");
entry.getGoogleBaseAttributes().addTextAttribute("zustand",
"neu");
entry.getGoogleBaseAttributes().addTextAttribute("produktart",
"neu");
entry.getGoogleBaseAttributes().addTextAttribute("Farbe",
"schwarz");
entry.getGoogleBaseAttributes().setItemType("Produkte");
entry.getGoogleBaseAttributes().addTextAttribute
("item_language", "de");
entry.getGoogleBaseAttributes().addTextAttribute
("target_country", "DE");
entry.getGoogleBaseAttributes().addTextAttribute("spring
deflection", "15 mm");
entry.getGoogleBaseAttributes().addTextAttribute("key",
"value");
entry.getGoogleBaseAttributes().addBooleanAttribute
("no_api_syndication", true);
entry.getGoogleBaseAttributes().addShipping(new Shipping(null,
null, price, null));
Integer byteLength = entry.toString().getBytes
("UTF-8").length;
return Pair.make(entry, byteLength);
}
--
You received this message because you are subscribed to the Google Groups
"Google Base Data API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-base-data-api?hl=en.