Multi Purpose external XML Mapper

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
nhaack

Multi Purpose external XML Mapper

Post by nhaack »

Hello all together,

I'd like to discuss some ideas about a project I'm thinking about with you.

Recently I have released a few plug-ins that consume API data via XML and I realized, that it's basically always the same: Formulate a get request, receive XML, map XML to smarty for output. The only real difference is the mapping and the get parameters. So instead of maintaining several plug-ins, I thought of some generic external XML handler module.

The workflow would be something like this:

1) create new api request pattern (store credentials, configure caching, state parameters and values...) in admin panel
2) receive XML for the first time, analyse and map data field to desired smarty output variables in admin panel
3) goto template dialog which lists available data fields to help creating a display template
4) place module call into actual page template

As far as I remember, the RSS went a bit into that direction...

Now my questions are the following:

Question 1)
- I would continue to store the XML data as regular files in the cache folder. I thought about supporting DB storage for some history kind of thing. However, in case a lot of different or large XML files or a high item frequency are consumed, it could quickly pile up a lot of data . What do you think? Drop the feature?

I am also thinking of creating something like a common settings thing. So that e.g. you do not have to state credentials for different patterns with the same service. It would also be nice to be able to assign the single feeds to a specific Back-End or Front-End user (including Users being able to state own XML credentials... e.g. import their personal youtube favourites or such things).

Question 2)
- What would be the best way to allow a module to assign data to any kind of user? I understand that allowing front end users to make their own import settings makes the whole thing a lot more complicated. That's probably more something for a later stage.

I am currently at the stage of gathering ideas and thinking about the way how I can solve the single problems. I am digging myself into the wiki about creating a module and browsing the forum. It would be my very first module :) I am not a real programmer and never really learned proper programming. I already wrote a few plug-ins that seem to work nicely - so I'm confident :).

Question 3)
- From your experience, do you see heavy problems (security, architecture, database) arising where I might not see them or which are typical errors beginners in module programming tend to make?

It would take me some time but I think I could do it... the only question: am I reinventing the wheel? So probably the biggest questions of all:

Question 4)
- Is such a mechanism/idea probably already possible in some form? CMSMS is sometimes so straight forward and flexible that I do not see the simple answer.

Do you understand what what I tried to explain? I'm interested to hear about your thoughts on this project idea.

Best
Nils
Post Reply

Return to “Developers Discussion”