[opencms-dev] access opencms documents from java application

Jason Trump jason.trump at brulant.com
Wed Oct 19 20:03:55 CEST 2005


Hello,

You don't want to use OpenCmsCore directly.  Use the class 'OpenCms' to
get an instance of CmsObject, and then use the methods on CmsObject.
You can do most things with CmsObject that you want to do with
OpenCmsCore.  Like this:

	import org.opencms.main.OpenCms;
	import org.opencms.file.CmsObject;

	...

	CmsObject session = null;
	session = OpenCms.initCmsObject("Guest");
	session.loginUser(userName, password);

I assume from the nature of your question that you are executing this
code in an application that can call the OpenCms API directly, as I
don't think there are any EJBs / JMX beans / Web Services that you can
call from another application.

-jason

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-
> bounces at opencms.org] On Behalf Of Christof Dallermassl
> Sent: Wednesday, October 19, 2005 12:59 PM
> To: The OpenCms mailing list
> Subject: [opencms-dev] access opencms documents from java application
> 
> Hi!
> 
> Is it possible to access the content of the opencms from a "normal"
java
> application (and not from inside the webapplication)?
> 
> I have a client application that retrieves information from a server
that
> should be put into some existing opencms xml contents.
> 
> I thought that I'd do it like the CmsShell does, but found, that the
> OpenCmsCore.getInstance() method is not accessible from outside.
> 
> Is there a "clean" solution to this problem (except putting my
application
> class into the same packge as OpenCmsCore)?
> 
> regards
> Christof Dallermassl
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please
visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list