Dear Experts,
Following up with
I added image to the document type thus now the Document Type call Orang (Person) has the following fields a name (nama) and age and an image.
I used essential → Bean Writer to generate the Java files
I used essential → REST Service Setup to generate the API (generic and manual)
In the generic REST Resource I get this very nice JSON
{
"id":"a54902a6-114f-45c1-9535-032cab9ab862",
"name":"cubaorang",
"displayName":"cubaorang",
"type":"xxxxxx:OrangDT",
"locale":"document-type-locale",
"pubState":"published",
"pubwfCreationDate":"2018-11-26T13:13:57.287+08:00",
"pubwfLastModificationDate":"2018-11-26T13:57:37.254+08:00",
"pubwfPublicationDate":"2018-11-26T13:57:39.528+08:00",
"items":{
"xxxxxx:nama":"Sola",
"xxxxxx:age":48,
"xxxxxx:image":{
"type":"hippogallerypicker:imagelink",
"link":{
"type":"binary",
"url":"http://localhost:8080/site/binaries/content/gallery/xxxxxx/orang/test_image.jpg"
}
}
}
}
My intention was to hold the image URL for example:
“http://localhost:8080/site/binaries/content/gallery/xxxxxx/orang/test_image.jpg”
package org.finexus.xxxxxx.beans;
public class Orang_POJO{
public String nama;
public String age;
public String imageURL;
public Orang_POJO(Orang data) {
nama = data.getNama();
age = data.getAge();
imageURL = data.getImage.getPath(); <---- this one
}
public String getNama() {return nama;}
public void setNama(String nama) {this.nama = nama;}
public String getAge() {return age;}
public void setAge(String age) {this.age = age;}
public String getImageURL() {return imageURL;}
public void setImageURL(String age) {this.imageURL = imageURL;}
}
BUT for my java file above (refer to ← this one) it shows me only the xpath below
“content/gallery/xxxxxx/orang/test_image.jpg”
missing the entire “http://localhost:8080/site/binaries/”
I can always add the missing part to my string but that will be cheating.
How do I get the full path like the one in generic?
Regards
Sola Lee