[opencms-dev] DbAccess for a custom file type
Andy Bicksbo
schlachtzeuger at gmail.com
Thu Nov 2 11:37:06 CET 2006
Hi
I want to build a backend adminmodule, for example a newsletter module or a
Module, which synchronices users data wich another database, or a shop, or a
Module which manages a big amount of similiar websites, which should run on
one ocms instance. So these Module should has it's own datatables of course.
So there would be cases, where a good db connection is not important, for
example for the shop Module, or the newsletter Module (it only would be
beatyfuller to have the same implementation than ocms has) but i think, in
the other to cases, it is important that there's a good why to connect to
db. There's actually a possibility to get a dbpool connection with
CmsSqlManager.getConnection(String dbPoolName), but i don#t know, if it#s
good to use just a random conn out of the pool(to not slow down the whole
cms, or invoke other problems with the connection, if there's a big
aplication, which uses this way to connect), cause Ocms never uses
this without a specific CmsDbContext. They use getConnection(CmsDbConext
dbc). So my question is :
how to get this DbContext and implement the new Driver correctly to Opencms?
How would the opencms team build a new adminModule with db connection?
Would they alter the core classes?(CmsObject, CmsSecurityManager,
CmsDriverManager)?
and thx to christian for your time....
Andy
2006/11/2, Christian Steinert <christian_steinert at web.de>:
>
> Andy Bicksbo schrieb:
>
> Hi
> I think you missunderstood me. I don't want to create a new resource type,
> i want to implement some custom Objects, such as for exemple a CmsUser, or
> CmsProject,... and create an specific dbconnection, which should be in the
> same style and structure as the dbconnection of for exemple CmsUser.
>
> Dear Andy,
>
> I am not sure if I understand...
>
> Why would you implement your own type of project or a totally different
> type of users for example? Do you want to synchronize opencms with the user
> management and resource management of other systems? What would be the
> benefit for you?
>
> So the point is, that i don't know how to get an apropriate CmsDbContext
> for the method calls(which get added at SecurityManager) and how to
> implement the new Driver to CmsDriverManager, that the new Driver(implements
> the Driver interface) gets correctly initialized
>
> I see, but I am afraid that I cannot help with that part. I don't know if
> you can get connections from the opencms connection pool without modifying
> the core. But there should probably be some service where you can get
> configuration data and then use this to access the database yourself. Sadly
> I cannot suggest anything in particular, because I did not need this until
> now.
>
> Of course - no matter how you get your database connection - you should
> not interfere with tables that belong to opencms, because you cannot know
> when and how they are being updated while your processes try to accomplish
> something.
>
>
>
> Hope thats more clearly know
> An additional quastion would be, what is it good for making some major
> classes of an opensource project final?
> and not provide public access to methods?
>
> I think, some services are just too critical. They should not be called
> without very special privileges and checks. Many internal functions of any
> sophisticated system will expect a certain state in which they are called.
> If somebody from outside can easily call them without that state being
> present, then anything can happen.
> I think it's good software design to hide some implementation details and
> not make them available for direct calling. This is just a software design
> issue, not an open sorce vs closed source issue.
>
> A possibilty would be to add classes to some opencms packages, but this
> would cause loads of props at updating opencms.
>
>
> christian
>
>
>
> _______________________________________________
> 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/mailman/listinfo/opencms-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20061102/9ec0fb38/attachment.htm>
More information about the opencms-dev
mailing list