I need to do the following inside my Joget forms:-

1. To Create a new plugin which calls an external  web service that return JSON representing images . The API URL is:- http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback.

2. After that i need to pass the received JSON ( representing the images) from the new plugin to my joget form.

3.  Then using JavaScript inside the joget form, i need to loop through the JOSN and append the JSON dynamically to the <imag>.

For testing purposes I have done the whole stuff in javaScript inside a custom HTML and it worked fine as follow:-

<script type="text/javascript">
$(function() {
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",
  {
    tags: "gulmarg",
    tagmode: "any",
    format: "json"
  },
  function(data) {
    $.each(data.items, function(i,item){
      $("<img/>").attr("src", item.media.m).appendTo("#images");
      if ( i == 5 ) return false;
    });
  });
})
</script>
<div id="images"></div>

but the missing part is as follow:-

1. i need the API call which is (http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback) to be done on a plugin then to pass the returned JSON to the form. Currently i am doing the API call from the javaScript itself, which might cause security problems if the API call contains confidential info which should not be exposed.

Best Regards

  • No labels