[opencms-dev] Displaying External Data in OpenCms 9
Michael Emmerich
m.emmerich at alkacon.com
Tue Nov 19 09:25:46 CET 2013
Hello,
there are several ways how you can work with external contents, for
selecting the best way to do it, it often depends how often the external
content is updated.
Some examples what we did in projects so far:
Example 1:
Some product data should be displayed, (we are talking about 200-300
products). This data is provided by an xml import which is imported into
OpenCms and for each product one xmlcontent is created.
Advantages: You can then use the default OpenCms methods to create the
output pages. You can use the OpenCms permissions system do
automatically add permissions to the products during the imports (which
was required). You only need access to the external data source during
the import.
Disadvantages: Such a solution is not so good if you have to update the
data very often (several times a day) or if you have a lot of products.
Example 2:
Direct access to an external data source. Some product data should be
directly displayed from an external database. So we made a direct access
to this data in our functional elements, by accessing the database via
JDBC in a java bean.
Advantages: Works good with a lot of data entries, easy to implement
Disadvantage: You need permanent access to the external database, you
cannot use the "normal" access methods to your content in your jsps
Example 3:
For a customer, we needed direct access to an external database (show
lists of those data), but the external database should be edited form
within OpenCms. The structure of this data was in a quite similar way as
it is in an xmlcontent with nested elements.
So we implemented a special content in OpenCms which automatically
creates dummy xmlcontent files which are automatically filled with data
fomr the database. You then could edit this content with the normal
editor in OpenCms (as this is a xmlcontent at that time). When saving,
the data form the xmlcontent is stored in the database. Access to the
data for display was like in Example 2.
Advantages: Works good with a lot of data entries, easy to use editing
of this data for content managers.
Disadvantage: Was quite complicated to implement.
So you see, there is no real "best" way how to do this, it always
depends on your use case. Mostly, I would think that either Example 1 or
2 would be those use cases that are most common.
Kind regards,
Michael
Am 18.11.2013 22:06, schrieb dayv2005:
> I was wondering what people were doing to display external data from another
> database in OpenCms 9?
>
> We have a web vehicle internal application that is managed by our software.
> We want to integrate it into OpenCms. I wrote the schemas, formatters, list
> and detail page. But this only works if you create the instance in OpenCms.
>
> How are people connecting to external databases?
>
> I realize I could use dynamic function and use the jsp sql library and read
> the data like that. This is probably the best way to handle this but you
> lose so much functionality of OpenCms handling it this way.
>
> I read some older papers on using TOS but that seemed to be more of a one
> time import and continue managing the objects from the website.
>
> Is there anyway to import in real time from an external database into the
> given resource type?
>
> Manly wanted to start this discussion to see what others have done and
> what's doable and the best case usage.
>
> Thanks
>
>
>
> --
> View this message in context: http://opencms.996256.n3.nabble.com/Displaying-External-Data-in-OpenCms-9-tp23811.html
> Sent from the OpenCMS mailing list archive at Nabble.com.
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
> --
> Alkacon Software GmbH - The OpenCms Experts
> Michael Emmerich
>
>
> http://www.alkacon.com
> http://www.opencms.org
>
>
> Geschäftsführer: Alexander Kandzior, Amtsgericht Köln, HRB 54613
More information about the opencms-dev
mailing list