× Requests and support related to jBackend.

Creating jbackend services to access joomla 2.5

  • breyer
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #2860 by breyer
We have installed jbackend for joomla 2.5. There doesn't seem to be much documentation on the internet with examples/demos of creating articles in joomla then exposing that content with jbackend.

We are building a native app that will talk to joomla 2.5 via jbackend. Can someone point me to some useful examples that walk through how to make the content of a joomla article accessible via a jbackend restful service? We want to have a url we can test in postman that will return the article contents. Not very familiar with joomla so a thorough example would be great!

Any help would be greatly appreciated.

Thanks in advance...

D

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #2862 by admin
Really?
The complete jBackend documentation is available here (including API for each module):

www.selfget.com/documentation/jbackend-joomla30.html

There is also a demo app with source available here:

SOURCE:
www.selfget.com/downloads/file/32-jbackapp-10.html

APK:
www.selfget.com/downloads/file/33-jbackapp-apk-10.html

And the description of how is made is available here:

www.selfget.com/newsblog/41-how-to-create-a-simple-mobile-app-with-jbackend-and-phonegap.html

Could you, please, tell me what is missing? I'm trying to provide the most complete documentation for jBackend (but always assuming that jBackend is used by experts to integrate Joomla with external systems).

Thanks,
Luigi

Please Log in or Create an account to join the conversation.

  • breyer
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 months ago #2969 by breyer
Thanks for replying Luigi. Based on your documentation I was able to figure out how to set up the Joomla server and create the url to retrieve data. I can see the data response via postman.

The issue I'm having now is accessing the data remotely (cross domains). To work around this issue I created a php file on the server where the Joomla site resides. However, when I try this url (www.momspumphere.com/j3x/mph_restful_mobile_aboutus2.php) in postman i get this response:

{
"status": "ko",
"error_code": "REQ_MNS",
"error_description": "Module not specified"
}


Here is the simple php code:

<?php
header("Content-Type:application/json");



// Feed URL
$feed_url = "www.momspumphere.com/j3x/rest/get/content/articles/44";

// Read the feed
$handle = fopen($feed_url, "r");
$feed = '';
while (!feof($handle)) {
$feed .= fread($handle, 1024);
}
fclose($handle);
$json_response=json_encode($feed);

echo $json_response
?>


However when I use the jbackend url I get a properly formed json reponse:

www.momspumphere.com/j3x/rest/get/content/articles/44

{
"status": "ok",
"id": "44",
"title": "About Moms Pump Here Mobile",
"alias": "about-moms-pump-here-mobile",
"content": "<p>Moms Pump Here is the first service to use smartphones to help moms easily locate places to breast pump or breastfeed on demand in privacy. &nbsp;Our mobile site and smartphone app allow moms to find, rate, and share safe places to express breast milk. We answer the question,<a href=\"places/list/all/\" title=\"View all places where you can breast pump\"><strong>&nbsp;can I pump here?</strong></a>&nbsp;</p>\r\n<p><strong>Quick Fact:</strong>&nbsp;Over 4 million babies are born a year in the US and 75% of those moms breastfeed and breast pump for up to 2 years. So at any given time we're servicing about 8 million moms. Childbirth, breast pumping, and breastfeeding is never-ending so our demographic is huge and our service never ends.</p>\r\n<p>We have a network of places, and moms like you, who have pumped away from home and rated their pumping spots so we all can learn the safe, comfortable places to make milk for our little ones when we can’t be with them.</p>\r\n<p><span style=\"line-height: 1.3em;\">Are you planning a day trip and aren’t sure which rest stops have the private bathrooms to allow you to pump cleanly and discretely?</span></p>\r\n<p>Are you a bridesmaid in your kid sister’s wedding and want to know if her catering hall has a big enough suite for the bride and YOUR boobs? Which hotels have in-room refrigerators with freezer compartments? Moms Pump Here can help answer these questions that you won’t find being asked anywhere else – and they’re answered by moms like you!</p>\r\n<p>Kim and I aren't just work from home moms, we were diehard breast pumpers too. Breast pumping moms don't always have the luxury to pump whenever or whereever they want.&nbsp;Moms Pump Here solves this problem by connecting moms to the closest breast pumping rooms on demand. At the touch of&nbsp;your web enabled ipad or smartphone, we connect you to our network of public or private breast pumping spots usig GPS and cellular triangulation location (yeah big words). Basically we have a smart finder that delivers pumping spots right to your location's smartphone screen. Don't worry no one knows where you're pumping when you checkin, only those you choose to let know. Learn more about&nbsp;<a href=\"index.php?option=com_content&amp;view=article&amp;id=31&amp;Itemid=355\"><strong>how it works</strong></a>&nbsp;and your&nbsp;<a href=\"index.php?option=com_content&amp;view=article&amp;id=28&amp;Itemid=180\"><strong>Safety and Privacy</strong></a>&nbsp;with Moms Pump Here.&nbsp;</p>\r\n<p>Our community of Moms, Sponsors, and Channel Partners mutually benefit from one another.&nbsp;<strong><a href=\"index.php?option=com_content&amp;view=article&amp;id=34:benefits-rewards-and-partners&amp;catid=7:articles&amp;Itemid=397\" title=\"How to become a sponsor or channel partner with Moms Pump Here\">Click here</a></strong>&nbsp;to see the benefits of becoming a sponsor or channel partner with Moms Pump Here.</p>",
"images": {
"image_intro": "www.momspumphere.com/j3x/",
"float_intro": "",
"image_intro_alt": "",
"image_intro_caption": "",
"image_fulltext": "www.momspumphere.com/j3x/",
"float_fulltext": "",
"image_fulltext_alt": "",
"image_fulltext_caption": ""
},
"metadesc": "",
"metakey": "",
"metadata": {
"robots": null,
"author": null,
"rights": null,
"xreference": null
},
"language": "*",
"category_title": "Articles",
"author": "MomsPumpHere",
"published_date": "2014-08-01 20:25:55",
"state": "1"
}


This will be a phonegap application. I have full access to the joomla server if I need to make any server changes. Any help would be appreciated.

Thanks,
D

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #2970 by admin
Hi,
try to replace:
$feed_url = "www.momspumphere.com/j3x/rest/get/content/articles/44";

With:
$feed_url = "http://www.momspumphere.com/j3x/rest/get/content/articles/44";

Kind regards,
Luigi
The following user(s) said Thank You: breyer

Please Log in or Create an account to join the conversation.

  • breyer
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 months ago #3016 by breyer
HI Luigi,

I am pulling in data from content nicely now, thanks to you. I appreciate your help.

Another question:

The client has FAQs and other content stored in some components. Like jplaces and FAQ FTW. I have been reading the forum and it seems that might require a custom jbackend plugin. Is this correct? Or is there an easier way to pull this information out.

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #3021 by admin
Hi,
you could create a custom plugin or add a custom view to the extension itself, there are a lot of extensions that have different version of the same view (e.g. K2 with json views). The main difference is related to the way you can manage the request parameters (e.g if you need REST requests then a custom jBackend plugin is better), and if you need other jBackend features like multiple end-point with access control.

Please Log in or Create an account to join the conversation.

Time to create page: 0.136 seconds