Mobile Integration

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
User avatar
n0on3
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Aug 01, 2007 5:30 am
Contact:

Mobile Integration

Post by n0on3 » Wed Aug 01, 2007 5:51 am

Hi guys,
I'm here to ask somthing that probably i should solve with a deep reading of the whole forum, but it will be great if any of you can help me to avoid searching for some days in order to find few explaination lines :D

I'm going to write down a piece of software for Mobile Web Toolkit platform ( I'll spend few words going on ) to enable it to serve CMSs contents for mobile devices. This means that this stuff will interact with CMSs, processing requestes for the mobile version, detecting the device proprieties, then grab the contents from the cms ( or its db ? ), and process em in order to be served on the mobile platform. Lots of this system component are ready, so i'm about to write the layer between this platform and the Joomla! cms ..

Now the question is : What's the best way to grab contents from Joomla ?

ianmac suggested on irc to append the tmpl=component to requests in order to get a clear version of the content requested, and it's a really good tip, but i'd like to evaluate the alternatives...
Even because mobile versions shall be complete with menu and widgets that will display other components you can normally see in the standard version in [Right,Left,Top, and so on] positions ...

So ...
-Can i use Joomla! APIs outside the Joomla! contest ? if yes, how to do it ? ( I'n not really familiar with APIs , i checked out the docs but couldn't get lots .. )
-How are the components for each page mapped ? Is there a way to get them outside that contest (I mean, without query the db directly, but maybe using some function of some class that retrive em) ?

Cause if this all won't be possible, it will force me to duplicate the access data with a component embedded in joomla ( e.g. a plugin tha serve those stuffs to mwt ) and the real mobile processing platform outside :-/ it won't be really agile...

( Well the previous version of MWT was a plug-in-only version to embed in CMSs, but now the devs decided to have a stand-alone platform that mau interact with different CMSs, or even may not, serving mobile pages from its own .. )


Thanks since now for answers guys =)
Regards,
n0on3
*-n0on3

User avatar
Hackwar
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3788
Joined: Fri Sep 16, 2005 8:41 pm
Location: NRW - Germany
Contact:

Re: Mobile Integration

Post by Hackwar » Thu Aug 02, 2007 11:28 am

Why not write a template optimized for mobile applications for Joomla?
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.

User avatar
n0on3
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Aug 01, 2007 5:30 am
Contact:

Re: Mobile Integration

Post by n0on3 » Thu Aug 02, 2007 5:55 pm

Hackwar wrote: Why not write a template optimized for mobile applications for Joomla?
Because it is not only a template matter.
Even contents and modules theirself need to be managed.
For example : image must be rescaled, tables must be re-defined, and think to mobile browsers supports less few tags instead of all the one used in standard version. And more : each served page must be optimized for the device that requested it.
MWT is meant to provide all this stuffs..
Device asks for mobile version, get detected by the user agent so mwt can query a db to get the device and browser's proprieties,
then looks for cached version for that device and that browsers, and then, if it's not found it gets from the cms all the stuffs it's supposed to serve in that page, divide them giving each to a widget that will parse it, readacting everything, and finally present the page.
So it's not that simple as a template i think...
Or better : the template solution may work, but it will be not scalable, not efficient, not device-driven, and not reliable =)
*-n0on3

User avatar
Hackwar
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3788
Joined: Fri Sep 16, 2005 8:41 pm
Location: NRW - Germany
Contact:

Re: Mobile Integration

Post by Hackwar » Thu Aug 02, 2007 6:24 pm

I still think, that you could do most of that with a template. Use template overrides, integrate your logic into the template file, etc. Otherwise you could really start from scratch and create a completely new application which just accesses the Joomla db. But then you would have to look at each component/module seperately how they access the data and what they do with it.
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.

User avatar
n0on3
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Aug 01, 2007 5:30 am
Contact:

Re: Mobile Integration

Post by n0on3 » Thu Aug 02, 2007 6:29 pm

Hackwar wrote: I still think, that you could do most of that with a template. Use template overrides, integrate your logic into the template file, etc. Otherwise you could really start from scratch and create a completely new application which just accesses the Joomla db. But then you would have to look at each component/module seperately how they access the data and what they do with it.
Well the second choice is quite what we're doing, since lots of component of mwt are ready to be used and i'm just working around the joomla integration, maybe with a plugin..

About templates, I think i should look deeper in your suggestion, so can you please link me something to go deep in template building and logic implementation embedded into templates ?
*-n0on3

