[opencms-dev] Challange! External Program access to OpenCMS I nstance...
Stephan Hartmann
beffe at beffe.de
Sat Nov 15 23:04:01 CET 2003
look at com.opencms.core.CmsShell (constructor) for the CmsObject and
CmsShellCommands for the rest. Maybe you can create an instance of the
CmsShellCommands and use its methods.
----- Original Message -----
From: "Ralf Bierig" <ambiesense at gmx.de>
To: <opencms-dev at opencms.org>
Sent: Saturday, November 15, 2003 10:46 PM
Subject: Re: [opencms-dev] Challange! External Program access to OpenCMS I
nstance...
> Yes, I actually only need to store and read user and usergroup
information.
> Sound logical...
>
> I have some more questions in the meantime.
>
> How can I insert a User in OpenCMS when I have the OpenCms object. In
> particular, do I need the CmsObject for that ? How can I create the
CmsObject
> object from the OpenCms object? Maybe you can provide some code?
>
> Kind Regards with new hope :-),
> Ralf
>
> > What you could do is to make a server that offers commands like the
> > CmsShell
> > which you call over RMI and the server operates on the OpenCms.
> >
> > ----- Original Message -----
> > From: "Ralf Bierig" <ambiesense at gmx.de>
> > To: <opencms-dev at opencms.org>
> > Sent: Saturday, November 15, 2003 10:28 PM
> > Subject: Re: [opencms-dev] Challange! External Program access to OpenCMS
I
> > nstance...
> >
> >
> > > Hi Stephan,
> > >
> > > yes, I got a NotSerializableException. It seems that I cannot use RMI
> > > interface to connect to OpenCMS. It seems that OpenCMS is not made for
> > any
> > other
> > > access then web.
> > >
> > > It is quite disappointing...
> > >
> > > Ralf
> > >
> > > > Hi Ralf,
> > > >
> > > > it won't help to mark the OpenCms class as serializable. All members
> > of
> > > > OpenCms and the members' members have to be serializable as well (or
> > > > transient, but thats surely not what you want).
> > > >
> > > > Bye,
> > > > Stephan
> > > >
> > > > ----- Original Message -----
> > > > From: "Ralf Bierig" <ambiesense at gmx.de>
> > > > To: <opencms-dev at opencms.org>
> > > > Sent: Saturday, November 15, 2003 9:43 PM
> > > > Subject: RE: [opencms-dev] Challange! External Program access to
> > OpenCMS
> > I
> > > > nstance...
> > > >
> > > >
> > > > > Hello,
> > > > >
> > > > > I followed your tip and programmed a RMI Server, which is
initiateed
> > by
> > > > the
> > > > > OpenCmsHTTPServlet class when the opencms servlet it called. The
> > server
> > > > is
> > > > > up
> > > > > and running.
> > > > >
> > > > > However when I access the server and want to get the OpenCms
object
> > I
> > > > get
> > > > > the following message:
> > > > >
> > > > > System RemoteExceptionjava.rmi.UnmarshalException: error
> > unmarshalling
> > > > > return; nested exception is:
> > > > > java.io.WriteAbortedException: writing aborted;
> > > > > java.io.NotSerializableException: com.opencms.core.OpenCms
> > > > >
> > > > > The OpenCms object does indeed not implement the Serializable
> > interface.
> > > > My
> > > > > question now is, when I modify the OpenCms class file and add that
> > it
> > > > > implements Serializable will it work then and will it work
properly?
> > > > >
> > > > > Is the problem another one and how can I fix it. I am soooo close
> > and
> > > > there
> > > > > should be a way...
> > > > >
> > > > >
> > > > > Cheers,
> > > > > Ralf
> > > > >
> > > > > > You will need RMI to call the wrapper class if you start another
> > > > > > application
> > > > > > with "java myApplication" because then you start a new JVM,
> > different
> > > > than
> > > > > > the JVM which is started by your web application and in which
your
> > > > wrapper
> > > > > > class was initialized.
> > > > > > w
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: ambiesense at gmx.de [mailto:ambiesense at gmx.de]
> > > > > > Sent: mercredi 12 novembre 2003 14:32
> > > > > > To: opencms-dev at opencms.org
> > > > > > Subject: RE: [opencms-dev] Challange! External Program access to
> > > > OpenCMS
> > > > > > I nstance...
> > > > > >
> > > > > >
> > > > > > Hello Wouter,
> > > > > >
> > > > > > can another Java program (started indepentendly with "java
> > > > myApplication")
> > > > > > call the static Wrapper embedded as part of the OpenCMS server?
If
> > > > this
> > > > is
> > > > > > possible, then I am fine.
> > > > > >
> > > > > > I think this is more a Java question then a OpenCMS question. I
> > > > appologise
> > > > > > if I might have confused you.
> > > > > >
> > > > > > Ralf
> > > > > >
> > > > > > > I don't understand exactly what you are trying to say. Why
don't
> > you
> > > > > > > consider the Wrapper class as being part of the OpenCms server
?
> > > > It's
> > > > > > > the
> > > > > > > client which afterwards calls the wrapper class in order to
get
> > > > acces
> > > > > > > to the
> > > > > > > singleton OpenCms.
> > > > > > >
> > > > > > > Concerning the other question , as long you keep the singleton
> > > > "single"
> > > > > > > there no problem that different threads or clients (possibly
> > through
> > > > > > > rmi)
> > > > > > > make use of the singleton. They all use a reference to the
same
> > > > object.
> > > > > > >
> > > > > > > wouter
> > > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Ralf Bierig [mailto:ambiesense at gmx.de]
> > > > > > > Sent: mercredi 12 novembre 2003 11:22
> > > > > > > To: opencms-dev at opencms.org
> > > > > > > Subject: Re: [opencms-dev] Challange! External Program access
to
> > > > > > > OpenCMS
> > > > > > > Instance...
> > > > > > >
> > > > > > >
> > > > > > > Hi Matt and Wouter,
> > > > > > >
> > > > > > > the method is more direct. However using this appraoch would
> > change
> > > > the
> > > > > > > workflow. My initial idea was that OpenCMS with data and
> > everything
> > > > is
> > > > > > > like
> > > > > > > a
> > > > > > > service and I have a client, who can access this without
> > > > > > > HTTP/SOAP/Webservice
> > > > > > > but API(local)/RMI or Sockets.
> > > > > > >
> > > > > > > Wouter's method is good but change the workflow in the way
that
> > the
> > > > > > > OpenCMS
> > > > > > > server is acutally calling my application (the wrapper). This
> > would
> > > > > > > turn
> > > > > > > OpenCMS into a pseudo client and the application which was
> > supposed
> > > > to
> > > > > > > be a
> > > > > > > client into a pseudo server. The application would be invoked
by
> > > > > > > starting
> > > > > > > OpenCMS.
> > > > > > > I would like it however the other way round. Would this be
> > possible
> > > > to
> > > > > > > start
> > > > > > > a RMI server/Socket Server with this extra line and let the
> > > > appliation
> > > > > > > client connect to that, get the OpenCms Object and work with
the
> > > > > > > singleton
> > > > > > > OpenCms
> > > > > > > instance.
> > > > > > >
> > > > > > > If more then one client applications would connect like that,
> > would
> > > > > > > this way
> > > > > > > of accessing still ensure that each client sees the same
(files,
> > > > users,
> > > > > > > etc)?
> > > > > > >
> > > > > > > Another question based on the fact that I would accept the
fact
> > that
> > > > > > > OpenCMS
> > > > > > > starts the application. Could this line:
> > > > > > >
> > > > > > > // added by myself
> > > > > > > opencms.addons.CmsWrapper.setOpenCms(m_opencms);
> > > > > > > // end added by myself
> > > > > > >
> > > > > > > be extended to start a number of appliations (Wrappers)
> > > > simultaniously
> > > > > > > (i.e.
> > > > > > > as Threads). Would this still ensure that each application
would
> > see
> > > > > > > the
> > > > > > > same OpenCMS instance with the same changes made by others
(i.e.
> > > > users,
> > > > > > > files,
> > > > > > > tasks...)?
> > > > > > >
> > > > > > > Cheers,
> > > > > > > Ralf
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Ralf Bierig wrote:
> > > > > > > > > Hello Matt,
> > > > > > > > >
> > > > > > > > > thank you again for you competent answer.
> > > > > > > > >
> > > > > > > > > Do you agree that this solution should not have side
> > effects,
> > if
> > > > > > > the
> > > > > > > > only
> > > > > > > > > user would be this Java programm and there would NO OTHER
> > user
> > > > > > > logged in
> > > > > > > > via
> > > > > > > > > HTTP/Tomcat?
> > > > > > > >
> > > > > > > > I think that should be okay. wouter's method is probably
> > better,
> > > > > > > though
> > > > > > > > -- esp. if you were planning on using RMI anyway.
> > > > > > > >
> > > > > > > > Matt
> > > > > > > >
> > > > > > > > _______________________________________________
> > > > > > > > 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
> > > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> > > > > > > Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> > > > > > >
> > > > > > > Jetzt kostenlos anmelden unter http://www.gmx.net
> > > > > > >
> > > > > > > +++ GMX - die erste Adresse für Mail, Message, More! +++
> > > > > > >
> > > > > > > _______________________________________________
> > > > > > > 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
> > > > > > > _______________________________________________
> > > > > > > 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
> > > > > > >
> > > > > >
> > > > > > --
> > > > > > NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> > > > > > Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> > > > > >
> > > > > > Jetzt kostenlos anmelden unter http://www.gmx.net
> > > > > >
> > > > > > +++ GMX - die erste Adresse für Mail, Message, More! +++
> > > > > >
> > > > > > _______________________________________________
> > > > > > 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
> > > > > > _______________________________________________
> > > > > > 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
> > > > > >
> > > > >
> > > > > --
> > > > > NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> > > > > Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> > > > >
> > > > > Jetzt kostenlos anmelden unter http://www.gmx.net
> > > > >
> > > > > +++ GMX - die erste Adresse für Mail, Message, More! +++
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> > > > > Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> > > > >
> > > > > Jetzt kostenlos anmelden unter http://www.gmx.net
> > > > >
> > > > > +++ GMX - die erste Adresse für Mail, Message, More! +++
> > > > >
> > > > > _______________________________________________
> > > > > 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
> > > > >
> > > >
> > > > _______________________________________________
> > > > 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
> > > >
> > >
> > > --
> > > NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> > > Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> > >
> > > Jetzt kostenlos anmelden unter http://www.gmx.net
> > >
> > > +++ GMX - die erste Adresse für Mail, Message, More! +++
> > >
> > > _______________________________________________
> > > 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
> >
> > _______________________________________________
> > 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
> >
>
> --
> NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
>
> Jetzt kostenlos anmelden unter http://www.gmx.net
>
> +++ GMX - die erste Adresse für Mail, Message, More! +++
>
> _______________________________________________
> 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