[opencms-dev] Displaying External Data in OpenCms 9

Paul-Inge Flakstad flakstad at npolar.no
Tue Nov 19 16:02:50 CET 2013


Hi,

Note that site search may become an issue when your content no longer resides completely within OpenCms. Just thought I'd add that, since Michael was mentioning pros and cons here.

Real world illustration: employee pages 
When browsing our employee pages, you'd probably never know that the names, e-mail addresses and phone numbers reside in an external database. But consider the OpenCms site search: it can't "see" or index any of that external content. Consequently, no employee page will appear in the SERP when searching for an employee by name.

So you see, site search can quickly become an issue. It has for us, and we haven't yet decided how to handle it. (You can circumvent the problem by using things like Google Custom Search, but it's not for everyone. Ideally, you probably want the external content integrated in your OpenCms index, or the equivalent.)

Also, if you're interested, I can say that we tend to access external content via web services. That means we use JSPs to fetch content (typically JSON) over HTTP and produce an output. Sometimes the JSP creates the entire web page by itself, sometimes it's designed only to fill a small slot on a page. Sometimes we mix external content with "local" OpenCms content. (We do this, for example, for employees and projects: key info is stored externally, and "web-specific" info is stored in OpenCms.)

Cheers,
Paul


-----Original Message-----
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Michael Emmerich
Sent: 19. november 2013 09:26
To: The OpenCms mailing list
Subject: Re: [opencms-dev] Displaying External Data in OpenCms 9

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-OpenCm
> s-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
_______________________________________________
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






More information about the opencms-dev mailing list