User avatar
Hackwar
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3788
Joined: Fri Sep 16, 2005 8:41 pm
Location: NRW - Germany
Contact:

Re: Mobile Integration

Post by Hackwar » Thu Aug 02, 2007 6:40 pm

For starters, you can use every and any kind of php code in the template file itself. And for template overrides, look at the beez template, which uses those allready very extensively. See in your Joomla! folder /templates/beez/html/*
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.

User avatar
n0on3
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Aug 01, 2007 5:30 am
Contact:

Re: Mobile Integration

Post by n0on3 » Thu Aug 02, 2007 8:27 pm

Hackwar wrote: For starters, you can use every and any kind of php code in the template file itself. And for template overrides, look at the beez template, which uses those allready very extensively. See in your Joomla! folder /templates/beez/html/*
Thx for the tip, tomorrow i'll look at it ( here it's night and i've been too much on the keyboard today ^^ ).
Is there any other docs about template building that may be useful ?
*-n0on3

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: Mobile Integration

Post by AmyStephen » Sun Aug 05, 2007 2:45 am

The guy to watch is sa247 in the mobile space with Joomla!. He's already exploring v 1.5. Take a look at some of his posts to see what he's doing.

Amy :)

User avatar
n0on3
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Aug 01, 2007 5:30 am
Contact:

Re: Mobile Integration

Post by n0on3 » Sun Aug 05, 2007 8:28 am

AmyStephen wrote: The guy to watch is sa247 in the mobile space with Joomla!. He's already exploring v 1.5. Take a look at some of his posts to see what he's doing.

Amy :)
Thx amy, i checked out sa247 last posts, but it didn't help too much since now, no going looking resources on [dot]mobi..

Anyway i don't want to go deep inside joomla code, i just like to use APIs or whatever they're called, the joomla functions that provide contents. Coming from java, this is my first experience with php so i'm quite not-friendly with the structure, maybe that's why it don't make lots of sense to me.

This is what i got ( correct me if wrong ) :
-the framework layer provide a set of base objects and function to manage stuffs in the cms.
-the "core" layer provide functions, based ont he framework layer stuffs, that extract the contents and provide them to some sort of template engine.
-the template engine, that gets contents, modules output data or whatever else, and by running the choosen template code displays all these stuffs.

Now what i want is to have my scripts working between the "core" and the "template" layers..  ( ok, maybe inside the template layers, this is what hackwar suggested i think but i need to know more about to decide wich way fits better )
So i need to know what can i use to extract contents and modules data, ora i'll have to do something from scratch querying the database.

The final result that i'd like to have from this ( giving an uri params ) is a structure ( object or array, doesn't matter in php it seems ) that contains some defined objects for very common modules ( such as menu, polls, most ranked, latest, and so on ) , contents, and other modules output ( this is being discussing cause custom modules may have quite anything inside but this is not the main poiny ).

SCRIPT(URI) should interact with the database/APIs/core and output this structure ..

I wrote something just to test, since now basically i can do a GET request for the content by append the tmpl=component parameter to the uri, than get the menus by JMenu::getIstance()->_items , and having a list of what should be displayed on each request by querying the database on itemid.. ( i actually used the 3 ways possible : proxy, using APIs, and query-db )

Now the question is : is there a simple / documented way to grab these things by the APIs ( i mean, framework or even "core" layer ) ?

I'm asking this because doing all the same way will be more clear and do it througout the API should provide a sort of stability since ( i hope ) APIs interface should not change in future.. ( of course i'm talking about 1.5, if someone didn't get yet )

Also if i didn't get completely wrong about joomla structure, the template layer should relay on something ... it THAT thing i think i would like to use ...
*-n0on3

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: Mobile Integration

Post by AmyStephen » Sun Aug 05, 2007 4:20 pm

n0on3 wrote: Now what i want is to have my scripts working between the "core" and the "template" layers..  ( ok, maybe inside the template layers, this is what hackwar suggested i think but i need to know more about to decide wich way fits better )
So i need to know what can i use to extract contents and modules data, ora i'll have to do something from scratch querying the database.
Ah! Gotcha!  ;) Yes, go with Hackwar's recommendation to look at Beez. That's your ticket. Here's the Beez Forum and read a.radtke's post What is BEEZ?. This tutorial might be helpful - it's on the template overrides used to build BEEZ, but it doesn't explain BEEZ specifically. Just how to build something like BEEZ.

You sound like someone who will be very successful with this new framework. Can't wait to see what you do!
Amy :)

rickey29
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Jul 16, 2007 12:51 pm

Re: Mobile Integration

Post by rickey29 » Wed Aug 08, 2007 6:55 am

I have been doing the same work for phpBB in the past three years.  Let me share my experience.

First of all, mobile solution is necessary.  The usage of wireless data applications rise dramatically these years and will continue in the next several years: http://www.mobilemessaging2.com/ .  The users of every popular CMS request mobile solution.  You can find these topics in their communities.  The character of mobile device are: (1) limited bandwidth, (2) small screen and (3) un-powerful CPU.  For example, mobile users want the content of Joomla index.php can be separated into several pages -- one newsflash per screen.  The template solution does not work in this case.

Secondly, the effort of mobile solution, the Mobile Web Toolkit platform as we discuss here, not mobile template solution, is ten times more than template solution, or more.  At the end, you will find, as Hackwar said and I have been doing: "you really start from scratch and create a completely new application which just accesses the Joomla db."  If Joomla is your only target, you should not do in this way.  For me, I choice this alternative because I want develop more CMS mobile solution.  You know, one template solution can not be reuse in other CMS, but DB query and PHP are almost the same.

The third point is, for your question "is there a simple / documented way to grab these things by the APIs", my understanding is there is not.  Please DO correct me if I am wrong, I will very appreciate because Joomla is my next target.  In almost Joomla's php files, you can find: (1) sql query operation, (2) if/else/while/case -- logical judgement and (3) "echo" and template parameter.  If Joomla provided the APIs you want, these three things should be separated into different files, at least different functions.  But they are not right now.  I do not criticize Joomla at all, every CMS do the same way.

Finally, I suggest you use "Frameworks" strategy during development, as I did for phpBB mobile:
  - Grady Booch (in Object Solutions): "A framework represents a collection of classes that provide a set of services for a particular domain; a framework exports a number of individual classes and mechanisms which clients can use or adapt."
  - Don Roberts and Ralph Johnson ("Evolving Frameworks" in Pattern Languages of Program Design 3): "Frameworks are reusable designs of all or part of a software system described by a set of abstract classes and the way instances of those classes collaborate."
This is actually the Mobile Web Toolkit you want.
  - Frameworks often follow the Hollywood Principle: "Don't call us, we'll call you."
Do not change Joomla code as more as possible.  For one scenario, from database to end display, or vice versa, you should debug Joomla's code, reuse the functions which do not have "echo", rewrite the functions you have to eliminate something, like template/picture ...

Any comments are welcome.

Good luck to you.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: Mobile Integration

Post by AmyStephen » Wed Aug 08, 2007 3:09 pm

Rickey -

Have you looked at Joomla! v 1.5? Or, just v 1.0.x?

Thanks for your comments.
Amy :)

rickey29
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Jul 16, 2007 12:51 pm

Re: Mobile Integration

Post by rickey29 » Wed Aug 08, 2007 3:33 pm

AmyStephen wrote: Rickey -

Have you looked at Joomla! v 1.5? Or, just v 1.0.x?

Thanks for your comments.
Amy :)
Actually, just v 1.5.  Any suggestion to me?

User avatar
n0on3
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Aug 01, 2007 5:30 am
Contact:

Re: Mobile Integration

Post by n0on3 » Wed Aug 08, 2007 3:56 pm

rickey29 wrote: (cut)
Thanks for your post guy, you well explained lots of things i'm experiencing these days.
Anyway, i agree with you about the framework strategy, that's the way i'm already trying to follow.
Well, MWT is not meant to work only with Joomla, it works with wordpress yet ( as a plugin, it's a beta-test version, you can see how it looks like at http://www.beeweeb.com ) and also drupal integration is being developed..
This makes the template way not really useful in this case, even if i hope that some functions for the template building may be useful for my purpose as well.
Even instead of doing query directly the db i'll better have http requests, cause db schema may change easily, bit i also think use APIs will be much better if their interface is ( or will be ) stable.. but as you said, i cannot get much from them at this time.


(EDIT: Confusing post, bad grammatic :P was in a hurry sry )
Last edited by n0on3 on Wed Aug 08, 2007 5:59 pm, edited 1 time in total.
*-n0on3


Locked

Return to “Joomla! 1.5 Coding”